@feedmepos/mf-report 5.25.3 → 5.25.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/{App-CnFZJmzp.js → App-DtptjhjZ.js} +61 -61
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-RUTqJF5H.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BpZRmN2X.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CcMbnaoi.js → Default.vue_vue_type_script_setup_true_lang-YD8hGEgU.js} +1 -1
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-khivJO9B.js +4939 -0
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-BY_KN_C1.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-ICdT23KP.js} +2 -2
  6. package/dist/{InsightView-DKrfAidQ.js → InsightView-D6kG8qxO.js} +4 -4
  7. package/dist/{Integration-BNW5e7Qk.js → Integration-5Zh9P4ni.js} +254 -254
  8. package/dist/{Integrations-DItxcgrC.js → Integrations-CS3GIgJs.js} +2 -2
  9. package/dist/{Layout-GLIcaoCe.js → Layout-PDHYlwIv.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-pOrfpYWl.js → MenuTab.vue_vue_type_script_setup_true_lang-BTkWCFV2.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CBAiRY5H.js → NavigationTab.vue_vue_type_script_setup_true_lang-BTEHMFrz.js} +6 -6
  12. package/dist/{OverviewView-V-17Kj3C.js → OverviewView-C8gFEyAy.js} +4 -4
  13. package/dist/{Report-Cawu6GrR.js → Report-CHb2EMt_.js} +3 -3
  14. package/dist/{ReportEditor-ChZgxHxU.js → ReportEditor-AvoIjWIX.js} +3 -3
  15. package/dist/{ReportView-Dfb_owW8.js → ReportView-BPK_UG_W.js} +6 -6
  16. package/dist/{Setting-bPYUv_iE.js → Setting-DQIQRxq2.js} +3 -3
  17. package/dist/{TileEditor-CZ_n5OKa.js → TileEditor-C3ItD9ZL.js} +1351 -1317
  18. package/dist/{TransitionFade-DCyLVIwo.js → TransitionFade-ClFH8Y2K.js} +4 -4
  19. package/dist/{app-AKUT_6m_.js → app-DS19_5wu.js} +103 -55
  20. package/dist/app.js +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/{useRestaurantPermission-251v8GZD.js → useRestaurantPermission-B5vpR4h3.js} +1 -1
  23. package/package.json +1 -1
  24. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-COXEyuoF.js +0 -4689
