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