@@ -0,0 +1,4939 @@
1
+ import { computed as x, defineComponent as Ne, ref as P, onMounted as ct, onBeforeUnmount as lo, resolveComponent as fe, createBlock as me, openBlock as J, Transition as Oo, withCtx as ke, createElementBlock as ce, createCommentVNode as ve, createElementVNode as ee, unref as a, normalizeStyle as Te, withModifiers as Qt, toDisplayString as Ae, createVNode as de, Fragment as ze, renderList as Nt, normalizeClass as Le, watch as De, nextTick as ut, mergeModels as Ue, useModel as Oe, renderSlot as Qe, h as jt, createSlots as Eo, resolveDynamicComponent as so, toRaw as Uo, markRaw as Ko, createTextVNode as Xo, onUnmounted as io, withDirectives as Yo, vShow as qo } from "vue";
2
+ import { W as ne, i as uo, j as Go, S as At, v as Ft, k as jo, l as dn, m as co, d as Jo, q as Zo, R as bt, n as Qo } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-ICdT23KP.js";
3
+ import { i as en, a as on, u as Ln } from "./app-DS19_5wu.js";
4
+ import { d as gn } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BpZRmN2X.js";
5
+ import { storeToRefs as it, defineStore as ea } from "pinia";
6
+ import { detectLocale as fo } from "@feedmepos/mf-common";
7
+ import { C as vn } from "./chart-DDDh8zNk.js";
8
+ import { useBreakpoints as Vt, useSnackbar as Dn, components as ta } from "@feedmepos/ui-library";
9
+ import { u as dt } from "./vue-i18n-DVWuTfed.js";
10
+ import { a as ho, _ as Hn } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Af_Z54a4.js";
11
+ import { r as lt } from "./i18n-CI_sQ5d_.js";
12
+ var yn = /* @__PURE__ */ ((e) => (e.line = "LINE", e.bar = "BAR", e))(yn || {}), Je = /* @__PURE__ */ ((e) => (e.top = "TOP", e.bottom = "BOTTOM", e))(Je || {}), bn = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e))(bn || {}), Cn = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(Cn || {}), xn = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e))(xn || {}), wn = /* @__PURE__ */ ((e) => (e.right = "right", e.left = "left", e))(wn || {}), Sn = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.right = "right", e.left = "left", e.chartArea = "chartArea", e))(Sn || {}), xe = /* @__PURE__ */ ((e) => (e.series = "SERIES", e.metric = "METRIC", e.breakdown = "BREAKDOWN", e))(xe || {});
13
+ ne.Circular, ne.Table, ne.BarChart, ne.LineChart, ne.StackBarChart, ne.ClusteredStackBarChart, ne.StackLineChart, ne.Scorecard, ne.Spacer;
14
+ const na = [
15
+ {
16
+ type: ne.Circular,
17
+ showLabel: !1,
18
+ // TODO: temporarily removed show label as it has no function
19
+ showDrillDimension: !0,
20
+ showRollup: !1,
21
+ showSearchBar: !1
22
+ },
23
+ {
24
+ type: ne.Table,
25
+ showLabel: !1,
26
+ showDrillDimension: !0,
27
+ showRollup: !0,
28
+ showSearchBar: !0
29
+ },
30
+ {
31
+ type: ne.BarChart,
32
+ showLabel: !1,
33
+ // TODO: temporarily removed show label as it has no function
34
+ showDrillDimension: !0,
35
+ showRollup: !1,
36
+ showSearchBar: !1
37
+ },
38
+ {
39
+ type: ne.LineChart,
40
+ showLabel: !1,
41
+ // TODO: temporarily removed show label as it has no function
42
+ showDrillDimension: !0,
43
+ showRollup: !0,
44
+ showSearchBar: !1
45
+ },
46
+ {
47
+ type: ne.StackBarChart,
48
+ showLabel: !1,
49
+ // TODO: temporarily removed show label as it has no function
50
+ showDrillDimension: !0,
51
+ showRollup: !0,
52
+ showSearchBar: !1
53
+ },
54
+ {
55
+ type: ne.ClusteredStackBarChart,
56
+ showLabel: !1,
57
+ // TODO: temporarily removed show label as it has no function
58
+ showDrillDimension: !0,
59
+ showRollup: !0,
60
+ showSearchBar: !1
61
+ },
62
+ {
63
+ type: ne.StackLineChart,
64
+ showLabel: !1,
65
+ // TODO: temporarily removed show label as it has no function
66
+ showDrillDimension: !0,
67
+ showRollup: !0,
68
+ showSearchBar: !1
69
+ },
70
+ {
71
+ type: ne.Scorecard,
72
+ showLabel: !1,
73
+ showDrillDimension: !1,
74
+ showRollup: !1,
75
+ showSearchBar: !1
76
+ },
77
+ {
78
+ type: ne.Spacer,
79
+ showLabel: !1,
80
+ showDrillDimension: !1,
81
+ showRollup: !1,
82
+ showSearchBar: !1
83
+ }
84
+ ];
85
+ function fn(e) {
86
+ const n = [e.schemaName, e.name];
87
+ return "option" in e && e.option && n.push(e.option), "aggregation" in e && e.aggregation && n.push(e.aggregation), n.push(e.label.replace(/[^\p{L}\p{N}_]+/gu, "")), n.join("_").toLowerCase();
88
+ }
89
+ function oa(e, n) {
90
+ switch (e) {
91
+ case ne.BarChart:
92
+ case ne.LineChart:
93
+ case ne.StackBarChart:
94
+ case ne.ClusteredStackBarChart:
95
+ case ne.StackLineChart:
96
+ return Array.isArray(n == null ? void 0 : n.datasets) && Array.isArray(n == null ? void 0 : n.xAxis) && n.datasets.length > 0 && n.xAxis.length > 0;
97
+ case ne.Table:
98
+ return Array.isArray(n == null ? void 0 : n.rows) && Array.isArray(n == null ? void 0 : n.columns) && n.rows.length > 0 && n.columns.length > 0;
99
+ case ne.Circular:
100
+ return Array.isArray(n == null ? void 0 : n.datasets) && n.datasets.length > 0;
101
+ case ne.Scorecard:
102
+ return !0;
103
+ case ne.Spacer:
104
+ return !0;
105
+ }
106
+ }
107
+ const wt = [
108
+ "#36A2EB",
109
+ "#007BA7",
110
+ "#FF5D53",
111
+ "#73C8E6",
112
+ "#FCA23E",
113
+ "#F09BBE",
114
+ "#FFD232",
115
+ "#50BE9B",
116
+ "#8358D4",
117
+ "#9B5046"
118
+ ];
119
+ function mo(e) {
120
+ const n = Math.max(1, Math.floor(e));
121
+ return Array.from({ length: n }, (t, o) => {
122
+ const r = wt[o % wt.length], i = Math.floor(o / wt.length);
123
+ return i === 0 ? r : an(r, Math.min(0.18 * i, 0.72));
124
+ });
125
+ }
126
+ const Rl = wt.map(() => "solid");
127
+ function Ct({
128
+ datasetIndex: e,
129
+ label: n
130
+ }) {
131
+ const t = typeof n == "string" ? n.trim().toLowerCase().replace(/\s+/g, " ") : "";
132
+ return `${e}:${t}`;
133
+ }
134
+ function aa(e) {
135
+ return e === "dashed" || e === "dotted" ? e : "solid";
136
+ }
137
+ function ra(e, n = !1) {
138
+ if (e == null)
139
+ return n ? [5, 5] : void 0;
140
+ const t = aa(e);
141
+ if (t === "dashed")
142
+ return [8, 6];
143
+ if (t === "dotted")
144
+ return [2, 4];
145
+ }
146
+ function Ie({
147
+ datasetIndex: e,
148
+ isCompare: n,
149
+ metricCount: t,
150
+ mode: o
151
+ }) {
152
+ if (o !== xe.metric)
153
+ return e;
154
+ const r = Number.isFinite(t) ? Number(t) : 0;
155
+ return r <= 0 ? e : n ? e >= r ? (e - r) % r : Math.max(0, (e - 1 + r) % r) : e % r;
156
+ }
157
+ function po({
158
+ datasets: e,
159
+ datasetIndex: n
160
+ }) {
161
+ var i;
162
+ const t = e[n];
163
+ if (!(t != null && t.isCompare))
164
+ return n;
165
+ const o = [];
166
+ let r = -1;
167
+ if (e.forEach((s, c) => {
168
+ if (s != null && s.isCompare) {
169
+ c <= n && (r += 1);
170
+ return;
171
+ }
172
+ o.push(c);
173
+ }), r >= 0 && r < o.length)
174
+ return o[r];
175
+ for (let s = n - 1; s >= 0; s -= 1)
176
+ if (((i = e[s]) == null ? void 0 : i.isCompare) !== !0)
177
+ return s;
178
+ return n;
179
+ }
180
+ function zt({
181
+ datasets: e,
182
+ datasetIndex: n
183
+ }) {
184
+ var r;
185
+ const t = po({
186
+ datasets: e,
187
+ datasetIndex: n
188
+ });
189
+ let o = 0;
190
+ for (let i = 0; i < e.length; i += 1)
191
+ if (((r = e[i]) == null ? void 0 : r.isCompare) !== !0) {
192
+ if (i === t)
193
+ return o;
194
+ o += 1;
195
+ }
196
+ return t;
197
+ }
198
+ const la = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
199
+ function $t(e) {
200
+ if (!e)
201
+ return null;
202
+ const n = e.trim();
203
+ if (!la.test(n))
204
+ return null;
205
+ if (n.length === 4) {
206
+ const [, t, o, r] = n;
207
+ return `#${t}${t}${o}${o}${r}${r}`.toUpperCase();
208
+ }
209
+ return n.toUpperCase();
210
+ }
211
+ function sa(e) {
212
+ const n = $t(e) ?? "#000000";
213
+ return {
214
+ red: Number.parseInt(n.slice(1, 3), 16),
215
+ green: Number.parseInt(n.slice(3, 5), 16),
216
+ blue: Number.parseInt(n.slice(5, 7), 16)
217
+ };
218
+ }
219
+ function go(e) {
220
+ const n = Math.max(
221
+ wt.length,
222
+ Array.isArray(e) ? e.length : 0
223
+ ), t = mo(n);
224
+ return !Array.isArray(e) || e.length === 0 ? t : t.map((o, r) => $t(e[r]) ?? o);
225
+ }
226
+ function vo(e, n) {
227
+ const { red: t, green: o, blue: r } = sa(e);
228
+ return `rgba(${t}, ${o}, ${r}, ${n})`;
229
+ }
230
+ function an(e, n) {
231
+ const t = $t(e) ?? "#000000", o = (r) => {
232
+ const i = Number.parseInt(t.slice(r, r + 2), 16);
233
+ return Math.round(i + (255 - i) * n).toString(16).padStart(2, "0").toUpperCase();
234
+ };
235
+ return `#${o(1)}${o(3)}${o(5)}`;
236
+ }
237
+ const ia = 0.25, yo = 0.7;
238
+ function bo(e) {
239
+ return an(e, ia);
240
+ }
241
+ function Wn(e) {
242
+ return Math.min(0.55 + (e - 1) * 0.18, 0.95);
243
+ }
244
+ function Ze({
245
+ index: e,
246
+ isCompare: n,
247
+ opacity: t,
248
+ customColors: o
249
+ }) {
250
+ const r = go(o), i = r[e % r.length], s = n ? bo(i) : i;
251
+ let c = typeof t == "number" ? t : 1;
252
+ return n && (c = c * yo), vo(s, c);
253
+ }
254
+ function _t({
255
+ fallbackIndex: e,
256
+ metricCount: n
257
+ }) {
258
+ return Number.isInteger(n) && Number(n) > 0 ? Math.floor(e / Number(n)) : e;
259
+ }
260
+ function Lt({
261
+ breakdownIndex: e,
262
+ metricIndex: n,
263
+ metricCount: t,
264
+ isCompare: o,
265
+ opacity: r,
266
+ breakdownColors: i,
267
+ useSecondaryMetricShades: s,
268
+ colorMode: c,
269
+ customColors: d
270
+ }) {
271
+ const v = Number.isInteger(t) && Number(t) > 0 ? Number(t) : 1, R = Number.isInteger(n) && Number(n) >= 0 ? Number(n) : 0, W = s !== !1, H = e * v + R, y = c === "clustered" ? mo(Math.max(wt.length, e + 1)) : go(d), p = $t(i == null ? void 0 : i[e * v]) ?? y[e % y.length], k = W && R > 0 ? an(p, Wn(R)) : $t(i == null ? void 0 : i[H]) ?? (R > 0 ? an(p, Wn(R)) : p), w = o ? bo(k) : k;
272
+ let F = typeof r == "number" ? r : 1;
273
+ return o && (F = F * yo), vo(w, F);
274
+ }
275
+ function Co(e, n, t) {
276
+ if (e === "" || n === "")
277
+ return null;
278
+ let o = (d) => d == null ? void 0 : d.replace(/,/g, "");
279
+ t === "ID" && (o = (d) => d == null ? void 0 : d.replace(/\./g, "").replace(/,/g, "."));
280
+ const r = Number(o(e)), i = Number(o(n));
281
+ if (isNaN(r) || isNaN(i))
282
+ return null;
283
+ let s = 0;
284
+ i === 0 ? r === 0 ? s = 0 : s = 1 : s = (r - i) / i;
285
+ const c = ua(s);
286
+ return {
287
+ value: isNaN(s) ? "" : `${(s * 100).toFixed(0)}%`,
288
+ icon: c
289
+ };
290
+ }
291
+ function ua(e) {
292
+ return e > 0 ? {
293
+ name: "moving",
294
+ color: "#1F7735",
295
+ tailwind: "fm-color-system-success-100"
296
+ } : e < 0 ? {
297
+ name: "trending_down",
298
+ color: "#99231D",
299
+ tailwind: "fm-color-system-error-100"
300
+ } : {
301
+ name: "equal",
302
+ color: "#C7C7CC",
303
+ tailwind: "fm-color-neutral-gray-100"
304
+ };
305
+ }
306
+ function Ht(e) {
307
+ return Object.entries(e).map(([n, t]) => `${n}:${t}`).join(";");
308
+ }
309
+ function xo(e) {
310
+ return {
311
+ mode: "index",
312
+ intersect: !1,
313
+ axis: e,
314
+ backgroundColor: "rgba(255, 255, 255, 0.86)",
315
+ titleColor: "#111827",
316
+ bodyColor: "#374151",
317
+ borderColor: "rgba(255, 255, 255, 0.65)",
318
+ borderWidth: 1,
319
+ cornerRadius: 10,
320
+ padding: {
321
+ top: 8,
322
+ right: 10,
323
+ bottom: 8,
324
+ left: 10
325
+ },
326
+ boxPadding: 3,
327
+ bodySpacing: 5,
328
+ caretPadding: 6,
329
+ caretSize: 5,
330
+ titleAlign: "left",
331
+ bodyAlign: "left",
332
+ multiKeyBackground: "#ffffff",
333
+ usePointStyle: !1,
334
+ titleFont: {
335
+ size: 13,
336
+ weight: 600
337
+ },
338
+ bodyFont: {
339
+ size: 12,
340
+ weight: 500
341
+ },
342
+ titleMarginBottom: 6
343
+ };
344
+ }
345
+ const ca = Ht({
346
+ display: "block",
347
+ padding: "0",
348
+ background: "none",
349
+ border: "none",
350
+ color: "#2563eb",
351
+ "font-size": "12px",
352
+ "font-weight": "600",
353
+ cursor: "pointer",
354
+ "text-align": "left",
355
+ "pointer-events": "auto"
356
+ }), da = {
357
+ "font-size": "13px",
358
+ "font-weight": "600",
359
+ color: "#111827",
360
+ "text-align": "left",
361
+ "white-space": "normal",
362
+ "word-break": "break-word",
363
+ "overflow-wrap": "anywhere"
364
+ }, fa = Ht({
365
+ display: "flex",
366
+ "align-items": "flex-start",
367
+ "font-size": "13px",
368
+ "font-weight": "500",
369
+ color: "#1f2937",
370
+ "text-align": "left",
371
+ "line-height": "1.35",
372
+ margin: "0 0 3px",
373
+ overflow: "hidden"
374
+ }), ha = Ht({
375
+ flex: "1 1 auto",
376
+ "min-width": "0",
377
+ "white-space": "normal",
378
+ "word-break": "break-word",
379
+ "overflow-wrap": "anywhere"
380
+ }), ma = {
381
+ display: "inline-block",
382
+ width: "10px",
383
+ height: "10px",
384
+ "border-radius": "2px",
385
+ border: "1px solid rgba(17, 24, 39, 0.28)",
386
+ "box-sizing": "border-box",
387
+ "margin-right": "8px",
388
+ flex: "0 0 auto"
389
+ }, pa = {
390
+ display: "inline-block",
391
+ width: "10px",
392
+ height: "10px",
393
+ "border-radius": "9999px",
394
+ border: "1px solid rgba(255, 255, 255, 0.9)",
395
+ "box-shadow": "0 0 0 1px rgba(17, 24, 39, 0.28)",
396
+ "box-sizing": "border-box",
397
+ "margin-right": "8px",
398
+ flex: "0 0 auto"
399
+ };
400
+ function ga() {
401
+ return {
402
+ ...xo(),
403
+ mode: "nearest",
404
+ intersect: !0,
405
+ usePointStyle: !0,
406
+ callbacks: {
407
+ label: (e) => {
408
+ const n = e.label || "", t = typeof e.parsed == "number" ? e.parsed : 0, r = (Array.isArray(e.dataset.data) ? e.dataset.data : []).reduce((s, c) => s + Number(c || 0), 0), i = r > 0 ? (t / r * 100).toFixed(1) : "0.0";
409
+ return `${n}: ${t.toLocaleString()} (${i}%)`;
410
+ }
411
+ }
412
+ };
413
+ }
414
+ const va = "rgba(0, 0, 0, 0.3)";
415
+ function On(e) {
416
+ if (typeof document > "u" || typeof window > "u")
417
+ return;
418
+ const n = String((e == null ? void 0 : e.id) ?? "");
419
+ if (!n)
420
+ return;
421
+ const t = document.querySelector(
422
+ `#comparison-tooltip-${n}`
423
+ );
424
+ t && (t.__onViewportChange && (window.removeEventListener("scroll", t.__onViewportChange, !0), window.removeEventListener("resize", t.__onViewportChange)), t.remove());
425
+ }
426
+ function hn(e, n, t, o) {
427
+ const { left: r, right: i, top: s, bottom: c } = t;
428
+ e.save(), e.beginPath(), e.lineWidth = 1, e.strokeStyle = va, e.setLineDash([5, 5]), n ? (e.moveTo(r, o), e.lineTo(i, o)) : (e.moveTo(o, s), e.lineTo(o, c)), e.stroke(), e.restore();
429
+ }
430
+ function ya(e, n) {
431
+ if (typeof document > "u")
432
+ return;
433
+ const t = String((e == null ? void 0 : e.id) ?? "");
434
+ if (!t)
435
+ return;
436
+ const o = document.querySelector(
437
+ `#comparison-tooltip-${t}`
438
+ );
439
+ if (!o || o.style.opacity !== "1")
440
+ return;
441
+ const r = Number(n ? o.dataset.caretY : o.dataset.caretX);
442
+ return Number.isFinite(r) ? r : void 0;
443
+ }
444
+ function ba(e, n, t) {
445
+ var p;
446
+ if (!t)
447
+ return;
448
+ const o = ((p = e.options) == null ? void 0 : p.indexAxis) === "y", r = e.tooltip, i = (r == null ? void 0 : r.getActiveElements()) ?? [];
449
+ if (i.length === 0) {
450
+ const k = ya(e, o);
451
+ k !== void 0 && hn(e.ctx, o, e.chartArea, k);
452
+ return;
453
+ }
454
+ const s = e.scales.x, c = e.scales.y;
455
+ if (!s || !c)
456
+ return;
457
+ const d = i[0];
458
+ if (!d)
459
+ return;
460
+ if (n === "bar") {
461
+ const w = (o ? c : s).getPixelForValue(d.index);
462
+ hn(e.ctx, o, e.chartArea, w);
463
+ return;
464
+ }
465
+ if (!d.element)
466
+ return;
467
+ const v = d.element, R = o ? c : s, W = o ? v.y : v.x, H = R.getPixelForValue(d.index), y = W ?? H;
468
+ hn(e.ctx, o, e.chartArea, y);
469
+ }
470
+ function Wt(e) {
471
+ let n = !1, t = !1;
472
+ return {
473
+ id: "crosshair",
474
+ afterDatasetsDraw: (o) => {
475
+ ba(o, e, t);
476
+ },
477
+ afterEvent: (o, r) => {
478
+ t = r.inChartArea === !0;
479
+ },
480
+ beforeTooltipDraw: (o) => {
481
+ var i;
482
+ const r = o.ctx;
483
+ (((i = o.tooltip) == null ? void 0 : i.opacity) ?? 0) > 0 && (r.save(), r.shadowColor = "rgba(17, 24, 39, 0.14)", r.shadowBlur = 12, r.shadowOffsetX = 0, r.shadowOffsetY = 4, n = !0);
484
+ },
485
+ afterTooltipDraw: (o) => {
486
+ n && (o.ctx.restore(), n = !1);
487
+ },
488
+ beforeDestroy: (o) => {
489
+ On(o);
490
+ },
491
+ afterDestroy: (o) => {
492
+ On(o);
493
+ }
494
+ };
495
+ }
496
+ const Ca = Number.POSITIVE_INFINITY, _n = 2, xa = 1, wa = 0.2, Sa = 120, _a = 320, ka = 24, { breakpoints: xt } = Vt(), Pn = "report-v5:locationchange";
497
+ let En = !1;
498
+ const Ta = "report.widget.comparisonTooltip";
499
+ function Un() {
500
+ window.dispatchEvent(new Event(Pn));
501
+ }
502
+ function La() {
503
+ if (En)
504
+ return;
505
+ En = !0;
506
+ const e = window.history.pushState.bind(window.history), n = window.history.replaceState.bind(window.history);
507
+ window.history.pushState = function(...o) {
508
+ const r = e(...o);
509
+ return Un(), r;
510
+ }, window.history.replaceState = function(...o) {
511
+ const r = n(...o);
512
+ return Un(), r;
513
+ };
514
+ }
515
+ function Da(e, n) {
516
+ const t = n.split(".");
517
+ let o = e;
518
+ for (const r of t) {
519
+ if (!o || typeof o != "object" || !(r in o))
520
+ return;
521
+ o = o[r];
522
+ }
523
+ return typeof o == "string" ? o : void 0;
524
+ }
525
+ function In(e) {
526
+ const n = `${Ta}.${e}`, t = fo(), o = en[t];
527
+ return Da(o, n) ?? n;
528
+ }
529
+ function wo() {
530
+ return In("viewBreakdown");
531
+ }
532
+ function Pa() {
533
+ return In("current");
534
+ }
535
+ function Ia() {
536
+ return In("compared");
537
+ }
538
+ function Kn(e, n) {
539
+ const t = e.trim();
540
+ return t.length === 0 ? n : `${t} · ${n}`;
541
+ }
542
+ function Ma(e) {
543
+ return e == null ? null : typeof e != "string" ? [] : e.split("#").map((n) => n.trim()).filter((n) => n.length > 0);
544
+ }
545
+ function Ba(e) {
546
+ return e.dash === !0 || e.isCompare === !0;
547
+ }
548
+ function Aa(e) {
549
+ return typeof e.label == "string" ? e.label : "N/A";
550
+ }
551
+ function Ra(e, n) {
552
+ let t;
553
+ return Array.isArray(e.data) && n < e.data.length && (t = e.data[n]), typeof t != "number" ? NaN : t;
554
+ }
555
+ function Fa(e, n) {
556
+ return `${e}: ${isNaN(n) ? "" : n.toLocaleString()}`;
557
+ }
558
+ function Na(e, n) {
559
+ return e.type === "bar" ? !0 : n === "bar";
560
+ }
561
+ function $a(e, n, t) {
562
+ const o = Rt(e.borderColor, n) || Rt(e.color, n), r = Rt(e.backgroundColor, n), i = Rt(e.pointBorderColor, n), s = Rt(e.pointBackgroundColor, n);
563
+ return t ? Xn(r, s, o, i) : Xn(o, i, r, s);
564
+ }
565
+ function Va(e) {
566
+ return e.trim().toLowerCase();
567
+ }
568
+ function Rt(e, n) {
569
+ if (typeof e == "string") return e;
570
+ if (Array.isArray(e)) {
571
+ const t = e[n];
572
+ return typeof t == "string" ? t : void 0;
573
+ }
574
+ }
575
+ function za(e) {
576
+ if (typeof e != "string") return "#9ca3af";
577
+ const n = e.trim();
578
+ return /^[-#(),.%\sa-zA-Z0-9]+$/.test(n) ? n : "#9ca3af";
579
+ }
580
+ function Ha(e) {
581
+ const n = e.replace(/\s+/g, "").toLowerCase();
582
+ return !!(n === "transparent" || /^rgba\([^)]*,0(?:\.0+)?\)$/.test(n) || /^hsla\([^)]*,0(?:\.0+)?\)$/.test(n) || n === "#0000" || n === "#00000000");
583
+ }
584
+ function Xn(...e) {
585
+ for (const n of e) {
586
+ if (!n) continue;
587
+ const t = za(n);
588
+ if (!Ha(t))
589
+ return t;
590
+ }
591
+ return "#9ca3af";
592
+ }
593
+ function kn(e) {
594
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/'/g, "&#39;");
595
+ }
596
+ function Wa(e) {
597
+ const n = typeof e == "number" ? e : typeof e == "string" ? Number(e) : Number.NaN;
598
+ return Number.isFinite(n) ? Math.max(_n, Math.floor(n)) : Ca;
599
+ }
600
+ function Oa(e) {
601
+ return e <= 0 ? 320 : xt.value.xs || xt.value.sm || e <= 640 ? Math.max(160, Math.floor(e * 0.38)) : xt.value.md || e <= 900 ? Math.max(200, Math.floor(e * 0.46)) : xt.value.lg || e <= 1200 ? Math.max(240, Math.floor(e * 0.54)) : Math.max(280, Math.floor(e * 0.62));
602
+ }
603
+ function Mn(e, n) {
604
+ const t = window.innerHeight, o = Oa(t), r = n ? Math.max(120, n.clientHeight - 16) : Number.POSITIVE_INFINITY, i = Math.max(120, Math.min(o, r));
605
+ e.style.maxHeight = `${i}px`;
606
+ }
607
+ function st() {
608
+ return xt.value.xs || xt.value.sm;
609
+ }
610
+ function St(e) {
611
+ return e.dataset.pinned === "true";
612
+ }
613
+ function So(e, n) {
614
+ if (n) {
615
+ e.dataset.pinned = "true";
616
+ return;
617
+ }
618
+ delete e.dataset.pinned;
619
+ }
620
+ function _o(e) {
621
+ return {
622
+ maxTooltipItems: Wa(e == null ? void 0 : e.maxTooltipItems)
623
+ };
624
+ }
625
+ function Ea(e) {
626
+ e.__lastPhoneTapAt = void 0, e.__lastPhoneTapX = void 0, e.__lastPhoneTapY = void 0, e.__lastPhoneTapDatasetIndex = void 0, e.__lastPhoneTapDataIndex = void 0;
627
+ }
628
+ function Ua(e, n, t, o, r, i) {
629
+ e.__lastPhoneTapAt = o, e.__lastPhoneTapX = n, e.__lastPhoneTapY = t, e.__lastPhoneTapDatasetIndex = r, e.__lastPhoneTapDataIndex = i;
630
+ }
631
+ function Ka(e, n, t) {
632
+ return e.__lastPhoneTapDatasetIndex === n && e.__lastPhoneTapDataIndex === t;
633
+ }
634
+ function Xa(e, n, t, o) {
635
+ if (!Number.isFinite(e.__lastPhoneTapAt) || !Number.isFinite(e.__lastPhoneTapX) || !Number.isFinite(e.__lastPhoneTapY))
636
+ return !1;
637
+ const r = o - e.__lastPhoneTapAt;
638
+ if (r < 0 || r > _a)
639
+ return !1;
640
+ const i = n - e.__lastPhoneTapX, s = t - e.__lastPhoneTapY;
641
+ return Math.hypot(i, s) <= ka;
642
+ }
643
+ function Yn(e) {
644
+ return {
645
+ text: `${e.datasetLabel}: ${0 .toLocaleString()}`,
646
+ color: "#cbd5e1",
647
+ isBar: e.isBar,
648
+ value: "-",
649
+ datasetLabel: e.datasetLabel,
650
+ matchingKey: e.matchingKey
651
+ };
652
+ }
653
+ function Ya(e) {
654
+ return Ht({
655
+ ...da,
656
+ margin: `${e ? "8px" : "0"} 0 4px`
657
+ });
658
+ }
659
+ function qa(e, n) {
660
+ return Ht({
661
+ ...e ? ma : pa,
662
+ background: n
663
+ });
664
+ }
665
+ function Ga(e) {
666
+ return `<button type="button" data-tooltip-full-details="true" style="${ca}">${kn(e)}</button>`;
667
+ }
668
+ function ko(e, n, t, o, r, i, s, c) {
669
+ var A;
670
+ const d = (A = e[0]) == null ? void 0 : A.label, v = Ma(d), W = !!(v != null && v[1]) ? Kn((v == null ? void 0 : v[0]) ?? "", Pa()) : (v == null ? void 0 : v[0]) ?? "", H = v != null && v[1] ? Kn(v[1], Ia()) : void 0, y = [], p = [], k = /* @__PURE__ */ new Set();
671
+ i.forEach((u, I) => {
672
+ if (k.has(I))
673
+ return;
674
+ const M = u ?? {};
675
+ if (M.isSpacer === !0)
676
+ return;
677
+ const U = Aa(M), G = Ra(M, s), j = Na(M, c), Y = {
678
+ text: Fa(U, G),
679
+ color: $a(M, s, j),
680
+ isBar: j,
681
+ value: G,
682
+ datasetLabel: U,
683
+ matchingKey: Va(U)
684
+ };
685
+ if (H && Ba(M)) {
686
+ p.push(Y);
687
+ return;
688
+ }
689
+ y.push(Y);
690
+ });
691
+ const w = y.slice(0, o), F = /* @__PURE__ */ new Map();
692
+ p.forEach((u) => {
693
+ const I = F.get(u.matchingKey);
694
+ if (!I) {
695
+ F.set(u.matchingKey, [u]);
696
+ return;
697
+ }
698
+ I.push(u);
699
+ });
700
+ const g = H ? w.map((u) => {
701
+ const I = F.get(u.matchingKey);
702
+ return !I || I.length === 0 ? Yn(u) : I.shift() ?? Yn(u);
703
+ }) : [], S = y.length > w.length || p.length > g.length, B = (u, I = !1) => `<div style="${Ya(I)}">${kn(u)}</div>`, D = (u) => {
704
+ const I = qa(u.isBar, u.color);
705
+ return `<div style="${fa}"><span style="${I}"></span><span style="${ha}">${kn(u.text)}</span></div>`;
706
+ };
707
+ let f = "";
708
+ W.length > 0 && (f += B(W)), f += w.map((u) => D(u)).join(""), H && g.length > 0 && (f += B(H, f.length > 0), f += g.map((u) => D(u)).join("")), r && S && (f += Ga(t));
709
+ const L = [
710
+ {
711
+ title: W,
712
+ values: y
713
+ },
714
+ {
715
+ title: H ?? "",
716
+ values: p
717
+ }
718
+ ].filter((u) => u.values.length > 0);
719
+ return {
720
+ html: f,
721
+ detailsPayload: { sections: L },
722
+ hasCollapsedValues: S
723
+ };
724
+ }
725
+ function qn(e) {
726
+ return e.scrollHeight - e.clientHeight > xa;
727
+ }
728
+ function Jt(e, n, t, o, r, i, s, c, d) {
729
+ const v = ko(
730
+ n,
731
+ t,
732
+ o,
733
+ r,
734
+ i,
735
+ s,
736
+ c,
737
+ d
738
+ );
739
+ return e.innerHTML !== v.html && (e.innerHTML = v.html, ur(e)), v;
740
+ }
741
+ function ja(e, n, t, o, r, i, s, c, d) {
742
+ if (Number.isFinite(r))
743
+ return {
744
+ markup: Jt(
745
+ e,
746
+ n,
747
+ t,
748
+ o,
749
+ r,
750
+ i,
751
+ s,
752
+ c,
753
+ d
754
+ ),
755
+ maxTooltipItems: r
756
+ };
757
+ const v = Math.max(_n, n.length);
758
+ let R = v, W = Jt(
759
+ e,
760
+ n,
761
+ t,
762
+ o,
763
+ v,
764
+ i,
765
+ s,
766
+ c,
767
+ d
768
+ );
769
+ if (!qn(e))
770
+ return {
771
+ markup: W,
772
+ maxTooltipItems: v
773
+ };
774
+ let H = _n, y = v;
775
+ for (; H <= y; ) {
776
+ const k = Math.floor((H + y) / 2), w = Jt(
777
+ e,
778
+ n,
779
+ t,
780
+ o,
781
+ k,
782
+ i,
783
+ s,
784
+ c,
785
+ d
786
+ );
787
+ if (qn(e)) {
788
+ y = k - 1;
789
+ continue;
790
+ }
791
+ R = k, W = w, H = k + 1;
792
+ }
793
+ return {
794
+ markup: R === v ? W : Jt(
795
+ e,
796
+ n,
797
+ t,
798
+ o,
799
+ R,
800
+ i,
801
+ s,
802
+ c,
803
+ d
804
+ ),
805
+ maxTooltipItems: R
806
+ };
807
+ }
808
+ function Gn(e, n) {
809
+ const t = Math.max(0, Math.min(1, n)), o = e.trim();
810
+ if (o.startsWith("#")) {
811
+ const s = o.slice(1), c = s.length === 3 ? `${s[0]}${s[0]}${s[1]}${s[1]}${s[2]}${s[2]}` : s.length === 4 ? `${s[0]}${s[0]}${s[1]}${s[1]}${s[2]}${s[2]}` : s.length >= 6 ? s.slice(0, 6) : "";
812
+ if (/^[0-9a-fA-F]{6}$/.test(c)) {
813
+ const d = Number.parseInt(c.slice(0, 2), 16), v = Number.parseInt(c.slice(2, 4), 16), R = Number.parseInt(c.slice(4, 6), 16);
814
+ return `rgba(${d}, ${v}, ${R}, ${t})`;
815
+ }
816
+ }
817
+ const r = o.match(/^rgba?\(([^)]+)\)$/i);
818
+ if (r) {
819
+ const s = r[1].split(",").map((c) => c.trim());
820
+ if (s.length >= 3) {
821
+ const [c, d, v] = s;
822
+ return `rgba(${c}, ${d}, ${v}, ${t})`;
823
+ }
824
+ }
825
+ const i = o.match(/^hsla?\(([^)]+)\)$/i);
826
+ if (i) {
827
+ const s = i[1].split(",").map((c) => c.trim());
828
+ if (s.length >= 3) {
829
+ const [c, d, v] = s;
830
+ return `hsla(${c}, ${d}, ${v}, ${t})`;
831
+ }
832
+ }
833
+ return e;
834
+ }
835
+ function Zt(e, n) {
836
+ return typeof e == "string" ? Gn(e, n) : Array.isArray(e) ? e.map(
837
+ (t) => typeof t == "string" ? Gn(t, n) : t
838
+ ) : e;
839
+ }
840
+ function Ja(e) {
841
+ e.__tooltipOriginalStyle || (e.__tooltipOriginalStyle = {
842
+ borderColor: Reflect.get(e, "borderColor"),
843
+ backgroundColor: Reflect.get(e, "backgroundColor"),
844
+ pointBorderColor: Reflect.get(e, "pointBorderColor"),
845
+ pointBackgroundColor: Reflect.get(e, "pointBackgroundColor")
846
+ });
847
+ }
848
+ function Za(e) {
849
+ const n = e.__tooltipOriginalStyle;
850
+ n && (Reflect.set(e, "borderColor", n.borderColor), Reflect.set(e, "backgroundColor", n.backgroundColor), Reflect.set(e, "pointBorderColor", n.pointBorderColor), Reflect.set(e, "pointBackgroundColor", n.pointBackgroundColor));
851
+ }
852
+ function Qa(e, n) {
853
+ const t = e.__tooltipOriginalStyle;
854
+ t && (Reflect.set(e, "borderColor", Zt(t.borderColor, n)), Reflect.set(e, "backgroundColor", Zt(t.backgroundColor, n)), Reflect.set(e, "pointBorderColor", Zt(t.pointBorderColor, n)), Reflect.set(
855
+ e,
856
+ "pointBackgroundColor",
857
+ Zt(t.pointBackgroundColor, n)
858
+ ));
859
+ }
860
+ function Tn(e) {
861
+ var o;
862
+ if (!e || typeof e != "object")
863
+ return !1;
864
+ const n = e;
865
+ if (n.destroyed === !0 || typeof n.update != "function" || !Array.isArray((o = n.data) == null ? void 0 : o.datasets))
866
+ return !1;
867
+ const t = n.canvas;
868
+ return !(t != null && (!t.isConnected || !t.ownerDocument));
869
+ }
870
+ function tn(e, n) {
871
+ if (!Tn(e))
872
+ return;
873
+ const t = e.data.datasets;
874
+ if (t.length !== 0) {
875
+ if (t.forEach((o, r) => {
876
+ Ja(o), !n || r === n.datasetIndex ? Za(o) : Qa(o, wa);
877
+ }), typeof e.setActiveElements == "function")
878
+ try {
879
+ n ? e.setActiveElements([
880
+ {
881
+ datasetIndex: n.datasetIndex,
882
+ index: n.dataIndex
883
+ }
884
+ ]) : e.setActiveElements([]);
885
+ } catch {
886
+ return;
887
+ }
888
+ try {
889
+ e.update("none");
890
+ } catch {
891
+ return;
892
+ }
893
+ }
894
+ }
895
+ function To(e) {
896
+ const n = e, t = n == null ? void 0 : n.chart;
897
+ if (Tn(t))
898
+ return t;
899
+ const o = n == null ? void 0 : n.$el;
900
+ if (!o)
901
+ return null;
902
+ const r = o.querySelector("canvas");
903
+ if (!(r instanceof HTMLCanvasElement))
904
+ return null;
905
+ const i = vn.getChart(r);
906
+ return Tn(i) ? i : null;
907
+ }
908
+ function er(e) {
909
+ const n = window.getComputedStyle(e);
910
+ return [n.overflow, n.overflowX, n.overflowY].some((o) => o !== "visible");
911
+ }
912
+ function Bn(e) {
913
+ let n = e.parentElement ?? e, t = n;
914
+ for (; t && t.parentElement && t.parentElement !== document.body && t.parentElement !== document.documentElement; )
915
+ er(t) && (n = t.parentElement), t = t.parentElement;
916
+ return window.getComputedStyle(n).position === "static" && (n.style.position = "relative"), n;
917
+ }
918
+ function An(e, n, t, o, r, i, s = "center", c = !1) {
919
+ const d = n.getBoundingClientRect(), v = t.getBoundingClientRect(), R = t.scrollLeft, W = t.scrollTop, H = t.clientWidth, y = t.clientHeight, p = e;
920
+ (!Number.isFinite(p.__cachedWidth) || !Number.isFinite(p.__cachedHeight) || p.__measurementHostWidth !== H || p.__measurementHostHeight !== y) && (p.__cachedWidth = e.offsetWidth, p.__cachedHeight = e.offsetHeight, p.__measurementHostWidth = H, p.__measurementHostHeight = y);
921
+ const w = p.__cachedWidth ?? e.offsetWidth, F = p.__cachedHeight ?? e.offsetHeight, g = 8, S = d.left - v.left + R + o, B = d.top - v.top + W + r, D = c ? s === "left" ? S - w - g : S + g : s === "left" ? S - w - g : s === "right" ? S + g : S - w / 2, f = c ? B + g : i ? B - F / 2 : B + g, L = R + g;
922
+ let A = W + g;
923
+ const u = document.querySelector('[data-menu-tab="true"]');
924
+ if (u) {
925
+ const Y = u.getBoundingClientRect().bottom - v.top + W + g;
926
+ A = Math.max(A, Y);
927
+ }
928
+ const I = Math.max(L, R + H - w - g), M = Math.max(A, W + y - F - g), U = Math.round(Math.min(Math.max(L, D), I)), G = Math.round(Math.min(Math.max(A, f), M));
929
+ p.__lastLeftPx === U && p.__lastTopPx === G || (p.__lastLeftPx = U, p.__lastTopPx = G, e.style.left = `${U}px`, e.style.top = `${G}px`);
930
+ }
931
+ function Lo(e) {
932
+ return e.dataset.anchorDirection === "left" ? "left" : e.dataset.anchorDirection === "right" ? "right" : "center";
933
+ }
934
+ function tr(e, n, t, o, r, i, s) {
935
+ const c = n.getBoundingClientRect(), d = o - c.left, v = r - c.top;
936
+ !Number.isFinite(d) || !Number.isFinite(v) || (e.dataset.cursorCanvasX = String(d), e.dataset.cursorCanvasY = String(v), e.dataset.caretX = String(d), e.dataset.caretY = String(v), e.dataset.anchorDirection = s, An(
937
+ e,
938
+ n,
939
+ t,
940
+ d,
941
+ v,
942
+ i,
943
+ s,
944
+ !0
945
+ ));
946
+ }
947
+ function nr(e) {
948
+ const n = document.createElement("div");
949
+ return n.id = e, n.dataset.comparisonTooltip = "true", n.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.66))", n.style.border = "1px solid rgba(255, 255, 255, 0.58)", n.style.borderRadius = "10px", n.style.boxShadow = "0 8px 24px rgba(15, 23, 42, 0.18)", n.style.color = "#111827", n.style.left = "0", n.style.opacity = "0", Mn(n), n.style.maxWidth = "min(360px, calc(100% - 16px))", n.style.overflow = "hidden", n.style.padding = "8px 10px", n.style.pointerEvents = "none", n.style.position = "absolute", n.style.textAlign = "left", n.style.top = "0", n.style.transform = "none", n.style.willChange = "left, top", n.style.whiteSpace = "normal", n.style.wordBreak = "normal", n.style.overflowWrap = "normal", n.style.zIndex = "10", n;
950
+ }
951
+ function or(e) {
952
+ e.__onViewportChange && (window.removeEventListener("scroll", e.__onViewportChange, !0), window.removeEventListener("resize", e.__onViewportChange));
953
+ }
954
+ function ar(e) {
955
+ e.__onNavigationChange && (window.removeEventListener(Pn, e.__onNavigationChange), window.removeEventListener("popstate", e.__onNavigationChange), window.removeEventListener("hashchange", e.__onNavigationChange), window.removeEventListener("beforeunload", e.__onNavigationChange));
956
+ }
957
+ function rr(e) {
958
+ e.__disconnectObserver && (e.__disconnectObserver.disconnect(), e.__disconnectObserver = void 0);
959
+ }
960
+ function Rn(e, n) {
961
+ kt(e), Do(e), or(e), ar(e), rr(e), e.__onDetailsClick && e.removeEventListener("click", e.__onDetailsClick), e.__onTooltipPointerEnter && e.removeEventListener("pointerenter", e.__onTooltipPointerEnter), e.__onTooltipPointerLeave && e.removeEventListener("pointerleave", e.__onTooltipPointerLeave), n && e.__onCanvasPointerEnter && n.removeEventListener("pointerenter", e.__onCanvasPointerEnter), n && e.__onCanvasPointerMove && n.removeEventListener("pointermove", e.__onCanvasPointerMove), n && e.__onCanvasPointerLeave && n.removeEventListener("pointerleave", e.__onCanvasPointerLeave), n && e.__onCanvasClick && n.removeEventListener("click", e.__onCanvasClick), n && e.__onCanvasPointerUp && n.removeEventListener("pointerup", e.__onCanvasPointerUp), e.remove();
962
+ }
963
+ function lr(e, n, t) {
964
+ e.__onNavigationChange || (La(), e.__onNavigationChange = () => {
965
+ if (!t.isConnected) {
966
+ Rn(e, t);
967
+ return;
968
+ }
969
+ Ve(e, n, !0);
970
+ }, window.addEventListener(Pn, e.__onNavigationChange), window.addEventListener("popstate", e.__onNavigationChange), window.addEventListener("hashchange", e.__onNavigationChange), window.addEventListener("beforeunload", e.__onNavigationChange));
971
+ }
972
+ function sr(e, n) {
973
+ e.__disconnectObserver || document.body && (e.__disconnectObserver = new MutationObserver(() => {
974
+ n.isConnected || Rn(e, n);
975
+ }), e.__disconnectObserver.observe(document.body, {
976
+ childList: !0,
977
+ subtree: !0
978
+ }));
979
+ }
980
+ function ir(e, n, t) {
981
+ Array.from(
982
+ e.querySelectorAll('[data-comparison-tooltip="true"]')
983
+ ).forEach((r) => {
984
+ r.id !== n && Rn(r, t);
985
+ });
986
+ }
987
+ function kt(e) {
988
+ typeof e.__hideTimeoutId == "number" && (window.clearTimeout(e.__hideTimeoutId), e.__hideTimeoutId = void 0);
989
+ }
990
+ function Do(e) {
991
+ typeof e.__cursorRafId == "number" && (window.cancelAnimationFrame(e.__cursorRafId), e.__cursorRafId = void 0);
992
+ }
993
+ function ur(e) {
994
+ e.__cachedWidth = void 0, e.__cachedHeight = void 0, e.__measurementHostWidth = void 0, e.__measurementHostHeight = void 0;
995
+ }
996
+ function jn(e, n, t, o, r) {
997
+ e.__pendingCursorClientX = o, e.__pendingCursorClientY = r, typeof e.__cursorRafId != "number" && (e.__cursorRafId = window.requestAnimationFrame(() => {
998
+ e.__cursorRafId = void 0;
999
+ const i = e.__pendingCursorClientX, s = e.__pendingCursorClientY;
1000
+ if (e.__pendingCursorClientX = void 0, e.__pendingCursorClientY = void 0, !Number.isFinite(i) || !Number.isFinite(s))
1001
+ return;
1002
+ const c = Bn(n);
1003
+ e.parentElement !== c && c.appendChild(e), tr(
1004
+ e,
1005
+ n,
1006
+ c,
1007
+ i,
1008
+ s,
1009
+ t,
1010
+ Lo(e)
1011
+ );
1012
+ }));
1013
+ }
1014
+ function Ve(e, n, t = !1) {
1015
+ St(e) && !t || (kt(e), Do(e), So(e, !1), Ea(e), e.__pendingCursorClientX = void 0, e.__pendingCursorClientY = void 0, e.__detailsPayload = void 0, e.__lastLeftPx = void 0, e.__lastTopPx = void 0, delete e.dataset.cursorCanvasX, delete e.dataset.cursorCanvasY, e.__isTooltipHovered = !1, e.style.pointerEvents = "none", e.style.opacity = "0", tn(n));
1016
+ }
1017
+ function Jn(e, n, t = Sa) {
1018
+ e.__isTooltipHovered || (kt(e), e.__hideTimeoutId = window.setTimeout(() => {
1019
+ e.__isTooltipHovered || Ve(e, n);
1020
+ }, t));
1021
+ }
1022
+ function cr(e, n, t, o, r) {
1023
+ const { maxTooltipItems: i } = _o(r);
1024
+ e.__onCanvasPointerEnter || (e.__onCanvasPointerEnter = (s) => {
1025
+ if (!(st() && St(e)) && (jn(
1026
+ e,
1027
+ n,
1028
+ o,
1029
+ s.clientX,
1030
+ s.clientY
1031
+ ), typeof (t == null ? void 0 : t.update) == "function"))
1032
+ try {
1033
+ t.update("none");
1034
+ } catch {
1035
+ return;
1036
+ }
1037
+ }, n.addEventListener("pointerenter", e.__onCanvasPointerEnter, {
1038
+ passive: !0
1039
+ })), e.__onCanvasPointerMove || (e.__onCanvasPointerMove = (s) => {
1040
+ st() && St(e) || jn(
1041
+ e,
1042
+ n,
1043
+ o,
1044
+ s.clientX,
1045
+ s.clientY
1046
+ );
1047
+ }, n.addEventListener("pointermove", e.__onCanvasPointerMove, {
1048
+ passive: !0
1049
+ })), e.__onCanvasPointerLeave || (e.__onCanvasPointerLeave = () => {
1050
+ st() && St(e) || Ve(e, t);
1051
+ }, n.addEventListener("pointerleave", e.__onCanvasPointerLeave, {
1052
+ passive: !0
1053
+ })), e.__onCanvasClick || (e.__onCanvasClick = (s) => {
1054
+ var w, F;
1055
+ if (st() || !(r != null && r.onViewFullDetails) || !e.__detailsPayload || e.style.opacity !== "1")
1056
+ return;
1057
+ const c = (g) => {
1058
+ var L, A, u, I;
1059
+ if (g.length === 0)
1060
+ return !1;
1061
+ const S = (L = g.find(
1062
+ (M) => typeof M.dataIndex == "number"
1063
+ )) == null ? void 0 : L.dataIndex, B = ((A = t == null ? void 0 : t.data) == null ? void 0 : A.datasets) ?? [], D = (u = t == null ? void 0 : t.config) == null ? void 0 : u.type, f = ko(
1064
+ g,
1065
+ o,
1066
+ (r == null ? void 0 : r.viewFullDetailsLabel) ?? wo(),
1067
+ i,
1068
+ !0,
1069
+ B,
1070
+ S,
1071
+ D
1072
+ ).detailsPayload;
1073
+ return (I = r.onViewFullDetails) == null || I.call(r, f, t), Ve(e, t), !0;
1074
+ }, d = ((w = t == null ? void 0 : t.tooltip) == null ? void 0 : w.dataPoints) ?? [];
1075
+ if (c(d))
1076
+ return;
1077
+ const v = t == null ? void 0 : t.getElementsAtEventForMode;
1078
+ if (typeof v != "function")
1079
+ return;
1080
+ const R = v.call(
1081
+ t,
1082
+ s,
1083
+ "nearest",
1084
+ { intersect: !0 },
1085
+ !1
1086
+ ), W = v.call(
1087
+ t,
1088
+ s,
1089
+ "index",
1090
+ { intersect: !1 },
1091
+ !1
1092
+ ), y = (R.length > 0 ? R : W).filter((g) => typeof g.datasetIndex == "number" && typeof g.index == "number").map((g) => ({ datasetIndex: g.datasetIndex, index: g.index }));
1093
+ if (y.length === 0)
1094
+ return;
1095
+ const p = t == null ? void 0 : t.tooltip;
1096
+ if (typeof (p == null ? void 0 : p.setActiveElements) != "function")
1097
+ return;
1098
+ p.setActiveElements(y, {
1099
+ x: s.offsetX,
1100
+ y: s.offsetY
1101
+ });
1102
+ try {
1103
+ t.update("none");
1104
+ } catch {
1105
+ return;
1106
+ }
1107
+ const k = ((F = t == null ? void 0 : t.tooltip) == null ? void 0 : F.dataPoints) ?? [];
1108
+ c(k);
1109
+ }, n.addEventListener("click", e.__onCanvasClick)), e.__onCanvasPointerUp || (e.__onCanvasPointerUp = (s) => {
1110
+ if (st()) {
1111
+ const c = t == null ? void 0 : t.getElementsAtEventForMode, d = t == null ? void 0 : t.tooltip;
1112
+ if (typeof c != "function" || typeof (d == null ? void 0 : d.setActiveElements) != "function")
1113
+ return;
1114
+ const v = c.call(
1115
+ t,
1116
+ s,
1117
+ "nearest",
1118
+ { intersect: !0 },
1119
+ !1
1120
+ ), R = c.call(
1121
+ t,
1122
+ s,
1123
+ "index",
1124
+ { intersect: !1 },
1125
+ !1
1126
+ ), H = (v.length > 0 ? v : R).filter((F) => typeof F.datasetIndex == "number" && typeof F.index == "number").map((F) => ({
1127
+ datasetIndex: F.datasetIndex,
1128
+ index: F.index
1129
+ }));
1130
+ if (H.length === 0) {
1131
+ Ve(e, t, !0);
1132
+ return;
1133
+ }
1134
+ const y = H[0], p = Ka(
1135
+ e,
1136
+ y.datasetIndex,
1137
+ y.index
1138
+ ), k = Number.isFinite(e.__lastPhoneTapAt), w = p && Xa(e, s.offsetX, s.offsetY, s.timeStamp);
1139
+ if (k && !w && p) {
1140
+ Ve(e, t, !0);
1141
+ return;
1142
+ }
1143
+ So(e, !0), kt(e), e.dataset.cursorCanvasX = String(s.offsetX), e.dataset.cursorCanvasY = String(s.offsetY), e.dataset.caretX = String(s.offsetX), e.dataset.caretY = String(s.offsetY), d.setActiveElements(H, {
1144
+ x: s.offsetX,
1145
+ y: s.offsetY
1146
+ });
1147
+ try {
1148
+ t.update("none");
1149
+ } catch {
1150
+ return;
1151
+ }
1152
+ if (w && (r != null && r.onViewFullDetails) && e.__detailsPayload) {
1153
+ r.onViewFullDetails(e.__detailsPayload, t), Ve(e, t);
1154
+ return;
1155
+ }
1156
+ Ua(
1157
+ e,
1158
+ s.offsetX,
1159
+ s.offsetY,
1160
+ s.timeStamp,
1161
+ y.datasetIndex,
1162
+ y.index
1163
+ );
1164
+ return;
1165
+ }
1166
+ e.__onCanvasClick && e.__onCanvasClick(s);
1167
+ }, n.addEventListener("pointerup", e.__onCanvasPointerUp)), r != null && r.onViewFullDetails && (e.__onDetailsClick || (e.__onDetailsClick = (s) => {
1168
+ var v;
1169
+ const c = s.target;
1170
+ c != null && c.closest('[data-tooltip-full-details="true"]') && (s.preventDefault(), s.stopPropagation(), e.__detailsPayload && ((v = r.onViewFullDetails) == null || v.call(r, e.__detailsPayload, t), Ve(e, t)));
1171
+ }, e.addEventListener("click", e.__onDetailsClick)), e.__onTooltipPointerEnter || (e.__onTooltipPointerEnter = () => {
1172
+ e.__isTooltipHovered = !0, kt(e);
1173
+ }, e.addEventListener("pointerenter", e.__onTooltipPointerEnter)), e.__onTooltipPointerLeave || (e.__onTooltipPointerLeave = () => {
1174
+ e.__isTooltipHovered = !1, Ve(e, t);
1175
+ }, e.addEventListener("pointerleave", e.__onTooltipPointerLeave)));
1176
+ }
1177
+ function dr(e, n, t) {
1178
+ e.__onViewportChange || (e.__onViewportChange = () => {
1179
+ if (e.style.opacity !== "1")
1180
+ return;
1181
+ const o = Number(e.dataset.caretX), r = Number(e.dataset.caretY), i = Lo(e);
1182
+ if (!Number.isFinite(o) || !Number.isFinite(r)) {
1183
+ e.style.opacity = "0";
1184
+ return;
1185
+ }
1186
+ const s = Bn(n);
1187
+ e.parentElement !== s && s.appendChild(e), Mn(e, s), An(
1188
+ e,
1189
+ n,
1190
+ s,
1191
+ o,
1192
+ r,
1193
+ t,
1194
+ i,
1195
+ !0
1196
+ );
1197
+ }, window.addEventListener("scroll", e.__onViewportChange, {
1198
+ capture: !0,
1199
+ passive: !0
1200
+ }), window.addEventListener("resize", e.__onViewportChange, {
1201
+ passive: !0
1202
+ }));
1203
+ }
1204
+ function fr(e, n) {
1205
+ const { maxTooltipItems: t } = _o(n);
1206
+ return ({ chart: o, tooltip: r }) => {
1207
+ var U, G, j, Y;
1208
+ if (typeof document > "u" || typeof window > "u")
1209
+ return;
1210
+ const i = o == null ? void 0 : o.canvas;
1211
+ if (!(i instanceof HTMLCanvasElement))
1212
+ return;
1213
+ const s = Bn(i), c = `comparison-tooltip-${String(o.id)}`;
1214
+ let d = document.querySelector(`#${c}`);
1215
+ if (d || (d = nr(c)), d.parentElement !== s && s.appendChild(d), Mn(d, s), dr(d, i, e), lr(d, o, i), sr(d, i), cr(d, i, o, e, n), ((r == null ? void 0 : r.opacity) ?? 0) === 0) {
1216
+ if (st() && St(d))
1217
+ return;
1218
+ n != null && n.onViewFullDetails ? Jn(d, o) : Ve(d, o);
1219
+ return;
1220
+ }
1221
+ const v = (r == null ? void 0 : r.dataPoints) ?? [];
1222
+ if (v.length === 0) {
1223
+ if (st() && St(d))
1224
+ return;
1225
+ n != null && n.onViewFullDetails ? Jn(d, o) : Ve(d, o);
1226
+ return;
1227
+ }
1228
+ ir(s, c, i), kt(d);
1229
+ const R = (n == null ? void 0 : n.viewFullDetailsLabel) ?? wo(), W = !!(n != null && n.onViewFullDetails), H = (U = v.find((z) => typeof z.dataIndex == "number")) == null ? void 0 : U.dataIndex, y = ((G = o == null ? void 0 : o.data) == null ? void 0 : G.datasets) ?? [], p = (j = o == null ? void 0 : o.config) == null ? void 0 : j.type, {
1230
+ markup: { detailsPayload: k, hasCollapsedValues: w }
1231
+ } = ja(
1232
+ d,
1233
+ v,
1234
+ e,
1235
+ R,
1236
+ t,
1237
+ W,
1238
+ y,
1239
+ H,
1240
+ p
1241
+ ), F = W && w;
1242
+ d.__detailsPayload = F ? k : void 0, d.style.pointerEvents = F ? "auto" : "none";
1243
+ const g = typeof (r == null ? void 0 : r.caretX) == "number" ? r.caretX : 0, S = Number(d.dataset.cursorCanvasX), B = Number(d.dataset.cursorCanvasY);
1244
+ if (!(Number.isFinite(S) && Number.isFinite(B))) {
1245
+ d.style.opacity = "0";
1246
+ return;
1247
+ }
1248
+ const f = (Y = o == null ? void 0 : o.scales) == null ? void 0 : Y.x, L = f && typeof f.getPixelForValue == "function" ? f.getPixelForValue(0) : NaN, A = e ? v.reduce((z, _) => {
1249
+ const b = _ == null ? void 0 : _.element, O = b == null ? void 0 : b.x;
1250
+ if (typeof O != "number" || !Number.isFinite(O))
1251
+ return z;
1252
+ if (!Number.isFinite(z))
1253
+ return O;
1254
+ const N = Number.isFinite(L) ? L : g, K = Math.abs(z - N);
1255
+ return Math.abs(O - N) > K ? O : z;
1256
+ }, Number.NaN) : Number.NaN, u = S, I = B, M = e ? Number.isFinite(L) && Number.isFinite(A) && A < L ? "left" : "right" : "center";
1257
+ An(
1258
+ d,
1259
+ i,
1260
+ s,
1261
+ u,
1262
+ I,
1263
+ e,
1264
+ M,
1265
+ !0
1266
+ ), d.dataset.caretX = String(u), d.dataset.caretY = String(I), d.dataset.anchorDirection = M, d.style.opacity = "1";
1267
+ };
1268
+ }
1269
+ function Po(e = !1, n) {
1270
+ return {
1271
+ ...xo(e ? "y" : "x"),
1272
+ enabled: !1,
1273
+ external: fr(e, n)
1274
+ };
1275
+ }
1276
+ const Zn = "en-US";
1277
+ function Qn(e, n) {
1278
+ const t = n.split(".");
1279
+ let o = e;
1280
+ for (const r of t) {
1281
+ if (!o || typeof o != "object" || !(r in o))
1282
+ return;
1283
+ o = o[r];
1284
+ }
1285
+ return typeof o == "string" ? o : void 0;
1286
+ }
1287
+ function hr() {
1288
+ const e = fo(), n = "report.widget.legend.comparison";
1289
+ return `(${Qn(en[e] ?? en[Zn], n) ?? Qn(en[Zn], n) ?? "Comparison"})`;
1290
+ }
1291
+ function Io(e) {
1292
+ function o(y, p, k) {
1293
+ if (y.measureText(p).width <= k) return p;
1294
+ const w = "…";
1295
+ let F = 0, g = p.length;
1296
+ for (; F < g; ) {
1297
+ const S = Math.floor((F + g) / 2), B = p.slice(0, S) + w;
1298
+ y.measureText(B).width <= k ? F = S + 1 : g = S;
1299
+ }
1300
+ return p.slice(0, F - 1) + w;
1301
+ }
1302
+ function r(y) {
1303
+ const p = y == null ? "" : String(y), [k] = p.split("#");
1304
+ return (k ?? p).trim();
1305
+ }
1306
+ function i(y, p) {
1307
+ const k = y == null ? "" : String(y).trim();
1308
+ if (k.length === 0) return k;
1309
+ const w = hr();
1310
+ return k.endsWith(` ${w}`) || k.endsWith(w) ? k : (p == null ? void 0 : p.dash) === !0 || (p == null ? void 0 : p.isCompare) === !0 ? `${k} ${w}` : k;
1311
+ }
1312
+ const s = x(() => ({
1313
+ display: e.showLabel,
1314
+ align: e.labelAlign,
1315
+ anchor: e.labelAnchor,
1316
+ rotation: e.labelRotation,
1317
+ offset: e.labelOffset,
1318
+ font: {
1319
+ size: e.labelFontSize
1320
+ },
1321
+ color: (y) => {
1322
+ const p = y.chart.data.datasets[y.datasetIndex];
1323
+ return p.borderColor ? Array.isArray(p.borderColor) ? p.borderColor[y.dataIndex] : p.borderColor : p.backgroundColor ? Array.isArray(p.backgroundColor) ? p.backgroundColor[y.dataIndex] : p.backgroundColor : "#000";
1324
+ },
1325
+ formatter: (y) => y.toLocaleString("en-US")
1326
+ })), c = x(() => ({
1327
+ display: e.showX,
1328
+ position: e.xPosition,
1329
+ grid: {
1330
+ display: e.showXGrid
1331
+ },
1332
+ ticks: {
1333
+ display: e.showXTick,
1334
+ padding: 8,
1335
+ callback: function(y) {
1336
+ if ((e == null ? void 0 : e.isTransposed) === !0) return r(y);
1337
+ let k = String(y);
1338
+ const w = this;
1339
+ w && typeof w.getLabelForValue == "function" && (k = w.getLabelForValue(y)), k = r(k);
1340
+ const F = w == null ? void 0 : w.chart, g = w == null ? void 0 : w.ctx, S = F.height * 0.25;
1341
+ if (g && S > 0) {
1342
+ g.save();
1343
+ const D = g.measureText(k).width > S ? o(g, k, S) : k;
1344
+ return g.restore(), D;
1345
+ }
1346
+ return k;
1347
+ },
1348
+ font: {
1349
+ size: e.xTickFontSize
1350
+ }
1351
+ },
1352
+ title: {
1353
+ display: e.showXTitle,
1354
+ text: e.xTitle,
1355
+ font: {
1356
+ size: e.xTitleFontSize
1357
+ }
1358
+ },
1359
+ afterBuildTicks: (y) => {
1360
+ const p = Array.isArray(y == null ? void 0 : y.ticks) ? y.ticks : [];
1361
+ if (p.length === 0) return;
1362
+ const k = r(y.getLabelForValue(p[0].value)), w = !isNaN(Number(k));
1363
+ y.options.ticks.minRotation = w || p.length < 10 ? 0 : 90;
1364
+ },
1365
+ afterFit: (y) => {
1366
+ if (!(e != null && e.isTransposed)) {
1367
+ const p = y.chart.height * 0.4;
1368
+ y.height > p && (y.height = p);
1369
+ }
1370
+ }
1371
+ })), d = x(() => ({
1372
+ display: e.showY,
1373
+ position: e.yPosition,
1374
+ grid: {
1375
+ display: e.showYGrid
1376
+ },
1377
+ ticks: {
1378
+ display: e.showYTick,
1379
+ padding: 8,
1380
+ font: {
1381
+ size: e.yTickFontSize
1382
+ },
1383
+ callback: function(y) {
1384
+ if (!((e == null ? void 0 : e.isTransposed) === !0)) return r(y);
1385
+ let k = String(y);
1386
+ const w = this;
1387
+ w && typeof w.getLabelForValue == "function" && (k = w.getLabelForValue(y)), k = r(k);
1388
+ const F = w == null ? void 0 : w.chart, g = w == null ? void 0 : w.ctx, S = F.width * 0.4;
1389
+ if (g && S > 0) {
1390
+ g.save();
1391
+ const D = g.measureText(k).width > S ? o(g, k, S) : k;
1392
+ return g.restore(), D;
1393
+ }
1394
+ return k;
1395
+ }
1396
+ },
1397
+ title: {
1398
+ display: e.showYTitle,
1399
+ text: e.yTitle,
1400
+ font: {
1401
+ size: e.yTitleFontSize
1402
+ }
1403
+ }
1404
+ })), v = x(() => ({
1405
+ display: e.showLegend,
1406
+ position: e.legendPosition,
1407
+ usePointStyle: e.usePointStyle,
1408
+ maxWidth: e.legendMaxWidth,
1409
+ labels: {
1410
+ usePointStyle: e.usePointStyle ?? !0,
1411
+ padding: 12,
1412
+ color: e.legendColor ?? "#6b6b6b",
1413
+ font: {
1414
+ size: e.legendFontSize
1415
+ },
1416
+ generateLabels: (y) => {
1417
+ var w;
1418
+ const p = e.legendColor ?? "#6b6b6b", k = ((w = y == null ? void 0 : y.data) == null ? void 0 : w.datasets) || [];
1419
+ if (k.length === 0) return [];
1420
+ if (k.length === 1 && Array.isArray(k[0].backgroundColor) && k[0].backgroundColor.length > 1 && Array.isArray(k[0].data)) {
1421
+ const F = k[0];
1422
+ return y.data.labels.map((S, B) => {
1423
+ const D = F.backgroundColor[B];
1424
+ return {
1425
+ text: S,
1426
+ fontColor: p,
1427
+ color: p,
1428
+ fillStyle: D,
1429
+ strokeStyle: D,
1430
+ datasetIndex: 0,
1431
+ index: B,
1432
+ hidden: y.getDataVisibility ? !y.getDataVisibility(B) : !1
1433
+ };
1434
+ });
1435
+ }
1436
+ return y.data.datasets.map((F, g) => {
1437
+ const S = F.borderColor || F.backgroundColor;
1438
+ return {
1439
+ text: i(F.label, F),
1440
+ fontColor: p,
1441
+ color: p,
1442
+ fillStyle: S,
1443
+ strokeStyle: S,
1444
+ datasetIndex: g,
1445
+ hidden: !y.isDatasetVisible(g)
1446
+ };
1447
+ });
1448
+ }
1449
+ }
1450
+ })), R = x(() => e.isTransposed), W = x(() => e.chartWidth), H = x(() => e.chartHeight);
1451
+ return { datalabels: s, xCfg: c, yCfg: d, isTransposed: R, legend: v, chartWidth: W, chartHeight: H };
1452
+ }
1453
+ const mr = {
1454
+ key: 0,
1455
+ class: "pointer-events-none fixed inset-0 z-[120] flex justify-end"
1456
+ }, pr = ["aria-label"], gr = { class: "relative z-20 flex shrink-0 items-center bg-fm-color-neutral-white justify-between sm:px-5" }, vr = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary min-w-0 flex-1 pr-3" }, yr = { class: "flex items-center gap-1.5" }, br = {
1457
+ key: 0,
1458
+ class: "pb-2 fm-typo-en-body-lg-600 text-fm-color-typo-primary"
1459
+ }, Cr = ["onMouseenter", "onFocus"], xr = { class: "min-w-0 flex flex-1 items-center gap-2.5 pr-2" }, wr = { class: "min-w-0 break-all text-fm-color-typo-secondary" }, Sr = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-secondary shrink-0 text-right tabular-nums" }, eo = 500, _r = 320, Ot = /* @__PURE__ */ Ne({
1460
+ __name: "TooltipDetailSidesheet",
1461
+ props: {
1462
+ modelValue: { type: Boolean },
1463
+ detailsPayload: {}
1464
+ },
1465
+ emits: ["update:modelValue", "value-hover", "value-leave"],
1466
+ setup(e, { emit: n }) {
1467
+ const t = e, o = n, { t: r } = dt(), i = P(null), s = P(eo), c = P(!1), d = x({
1468
+ get: () => t.modelValue,
1469
+ set: (u) => o("update:modelValue", u)
1470
+ }), v = x(() => {
1471
+ var u;
1472
+ return (((u = t.detailsPayload) == null ? void 0 : u.sections) ?? []).filter((I) => I.values.length > 0);
1473
+ }), R = x(() => ({
1474
+ width: `${s.value}px`,
1475
+ maxWidth: "94vw"
1476
+ }));
1477
+ function W(u) {
1478
+ return u.value == null || u.value === "" ? "-" : typeof u.value == "number" ? Number.isFinite(u.value) ? u.value.toLocaleString() : "-" : String(u.value);
1479
+ }
1480
+ function H(u) {
1481
+ const I = u.text ?? "", M = I.lastIndexOf(":");
1482
+ return M > -1 ? I.slice(0, M).trim() : I;
1483
+ }
1484
+ function y(u) {
1485
+ o("value-hover", u);
1486
+ }
1487
+ function p() {
1488
+ o("value-leave");
1489
+ }
1490
+ function k() {
1491
+ p(), d.value = !1;
1492
+ }
1493
+ function w() {
1494
+ return typeof window > "u" ? eo : Math.floor(window.innerWidth * 0.94);
1495
+ }
1496
+ function F(u) {
1497
+ const I = w(), M = Math.min(_r, I);
1498
+ return Math.min(I, Math.max(M, Math.floor(u)));
1499
+ }
1500
+ function g(u) {
1501
+ typeof window > "u" || (s.value = F(window.innerWidth - u));
1502
+ }
1503
+ function S() {
1504
+ c.value = !1, document.removeEventListener("pointermove", B), document.removeEventListener("pointerup", S), document.removeEventListener("pointercancel", S);
1505
+ }
1506
+ function B(u) {
1507
+ c.value && g(u.clientX);
1508
+ }
1509
+ function D(u) {
1510
+ d.value && (c.value = !0, g(u.clientX), document.addEventListener("pointermove", B), document.addEventListener("pointerup", S), document.addEventListener("pointercancel", S));
1511
+ }
1512
+ function f() {
1513
+ s.value = F(s.value);
1514
+ }
1515
+ function L(u) {
1516
+ var U;
1517
+ if (!d.value)
1518
+ return;
1519
+ const I = u.target;
1520
+ if (!(I instanceof Node))
1521
+ return;
1522
+ const M = I instanceof Element ? I : null;
1523
+ M != null && M.closest('[data-tooltip-full-details="true"]') || (U = i.value) != null && U.contains(I) || k();
1524
+ }
1525
+ function A(u) {
1526
+ d.value && u.key === "Escape" && k();
1527
+ }
1528
+ return ct(() => {
1529
+ s.value = F(s.value), document.addEventListener("pointerdown", L, !0), document.addEventListener("keydown", A), window.addEventListener("resize", f);
1530
+ }), lo(() => {
1531
+ S(), document.removeEventListener("pointerdown", L, !0), document.removeEventListener("keydown", A), window.removeEventListener("resize", f);
1532
+ }), (u, I) => {
1533
+ const M = fe("FmButton");
1534
+ return J(), me(Oo, {
1535
+ "enter-active-class": "transform transition duration-200 ease-out",
1536
+ "enter-from-class": "translate-x-full opacity-0",
1537
+ "enter-to-class": "translate-x-0 opacity-100",
1538
+ "leave-active-class": "transform transition duration-150 ease-in",
1539
+ "leave-from-class": "translate-x-0 opacity-100",
1540
+ "leave-to-class": "translate-x-full opacity-0"
1541
+ }, {
1542
+ default: ke(() => [
1543
+ d.value ? (J(), ce("div", mr, [
1544
+ ee("div", {
1545
+ ref_key: "panelRef",
1546
+ ref: i,
1547
+ class: "glassmorphism pointer-events-auto relative ml-auto flex h-full flex-col px-24 py-3 overflow-hidden rounded-l-2xl border border-fm-color-border-secondary bg-fm-color-neutral-white duration-200 ease-out",
1548
+ style: Te(R.value),
1549
+ role: "dialog",
1550
+ "aria-modal": "false",
1551
+ "aria-label": a(r)("report.widget.comparisonTooltip.fullBreakdownTitle")
1552
+ }, [
1553
+ ee("div", {
1554
+ class: "absolute left-0 top-0 z-40 h-full w-3 -translate-x-1/2 cursor-ew-resize",
1555
+ onPointerdown: Qt(D, ["prevent"])
1556
+ }, null, 32),
1557
+ ee("div", gr, [
1558
+ ee("div", vr, Ae(a(r)("report.widget.comparisonTooltip.fullBreakdownTitle")), 1),
1559
+ ee("div", yr, [
1560
+ de(M, {
1561
+ class: "relative z-30 h-9 w-9 shrink-0",
1562
+ variant: "tertiary",
1563
+ icon: "close",
1564
+ "aria-label": a(r)("report.dynamic.common.close"),
1565
+ onClick: k
1566
+ }, null, 8, ["aria-label"])
1567
+ ])
1568
+ ]),
1569
+ ee("div", {
1570
+ class: "flex flex-1 flex-col gap-4 overflow-y-auto px-4 py-4 sm:px-5",
1571
+ onMouseleave: p
1572
+ }, [
1573
+ (J(!0), ce(ze, null, Nt(v.value, (U, G) => (J(), ce("div", {
1574
+ key: `${U.title || "section"}-${G}`,
1575
+ class: "flex flex-col gap-2 rounded-2xl bg-fm-color-neutral-white/45 py-3"
1576
+ }, [
1577
+ U.title ? (J(), ce("p", br, Ae(U.title), 1)) : ve("", !0),
1578
+ (J(!0), ce(ze, null, Nt(U.values, (j, Y) => (J(), ce("button", {
1579
+ key: `${j.text}-${Y}`,
1580
+ type: "button",
1581
+ class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex w-full items-start justify-between gap-3 bg-transparent px-2 py-1.5 text-left transition-colors hover:bg-fm-color-opacity-sm focus-visible:bg-fm-color-opacity-sm focus-visible:outline-none",
1582
+ onMouseenter: (z) => y(j),
1583
+ onFocus: (z) => y(j),
1584
+ onMouseleave: p,
1585
+ onBlur: p
1586
+ }, [
1587
+ ee("span", xr, [
1588
+ ee("span", {
1589
+ class: Le([
1590
+ "inline-block h-3 w-3 shrink-0 box-border",
1591
+ j.isBar ? "rounded-sm border border-fm-color-neutral-gray-400" : "rounded-full border border-white shadow-[0_0_0_1px_rgba(17,24,39,0.28)]"
1592
+ ]),
1593
+ style: Te({ backgroundColor: j.color })
1594
+ }, null, 6),
1595
+ ee("span", wr, Ae(H(j)), 1)
1596
+ ]),
1597
+ ee("span", Sr, Ae(W(j)), 1)
1598
+ ], 40, Cr))), 128))
1599
+ ]))), 128))
1600
+ ], 32)
1601
+ ], 12, pr)
1602
+ ])) : ve("", !0)
1603
+ ]),
1604
+ _: 1
1605
+ });
1606
+ };
1607
+ }
1608
+ }), kr = {
1609
+ type: "button",
1610
+ class: "inline-flex cursor-pointer select-none items-center gap-1 rounded px-1 py-0.5 border-none bg-transparent text-fm-color-system-info-300 leading-[1.4]",
1611
+ style: { fontSize: "var(--legend-font-size)" }
1612
+ }, Tr = ["aria-pressed", "onClick"], Lr = ["title"], Dr = {
1613
+ key: 0,
1614
+ class: "chart-legend-item relative z-[2] inline-flex max-w-full cursor-pointer select-none pointer-events-auto"
1615
+ }, Pr = 36, to = 2, no = 16, Ir = 50, Mr = 6, Br = /* @__PURE__ */ Ne({
1616
+ __name: "ChartLegendPanel",
1617
+ props: {
1618
+ chartRef: {},
1619
+ enabled: { type: Boolean },
1620
+ position: {},
1621
+ textColor: {},
1622
+ fontSize: {},
1623
+ legendUpdateKey: {},
1624
+ hiddenDatasetKeys: {},
1625
+ hiddenDataPointIndexes: {},
1626
+ chartColorBinding: {},
1627
+ chartColors: {},
1628
+ chartBreakdownColors: {},
1629
+ chartUseSecondaryMetricShades: { type: Boolean },
1630
+ metricCount: {},
1631
+ usePointStyle: { type: Boolean }
1632
+ },
1633
+ emits: ["toggleDatasetVisibility", "toggleDataPointVisibility"],
1634
+ setup(e, { emit: n }) {
1635
+ const t = e, o = n, { t: r, locale: i } = dt(), s = P([]), c = P(0), d = P(!1), v = P(!1), R = P(0), W = P(null), H = P(null), y = P(null), p = P(null), k = P(!1), w = P(0), F = P(0), g = P(!1), S = P(0), B = P(0), D = x(() => t.enabled !== !1), f = x(() => t.position === "left" || t.position === "right");
1636
+ let L = null;
1637
+ const A = x(
1638
+ () => d.value && v.value && k.value
1639
+ ), u = x(() => ({
1640
+ height: `${Math.max(0, w.value)}px`,
1641
+ transform: `translateY(${Math.max(0, F.value)}px)`
1642
+ })), I = x(() => typeof t.textColor == "string" && t.textColor.trim().length > 0 ? t.textColor : "#6b6b6b"), M = x(() => typeof t.fontSize == "number" && Number.isFinite(t.fontSize) && t.fontSize > 0 ? t.fontSize : 12);
1643
+ function U(l) {
1644
+ G({ height: l, width: 0 });
1645
+ }
1646
+ function G({ height: l, width: m }) {
1647
+ var C;
1648
+ const h = (C = t.chartRef) == null ? void 0 : C.$el;
1649
+ h instanceof HTMLElement && (h.style.setProperty("--legend-panel-height", `${Math.max(0, Math.floor(l))}px`), h.style.setProperty("--legend-panel-width", `${Math.max(0, Math.floor(m))}px`));
1650
+ }
1651
+ function j() {
1652
+ L != null && (window.clearTimeout(L), L = null);
1653
+ }
1654
+ function Y() {
1655
+ const l = To(
1656
+ t.chartRef
1657
+ );
1658
+ if (l)
1659
+ return l;
1660
+ const m = W.value, h = [m == null ? void 0 : m.parentElement, m == null ? void 0 : m.closest(".h-full"), m];
1661
+ for (const C of h) {
1662
+ if (!(C instanceof HTMLElement))
1663
+ continue;
1664
+ const V = C.querySelector("canvas");
1665
+ if (!(V instanceof HTMLCanvasElement))
1666
+ continue;
1667
+ const X = vn.getChart(V);
1668
+ if (X)
1669
+ return X;
1670
+ }
1671
+ return null;
1672
+ }
1673
+ function z() {
1674
+ _();
1675
+ }
1676
+ function _() {
1677
+ var C;
1678
+ const l = (C = W.value) == null ? void 0 : C.getBoundingClientRect(), m = Number((l == null ? void 0 : l.height) ?? 0), h = Number((l == null ? void 0 : l.width) ?? 0);
1679
+ if (Number.isFinite(m) && m >= 0) {
1680
+ G({
1681
+ height: f.value ? 0 : m,
1682
+ width: f.value && Number.isFinite(h) && h >= 0 ? h : 0
1683
+ });
1684
+ return;
1685
+ }
1686
+ G({ height: 0, width: 0 });
1687
+ }
1688
+ function b() {
1689
+ const l = y.value;
1690
+ if (!l) {
1691
+ k.value = !1, w.value = 0, F.value = 0;
1692
+ return;
1693
+ }
1694
+ const m = l.clientHeight, h = l.scrollHeight, C = l.scrollTop, V = h > m + 1;
1695
+ if (k.value = V, !V || m <= 0) {
1696
+ w.value = 0, F.value = 0;
1697
+ return;
1698
+ }
1699
+ const X = m, Z = Math.max(18, Math.round(m / h * X)), te = Math.max(0, X - Z), E = Math.max(1, h - m), ue = Math.round(C / E * te);
1700
+ w.value = Z, F.value = ue;
1701
+ }
1702
+ function O() {
1703
+ b();
1704
+ }
1705
+ function N(l) {
1706
+ const m = y.value, h = H.value;
1707
+ if (!m || !h || !k.value)
1708
+ return;
1709
+ const C = h.getBoundingClientRect(), V = l.clientY - C.top, X = Math.max(0, V - w.value / 2), Z = Math.max(1, m.clientHeight - w.value), te = Math.min(1, X / Z), E = Math.max(0, m.scrollHeight - m.clientHeight);
1710
+ m.scrollTop = te * E, b();
1711
+ }
1712
+ function K(l) {
1713
+ k.value && (g.value = !0, S.value = l.clientY, B.value = F.value);
1714
+ }
1715
+ function q(l) {
1716
+ if (!g.value)
1717
+ return;
1718
+ const m = y.value;
1719
+ if (!m)
1720
+ return;
1721
+ const h = l.clientY - S.value, C = Math.max(1, m.clientHeight - w.value), X = Math.min(C, Math.max(0, B.value + h)) / C, Z = Math.max(0, m.scrollHeight - m.clientHeight);
1722
+ m.scrollTop = X * Z, b();
1723
+ }
1724
+ function $() {
1725
+ g.value && (g.value = !1);
1726
+ }
1727
+ function Q() {
1728
+ var m;
1729
+ const l = [(m = t.chartRef) == null ? void 0 : m.$el, W.value];
1730
+ for (const h of l) {
1731
+ if (!(h instanceof HTMLElement))
1732
+ continue;
1733
+ const C = h.closest('[class*="fm-card"]');
1734
+ if (C)
1735
+ return C;
1736
+ }
1737
+ for (const h of l) {
1738
+ if (!(h instanceof HTMLElement))
1739
+ continue;
1740
+ const C = h.closest(".h-full") ?? h.parentElement;
1741
+ if (C)
1742
+ return C;
1743
+ }
1744
+ return null;
1745
+ }
1746
+ function oe() {
1747
+ var h, C, V, X;
1748
+ const l = (C = (h = W.value) == null ? void 0 : h.closest(".chart-layout")) == null ? void 0 : C.parentElement;
1749
+ if (l instanceof HTMLElement)
1750
+ return l;
1751
+ const m = (V = t.chartRef) == null ? void 0 : V.$el;
1752
+ if (m instanceof HTMLElement) {
1753
+ const Z = (X = m.closest(".chart-layout")) == null ? void 0 : X.parentElement;
1754
+ if (Z instanceof HTMLElement)
1755
+ return Z;
1756
+ }
1757
+ return null;
1758
+ }
1759
+ function le() {
1760
+ var h, C, V, X;
1761
+ const l = ((h = W.value) == null ? void 0 : h.closest(".chart-layout")) ?? ((X = (V = (C = t.chartRef) == null ? void 0 : C.$el) == null ? void 0 : V.closest) == null ? void 0 : X.call(V, ".chart-layout")) ?? null;
1762
+ if (!(l instanceof HTMLElement))
1763
+ return null;
1764
+ const m = Number(l.getBoundingClientRect().width);
1765
+ return Number.isFinite(m) && m > 0 ? m : null;
1766
+ }
1767
+ function se() {
1768
+ const l = oe();
1769
+ if (l) {
1770
+ const Z = Number(l.getBoundingClientRect().height);
1771
+ if (Number.isFinite(Z) && Z > 0)
1772
+ return Z;
1773
+ }
1774
+ const m = Q();
1775
+ if (!m)
1776
+ return null;
1777
+ const h = window.getComputedStyle(m), C = parseFloat(h.paddingTop) || 0, V = parseFloat(h.paddingBottom) || 0, X = m.getBoundingClientRect().height - C - V;
1778
+ return Number.isFinite(X) && X > 0 ? X : null;
1779
+ }
1780
+ function ye() {
1781
+ const l = oe();
1782
+ if (l) {
1783
+ const Z = Number(l.getBoundingClientRect().width);
1784
+ if (Number.isFinite(Z) && Z > 0)
1785
+ return Z;
1786
+ }
1787
+ const m = Q();
1788
+ if (!m)
1789
+ return null;
1790
+ const h = window.getComputedStyle(m), C = parseFloat(h.paddingLeft) || 0, V = parseFloat(h.paddingRight) || 0, X = m.getBoundingClientRect().width - C - V;
1791
+ return Number.isFinite(X) && X > 0 ? X : null;
1792
+ }
1793
+ function ie() {
1794
+ const l = Y(), m = Number(l == null ? void 0 : l.height), h = se();
1795
+ if (f.value)
1796
+ return Number.isFinite(m) && m > 0 ? Math.max(0, Math.floor(m - no)) : h != null ? Math.max(0, Math.floor(h - no)) : 120;
1797
+ if (h != null) {
1798
+ const C = h * 0.3, V = h - Pr, X = Math.min(C, V);
1799
+ return Math.max(0, Math.floor(X));
1800
+ }
1801
+ return Number.isFinite(m) && m > 0 ? Math.max(0, Math.floor(m * 0.3)) : 120;
1802
+ }
1803
+ function be() {
1804
+ var X;
1805
+ if (f.value) {
1806
+ const Z = ye();
1807
+ if (Z != null)
1808
+ return Math.max(0, Math.floor(Z * 0.3));
1809
+ const te = Y(), E = Number(te == null ? void 0 : te.width);
1810
+ return Number.isFinite(E) && E > 0 ? Math.max(0, Math.floor(E * 0.3)) : 180;
1811
+ }
1812
+ const l = le();
1813
+ if (l != null)
1814
+ return Math.max(0, Math.floor(l * 0.3));
1815
+ const m = Y(), h = Number(m == null ? void 0 : m.width), C = Number(((X = W.value) == null ? void 0 : X.getBoundingClientRect().width) ?? 0);
1816
+ if (Number.isFinite(h) && h > 0) {
1817
+ const Z = h + (Number.isFinite(C) ? C : 0);
1818
+ return Math.max(0, Math.floor(Z * 0.3));
1819
+ }
1820
+ const V = ye();
1821
+ return V != null ? Math.max(0, Math.floor(V * 0.3)) : 180;
1822
+ }
1823
+ function we(l, m) {
1824
+ const h = t.chartColorBinding;
1825
+ if (h) {
1826
+ const X = typeof l.datasetIndex == "number" ? l.datasetIndex : m, Z = Number.isInteger(t.metricCount) && Number(t.metricCount) > 0 ? Number(t.metricCount) : Math.max(1, Number(s.value.length));
1827
+ if (h === xe.breakdown) {
1828
+ const E = _t({
1829
+ fallbackIndex: X,
1830
+ metricCount: Z
1831
+ }), ue = Ie({
1832
+ datasetIndex: X,
1833
+ metricCount: Z,
1834
+ mode: xe.metric
1835
+ });
1836
+ return Lt({
1837
+ breakdownIndex: E,
1838
+ metricIndex: ue,
1839
+ metricCount: Z,
1840
+ breakdownColors: t.chartBreakdownColors,
1841
+ useSecondaryMetricShades: t.chartUseSecondaryMetricShades,
1842
+ customColors: t.chartColors
1843
+ });
1844
+ }
1845
+ if (h === xe.metric) {
1846
+ const E = Ie({
1847
+ datasetIndex: X,
1848
+ metricCount: Z,
1849
+ mode: xe.metric
1850
+ });
1851
+ return Ze({ index: E, customColors: t.chartColors });
1852
+ }
1853
+ const te = typeof l.index == "number" ? l.index : X;
1854
+ return Ze({ index: te, customColors: t.chartColors });
1855
+ }
1856
+ const C = l;
1857
+ return Se(l.fillStyle) || Se(l.strokeStyle) || Se(C.color) || "#9ca3af";
1858
+ }
1859
+ function Se(l) {
1860
+ return typeof l == "string" && l.trim().length > 0 ? l : Array.isArray(l) ? l.map((h) => Se(h)).find((h) => typeof h == "string" && h.trim().length > 0) ?? "" : "";
1861
+ }
1862
+ function Ke(l) {
1863
+ return Array.isArray(t.hiddenDataPointIndexes) ? t.hiddenDataPointIndexes.includes(l) : !1;
1864
+ }
1865
+ function Xe(l) {
1866
+ return Array.isArray(l) ? l : [];
1867
+ }
1868
+ function et(l) {
1869
+ if (l.length <= 1)
1870
+ return l;
1871
+ const m = Number.isInteger(t.metricCount) && Number(t.metricCount) > 0 ? Number(t.metricCount) : 1;
1872
+ return [...l.map((C, V) => {
1873
+ const X = typeof C.datasetIndex == "number" ? C.datasetIndex : V, Z = _t({
1874
+ fallbackIndex: X,
1875
+ metricCount: m
1876
+ });
1877
+ return {
1878
+ item: C,
1879
+ originalIndex: V,
1880
+ breakdownIndex: Z
1881
+ };
1882
+ })].sort((C, V) => C.breakdownIndex !== V.breakdownIndex ? C.breakdownIndex - V.breakdownIndex : C.originalIndex - V.originalIndex).map((C) => C.item);
1883
+ }
1884
+ function Dt(l) {
1885
+ if (l.length <= 1)
1886
+ return l;
1887
+ const m = /* @__PURE__ */ new Map(), h = [];
1888
+ for (const C of l) {
1889
+ const V = typeof C.index == "number", X = C.datasetIndex, Z = typeof X == "number" && !V, te = typeof C.text == "string" ? C.text.trim() : "";
1890
+ if (!Z || !te) {
1891
+ h.push(C);
1892
+ continue;
1893
+ }
1894
+ const E = te.toLowerCase(), ue = m.get(E);
1895
+ if (ue == null) {
1896
+ h.push({
1897
+ ...C,
1898
+ datasetIndexes: [X],
1899
+ datasetKeys: typeof C.datasetKey == "string" && C.datasetKey.trim().length > 0 ? [C.datasetKey] : []
1900
+ }), m.set(E, h.length - 1);
1901
+ continue;
1902
+ }
1903
+ const ge = h[ue];
1904
+ if (!ge)
1905
+ continue;
1906
+ const re = new Set(
1907
+ Array.isArray(ge.datasetIndexes) ? ge.datasetIndexes : typeof ge.datasetIndex == "number" ? [ge.datasetIndex] : []
1908
+ );
1909
+ re.add(X);
1910
+ const ae = new Set(
1911
+ Array.isArray(ge.datasetKeys) ? ge.datasetKeys : typeof ge.datasetKey == "string" && ge.datasetKey.trim().length > 0 ? [ge.datasetKey] : []
1912
+ );
1913
+ typeof C.datasetKey == "string" && C.datasetKey.trim().length > 0 && ae.add(C.datasetKey), h[ue] = {
1914
+ ...ge,
1915
+ datasetIndexes: Array.from(re).sort((pe, Ce) => pe - Ce),
1916
+ datasetKeys: Array.from(ae),
1917
+ hidden: ge.hidden === !0 && C.hidden === !0
1918
+ };
1919
+ }
1920
+ return h;
1921
+ }
1922
+ function ft(l) {
1923
+ var E, ue, ge, re, ae, pe;
1924
+ const m = l == null ? void 0 : l.legend;
1925
+ if (typeof (m == null ? void 0 : m.buildLabels) == "function")
1926
+ try {
1927
+ m.buildLabels();
1928
+ } catch {
1929
+ }
1930
+ const h = Xe(m == null ? void 0 : m.legendItems);
1931
+ if (h.length > 0)
1932
+ return h;
1933
+ const C = (ue = (E = l == null ? void 0 : l.options) == null ? void 0 : E.plugins) == null ? void 0 : ue.legend, V = C == null ? void 0 : C.labels, X = V == null ? void 0 : V.generateLabels, Z = (pe = (ae = (re = (ge = vn.defaults) == null ? void 0 : ge.plugins) == null ? void 0 : re.legend) == null ? void 0 : ae.labels) == null ? void 0 : pe.generateLabels;
1934
+ let te = Xe(
1935
+ typeof X == "function" ? X(l) : []
1936
+ );
1937
+ return te.length === 0 && typeof Z == "function" && (te = Xe(Z(l))), typeof (V == null ? void 0 : V.filter) == "function" && (te = te.filter((Ce) => V.filter(Ce, l.data))), typeof (V == null ? void 0 : V.sort) == "function" && (te = [...te].sort((Ce, Me) => V.sort(Ce, Me, l.data))), (C == null ? void 0 : C.reverse) === !0 && (te = [...te].reverse()), te;
1938
+ }
1939
+ function ht(l) {
1940
+ var h;
1941
+ return (Array.isArray((h = l == null ? void 0 : l.data) == null ? void 0 : h.datasets) ? l.data.datasets : []).map((C, V) => {
1942
+ const X = Se((C == null ? void 0 : C.borderColor) ?? (C == null ? void 0 : C.backgroundColor)), Z = Ct({
1943
+ datasetIndex: V,
1944
+ label: C == null ? void 0 : C.label
1945
+ });
1946
+ return {
1947
+ text: tt.value(C == null ? void 0 : C.label, C),
1948
+ fillStyle: X,
1949
+ strokeStyle: X,
1950
+ datasetIndex: V,
1951
+ datasetKey: Z,
1952
+ hidden: Array.isArray(t.hiddenDatasetKeys) ? t.hiddenDatasetKeys.includes(Z) : typeof l.isDatasetVisible == "function" ? !l.isDatasetVisible(V) : !1
1953
+ };
1954
+ });
1955
+ }
1956
+ const mt = x(() => `(${r("report.widget.legend.comparison")})`), tt = x(
1957
+ () => (l, m) => {
1958
+ const h = l == null ? "" : String(l).trim();
1959
+ if (h.length === 0) return h;
1960
+ const C = mt.value;
1961
+ return h.endsWith(` ${C}`) || h.endsWith(C) ? h : (m == null ? void 0 : m.dash) === !0 || (m == null ? void 0 : m.isCompare) === !0 ? `${h} ${C}` : h;
1962
+ }
1963
+ );
1964
+ function nt(l, m) {
1965
+ if (!Array.isArray(l) || l.length === 0)
1966
+ return [];
1967
+ const h = l, C = h[0], V = Array.isArray(C == null ? void 0 : C.labels) ? C.labels : [], X = Array.isArray(m == null ? void 0 : m.metrics) ? m.metrics : [], Z = V.length > 0 ? V : X, te = C == null ? void 0 : C.backgroundColor;
1968
+ return h.length === 1 && Array.isArray(te) && te.length > 1 ? te.map((E, ue) => ({
1969
+ text: Z[ue] == null || String(Z[ue]).trim().length === 0 ? `Series ${ue + 1}` : String(Z[ue]),
1970
+ fillStyle: Se(E),
1971
+ strokeStyle: Se(E),
1972
+ datasetIndex: 0,
1973
+ index: ue,
1974
+ hidden: Ke(ue)
1975
+ })) : h.map((E, ue) => ({
1976
+ datasetKey: Ct({
1977
+ datasetIndex: ue,
1978
+ label: E == null ? void 0 : E.label
1979
+ }),
1980
+ text: tt.value(E == null ? void 0 : E.label, E),
1981
+ fillStyle: Se(
1982
+ (E == null ? void 0 : E.color) ?? (E == null ? void 0 : E.borderColor) ?? (E == null ? void 0 : E.backgroundColor) ?? (E == null ? void 0 : E.pointBackgroundColor)
1983
+ ),
1984
+ strokeStyle: Se(
1985
+ (E == null ? void 0 : E.color) ?? (E == null ? void 0 : E.borderColor) ?? (E == null ? void 0 : E.backgroundColor) ?? (E == null ? void 0 : E.pointBorderColor)
1986
+ ),
1987
+ datasetIndex: ue,
1988
+ hidden: Array.isArray(t.hiddenDatasetKeys) ? t.hiddenDatasetKeys.includes(
1989
+ Ct({
1990
+ datasetIndex: ue,
1991
+ label: E == null ? void 0 : E.label
1992
+ })
1993
+ ) : !!(E != null && E.hidden)
1994
+ }));
1995
+ }
1996
+ function pt() {
1997
+ var m;
1998
+ const l = (m = t.chartRef) == null ? void 0 : m.datasets;
1999
+ return Array.isArray(l) ? l : [];
2000
+ }
2001
+ function $e(l, m) {
2002
+ return typeof l.datasetKey == "string" && l.datasetKey.trim().length > 0 ? `dataset-key:${l.datasetKey}` : typeof l.datasetIndex == "number" && typeof l.index == "number" ? `dataset:${l.datasetIndex}-item:${l.index}` : typeof l.datasetIndex == "number" ? `dataset:${l.datasetIndex}` : typeof l.index == "number" ? `item:${l.index}` : typeof l.text == "string" && l.text.trim().length > 0 ? `text:${l.text.trim()}` : `fallback:${m}`;
2003
+ }
2004
+ function ot() {
2005
+ const l = p.value;
2006
+ return l ? Math.ceil(l.getBoundingClientRect().width) : 0;
2007
+ }
2008
+ function Ut() {
2009
+ const l = p.value;
2010
+ return l ? Math.ceil(l.getBoundingClientRect().height) : 0;
2011
+ }
2012
+ function Kt(l, m) {
2013
+ var re;
2014
+ const h = y.value;
2015
+ if (!h || l.length === 0)
2016
+ return 0;
2017
+ const C = Math.max(0, m - to), V = window.getComputedStyle(h);
2018
+ if (V.flexDirection.startsWith("column")) {
2019
+ const ae = Number.parseFloat(V.rowGap || V.gap || "0") || 0, pe = Ut();
2020
+ let Ce = 0, Me = 0;
2021
+ for (let He = 0; He < l.length; He += 1) {
2022
+ const Pe = l[He];
2023
+ if (!Pe)
2024
+ continue;
2025
+ const at = Ce + (Me > 0 ? ae : 0) + Pe.offsetHeight, We = l.length - (He + 1) > 0 ? ae + pe : 0;
2026
+ if (at + We > C)
2027
+ break;
2028
+ Ce = at, Me += 1;
2029
+ }
2030
+ return Me > 0 ? Me : 1;
2031
+ }
2032
+ const Z = ((re = l[0]) == null ? void 0 : re.offsetTop) ?? 0, te = l.filter(
2033
+ (ae) => ae.offsetTop - Z + ae.offsetHeight <= C
2034
+ );
2035
+ if (te.length === 0)
2036
+ return 0;
2037
+ if (te.length >= l.length)
2038
+ return te.length;
2039
+ const E = ot();
2040
+ if (E <= 0)
2041
+ return Math.max(1, te.length - 1);
2042
+ const ue = Number.parseFloat(V.columnGap || V.gap || "0") || 0, ge = h.clientWidth;
2043
+ for (let ae = te.length; ae > 0; ae -= 1) {
2044
+ const pe = te.slice(0, ae), Ce = pe[pe.length - 1];
2045
+ if (!Ce)
2046
+ continue;
2047
+ if (Ce.offsetLeft + Ce.offsetWidth + ue + E <= ge)
2048
+ return ae;
2049
+ }
2050
+ return 1;
2051
+ }
2052
+ function Pt() {
2053
+ const l = y.value;
2054
+ if (!l) {
2055
+ v.value = !1, R.value = 0, c.value = 0, z(), b();
2056
+ return;
2057
+ }
2058
+ const m = Array.from(
2059
+ l.querySelectorAll(".chart-legend-item[data-legend-data='true']")
2060
+ );
2061
+ if (m.length === 0) {
2062
+ v.value = !1, R.value = 0, c.value = 0, z(), b();
2063
+ return;
2064
+ }
2065
+ const h = Array.from(new Set(m.map((ae) => ae.offsetTop))).sort((ae, pe) => ae - pe), C = !d.value && s.value.length > m.length, V = !d.value && !C, X = V || R.value <= 0 ? ie() : R.value;
2066
+ if ((V || R.value <= 0) && (R.value = X), C) {
2067
+ const ae = ie();
2068
+ if (ae > 0 && (R.value = ae), window.getComputedStyle(l).flexDirection.startsWith("column") && c.value < s.value.length) {
2069
+ const Me = Math.max(0, R.value - to), He = l.scrollHeight;
2070
+ if (He + 1 < Me) {
2071
+ const Pe = m.map((Be) => Be.offsetHeight).filter((Be) => Number.isFinite(Be) && Be > 0), at = Pe.length > 0 ? Pe.reduce((Be, We) => Be + We, 0) / Pe.length : 0;
2072
+ if (at > 0) {
2073
+ const Be = window.getComputedStyle(l), We = Number.parseFloat(Be.rowGap || Be.gap || "0") || 0, qt = Math.max(1, at + We), un = Me - He, Gt = Math.floor(un / qt);
2074
+ if (Gt > 0) {
2075
+ c.value = Math.min(
2076
+ s.value.length,
2077
+ c.value + Gt
2078
+ ), Ye();
2079
+ return;
2080
+ }
2081
+ }
2082
+ }
2083
+ }
2084
+ v.value = !0, z(), b();
2085
+ return;
2086
+ }
2087
+ const Z = h[0] ?? 0, te = h[h.length - 1] ?? Z, E = m.filter((ae) => ae.offsetTop === te), ue = Math.max(...E.map((ae) => ae.offsetHeight), 0), ge = Math.max(0, te - Z + ue), re = Kt(m, X);
2088
+ (V || c.value <= 0) && (c.value = Math.max(0, re)), v.value = ge > X, z(), b();
2089
+ }
2090
+ function Ye() {
2091
+ ut(() => {
2092
+ Pt(), window.requestAnimationFrame(() => {
2093
+ Pt(), _(), b();
2094
+ });
2095
+ });
2096
+ }
2097
+ const It = x(() => {
2098
+ const l = {
2099
+ "--legend-text-color": I.value,
2100
+ "--legend-font-size": `${M.value}px`
2101
+ }, m = ie();
2102
+ if (f.value) {
2103
+ const h = be();
2104
+ return {
2105
+ ...l,
2106
+ width: "fit-content",
2107
+ maxWidth: `${h}px`,
2108
+ maxHeight: `${m}px`,
2109
+ minWidth: "0",
2110
+ flex: "0 1 auto"
2111
+ };
2112
+ }
2113
+ return {
2114
+ ...l,
2115
+ maxHeight: `${m}px`,
2116
+ flex: "0 0 auto"
2117
+ };
2118
+ }), Mt = x(() => {
2119
+ if (d.value || !v.value)
2120
+ return s.value;
2121
+ const l = Math.max(1, c.value), m = f.value ? l : Math.max(0, l - 1);
2122
+ return s.value.slice(0, Math.min(m, s.value.length));
2123
+ }), qe = x(() => D.value ? v.value && d.value ? {
2124
+ flex: "1 1 auto",
2125
+ minHeight: "0",
2126
+ overflowY: "auto"
2127
+ } : v.value ? {
2128
+ overflow: "hidden"
2129
+ } : {} : {});
2130
+ function Ge() {
2131
+ var C;
2132
+ if (!D.value) {
2133
+ s.value = [], c.value = 0, d.value = !1, v.value = !1, R.value = 0, G({ height: 0, width: 0 });
2134
+ return;
2135
+ }
2136
+ c.value = 0, v.value = !1, R.value = 0;
2137
+ const l = Y();
2138
+ if (!l) {
2139
+ s.value = et(
2140
+ nt(t.legendUpdateKey, t.chartRef)
2141
+ ), Ye();
2142
+ return;
2143
+ }
2144
+ try {
2145
+ s.value = ft(l);
2146
+ } catch {
2147
+ s.value = [];
2148
+ }
2149
+ const m = Array.isArray((C = l == null ? void 0 : l.data) == null ? void 0 : C.datasets) ? l.data.datasets : [];
2150
+ s.value.length === 0 && (s.value = nt(t.legendUpdateKey, t.chartRef)), s.value.length === 0 && (s.value = ht(l)), s.value = Dt(et(s.value));
2151
+ const h = Array.isArray(t.legendUpdateKey) && t.legendUpdateKey.length > 0 || !Array.isArray(t.legendUpdateKey) && !!t.legendUpdateKey;
2152
+ s.value.length === 0 && !(m.length > 0 || h) && U(0), Ye();
2153
+ }
2154
+ function Xt(l) {
2155
+ return Array.isArray(l.datasetIndexes) && l.datasetIndexes.length > 0 ? l.datasetIndexes.filter((m) => Number.isInteger(m)) : typeof l.datasetIndex == "number" ? [l.datasetIndex] : [];
2156
+ }
2157
+ function _e(l, m) {
2158
+ return Array.isArray(l.datasetKeys) && l.datasetKeys.length > 0 ? l.datasetKeys.filter((h) => typeof h == "string" && h.trim().length > 0) : typeof l.datasetKey == "string" && l.datasetKey.trim().length > 0 ? [l.datasetKey] : m.map(
2159
+ (h) => Ct({
2160
+ datasetIndex: h,
2161
+ label: l.text
2162
+ })
2163
+ );
2164
+ }
2165
+ function Bt(l, m) {
2166
+ s.value = s.value.map(
2167
+ (h) => l(h) ? {
2168
+ ...h,
2169
+ hidden: m
2170
+ } : h
2171
+ );
2172
+ }
2173
+ function rn(l, m, h) {
2174
+ var V;
2175
+ typeof l.setDatasetVisibility == "function" ? l.setDatasetVisibility(m, h) : h && typeof l.show == "function" ? l.show(m) : !h && typeof l.hide == "function" && l.hide(m);
2176
+ const C = Array.isArray((V = l == null ? void 0 : l.data) == null ? void 0 : V.datasets) ? l.data.datasets[m] : null;
2177
+ C && typeof C == "object" && (C.hidden = !h);
2178
+ }
2179
+ function ln(l, m) {
2180
+ var Z;
2181
+ if (typeof l.toggleDataVisibility == "function") {
2182
+ l.toggleDataVisibility(m);
2183
+ return;
2184
+ }
2185
+ const h = Array.isArray((Z = l == null ? void 0 : l.data) == null ? void 0 : Z.datasets) ? l.data.datasets[0] : null, C = Array.isArray(h == null ? void 0 : h.data) ? h.data : [];
2186
+ if (m < 0 || m >= C.length)
2187
+ return;
2188
+ const V = typeof l.getDatasetMeta == "function" ? l.getDatasetMeta(0) : null, X = Array.isArray(V == null ? void 0 : V.data) ? V.data[m] : null;
2189
+ X && typeof X.hidden == "boolean" && (X.hidden = !X.hidden);
2190
+ }
2191
+ function Yt(l = 0) {
2192
+ Ge();
2193
+ const m = Y(), h = s.value.length > 0;
2194
+ if (m || h || l >= Mr) {
2195
+ j();
2196
+ return;
2197
+ }
2198
+ j(), L = window.setTimeout(() => {
2199
+ Yt(l + 1);
2200
+ }, Ir);
2201
+ }
2202
+ function gt(l, m) {
2203
+ var ge;
2204
+ const h = Y(), C = String(((ge = h == null ? void 0 : h.config) == null ? void 0 : ge.type) ?? ""), V = C === "pie" || C === "doughnut" || C === "polarArea", X = typeof l.index == "number" ? l.index : typeof m == "number" ? m : null;
2205
+ if ((V || typeof l.index == "number") && typeof X == "number") {
2206
+ if (Array.isArray(t.hiddenDataPointIndexes)) {
2207
+ o("toggleDataPointVisibility", { itemIndex: X });
2208
+ return;
2209
+ }
2210
+ h && (ln(h, X), h.update());
2211
+ const re = h && typeof h.getDataVisibility == "function" ? !h.getDataVisibility(X) : l.hidden !== !0;
2212
+ Bt(
2213
+ (ae) => typeof ae.index == "number" ? ae.index === X : ae.datasetIndex === l.datasetIndex && ae.text === l.text,
2214
+ re
2215
+ );
2216
+ return;
2217
+ }
2218
+ const te = Xt(l), E = _e(l, te);
2219
+ if (Array.isArray(t.hiddenDatasetKeys) && te.length > 0) {
2220
+ te.forEach((re, ae) => {
2221
+ o("toggleDatasetVisibility", {
2222
+ datasetIndex: re,
2223
+ datasetKey: E[ae] ?? Ct({
2224
+ datasetIndex: re,
2225
+ label: l.text
2226
+ })
2227
+ });
2228
+ });
2229
+ return;
2230
+ }
2231
+ const ue = pt();
2232
+ if (!h) {
2233
+ if (te.length > 0) {
2234
+ const re = l.hidden !== !0;
2235
+ te.forEach((ae) => {
2236
+ const pe = ue[ae];
2237
+ pe && typeof pe == "object" && (pe.hidden = re);
2238
+ }), Bt(
2239
+ (ae) => $e(ae, 0) === $e(l, 0),
2240
+ re
2241
+ );
2242
+ }
2243
+ return;
2244
+ }
2245
+ if (te.length > 0) {
2246
+ const ae = !te.every(
2247
+ (pe) => typeof h.isDatasetVisible == "function" ? h.isDatasetVisible(pe) : l.hidden !== !0
2248
+ );
2249
+ te.forEach((pe) => {
2250
+ rn(h, pe, ae);
2251
+ const Ce = ue[pe];
2252
+ Ce && typeof Ce == "object" && (Ce.hidden = !ae);
2253
+ }), h.update(), Bt(
2254
+ (pe) => $e(pe, 0) === $e(l, 0),
2255
+ !ae
2256
+ );
2257
+ }
2258
+ }
2259
+ function je() {
2260
+ d.value = !0, Ye();
2261
+ }
2262
+ function sn() {
2263
+ d.value = !1, y.value && (y.value.scrollTop = 0), Ye();
2264
+ }
2265
+ return ct(() => {
2266
+ Yt(), window.addEventListener("mousemove", q), window.addEventListener("mouseup", $);
2267
+ }), De(
2268
+ () => [
2269
+ t.enabled,
2270
+ t.legendUpdateKey,
2271
+ t.hiddenDatasetKeys,
2272
+ t.hiddenDataPointIndexes,
2273
+ i.value
2274
+ ],
2275
+ () => {
2276
+ Ge();
2277
+ }
2278
+ ), lo(() => {
2279
+ g.value = !1, j(), G({ height: 0, width: 0 }), window.removeEventListener("mousemove", q), window.removeEventListener("mouseup", $);
2280
+ }), (l, m) => D.value ? (J(), ce("div", {
2281
+ key: 0,
2282
+ ref_key: "legendPanelRef",
2283
+ ref: W,
2284
+ class: Le(["chart-legend-panel relative z-[2] flex min-w-0 flex-col overflow-hidden pointer-events-auto", {
2285
+ "self-stretch h-full pt-2": f.value,
2286
+ "mb-2": !f.value && l.position === "top",
2287
+ "mt-2": !f.value && l.position === "bottom"
2288
+ }]),
2289
+ style: Te(It.value)
2290
+ }, [
2291
+ ee("div", {
2292
+ ref_key: "legendScrollShellRef",
2293
+ ref: H,
2294
+ class: "relative z-[2] flex flex-1 min-h-0 flex-col overflow-hidden"
2295
+ }, [
2296
+ ee("div", {
2297
+ ref_key: "legendToggleMeasureRef",
2298
+ ref: p,
2299
+ class: "absolute invisible pointer-events-none left-0 top-0 z-[2] inline-flex max-w-full select-none"
2300
+ }, [
2301
+ ee("button", kr, Ae(a(r)("report.widget.legend.viewMore")), 1)
2302
+ ], 512),
2303
+ ee("ul", {
2304
+ ref_key: "legendListRef",
2305
+ ref: y,
2306
+ class: Le(["chart-legend-list m-0 flex list-none p-0", [
2307
+ f.value ? "flex-row flex-wrap justify-start gap-x-3 gap-y-2 pt-1" : "flex-wrap justify-center gap-x-2 gap-y-1 pt-1"
2308
+ ]]),
2309
+ style: Te(qe.value),
2310
+ onScroll: O
2311
+ }, [
2312
+ (J(!0), ce(ze, null, Nt(Mt.value, (h, C) => (J(), ce("li", {
2313
+ key: $e(h, C),
2314
+ class: Le(["chart-legend-item relative z-[2] inline-flex max-w-full cursor-pointer select-none pointer-events-auto", {
2315
+ "opacity-45": h.hidden
2316
+ }]),
2317
+ "data-legend-data": "true"
2318
+ }, [
2319
+ ee("button", {
2320
+ type: "button",
2321
+ class: Le(["inline-flex max-w-full items-center gap-1.5 border-none bg-transparent p-0", { "justify-start text-left": f.value }]),
2322
+ "aria-pressed": h.hidden === !0 ? "false" : "true",
2323
+ onClick: Qt((V) => gt(h, C), ["stop"])
2324
+ }, [
2325
+ t.usePointStyle !== !1 ? (J(), ce("span", {
2326
+ key: 0,
2327
+ class: "h-5 w-5 shrink-0 rounded-full",
2328
+ style: Te({ backgroundColor: we(h, C) })
2329
+ }, null, 4)) : (J(), ce("span", {
2330
+ key: 1,
2331
+ class: "h-5 w-5 shrink-0 rounded-sm border border-solid border-gray-300",
2332
+ style: Te({
2333
+ backgroundColor: we(h, C),
2334
+ borderColor: "#c7c7cc"
2335
+ })
2336
+ }, null, 4)),
2337
+ ee("span", {
2338
+ class: Le(["chart-legend-text leading-[1.4]", {
2339
+ "max-w-[120px] whitespace-nowrap overflow-hidden text-left": f.value,
2340
+ "whitespace-nowrap overflow-hidden": !f.value,
2341
+ "line-through": h.hidden
2342
+ }]),
2343
+ title: h.text ?? ""
2344
+ }, Ae(h.text), 11, Lr)
2345
+ ], 10, Tr)
2346
+ ], 2))), 128)),
2347
+ v.value ? (J(), ce("li", Dr, [
2348
+ ee("button", {
2349
+ type: "button",
2350
+ class: "inline-flex max-w-full cursor-pointer select-none underline items-center gap-1 rounded px-1 py-0.5 border-none bg-transparent text-fm-color-system-info-300 leading-[1.4] transition-colors hover:bg-black/5",
2351
+ style: { fontSize: "var(--legend-font-size)" },
2352
+ onClick: m[0] || (m[0] = Qt((h) => d.value ? sn() : je(), ["stop"]))
2353
+ }, Ae(d.value ? a(r)("report.widget.legend.viewLess") : a(r)("report.widget.legend.viewMore")), 1)
2354
+ ])) : ve("", !0)
2355
+ ], 38),
2356
+ A.value ? (J(), ce("div", {
2357
+ key: 0,
2358
+ class: "absolute top-0 right-0 h-full w-2 rounded-full bg-transparent",
2359
+ onMousedown: N
2360
+ }, [
2361
+ ee("div", {
2362
+ class: "absolute left-0 w-full rounded-full bg-gray-500/60 cursor-pointer hover:bg-gray-500/85",
2363
+ style: Te(u.value),
2364
+ onMousedown: Qt(K, ["stop"])
2365
+ }, null, 36)
2366
+ ], 32)) : ve("", !0)
2367
+ ], 512)
2368
+ ], 6)) : ve("", !0);
2369
+ }
2370
+ }), Fe = /* @__PURE__ */ ho(Br, [["__scopeId", "data-v-a258ca90"]]);
2371
+ function Ar(e, n) {
2372
+ const { t } = dt(), { breakpoints: o } = Vt(), r = P(!1), i = P(null), s = P(null);
2373
+ function c() {
2374
+ return To(e.value) ?? s.value;
2375
+ }
2376
+ function d(y) {
2377
+ r.value = y, !y && (i.value = null, tn(c()), s.value = null);
2378
+ }
2379
+ function v(y, p) {
2380
+ i.value = y, s.value = p ?? c(), r.value = !0;
2381
+ }
2382
+ function R(y) {
2383
+ tn(c(), y.focusTarget);
2384
+ }
2385
+ function W() {
2386
+ tn(c());
2387
+ }
2388
+ const H = x(() => ({
2389
+ viewFullDetailsLabel: o.value.xs || o.value.sm ? t("report.widget.comparisonTooltip.doubleClickViewBreakdown") : t("report.widget.comparisonTooltip.viewBreakdown"),
2390
+ onViewFullDetails: v,
2391
+ maxTooltipItems: a(n == null ? void 0 : n.maxTooltipItems)
2392
+ }));
2393
+ return {
2394
+ isTooltipDetailsSheetOpen: r,
2395
+ tooltipDetailsPayload: i,
2396
+ tooltipOptions: H,
2397
+ handleTooltipDetailsSheetVisibility: d,
2398
+ handleTooltipDetailsHover: R,
2399
+ handleTooltipDetailsLeave: W
2400
+ };
2401
+ }
2402
+ function Rr(e) {
2403
+ const n = P([]), t = x(() => new Set(n.value));
2404
+ function o(s, c) {
2405
+ return Ct({
2406
+ datasetIndex: c,
2407
+ label: s == null ? void 0 : s.label
2408
+ });
2409
+ }
2410
+ function r(s, c) {
2411
+ return t.value.has(o(s, c));
2412
+ }
2413
+ function i({ datasetIndex: s, datasetKey: c }) {
2414
+ const d = c ?? o(e.value[s], s);
2415
+ if (t.value.has(d)) {
2416
+ n.value = n.value.filter((v) => v !== d);
2417
+ return;
2418
+ }
2419
+ n.value = [...n.value, d];
2420
+ }
2421
+ return De(
2422
+ e,
2423
+ (s) => {
2424
+ const c = new Set(
2425
+ s.map((v, R) => o(v, R))
2426
+ ), d = n.value.filter((v) => c.has(v));
2427
+ d.length !== n.value.length && (n.value = d);
2428
+ },
2429
+ { immediate: !0 }
2430
+ ), {
2431
+ hiddenDatasetKeys: n,
2432
+ isDatasetHidden: r,
2433
+ toggleDatasetVisibility: i
2434
+ };
2435
+ }
2436
+ function Et({ chartRef: e, model: n, baseDatasets: t, tileIndex: o }) {
2437
+ const r = uo(), i = x(() => n.value.maxTooltipItems), {
2438
+ isTooltipDetailsSheetOpen: s,
2439
+ tooltipDetailsPayload: c,
2440
+ tooltipOptions: d,
2441
+ handleTooltipDetailsSheetVisibility: v,
2442
+ handleTooltipDetailsHover: R,
2443
+ handleTooltipDetailsLeave: W
2444
+ } = Ar(e, {
2445
+ maxTooltipItems: i
2446
+ }), { datalabels: H, xCfg: y, yCfg: p, isTransposed: k, legend: w, chartWidth: F, chartHeight: g } = Io(
2447
+ n.value
2448
+ ), S = x(
2449
+ () => Po(n.value.isTransposed === !0, d.value)
2450
+ ), B = x(() => {
2451
+ const G = w.value.position;
2452
+ return !G || G === "top" || G === "bottom" || G === "left" || G === "right";
2453
+ }), D = x(() => w.value.position ?? "top"), f = x(
2454
+ () => D.value === "left" || D.value === "right"
2455
+ ), L = x(
2456
+ () => D.value === "top" || D.value === "left"
2457
+ ), { hiddenDatasetKeys: A, isDatasetHidden: u, toggleDatasetVisibility: I } = Rr(t), M = x(() => t.value.map((G, j) => ({
2458
+ ...G,
2459
+ hidden: u(G, j)
2460
+ })));
2461
+ function U() {
2462
+ r.extractChartSize(e.value, o);
2463
+ }
2464
+ return ct(() => {
2465
+ ut(() => {
2466
+ U();
2467
+ });
2468
+ }), De([M], () => {
2469
+ ut(() => {
2470
+ U();
2471
+ });
2472
+ }), {
2473
+ isTooltipDetailsSheetOpen: s,
2474
+ tooltipDetailsPayload: c,
2475
+ handleTooltipDetailsSheetVisibility: v,
2476
+ handleTooltipDetailsHover: R,
2477
+ handleTooltipDetailsLeave: W,
2478
+ comparisonTooltip: S,
2479
+ datalabels: H,
2480
+ xCfg: y,
2481
+ yCfg: p,
2482
+ isTransposed: k,
2483
+ legend: w,
2484
+ chartWidth: F,
2485
+ chartHeight: g,
2486
+ useCustomLegend: B,
2487
+ legendPosition: D,
2488
+ isLegendSide: f,
2489
+ isLegendBeforeChart: L,
2490
+ hiddenDatasetKeys: A,
2491
+ toggleDatasetVisibility: I,
2492
+ datasets: M
2493
+ };
2494
+ }
2495
+ const Fr = { class: "widget-content" }, Nr = 2, mn = 1, oo = "rgba(0, 0, 0, 0)", $r = /* @__PURE__ */ Ne({
2496
+ __name: "WidgetBarchart",
2497
+ props: /* @__PURE__ */ Ue({
2498
+ tileIndex: {}
2499
+ }, {
2500
+ modelValue: { required: !0 },
2501
+ modelModifiers: {}
2502
+ }),
2503
+ emits: ["update:modelValue"],
2504
+ setup(e) {
2505
+ const n = e, t = Oe(e, "modelValue"), o = P(null), r = x(() => {
2506
+ var b;
2507
+ return ((b = t.value.data) == null ? void 0 : b.datasets) ?? [];
2508
+ }), i = x(() => {
2509
+ var b;
2510
+ return ((b = t.value.data) == null ? void 0 : b.xAxis) ?? [];
2511
+ }), s = x(() => i.value.length === 1 && r.value.length > 1 && r.value.every((b) => b.values.length === 1 && b.isCompare !== !0)), c = x(() => s.value ? r.value.map((b) => b.name) : i.value), d = x(() => i.value.length === 1 && r.value.some((b) => b.isCompare === !0)), v = Wt("bar");
2512
+ function R(b) {
2513
+ return {
2514
+ label: `__comparison_gap__${b}`,
2515
+ data: [0],
2516
+ backgroundColor: oo,
2517
+ borderColor: oo,
2518
+ minBarLength: 0,
2519
+ barPercentage: mn,
2520
+ isSpacer: !0
2521
+ };
2522
+ }
2523
+ const W = x(() => r.value.length > 0 ? [
2524
+ ...r.value.map((b, O) => {
2525
+ const N = zt({
2526
+ datasets: r.value,
2527
+ datasetIndex: O
2528
+ }), K = Ie({
2529
+ datasetIndex: N,
2530
+ isCompare: !1,
2531
+ metricCount: t.value.metricCount,
2532
+ mode: t.value.chartColorBinding
2533
+ }), q = Ie({
2534
+ datasetIndex: N,
2535
+ isCompare: !1,
2536
+ metricCount: t.value.metricCount,
2537
+ mode: xe.metric
2538
+ });
2539
+ let $ = b.values;
2540
+ s.value && ($ = r.value.map(
2541
+ (se, ye) => ye === O ? b.values[0] : NaN
2542
+ ));
2543
+ const Q = t.value.chartColorBinding === xe.breakdown, oe = _t({
2544
+ fallbackIndex: N,
2545
+ metricCount: t.value.metricCount
2546
+ }), le = $.map((se) => se === null ? NaN : Number(se));
2547
+ return {
2548
+ label: b.name,
2549
+ data: le,
2550
+ dash: !!b.isCompare,
2551
+ minBarLength: Nr,
2552
+ barPercentage: d.value ? mn : void 0,
2553
+ backgroundColor: Q ? Lt({
2554
+ breakdownIndex: oe,
2555
+ metricIndex: q,
2556
+ metricCount: t.value.metricCount,
2557
+ isCompare: b.isCompare,
2558
+ breakdownColors: t.value.chartBreakdownColors,
2559
+ useSecondaryMetricShades: t.value.chartUseSecondaryMetricShades,
2560
+ customColors: t.value.chartColors
2561
+ }) : Ze({
2562
+ index: K,
2563
+ isCompare: b.isCompare,
2564
+ customColors: t.value.chartColors
2565
+ })
2566
+ };
2567
+ })
2568
+ ] : []), {
2569
+ isTooltipDetailsSheetOpen: H,
2570
+ tooltipDetailsPayload: y,
2571
+ handleTooltipDetailsSheetVisibility: p,
2572
+ handleTooltipDetailsHover: k,
2573
+ handleTooltipDetailsLeave: w,
2574
+ comparisonTooltip: F,
2575
+ datalabels: g,
2576
+ xCfg: S,
2577
+ yCfg: B,
2578
+ isTransposed: D,
2579
+ legend: f,
2580
+ chartWidth: L,
2581
+ chartHeight: A,
2582
+ useCustomLegend: u,
2583
+ legendPosition: I,
2584
+ isLegendSide: M,
2585
+ isLegendBeforeChart: U,
2586
+ hiddenDatasetKeys: G,
2587
+ toggleDatasetVisibility: j,
2588
+ datasets: Y
2589
+ } = Et({
2590
+ chartRef: o,
2591
+ model: t,
2592
+ baseDatasets: W,
2593
+ tileIndex: n.tileIndex
2594
+ }), z = x(() => {
2595
+ if (!d.value)
2596
+ return Y.value;
2597
+ const b = [];
2598
+ return Y.value.forEach((O, N) => {
2599
+ b.push({
2600
+ ...O,
2601
+ barPercentage: mn
2602
+ });
2603
+ const K = Y.value[N + 1];
2604
+ O.dash === !0 && K && b.push(R(N));
2605
+ }), b;
2606
+ }), _ = x(() => ({
2607
+ display: !1,
2608
+ labels: {
2609
+ filter: (b, O) => {
2610
+ var N, K;
2611
+ return !((K = (N = O.datasets) == null ? void 0 : N[b.datasetIndex ?? -1]) != null && K.isSpacer);
2612
+ }
2613
+ }
2614
+ }));
2615
+ return (b, O) => {
2616
+ var K, q, $, Q, oe, le;
2617
+ const N = fe("FmBarChart");
2618
+ return J(), ce(ze, null, [
2619
+ ee("div", Fr, [
2620
+ Qe(b.$slots, "menu"),
2621
+ ee("div", {
2622
+ class: Le(["chart-layout", {
2623
+ "chart-layout--side": a(u) && (a(f).display ?? !1) && a(M)
2624
+ }])
2625
+ }, [
2626
+ a(u) && (a(f).display ?? !1) && a(U) ? (J(), me(Fe, {
2627
+ key: 0,
2628
+ "chart-ref": o.value,
2629
+ enabled: a(f).display ?? !1,
2630
+ position: a(I),
2631
+ "max-width": a(f).maxWidth,
2632
+ "text-color": (K = a(f).labels) == null ? void 0 : K.color,
2633
+ "font-size": ($ = (q = a(f).labels) == null ? void 0 : q.font) == null ? void 0 : $.size,
2634
+ "legend-update-key": a(Y),
2635
+ "use-point-style": t.value.usePointStyle ?? !0,
2636
+ "chart-color-binding": t.value.chartColorBinding,
2637
+ "chart-colors": t.value.chartColors,
2638
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
2639
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
2640
+ "metric-count": t.value.metricCount,
2641
+ "hidden-dataset-keys": a(G),
2642
+ onToggleDatasetVisibility: a(j)
2643
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0),
2644
+ de(N, {
2645
+ ref_key: "chartRef",
2646
+ ref: o,
2647
+ class: "bar-chart",
2648
+ datasets: z.value,
2649
+ "x-axis": { categories: c.value },
2650
+ "x-cfg": a(S),
2651
+ "y-cfg": a(B),
2652
+ transpose: a(D),
2653
+ legend: _.value,
2654
+ tooltip: a(F),
2655
+ datalabels: a(g),
2656
+ plugins: [a(v)],
2657
+ "maintain-aspect-ratio": !1,
2658
+ style: Te({
2659
+ "--chart-width": a(u) && (a(f).display ?? !1) && a(M) ? "calc(100% - var(--legend-panel-width, 0px))" : a(L) !== void 0 ? a(L) + "px" : "100%",
2660
+ "--chart-height": a(u) && (a(f).display ?? !1) && !a(M) ? "calc(100% - 36px - var(--legend-panel-height, 0px))" : a(A) !== void 0 ? a(A) + "px" : "100%"
2661
+ })
2662
+ }, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "legend", "tooltip", "datalabels", "plugins", "style"]),
2663
+ a(u) && (a(f).display ?? !1) && !a(U) ? (J(), me(Fe, {
2664
+ key: 1,
2665
+ "chart-ref": o.value,
2666
+ enabled: a(f).display ?? !1,
2667
+ position: a(I),
2668
+ "max-width": a(f).maxWidth,
2669
+ "text-color": (Q = a(f).labels) == null ? void 0 : Q.color,
2670
+ "font-size": (le = (oe = a(f).labels) == null ? void 0 : oe.font) == null ? void 0 : le.size,
2671
+ "legend-update-key": a(Y),
2672
+ "use-point-style": t.value.usePointStyle ?? !0,
2673
+ "chart-color-binding": t.value.chartColorBinding,
2674
+ "chart-colors": t.value.chartColors,
2675
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
2676
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
2677
+ "metric-count": t.value.metricCount,
2678
+ "hidden-dataset-keys": a(G),
2679
+ onToggleDatasetVisibility: a(j)
2680
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0)
2681
+ ], 2)
2682
+ ]),
2683
+ de(Ot, {
2684
+ "model-value": a(H),
2685
+ "details-payload": a(y),
2686
+ "onUpdate:modelValue": a(p),
2687
+ onValueHover: a(k),
2688
+ onValueLeave: a(w)
2689
+ }, null, 8, ["model-value", "details-payload", "onUpdate:modelValue", "onValueHover", "onValueLeave"])
2690
+ ], 64);
2691
+ };
2692
+ }
2693
+ }), Vr = { class: "widget-content" }, zr = /* @__PURE__ */ Ne({
2694
+ __name: "WidgetCircular",
2695
+ props: /* @__PURE__ */ Ue({
2696
+ tileIndex: {}
2697
+ }, {
2698
+ modelValue: { required: !0 },
2699
+ modelModifiers: {}
2700
+ }),
2701
+ emits: ["update:modelValue"],
2702
+ setup(e) {
2703
+ const n = e, t = Oe(e, "modelValue"), { breakpoints: o } = Vt(), r = P(null), i = P([]), { datalabels: s, legend: c, chartWidth: d, chartHeight: v } = Io(t.value), R = x(() => {
2704
+ const u = Array.isArray(t.value.data.datasets) ? t.value.data.datasets.map((I) => I.name) : [];
2705
+ return u.length > 0 ? u : Array.isArray(t.value.data.metrics) ? t.value.data.metrics.map((I) => String(I)) : [];
2706
+ }), W = x(() => {
2707
+ let u = [];
2708
+ return Array.isArray(t.value.data.datasets) && t.value.data.datasets.length > 0 && (u = [
2709
+ {
2710
+ label: R.value[0] ?? (Array.isArray(t.value.data.metrics) && t.value.data.metrics.length > 0 ? String(t.value.data.metrics[0]) : "Series"),
2711
+ labels: R.value,
2712
+ data: t.value.data.datasets.map(
2713
+ (M, U) => i.value.includes(U) ? null : M.value
2714
+ ),
2715
+ backgroundColor: t.value.data.datasets.map(
2716
+ (M, U) => Ze({ index: U, customColors: t.value.chartColors })
2717
+ )
2718
+ }
2719
+ ]), u;
2720
+ }), H = uo();
2721
+ function y() {
2722
+ return H.extractChartSize(r.value, n.tileIndex) || { width: 0, height: 0 };
2723
+ }
2724
+ ct(() => {
2725
+ ut(() => {
2726
+ y();
2727
+ });
2728
+ }), De([W], () => {
2729
+ ut(() => y());
2730
+ }), De(
2731
+ () => t.value.data.datasets,
2732
+ (u) => {
2733
+ const I = new Set(
2734
+ Array.isArray(u) ? u.map((M, U) => U) : []
2735
+ );
2736
+ i.value = i.value.filter(
2737
+ (M) => I.has(M)
2738
+ );
2739
+ },
2740
+ { deep: !0 }
2741
+ );
2742
+ const p = x(() => typeof t.value.legendFontSize == "number" ? t.value.legendFontSize : o.value.lg ? 12 : 8), k = x(() => {
2743
+ const u = c.value.position;
2744
+ return !u || u === "top" || u === "bottom" || u === "left" || u === "right";
2745
+ }), w = x(() => c.value.display !== !1), F = x(() => k.value && w.value), g = x(() => c.value.position ?? "top"), S = x(
2746
+ () => g.value === "left" || g.value === "right"
2747
+ ), B = x(
2748
+ () => g.value === "top" || g.value === "left"
2749
+ ), D = x(() => {
2750
+ var I;
2751
+ const u = (I = c.value.labels) == null ? void 0 : I.color;
2752
+ return typeof u == "string" && u.trim().length > 0 ? u : t.value.legendColor ?? "#6b6b6b";
2753
+ }), f = x(() => p.value), L = ga();
2754
+ function A({ itemIndex: u }) {
2755
+ if (i.value.includes(u)) {
2756
+ i.value = i.value.filter(
2757
+ (I) => I !== u
2758
+ );
2759
+ return;
2760
+ }
2761
+ i.value = [...i.value, u];
2762
+ }
2763
+ return (u, I) => {
2764
+ const M = fe("FmPieChart");
2765
+ return J(), ce("div", Vr, [
2766
+ Qe(u.$slots, "menu"),
2767
+ ee("div", {
2768
+ class: Le(["chart-layout", {
2769
+ "chart-layout--side": F.value && S.value
2770
+ }])
2771
+ }, [
2772
+ F.value && B.value ? (J(), me(Fe, {
2773
+ key: 0,
2774
+ "chart-ref": r.value,
2775
+ enabled: w.value,
2776
+ position: g.value,
2777
+ "max-width": a(c).maxWidth,
2778
+ "text-color": D.value,
2779
+ "font-size": f.value,
2780
+ "legend-update-key": W.value,
2781
+ "use-point-style": t.value.usePointStyle ?? !0,
2782
+ "chart-color-binding": t.value.chartColorBinding,
2783
+ "chart-colors": t.value.chartColors,
2784
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
2785
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
2786
+ "metric-count": t.value.metricCount,
2787
+ "hidden-data-point-indexes": i.value,
2788
+ onToggleDataPointVisibility: A
2789
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-data-point-indexes"])) : ve("", !0),
2790
+ de(M, {
2791
+ ref_key: "chartRef",
2792
+ ref: r,
2793
+ class: "circular",
2794
+ percentage: "70%",
2795
+ datasets: W.value,
2796
+ metrics: R.value,
2797
+ tooltip: a(L),
2798
+ variant: "doughnut",
2799
+ legend: {
2800
+ display: !1
2801
+ },
2802
+ datalabels: a(s),
2803
+ "maintain-aspect-ratio": !1,
2804
+ style: Te({
2805
+ "--chart-width": F.value && S.value ? "calc(100% - var(--legend-panel-width, 0px))" : a(d) !== void 0 ? a(d) + "px" : "100%",
2806
+ "--chart-height": F.value && !S.value ? "calc(100% - var(--legend-panel-height, 0px))" : a(v) !== void 0 ? a(v) + "px" : "100%"
2807
+ })
2808
+ }, null, 8, ["datasets", "metrics", "tooltip", "datalabels", "style"]),
2809
+ F.value && !B.value ? (J(), me(Fe, {
2810
+ key: 1,
2811
+ "chart-ref": r.value,
2812
+ enabled: w.value,
2813
+ position: g.value,
2814
+ "max-width": a(c).maxWidth,
2815
+ "text-color": D.value,
2816
+ "font-size": f.value,
2817
+ "legend-update-key": W.value,
2818
+ "use-point-style": t.value.usePointStyle ?? !0,
2819
+ "chart-color-binding": t.value.chartColorBinding,
2820
+ "chart-colors": t.value.chartColors,
2821
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
2822
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
2823
+ "metric-count": t.value.metricCount,
2824
+ "hidden-data-point-indexes": i.value,
2825
+ onToggleDataPointVisibility: A
2826
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-data-point-indexes"])) : ve("", !0)
2827
+ ], 2)
2828
+ ]);
2829
+ };
2830
+ }
2831
+ });
2832
+ function nn(e) {
2833
+ if (e == null || e === "")
2834
+ return "";
2835
+ const n = String(e), t = Number(n);
2836
+ if (isNaN(t)) return n;
2837
+ const [o, r] = n.split("."), i = new Intl.NumberFormat("en-US").format(Number(o));
2838
+ return r !== void 0 ? `${i}.${r}` : i;
2839
+ }
2840
+ const Hr = { class: "flex flex-col gap-1" }, Wr = { class: "fm-typo-en-title-md-600" }, Or = { class: "flex gap-2" }, Er = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Ur = { key: 0 }, Kr = { key: 1 }, Xr = /* @__PURE__ */ Ne({
2841
+ __name: "WidgetScorecard",
2842
+ props: {
2843
+ modelValue: { required: !0 },
2844
+ modelModifiers: {}
2845
+ },
2846
+ emits: ["update:modelValue"],
2847
+ setup(e) {
2848
+ const n = Oe(e, "modelValue"), { t } = dt(), { compareDateRange: o, defaultDateSetting: r } = it(on()), { country: i } = Ln(), s = x(() => {
2849
+ var p;
2850
+ return ((p = n.value.data) == null ? void 0 : p.value) || "";
2851
+ }), c = x(() => nn(s.value)), d = x(() => {
2852
+ const { data: p } = n.value;
2853
+ return p != null && p.comparison ? Co(s.value, p.comparison, i) : null;
2854
+ });
2855
+ function v(p) {
2856
+ switch (p) {
2857
+ case yn.bar:
2858
+ return "bar";
2859
+ case yn.line:
2860
+ return "line";
2861
+ default:
2862
+ return "line";
2863
+ }
2864
+ }
2865
+ const R = x(() => {
2866
+ var p;
2867
+ return (p = n.value.data) == null ? void 0 : p.sparkline;
2868
+ }), W = x(() => ({
2869
+ display: !1,
2870
+ beginAtZero: !1,
2871
+ grace: "20%"
2872
+ })), H = x(() => R.value.datasets.map((p) => ({
2873
+ label: p.name,
2874
+ data: p.values,
2875
+ fill: !0,
2876
+ color: "#36a2eb"
2877
+ }))), y = x(() => Po(!1));
2878
+ return (p, k) => {
2879
+ const w = fe("FmIcon"), F = fe("FmChip"), g = fe("FmTooltip"), S = fe("FmLineChart");
2880
+ return J(), ce("div", Hr, [
2881
+ Qe(p.$slots, "menu"),
2882
+ ee("p", Wr, Ae(c.value), 1),
2883
+ ee("div", Or, [
2884
+ de(g, {
2885
+ disabled: d.value === null,
2886
+ placement: "right",
2887
+ "hide-arrow": "",
2888
+ variant: "rich"
2889
+ }, {
2890
+ content: ke(() => {
2891
+ var B;
2892
+ return [
2893
+ ee("span", Er, Ae(`vs. ${(B = a(r).defaultCompareType) == null ? void 0 : B.split("_").join(" ")}`), 1)
2894
+ ];
2895
+ }),
2896
+ default: ke(() => [
2897
+ d.value ? (J(), me(F, {
2898
+ key: 0,
2899
+ icon: d.value.icon.name,
2900
+ class: Le(`bg-${d.value.icon.tailwind}`),
2901
+ compact: ""
2902
+ }, {
2903
+ default: ke(() => [
2904
+ de(w, {
2905
+ name: d.value.icon.name,
2906
+ color: d.value.icon.color
2907
+ }, null, 8, ["name", "color"]),
2908
+ ee("p", {
2909
+ class: "fm-typo-en-body-md-600",
2910
+ style: Te({ color: d.value.icon.color })
2911
+ }, Ae(d.value.value), 5)
2912
+ ]),
2913
+ _: 1
2914
+ }, 8, ["icon", "class"])) : ve("", !0),
2915
+ a(o).endDate != null && a(o).startDate != null && d.value === null ? (J(), me(F, {
2916
+ key: 1,
2917
+ class: "invisible pointer-events-none",
2918
+ "aria-hidden": "true",
2919
+ compact: ""
2920
+ }, {
2921
+ default: ke(() => [
2922
+ de(w, {
2923
+ name: "arrow_upward",
2924
+ color: "#C7C7CC"
2925
+ }),
2926
+ k[0] || (k[0] = ee("p", { class: "fm-typo-en-body-md-600" }, " ", -1))
2927
+ ]),
2928
+ _: 1
2929
+ })) : ve("", !0)
2930
+ ]),
2931
+ _: 1
2932
+ }, 8, ["disabled"])
2933
+ ]),
2934
+ R.value ? (J(), ce("div", Ur, [
2935
+ v(R.value.type) === "line" ? (J(), me(S, {
2936
+ key: 0,
2937
+ class: "sparkline",
2938
+ datasets: H.value,
2939
+ legend: {
2940
+ display: !1
2941
+ },
2942
+ datalabels: { display: !1 },
2943
+ "x-axis": { categories: R.value.dimensions },
2944
+ "y-cfg": W.value,
2945
+ "x-cfg": { display: !1 },
2946
+ tooltip: y.value,
2947
+ "maintain-aspect-ratio": !1
2948
+ }, null, 8, ["datasets", "x-axis", "y-cfg", "tooltip"])) : ve("", !0)
2949
+ ])) : (J(), ce("div", Kr, k[1] || (k[1] = [
2950
+ ee("div", { class: "sparkline" }, [
2951
+ ee("div", { class: "flex flex-col gap-8" }, [
2952
+ ee("div"),
2953
+ ee("div")
2954
+ ]),
2955
+ ee("div", { class: "grow" })
2956
+ ], -1)
2957
+ ])))
2958
+ ]);
2959
+ };
2960
+ }
2961
+ }), Yr = {};
2962
+ function qr(e, n) {
2963
+ const t = fe("FmMenuDivider");
2964
+ return J(), me(t);
2965
+ }
2966
+ const Gr = /* @__PURE__ */ ho(Yr, [["render", qr]]), jr = "mf-reporttable-dimension", ao = ea(jr, () => {
2967
+ const e = P(0), n = P([]), t = P(!1), o = (g, S) => {
2968
+ e.value = g, i(g, S);
2969
+ }, r = (g, S, B, D) => {
2970
+ n[g] = S, n.value = [...n.value], s(g, S, B, D);
2971
+ }, i = (g, S) => {
2972
+ const B = (S == null ? void 0 : S.querySelectorAll("thead tr")) ?? [], D = (S == null ? void 0 : S.querySelectorAll("tbody tr")) ?? [];
2973
+ [...B, ...D].forEach((L) => {
2974
+ const A = L;
2975
+ A && (A.style.height = `${g}px`);
2976
+ });
2977
+ }, s = (g, S, B, D = !1) => {
2978
+ const f = (B == null ? void 0 : B.querySelectorAll("th")) ?? [];
2979
+ if (g === void 0) return;
2980
+ const L = f[g], A = D ? n[g] : S;
2981
+ if (!L || A === void 0) return;
2982
+ const u = () => {
2983
+ L.style.width = `${A}px`;
2984
+ };
2985
+ D ? requestAnimationFrame(u) : u();
2986
+ }, c = () => {
2987
+ const g = document.querySelectorAll("th"), S = document.querySelectorAll("td"), B = document.querySelector("table");
2988
+ B == null || B.classList.add("table-fixed"), g.forEach((D) => D.classList.add("toggleEditResize")), S.forEach((D) => D.classList.add("toggleEditResize")), t.value = !0;
2989
+ }, d = () => {
2990
+ const g = document.querySelectorAll("th"), S = document.querySelectorAll("td"), B = document.querySelectorAll(".col-resize-handle"), D = document.querySelectorAll(".row-resize-handle");
2991
+ g.forEach((f) => f.classList.remove("toggleEditResize")), S.forEach((f) => f.classList.remove("toggleEditResize")), B.forEach((f) => f.remove()), D.forEach((f) => f.remove()), t.value = !1;
2992
+ }, v = () => {
2993
+ e.value = 0, n.value = [];
2994
+ }, R = (g, S) => {
2995
+ if (S) {
2996
+ const B = document.querySelectorAll(`thead th:nth-child(${g + 1})`), D = document.querySelectorAll(`tbody td:nth-child(${g + 1})`);
2997
+ [...B, ...D].forEach((f) => {
2998
+ f.classList.add("highlight-hover-col");
2999
+ });
3000
+ } else
3001
+ document.querySelectorAll(
3002
+ `thead th:nth-child(${g + 1}), tbody td:nth-child(${g + 1})`
3003
+ ).forEach((B) => B.classList.add("highlight-col"));
3004
+ }, W = (g) => {
3005
+ const S = document.querySelectorAll("thead tr"), B = document.querySelectorAll("tbody tr"), D = [...S, ...B];
3006
+ for (const f of D)
3007
+ g ? f.classList.add("highlight-hover-row") : f.classList.add("highlight-row");
3008
+ }, H = (g) => {
3009
+ const S = g ? ".highlight-hover-row" : ".highlight-row", B = document.querySelectorAll(S);
3010
+ for (const D of B)
3011
+ D.classList.remove(S.slice(1));
3012
+ }, y = (g) => {
3013
+ g ? document.querySelectorAll(".highlight-hover-col").forEach((S) => {
3014
+ S.classList.remove("highlight-hover-col");
3015
+ }) : document.querySelectorAll(".highlight-col").forEach((S) => S.classList.remove("highlight-col"));
3016
+ }, p = (g, S) => {
3017
+ const B = g.clientX, D = g.target.closest("table");
3018
+ if (!D) return;
3019
+ const f = D.querySelectorAll("th")[S];
3020
+ if (!f) return;
3021
+ const L = f.getBoundingClientRect().width || 60, A = f.querySelector("button"), u = (A == null ? void 0 : A.querySelector("span")) || f.querySelector("p") || f;
3022
+ let I = 60;
3023
+ if (u) {
3024
+ const z = u.textContent || "", _ = window.getComputedStyle(u), b = `${_.fontWeight} ${_.fontSize} ${_.fontFamily}`, N = document.createElement("canvas").getContext("2d");
3025
+ if (N) {
3026
+ N.font = b;
3027
+ const K = N.measureText(z), q = window.getComputedStyle(f), $ = parseFloat(q.paddingLeft || "0"), Q = parseFloat(q.paddingRight || "0");
3028
+ I = K.width + $ + Q;
3029
+ }
3030
+ }
3031
+ R(S, !1);
3032
+ let M = null, U = null;
3033
+ const G = () => {
3034
+ if (U === null) return;
3035
+ const z = f;
3036
+ z.style.width = `${U}px`;
3037
+ let _ = 0;
3038
+ D.querySelectorAll("th").forEach((O, N) => {
3039
+ _ += N === S ? U : O.getBoundingClientRect().width;
3040
+ }), D.classList.remove("w-full"), D.style.width = `${_}px`, M = null;
3041
+ }, j = (z) => {
3042
+ const _ = z.clientX - B;
3043
+ U = Math.max(I, L + _), M === null && (M = requestAnimationFrame(G));
3044
+ }, Y = () => {
3045
+ M !== null && cancelAnimationFrame(M), U !== null && (f.style.width = `${U}px`);
3046
+ const z = D.querySelectorAll("th"), _ = [];
3047
+ z.forEach((b) => {
3048
+ _.push(b.getBoundingClientRect().width);
3049
+ }), n.value = _, y(!1), document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", Y);
3050
+ };
3051
+ document.addEventListener("mousemove", j), document.addEventListener("mouseup", Y);
3052
+ }, k = (g) => {
3053
+ const S = g.clientY, B = g.target.closest("table"), D = e.value || 48;
3054
+ W(!1);
3055
+ const f = (A) => {
3056
+ const u = Math.max(30, D + (A.clientY - S));
3057
+ B && o(u, B);
3058
+ }, L = () => {
3059
+ H(!1), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", L);
3060
+ };
3061
+ document.addEventListener("mousemove", f), document.addEventListener("mouseup", L);
3062
+ };
3063
+ return {
3064
+ rowHeight: e,
3065
+ colWidths: n,
3066
+ isEditing: t,
3067
+ updateRowHeight: o,
3068
+ updateColWidth: r,
3069
+ setRowHeights: i,
3070
+ setColWidths: s,
3071
+ enableEditMode: c,
3072
+ disableEditMode: d,
3073
+ resetStore: v,
3074
+ highlightCol: R,
3075
+ highlightRows: W,
3076
+ removeRowHighlight: H,
3077
+ removeColHighlight: y,
3078
+ resizeCol: p,
3079
+ resizeRow: k,
3080
+ enableCellResizing: () => {
3081
+ const g = document.querySelector("thead"), S = document.querySelectorAll("thead tr"), B = document.querySelectorAll("tbody tr"), D = [...S, ...B];
3082
+ g && g.classList.remove("sticky");
3083
+ const f = (L, A) => {
3084
+ const u = document.createElement("div");
3085
+ return u.className = `${L}-resize-handle`, L === "col" ? (u.addEventListener("mouseenter", () => R(A, !0)), u.addEventListener("mouseleave", () => y(!0)), u.addEventListener("mousedown", (I) => {
3086
+ I.stopPropagation(), p(I, A);
3087
+ })) : (u.addEventListener("mouseenter", () => W(!0)), u.addEventListener("mouseleave", () => H(!0)), u.addEventListener("mousedown", (I) => {
3088
+ I.stopPropagation(), k(I);
3089
+ })), u;
3090
+ };
3091
+ D.forEach((L) => {
3092
+ const A = L.closest("thead") !== null;
3093
+ L.querySelectorAll(A ? "th" : "td").forEach((I, M) => {
3094
+ const U = f("col", M), G = f("row", M);
3095
+ I.appendChild(U), I.appendChild(G);
3096
+ });
3097
+ }), c();
3098
+ },
3099
+ cancelResizingChanges: () => {
3100
+ d();
3101
+ }
3102
+ };
3103
+ }), Jr = "/assets/processTableData.worker-CNwOO2hz.js", Zr = { class: "my-4" }, Qr = {
3104
+ class: "border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",
3105
+ style: { backgroundColor: "#f9f9f9" }
3106
+ }, el = { class: "font-bold" }, tl = { class: "text-fm-color-neutral-gray-300" }, nl = /* @__PURE__ */ Ne({
3107
+ __name: "WidgetTable",
3108
+ props: /* @__PURE__ */ Ue({
3109
+ tileIndex: {}
3110
+ }, {
3111
+ modelValue: { required: !0 },
3112
+ modelModifiers: {}
3113
+ }),
3114
+ emits: ["update:modelValue"],
3115
+ setup(e) {
3116
+ const { t: n, te: t } = dt(), o = Oe(e, "modelValue"), { country: r } = Ln(), { clearTileSorts: i, setTileSorts: s } = Go(), c = Dn(), d = e, v = P([]), { isEditing: R, colWidths: W, rowHeight: H } = it(ao()), { setColWidths: y, setRowHeights: p, enableCellResizing: k } = ao(), w = P(null), F = x(() => {
3117
+ var _;
3118
+ return ((_ = o.value.data) == null ? void 0 : _.columns) || [{ label: "", key: "" }];
3119
+ }), g = x(() => {
3120
+ var _;
3121
+ return ((_ = o.value.data) == null ? void 0 : _.rows) || [];
3122
+ }), S = x(() => o.value.filterText), B = x(() => {
3123
+ var b;
3124
+ const _ = (b = o.value.grandTotalLabel) == null ? void 0 : b.trim();
3125
+ return _ && _.length > 0 ? _ : lt(n, t, "Grand total", "other");
3126
+ }), D = x(() => {
3127
+ var _, b;
3128
+ if (!(S.value && S.value.trim().length > 0 || !((_ = g.value[0]) != null && _.isRollup) && !((b = g.value[g.value.length - 1]) != null && b.isRollup))) {
3129
+ if (o.value.rollupPosition === Je.top || o.value.rollupPosition === void 0)
3130
+ return Je.top;
3131
+ if (o.value.rollupPosition === Je.bottom)
3132
+ return Je.bottom;
3133
+ }
3134
+ }), f = x(() => {
3135
+ const N = D.value !== void 0 ? 1 : 0, K = (w.value ? w.value.$el.offsetHeight : 0) - 48;
3136
+ return Math.floor((K - 34.5 - 32) / 48) - N;
3137
+ }), L = x(() => {
3138
+ var b, O;
3139
+ let _ = [];
3140
+ switch (D.value) {
3141
+ case Je.top:
3142
+ _ = [...((b = g.value[0]) == null ? void 0 : b.cells) || []].map((N, K) => {
3143
+ var q;
3144
+ return {
3145
+ main: N,
3146
+ comparison: (q = g.value[0]) == null ? void 0 : q.comparisonCells[K],
3147
+ rowType: F.value[K].type
3148
+ };
3149
+ });
3150
+ break;
3151
+ case Je.bottom:
3152
+ _ = [...((O = g.value[g.value.length - 1]) == null ? void 0 : O.cells) || []].map((N, K) => {
3153
+ var q;
3154
+ return {
3155
+ main: N,
3156
+ comparison: (q = g.value[g.value.length - 1]) == null ? void 0 : q.comparisonCells[K],
3157
+ rowType: F.value[K].type
3158
+ };
3159
+ });
3160
+ break;
3161
+ }
3162
+ return _.length > 0 && _[0].main === "" && (_[0].main = B.value), _;
3163
+ });
3164
+ function A(_) {
3165
+ let b = (_ == null ? void 0 : _.main) || "";
3166
+ return !_ || _.main === "" || !_.comparison ? {
3167
+ main: b
3168
+ } : (b.includes("#") && !b.startsWith("#") && (b = b.split("#")[0]), {
3169
+ main: b,
3170
+ comparison: _ == null ? void 0 : _.comparison,
3171
+ difference: Co(_.main, _.comparison, r)
3172
+ });
3173
+ }
3174
+ ct(() => {
3175
+ i();
3176
+ });
3177
+ const u = P([]);
3178
+ let I = 0, M;
3179
+ function U() {
3180
+ var K;
3181
+ if (!((K = o.value) != null && K.data)) {
3182
+ u.value = [];
3183
+ return;
3184
+ }
3185
+ const _ = ++I, b = (o.value.data.rows || []).map((q) => ({
3186
+ isRollup: q.isRollup,
3187
+ cells: Array.isArray(q.cells) ? [...q.cells] : [],
3188
+ comparisonCells: Array.isArray(q.comparisonCells) ? [...q.comparisonCells] : []
3189
+ })), O = (o.value.data.columns || []).map((q) => ({
3190
+ key: q.key,
3191
+ type: q.type,
3192
+ label: q.label
3193
+ })), N = {
3194
+ rows: b,
3195
+ columns: O,
3196
+ filter: S.value ?? "",
3197
+ globalSorts: Uo(v.value).map((q) => ({
3198
+ key: q.key,
3199
+ type: q.type
3200
+ })),
3201
+ grandTotalPosition: D.value,
3202
+ pageSize: f.value
3203
+ };
3204
+ jo(Jr, N).then((q) => {
3205
+ _ === I && (q != null && q.error ? (c.open({ message: "Failed to process table data. Please retry.", type: "error" }), console.log(q.error), u.value = []) : u.value = Ko(q.data || []));
3206
+ });
3207
+ }
3208
+ De(
3209
+ () => v.value,
3210
+ (_) => {
3211
+ d.tileIndex === void 0 || d.tileIndex === null || s(d.tileIndex, _);
3212
+ },
3213
+ { immediate: !0, deep: !0 }
3214
+ );
3215
+ const G = x(() => {
3216
+ var O, N;
3217
+ const _ = ((O = o.value.data) == null ? void 0 : O.rows) || [], b = ((N = o.value.data) == null ? void 0 : N.columns) || [];
3218
+ return JSON.stringify({
3219
+ rowsLength: _.length,
3220
+ columns: b.map((K) => ({ key: K.key, type: K.type, label: K.label })),
3221
+ filter: S.value ?? "",
3222
+ globalSorts: v.value.map((K) => ({ key: K.key, type: K.type })),
3223
+ grandTotalPosition: D.value,
3224
+ pageSize: f.value
3225
+ });
3226
+ });
3227
+ De(
3228
+ () => G.value,
3229
+ () => {
3230
+ clearTimeout(M), M = setTimeout(U, 200);
3231
+ },
3232
+ { immediate: !0 }
3233
+ );
3234
+ function j(_) {
3235
+ const b = v.value.find((O) => O.key === _);
3236
+ if (!b) {
3237
+ v.value.push({ key: _, type: At.Asc });
3238
+ return;
3239
+ }
3240
+ b.type === At.Asc ? b.type = At.Desc : b.type === At.Desc && (v.value = v.value.filter((O) => O.key !== _));
3241
+ }
3242
+ const Y = x(
3243
+ () => {
3244
+ var _;
3245
+ return (((_ = o.value.colWidths) == null ? void 0 : _.length) ?? 0) > 0 || W.value.length > 0;
3246
+ }
3247
+ ), z = x(() => {
3248
+ var _;
3249
+ return (_ = o.value.data) != null && _.columns ? o.value.data.columns.map((b) => {
3250
+ const O = lt(n, t, b.label, "other"), N = v.value.find(($) => $.key === b.key), K = !!N, q = K ? N.type === At.Asc ? "arrow_upward" : "arrow_downward" : "unfold_more";
3251
+ return {
3252
+ accessorKey: b.key,
3253
+ header: () => {
3254
+ const $ = fe("FmIcon");
3255
+ return jt(
3256
+ "button",
3257
+ {
3258
+ type: "button",
3259
+ class: `w-full flex items-center gap-1 group/select-header select-none ${b.type === "NUMERIC" ? "justify-end" : "justify-start"} ${K ? "text-fm-color-typo-primary" : "text-fm-color-neutral-gray-400"}`,
3260
+ onClick: () => j(b.key)
3261
+ },
3262
+ [
3263
+ jt(
3264
+ "span",
3265
+ { class: `${b.type === "NUMERIC" ? "text-right" : ""} whitespace-nowrap` },
3266
+ O
3267
+ ),
3268
+ jt($, {
3269
+ name: q,
3270
+ color: K ? "primary" : "neutral-gray-400",
3271
+ size: "sm",
3272
+ class: "transition-transform",
3273
+ style: q === "arrow_upward" ? "transform: translateY(-1px);" : ""
3274
+ })
3275
+ ]
3276
+ );
3277
+ },
3278
+ cell: ($) => {
3279
+ var le, se;
3280
+ const Q = A($.getValue()), oe = (se = (le = $ == null ? void 0 : $.row) == null ? void 0 : le.original) == null ? void 0 : se.isRollup;
3281
+ return jt(
3282
+ "div",
3283
+ {
3284
+ class: [
3285
+ oe ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400",
3286
+ b.type === "NUMERIC" ? "text-right" : "",
3287
+ Y.value ? "whitespace-normal break-words line-clamp-6" : "whitespace-nowrap"
3288
+ ].join(" ")
3289
+ },
3290
+ [b.type === "NUMERIC" ? nn(Q.main) : Q.main]
3291
+ );
3292
+ },
3293
+ enableSorting: !1
3294
+ };
3295
+ }) : [];
3296
+ });
3297
+ return De(
3298
+ () => W.value.length > 0,
3299
+ async (_) => {
3300
+ _ && R.value && (await ut(), k());
3301
+ }
3302
+ ), De(
3303
+ [() => z.value],
3304
+ async () => {
3305
+ var K;
3306
+ await ut();
3307
+ const _ = (K = w.value) == null ? void 0 : K.$el;
3308
+ if (!_) return;
3309
+ const b = _.querySelector("table");
3310
+ if (!b) return;
3311
+ b.classList.add(Y.value ? "table-fixed" : "table-auto");
3312
+ let O, N;
3313
+ R.value ? (k(), O = W.value, N = H.value) : (N = o.value.rowHeight, O = o.value.colWidths), typeof N == "number" && p(N, _), O == null || O.forEach((q, $) => {
3314
+ y($, q, _);
3315
+ });
3316
+ },
3317
+ { immediate: !0 }
3318
+ ), (_, b) => {
3319
+ const O = fe("FmTable");
3320
+ return J(), ce(ze, null, [
3321
+ ee("div", Zr, [
3322
+ Qe(_.$slots, "menu")
3323
+ ]),
3324
+ de(O, {
3325
+ ref_key: "table",
3326
+ ref: w,
3327
+ "column-defs": z.value,
3328
+ "row-data": u.value,
3329
+ "search-value": S.value,
3330
+ "page-size": f.value,
3331
+ "shrink-at": !1,
3332
+ "force-mobile-footer": !0,
3333
+ class: "scrollbar-hide-table",
3334
+ "pin-header-row": !0,
3335
+ "auto-reset-page-index": !0
3336
+ }, Eo({ _: 2 }, [
3337
+ D.value ? {
3338
+ name: "pin-top",
3339
+ fn: ke(() => [
3340
+ (J(), me(so(D.value === a(Je).bottom ? "tfoot" : "tbody"), null, {
3341
+ default: ke(() => [
3342
+ ee("tr", Qr, [
3343
+ (J(!0), ce(ze, null, Nt(L.value, (N, K) => (J(), ce("td", {
3344
+ key: `${a(Ft)()}_${K}`,
3345
+ class: "h-[48px] text-fm-color-typo-primary px-16"
3346
+ }, [
3347
+ ee("span", {
3348
+ class: Le([
3349
+ "items-center text-fm-color-typo-secondary gap-2",
3350
+ N.rowType === "NUMERIC" ? "text-right" : "",
3351
+ Y.value ? "whitespace-normal break-words line-clamp-6" : "whitespace-nowrap"
3352
+ ])
3353
+ }, [
3354
+ ee("p", el, Ae(N.rowType === "NUMERIC" ? a(nn)(N.main) : N.main), 1),
3355
+ ee("p", tl, Ae(N.comparison ? N.rowType === "NUMERIC" ? `(${a(nn)(N.comparison)})` : `(${N.comparison})` : ""), 1)
3356
+ ], 2)
3357
+ ]))), 128))
3358
+ ])
3359
+ ]),
3360
+ _: 1
3361
+ }))
3362
+ ]),
3363
+ key: "0"
3364
+ } : void 0
3365
+ ]), 1032, ["column-defs", "row-data", "search-value", "page-size"])
3366
+ ], 64);
3367
+ };
3368
+ }
3369
+ }), ol = { class: "widget-content" }, al = 2, rl = /* @__PURE__ */ Ne({
3370
+ __name: "WidgetStackBarChart",
3371
+ props: /* @__PURE__ */ Ue({
3372
+ tileIndex: {}
3373
+ }, {
3374
+ modelValue: { required: !0 },
3375
+ modelModifiers: {}
3376
+ }),
3377
+ emits: ["update:modelValue"],
3378
+ setup(e) {
3379
+ const n = e, t = Oe(e, "modelValue"), o = P(null), r = x(() => {
3380
+ var b;
3381
+ return ((b = t.value.data) == null ? void 0 : b.xAxis) || [];
3382
+ }), i = x(() => {
3383
+ var _;
3384
+ return ((_ = t.value.data) == null ? void 0 : _.datasets) ?? [];
3385
+ }), s = Wt("bar"), c = x(() => t.value.stackBarOverlap === !0), d = x(() => c.value === !1), v = x(() => ({
3386
+ ...B.value,
3387
+ stacked: d.value
3388
+ })), R = x(() => ({
3389
+ ...D.value,
3390
+ stacked: d.value
3391
+ }));
3392
+ function W({
3393
+ datasetIndex: _,
3394
+ colorIndex: b,
3395
+ breakdownIndex: O
3396
+ }) {
3397
+ var $;
3398
+ const N = t.value.chartColorBinding === xe.metric ? b : t.value.chartColorBinding === xe.breakdown ? O : _, K = ($ = t.value.chartColorLayers) == null ? void 0 : $[N], q = Number(K);
3399
+ return Number.isInteger(q) && q > 0 ? q : N + 1;
3400
+ }
3401
+ const H = x(() => {
3402
+ if (i.value.length > 0) {
3403
+ const _ = i.value.map((b, O) => {
3404
+ const N = zt({
3405
+ datasets: i.value,
3406
+ datasetIndex: O
3407
+ }), K = Ie({
3408
+ datasetIndex: N,
3409
+ isCompare: !1,
3410
+ metricCount: t.value.metricCount,
3411
+ mode: t.value.chartColorBinding
3412
+ }), q = Ie({
3413
+ datasetIndex: N,
3414
+ isCompare: !1,
3415
+ metricCount: t.value.metricCount,
3416
+ mode: xe.metric
3417
+ }), $ = _t({
3418
+ fallbackIndex: N,
3419
+ metricCount: t.value.metricCount
3420
+ }), Q = W({
3421
+ datasetIndex: N,
3422
+ colorIndex: K,
3423
+ breakdownIndex: $
3424
+ }), le = b.values.map((se) => se === null ? NaN : Number(se));
3425
+ return {
3426
+ dataset: {
3427
+ label: b.name,
3428
+ data: le,
3429
+ dash: !!b.isCompare,
3430
+ minBarLength: al,
3431
+ grouped: c.value ? !1 : void 0,
3432
+ order: c.value ? Q : void 0,
3433
+ backgroundColor: t.value.chartColorBinding === xe.breakdown ? Lt({
3434
+ breakdownIndex: $,
3435
+ metricIndex: q,
3436
+ metricCount: t.value.metricCount,
3437
+ isCompare: b.isCompare,
3438
+ breakdownColors: t.value.chartBreakdownColors,
3439
+ useSecondaryMetricShades: t.value.chartUseSecondaryMetricShades,
3440
+ customColors: t.value.chartColors
3441
+ }) : Ze({
3442
+ index: K,
3443
+ isCompare: b.isCompare,
3444
+ customColors: t.value.chartColors
3445
+ })
3446
+ }
3447
+ };
3448
+ });
3449
+ return c.value ? _.map((b) => b.dataset) : _.map((b) => b.dataset);
3450
+ } else
3451
+ return [];
3452
+ }), {
3453
+ isTooltipDetailsSheetOpen: y,
3454
+ tooltipDetailsPayload: p,
3455
+ handleTooltipDetailsSheetVisibility: k,
3456
+ handleTooltipDetailsHover: w,
3457
+ handleTooltipDetailsLeave: F,
3458
+ comparisonTooltip: g,
3459
+ datalabels: S,
3460
+ xCfg: B,
3461
+ yCfg: D,
3462
+ isTransposed: f,
3463
+ legend: L,
3464
+ chartWidth: A,
3465
+ chartHeight: u,
3466
+ useCustomLegend: I,
3467
+ legendPosition: M,
3468
+ isLegendSide: U,
3469
+ isLegendBeforeChart: G,
3470
+ hiddenDatasetKeys: j,
3471
+ toggleDatasetVisibility: Y,
3472
+ datasets: z
3473
+ } = Et({
3474
+ chartRef: o,
3475
+ model: t,
3476
+ baseDatasets: H,
3477
+ tileIndex: n.tileIndex
3478
+ });
3479
+ return (_, b) => {
3480
+ var N, K, q, $, Q, oe;
3481
+ const O = fe("FmBarChart");
3482
+ return J(), ce(ze, null, [
3483
+ ee("div", ol, [
3484
+ Qe(_.$slots, "menu"),
3485
+ ee("div", {
3486
+ class: Le(["chart-layout", {
3487
+ "chart-layout--side": a(I) && (a(L).display ?? !1) && a(U)
3488
+ }])
3489
+ }, [
3490
+ a(I) && (a(L).display ?? !1) && a(G) ? (J(), me(Fe, {
3491
+ key: 0,
3492
+ "chart-ref": o.value,
3493
+ enabled: a(L).display ?? !1,
3494
+ position: a(M),
3495
+ "max-width": a(L).maxWidth,
3496
+ "text-color": (N = a(L).labels) == null ? void 0 : N.color,
3497
+ "font-size": (q = (K = a(L).labels) == null ? void 0 : K.font) == null ? void 0 : q.size,
3498
+ "legend-update-key": a(z),
3499
+ "use-point-style": t.value.usePointStyle ?? !0,
3500
+ "chart-color-binding": t.value.chartColorBinding,
3501
+ "chart-colors": t.value.chartColors,
3502
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3503
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3504
+ "metric-count": t.value.metricCount,
3505
+ "hidden-dataset-keys": a(j),
3506
+ onToggleDatasetVisibility: a(Y)
3507
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0),
3508
+ de(O, {
3509
+ ref_key: "chartRef",
3510
+ ref: o,
3511
+ class: "bar-chart",
3512
+ datasets: a(z),
3513
+ "x-axis": { categories: r.value },
3514
+ "x-cfg": v.value,
3515
+ "y-cfg": R.value,
3516
+ transpose: a(f),
3517
+ stacked: d.value,
3518
+ legend: {
3519
+ display: !1
3520
+ },
3521
+ tooltip: a(g),
3522
+ plugins: [a(s)],
3523
+ datalabels: a(S),
3524
+ "maintain-aspect-ratio": !1,
3525
+ style: Te({
3526
+ "--chart-width": a(I) && (a(L).display ?? !1) && a(U) ? "calc(100% - var(--legend-panel-width, 0px))" : a(A) !== void 0 ? a(A) + "px" : "100%",
3527
+ "--chart-height": a(I) && (a(L).display ?? !1) && !a(U) ? "calc(100% - var(--legend-panel-height, 0px))" : a(u) !== void 0 ? a(u) + "px" : "100%"
3528
+ })
3529
+ }, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "stacked", "tooltip", "plugins", "datalabels", "style"]),
3530
+ a(I) && (a(L).display ?? !1) && !a(G) ? (J(), me(Fe, {
3531
+ key: 1,
3532
+ "chart-ref": o.value,
3533
+ enabled: a(L).display ?? !1,
3534
+ position: a(M),
3535
+ "max-width": a(L).maxWidth,
3536
+ "text-color": ($ = a(L).labels) == null ? void 0 : $.color,
3537
+ "font-size": (oe = (Q = a(L).labels) == null ? void 0 : Q.font) == null ? void 0 : oe.size,
3538
+ "legend-update-key": a(z),
3539
+ "use-point-style": t.value.usePointStyle ?? !0,
3540
+ "chart-color-binding": t.value.chartColorBinding,
3541
+ "chart-colors": t.value.chartColors,
3542
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3543
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3544
+ "metric-count": t.value.metricCount,
3545
+ "hidden-dataset-keys": a(j),
3546
+ onToggleDatasetVisibility: a(Y)
3547
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0)
3548
+ ], 2)
3549
+ ]),
3550
+ de(Ot, {
3551
+ "model-value": a(y),
3552
+ "details-payload": a(p),
3553
+ "onUpdate:modelValue": a(k),
3554
+ onValueHover: a(w),
3555
+ onValueLeave: a(F)
3556
+ }, null, 8, ["model-value", "details-payload", "onUpdate:modelValue", "onValueHover", "onValueLeave"])
3557
+ ], 64);
3558
+ };
3559
+ }
3560
+ }), ll = { class: "widget-content" }, sl = 2, pn = 1, ro = "rgba(0, 0, 0, 0)", il = /* @__PURE__ */ Ne({
3561
+ __name: "WidgetClusteredStackBarchart",
3562
+ props: /* @__PURE__ */ Ue({
3563
+ tileIndex: {}
3564
+ }, {
3565
+ modelValue: { required: !0 },
3566
+ modelModifiers: {}
3567
+ }),
3568
+ emits: ["update:modelValue"],
3569
+ setup(e) {
3570
+ const n = e, t = Oe(e, "modelValue"), o = P(null), r = x(() => {
3571
+ var $;
3572
+ return (($ = t.value.data) == null ? void 0 : $.xAxis) || [];
3573
+ }), i = x(() => {
3574
+ var $;
3575
+ return (($ = t.value.data) == null ? void 0 : $.datasets) ?? [];
3576
+ }), s = Wt("bar"), c = x(() => t.value.stackBarOverlap === !0), d = x(() => c.value === !1), v = x(() => r.value.length === 1 && i.value.some(($) => $.isCompare === !0)), R = x(() => ({
3577
+ ...A.value,
3578
+ stacked: d.value
3579
+ })), W = x(() => ({
3580
+ ...u.value,
3581
+ stacked: d.value
3582
+ }));
3583
+ function H($) {
3584
+ const Q = " - ", oe = $.lastIndexOf(Q);
3585
+ return oe < 0 ? {
3586
+ clusterKey: $,
3587
+ metricLabel: $
3588
+ } : {
3589
+ clusterKey: $.slice(0, oe),
3590
+ metricLabel: $.slice(oe + Q.length)
3591
+ };
3592
+ }
3593
+ function y($, Q) {
3594
+ if (typeof $ == "string") {
3595
+ const oe = $.trim();
3596
+ if (oe.length > 0)
3597
+ return oe;
3598
+ }
3599
+ return `Series ${Q + 1}`;
3600
+ }
3601
+ function p({
3602
+ datasetIndex: $,
3603
+ colorIndex: Q
3604
+ }) {
3605
+ var ye;
3606
+ const oe = t.value.chartColorBinding === xe.metric ? Q : $, le = (ye = t.value.chartColorLayers) == null ? void 0 : ye[oe], se = Number(le);
3607
+ return Number.isInteger(se) && se > 0 ? se : oe + 1;
3608
+ }
3609
+ function k($) {
3610
+ return {
3611
+ label: `__comparison_gap__${$}`,
3612
+ tooltipLabel: `__comparison_gap__${$}`,
3613
+ data: [0],
3614
+ grouped: !0,
3615
+ stack: `__comparison_gap__${$}`,
3616
+ backgroundColor: ro,
3617
+ borderColor: ro,
3618
+ minBarLength: 0,
3619
+ barPercentage: pn,
3620
+ isSpacer: !0
3621
+ };
3622
+ }
3623
+ const w = x(() => {
3624
+ if (i.value.length === 0)
3625
+ return [];
3626
+ const $ = i.value.map((ie, be) => ({
3627
+ source: ie,
3628
+ index: be,
3629
+ name: y(ie == null ? void 0 : ie.name, be),
3630
+ values: (ie == null ? void 0 : ie.values) ?? []
3631
+ })), Q = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
3632
+ for (const ie of $) {
3633
+ const { clusterKey: be, metricLabel: we } = H(ie.name);
3634
+ oe.has(be) || oe.set(be, oe.size), Q.has(we) || Q.set(we, Q.size);
3635
+ }
3636
+ const le = Math.max(Q.size, 1), se = t.value.chartColorBinding === xe.breakdown, ye = t.value.chartUseSecondaryMetricShades !== !1;
3637
+ return $.map((ie) => {
3638
+ var $e;
3639
+ const be = zt({
3640
+ datasets: i.value,
3641
+ datasetIndex: ie.index
3642
+ }), we = po({
3643
+ datasets: i.value,
3644
+ datasetIndex: ie.index
3645
+ }), Se = Ie({
3646
+ datasetIndex: be,
3647
+ isCompare: !1,
3648
+ metricCount: t.value.metricCount,
3649
+ mode: t.value.chartColorBinding
3650
+ }), { clusterKey: Ke, metricLabel: Xe } = H(ie.name), et = (($e = $[we]) == null ? void 0 : $e.name) ?? ie.name, { clusterKey: Dt, metricLabel: ft } = H(et), ht = Ie({
3651
+ datasetIndex: be,
3652
+ isCompare: !1,
3653
+ metricCount: le,
3654
+ mode: xe.breakdown
3655
+ }), mt = Q.get(ft) ?? 0, tt = se ? Lt({
3656
+ breakdownIndex: ht,
3657
+ metricIndex: mt,
3658
+ metricCount: le,
3659
+ isCompare: ie.source.isCompare,
3660
+ breakdownColors: t.value.chartBreakdownColors,
3661
+ useSecondaryMetricShades: ye,
3662
+ colorMode: "clustered"
3663
+ }) : Ze({
3664
+ index: Se,
3665
+ isCompare: ie.source.isCompare,
3666
+ customColors: t.value.chartColors
3667
+ }), nt = p({
3668
+ datasetIndex: be,
3669
+ colorIndex: Se
3670
+ }), pt = ie.values.map((ot) => ot === null ? NaN : Number(ot));
3671
+ return {
3672
+ label: ie.name,
3673
+ tooltipLabel: `${Ke} - ${Xe}`,
3674
+ data: pt,
3675
+ dash: !!ie.source.isCompare,
3676
+ minBarLength: sl,
3677
+ barPercentage: v.value ? pn : void 0,
3678
+ grouped: !0,
3679
+ order: c.value ? nt : void 0,
3680
+ stack: ie.source.isCompare ? `${Ke}__compare` : `${Ke}__main`,
3681
+ backgroundColor: tt
3682
+ };
3683
+ });
3684
+ }), {
3685
+ isTooltipDetailsSheetOpen: F,
3686
+ tooltipDetailsPayload: g,
3687
+ handleTooltipDetailsSheetVisibility: S,
3688
+ handleTooltipDetailsHover: B,
3689
+ handleTooltipDetailsLeave: D,
3690
+ comparisonTooltip: f,
3691
+ datalabels: L,
3692
+ xCfg: A,
3693
+ yCfg: u,
3694
+ isTransposed: I,
3695
+ legend: M,
3696
+ chartWidth: U,
3697
+ chartHeight: G,
3698
+ useCustomLegend: j,
3699
+ legendPosition: Y,
3700
+ isLegendSide: z,
3701
+ isLegendBeforeChart: _,
3702
+ hiddenDatasetKeys: b,
3703
+ toggleDatasetVisibility: O,
3704
+ datasets: N
3705
+ } = Et({
3706
+ chartRef: o,
3707
+ model: t,
3708
+ baseDatasets: w,
3709
+ tileIndex: n.tileIndex
3710
+ }), K = x(() => {
3711
+ if (!v.value)
3712
+ return N.value;
3713
+ const $ = [];
3714
+ return N.value.forEach((Q, oe) => {
3715
+ $.push({
3716
+ ...Q,
3717
+ barPercentage: pn
3718
+ });
3719
+ const le = N.value[oe + 1];
3720
+ Q.dash === !0 && le && $.push(k(oe));
3721
+ }), $;
3722
+ }), q = x(() => ({
3723
+ display: !1,
3724
+ labels: {
3725
+ filter: ($, Q) => {
3726
+ var oe, le;
3727
+ return !((le = (oe = Q.datasets) == null ? void 0 : oe[$.datasetIndex ?? -1]) != null && le.isSpacer);
3728
+ }
3729
+ }
3730
+ }));
3731
+ return ($, Q) => {
3732
+ var le, se, ye, ie, be, we;
3733
+ const oe = fe("FmBarChart");
3734
+ return J(), ce(ze, null, [
3735
+ ee("div", ll, [
3736
+ Qe($.$slots, "menu"),
3737
+ ee("div", {
3738
+ class: Le(["chart-layout", {
3739
+ "chart-layout--side": a(j) && (a(M).display ?? !1) && a(z)
3740
+ }])
3741
+ }, [
3742
+ a(j) && (a(M).display ?? !1) && a(_) ? (J(), me(Fe, {
3743
+ key: 0,
3744
+ "chart-ref": o.value,
3745
+ enabled: a(M).display ?? !1,
3746
+ position: a(Y),
3747
+ "max-width": a(M).maxWidth,
3748
+ "text-color": (le = a(M).labels) == null ? void 0 : le.color,
3749
+ "font-size": (ye = (se = a(M).labels) == null ? void 0 : se.font) == null ? void 0 : ye.size,
3750
+ "legend-update-key": a(N),
3751
+ "use-point-style": t.value.usePointStyle ?? !0,
3752
+ "chart-color-binding": t.value.chartColorBinding,
3753
+ "chart-colors": t.value.chartColors,
3754
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3755
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3756
+ "metric-count": t.value.metricCount,
3757
+ "hidden-dataset-keys": a(b),
3758
+ onToggleDatasetVisibility: a(O)
3759
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0),
3760
+ de(oe, {
3761
+ ref_key: "chartRef",
3762
+ ref: o,
3763
+ class: "bar-chart",
3764
+ datasets: K.value,
3765
+ "x-axis": { categories: r.value },
3766
+ "x-cfg": R.value,
3767
+ "y-cfg": W.value,
3768
+ transpose: a(I),
3769
+ stacked: d.value,
3770
+ legend: q.value,
3771
+ tooltip: a(f),
3772
+ plugins: [a(s)],
3773
+ datalabels: a(L),
3774
+ "maintain-aspect-ratio": !1,
3775
+ style: Te({
3776
+ "--chart-width": a(j) && (a(M).display ?? !1) && a(z) ? "calc(100% - var(--legend-panel-width, 0px))" : a(U) !== void 0 ? a(U) + "px" : "100%",
3777
+ "--chart-height": a(j) && (a(M).display ?? !1) && !a(z) ? "calc(100% - var(--legend-panel-height, 0px))" : a(G) !== void 0 ? a(G) + "px" : "100%"
3778
+ })
3779
+ }, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "stacked", "legend", "tooltip", "plugins", "datalabels", "style"]),
3780
+ a(j) && (a(M).display ?? !1) && !a(_) ? (J(), me(Fe, {
3781
+ key: 1,
3782
+ "chart-ref": o.value,
3783
+ enabled: a(M).display ?? !1,
3784
+ position: a(Y),
3785
+ "max-width": a(M).maxWidth,
3786
+ "text-color": (ie = a(M).labels) == null ? void 0 : ie.color,
3787
+ "font-size": (we = (be = a(M).labels) == null ? void 0 : be.font) == null ? void 0 : we.size,
3788
+ "legend-update-key": a(N),
3789
+ "use-point-style": t.value.usePointStyle ?? !0,
3790
+ "chart-color-binding": t.value.chartColorBinding,
3791
+ "chart-colors": t.value.chartColors,
3792
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3793
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3794
+ "metric-count": t.value.metricCount,
3795
+ "hidden-dataset-keys": a(b),
3796
+ onToggleDatasetVisibility: a(O)
3797
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0)
3798
+ ], 2)
3799
+ ]),
3800
+ de(Ot, {
3801
+ "model-value": a(F),
3802
+ "details-payload": a(g),
3803
+ "onUpdate:modelValue": a(S),
3804
+ onValueHover: a(B),
3805
+ onValueLeave: a(D)
3806
+ }, null, 8, ["model-value", "details-payload", "onUpdate:modelValue", "onValueHover", "onValueLeave"])
3807
+ ], 64);
3808
+ };
3809
+ }
3810
+ });
3811
+ function ul(e) {
3812
+ const n = Reflect.get(e, "lineStyle"), t = Reflect.get(e, "dash") === !0;
3813
+ return ra(n, t);
3814
+ }
3815
+ function Mo(e = "report-line-style-plugin") {
3816
+ return {
3817
+ id: e,
3818
+ beforeDatasetsUpdate(n) {
3819
+ var o;
3820
+ (((o = n == null ? void 0 : n.data) == null ? void 0 : o.datasets) ?? []).forEach((r) => {
3821
+ const i = r;
3822
+ Reflect.set(i, "borderDash", ul(i));
3823
+ });
3824
+ }
3825
+ };
3826
+ }
3827
+ const cl = { class: "widget-content" }, dl = /* @__PURE__ */ Ne({
3828
+ __name: "WidgetStackLineChart",
3829
+ props: /* @__PURE__ */ Ue({
3830
+ tileIndex: {}
3831
+ }, {
3832
+ modelValue: { required: !0 },
3833
+ modelModifiers: {}
3834
+ }),
3835
+ emits: ["update:modelValue"],
3836
+ setup(e) {
3837
+ const n = e, t = Oe(e, "modelValue"), o = P(null), r = x(() => {
3838
+ var Y;
3839
+ return ((Y = t.value.data) == null ? void 0 : Y.xAxis) ?? [];
3840
+ }), i = x(
3841
+ () => r.value.length === 1 && c.value.length > 0 && c.value.every((Y) => Y.values.length === 1)
3842
+ ), s = x(() => i.value ? ["", r.value[0], ""] : r.value), c = x(() => {
3843
+ var Y;
3844
+ return ((Y = t.value.data) == null ? void 0 : Y.datasets) ?? [];
3845
+ }), d = Wt("line"), v = Mo("report-line-style-plugin-stack-line"), R = x(() => c.value.length > 0 ? [
3846
+ ...c.value.map((Y, z) => {
3847
+ var se;
3848
+ const _ = zt({
3849
+ datasets: c.value,
3850
+ datasetIndex: z
3851
+ });
3852
+ let b = Y.values;
3853
+ i.value && (b = [NaN, b[0], NaN]);
3854
+ const O = b.map((ye) => ye === null ? NaN : Number(ye)), N = Ie({
3855
+ datasetIndex: _,
3856
+ isCompare: !1,
3857
+ metricCount: t.value.metricCount,
3858
+ mode: t.value.chartColorBinding
3859
+ }), K = Ie({
3860
+ datasetIndex: _,
3861
+ isCompare: !1,
3862
+ metricCount: t.value.metricCount,
3863
+ mode: xe.metric
3864
+ }), q = Ie({
3865
+ datasetIndex: z,
3866
+ isCompare: Y.isCompare,
3867
+ metricCount: t.value.metricCount,
3868
+ mode: t.value.lineStyleBinding
3869
+ }), $ = (se = t.value.lineStyles) == null ? void 0 : se[q], Q = t.value.chartColorBinding === xe.breakdown, oe = _t({
3870
+ fallbackIndex: _,
3871
+ metricCount: t.value.metricCount
3872
+ }), le = Q ? Lt({
3873
+ breakdownIndex: oe,
3874
+ metricIndex: K,
3875
+ metricCount: t.value.metricCount,
3876
+ isCompare: Y.isCompare,
3877
+ breakdownColors: t.value.chartBreakdownColors,
3878
+ useSecondaryMetricShades: t.value.chartUseSecondaryMetricShades,
3879
+ customColors: t.value.chartColors
3880
+ }) : Ze({
3881
+ index: N,
3882
+ isCompare: Y.isCompare,
3883
+ customColors: t.value.chartColors
3884
+ });
3885
+ return {
3886
+ label: Y.name,
3887
+ data: O,
3888
+ dash: Y.isCompare,
3889
+ lineStyle: $,
3890
+ fill: !0,
3891
+ color: le,
3892
+ pointRadius: i.value ? 4 : void 0,
3893
+ pointHoverRadius: i.value ? 6 : void 0,
3894
+ pointBackgroundColor: i.value ? le : void 0,
3895
+ pointBorderColor: i.value ? le : void 0,
3896
+ pointBorderWidth: i.value ? 2 : void 0
3897
+ };
3898
+ })
3899
+ ] : []), {
3900
+ isTooltipDetailsSheetOpen: W,
3901
+ tooltipDetailsPayload: H,
3902
+ handleTooltipDetailsSheetVisibility: y,
3903
+ handleTooltipDetailsHover: p,
3904
+ handleTooltipDetailsLeave: k,
3905
+ comparisonTooltip: w,
3906
+ datalabels: F,
3907
+ xCfg: g,
3908
+ yCfg: S,
3909
+ isTransposed: B,
3910
+ legend: D,
3911
+ chartWidth: f,
3912
+ chartHeight: L,
3913
+ useCustomLegend: A,
3914
+ legendPosition: u,
3915
+ isLegendSide: I,
3916
+ isLegendBeforeChart: M,
3917
+ hiddenDatasetKeys: U,
3918
+ toggleDatasetVisibility: G,
3919
+ datasets: j
3920
+ } = Et({
3921
+ chartRef: o,
3922
+ model: t,
3923
+ baseDatasets: R,
3924
+ tileIndex: n.tileIndex
3925
+ });
3926
+ return (Y, z) => {
3927
+ var b, O, N, K, q, $;
3928
+ const _ = fe("FmLineChart");
3929
+ return J(), ce(ze, null, [
3930
+ ee("div", cl, [
3931
+ Qe(Y.$slots, "menu"),
3932
+ ee("div", {
3933
+ class: Le(["chart-layout", {
3934
+ "chart-layout--side": a(A) && (a(D).display ?? !1) && a(I)
3935
+ }])
3936
+ }, [
3937
+ a(A) && (a(D).display ?? !1) && a(M) ? (J(), me(Fe, {
3938
+ key: 0,
3939
+ "chart-ref": o.value,
3940
+ enabled: a(D).display ?? !1,
3941
+ position: a(u),
3942
+ "max-width": a(D).maxWidth,
3943
+ "text-color": (b = a(D).labels) == null ? void 0 : b.color,
3944
+ "font-size": (N = (O = a(D).labels) == null ? void 0 : O.font) == null ? void 0 : N.size,
3945
+ "legend-update-key": a(j),
3946
+ "use-point-style": t.value.usePointStyle ?? !0,
3947
+ "chart-color-binding": t.value.chartColorBinding,
3948
+ "chart-colors": t.value.chartColors,
3949
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3950
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3951
+ "metric-count": t.value.metricCount,
3952
+ "hidden-dataset-keys": a(U),
3953
+ onToggleDatasetVisibility: a(G)
3954
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0),
3955
+ de(_, {
3956
+ ref_key: "chartRef",
3957
+ ref: o,
3958
+ class: "line-chart",
3959
+ datasets: a(j),
3960
+ "x-axis": { categories: s.value },
3961
+ "x-cfg": a(g),
3962
+ "y-cfg": a(S),
3963
+ transpose: a(B),
3964
+ legend: {
3965
+ display: !1
3966
+ },
3967
+ tooltip: a(w),
3968
+ plugins: [a(d), a(v)],
3969
+ stacked: !0,
3970
+ datalabels: a(F),
3971
+ "maintain-aspect-ratio": !1,
3972
+ style: Te({
3973
+ "--chart-width": a(A) && (a(D).display ?? !1) && a(I) ? "calc(100% - var(--legend-panel-width, 0px))" : a(f) !== void 0 ? a(f) + "px" : "100%",
3974
+ "--chart-height": a(A) && (a(D).display ?? !1) && !a(I) ? "calc(100% - var(--legend-panel-height, 0px))" : a(L) !== void 0 ? a(L) + "px" : "100%"
3975
+ })
3976
+ }, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "tooltip", "plugins", "datalabels", "style"]),
3977
+ a(A) && (a(D).display ?? !1) && !a(M) ? (J(), me(Fe, {
3978
+ key: 1,
3979
+ "chart-ref": o.value,
3980
+ enabled: a(D).display ?? !1,
3981
+ position: a(u),
3982
+ "max-width": a(D).maxWidth,
3983
+ "text-color": (K = a(D).labels) == null ? void 0 : K.color,
3984
+ "font-size": ($ = (q = a(D).labels) == null ? void 0 : q.font) == null ? void 0 : $.size,
3985
+ "legend-update-key": a(j),
3986
+ "use-point-style": t.value.usePointStyle ?? !0,
3987
+ "chart-color-binding": t.value.chartColorBinding,
3988
+ "chart-colors": t.value.chartColors,
3989
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
3990
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
3991
+ "metric-count": t.value.metricCount,
3992
+ "hidden-dataset-keys": a(U),
3993
+ onToggleDatasetVisibility: a(G)
3994
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "use-point-style", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "onToggleDatasetVisibility"])) : ve("", !0)
3995
+ ], 2)
3996
+ ]),
3997
+ de(Ot, {
3998
+ "model-value": a(W),
3999
+ "details-payload": a(H),
4000
+ "onUpdate:modelValue": a(y),
4001
+ onValueHover: a(p),
4002
+ onValueLeave: a(k)
4003
+ }, null, 8, ["model-value", "details-payload", "onUpdate:modelValue", "onValueHover", "onValueLeave"])
4004
+ ], 64);
4005
+ };
4006
+ }
4007
+ }), Tt = [
4008
+ "col-span-1",
4009
+ "col-span-2",
4010
+ "col-span-3",
4011
+ "col-span-4",
4012
+ "col-span-5",
4013
+ "col-span-6",
4014
+ "col-span-7",
4015
+ "col-span-8",
4016
+ "col-span-9",
4017
+ "col-span-10",
4018
+ "col-span-11",
4019
+ "col-span-12"
4020
+ ];
4021
+ function fl(e) {
4022
+ return e < 12 ? Tt[e - 1] : Tt[11];
4023
+ }
4024
+ function hl(e) {
4025
+ return e < 12 ? Tt[Math.min(11, e * 2 - 1)] : Tt[11];
4026
+ }
4027
+ function ml(e) {
4028
+ return e < 12 ? Tt[Math.min(11, e * 3 - 1)] : Tt[11];
4029
+ }
4030
+ const pl = { class: "widget-content" }, gl = /* @__PURE__ */ Ne({
4031
+ __name: "WidgetLinechart",
4032
+ props: /* @__PURE__ */ Ue({
4033
+ tileIndex: {}
4034
+ }, {
4035
+ modelValue: { required: !0 },
4036
+ modelModifiers: {}
4037
+ }),
4038
+ emits: ["update:modelValue"],
4039
+ setup(e) {
4040
+ const n = e, t = Oe(e, "modelValue"), o = P(null), r = x(() => {
4041
+ var z;
4042
+ return ((z = t.value.data) == null ? void 0 : z.datasets) ?? [];
4043
+ }), i = x(() => {
4044
+ var z;
4045
+ return ((z = t.value.data) == null ? void 0 : z.xAxis) ?? [];
4046
+ }), s = x(() => i.value.length === 1 && r.value.length > 1 && r.value.every((z) => z.values.length === 1 && z.isCompare !== !0)), c = x(
4047
+ () => i.value.length === 1 && r.value.length > 0 && r.value.every((z) => z.values.length === 1)
4048
+ ), d = x(() => s.value ? r.value.map((z) => z.name) : c.value ? ["", i.value[0], ""] : i.value), v = Wt("line"), R = Mo("report-line-style-plugin-line"), W = x(() => r.value.length > 0 ? [
4049
+ ...r.value.map((z, _) => {
4050
+ var be;
4051
+ const b = zt({
4052
+ datasets: r.value,
4053
+ datasetIndex: _
4054
+ }), O = Ie({
4055
+ datasetIndex: b,
4056
+ isCompare: !1,
4057
+ metricCount: t.value.metricCount,
4058
+ mode: t.value.chartColorBinding
4059
+ }), N = Ie({
4060
+ datasetIndex: b,
4061
+ isCompare: !1,
4062
+ metricCount: t.value.metricCount,
4063
+ mode: xe.metric
4064
+ }), K = Ze({
4065
+ index: O,
4066
+ isCompare: z.isCompare,
4067
+ customColors: t.value.chartColors
4068
+ }), q = t.value.chartColorBinding === xe.breakdown, $ = _t({
4069
+ fallbackIndex: b,
4070
+ metricCount: t.value.metricCount
4071
+ }), Q = q ? Lt({
4072
+ breakdownIndex: $,
4073
+ metricIndex: N,
4074
+ metricCount: t.value.metricCount,
4075
+ isCompare: z.isCompare,
4076
+ breakdownColors: t.value.chartBreakdownColors,
4077
+ useSecondaryMetricShades: t.value.chartUseSecondaryMetricShades,
4078
+ customColors: t.value.chartColors
4079
+ }) : K;
4080
+ let oe = z.values;
4081
+ s.value ? oe = r.value.map(
4082
+ (we, Se) => Se === _ ? z.values[0] : NaN
4083
+ ) : c.value && (oe = [NaN, oe[0], NaN]);
4084
+ const le = oe.map((we) => we === null ? NaN : Number(we)), se = c.value || s.value, ye = Ie({
4085
+ datasetIndex: _,
4086
+ isCompare: z.isCompare,
4087
+ metricCount: t.value.metricCount,
4088
+ mode: t.value.lineStyleBinding
4089
+ }), ie = (be = t.value.lineStyles) == null ? void 0 : be[ye];
4090
+ return {
4091
+ label: z.name,
4092
+ data: le,
4093
+ dash: !!z.isCompare,
4094
+ lineStyle: ie,
4095
+ fill: !1,
4096
+ color: Q,
4097
+ pointRadius: se ? 4 : void 0,
4098
+ pointHoverRadius: se ? 6 : void 0,
4099
+ pointBackgroundColor: se ? Q : void 0,
4100
+ pointBorderColor: se ? Q : void 0,
4101
+ pointBorderWidth: se ? 2 : void 0
4102
+ };
4103
+ })
4104
+ ] : []), {
4105
+ isTooltipDetailsSheetOpen: H,
4106
+ tooltipDetailsPayload: y,
4107
+ handleTooltipDetailsSheetVisibility: p,
4108
+ handleTooltipDetailsHover: k,
4109
+ handleTooltipDetailsLeave: w,
4110
+ comparisonTooltip: F,
4111
+ datalabels: g,
4112
+ xCfg: S,
4113
+ yCfg: B,
4114
+ isTransposed: D,
4115
+ legend: f,
4116
+ chartWidth: L,
4117
+ chartHeight: A,
4118
+ useCustomLegend: u,
4119
+ legendPosition: I,
4120
+ isLegendSide: M,
4121
+ isLegendBeforeChart: U,
4122
+ hiddenDatasetKeys: G,
4123
+ toggleDatasetVisibility: j,
4124
+ datasets: Y
4125
+ } = Et({
4126
+ chartRef: o,
4127
+ model: t,
4128
+ baseDatasets: W,
4129
+ tileIndex: n.tileIndex
4130
+ });
4131
+ return (z, _) => {
4132
+ var O, N, K, q, $, Q;
4133
+ const b = fe("FmLineChart");
4134
+ return J(), ce(ze, null, [
4135
+ ee("div", pl, [
4136
+ Qe(z.$slots, "menu"),
4137
+ ee("div", {
4138
+ class: Le(["chart-layout", {
4139
+ "chart-layout--side": a(u) && (a(f).display ?? !1) && a(M)
4140
+ }])
4141
+ }, [
4142
+ a(u) && (a(f).display ?? !1) && a(U) ? (J(), me(Fe, {
4143
+ key: 0,
4144
+ "chart-ref": o.value,
4145
+ enabled: a(f).display ?? !1,
4146
+ position: a(I),
4147
+ "max-width": a(f).maxWidth,
4148
+ "text-color": (O = a(f).labels) == null ? void 0 : O.color,
4149
+ "font-size": (K = (N = a(f).labels) == null ? void 0 : N.font) == null ? void 0 : K.size,
4150
+ "legend-update-key": a(Y),
4151
+ "chart-color-binding": t.value.chartColorBinding,
4152
+ "chart-colors": t.value.chartColors,
4153
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
4154
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
4155
+ "metric-count": t.value.metricCount,
4156
+ "hidden-dataset-keys": a(G),
4157
+ "use-point-style": t.value.usePointStyle ?? !0,
4158
+ onToggleDatasetVisibility: a(j)
4159
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "use-point-style", "onToggleDatasetVisibility"])) : ve("", !0),
4160
+ de(b, {
4161
+ ref_key: "chartRef",
4162
+ ref: o,
4163
+ class: "line-chart",
4164
+ datasets: a(Y),
4165
+ "x-axis": { categories: d.value },
4166
+ "x-cfg": a(S),
4167
+ "y-cfg": a(B),
4168
+ transpose: a(D),
4169
+ legend: {
4170
+ display: !1
4171
+ },
4172
+ tooltip: a(F),
4173
+ datalabels: a(g),
4174
+ plugins: [a(v), a(R)],
4175
+ "maintain-aspect-ratio": !1,
4176
+ style: Te({
4177
+ "--chart-width": a(u) && (a(f).display ?? !1) && a(M) ? "calc(100% - var(--legend-panel-width, 0px))" : a(L) !== void 0 ? a(L) + "px" : "100%",
4178
+ "--chart-height": a(u) && (a(f).display ?? !1) && !a(M) ? "calc(100% - var(--legend-panel-height, 0px))" : a(A) !== void 0 ? a(A) + "px" : "100%"
4179
+ })
4180
+ }, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "tooltip", "datalabels", "plugins", "style"]),
4181
+ a(u) && (a(f).display ?? !1) && !a(U) ? (J(), me(Fe, {
4182
+ key: 1,
4183
+ "chart-ref": o.value,
4184
+ enabled: a(f).display ?? !1,
4185
+ position: a(I),
4186
+ "max-width": a(f).maxWidth,
4187
+ "text-color": (q = a(f).labels) == null ? void 0 : q.color,
4188
+ "font-size": (Q = ($ = a(f).labels) == null ? void 0 : $.font) == null ? void 0 : Q.size,
4189
+ "legend-update-key": a(Y),
4190
+ "chart-color-binding": t.value.chartColorBinding,
4191
+ "chart-colors": t.value.chartColors,
4192
+ "chart-breakdown-colors": t.value.chartBreakdownColors,
4193
+ "chart-use-secondary-metric-shades": t.value.chartUseSecondaryMetricShades,
4194
+ "metric-count": t.value.metricCount,
4195
+ "hidden-dataset-keys": a(G),
4196
+ "use-point-style": t.value.usePointStyle ?? !0,
4197
+ onToggleDatasetVisibility: a(j)
4198
+ }, null, 8, ["chart-ref", "enabled", "position", "max-width", "text-color", "font-size", "legend-update-key", "chart-color-binding", "chart-colors", "chart-breakdown-colors", "chart-use-secondary-metric-shades", "metric-count", "hidden-dataset-keys", "use-point-style", "onToggleDatasetVisibility"])) : ve("", !0)
4199
+ ], 2)
4200
+ ]),
4201
+ de(Ot, {
4202
+ "model-value": a(H),
4203
+ "details-payload": a(y),
4204
+ "onUpdate:modelValue": a(p),
4205
+ onValueHover: a(k),
4206
+ onValueLeave: a(w)
4207
+ }, null, 8, ["model-value", "details-payload", "onUpdate:modelValue", "onValueHover", "onValueLeave"])
4208
+ ], 64);
4209
+ };
4210
+ }
4211
+ }), vl = { class: "flex flex-col gap-16" }, yl = { class: "flex flex-row" }, bl = /* @__PURE__ */ Ne({
4212
+ __name: "PdfOrientationDialog",
4213
+ props: /* @__PURE__ */ Ue({
4214
+ reportType: {},
4215
+ index: {}
4216
+ }, {
4217
+ modelValue: { type: Boolean, required: !0 },
4218
+ modelModifiers: {}
4219
+ }),
4220
+ emits: ["update:modelValue"],
4221
+ setup(e) {
4222
+ const { t: n } = dt(), { FmForm: t } = ta, o = e, r = P(), i = Oe(e, "modelValue"), s = P(!0), c = P(!1), d = Dn(), { selectedLocationIds: v, dateRange: R, timeRange: W } = it(on()), H = P(dn.PORTRAIT);
4223
+ function y() {
4224
+ var k;
4225
+ (k = r.value) == null || k.validateInputs();
4226
+ }
4227
+ async function p() {
4228
+ c.value = !0;
4229
+ try {
4230
+ o.index != null && await co({
4231
+ reportType: o.reportType,
4232
+ index: o.index,
4233
+ orientationTypes: [H.value],
4234
+ isCombinedLocationLayout: s.value,
4235
+ timeRange: W.value,
4236
+ dateRange: R.value,
4237
+ locationIds: v.value
4238
+ });
4239
+ } catch (k) {
4240
+ d.open({ message: k.message, type: "error" });
4241
+ } finally {
4242
+ c.value = !1;
4243
+ }
4244
+ }
4245
+ return (k, w) => {
4246
+ const F = fe("FmRadio"), g = fe("FmRadioGroup"), S = fe("FmButton"), B = fe("FmDialog");
4247
+ return J(), me(B, {
4248
+ modelValue: i.value,
4249
+ "onUpdate:modelValue": w[2] || (w[2] = (D) => i.value = D),
4250
+ overlay: !0,
4251
+ "z-index": 10
4252
+ }, {
4253
+ "dialog-header": ke(() => w[3] || (w[3] = [
4254
+ Xo("Select Orientation")
4255
+ ])),
4256
+ default: ke(() => [
4257
+ de(a(t), {
4258
+ ref_key: "form",
4259
+ ref: r,
4260
+ onValidationSuccess: p
4261
+ }, {
4262
+ default: ke(() => [
4263
+ ee("div", vl, [
4264
+ de(g, {
4265
+ modelValue: H.value,
4266
+ "onUpdate:modelValue": w[0] || (w[0] = (D) => H.value = D)
4267
+ }, {
4268
+ default: ke(() => [
4269
+ de(F, {
4270
+ value: a(dn).PORTRAIT,
4271
+ label: a(n)("report.common.portrait")
4272
+ }, null, 8, ["value", "label"]),
4273
+ de(F, {
4274
+ value: a(dn).LANDSCAPE,
4275
+ label: a(n)("report.common.landscape")
4276
+ }, null, 8, ["value", "label"])
4277
+ ]),
4278
+ _: 1
4279
+ }, 8, ["modelValue"])
4280
+ ]),
4281
+ ee("div", yl, [
4282
+ w[4] || (w[4] = ee("div", { class: "grow" }, null, -1)),
4283
+ de(S, {
4284
+ label: a(n)("report.common.cancel"),
4285
+ variant: "tertiary",
4286
+ onClick: w[1] || (w[1] = (D) => i.value = !1)
4287
+ }, null, 8, ["label"]),
4288
+ ee("div", null, [
4289
+ de(S, {
4290
+ label: a(n)("report.common.download"),
4291
+ loading: c.value,
4292
+ onClick: y
4293
+ }, null, 8, ["label", "loading"])
4294
+ ])
4295
+ ])
4296
+ ]),
4297
+ _: 1
4298
+ }, 512)
4299
+ ]),
4300
+ _: 1
4301
+ }, 8, ["modelValue"]);
4302
+ };
4303
+ }
4304
+ });
4305
+ function Cl(e) {
4306
+ const { breakpoints: n } = Vt(), { containerRef: t, isTable: o = P(!0) } = e;
4307
+ let r = P(1), i = null, s = null, c = null, d = null, v = null, R = null;
4308
+ function W() {
4309
+ return t.value ? t.value.querySelector("table") : null;
4310
+ }
4311
+ function H() {
4312
+ var A;
4313
+ const f = [];
4314
+ t.value && t.value.querySelectorAll("div,section,main,article,aside").forEach((u) => {
4315
+ if (u.scrollWidth > u.clientWidth) {
4316
+ const I = window.getComputedStyle(u);
4317
+ (I.overflowX === "auto" || I.overflowX === "scroll") && f.push(u);
4318
+ }
4319
+ });
4320
+ let L = (A = t.value) == null ? void 0 : A.parentElement;
4321
+ for (; L; ) {
4322
+ if (L.scrollWidth > L.clientWidth) {
4323
+ const u = window.getComputedStyle(L);
4324
+ (u.overflowX === "auto" || u.overflowX === "scroll") && f.push(L);
4325
+ }
4326
+ L = L.parentElement;
4327
+ }
4328
+ return f;
4329
+ }
4330
+ function y() {
4331
+ if (B(), !o.value || !t.value || (s = W(), !s) || (c = s.querySelector("thead"), !c)) return;
4332
+ i = document.createElement("div"), i.className = "sticky-header-clone", i.style.cssText = `
4333
+ position: fixed;
4334
+ top: ${r.value}px;
4335
+ left: 0;
4336
+ right: 0;
4337
+ z-index: 9;
4338
+ overflow: hidden;
4339
+ pointer-events: none;
4340
+ visibility: hidden;
4341
+ `;
4342
+ const f = document.createElement("table");
4343
+ f.className = s.className, f.style.cssText = `
4344
+ table-layout: fixed;
4345
+ width: ${s.offsetWidth}px;
4346
+ margin: 0;
4347
+ border-collapse: collapse;
4348
+ pointer-events: auto;
4349
+ `;
4350
+ const L = c.cloneNode(!0);
4351
+ L.style.cssText = "pointer-events: auto;", p(c, L), f.appendChild(L), i.appendChild(f), document.body.appendChild(i), F(), g(), S(), w();
4352
+ }
4353
+ function p(f, L) {
4354
+ const A = f.querySelectorAll("th, td"), u = L.querySelectorAll("th, td");
4355
+ A.forEach((I, M) => {
4356
+ const U = u[M];
4357
+ if (!U) return;
4358
+ const G = I, j = window.getComputedStyle(G);
4359
+ Object.assign(U.style, {
4360
+ width: `${G.offsetWidth}px`,
4361
+ minWidth: `${G.offsetWidth}px`,
4362
+ maxWidth: `${G.offsetWidth}px`,
4363
+ height: `${G.offsetHeight}px`,
4364
+ padding: j.padding,
4365
+ backgroundColor: j.backgroundColor,
4366
+ borderBottom: j.borderBottom,
4367
+ fontSize: j.fontSize,
4368
+ fontWeight: j.fontWeight,
4369
+ textAlign: j.textAlign,
4370
+ verticalAlign: j.verticalAlign,
4371
+ boxSizing: "border-box",
4372
+ cursor: j.cursor || "pointer",
4373
+ pointerEvents: "auto"
4374
+ }), U.onclick = (Y) => {
4375
+ Y.preventDefault(), Y.stopPropagation();
4376
+ const z = G.querySelector(
4377
+ "button, a, [role='button']"
4378
+ );
4379
+ z ? z.click() : G.click();
4380
+ };
4381
+ });
4382
+ }
4383
+ function k() {
4384
+ const f = n.value.xs || n.value.sm, L = document.querySelector('[data-editor-header="true"]'), A = document.querySelector('[data-menu-tab="true"]');
4385
+ if (f && !L)
4386
+ return 1;
4387
+ if (L)
4388
+ return L.getBoundingClientRect().bottom;
4389
+ if (A) {
4390
+ let u = A;
4391
+ for (; u; ) {
4392
+ if (window.getComputedStyle(u).position === "sticky")
4393
+ return u.getBoundingClientRect().bottom;
4394
+ u = u.parentElement;
4395
+ }
4396
+ return A.getBoundingClientRect().bottom;
4397
+ }
4398
+ return r.value;
4399
+ }
4400
+ function w() {
4401
+ if (!i || !s || !c || !t.value) return;
4402
+ const f = t.value.getBoundingClientRect(), L = s.getBoundingClientRect(), A = c.getBoundingClientRect(), u = k();
4403
+ if (!(L.top <= u && L.bottom >= u + A.height)) {
4404
+ i.style.visibility = "hidden";
4405
+ return;
4406
+ }
4407
+ i.style.visibility = "visible", i.style.top = `${u}px`;
4408
+ const M = window.getComputedStyle(t.value), U = parseFloat(M.paddingLeft) || 0, G = parseFloat(M.paddingRight) || 0, j = f.left + U, Y = f.right - G, z = Math.max(j, f.left), _ = Math.min(Y, f.right), b = Math.max(0, _ - z);
4409
+ if (b <= 0) {
4410
+ i.style.visibility = "hidden";
4411
+ return;
4412
+ }
4413
+ i.style.left = `${z}px`, i.style.width = `${b}px`;
4414
+ const O = i.querySelector("table");
4415
+ O && (O.style.width = `${s.offsetWidth}px`, O.style.marginLeft = `${A.left - z}px`);
4416
+ }
4417
+ function F() {
4418
+ var L;
4419
+ v = () => requestAnimationFrame(w), window.addEventListener("scroll", v, { passive: !0 }), H().forEach((A) => {
4420
+ v && A.addEventListener("scroll", v, { passive: !0 });
4421
+ });
4422
+ let f = (L = t.value) == null ? void 0 : L.parentElement;
4423
+ for (; f; )
4424
+ f !== document.body && (f.scrollHeight > f.clientHeight || f.scrollWidth > f.clientWidth) && f.addEventListener("scroll", v, { passive: !0 }), f = f.parentElement;
4425
+ }
4426
+ function g() {
4427
+ d = new ResizeObserver(() => {
4428
+ if (c && i) {
4429
+ const f = i.querySelector("thead");
4430
+ f && p(c, f);
4431
+ const L = i.querySelector("table");
4432
+ L && s && (L.style.width = `${s.offsetWidth}px`);
4433
+ }
4434
+ w();
4435
+ }), t.value && d.observe(t.value), s && d.observe(s);
4436
+ }
4437
+ function S() {
4438
+ if (!c) return;
4439
+ const f = gn(() => y(), 100), L = () => {
4440
+ if (c && i) {
4441
+ const A = i.querySelector("thead");
4442
+ A && p(c, A), w();
4443
+ }
4444
+ };
4445
+ R = new MutationObserver((A) => {
4446
+ A.some((I) => I.type === "childList" ? I.addedNodes.length > 0 || I.removedNodes.length > 0 : !1) ? f() : L();
4447
+ }), R.observe(c, {
4448
+ childList: !0,
4449
+ subtree: !0,
4450
+ attributes: !0,
4451
+ characterData: !0
4452
+ });
4453
+ }
4454
+ function B() {
4455
+ var f;
4456
+ if (i && (i.remove(), i = null), v) {
4457
+ window.removeEventListener("scroll", v), H().forEach((A) => {
4458
+ v && A.removeEventListener("scroll", v);
4459
+ });
4460
+ let L = (f = t.value) == null ? void 0 : f.parentElement;
4461
+ for (; L; )
4462
+ L.removeEventListener("scroll", v), L = L.parentElement;
4463
+ v = null;
4464
+ }
4465
+ d && (d.disconnect(), d = null), R && (R.disconnect(), R = null), s = null, c = null;
4466
+ }
4467
+ function D() {
4468
+ y();
4469
+ }
4470
+ return De(o, (f) => {
4471
+ f ? y() : B();
4472
+ }), De(r, () => {
4473
+ i && (i.style.top = `${r.value}px`, w());
4474
+ }), De(t, () => {
4475
+ t.value && o.value && setTimeout(y, 100);
4476
+ }), ct(() => {
4477
+ o.value && setTimeout(y, 100);
4478
+ }), io(() => {
4479
+ B();
4480
+ }), { refresh: D, cleanup: B };
4481
+ }
4482
+ const xl = {
4483
+ key: 1,
4484
+ class: "grow"
4485
+ }, wl = {
4486
+ key: 2,
4487
+ class: "flex"
4488
+ }, Fl = /* @__PURE__ */ Ne({
4489
+ __name: "DynamicWidget",
4490
+ props: /* @__PURE__ */ Ue({
4491
+ index: {
4492
+ type: Number,
4493
+ default: 0
4494
+ },
4495
+ hideExport: {
4496
+ type: Boolean,
4497
+ default: !1
4498
+ },
4499
+ customScreenWidth: {
4500
+ type: Number,
4501
+ required: !1,
4502
+ default: void 0
4503
+ },
4504
+ isStyleEditing: {
4505
+ type: Boolean,
4506
+ default: !1
4507
+ }
4508
+ }, {
4509
+ modelValue: { required: !0, default: () => {
4510
+ } },
4511
+ modelModifiers: {}
4512
+ }),
4513
+ emits: ["update:modelValue"],
4514
+ setup(e) {
4515
+ const n = P(!0), t = Oe(e, "modelValue"), o = t.value.widget.config, { t: r, te: i, locale: s } = dt(), c = e, d = P(null), v = x(() => t.value.widget.type === ne.Table), R = x(() => {
4516
+ var T;
4517
+ return (T = d.value) == null ? void 0 : T.$el;
4518
+ }), { refresh: W } = Cl({
4519
+ containerRef: R,
4520
+ isTable: v
4521
+ }), H = P(o.rollup), y = P(Ft()), p = P(o.drillDimension), k = x(() => {
4522
+ if (Pe.value.length > 0) {
4523
+ const T = Pe.value.findIndex(
4524
+ (he) => he.value === p.value
4525
+ );
4526
+ return T >= 0 ? T : 0;
4527
+ } else
4528
+ return -1;
4529
+ }), w = x(() => k.value !== 0), F = x(
4530
+ () => k.value != Pe.value.length - 1
4531
+ ), g = P(o.showTitle ?? !0), S = P(o.titleFontSize ?? 14), B = P(o.titleBold ?? !1), D = P(o.titleItalic ?? !1), f = P(o.titleUnderline ?? !1), L = P(o.chartWidth ?? void 0), A = P(o.chartHeight ?? void 0), u = P(
4532
+ Array.isArray(o.chartColors) ? [...o.chartColors] : void 0
4533
+ ), I = P(
4534
+ Array.isArray(o.chartColorLayers) ? [...o.chartColorLayers] : void 0
4535
+ ), M = P(
4536
+ Array.isArray(o.chartBreakdownColors) ? [...o.chartBreakdownColors] : void 0
4537
+ ), U = P(o.chartUseSecondaryMetricShades ?? !0), G = P(o.chartColorBinding), j = P(
4538
+ Array.isArray(o.lineStyles) ? [...o.lineStyles] : void 0
4539
+ ), Y = P(o.lineStyleBinding), z = P(o.showLabel ?? !1), _ = P(o.labelAlign ?? Cn.center), b = P(o.labelAnchor ?? bn.center), O = P(o.labelRotation ?? 0), N = P(o.labelOffset ?? 0), K = P(o.labelFontSize ?? 12), q = x(() => o.showSearchBar), $ = P(o.showX ?? !0), Q = P(o.xPosition ?? xn.bottom), oe = P(o.showXGrid ?? !1), le = P(o.showXTick ?? !0), se = P(o.xTickFontSize ?? 12), ye = P(o.showXTitle ?? !1), ie = P(o.xTitle ?? ""), be = P(o.xTitleFontSize ?? 12), we = P(o.showY ?? !0), Se = P(o.yPosition ?? wn.left), Ke = P(o.showYGrid ?? !1), Xe = P(o.showYTick ?? !0), et = P(o.yTickFontSize ?? 12), Dt = P(o.showYTitle ?? !1), ft = P(o.yTitle ?? ""), ht = P(o.yTitleFontSize ?? 12), mt = P(o.showLegend ?? void 0), tt = P(o.legendPosition ?? Sn.top), nt = P(o.usePointStyle ?? !0), pt = P(o.legendFontSize), $e = P(o.legendColor ?? "#6b6b6b"), ot = P(o.legendMaxWidth), Ut = P(o.maxTooltipItems), Kt = P(o.stackBarOverlap ?? !1), Pt = P(o.rowHeight ?? 0), Ye = P(o.colWidths ?? []), It = P(!1), Mt = P(""), { breakpoints: qe, getBreakpointsBoundary: Ge } = Vt(), Xt = P(), _e = x(
4540
+ () => c.customScreenWidth === void 0 ? window.innerWidth : c.customScreenWidth
4541
+ ), Bt = x(
4542
+ () => (_e == null ? void 0 : _e.value) > Ge("xs")[1] && (_e == null ? void 0 : _e.value) <= Ge("sm")[1]
4543
+ ), rn = x(
4544
+ () => (_e == null ? void 0 : _e.value) > Ge("sm")[1] && (_e == null ? void 0 : _e.value) <= Ge("md")[1]
4545
+ ), ln = x(() => (_e == null ? void 0 : _e.value) > Ge("md")[1]), Yt = x(() => {
4546
+ const T = t.value.size.width;
4547
+ return ln.value || rn.value ? fl(T) : Bt.value ? hl(T) : ml(T);
4548
+ }), gt = x(
4549
+ () => na.find((T) => T.type === t.value.widget.type)
4550
+ ), je = gn(() => {
4551
+ var T;
4552
+ Xt.value = un((T = d.value) == null ? void 0 : T.$el.offsetWidth), y.value = Ft();
4553
+ }), sn = x(() => {
4554
+ if (oa(re.value.type, l.value))
4555
+ switch (t.value.widget.type) {
4556
+ case ne.BarChart:
4557
+ return $r;
4558
+ case ne.StackBarChart:
4559
+ return rl;
4560
+ case ne.ClusteredStackBarChart:
4561
+ return il;
4562
+ case ne.LineChart:
4563
+ return gl;
4564
+ case ne.StackLineChart:
4565
+ return dl;
4566
+ case ne.Circular:
4567
+ return zr;
4568
+ case ne.Scorecard:
4569
+ return Xr;
4570
+ case ne.Spacer:
4571
+ return Gr;
4572
+ case ne.Table:
4573
+ return nl;
4574
+ default:
4575
+ return Hn;
4576
+ }
4577
+ else
4578
+ return Hn;
4579
+ }), l = P(null), { selectedLocationIds: m, dateRange: h, compareDateRange: C, timeRange: V } = it(on()), { globalFilters: X, isGlobalFiltersLoading: Z } = it(Jo()), { businessId: te } = it(Ln()), { businessLoadedId: E, businessDataVersion: ue } = it(on());
4580
+ x(() => E.value === te.value && m.value.length > 0 && !Z.value);
4581
+ const ge = P(!0), re = x(() => {
4582
+ const T = JSON.parse(JSON.stringify(t.value.widget));
4583
+ return {
4584
+ ...T,
4585
+ config: {
4586
+ ...T.config,
4587
+ rollup: H.value,
4588
+ drillDimension: p.value,
4589
+ showGrandTotal: !1
4590
+ }
4591
+ };
4592
+ }), ae = x(() => {
4593
+ var Re;
4594
+ const T = ((Re = re.value.config.metrics) == null ? void 0 : Re.length) ?? 0;
4595
+ if (!re.value.config.isBlend)
4596
+ return T;
4597
+ const he = (re.value.config.joinDatasources ?? []).reduce(
4598
+ (rt, cn) => {
4599
+ var vt;
4600
+ return rt + (((vt = cn.metrics) == null ? void 0 : vt.length) ?? 0);
4601
+ },
4602
+ 0
4603
+ );
4604
+ return T + he;
4605
+ });
4606
+ function pe() {
4607
+ return {
4608
+ data: l.value,
4609
+ showTitle: g.value,
4610
+ titleFontSize: S.value,
4611
+ titleBold: B.value,
4612
+ titleItalic: D.value,
4613
+ titleUnderline: f.value,
4614
+ chartHeight: A.value,
4615
+ chartWidth: L.value,
4616
+ chartColors: u.value,
4617
+ chartColorLayers: I.value,
4618
+ chartBreakdownColors: M.value,
4619
+ chartUseSecondaryMetricShades: U.value,
4620
+ chartColorBinding: G.value,
4621
+ metricCount: ae.value,
4622
+ lineStyles: j.value,
4623
+ lineStyleBinding: Y.value,
4624
+ showLabel: z.value,
4625
+ labelAnchor: b.value,
4626
+ labelAlign: _.value,
4627
+ labelRotation: O.value,
4628
+ labelOffset: N.value,
4629
+ labelFontSize: K.value,
4630
+ showX: $.value,
4631
+ xPosition: Q.value,
4632
+ showXGrid: oe.value,
4633
+ showXTick: le.value,
4634
+ xTickFontSize: se.value,
4635
+ showXTitle: ye.value,
4636
+ xTitle: ie.value,
4637
+ xTitleFontSize: be.value,
4638
+ showY: we.value,
4639
+ yPosition: Se.value,
4640
+ showYGrid: Ke.value,
4641
+ showYTick: Xe.value,
4642
+ yTitle: ft.value,
4643
+ showYTitle: Dt.value,
4644
+ yTitleFontSize: ht.value,
4645
+ yTickFontSize: et.value,
4646
+ isTransposed: re.value.config.isTransposed,
4647
+ showLegend: mt.value,
4648
+ legendPosition: tt.value,
4649
+ usePointStyle: nt.value,
4650
+ legendFontSize: pt.value,
4651
+ legendColor: $e.value,
4652
+ legendMaxWidth: ot.value,
4653
+ maxTooltipItems: Ut.value,
4654
+ stackBarOverlap: Kt.value
4655
+ };
4656
+ }
4657
+ function Ce() {
4658
+ return {
4659
+ data: l.value,
4660
+ filterText: Mt.value,
4661
+ rollupPosition: re.value.config.rollupPosition,
4662
+ grandTotalLabel: re.value.config.grandTotalLabel,
4663
+ rowHeight: Pt.value,
4664
+ colWidths: Ye.value
4665
+ };
4666
+ }
4667
+ const Me = x(() => {
4668
+ switch (re.value.type) {
4669
+ case ne.Table:
4670
+ return Ce();
4671
+ case ne.BarChart:
4672
+ case ne.LineChart:
4673
+ case ne.StackBarChart:
4674
+ case ne.ClusteredStackBarChart:
4675
+ case ne.StackLineChart:
4676
+ case ne.Circular:
4677
+ return pe();
4678
+ default:
4679
+ return { data: l.value };
4680
+ }
4681
+ }), He = x(() => {
4682
+ const { config: T } = t.value.widget;
4683
+ if (T.rollup != null) {
4684
+ const he = [...T.dimensions].filter((Re) => !Re.hide);
4685
+ return he.sort(
4686
+ (Re, rt) => (T.rowIds || []).indexOf(fn(Re)) - (T.rowIds || []).indexOf(fn(rt))
4687
+ ), [
4688
+ { label: lt(r, i, "None", "other"), value: "none" },
4689
+ { label: lt(r, i, "Grand Total", "other"), value: 0 },
4690
+ ...[...he].slice(0, he.length - 1).map((Re, rt) => ({
4691
+ label: lt(r, i, Re.label, "other"),
4692
+ value: rt + 1
4693
+ }))
4694
+ ];
4695
+ }
4696
+ return [];
4697
+ }), Pe = x(() => {
4698
+ const { config: T } = re.value;
4699
+ return T.isDrillable ? T.dimensions.map((he) => ({
4700
+ label: lt(r, i, he.label, "other"),
4701
+ value: fn(he)
4702
+ })) : [];
4703
+ }), at = x(() => {
4704
+ const T = t.value.id;
4705
+ return (X.value || []).filter(
4706
+ (he) => Array.isArray(he.tileIds) && he.tileIds.includes(T)
4707
+ );
4708
+ });
4709
+ De(
4710
+ () => t.value.widget.config,
4711
+ (T) => {
4712
+ H.value = T.rollup, g.value = T.showTitle ?? !0, S.value = T.titleFontSize ?? 14, B.value = T.titleBold ?? !1, D.value = T.titleItalic ?? !1, f.value = T.titleUnderline ?? !1, A.value = T.chartHeight ?? void 0, L.value = T.chartWidth ?? void 0, u.value = Array.isArray(T.chartColors) ? [...T.chartColors] : void 0, I.value = Array.isArray(T.chartColorLayers) ? [...T.chartColorLayers] : void 0, M.value = Array.isArray(T.chartBreakdownColors) ? [...T.chartBreakdownColors] : void 0, U.value = T.chartUseSecondaryMetricShades ?? !0, G.value = T.chartColorBinding, j.value = Array.isArray(T.lineStyles) ? [...T.lineStyles] : void 0, Y.value = T.lineStyleBinding, z.value = T.showLabel ?? !1, _.value = T.labelAlign ?? Cn.center, b.value = T.labelAnchor ?? bn.center, O.value = T.labelRotation ?? 0, N.value = T.labelOffset ?? 0, K.value = T.labelFontSize ?? 12, $.value = T.showX ?? !0, Q.value = T.xPosition ?? xn.bottom, oe.value = T.showXGrid ?? !1, le.value = T.showXTick ?? !0, se.value = T.xTickFontSize ?? 12, ye.value = T.showXTitle ?? !1, ie.value = T.xTitle ?? "", be.value = T.xTitleFontSize ?? 12, we.value = T.showY ?? !0, Se.value = T.yPosition ?? wn.left, Ke.value = T.showYGrid ?? !1, Xe.value = T.showYTick ?? !0, et.value = T.yTickFontSize ?? 12, Dt.value = T.showYTitle ?? !1, ft.value = T.yTitle ?? "", ht.value = T.yTitleFontSize ?? 12, mt.value = T.showLegend ?? void 0, tt.value = T.legendPosition ?? Sn.top, nt.value = T.usePointStyle ?? !0, pt.value = T.legendFontSize, $e.value = T.legendColor ?? "#6b6b6b", ot.value = T.legendMaxWidth, Ut.value = T.maxTooltipItems, Kt.value = T.stackBarOverlap ?? !1, Pt.value = T.rowHeight ?? 0, Ye.value = T.colWidths ?? [], y.value = Ft();
4713
+ },
4714
+ { deep: !0 }
4715
+ ), De([() => H.value], () => {
4716
+ H.value !== null && (t.value.widget.config.rollup = H.value);
4717
+ }), De(
4718
+ [
4719
+ () => re.value,
4720
+ () => h.value,
4721
+ () => V.value,
4722
+ () => C.value,
4723
+ () => m.value,
4724
+ () => at.value,
4725
+ () => ue.value
4726
+ ],
4727
+ () => {
4728
+ qt();
4729
+ },
4730
+ { deep: !0 }
4731
+ ), De(
4732
+ [() => t.value.size],
4733
+ () => {
4734
+ je();
4735
+ },
4736
+ { deep: !0 }
4737
+ ), ct(() => {
4738
+ je(), qe.value.sm || qe.value.md || qe.value.xs ? (console.log("Ignoring resize event due to keyboard"), addEventListener("change", je)) : addEventListener("resize", je), qt();
4739
+ }), io(() => {
4740
+ qe.value.sm || qe.value.md || qe.value.xs ? (console.log("Ignoring resize event due to keyboard"), removeEventListener("change", je)) : removeEventListener("resize", je);
4741
+ });
4742
+ const Be = Dn();
4743
+ let We;
4744
+ async function qt() {
4745
+ if (!c.isStyleEditing) {
4746
+ if (re.value.config.schemaNames.length <= 0 && !(re.value.config.dimensions.length <= 0 || re.value.config.metrics.length <= 0)) {
4747
+ Be.open({
4748
+ message: "schema must not be empty and dimension or metrics must have at least 1 column",
4749
+ type: "info"
4750
+ }), n.value = !1;
4751
+ return;
4752
+ }
4753
+ try {
4754
+ n.value = !0, We && We.abort(), We = new AbortController();
4755
+ const T = We.signal, he = ue.value, Re = await gn(
4756
+ Zo,
4757
+ 500
4758
+ )({
4759
+ widget: re.value,
4760
+ signal: T,
4761
+ tileId: t.value.id
4762
+ });
4763
+ ue.value === he && (l.value = Re, y.value = Ft(), setTimeout(() => W(), 100)), n.value = !1;
4764
+ } catch (T) {
4765
+ T.code !== "ERR_CANCELED" && (l.value = null, Be.open({ message: `Invalid chart ${re.value.type}`, type: "error" }), console.log(T), n.value = !1);
4766
+ }
4767
+ }
4768
+ }
4769
+ function un(T) {
4770
+ switch (t.value.widget.type) {
4771
+ case "SPACER":
4772
+ return;
4773
+ case "SCORECARD":
4774
+ return;
4775
+ case "TABLE":
4776
+ return `${t.value.size.height * 100 + (q.value ? 72 : 0) + 96.5}px`;
4777
+ }
4778
+ return `${Math.max(T / t.value.size.width, 90) * t.value.size.height}px`;
4779
+ }
4780
+ function Gt() {
4781
+ const T = k.value - 1;
4782
+ T >= 0 && (p.value = Pe.value[T].value);
4783
+ }
4784
+ function Bo() {
4785
+ const T = k.value + 1;
4786
+ T >= 0 && T < Pe.value.length && (p.value = Pe.value[T].value);
4787
+ }
4788
+ const Fn = P(bt.EXCEL), Nn = P(), Ao = Object.values(bt).map((T) => ({
4789
+ label: Qo(T),
4790
+ value: T,
4791
+ onClick: async () => {
4792
+ T === bt.EXCEL || T === bt.PDFFULLSIZE || T === bt.PDFRECEIPT ? await co({
4793
+ reportType: T,
4794
+ index: c.index,
4795
+ isCombinedLocationLayout: ge.value,
4796
+ timeRange: V.value,
4797
+ dateRange: h.value,
4798
+ locationIds: m.value
4799
+ }) : T === bt.PDF && (Fn.value = T, Nn.value = c.index, It.value = !0);
4800
+ }
4801
+ })), Ro = re.value.type === ne.Spacer ? "flat" : "outlined", Fo = re.value.type === ne.Spacer ? "p-0" : "p-16";
4802
+ return (T, he) => {
4803
+ const Re = fe("FmTooltip"), rt = fe("FmSearch"), cn = fe("FmCheckbox"), vt = fe("FmButton"), No = fe("FmSelect"), $o = fe("FmMenuItem"), Vo = fe("FmMenu"), zo = fe("FmForm"), Ho = fe("FmCircularProgress"), Wo = fe("FmCard");
4804
+ return J(), me(Wo, {
4805
+ ref_key: "tileCard",
4806
+ ref: d,
4807
+ class: Le(`${Yt.value} ${a(Fo)}`),
4808
+ variant: a(Ro)
4809
+ }, {
4810
+ default: ke(() => [
4811
+ de(bl, {
4812
+ modelValue: It.value,
4813
+ "onUpdate:modelValue": he[0] || (he[0] = (yt) => It.value = yt),
4814
+ "report-type": Fn.value,
4815
+ index: Nn.value
4816
+ }, null, 8, ["modelValue", "report-type", "index"]),
4817
+ !n.value && !a(Z) ? (J(), ce("div", {
4818
+ key: 0,
4819
+ style: Te({ height: Xt.value })
4820
+ }, [
4821
+ (J(), me(so(sn.value), {
4822
+ key: y.value,
4823
+ modelValue: Me.value,
4824
+ "onUpdate:modelValue": he[4] || (he[4] = (yt) => Me.value = yt),
4825
+ "tile-index": c.index
4826
+ }, {
4827
+ menu: ke(() => [
4828
+ de(zo, { class: "flex items-center gap-2" }, {
4829
+ default: ke(() => {
4830
+ var yt, $n, Vn, zn;
4831
+ return [
4832
+ de(Re, {
4833
+ variant: "plain",
4834
+ placement: "right",
4835
+ content: re.value.description,
4836
+ "hide-arrow": !0,
4837
+ disabled: !re.value.description,
4838
+ "z-index": 99
4839
+ }, {
4840
+ default: ke(() => [
4841
+ g.value !== !1 ? (J(), ce("p", {
4842
+ key: 0,
4843
+ style: Te({
4844
+ fontSize: S.value + "px",
4845
+ fontWeight: B.value ? "bold" : "normal",
4846
+ fontStyle: D.value ? "italic" : "normal",
4847
+ textDecoration: f.value ? "underline" : "none"
4848
+ }),
4849
+ class: Le(["text-fm-color-typo-secondary line-clamp-1", [
4850
+ S.value <= 18 ? "fm-typo-en-body-md-400" : "",
4851
+ re.value.description ? "border-b-2 border-dashed border-gray-300" : ""
4852
+ ]])
4853
+ }, Ae(a(lt)(a(r), a(i), re.value.title, "other")), 7)) : ve("", !0)
4854
+ ]),
4855
+ _: 1
4856
+ }, 8, ["content", "disabled"]),
4857
+ (yt = gt.value) != null && yt.showSearchBar ? (J(), me(rt, {
4858
+ key: 0,
4859
+ modelValue: Mt.value,
4860
+ "onUpdate:modelValue": he[1] || (he[1] = (Ee) => Mt.value = Ee),
4861
+ class: "grow"
4862
+ }, null, 8, ["modelValue"])) : (J(), ce("div", xl)),
4863
+ Yo(de(cn, {
4864
+ modelValue: z.value,
4865
+ "onUpdate:modelValue": he[2] || (he[2] = (Ee) => z.value = Ee),
4866
+ label: "Label",
4867
+ value: !1
4868
+ }, null, 8, ["modelValue"]), [
4869
+ [qo, ($n = gt.value) == null ? void 0 : $n.showLabel]
4870
+ ]),
4871
+ (Vn = gt.value) != null && Vn.showDrillDimension && Pe.value.length > 0 ? (J(), ce("div", wl, [
4872
+ de(vt, {
4873
+ icon: "arrow_upward",
4874
+ variant: "tertiary",
4875
+ disabled: !w.value,
4876
+ onClick: Gt
4877
+ }, null, 8, ["disabled"]),
4878
+ de(vt, {
4879
+ icon: "arrow_downward",
4880
+ variant: "tertiary",
4881
+ disabled: !F.value,
4882
+ onClick: Bo
4883
+ }, null, 8, ["disabled"])
4884
+ ])) : ve("", !0),
4885
+ (zn = gt.value) != null && zn.showRollup && He.value.length > 0 ? (J(), me(No, {
4886
+ key: `rollup-${a(s)}`,
4887
+ modelValue: H.value,
4888
+ "onUpdate:modelValue": he[3] || (he[3] = (Ee) => H.value = Ee),
4889
+ class: "w-[150px]",
4890
+ items: He.value
4891
+ }, null, 8, ["modelValue", "items"])) : ve("", !0),
4892
+ c.hideExport ? ve("", !0) : (J(), me(Vo, {
4893
+ key: 4,
4894
+ shift: !0
4895
+ }, {
4896
+ "menu-button": ke(() => [
4897
+ de(vt, {
4898
+ icon: "more_vert",
4899
+ variant: "tertiary"
4900
+ })
4901
+ ]),
4902
+ default: ke(() => [
4903
+ (J(!0), ce(ze, null, Nt(a(Ao), (Ee) => (J(), me($o, {
4904
+ key: Ee.value,
4905
+ label: Ee.label,
4906
+ onClick: Ee.onClick
4907
+ }, null, 8, ["label", "onClick"]))), 128))
4908
+ ]),
4909
+ _: 1
4910
+ }))
4911
+ ];
4912
+ }),
4913
+ _: 1
4914
+ })
4915
+ ]),
4916
+ _: 1
4917
+ }, 8, ["modelValue", "tile-index"]))
4918
+ ], 4)) : (J(), me(Ho, { key: 1 }))
4919
+ ]),
4920
+ _: 1
4921
+ }, 8, ["class", "variant"]);
4922
+ };
4923
+ }
4924
+ });
4925
+ export {
4926
+ Cn as L,
4927
+ Je as R,
4928
+ xe as S,
4929
+ xn as X,
4930
+ wn as Y,
4931
+ Fl as _,
4932
+ bn as a,
4933
+ mo as b,
4934
+ Rl as c,
4935
+ wt as d,
4936
+ Sn as e,
4937
+ fn as g,
4938
+ ao as u
4939
+ };