@feedmepos/mf-report 5.27.36 → 5.27.37-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-CHT3iF-7.js → App-a4tBFUHG.js} +39 -39
  2. package/dist/{DateRangeSelect-D2772bgT.js → DateRangeSelect-CzdH8KIh.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CArSG8Z_.js → Default.vue_vue_type_script_setup_true_lang-Das5NydC.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-RABMoQ3F.js → DynamicWidget.vue_vue_type_script_setup_true_lang-C7MfH6lO.js} +189 -189
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DzZP-ANz.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CY9Ittfx.js} +320 -332
  6. package/dist/{InsightView-KYbGpFKj.js → InsightView-CeM0vAPG.js} +4 -4
  7. package/dist/{Integration-CocbSCYz.js → Integration-khURGqXN.js} +3 -3
  8. package/dist/{Integrations-DaKi0pnt.js → Integrations-ByX5HR8T.js} +2 -2
  9. package/dist/{Layout-p1hYeFa3.js → Layout-CuDYhf7_.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DG-9RjS_.js → MenuTab.vue_vue_type_script_setup_true_lang-Cugq5T_x.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-By2GxyK2.js → NavigationTab.vue_vue_type_script_setup_true_lang-CtFQwutL.js} +3 -3
  12. package/dist/{OverviewView-CfmhSHLj.js → OverviewView-CVHgWDoJ.js} +4 -4
  13. package/dist/{Report-tUyaWEtI.js → Report-CjubflTp.js} +3 -3
  14. package/dist/{ReportEditor-BUXYZXMs.js → ReportEditor--ybAiFQo.js} +6 -6
  15. package/dist/{ReportView-BwrLb4jX.js → ReportView-uIuOcRa1.js} +6 -6
  16. package/dist/{Setting-DApgIt2e.js → Setting-BBNkwb-7.js} +3 -3
  17. package/dist/{Template-Cte2kk4J.js → Template-CCfgnFUd.js} +3 -3
  18. package/dist/TileEditor-DO4ZbyI4.js +4160 -0
  19. package/dist/{TileGrid.vue_vue_type_script_setup_true_lang-CC-xGpBd.js → TileGrid.vue_vue_type_script_setup_true_lang-BFN_LBP_.js} +2 -2
  20. package/dist/{TransitionFade-DszPGM-J.js → TransitionFade-BVqXn6QI.js} +4 -4
  21. package/dist/{app-CwM9HM2R.js → app-CF0phXX0.js} +1569 -1565
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-Ci7ZpIYk.js → formatChartData.worker-4gz12Ml-.js} +6 -6
  24. package/dist/assets/{processTableData.worker-C2Ubh_e0.js → processTableData.worker-KnOy0AZ-.js} +6 -6
  25. package/dist/{useRestaurantPermission-BQ0MKNOz.js → useRestaurantPermission-DKLxTWCr.js} +1 -1
  26. package/package.json +1 -1
  27. package/dist/TileEditor-DPUludYa.js +0 -4154
@@ -0,0 +1,4160 @@
1
+ import { defineComponent as me, mergeModels as ve, useModel as ge, computed as C, ref as ae, resolveComponent as M, createElementBlock as P, openBlock as c, createVNode as m, createElementVNode as h, unref as l, withCtx as ee, toDisplayString as J, Fragment as de, renderList as Se, withModifiers as he, createTextVNode as We, watch as xe, createCommentVNode as z, createBlock as I, renderSlot as kl, onBeforeUnmount as ul, resolveDynamicComponent as Fl, normalizeClass as Fe, withDirectives as ke, vShow as $e, onMounted as Vl, withKeys as fl, vModelText as El, normalizeStyle as il, isRef as Wl } from "vue";
2
+ import { useRoute as Xl, useRouter as Hl } from "vue-router";
3
+ import { u as dl, f as ml, h as Ee, F as Ne, d as el, S as rl, a as ql, W as Gl, T as Yl, c as Jl, b as gl } from "./TransitionFade-BVqXn6QI.js";
4
+ import { W as Y, a as Sl, t as Xe, D as Ye, S as yl, C as Kl, u as _l, P as bl, F as Pe, e as Le, b as Ql, c as Zl, j as et } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CY9Ittfx.js";
5
+ import { storeToRefs as Re } from "pinia";
6
+ import { u as Tl } from "./message-dialog-UoMWOnil.js";
7
+ import { useSnackbar as lt, useBreakpoints as $l, FmButtonColorThemeVariant as Ue } from "@feedmepos/ui-library";
8
+ import { h as tt, g as Ve, R as hl, d as ot, e as at, j as nt, L as Ae, k as ol, S as se, l as fe, m as al, n as wl, a as Dl } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-C7MfH6lO.js";
9
+ import { a as be, _ as Ul } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGbb3b5G.js";
10
+ import { u as pe, _ as Bl } from "./_plugin-vue_export-helper-onplcgja.js";
11
+ import { r as ue } from "./i18n-CI_sQ5d_.js";
12
+ import { a as je, d as Je } from "./DateRangeSelect-CzdH8KIh.js";
13
+ import { a as it, d as Ge } from "./app-CF0phXX0.js";
14
+ const ll = [
15
+ {
16
+ type: Y.Circular,
17
+ maxDimension: null,
18
+ maxMetric: 1,
19
+ hasBreakdownDimension: !1,
20
+ canTranspose: !1,
21
+ isDrillConfigurable: !1,
22
+ hasChart: !0,
23
+ hasTable: !1,
24
+ hasLabel: !0,
25
+ hasLegend: !0,
26
+ hasXy: !1,
27
+ canRollup: !1,
28
+ showRollupPosition: !1,
29
+ canSearch: !1,
30
+ periodType: null
31
+ },
32
+ {
33
+ type: Y.Table,
34
+ maxDimension: null,
35
+ maxMetric: null,
36
+ hasBreakdownDimension: !1,
37
+ canTranspose: !1,
38
+ isDrillConfigurable: !0,
39
+ hasChart: !1,
40
+ hasTable: !0,
41
+ hasLabel: !1,
42
+ hasLegend: !1,
43
+ hasXy: !1,
44
+ canRollup: !0,
45
+ showRollupPosition: !0,
46
+ canSearch: !0,
47
+ periodType: null
48
+ },
49
+ {
50
+ type: Y.BarChart,
51
+ maxDimension: null,
52
+ maxMetric: 1,
53
+ hasBreakdownDimension: !0,
54
+ canTranspose: !0,
55
+ isDrillConfigurable: !1,
56
+ hasChart: !0,
57
+ hasTable: !1,
58
+ hasLabel: !0,
59
+ hasLegend: !0,
60
+ hasXy: !0,
61
+ canRollup: !1,
62
+ showRollupPosition: !1,
63
+ canSearch: !1,
64
+ periodType: null
65
+ },
66
+ {
67
+ type: Y.LineChart,
68
+ maxDimension: null,
69
+ maxMetric: 1,
70
+ hasBreakdownDimension: !0,
71
+ canTranspose: !0,
72
+ isDrillConfigurable: !1,
73
+ hasChart: !0,
74
+ hasTable: !1,
75
+ hasLabel: !0,
76
+ hasLegend: !0,
77
+ hasXy: !0,
78
+ canRollup: !1,
79
+ showRollupPosition: !1,
80
+ canSearch: !1,
81
+ periodType: null
82
+ },
83
+ {
84
+ type: Y.StackBarChart,
85
+ maxDimension: null,
86
+ maxMetric: 1,
87
+ hasBreakdownDimension: !0,
88
+ canTranspose: !0,
89
+ isDrillConfigurable: !1,
90
+ hasChart: !0,
91
+ hasTable: !1,
92
+ hasLabel: !0,
93
+ hasLegend: !0,
94
+ hasXy: !0,
95
+ canRollup: !1,
96
+ showRollupPosition: !1,
97
+ canSearch: !1,
98
+ periodType: null
99
+ },
100
+ {
101
+ type: Y.ClusteredStackBarChart,
102
+ maxDimension: null,
103
+ maxMetric: 1,
104
+ hasBreakdownDimension: !0,
105
+ canTranspose: !0,
106
+ isDrillConfigurable: !1,
107
+ hasChart: !0,
108
+ hasTable: !1,
109
+ hasLabel: !0,
110
+ hasLegend: !0,
111
+ hasXy: !0,
112
+ canRollup: !1,
113
+ showRollupPosition: !1,
114
+ canSearch: !1,
115
+ periodType: null
116
+ },
117
+ {
118
+ type: Y.StackLineChart,
119
+ maxDimension: null,
120
+ maxMetric: 1,
121
+ hasBreakdownDimension: !0,
122
+ canTranspose: !0,
123
+ isDrillConfigurable: !1,
124
+ hasChart: !0,
125
+ hasTable: !1,
126
+ hasLabel: !0,
127
+ hasLegend: !0,
128
+ hasXy: !0,
129
+ canRollup: !1,
130
+ showRollupPosition: !1,
131
+ canSearch: !1,
132
+ periodType: null
133
+ },
134
+ {
135
+ type: Y.Scorecard,
136
+ maxDimension: null,
137
+ maxMetric: 1,
138
+ hasBreakdownDimension: !1,
139
+ canTranspose: !1,
140
+ isDrillConfigurable: !1,
141
+ hasChart: !1,
142
+ hasTable: !1,
143
+ hasLabel: !1,
144
+ hasLegend: !1,
145
+ hasXy: !1,
146
+ canRollup: !1,
147
+ showRollupPosition: !1,
148
+ canSearch: !1,
149
+ periodType: null
150
+ },
151
+ {
152
+ type: Y.Spacer,
153
+ maxDimension: 0,
154
+ maxMetric: 0,
155
+ hasBreakdownDimension: !1,
156
+ canTranspose: !1,
157
+ isDrillConfigurable: !1,
158
+ hasChart: !1,
159
+ hasTable: !1,
160
+ hasLabel: !1,
161
+ hasLegend: !1,
162
+ hasXy: !1,
163
+ canRollup: !1,
164
+ showRollupPosition: !1,
165
+ canSearch: !1,
166
+ periodType: null
167
+ }
168
+ ], rt = { class: "flex flex-col my-2 gap-8" }, st = { class: "fm-typo-en-body-lg-600" }, ut = { class: "text-sm text-fm-color-neutral-gray-400" }, dt = ["onClick"], mt = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, ct = /* @__PURE__ */ me({
169
+ __name: "SchemaSection",
170
+ props: /* @__PURE__ */ ve({
171
+ options: {
172
+ type: Array,
173
+ default: () => []
174
+ },
175
+ label: {
176
+ type: String,
177
+ default: "Schema"
178
+ }
179
+ }, {
180
+ modelValue: { required: !0 },
181
+ modelModifiers: {}
182
+ }),
183
+ emits: ["update:modelValue"],
184
+ setup(B) {
185
+ const { t: p, te: e } = pe(), a = ge(B, "modelValue"), o = B, { schemas: S } = Re(Sl()), v = C(
186
+ () => S.value.map((d) => ({
187
+ label: d.label,
188
+ value: d.name,
189
+ raw: d
190
+ }))
191
+ ), f = C(() => {
192
+ if (a.value.schemaNames.length === 0 || i.value === 0)
193
+ return v.value.filter((d) => !d.raw.isJoinOnly);
194
+ {
195
+ const d = a.value.schemaNames[0], w = S.value.find((A) => A.name === d), R = ((w == null ? void 0 : w.joins) || []).map((A) => A);
196
+ return v.value.filter((A) => R.includes(A.raw.name));
197
+ }
198
+ }), D = ae(!1), O = ae(""), i = ae(), r = lt();
199
+ function g(d) {
200
+ var w;
201
+ return ue(
202
+ p,
203
+ e,
204
+ (w = S.value.find((R) => R.name === d)) == null ? void 0 : w.label,
205
+ "schema"
206
+ );
207
+ }
208
+ function F(d) {
209
+ i.value = d, D.value = !0, d !== void 0 ? O.value = a.value.schemaNames[d] : O.value = "";
210
+ }
211
+ function L() {
212
+ O.value !== "" ? (i.value !== void 0 ? a.value.schemaNames[i.value] = O.value : a.value.schemaNames.push(O.value), D.value = !1) : r.open({ message: p("report.section.schema.nothingSelected"), type: "error" });
213
+ }
214
+ return (d, w) => {
215
+ const R = M("FmForm"), A = M("FmIcon"), b = M("FmField");
216
+ return c(), P("div", rt, [
217
+ m(Xe, {
218
+ modelValue: D.value,
219
+ "onUpdate:modelValue": w[1] || (w[1] = (s) => D.value = s),
220
+ title: o.label,
221
+ "primary-button-label": l(p)("report.common.confirm"),
222
+ "secondary-button-label": l(p)("report.common.cancel"),
223
+ onConfirm: L
224
+ }, {
225
+ content: ee(() => [
226
+ m(R, { ref: "form" }, {
227
+ default: ee(() => [
228
+ m(be, {
229
+ modelValue: O.value,
230
+ "onUpdate:modelValue": w[0] || (w[0] = (s) => O.value = s),
231
+ label: l(p)("report.section.schema.title"),
232
+ items: i.value === 0 ? v.value.map((s) => ({
233
+ label: l(ue)(l(p), l(e), s.label, "schema"),
234
+ value: s.value
235
+ })) : f.value.map((s) => ({
236
+ label: l(ue)(l(p), l(e), s.label, "schema"),
237
+ value: s.value
238
+ }))
239
+ }, null, 8, ["modelValue", "label", "items"])
240
+ ]),
241
+ _: 1
242
+ }, 512)
243
+ ]),
244
+ _: 1
245
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
246
+ h("div", null, [
247
+ h("p", st, J(l(p)("report.section.schema.title")), 1),
248
+ h("p", ut, J(l(p)("report.section.schema.description")), 1)
249
+ ]),
250
+ (c(!0), P(de, null, Se(a.value.schemaNames, (s, V) => (c(), P("div", {
251
+ key: V,
252
+ class: "flex flex-col gap-2 w-full"
253
+ }, [
254
+ h("div", {
255
+ class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
256
+ onClick: (N) => F(V)
257
+ }, [
258
+ h("p", mt, J(g(s)), 1),
259
+ w[3] || (w[3] = h("div", { class: "grow" }, null, -1)),
260
+ m(A, {
261
+ name: "close",
262
+ onClick: he(
263
+ () => {
264
+ a.value.schemaNames = l(tt)(a.value.schemaNames, V);
265
+ },
266
+ ["stop"]
267
+ )
268
+ }, null, 8, ["onClick"])
269
+ ], 8, dt)
270
+ ]))), 128)),
271
+ m(b, {
272
+ class: "text-fm-color-typo-tertiary",
273
+ onClick: w[2] || (w[2] = () => {
274
+ F();
275
+ })
276
+ }, {
277
+ default: ee(() => [
278
+ We(J(l(p)("report.section.schema.add")), 1)
279
+ ]),
280
+ _: 1
281
+ })
282
+ ]);
283
+ };
284
+ }
285
+ }), pt = {
286
+ key: 0,
287
+ class: "flex flex-col my-2 gap-8"
288
+ }, vt = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, ft = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, gt = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, nl = /* @__PURE__ */ me({
289
+ __name: "DimensionSection",
290
+ props: /* @__PURE__ */ ve({
291
+ options: {
292
+ type: Array,
293
+ default: () => []
294
+ },
295
+ label: {
296
+ type: String,
297
+ default: "title"
298
+ },
299
+ max: {
300
+ type: Number,
301
+ default: void 0
302
+ },
303
+ config: {
304
+ type: Object,
305
+ default: () => {
306
+ }
307
+ },
308
+ hasRowColumn: {
309
+ type: Boolean,
310
+ default: !1
311
+ }
312
+ }, {
313
+ modelValue: {
314
+ required: !1,
315
+ default: []
316
+ },
317
+ modelModifiers: {}
318
+ }),
319
+ emits: ["update:modelValue"],
320
+ setup(B) {
321
+ const { t: p, te: e } = pe(), a = ge(B, "modelValue"), o = B, S = C(() => p(`report.section.dimension.${o.label}`)), v = ae(!1), f = C(
322
+ () => a.value.map((t, x) => ({
323
+ index: x,
324
+ labels: [t.label || t.name],
325
+ value: t
326
+ }))
327
+ ), D = ae(a.value.length > 0 ? 0 : void 0);
328
+ function O(t) {
329
+ var x, le, ie, H;
330
+ v.value = !0, i.value = t != null && t.value ? JSON.parse(
331
+ JSON.stringify({
332
+ ...t.value,
333
+ label: ue(p, e, (x = t.value) == null ? void 0 : x.label, "other"),
334
+ moveToColumn: (((le = o.config) == null ? void 0 : le.columnIds) || []).includes(Ve(t.value))
335
+ })
336
+ ) : void 0, D.value = t == null ? void 0 : t.index, r.value = !!((ie = i.value) != null && ie.dataFormula || (H = i.value) != null && H.displayFormula), i.value && i.value.formatter === void 0 && t != null && t.value.timeFormatter && i.value.formatter === void 0 && (i.value.formatter = t == null ? void 0 : t.value.timeFormatter, i.value.timeFormatter = void 0);
337
+ }
338
+ const i = ae(void 0), r = ae(!1), g = C(
339
+ () => o.options.find(
340
+ (t) => {
341
+ var x, le;
342
+ return t.schemaName === ((x = i.value) == null ? void 0 : x.schemaName) && t.name === ((le = i.value) == null ? void 0 : le.name);
343
+ }
344
+ ) ?? {}
345
+ );
346
+ xe(
347
+ () => {
348
+ var t;
349
+ return (t = i.value) == null ? void 0 : t.option;
350
+ },
351
+ () => {
352
+ !F.value && i.value && (i.value.fillGap = !1);
353
+ }
354
+ );
355
+ const F = C(
356
+ () => {
357
+ var t, x, le;
358
+ return (le = (t = g.value) == null ? void 0 : t.fillGapDimensionOptions) == null ? void 0 : le.includes(((x = i.value) == null ? void 0 : x.option) || "");
359
+ }
360
+ ), L = (t) => t.toLowerCase().includes("image"), d = C(() => {
361
+ const { formatters: t = [], type: x } = g.value;
362
+ return t.filter((le) => x === Ye.String ? L(le) : x === Ye.Numeric ? !L(le) : !0);
363
+ });
364
+ function w(t) {
365
+ var x, le;
366
+ (t.schemaName !== ((x = i.value) == null ? void 0 : x.schemaName) || t.name !== ((le = i.value) == null ? void 0 : le.name)) && (i.value = {
367
+ schemaName: t.schemaName,
368
+ name: t.name,
369
+ option: t.dimensionOptions[0],
370
+ label: ue(p, e, t.label, "other"),
371
+ decimal: t.isNumericType ? 2 : void 0,
372
+ hide: !1
373
+ }, r.value = !1);
374
+ }
375
+ function R() {
376
+ if (!i.value) {
377
+ console.error("new field is undefined");
378
+ return;
379
+ }
380
+ const t = [...f.value.map((x) => x.value)];
381
+ r.value || (i.value.dataFormula = void 0, i.value.displayFormula = void 0), D.value !== void 0 ? t[D.value] = i.value : t.push(i.value), a.value = t, v.value = !1;
382
+ }
383
+ function A(t) {
384
+ const le = [...f.value.map((ie) => ie.value)].filter((ie, H) => H !== t);
385
+ a.value = le;
386
+ }
387
+ function b(t) {
388
+ i.value && (i.value.decimal = Number(t));
389
+ }
390
+ function s(t) {
391
+ const x = `report.section.filter.${je(t)}`;
392
+ return e(x) ? p(x) : ue(p, e, t, "field");
393
+ }
394
+ function V(t) {
395
+ const x = `report.section.metric.formatterType.${t}`;
396
+ return e(x) ? p(x) : t;
397
+ }
398
+ function N(t) {
399
+ return Array.isArray(t) ? t.length > 0 : t;
400
+ }
401
+ const T = C(
402
+ () => o.options.map((t) => ({
403
+ label: t.labels.join(" "),
404
+ value: t
405
+ }))
406
+ );
407
+ function u(t) {
408
+ return [t.schemaName, t.name, ue(p, e, t.label, "other")].join(" ");
409
+ }
410
+ function _(t) {
411
+ return [t.schemaName, t.name, t.option, t.label || ""].join("__");
412
+ }
413
+ const y = C(() => {
414
+ var ie, H;
415
+ const t = /* @__PURE__ */ new Map(), x = i.value ? _(i.value) : "";
416
+ for (const _e of ((ie = o.config) == null ? void 0 : ie.dimensions) ?? [])
417
+ x && _(_e) === x || t.set(Ve(_e), _e);
418
+ const le = (H = o.config) == null ? void 0 : H.breakdownDimension;
419
+ return le && (!x || _(le) !== x) && t.set(Ve(le), le), i.value && t.set(Ve(i.value), i.value), Array.from(t.values());
420
+ }), { formulaFieldDataList: Q, allowedFormulaFields: K } = dl({
421
+ options: C(() => o.options),
422
+ primaryFields: y,
423
+ secondaryFields: C(() => {
424
+ var t;
425
+ return ((t = o.config) == null ? void 0 : t.metrics) ?? [];
426
+ }),
427
+ getLabel: u
428
+ }), { dataValidation: j, displayValidation: W, isDataValidating: oe, isDisplayValidating: n } = ml({
429
+ getDataFormula: () => {
430
+ var t;
431
+ return (t = i.value) == null ? void 0 : t.dataFormula;
432
+ },
433
+ getDisplayFormula: () => {
434
+ var t;
435
+ return (t = i.value) == null ? void 0 : t.displayFormula;
436
+ },
437
+ getIsAdvance: () => r.value,
438
+ getAllowedFields: () => K.value
439
+ });
440
+ return (t, x) => {
441
+ const le = M("FmTextField"), ie = M("FmStepperField"), H = M("FmCheckbox"), _e = M("FmForm"), Te = M("FmIcon"), Be = M("FmButton"), Ie = M("FmListItem"), ze = M("FmList"), Ce = M("FmField");
442
+ return B.max !== 0 ? (c(), P("div", pt, [
443
+ m(Xe, {
444
+ modelValue: v.value,
445
+ "onUpdate:modelValue": x[12] || (x[12] = (ye) => v.value = ye),
446
+ title: S.value,
447
+ "primary-button-label": l(p)("report.common.confirm"),
448
+ "secondary-button-label": l(p)("report.common.cancel"),
449
+ onConfirm: R
450
+ }, {
451
+ content: ee(() => [
452
+ m(_e, {
453
+ ref: "form",
454
+ class: "flex flex-col gap-2 w-[490px]"
455
+ }, {
456
+ default: ee(() => {
457
+ var ye, we, Z, He, qe;
458
+ return [
459
+ m(be, {
460
+ "model-value": g.value,
461
+ items: T.value,
462
+ placeholder: S.value,
463
+ label: S.value,
464
+ "onUpdate:modelValue": x[0] || (x[0] = (re) => w(re))
465
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
466
+ i.value ? (c(), P(de, { key: 0 }, [
467
+ m(le, {
468
+ modelValue: i.value.label,
469
+ "onUpdate:modelValue": x[1] || (x[1] = (re) => i.value.label = re),
470
+ label: l(p)("report.section.dimension.label")
471
+ }, null, 8, ["modelValue", "label"]),
472
+ (((ye = g.value) == null ? void 0 : ye.dimensionOptions) || []).length > 0 ? (c(), I(be, {
473
+ key: 0,
474
+ modelValue: i.value.option,
475
+ "onUpdate:modelValue": x[2] || (x[2] = (re) => i.value.option = re),
476
+ items: ((we = g.value) == null ? void 0 : we.dimensionOptions.map((re) => ({
477
+ label: s(re),
478
+ value: re
479
+ }))) ?? []
480
+ }, null, 8, ["modelValue", "items"])) : z("", !0),
481
+ (Z = g.value) != null && Z.isNumericType ? (c(), I(ie, {
482
+ key: 1,
483
+ label: l(p)("report.common.decimal"),
484
+ "model-value": ((He = i.value) == null ? void 0 : He.decimal) ?? 2,
485
+ "onUpdate:modelValue": x[3] || (x[3] = (re) => {
486
+ b(re);
487
+ })
488
+ }, null, 8, ["label", "model-value"])) : z("", !0),
489
+ d.value.length > 0 ? (c(), I(be, {
490
+ key: 2,
491
+ modelValue: i.value.formatter,
492
+ "onUpdate:modelValue": x[4] || (x[4] = (re) => i.value.formatter = re),
493
+ placeholder: l(p)("report.section.dimension.formatter"),
494
+ label: l(p)("report.section.dimension.formatter"),
495
+ items: [
496
+ { label: l(p)("report.section.metric.formatterType.NONE"), value: null },
497
+ ...d.value.map((re) => ({
498
+ label: V(re),
499
+ value: re
500
+ }))
501
+ ]
502
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : z("", !0),
503
+ F.value ? (c(), I(H, {
504
+ key: 3,
505
+ "model-value": i.value.fillGap ?? !1,
506
+ label: l(p)("report.section.dimension.fillGap"),
507
+ value: "",
508
+ placeholder: "Fill gap",
509
+ "onUpdate:modelValue": x[5] || (x[5] = (re) => {
510
+ i.value && (i.value.fillGap = N(re));
511
+ })
512
+ }, null, 8, ["model-value", "label"])) : z("", !0),
513
+ ((qe = g.value) == null ? void 0 : qe.type) === l(Ye).Timestamp ? (c(), I(H, {
514
+ key: 4,
515
+ "model-value": i.value.dateComparison ?? !1,
516
+ label: l(p)("report.section.dimension.dateComparison"),
517
+ value: "",
518
+ "onUpdate:modelValue": x[6] || (x[6] = (re) => {
519
+ i.value && (i.value.dateComparison = N(re));
520
+ })
521
+ }, null, 8, ["model-value", "label"])) : z("", !0),
522
+ m(H, {
523
+ modelValue: i.value.hide,
524
+ "onUpdate:modelValue": x[7] || (x[7] = (re) => i.value.hide = re),
525
+ label: l(p)("report.section.dimension.hide"),
526
+ value: ""
527
+ }, null, 8, ["modelValue", "label"]),
528
+ o.hasRowColumn ? (c(), I(H, {
529
+ key: 5,
530
+ "model-value": i.value.moveToColumn ?? !1,
531
+ label: l(p)("report.section.dimension.moveToColumn"),
532
+ value: "",
533
+ "onUpdate:modelValue": x[8] || (x[8] = (re) => {
534
+ i.value && (i.value.moveToColumn = N(re));
535
+ })
536
+ }, null, 8, ["model-value", "label"])) : z("", !0),
537
+ m(H, {
538
+ modelValue: r.value,
539
+ "onUpdate:modelValue": x[9] || (x[9] = (re) => r.value = re),
540
+ label: l(p)("report.section.dimension.advance"),
541
+ value: !0
542
+ }, null, 8, ["modelValue", "label"]),
543
+ r.value ? (c(), I(Ee, {
544
+ key: 6,
545
+ modelValue: i.value.dataFormula,
546
+ "onUpdate:modelValue": x[10] || (x[10] = (re) => i.value.dataFormula = re),
547
+ placeholder: l(p)("report.section.dimension.dataFormula"),
548
+ "field-data-list": l(Q),
549
+ "formula-field": l(Ne).Dimension,
550
+ "validation-result": l(j),
551
+ "is-validating": l(oe),
552
+ "valid-formula-label": l(p)("report.common.validFormula")
553
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0),
554
+ r.value ? (c(), I(Ee, {
555
+ key: 7,
556
+ modelValue: i.value.displayFormula,
557
+ "onUpdate:modelValue": x[11] || (x[11] = (re) => i.value.displayFormula = re),
558
+ placeholder: l(p)("report.section.dimension.displayFormula"),
559
+ "field-data-list": l(Q),
560
+ "formula-field": l(Ne).Dimension,
561
+ "validation-result": l(W),
562
+ "is-validating": l(n),
563
+ "valid-formula-label": l(p)("report.common.validFormula")
564
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
565
+ ], 64)) : z("", !0)
566
+ ];
567
+ }),
568
+ _: 1
569
+ }, 512)
570
+ ]),
571
+ _: 1
572
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
573
+ h("div", null, [
574
+ h("p", vt, J(S.value), 1),
575
+ h("p", ft, J(l(p)("report.section.dimension.description")), 1)
576
+ ]),
577
+ m(ze, null, {
578
+ default: ee(() => [
579
+ m(l(el), {
580
+ list: a.value,
581
+ "item-key": (ye) => l(Ve)(ye),
582
+ class: "flex flex-col gap-2"
583
+ }, {
584
+ item: ee(({ element: ye, index: we }) => [
585
+ m(Ie, {
586
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
587
+ onClick: he((Z) => O(f.value[we]), ["stop"])
588
+ }, {
589
+ default: ee(() => [
590
+ m(Te, { name: "drag_handle" }),
591
+ h("p", gt, J(l(ue)(l(p), l(e), ye.label, "other")), 1),
592
+ x[14] || (x[14] = h("div", { class: "grow" }, null, -1)),
593
+ m(Be, {
594
+ icon: "close",
595
+ size: "md",
596
+ variant: "tertiary",
597
+ onClick: he((Z) => A(we), ["stop"])
598
+ }, null, 8, ["onClick"])
599
+ ]),
600
+ _: 2
601
+ }, 1032, ["onClick"])
602
+ ]),
603
+ _: 1
604
+ }, 8, ["list", "item-key"])
605
+ ]),
606
+ _: 1
607
+ }),
608
+ m(Ce, {
609
+ class: "text-fm-color-typo-tertiary",
610
+ onClick: x[13] || (x[13] = () => {
611
+ O();
612
+ })
613
+ }, {
614
+ default: ee(() => [
615
+ We(J(l(p)("report.section.dimension.add")), 1)
616
+ ]),
617
+ _: 1
618
+ })
619
+ ])) : z("", !0);
620
+ };
621
+ }
622
+ }), Ke = {
623
+ value: "_metric_name"
624
+ };
625
+ function yt(B, p, e) {
626
+ switch (B) {
627
+ case Y.BarChart:
628
+ case Y.StackBarChart:
629
+ case Y.ClusteredStackBarChart:
630
+ case Y.LineChart:
631
+ case Y.StackLineChart:
632
+ case Y.Circular:
633
+ return p.length > 1;
634
+ default:
635
+ return e;
636
+ }
637
+ }
638
+ function sl(B) {
639
+ var a;
640
+ if (!B.widget)
641
+ return B.tiles ? { ...B, tiles: B.tiles.map(sl) } : B;
642
+ const { rowIds: p, columnIds: e } = Qe(B.widget.config);
643
+ return {
644
+ ...B,
645
+ ...B.tiles ? { tiles: B.tiles.map(sl) } : {},
646
+ widget: {
647
+ ...B.widget,
648
+ config: {
649
+ ...B.widget.config,
650
+ rowIds: p,
651
+ columnIds: e,
652
+ isDrillable: yt(
653
+ B.widget.type,
654
+ B.widget.config.dimensions,
655
+ B.widget.config.isDrillable
656
+ ),
657
+ joinDatasources: (a = B.widget.config.joinDatasources) == null ? void 0 : a.map((o) => {
658
+ const { rowIds: S, columnIds: v } = Qe(o);
659
+ return {
660
+ ...o,
661
+ rowIds: S,
662
+ columnIds: v
663
+ };
664
+ })
665
+ }
666
+ }
667
+ };
668
+ }
669
+ function Qe(B) {
670
+ const p = B.dimensions.filter((v) => v.hide !== !0 && !v.moveToColumn).map((v) => Ve(v)), e = B.dimensions.filter((v) => v.hide !== !0 && v.moveToColumn == !0).map((v) => Ve(v)), a = B.metrics.length > 0;
671
+ a && B.metrics.find((v) => v.moveToRow == !0) ? p.push(Ke.value) : a && e.push(Ke.value);
672
+ const o = [], S = [];
673
+ for (const v of p)
674
+ o.push(v);
675
+ for (const v of e)
676
+ S.push(v);
677
+ return {
678
+ rowIds: o,
679
+ columnIds: S
680
+ };
681
+ }
682
+ const bt = { class: "flex flex-col my-2 gap-8" }, ht = { class: "fm-typo-en-body-lg-600" }, wt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Ct = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, xt = /* @__PURE__ */ me({
683
+ __name: "MetricSection",
684
+ props: /* @__PURE__ */ ve({
685
+ options: {
686
+ type: Array,
687
+ default: () => []
688
+ },
689
+ label: {
690
+ type: String,
691
+ default: "title"
692
+ },
693
+ max: {
694
+ type: Number,
695
+ default: void 0
696
+ },
697
+ config: {
698
+ type: Object,
699
+ default: () => {
700
+ }
701
+ },
702
+ hasRowColumn: {
703
+ type: Boolean,
704
+ default: !1
705
+ },
706
+ hasPercentOfTotal: {
707
+ type: Boolean,
708
+ default: !1
709
+ },
710
+ hasXy: {
711
+ type: Boolean,
712
+ default: !1
713
+ }
714
+ }, {
715
+ modelValue: { required: !1, default: [] },
716
+ modelModifiers: {}
717
+ }),
718
+ emits: /* @__PURE__ */ ve(["config"], ["update:modelValue"]),
719
+ setup(B, { emit: p }) {
720
+ const { t: e, te: a } = pe(), o = ge(B, "modelValue"), S = B;
721
+ C(() => !!S.max && o.value.length === S.max);
722
+ const v = C(() => e(`report.section.metric.${S.label}`)), f = ae(!1), D = C(
723
+ () => o.value.map((n, t) => ({
724
+ index: t,
725
+ labels: [n.label || n.name],
726
+ value: n
727
+ }))
728
+ ), O = ae(o.value.length > 0 ? 0 : void 0);
729
+ function i(n) {
730
+ var t, x, le;
731
+ f.value = !0, r.value = n != null && n.value ? JSON.parse(
732
+ JSON.stringify({
733
+ ...n.value,
734
+ label: ue(e, a, n.value.label, "other")
735
+ })
736
+ ) : void 0, O.value = n == null ? void 0 : n.index, g.value = !!((t = r.value) != null && t.dataFormula || (x = r.value) != null && x.displayFormula), r.value && r.value.formatter === void 0 && n != null && n.value.timeFormatter && r.value.formatter === void 0 && (r.value.formatter = n == null ? void 0 : n.value.timeFormatter, r.value.timeFormatter = void 0), S.hasRowColumn && ((le = S.config.rowIds) == null ? void 0 : le.includes(Ke.value)) === !0 && r.value && r.value.moveToRow === void 0 && (r.value.moveToRow = !0), r.value && (!S.hasXy || r.value.nullable === void 0) && (r.value.nullable = !1);
737
+ }
738
+ const r = ae(void 0), g = ae(!1), F = C(
739
+ () => S.options.find(
740
+ (n) => {
741
+ var t, x;
742
+ return n.schemaName === ((t = r.value) == null ? void 0 : t.schemaName) && n.name === ((x = r.value) == null ? void 0 : x.name);
743
+ }
744
+ ) ?? {}
745
+ );
746
+ function L(n, t) {
747
+ var x;
748
+ return (n == null ? void 0 : n.isNumericType) || ((x = n == null ? void 0 : n.isNumericAggregations) == null ? void 0 : x.includes(t || ""));
749
+ }
750
+ function d() {
751
+ var n, t;
752
+ if (o.value.length > 0) {
753
+ const x = (n = o.value[0]) == null ? void 0 : n.moveToRow;
754
+ if (typeof x == "boolean")
755
+ return x;
756
+ }
757
+ return ((t = S.config.rowIds) == null ? void 0 : t.includes(Ke.value)) === !0;
758
+ }
759
+ const w = C(
760
+ () => {
761
+ var n;
762
+ return L(F.value, (n = r.value) == null ? void 0 : n.aggregation);
763
+ }
764
+ ), R = (n) => n.toLowerCase().includes("image"), A = C(() => {
765
+ const { formatters: n = [], type: t } = F.value;
766
+ return n.filter((x) => w.value ? !R(x) : t === Ye.String ? R(x) : !0);
767
+ });
768
+ xe(w, (n) => {
769
+ r.value && (n ? r.value.decimal = typeof r.value.decimal != "number" ? 2 : r.value.decimal : r.value.decimal = void 0);
770
+ });
771
+ function b(n) {
772
+ var t, x;
773
+ (n.schemaName !== ((t = r.value) == null ? void 0 : t.schemaName) || n.name !== ((x = r.value) == null ? void 0 : x.name)) && (r.value = {
774
+ schemaName: n.schemaName,
775
+ name: n.name,
776
+ aggregation: n.aggregations[0],
777
+ label: ue(e, a, n.label, "other"),
778
+ nullable: !1,
779
+ decimal: L(n, n.aggregations[0]) ? 2 : void 0,
780
+ moveToRow: d(),
781
+ hide: !1
782
+ }, g.value = !1);
783
+ }
784
+ function s() {
785
+ var t;
786
+ const n = [...D.value.map((x) => x.value)];
787
+ if (r.value && (g.value || (r.value.dataFormula = void 0, r.value.displayFormula = void 0), S.hasXy || (r.value.nullable = !1), O.value !== void 0 ? n[O.value] = r.value : n.push(r.value)), S.hasRowColumn && typeof ((t = r.value) == null ? void 0 : t.moveToRow) == "boolean")
788
+ for (const x of n)
789
+ x.moveToRow = r.value.moveToRow;
790
+ o.value = n, f.value = !1;
791
+ }
792
+ function V(n) {
793
+ const t = [...D.value.map((x) => x.value)];
794
+ t.splice(n, 1), o.value = t;
795
+ }
796
+ const N = C(
797
+ () => S.options.map((n) => ({
798
+ label: n.labels.join(" "),
799
+ value: n
800
+ }))
801
+ );
802
+ function T(n) {
803
+ return [n.schemaName, n.name, ue(e, a, n.label, "other")].join(" ");
804
+ }
805
+ function u(n) {
806
+ return [n.schemaName, n.name, n.aggregation, n.label || ""].join("__");
807
+ }
808
+ const _ = C(() => {
809
+ var x;
810
+ const n = /* @__PURE__ */ new Map(), t = r.value ? u(r.value) : "";
811
+ for (const le of ((x = S.config) == null ? void 0 : x.metrics) ?? [])
812
+ t && u(le) === t || n.set(Ve(le), le);
813
+ return r.value && n.set(Ve(r.value), r.value), Array.from(n.values());
814
+ }), { formulaFieldDataList: y, allowedFormulaFields: Q } = dl({
815
+ options: C(() => S.options),
816
+ primaryFields: C(() => {
817
+ var n, t;
818
+ return [
819
+ ...((n = S.config) == null ? void 0 : n.dimensions) ?? [],
820
+ ...(t = S.config) != null && t.breakdownDimension ? [S.config.breakdownDimension] : []
821
+ ];
822
+ }),
823
+ secondaryFields: _,
824
+ getLabel: T
825
+ }), { dataValidation: K, displayValidation: j, isDataValidating: W, isDisplayValidating: oe } = ml({
826
+ getDataFormula: () => {
827
+ var n;
828
+ return (n = r.value) == null ? void 0 : n.dataFormula;
829
+ },
830
+ getDisplayFormula: () => {
831
+ var n;
832
+ return (n = r.value) == null ? void 0 : n.displayFormula;
833
+ },
834
+ getIsAdvance: () => g.value,
835
+ getAllowedFields: () => Q.value
836
+ });
837
+ return (n, t) => {
838
+ const x = M("FmTextField"), le = M("FmStepperField"), ie = M("FmCheckbox"), H = M("FmForm"), _e = M("FmIcon"), Te = M("FmButton"), Be = M("FmListItem"), Ie = M("FmList"), ze = M("FmField");
839
+ return c(), P("div", bt, [
840
+ m(Xe, {
841
+ modelValue: f.value,
842
+ "onUpdate:modelValue": t[12] || (t[12] = (Ce) => f.value = Ce),
843
+ title: v.value,
844
+ onConfirm: s
845
+ }, {
846
+ content: ee(() => [
847
+ m(H, {
848
+ ref: "form",
849
+ class: "flex flex-col gap-2 w-[490px]"
850
+ }, {
851
+ default: ee(() => {
852
+ var Ce, ye, we;
853
+ return [
854
+ m(be, {
855
+ "model-value": F.value,
856
+ items: N.value,
857
+ placeholder: v.value,
858
+ label: v.value,
859
+ "onUpdate:modelValue": t[0] || (t[0] = (Z) => b(Z))
860
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
861
+ r.value ? (c(), P(de, { key: 0 }, [
862
+ m(x, {
863
+ modelValue: r.value.label,
864
+ "onUpdate:modelValue": t[1] || (t[1] = (Z) => r.value.label = Z),
865
+ label: l(e)("report.section.metric.label")
866
+ }, null, 8, ["modelValue", "label"]),
867
+ (((Ce = F.value) == null ? void 0 : Ce.aggregations) || []).length > 0 ? (c(), I(be, {
868
+ key: 0,
869
+ modelValue: r.value.aggregation,
870
+ "onUpdate:modelValue": t[2] || (t[2] = (Z) => r.value.aggregation = Z),
871
+ label: l(e)("report.section.metric.aggregation"),
872
+ items: ((ye = F.value) == null ? void 0 : ye.aggregations.map((Z) => ({
873
+ label: l(a)(`report.section.metric.aggregationType.${Z}`) ? l(e)(`report.section.metric.aggregationType.${Z}`) : l(ue)(l(e), l(a), Z, "field"),
874
+ value: Z
875
+ }))) ?? []
876
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
877
+ w.value ? (c(), I(le, {
878
+ key: 1,
879
+ label: l(e)("report.common.decimal"),
880
+ "model-value": ((we = r.value) == null ? void 0 : we.decimal) ?? 2,
881
+ "onUpdate:modelValue": t[3] || (t[3] = (Z) => {
882
+ r.value && (r.value.decimal = Z);
883
+ })
884
+ }, null, 8, ["label", "model-value"])) : z("", !0),
885
+ A.value.length > 0 ? (c(), I(be, {
886
+ key: 2,
887
+ modelValue: r.value.formatter,
888
+ "onUpdate:modelValue": t[4] || (t[4] = (Z) => r.value.formatter = Z),
889
+ placeholder: l(e)("report.section.metric.formatter"),
890
+ label: l(e)("report.section.metric.formatter"),
891
+ items: [
892
+ { label: l(e)("report.section.metric.formatterType.NONE"), value: null },
893
+ ...A.value.map((Z) => ({
894
+ label: l(a)(`report.section.metric.formatterType.${Z}`) ? l(e)(`report.section.metric.formatterType.${Z}`) : l(ue)(l(e), l(a), Z, "field"),
895
+ value: Z
896
+ }))
897
+ ]
898
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : z("", !0),
899
+ m(ie, {
900
+ modelValue: r.value.hide,
901
+ "onUpdate:modelValue": t[5] || (t[5] = (Z) => r.value.hide = Z),
902
+ label: l(e)("report.section.metric.hide"),
903
+ value: ""
904
+ }, null, 8, ["modelValue", "label"]),
905
+ S.hasXy ? (c(), I(ie, {
906
+ key: 3,
907
+ "model-value": r.value.nullable ?? !1,
908
+ label: l(e)("report.section.metric.nullable"),
909
+ value: !0,
910
+ "onUpdate:modelValue": t[6] || (t[6] = (Z) => {
911
+ r.value && (r.value.nullable = Z);
912
+ })
913
+ }, null, 8, ["model-value", "label"])) : z("", !0),
914
+ S.hasRowColumn ? (c(), I(ie, {
915
+ key: 4,
916
+ "model-value": r.value.moveToRow ?? !1,
917
+ label: l(e)("report.section.metric.moveToRow"),
918
+ value: "",
919
+ "onUpdate:modelValue": t[7] || (t[7] = (Z) => {
920
+ r.value && (r.value.moveToRow = Array.isArray(Z) ? Z.length > 0 : Z);
921
+ })
922
+ }, null, 8, ["model-value", "label"])) : z("", !0),
923
+ S.hasRowColumn && S.hasPercentOfTotal ? (c(), I(ie, {
924
+ key: 5,
925
+ "model-value": r.value.percentOfTotal ?? !1,
926
+ label: l(e)("report.section.metric.percentOfTotal"),
927
+ value: "",
928
+ "onUpdate:modelValue": t[8] || (t[8] = (Z) => {
929
+ r.value && (r.value.percentOfTotal = Array.isArray(Z) ? Z.length > 0 : Z);
930
+ })
931
+ }, null, 8, ["model-value", "label"])) : z("", !0),
932
+ m(ie, {
933
+ modelValue: g.value,
934
+ "onUpdate:modelValue": t[9] || (t[9] = (Z) => g.value = Z),
935
+ label: l(e)("report.section.metric.advance"),
936
+ value: !0
937
+ }, null, 8, ["modelValue", "label"]),
938
+ g.value ? (c(), I(Ee, {
939
+ key: 6,
940
+ modelValue: r.value.dataFormula,
941
+ "onUpdate:modelValue": t[10] || (t[10] = (Z) => r.value.dataFormula = Z),
942
+ placeholder: l(e)("report.section.metric.dataFormula"),
943
+ "field-data-list": l(y),
944
+ "formula-field": l(Ne).Metric,
945
+ "validation-result": l(K),
946
+ "is-validating": l(W),
947
+ "valid-formula-label": l(e)("report.common.validFormula")
948
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0),
949
+ g.value ? (c(), I(Ee, {
950
+ key: 7,
951
+ modelValue: r.value.displayFormula,
952
+ "onUpdate:modelValue": t[11] || (t[11] = (Z) => r.value.displayFormula = Z),
953
+ placeholder: l(e)("report.section.metric.displayFormula"),
954
+ "field-data-list": l(y),
955
+ "formula-field": l(Ne).Metric,
956
+ "validation-result": l(j),
957
+ "is-validating": l(oe),
958
+ "valid-formula-label": l(e)("report.common.validFormula")
959
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
960
+ ], 64)) : z("", !0)
961
+ ];
962
+ }),
963
+ _: 1
964
+ }, 512)
965
+ ]),
966
+ _: 1
967
+ }, 8, ["modelValue", "title"]),
968
+ h("div", null, [
969
+ h("p", ht, J(v.value), 1),
970
+ h("p", wt, J(l(e)("report.section.metric.description")), 1)
971
+ ]),
972
+ m(Ie, null, {
973
+ default: ee(() => [
974
+ m(l(el), {
975
+ list: o.value,
976
+ "item-key": "id",
977
+ class: "flex flex-col gap-2 w-full"
978
+ }, {
979
+ item: ee(({ element: Ce, index: ye }) => [
980
+ m(Be, {
981
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
982
+ onClick: he((we) => i(D.value[ye]), ["stop"])
983
+ }, {
984
+ default: ee(() => [
985
+ m(_e, { name: "drag_handle" }),
986
+ h("p", Ct, J(l(ue)(l(e), l(a), Ce.label, "other")), 1),
987
+ t[14] || (t[14] = h("div", { class: "grow" }, null, -1)),
988
+ m(Te, {
989
+ icon: "close",
990
+ size: "md",
991
+ variant: "tertiary",
992
+ onClick: he((we) => V(ye), ["stop"])
993
+ }, null, 8, ["onClick"])
994
+ ]),
995
+ _: 2
996
+ }, 1032, ["onClick"])
997
+ ]),
998
+ _: 1
999
+ }, 8, ["list"])
1000
+ ]),
1001
+ _: 1
1002
+ }),
1003
+ m(ze, {
1004
+ class: "text-fm-color-typo-tertiary",
1005
+ onClick: t[13] || (t[13] = () => {
1006
+ i();
1007
+ })
1008
+ }, {
1009
+ default: ee(() => [
1010
+ We(J(l(e)("report.section.metric.add")), 1)
1011
+ ]),
1012
+ _: 1
1013
+ })
1014
+ ]);
1015
+ };
1016
+ }
1017
+ }), kt = { class: "flex flex-col my-2 gap-8" }, Ft = { class: "fm-typo-en-body-lg-600" }, Vt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, St = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, _t = /* @__PURE__ */ me({
1018
+ __name: "SortSection",
1019
+ props: /* @__PURE__ */ ve({
1020
+ options: {
1021
+ type: Array,
1022
+ default: () => []
1023
+ },
1024
+ dimensions: {
1025
+ type: Array,
1026
+ default: () => []
1027
+ },
1028
+ breakdownDimension: {
1029
+ type: Object,
1030
+ default: void 0
1031
+ },
1032
+ metrics: {
1033
+ type: Array,
1034
+ default: () => []
1035
+ },
1036
+ label: {
1037
+ type: String,
1038
+ default: "title"
1039
+ }
1040
+ }, {
1041
+ modelValue: { required: !1, default: [] },
1042
+ modelModifiers: {}
1043
+ }),
1044
+ emits: ["update:modelValue"],
1045
+ setup(B) {
1046
+ const { t: p, te: e } = pe(), a = ge(B, "modelValue"), o = B, S = C(() => p(`report.section.sort.${o.label}`)), v = ae(!1), f = C(
1047
+ () => a.value.map((T, u) => {
1048
+ const _ = o.options.find(
1049
+ (Q) => Q.schemaName === T.schemaName && Q.name === T.name
1050
+ ), y = (_ == null ? void 0 : _.labels) || [T.schemaName, T.name];
1051
+ return {
1052
+ index: u,
1053
+ label: y.map((Q) => ue(p, e, Q, "other")).join(" "),
1054
+ value: T
1055
+ };
1056
+ })
1057
+ ), D = ae(a.value.length > 0 ? 0 : void 0);
1058
+ function O(T) {
1059
+ var u;
1060
+ v.value = !0, i.value = T != null && T.value ? JSON.parse(JSON.stringify(T.value)) : void 0, D.value = T == null ? void 0 : T.index, r.value = !!((u = i.value) != null && u.dataFormula);
1061
+ }
1062
+ const i = ae(void 0), r = ae(!1), g = C(
1063
+ () => o.options.find(
1064
+ (T) => {
1065
+ var u, _;
1066
+ return T.schemaName === ((u = i.value) == null ? void 0 : u.schemaName) && T.name === ((_ = i.value) == null ? void 0 : _.name);
1067
+ }
1068
+ ) ?? {}
1069
+ );
1070
+ function F(T) {
1071
+ var u, _;
1072
+ (T.schemaName !== ((u = i.value) == null ? void 0 : u.schemaName) || T.name !== ((_ = i.value) == null ? void 0 : _.name)) && (i.value = {
1073
+ schemaName: T.schemaName,
1074
+ name: T.name,
1075
+ dimensionOption: T.dimensionOptions[0],
1076
+ aggregation: null,
1077
+ type: yl.Asc
1078
+ });
1079
+ }
1080
+ function L() {
1081
+ if (!i.value) {
1082
+ console.log("new sort is undefined");
1083
+ return;
1084
+ }
1085
+ const T = [...f.value.map((u) => u.value)];
1086
+ r.value || (i.value.dataFormula = void 0), D.value !== void 0 ? T[D.value] = i.value : T.push(i.value), a.value = T, v.value = !1;
1087
+ }
1088
+ function d(T) {
1089
+ const u = [...f.value.map((_) => _.value)];
1090
+ u.splice(T, 1), a.value = u, v.value = !1;
1091
+ }
1092
+ function w(T) {
1093
+ const u = `report.section.filter.${je(T)}`;
1094
+ return e(u) ? p(u) : ue(p, e, T, "field");
1095
+ }
1096
+ const R = C(
1097
+ () => o.options.map((T) => ({
1098
+ label: T.labels.join(" "),
1099
+ value: T
1100
+ }))
1101
+ );
1102
+ function A(T) {
1103
+ return [T.schemaName, T.name, ue(p, e, T.label, "other")].join(" ");
1104
+ }
1105
+ const { formulaFieldDataList: b, allowedFormulaFields: s } = dl({
1106
+ options: C(() => o.options),
1107
+ primaryFields: C(() => [
1108
+ ...o.dimensions,
1109
+ ...o.breakdownDimension ? [o.breakdownDimension] : []
1110
+ ]),
1111
+ secondaryFields: C(() => o.metrics),
1112
+ getLabel: A
1113
+ }), { dataValidation: V, isDataValidating: N } = ml({
1114
+ getDataFormula: () => {
1115
+ var T;
1116
+ return (T = i.value) == null ? void 0 : T.dataFormula;
1117
+ },
1118
+ getDisplayFormula: () => {
1119
+ },
1120
+ getIsAdvance: () => r.value,
1121
+ getAllowedFields: () => s.value
1122
+ });
1123
+ return (T, u) => {
1124
+ const _ = M("FmCheckbox"), y = M("FmForm"), Q = M("FmIcon"), K = M("FmButton"), j = M("FmListItem"), W = M("FmList"), oe = M("FmField");
1125
+ return c(), P("div", kt, [
1126
+ m(Xe, {
1127
+ modelValue: v.value,
1128
+ "onUpdate:modelValue": u[6] || (u[6] = (n) => v.value = n),
1129
+ title: S.value,
1130
+ onConfirm: L
1131
+ }, {
1132
+ content: ee(() => [
1133
+ m(y, {
1134
+ ref: "form",
1135
+ class: "flex flex-col gap-2 w-[490px]"
1136
+ }, {
1137
+ default: ee(() => {
1138
+ var n, t, x, le, ie;
1139
+ return [
1140
+ m(be, {
1141
+ "model-value": g.value,
1142
+ items: R.value,
1143
+ placeholder: S.value,
1144
+ label: S.value,
1145
+ "onUpdate:modelValue": u[0] || (u[0] = (H) => F(H))
1146
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
1147
+ i.value ? (c(), P(de, { key: 0 }, [
1148
+ (((n = g.value) == null ? void 0 : n.dimensionOptions) || []).length > 0 ? (c(), I(be, {
1149
+ key: 0,
1150
+ modelValue: i.value.dimensionOption,
1151
+ "onUpdate:modelValue": u[1] || (u[1] = (H) => i.value.dimensionOption = H),
1152
+ items: ((t = g.value) == null ? void 0 : t.dimensionOptions.map((H) => ({
1153
+ label: w(H),
1154
+ value: H
1155
+ }))) ?? [],
1156
+ placeholder: l(p)("report.section.sort.format"),
1157
+ label: l(p)("report.section.sort.format")
1158
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : z("", !0),
1159
+ (((x = g.value) == null ? void 0 : x.aggregations) || []).length > 0 ? (c(), I(be, {
1160
+ key: 1,
1161
+ modelValue: i.value.aggregation,
1162
+ "onUpdate:modelValue": u[2] || (u[2] = (H) => i.value.aggregation = H),
1163
+ items: ((le = g.value) == null ? void 0 : le.aggregations.map((H) => ({
1164
+ label: l(e)(`report.section.metric.aggregationType.${H}`) ? l(p)(`report.section.metric.aggregationType.${H}`) : H,
1165
+ value: H
1166
+ }))) ?? [],
1167
+ label: l(p)("report.section.sort.aggregation"),
1168
+ placeholder: l(p)("report.section.sort.aggregation")
1169
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])) : z("", !0),
1170
+ m(be, {
1171
+ modelValue: i.value.type,
1172
+ "onUpdate:modelValue": u[3] || (u[3] = (H) => i.value.type = H),
1173
+ items: Object.values(l(yl)).map((H) => ({
1174
+ label: l(e)(`report.section.sort.sortType.${H}`) ? l(p)(`report.section.sort.sortType.${H}`) : H,
1175
+ value: H
1176
+ })),
1177
+ placeholder: l(p)("report.section.sort.order"),
1178
+ label: l(p)("report.section.sort.order")
1179
+ }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1180
+ m(_, {
1181
+ modelValue: r.value,
1182
+ "onUpdate:modelValue": u[4] || (u[4] = (H) => r.value = H),
1183
+ label: l(p)("report.section.sort.advance"),
1184
+ value: !0
1185
+ }, null, 8, ["modelValue", "label"]),
1186
+ r.value ? (c(), I(Ee, {
1187
+ key: 2,
1188
+ modelValue: i.value.dataFormula,
1189
+ "onUpdate:modelValue": u[5] || (u[5] = (H) => i.value.dataFormula = H),
1190
+ placeholder: l(p)("report.section.sort.dataFormula"),
1191
+ "field-data-list": l(b),
1192
+ "formula-field": ((ie = g.value) == null ? void 0 : ie.type) === "NUMERIC" ? l(Ne).Metric : l(Ne).Dimension,
1193
+ "validation-result": l(V),
1194
+ "is-validating": l(N),
1195
+ "valid-formula-label": l(p)("report.common.validFormula")
1196
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
1197
+ ], 64)) : z("", !0)
1198
+ ];
1199
+ }),
1200
+ _: 1
1201
+ }, 512)
1202
+ ]),
1203
+ _: 1
1204
+ }, 8, ["modelValue", "title"]),
1205
+ h("div", null, [
1206
+ h("p", Ft, J(S.value), 1),
1207
+ h("p", Vt, J(l(p)("report.section.sort.description")), 1)
1208
+ ]),
1209
+ m(W, null, {
1210
+ default: ee(() => [
1211
+ m(l(el), {
1212
+ list: a.value,
1213
+ "item-key": "id",
1214
+ class: "flex flex-col gap-2 w-full"
1215
+ }, {
1216
+ item: ee(({ element: n, index: t }) => [
1217
+ m(j, {
1218
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1219
+ onClick: he((x) => O(f.value[t]), ["stop"])
1220
+ }, {
1221
+ default: ee(() => [
1222
+ m(Q, { name: "drag_handle" }),
1223
+ h("p", St, J(f.value[t].label), 1),
1224
+ u[8] || (u[8] = h("div", { class: "grow" }, null, -1)),
1225
+ m(K, {
1226
+ icon: "close",
1227
+ size: "md",
1228
+ variant: "tertiary",
1229
+ onClick: he((x) => d(t), ["stop"])
1230
+ }, null, 8, ["onClick"])
1231
+ ]),
1232
+ _: 2
1233
+ }, 1032, ["onClick"])
1234
+ ]),
1235
+ _: 1
1236
+ }, 8, ["list"])
1237
+ ]),
1238
+ _: 1
1239
+ }),
1240
+ m(oe, {
1241
+ class: "text-fm-color-typo-tertiary",
1242
+ onClick: u[7] || (u[7] = () => {
1243
+ O();
1244
+ })
1245
+ }, {
1246
+ default: ee(() => [
1247
+ We(J(l(p)("report.section.sort.add")), 1)
1248
+ ]),
1249
+ _: 1
1250
+ })
1251
+ ]);
1252
+ };
1253
+ }
1254
+ }), Tt = { class: "fm-typo-en-body-lg-600" }, $t = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Dt = /* @__PURE__ */ me({
1255
+ __name: "LimitSection",
1256
+ props: {
1257
+ modelValue: { required: !0, default: null },
1258
+ modelModifiers: {}
1259
+ },
1260
+ emits: ["update:modelValue"],
1261
+ setup(B) {
1262
+ const { t: p } = pe(), e = ge(B, "modelValue"), a = Je((o) => {
1263
+ o !== "" ? e.value = o : e.value = null;
1264
+ }, 1e3);
1265
+ return (o, S) => {
1266
+ const v = M("FmTextField");
1267
+ return c(), P(de, null, [
1268
+ h("div", null, [
1269
+ h("p", Tt, J(l(p)("report.section.limit.title")), 1),
1270
+ h("p", $t, J(l(p)("report.section.limit.description")), 1)
1271
+ ]),
1272
+ m(v, {
1273
+ "model-value": e.value,
1274
+ inputmode: "numeric",
1275
+ placeholder: l(p)("report.section.limit.placeholder"),
1276
+ "onUpdate:modelValue": S[0] || (S[0] = (f) => l(a)(f))
1277
+ }, null, 8, ["model-value", "placeholder"])
1278
+ ], 64);
1279
+ };
1280
+ }
1281
+ }), Ut = { class: "flex flex-col my-2 gap-8" }, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, At = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Mt = /* @__PURE__ */ me({
1282
+ __name: "ConditionSection",
1283
+ props: /* @__PURE__ */ ve({
1284
+ joinFieldOptions: {
1285
+ type: Array,
1286
+ default: () => []
1287
+ },
1288
+ mainFieldOptions: {
1289
+ type: Array,
1290
+ default: () => []
1291
+ },
1292
+ label: {
1293
+ type: String,
1294
+ default: "title"
1295
+ }
1296
+ }, {
1297
+ modelValue: { required: !0 },
1298
+ modelModifiers: {}
1299
+ }),
1300
+ emits: ["update:modelValue"],
1301
+ setup(B) {
1302
+ const { t: p, te: e } = pe(), a = ge(B, "modelValue"), o = B, S = C(() => p(`report.section.condition.${o.label}`)), v = ae(!1), f = C(
1303
+ () => a.value.map((b, s) => {
1304
+ var T, u;
1305
+ const V = o.joinFieldOptions.find(
1306
+ (_) => {
1307
+ var y, Q;
1308
+ return _.schemaName === ((y = b.joinDimension) == null ? void 0 : y.schemaName) && _.name === ((Q = b.joinDimension) == null ? void 0 : Q.name);
1309
+ }
1310
+ ), N = (V == null ? void 0 : V.labels) || [
1311
+ (T = b.joinDimension) == null ? void 0 : T.schemaName,
1312
+ (u = b.joinDimension) == null ? void 0 : u.name
1313
+ ];
1314
+ return {
1315
+ index: s,
1316
+ label: N.map((_) => ue(p, e, _, "other")).join(" "),
1317
+ value: b
1318
+ };
1319
+ })
1320
+ ), D = ae(a.value.length > 0 ? 0 : void 0);
1321
+ function O(b) {
1322
+ b ? (i.value = b != null && b.value ? JSON.parse(JSON.stringify(b.value)) : void 0, D.value = b == null ? void 0 : b.index) : (i.value = {
1323
+ joinDimension: null,
1324
+ operator: "",
1325
+ mainDimensions: []
1326
+ }, D.value = void 0), v.value = !0;
1327
+ }
1328
+ const i = ae(void 0), r = C(
1329
+ () => o.joinFieldOptions.find(
1330
+ (b) => {
1331
+ var s, V;
1332
+ return b.schemaName === ((V = (s = i.value) == null ? void 0 : s.joinDimension) == null ? void 0 : V.schemaName) && b.name === i.value.joinDimension.name;
1333
+ }
1334
+ ) ?? {}
1335
+ ), g = C(
1336
+ () => {
1337
+ var b;
1338
+ return (((b = i.value) == null ? void 0 : b.mainDimensions) || []).map(
1339
+ (s) => o.mainFieldOptions.find(
1340
+ (V) => V.schemaName === (s == null ? void 0 : s.schemaName) && V.name === s.name
1341
+ ) ?? {}
1342
+ );
1343
+ }
1344
+ ), F = C(
1345
+ () => o.joinFieldOptions.map((b) => ({ label: b.labels.join(" "), value: b }))
1346
+ );
1347
+ function L(b) {
1348
+ var s, V, N, T;
1349
+ i.value && (i.value && b.schemaName !== ((V = (s = i.value) == null ? void 0 : s.joinDimension) == null ? void 0 : V.schemaName) || b.name !== ((T = (N = i.value) == null ? void 0 : N.joinDimension) == null ? void 0 : T.name)) && (i.value = {
1350
+ ...i.value,
1351
+ joinDimension: {
1352
+ schemaName: b.schemaName,
1353
+ name: b.name,
1354
+ option: b.dimensionOptions[0],
1355
+ label: `_${b.label}`,
1356
+ hide: !0
1357
+ }
1358
+ }, b.joinConditionOperators.includes(i.value.operator) || w(b.joinConditionOperators[0]));
1359
+ }
1360
+ function d(b, s) {
1361
+ var V, N, T, u;
1362
+ if (i.value && s >= 0 && (i.value && b.schemaName !== ((N = (V = i.value) == null ? void 0 : V.mainDimensions[s]) == null ? void 0 : N.schemaName) || b.name !== ((u = (T = i.value) == null ? void 0 : T.mainDimensions[s]) == null ? void 0 : u.name))) {
1363
+ const _ = [...i.value.mainDimensions];
1364
+ _[s] = {
1365
+ schemaName: b.schemaName,
1366
+ name: b.name,
1367
+ option: b.dimensionOptions[0],
1368
+ label: b.label,
1369
+ hide: !0
1370
+ }, i.value = {
1371
+ ...i.value,
1372
+ mainDimensions: _
1373
+ };
1374
+ }
1375
+ }
1376
+ function w(b) {
1377
+ if (i.value)
1378
+ switch (b) {
1379
+ case Kl.Between:
1380
+ i.value = {
1381
+ ...i.value,
1382
+ operator: b,
1383
+ mainDimensions: [null, null]
1384
+ };
1385
+ break;
1386
+ default:
1387
+ i.value = {
1388
+ ...i.value,
1389
+ operator: b,
1390
+ mainDimensions: [null]
1391
+ };
1392
+ break;
1393
+ }
1394
+ }
1395
+ function R() {
1396
+ const b = [...f.value.map((s) => s.value)];
1397
+ i.value && (i.value.mainDimensions = i.value.mainDimensions.filter(
1398
+ (s) => s !== "" && s != null
1399
+ ), D.value !== void 0 ? b[D.value] = i.value : b.push(i.value)), a.value = b, v.value = !1;
1400
+ }
1401
+ function A(b) {
1402
+ const s = [...f.value.map((V) => V.value)];
1403
+ s.splice(b, 1), a.value = s;
1404
+ }
1405
+ return (b, s) => {
1406
+ const V = M("FmMenuDivider"), N = M("FmForm"), T = M("FmIcon"), u = M("FmButton"), _ = M("FmListItem"), y = M("FmList"), Q = M("FmField");
1407
+ return c(), P("div", Ut, [
1408
+ m(Xe, {
1409
+ modelValue: v.value,
1410
+ "onUpdate:modelValue": s[2] || (s[2] = (K) => v.value = K),
1411
+ title: S.value,
1412
+ onConfirm: R
1413
+ }, {
1414
+ content: ee(() => [
1415
+ m(N, {
1416
+ ref: "form",
1417
+ class: "flex flex-col gap-2 w-[490px]"
1418
+ }, {
1419
+ default: ee(() => {
1420
+ var K, j, W, oe, n;
1421
+ return [
1422
+ m(be, {
1423
+ label: l(p)("report.section.condition.joinDatasource"),
1424
+ "model-value": r.value,
1425
+ items: F.value,
1426
+ placeholder: l(p)("report.section.condition.joinDimension"),
1427
+ "onUpdate:modelValue": s[0] || (s[0] = (t) => L(t))
1428
+ }, null, 8, ["label", "model-value", "items", "placeholder"]),
1429
+ m(V),
1430
+ (K = i.value) != null && K.joinDimension && (((j = r.value) == null ? void 0 : j.dimensionOptions) || []).length > 0 ? (c(), I(be, {
1431
+ key: 0,
1432
+ modelValue: i.value.joinDimension.option,
1433
+ "onUpdate:modelValue": s[1] || (s[1] = (t) => i.value.joinDimension.option = t),
1434
+ label: l(p)("report.section.condition.format"),
1435
+ items: ((W = r.value) == null ? void 0 : W.dimensionOptions.map((t) => ({
1436
+ label: l(e)(`report.section.filter.${l(je)(t)}`) ? l(p)(`report.section.filter.${l(je)(t)}`) : t,
1437
+ value: t
1438
+ }))) ?? []
1439
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1440
+ i.value && (((oe = r.value) == null ? void 0 : oe.joinConditionOperators) || []).length > 0 ? (c(), I(be, {
1441
+ key: 1,
1442
+ "model-value": i.value.operator,
1443
+ label: l(p)("report.section.condition.operator"),
1444
+ items: r.value.joinConditionOperators.map((t) => ({
1445
+ label: l(p)("report.section.comparisonOperator." + t),
1446
+ value: t
1447
+ })) ?? [],
1448
+ "onUpdate:modelValue": w
1449
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1450
+ (c(!0), P(de, null, Se(((n = i.value) == null ? void 0 : n.mainDimensions) || [], (t, x) => {
1451
+ var le, ie;
1452
+ return c(), P("div", {
1453
+ key: x,
1454
+ class: "flex flex-col gap-2"
1455
+ }, [
1456
+ m(be, {
1457
+ "model-value": g.value[x],
1458
+ label: l(p)("report.section.condition.mainDatasource", { index: x + 1 }),
1459
+ items: o.mainFieldOptions.map((H) => ({
1460
+ label: H.labels.join(" "),
1461
+ value: H
1462
+ })),
1463
+ "onUpdate:modelValue": (H) => d(H, x)
1464
+ }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1465
+ t && (((le = g.value[x]) == null ? void 0 : le.dimensionOptions) || []).length > 0 && t ? (c(), I(be, {
1466
+ key: 0,
1467
+ modelValue: t.option,
1468
+ "onUpdate:modelValue": (H) => t.option = H,
1469
+ items: (ie = g.value[x]) == null ? void 0 : ie.dimensionOptions.map((H) => ({
1470
+ label: l(e)(`report.section.filter.${l(je)(H)}`) ? l(p)(`report.section.filter.${l(je)(H)}`) : H,
1471
+ value: H
1472
+ }))
1473
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : z("", !0),
1474
+ m(V)
1475
+ ]);
1476
+ }), 128))
1477
+ ];
1478
+ }),
1479
+ _: 1
1480
+ }, 512)
1481
+ ]),
1482
+ _: 1
1483
+ }, 8, ["modelValue", "title"]),
1484
+ h("div", null, [
1485
+ h("p", Bt, J(S.value), 1),
1486
+ h("p", Lt, J(l(p)("report.section.condition.description")), 1)
1487
+ ]),
1488
+ m(y, { class: "flex flex-col gap-2" }, {
1489
+ default: ee(() => [
1490
+ m(l(el), {
1491
+ list: a.value,
1492
+ "item-key": (K) => {
1493
+ var j, W;
1494
+ return `${(j = K.joinDimension) == null ? void 0 : j.schemaName}:${(W = K.joinDimension) == null ? void 0 : W.name}`;
1495
+ },
1496
+ class: "flex flex-col gap-2 w-full"
1497
+ }, {
1498
+ item: ee(({
1499
+ element: K,
1500
+ index: j
1501
+ }) => [
1502
+ m(_, {
1503
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1504
+ onClick: he((W) => O(f.value[j]), ["stop"])
1505
+ }, {
1506
+ default: ee(() => [
1507
+ m(T, { name: "drag_handle" }),
1508
+ h("p", At, J(f.value[j].label), 1),
1509
+ s[4] || (s[4] = h("div", { class: "grow" }, null, -1)),
1510
+ m(u, {
1511
+ icon: "close",
1512
+ size: "md",
1513
+ variant: "tertiary",
1514
+ onClick: he((W) => A(j), ["stop"])
1515
+ }, null, 8, ["onClick"])
1516
+ ]),
1517
+ _: 2
1518
+ }, 1032, ["onClick"])
1519
+ ]),
1520
+ _: 1
1521
+ }, 8, ["list", "item-key"])
1522
+ ]),
1523
+ _: 1
1524
+ }),
1525
+ m(Q, {
1526
+ class: "text-fm-color-typo-tertiary cursor-pointer",
1527
+ onClick: s[3] || (s[3] = (K) => O())
1528
+ }, {
1529
+ default: ee(() => [
1530
+ We(J(l(p)("report.section.condition.add")), 1)
1531
+ ]),
1532
+ _: 1
1533
+ })
1534
+ ]);
1535
+ };
1536
+ }
1537
+ }), Cl = /* @__PURE__ */ me({
1538
+ __name: "Datasource",
1539
+ props: /* @__PURE__ */ ve({
1540
+ label: {
1541
+ type: String,
1542
+ default: "Label"
1543
+ },
1544
+ config: {
1545
+ type: Object,
1546
+ default: null
1547
+ },
1548
+ closeable: {
1549
+ type: Boolean,
1550
+ default: !1
1551
+ },
1552
+ mainDatasourceConfig: {
1553
+ type: Object,
1554
+ default: () => {
1555
+ }
1556
+ },
1557
+ modelValue: {
1558
+ type: Object,
1559
+ default: () => {
1560
+ }
1561
+ }
1562
+ }, {
1563
+ modelValue: { required: !0 },
1564
+ modelModifiers: {}
1565
+ }),
1566
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
1567
+ setup(B, { emit: p }) {
1568
+ const e = ge(B, "modelValue");
1569
+ xe(
1570
+ [() => e.value.dimensions, () => e.value.metrics],
1571
+ () => {
1572
+ const { rowIds: _, columnIds: y } = Qe(e.value);
1573
+ e.value.rowIds = _, e.value.columnIds = y;
1574
+ },
1575
+ { deep: !0 }
1576
+ );
1577
+ const a = B, o = p, { schemas: S } = Re(Sl()), { editingReport: v } = Re(_l()), f = C(() => {
1578
+ var _;
1579
+ return ((_ = v.value) == null ? void 0 : _.queryVersion) === "v2";
1580
+ }), { t: D, te: O, locale: i } = pe(), r = C(() => !a.mainDatasourceConfig), g = C(
1581
+ () => [Y.BarChart, Y.LineChart, Y.Scorecard].includes(a.config.type)
1582
+ ), F = C(() => [...e.value.dimensions].filter((_) => !_.hide)), L = C(() => a.config.type === Y.Scorecard), d = C(() => e.value.sparklineType === "PROGRESS"), w = C({
1583
+ get: () => e.value.sparklineTargetValue ?? null,
1584
+ set: (_) => {
1585
+ e.value.sparklineTargetValue = _ ?? void 0;
1586
+ }
1587
+ }), R = C(
1588
+ () => {
1589
+ var _;
1590
+ return (((_ = a.mainDatasourceConfig) == null ? void 0 : _.schemaNames) || []).reduce(
1591
+ (y, Q) => {
1592
+ const K = S.value.find((j) => j.name === Q);
1593
+ return K && (y = [
1594
+ ...y,
1595
+ ...K.fields.map((j) => ({
1596
+ ...j,
1597
+ labels: [
1598
+ ue(D, O, K.label, "schema"),
1599
+ ue(D, O, j.label || j.name, "other")
1600
+ ]
1601
+ }))
1602
+ ]), y;
1603
+ },
1604
+ []
1605
+ );
1606
+ }
1607
+ ), A = C(
1608
+ () => e.value.schemaNames.reduce((_, y) => {
1609
+ const Q = S.value.find((K) => K.name === y);
1610
+ return Q && (_ = [
1611
+ ..._,
1612
+ ...Q.fields.map((K) => ({
1613
+ ...K,
1614
+ labels: [
1615
+ ue(D, O, Q.label, "schema"),
1616
+ ue(D, O, K.label || K.name, "other")
1617
+ ]
1618
+ }))
1619
+ ]), _;
1620
+ }, [])
1621
+ ), b = C(() => [
1622
+ { label: D("report.section.datasource.none"), value: null },
1623
+ { label: D("report.section.datasource.grandTotal"), value: 0 },
1624
+ ...[...F.value].slice(0, F.value.length - 1).map((_, y) => ({
1625
+ label: ue(D, O, _.label, "other"),
1626
+ value: y + 1
1627
+ }))
1628
+ ]), s = C(() => [
1629
+ {
1630
+ label: D("report.section.datasource.position.top"),
1631
+ value: hl.top
1632
+ },
1633
+ {
1634
+ label: D("report.section.datasource.position.bottom"),
1635
+ value: hl.bottom
1636
+ }
1637
+ ]), V = C(
1638
+ () => `rollup-${i.value}-${F.value.map((_) => Ve(_)).join("|")}`
1639
+ ), N = C(() => [
1640
+ {
1641
+ label: D("report.section.datasource.none"),
1642
+ value: null
1643
+ },
1644
+ ...Object.keys(bl).map((_) => ({
1645
+ label: O(`report.section.datasource.periodType.${_}`) ? D(`report.section.datasource.periodType.${_}`) : _,
1646
+ value: bl[_]
1647
+ }))
1648
+ ]), T = C(() => [
1649
+ { label: D("report.section.datasource.joinType.left"), value: "LEFT" },
1650
+ { label: D("report.section.datasource.joinType.fullOuter"), value: "FULL_OUTER" }
1651
+ ]), u = C(() => [
1652
+ { label: D("report.section.datasource.sparklineType.line"), value: "LINECHART" },
1653
+ { label: D("report.section.datasource.sparklineType.bar"), value: "BARCHART" },
1654
+ { label: D("report.section.datasource.sparklineType.stackedBar"), value: "STACKBARCHART" },
1655
+ { label: D("report.section.datasource.sparklineType.progress"), value: "PROGRESS" }
1656
+ ]);
1657
+ return (_, y) => {
1658
+ const Q = M("FmButton"), K = M("FmSwitch"), j = M("FmSelect"), W = M("FmTextField"), oe = M("FmStepperField");
1659
+ return c(), I(rl, null, {
1660
+ header: ee(() => [
1661
+ h("p", null, J(a.label), 1),
1662
+ y[25] || (y[25] = h("div", { class: "grow" }, null, -1)),
1663
+ a.closeable ? (c(), I(Q, {
1664
+ key: 0,
1665
+ icon: "close",
1666
+ variant: "tertiary",
1667
+ size: "md",
1668
+ onClick: y[0] || (y[0] = he((n) => o("click-close"), ["stop"]))
1669
+ })) : z("", !0)
1670
+ ]),
1671
+ content: ee(() => [
1672
+ m(ct, {
1673
+ modelValue: e.value,
1674
+ "onUpdate:modelValue": y[1] || (y[1] = (n) => e.value = n),
1675
+ label: l(D)("report.section.schema.title")
1676
+ }, null, 8, ["modelValue", "label"]),
1677
+ m(nl, {
1678
+ modelValue: e.value.dimensions,
1679
+ "onUpdate:modelValue": y[2] || (y[2] = (n) => e.value.dimensions = n),
1680
+ options: A.value,
1681
+ config: e.value,
1682
+ max: a.config.maxDimension,
1683
+ "has-row-column": !0,
1684
+ onConfig: y[3] || (y[3] = (n) => {
1685
+ e.value = n;
1686
+ })
1687
+ }, null, 8, ["modelValue", "options", "config", "max"]),
1688
+ m(K, {
1689
+ "label-placement": "right",
1690
+ label: l(D)("report.section.datasource.comparable"),
1691
+ "model-value": e.value.isComparable ?? !1,
1692
+ "onUpdate:modelValue": y[4] || (y[4] = (n) => {
1693
+ e.value.isComparable = n;
1694
+ })
1695
+ }, null, 8, ["label", "model-value"]),
1696
+ g.value ? (c(), I(K, {
1697
+ key: 0,
1698
+ "label-placement": "right",
1699
+ label: l(D)("report.section.datasource.cumulative"),
1700
+ "model-value": e.value.isCumulative ?? !1,
1701
+ "onUpdate:modelValue": y[5] || (y[5] = (n) => {
1702
+ e.value.isCumulative = n;
1703
+ })
1704
+ }, null, 8, ["label", "model-value"])) : z("", !0),
1705
+ a.config.isDrillConfigurable && r.value ? (c(), I(K, {
1706
+ key: 1,
1707
+ label: l(D)("report.section.datasource.drill"),
1708
+ "label-placement": "right",
1709
+ "model-value": e.value.isDrillable ?? !1,
1710
+ "onUpdate:modelValue": y[6] || (y[6] = (n) => {
1711
+ e.value.isDrillable = n;
1712
+ })
1713
+ }, null, 8, ["label", "model-value"])) : z("", !0),
1714
+ r.value ? (c(), I(K, {
1715
+ key: 2,
1716
+ modelValue: e.value.isBlend,
1717
+ "onUpdate:modelValue": y[7] || (y[7] = (n) => e.value.isBlend = n),
1718
+ label: l(D)("report.section.datasource.blend"),
1719
+ "label-placement": "right"
1720
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1721
+ a.config.canRollup && r.value ? (c(), I(j, {
1722
+ key: V.value,
1723
+ modelValue: e.value.rollup,
1724
+ "onUpdate:modelValue": y[8] || (y[8] = (n) => e.value.rollup = n),
1725
+ label: l(D)("report.section.datasource.subTotal"),
1726
+ items: b.value
1727
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1728
+ a.config.showRollupPosition && r.value ? (c(), I(j, {
1729
+ key: `rollup-position-${l(i)}`,
1730
+ modelValue: e.value.rollupPosition,
1731
+ "onUpdate:modelValue": y[9] || (y[9] = (n) => e.value.rollupPosition = n),
1732
+ label: l(D)("report.section.datasource.position.showPosition"),
1733
+ items: s.value
1734
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1735
+ a.config.type === l(Y).Table && r.value ? (c(), I(W, {
1736
+ key: 5,
1737
+ modelValue: e.value.grandTotalLabel,
1738
+ "onUpdate:modelValue": y[10] || (y[10] = (n) => e.value.grandTotalLabel = n),
1739
+ label: l(D)("report.section.datasource.grandTotalLabel"),
1740
+ placeholder: l(D)("report.section.datasource.grandTotal")
1741
+ }, null, 8, ["modelValue", "label", "placeholder"])) : z("", !0),
1742
+ r.value ? z("", !0) : (c(), I(j, {
1743
+ key: `periodType-${l(i)}`,
1744
+ modelValue: e.value.periodType,
1745
+ "onUpdate:modelValue": y[11] || (y[11] = (n) => e.value.periodType = n),
1746
+ label: l(D)("report.section.datasource.periodType.label"),
1747
+ items: N.value
1748
+ }, null, 8, ["modelValue", "label", "items"])),
1749
+ a.config.canTranspose && r.value ? (c(), I(K, {
1750
+ key: 7,
1751
+ modelValue: e.value.isTransposed,
1752
+ "onUpdate:modelValue": y[12] || (y[12] = (n) => e.value.isTransposed = n),
1753
+ label: l(D)("report.section.datasource.transpose"),
1754
+ "label-placement": "right"
1755
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1756
+ a.config.hasBreakdownDimension ? (c(), I(nl, {
1757
+ key: 8,
1758
+ "model-value": e.value.breakdownDimension ? [e.value.breakdownDimension] : [],
1759
+ label: "breakdownDimension",
1760
+ max: 1,
1761
+ options: A.value,
1762
+ config: e.value,
1763
+ "onUpdate:modelValue": y[13] || (y[13] = (n) => {
1764
+ e.value.breakdownDimension = n[0];
1765
+ })
1766
+ }, null, 8, ["model-value", "options", "config"])) : z("", !0),
1767
+ L.value && !d.value ? (c(), I(nl, {
1768
+ key: 9,
1769
+ "model-value": e.value.sparklineDimension ? [e.value.sparklineDimension] : [],
1770
+ label: "sparklineDimension",
1771
+ max: 1,
1772
+ options: A.value,
1773
+ config: e.value,
1774
+ "onUpdate:modelValue": y[14] || (y[14] = (n) => {
1775
+ e.value.sparklineDimension = n[0];
1776
+ })
1777
+ }, null, 8, ["model-value", "options", "config"])) : z("", !0),
1778
+ L.value && f.value ? (c(), I(j, {
1779
+ key: `sparklineType-${l(i)}`,
1780
+ "model-value": e.value.sparklineType ?? "LINECHART",
1781
+ label: l(D)("report.section.datasource.sparklineType.label"),
1782
+ items: u.value,
1783
+ "onUpdate:modelValue": y[15] || (y[15] = (n) => {
1784
+ e.value.sparklineType = n, n !== "STACKBARCHART" && (e.value.sparklinePercentOfTotal = void 0);
1785
+ })
1786
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1787
+ L.value && f.value && e.value.sparklineType === "STACKBARCHART" ? (c(), I(K, {
1788
+ key: 11,
1789
+ "model-value": e.value.sparklinePercentOfTotal ?? !1,
1790
+ label: l(D)("report.section.datasource.sparklinePercentOfTotal"),
1791
+ "label-placement": "right",
1792
+ "onUpdate:modelValue": y[16] || (y[16] = (n) => {
1793
+ e.value.sparklinePercentOfTotal = n;
1794
+ })
1795
+ }, null, 8, ["model-value", "label"])) : z("", !0),
1796
+ L.value && f.value && d.value ? (c(), I(oe, {
1797
+ key: 12,
1798
+ modelValue: w.value,
1799
+ "onUpdate:modelValue": y[17] || (y[17] = (n) => w.value = n),
1800
+ label: l(D)("report.section.datasource.sparklineTargetValue"),
1801
+ type: "number",
1802
+ min: 0
1803
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1804
+ m(xt, {
1805
+ modelValue: e.value.metrics,
1806
+ "onUpdate:modelValue": y[18] || (y[18] = (n) => e.value.metrics = n),
1807
+ options: A.value,
1808
+ max: a.config.maxMetric,
1809
+ config: e.value,
1810
+ "has-row-column": a.config.type === l(Y).Table,
1811
+ "has-percent-of-total": f.value,
1812
+ "has-xy": a.config.hasXy,
1813
+ onConfig: y[19] || (y[19] = (n) => {
1814
+ e.value = n;
1815
+ })
1816
+ }, null, 8, ["modelValue", "options", "max", "config", "has-row-column", "has-percent-of-total", "has-xy"]),
1817
+ m(ql, {
1818
+ modelValue: e.value.filters,
1819
+ "onUpdate:modelValue": y[20] || (y[20] = (n) => e.value.filters = n),
1820
+ options: A.value,
1821
+ dimensions: e.value.dimensions,
1822
+ "breakdown-dimension": e.value.breakdownDimension,
1823
+ metrics: e.value.metrics
1824
+ }, null, 8, ["modelValue", "options", "dimensions", "breakdown-dimension", "metrics"]),
1825
+ m(_t, {
1826
+ modelValue: e.value.sorts,
1827
+ "onUpdate:modelValue": y[21] || (y[21] = (n) => e.value.sorts = n),
1828
+ options: A.value,
1829
+ dimensions: e.value.dimensions,
1830
+ "breakdown-dimension": e.value.breakdownDimension,
1831
+ metrics: e.value.metrics
1832
+ }, null, 8, ["modelValue", "options", "dimensions", "breakdown-dimension", "metrics"]),
1833
+ m(Dt, {
1834
+ modelValue: e.value.limit,
1835
+ "onUpdate:modelValue": y[22] || (y[22] = (n) => e.value.limit = n)
1836
+ }, null, 8, ["modelValue"]),
1837
+ e.value.conditions && f.value ? (c(), I(j, {
1838
+ key: 13,
1839
+ "model-value": e.value.joinType ?? "LEFT",
1840
+ label: l(D)("report.section.datasource.joinType.label"),
1841
+ items: T.value,
1842
+ "onUpdate:modelValue": y[23] || (y[23] = (n) => {
1843
+ e.value.joinType = n;
1844
+ })
1845
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1846
+ e.value.conditions ? (c(), I(Mt, {
1847
+ key: 14,
1848
+ modelValue: e.value.conditions,
1849
+ "onUpdate:modelValue": y[24] || (y[24] = (n) => e.value.conditions = n),
1850
+ "join-field-options": A.value,
1851
+ "main-field-options": R.value
1852
+ }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : z("", !0)
1853
+ ]),
1854
+ _: 1
1855
+ });
1856
+ };
1857
+ }
1858
+ }), Ot = { class: "fm-typo-en-title-sm-600" }, Ze = /* @__PURE__ */ me({
1859
+ __name: "TileEditorTabHeader",
1860
+ props: /* @__PURE__ */ ve({
1861
+ icon: {
1862
+ type: String,
1863
+ required: !0
1864
+ },
1865
+ title: {
1866
+ type: String,
1867
+ default: void 0
1868
+ }
1869
+ }, {
1870
+ modelValue: { type: Boolean, required: !0, default: !1 },
1871
+ modelModifiers: {}
1872
+ }),
1873
+ emits: ["update:modelValue"],
1874
+ setup(B) {
1875
+ const { t: p } = pe(), e = ge(B, "modelValue"), a = B, o = C(() => a.title || p("report.tile.setting"));
1876
+ return (S, v) => {
1877
+ const f = M("FmIcon");
1878
+ return c(), P("div", {
1879
+ class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1880
+ onClick: v[0] || (v[0] = (D) => e.value = !e.value)
1881
+ }, [
1882
+ h("p", Ot, J(o.value), 1),
1883
+ v[1] || (v[1] = h("div", { class: "grow" }, null, -1)),
1884
+ m(f, {
1885
+ name: a.icon
1886
+ }, null, 8, ["name"])
1887
+ ]);
1888
+ };
1889
+ }
1890
+ }), jt = /* @__PURE__ */ me({
1891
+ __name: "TileEditorTabDesktop",
1892
+ props: {
1893
+ modelValue: { required: !0, default: !1 },
1894
+ modelModifiers: {}
1895
+ },
1896
+ emits: ["update:modelValue"],
1897
+ setup(B) {
1898
+ const p = ge(B, "modelValue"), { t: e } = pe();
1899
+ return (a, o) => (c(), P(de, null, [
1900
+ m(Ze, {
1901
+ modelValue: p.value,
1902
+ "onUpdate:modelValue": o[0] || (o[0] = (S) => p.value = S),
1903
+ icon: "keyboard_double_arrow_left",
1904
+ title: l(e)("report.tile.setupSetting")
1905
+ }, null, 8, ["modelValue", "title"]),
1906
+ kl(a.$slots, "default")
1907
+ ], 64));
1908
+ }
1909
+ }), Nt = { class: "fixed bottom-0 w-full" }, Rt = /* @__PURE__ */ me({
1910
+ __name: "TileEditorTabMobile",
1911
+ props: {
1912
+ modelValue: { required: !0, default: !1 },
1913
+ modelModifiers: {}
1914
+ },
1915
+ emits: ["update:modelValue"],
1916
+ setup(B) {
1917
+ const p = ge(B, "modelValue");
1918
+ return (e, a) => {
1919
+ const o = M("FmTopSheet");
1920
+ return c(), P("div", Nt, [
1921
+ m(Ze, {
1922
+ modelValue: p.value,
1923
+ "onUpdate:modelValue": a[0] || (a[0] = (S) => p.value = S),
1924
+ icon: "keyboard_double_arrow_up"
1925
+ }, null, 8, ["modelValue"]),
1926
+ m(o, {
1927
+ modelValue: p.value,
1928
+ "onUpdate:modelValue": a[2] || (a[2] = (S) => p.value = S),
1929
+ "fullscreen-size": "sm"
1930
+ }, {
1931
+ default: ee(() => [
1932
+ m(Ze, {
1933
+ modelValue: p.value,
1934
+ "onUpdate:modelValue": a[1] || (a[1] = (S) => p.value = S),
1935
+ icon: "keyboard_double_arrow_down"
1936
+ }, null, 8, ["modelValue"]),
1937
+ p.value ? kl(e.$slots, "default", { key: 0 }) : z("", !0)
1938
+ ]),
1939
+ _: 3
1940
+ }, 8, ["modelValue"])
1941
+ ]);
1942
+ };
1943
+ }
1944
+ });
1945
+ function Ll(B, p = 600) {
1946
+ const e = ae(null);
1947
+ function a() {
1948
+ B.value = !0, e.value && clearTimeout(e.value), e.value = setTimeout(() => {
1949
+ B.value = !1, e.value = null;
1950
+ }, p);
1951
+ }
1952
+ function o() {
1953
+ e.value && (clearTimeout(e.value), e.value = null), B.value = !1;
1954
+ }
1955
+ return ul(() => {
1956
+ o();
1957
+ }), {
1958
+ markStyleEditing: a,
1959
+ resetStyleEditing: o
1960
+ };
1961
+ }
1962
+ const It = { class: "flex flex-col gap-5" }, zt = { class: "fm-typo-en-body-lg-600" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Et = { class: "flex gap-16" }, Wt = { class: "flex flex-col gap-8 max-w-[120px]" }, Xt = { class: "fm-typo-en-body-lg-600" }, Ht = { class: "flex flex-col gap-16" }, qt = { class: "fm-typo-en-body-lg-600" }, Gt = { class: "flex flex-row gap-8" }, Yt = {
1963
+ key: 1,
1964
+ class: "flex flex-col gap-16 pt-8"
1965
+ }, Jt = /* @__PURE__ */ me({
1966
+ __name: "TitleSection",
1967
+ props: /* @__PURE__ */ ve({
1968
+ title: {},
1969
+ description: {},
1970
+ showSearchToggle: { type: Boolean },
1971
+ showTitleIconSettings: { type: Boolean },
1972
+ model: {}
1973
+ }, {
1974
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
1975
+ isEditingStyleModifiers: {}
1976
+ }),
1977
+ emits: /* @__PURE__ */ ve(["update:model", "update:title", "update:description"], ["update:isEditingStyle"]),
1978
+ setup(B, { emit: p }) {
1979
+ const e = ge(B, "isEditingStyle"), { markStyleEditing: a } = Ll(e), o = B, S = p, { t: v } = pe(), f = [
1980
+ { label: v("report.tile.widget.icon.small"), value: Pe.Small },
1981
+ { label: v("report.tile.widget.icon.medium"), value: Pe.Medium },
1982
+ { label: v("report.tile.widget.icon.large"), value: Pe.Large },
1983
+ { label: v("report.tile.widget.icon.extraLarge"), value: Pe.ExtraLarge }
1984
+ ], D = [
1985
+ { label: v("report.tile.widget.icon.material"), value: Le.Material },
1986
+ { label: v("report.tile.widget.icon.customSvg"), value: Le.Custom }
1987
+ ], O = Je((V) => {
1988
+ S("update:title", V);
1989
+ }, 500), i = C({
1990
+ get: () => o.title ?? "",
1991
+ set: (V) => {
1992
+ a(), O(V);
1993
+ }
1994
+ }), r = C({
1995
+ get: () => o.description ?? "",
1996
+ set: (V) => {
1997
+ a(), S("update:description", V);
1998
+ }
1999
+ }), g = C({
2000
+ get: () => o.model.showTitle ?? !0,
2001
+ set: (V) => {
2002
+ a(), S("update:model", { ...o.model, showTitle: V });
2003
+ }
2004
+ }), F = C({
2005
+ get: () => o.model.showSearchBar ?? !0,
2006
+ set: (V) => {
2007
+ a(), S("update:model", { ...o.model, showSearchBar: V });
2008
+ }
2009
+ }), L = C({
2010
+ get: () => o.model.titleIconType === Le.Custom ? ot(o.model.titleIcon ?? "") : o.model.titleIcon ?? "",
2011
+ set: (V) => {
2012
+ a();
2013
+ const N = d.value === Le.Custom ? at(V) : V.trim();
2014
+ S("update:model", { ...o.model, titleIcon: N });
2015
+ }
2016
+ }), d = C({
2017
+ get: () => {
2018
+ var V;
2019
+ return o.model.titleIconType ?? ((V = o.model.titleIcon) != null && V.trim().startsWith("<svg") ? Le.Custom : Le.Material);
2020
+ },
2021
+ set: (V) => {
2022
+ a(), S("update:model", { ...o.model, titleIconType: V });
2023
+ }
2024
+ }), w = C({
2025
+ get: () => o.model.titleIconSize ?? Pe.Small,
2026
+ set: (V) => {
2027
+ a(), S("update:model", { ...o.model, titleIconSize: V });
2028
+ }
2029
+ }), R = C({
2030
+ get: () => o.model.titleFontSize ?? 14,
2031
+ set: (V) => {
2032
+ a(), S("update:model", { ...o.model, titleFontSize: Math.min(Number(V), 24) });
2033
+ }
2034
+ }), A = C({
2035
+ get: () => o.model.titleBold ?? !1,
2036
+ set: (V) => {
2037
+ a(), S("update:model", { ...o.model, titleBold: V });
2038
+ }
2039
+ }), b = C({
2040
+ get: () => o.model.titleItalic ?? !1,
2041
+ set: (V) => {
2042
+ a(), S("update:model", { ...o.model, titleItalic: V });
2043
+ }
2044
+ }), s = C({
2045
+ get: () => o.model.titleUnderline ?? !1,
2046
+ set: (V) => {
2047
+ a(), S("update:model", { ...o.model, titleUnderline: V });
2048
+ }
2049
+ });
2050
+ return (V, N) => {
2051
+ const T = M("FmTextField"), u = M("FmTextarea"), _ = M("FmStepperField"), y = M("FmButton"), Q = M("FmSwitch"), K = M("FmSelect");
2052
+ return c(), P(de, null, [
2053
+ h("div", It, [
2054
+ m(T, {
2055
+ modelValue: i.value,
2056
+ "onUpdate:modelValue": N[0] || (N[0] = (j) => i.value = j),
2057
+ label: l(v)("report.tile.widget.title"),
2058
+ placeholder: l(v)("report.tile.widget.titlePlaceholder")
2059
+ }, null, 8, ["modelValue", "label", "placeholder"]),
2060
+ m(u, {
2061
+ modelValue: r.value,
2062
+ "onUpdate:modelValue": N[1] || (N[1] = (j) => r.value = j),
2063
+ disabled: i.value === "",
2064
+ placeholder: l(v)("report.tile.widget.descriptionPlaceholder"),
2065
+ "helper-text": l(v)("report.tile.widget.descriptionHelper")
2066
+ }, {
2067
+ label: ee(() => [
2068
+ h("p", zt, J(l(v)("report.tile.widget.widgetDescription")), 1),
2069
+ h("p", Pt, " (" + J(l(v)("report.tile.widget.optional")) + ") ", 1)
2070
+ ]),
2071
+ _: 1
2072
+ }, 8, ["modelValue", "disabled", "placeholder", "helper-text"]),
2073
+ h("div", Et, [
2074
+ h("div", Wt, [
2075
+ h("p", Xt, J(l(v)("report.section.datasource.title.titleFontSize")), 1),
2076
+ m(_, {
2077
+ modelValue: R.value,
2078
+ "onUpdate:modelValue": N[2] || (N[2] = (j) => R.value = j),
2079
+ max: 24,
2080
+ min: 1,
2081
+ type: "number"
2082
+ }, null, 8, ["modelValue"])
2083
+ ]),
2084
+ h("div", Ht, [
2085
+ h("p", qt, J(l(v)("report.section.datasource.title.textStyleFormat")), 1),
2086
+ h("div", Gt, [
2087
+ m(y, {
2088
+ "append-icon": "format_bold",
2089
+ "model-value": V.model.titleBold ?? !1,
2090
+ variant: "tertiary",
2091
+ "icon-color": V.model.titleBold ? "neutral-gray-400" : "neutral-gray-300",
2092
+ "bg-color": V.model.titleBold ? "neutral-gray-100" : "neutral-white",
2093
+ class: "rounded-sm",
2094
+ onClick: N[3] || (N[3] = (j) => A.value = !A.value)
2095
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
2096
+ m(y, {
2097
+ "append-icon": "format_italic",
2098
+ "model-value": V.model.titleItalic ?? !1,
2099
+ "icon-color": V.model.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
2100
+ "bg-color": V.model.titleItalic ? "neutral-gray-100" : "neutral-white",
2101
+ class: "rounded-sm",
2102
+ onClick: N[4] || (N[4] = (j) => b.value = !b.value)
2103
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
2104
+ m(y, {
2105
+ "append-icon": "format_underlined",
2106
+ "model-value": V.model.titleUnderline ?? !1,
2107
+ "icon-color": V.model.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
2108
+ "bg-color": V.model.titleUnderline ? "neutral-gray-100" : "neutral-white",
2109
+ class: "rounded-sm",
2110
+ onClick: N[5] || (N[5] = (j) => s.value = !s.value)
2111
+ }, null, 8, ["model-value", "icon-color", "bg-color"])
2112
+ ])
2113
+ ])
2114
+ ])
2115
+ ]),
2116
+ m(Q, {
2117
+ modelValue: g.value,
2118
+ "onUpdate:modelValue": N[6] || (N[6] = (j) => g.value = j),
2119
+ label: l(v)("report.section.datasource.title.showTitle"),
2120
+ "label-placement": "right"
2121
+ }, null, 8, ["modelValue", "label"]),
2122
+ o.showSearchToggle ? (c(), I(Q, {
2123
+ key: 0,
2124
+ modelValue: F.value,
2125
+ "onUpdate:modelValue": N[7] || (N[7] = (j) => F.value = j),
2126
+ label: l(v)("report.section.datasource.title.showSearchBar"),
2127
+ "label-placement": "right"
2128
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
2129
+ o.showTitleIconSettings ? (c(), P("div", Yt, [
2130
+ m(K, {
2131
+ modelValue: d.value,
2132
+ "onUpdate:modelValue": N[8] || (N[8] = (j) => d.value = j),
2133
+ label: l(v)("report.tile.widget.icon.type"),
2134
+ items: D
2135
+ }, null, 8, ["modelValue", "label"]),
2136
+ m(K, {
2137
+ modelValue: w.value,
2138
+ "onUpdate:modelValue": N[9] || (N[9] = (j) => w.value = j),
2139
+ label: l(v)("report.tile.widget.icon.size"),
2140
+ items: f
2141
+ }, null, 8, ["modelValue", "label"]),
2142
+ d.value === l(Le).Material ? (c(), I(T, {
2143
+ key: 0,
2144
+ modelValue: L.value,
2145
+ "onUpdate:modelValue": N[10] || (N[10] = (j) => L.value = j),
2146
+ label: l(v)("report.tile.widget.icon.materialName"),
2147
+ placeholder: l(v)("report.tile.widget.icon.materialPlaceholder")
2148
+ }, null, 8, ["modelValue", "label", "placeholder"])) : (c(), I(u, {
2149
+ key: 1,
2150
+ modelValue: L.value,
2151
+ "onUpdate:modelValue": N[11] || (N[11] = (j) => L.value = j),
2152
+ class: "w-full",
2153
+ label: l(v)("report.tile.widget.icon.customSvg"),
2154
+ placeholder: l(v)("report.tile.widget.icon.customPlaceholder")
2155
+ }, null, 8, ["modelValue", "label", "placeholder"]))
2156
+ ])) : z("", !0)
2157
+ ], 64);
2158
+ };
2159
+ }
2160
+ }), Kt = { class: "flex gap-16 justify-center items-center" }, Qt = { class: "fm-typo-en-title-sm-600" }, Zt = { class: "h-[40x]" }, xl = "YYYY-MM-DD", Al = /* @__PURE__ */ me({
2161
+ __name: "TileEditorTab",
2162
+ props: /* @__PURE__ */ ve({
2163
+ hideConfiguration: {
2164
+ type: Boolean,
2165
+ default: !1
2166
+ }
2167
+ }, {
2168
+ modelValue: {
2169
+ required: !0
2170
+ },
2171
+ modelModifiers: {},
2172
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
2173
+ isEditingStyleModifiers: {}
2174
+ }),
2175
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue", "update:isEditingStyle"]),
2176
+ setup(B, { emit: p }) {
2177
+ var V, N;
2178
+ const e = it(), { dateRange: a, timezone: o } = Re(e), S = {
2179
+ startDate: a.value.startDate,
2180
+ endDate: a.value.endDate
2181
+ }, v = ae({
2182
+ startDate: (V = Ge(a.value.startDate)) == null ? void 0 : V.tz(o.value).format(xl),
2183
+ endDate: (N = Ge(a.value.endDate)) == null ? void 0 : N.tz(o.value).format(xl)
2184
+ });
2185
+ xe(
2186
+ v,
2187
+ () => {
2188
+ v.value.endDate || (v.value.endDate = v.value.startDate);
2189
+ const T = {
2190
+ startDate: Ge.tz(v.value.startDate, o.value).startOf("day").utc().toISOString(),
2191
+ endDate: Ge.tz(v.value.endDate, o.value).endOf("day").utc().toISOString()
2192
+ };
2193
+ a.value = T;
2194
+ },
2195
+ { deep: !0 }
2196
+ ), ul(() => {
2197
+ a.value = { ...S };
2198
+ });
2199
+ const f = ge(B, "modelValue"), D = ge(B, "isEditingStyle"), { breakpoints: O } = $l(), i = B, { promptMessage: r } = Tl(), g = p, { t: F, locale: L } = pe();
2200
+ function d(T) {
2201
+ f.value = sl(T);
2202
+ }
2203
+ function w() {
2204
+ const T = [...f.value.widget.config.joinDatasources || []];
2205
+ T.push({ ...nt(f.value.widget.type), conditions: [] }), d({
2206
+ ...f.value,
2207
+ widget: {
2208
+ ...f.value.widget,
2209
+ config: {
2210
+ ...f.value.widget.config,
2211
+ joinDatasources: T
2212
+ }
2213
+ }
2214
+ });
2215
+ }
2216
+ async function R(T) {
2217
+ if (!await r({
2218
+ title: F("report.tile.datasource.remove"),
2219
+ message: F("report.tile.datasource.confirmRemove", { index: T + 1 })
2220
+ })) return;
2221
+ const _ = [...f.value.widget.config.joinDatasources || []];
2222
+ _.splice(T, 1), d({
2223
+ ...f.value,
2224
+ widget: {
2225
+ ...f.value.widget,
2226
+ config: {
2227
+ ...f.value.widget.config,
2228
+ joinDatasources: _
2229
+ }
2230
+ }
2231
+ });
2232
+ }
2233
+ const A = (T, u) => {
2234
+ let _ = 1, y = 1;
2235
+ switch (T) {
2236
+ case Y.Scorecard:
2237
+ _ = 1, y = 2;
2238
+ break;
2239
+ case Y.BarChart:
2240
+ case Y.StackBarChart:
2241
+ case Y.ClusteredStackBarChart:
2242
+ case Y.LineChart:
2243
+ case Y.StackLineChart:
2244
+ _ = 4, y = 6;
2245
+ break;
2246
+ case Y.Table:
2247
+ _ = 4, y = 12;
2248
+ break;
2249
+ case Y.Circular:
2250
+ _ = 4, y = 4;
2251
+ break;
2252
+ case Y.Spacer:
2253
+ _ = 0, y = 12;
2254
+ break;
2255
+ }
2256
+ return {
2257
+ id: u.id,
2258
+ size: {
2259
+ height: _,
2260
+ width: y
2261
+ },
2262
+ widget: {
2263
+ ...u.widget,
2264
+ type: T
2265
+ }
2266
+ };
2267
+ }, b = C(
2268
+ () => ll.find((T) => T.type === f.value.widget.type)
2269
+ ), s = C(() => f.value.widget.config.joinDatasources);
2270
+ return xe(
2271
+ () => f.value.size.height,
2272
+ (T) => {
2273
+ T < 1 && (f.value.size.height = 1), T > 12 && (f.value.size.height = 12);
2274
+ }
2275
+ ), xe(
2276
+ () => f.value.size.width,
2277
+ (T) => {
2278
+ T < 1 && (f.value.size.width = 1), T > 12 && (f.value.size.width = 12);
2279
+ }
2280
+ ), (T, u) => {
2281
+ const _ = M("FmCircularProgress"), y = M("FmSimpleDateRangePicker"), Q = M("FmStepperField"), K = M("FmButton"), j = M("FmForm");
2282
+ return c(), I(Fl(l(O).lg || l(O).md ? jt : Rt), {
2283
+ "model-value": i.hideConfiguration,
2284
+ "onUpdate:modelValue": u[10] || (u[10] = (W) => g("hideConfiguration", W))
2285
+ }, {
2286
+ default: ee(() => [
2287
+ f.value ? (c(), I(j, {
2288
+ key: 1,
2289
+ ref: "form",
2290
+ class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2291
+ }, {
2292
+ default: ee(() => [
2293
+ h("div", Kt, [
2294
+ (c(), I(y, {
2295
+ key: `date-picker-${l(L)}`,
2296
+ modelValue: v.value,
2297
+ "onUpdate:modelValue": u[0] || (u[0] = (W) => v.value = W)
2298
+ }, null, 8, ["modelValue"]))
2299
+ ]),
2300
+ m(rl, null, {
2301
+ header: ee(() => [
2302
+ h("p", Qt, J(l(F)("report.tile.widget.details")), 1),
2303
+ u[11] || (u[11] = h("div", { class: "grow" }, null, -1))
2304
+ ]),
2305
+ content: ee(() => [
2306
+ h("div", {
2307
+ class: Fe(["flex flex-row", `${l(O).sm || l(O).xs ? "gap-16" : "gap-2"}`])
2308
+ }, [
2309
+ m(Q, {
2310
+ modelValue: f.value.size.width,
2311
+ "onUpdate:modelValue": u[1] || (u[1] = (W) => f.value.size.width = W),
2312
+ label: l(F)("report.tile.widget.width"),
2313
+ min: 1,
2314
+ max: 12
2315
+ }, null, 8, ["modelValue", "label"]),
2316
+ m(Q, {
2317
+ modelValue: f.value.size.height,
2318
+ "onUpdate:modelValue": u[2] || (u[2] = (W) => f.value.size.height = W),
2319
+ label: l(F)("report.tile.widget.height"),
2320
+ min: 1,
2321
+ max: 12
2322
+ }, null, 8, ["modelValue", "label"])
2323
+ ], 2),
2324
+ m(Jt, {
2325
+ "is-editing-style": D.value,
2326
+ "onUpdate:isEditingStyle": u[3] || (u[3] = (W) => D.value = W),
2327
+ title: f.value.widget.title,
2328
+ description: f.value.widget.description,
2329
+ model: f.value.widget.config,
2330
+ "show-search-toggle": f.value.widget.type === l(Y).Table,
2331
+ "show-title-icon-settings": f.value.widget.type === l(Y).Scorecard,
2332
+ "onUpdate:title": u[4] || (u[4] = (W) => f.value.widget.title = W),
2333
+ "onUpdate:description": u[5] || (u[5] = (W) => f.value.widget.description = W),
2334
+ "onUpdate:model": u[6] || (u[6] = (W) => f.value.widget.config = W)
2335
+ }, null, 8, ["is-editing-style", "title", "description", "model", "show-search-toggle", "show-title-icon-settings"])
2336
+ ]),
2337
+ _: 1
2338
+ }),
2339
+ m(rl, null, {
2340
+ header: ee(() => [
2341
+ h("p", null, J(l(F)("report.tile.widget.type")), 1),
2342
+ u[12] || (u[12] = h("div", { class: "grow" }, null, -1))
2343
+ ]),
2344
+ content: ee(() => [
2345
+ m(Gl, {
2346
+ "is-list": !0,
2347
+ "model-value": f.value.widget.type,
2348
+ class: "grid grid-cols-1 gap-2",
2349
+ "child-class": "flex flex-row p-[8px] gap-2",
2350
+ "exclude-widge-type": [l(Y).Spacer],
2351
+ "onUpdate:modelValue": u[7] || (u[7] = (W) => f.value = A(W, f.value))
2352
+ }, null, 8, ["model-value", "exclude-widge-type"])
2353
+ ]),
2354
+ _: 1
2355
+ }),
2356
+ m(Cl, {
2357
+ modelValue: f.value.widget.config,
2358
+ "onUpdate:modelValue": u[8] || (u[8] = (W) => f.value.widget.config = W),
2359
+ label: l(F)("report.tile.datasource.main"),
2360
+ config: b.value
2361
+ }, null, 8, ["modelValue", "label", "config"]),
2362
+ s.value ? (c(!0), P(de, { key: 0 }, Se(s.value, (W, oe) => (c(), P("div", { key: oe }, [
2363
+ m(Cl, {
2364
+ modelValue: s.value[oe],
2365
+ "onUpdate:modelValue": (n) => s.value[oe] = n,
2366
+ label: l(F)("report.tile.datasource.join", { index: oe + 1 }),
2367
+ config: b.value,
2368
+ "main-datasource-config": f.value.widget.config,
2369
+ closeable: !0,
2370
+ onClickClose: (n) => R(oe)
2371
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2372
+ ]))), 128)) : z("", !0),
2373
+ h("div", Zt, [
2374
+ m(K, {
2375
+ label: l(F)("report.tile.datasource.joinButton"),
2376
+ variant: "secondary",
2377
+ icon: "add",
2378
+ "icon-position": "prepend",
2379
+ "border-color": "primary",
2380
+ "text-color": "primary",
2381
+ class: "w-full",
2382
+ onClick: u[9] || (u[9] = (W) => w())
2383
+ }, null, 8, ["label"])
2384
+ ])
2385
+ ]),
2386
+ _: 1
2387
+ }, 512)) : (c(), I(_, { key: 0 }))
2388
+ ]),
2389
+ _: 1
2390
+ }, 8, ["model-value"]);
2391
+ };
2392
+ }
2393
+ }), eo = { class: "flex flex-col gap-8" }, lo = { class: "pl-32 flex flex-col gap-8" }, to = { class: "fm-typo-en-body-lg-600" }, oo = { class: "flex flex-row gap-8" }, ao = { class: "fm-typo-en-body-lg-600" }, no = { class: "flex flex-row gap-8" }, io = /* @__PURE__ */ me({
2394
+ __name: "LabelSection",
2395
+ props: {
2396
+ model: {}
2397
+ },
2398
+ emits: ["update:model"],
2399
+ setup(B, { emit: p }) {
2400
+ const e = B, a = p, { t: o } = pe(), S = C({
2401
+ get: () => e.model.showLabel ?? !1,
2402
+ set: (F) => {
2403
+ a("update:model", { ...e.model, showLabel: F });
2404
+ }
2405
+ }), v = C({
2406
+ get: () => e.model.labelRotation ?? 0,
2407
+ set: (F) => a("update:model", { ...e.model, labelRotation: F })
2408
+ }), f = C({
2409
+ get: () => e.model.labelOffset ?? 0,
2410
+ set: (F) => a("update:model", { ...e.model, labelOffset: F })
2411
+ }), D = C({
2412
+ get: () => e.model.labelFontSize ?? 12,
2413
+ set: (F) => a("update:model", { ...e.model, labelFontSize: F })
2414
+ }), O = (F) => {
2415
+ a("update:model", {
2416
+ ...e.model,
2417
+ labelAlign: e.model.labelAlign === F ? void 0 : F
2418
+ });
2419
+ }, i = (F) => {
2420
+ a("update:model", {
2421
+ ...e.model,
2422
+ labelAnchor: e.model.labelAnchor === F ? void 0 : F
2423
+ });
2424
+ }, r = [
2425
+ { icon: "align_horizontal_left", value: Ae.left, tooltip: "alignLeft" },
2426
+ { icon: "align_justify_center", value: Ae.center, tooltip: "alignCenter" },
2427
+ { icon: "align_horizontal_right", value: Ae.right, tooltip: "alignRight" },
2428
+ { icon: "align_justify_flex_start", value: Ae.start, tooltip: "alignStart" },
2429
+ { icon: "align_justify_flex_end", value: Ae.end, tooltip: "alignEnd" },
2430
+ { icon: "align_flex_start", value: Ae.top, tooltip: "alignTop" },
2431
+ { icon: "align_flex_end", value: Ae.bottom, tooltip: "alignBottom" }
2432
+ ], g = [
2433
+ { icon: "format_align_left", value: ol.start, tooltip: "anchorStart" },
2434
+ { icon: "format_align_center", value: ol.center, tooltip: "anchorCenter" },
2435
+ { icon: "format_align_right", value: ol.end, tooltip: "anchorEnd" }
2436
+ ];
2437
+ return (F, L) => {
2438
+ const d = M("FmCheckbox"), w = M("FmButton"), R = M("FmTooltip"), A = M("FmTextField"), b = M("FmStepperField");
2439
+ return c(), P("div", eo, [
2440
+ m(d, {
2441
+ modelValue: S.value,
2442
+ "onUpdate:modelValue": L[0] || (L[0] = (s) => S.value = s),
2443
+ value: !1,
2444
+ label: l(o)("report.section.datasource.label.showLabel"),
2445
+ "label-placement": "right",
2446
+ class: "fm-typo-en-body-lg-400"
2447
+ }, null, 8, ["modelValue", "label"]),
2448
+ ke(h("div", lo, [
2449
+ h("p", to, J(l(o)("report.section.datasource.alignment.textAlignment")), 1),
2450
+ h("div", oo, [
2451
+ (c(), P(de, null, Se(r, ({ icon: s, value: V, tooltip: N }) => m(R, {
2452
+ key: V,
2453
+ variant: "plain",
2454
+ placement: "top",
2455
+ content: l(o)(`report.section.datasource.alignment.alignOptions.${N}`),
2456
+ "z-index": 50
2457
+ }, {
2458
+ default: ee(() => [
2459
+ m(w, {
2460
+ "append-icon": s,
2461
+ variant: "tertiary",
2462
+ "icon-color": F.model.labelAlign === V ? "neutral-gray-400" : "neutral-gray-300",
2463
+ "bg-color": F.model.labelAlign === V ? "neutral-gray-100" : "neutral-white",
2464
+ class: "rounded-sm",
2465
+ onClick: (T) => O(V)
2466
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2467
+ ]),
2468
+ _: 2
2469
+ }, 1032, ["content"])), 64))
2470
+ ]),
2471
+ h("p", ao, J(l(o)("report.section.datasource.alignment.anchor")), 1),
2472
+ h("div", no, [
2473
+ (c(), P(de, null, Se(g, ({ icon: s, value: V, tooltip: N }) => m(R, {
2474
+ key: V,
2475
+ variant: "plain",
2476
+ placement: "top",
2477
+ content: l(o)(`report.section.datasource.alignment.anchorOptions.${N}`),
2478
+ "z-index": 50
2479
+ }, {
2480
+ default: ee(() => [
2481
+ m(w, {
2482
+ "append-icon": s,
2483
+ variant: "tertiary",
2484
+ "icon-color": F.model.labelAnchor === V ? "neutral-gray-400" : "neutral-gray-300",
2485
+ "bg-color": F.model.labelAnchor === V ? "neutral-gray-100" : "neutral-white",
2486
+ class: "rounded-sm",
2487
+ onClick: (T) => i(V)
2488
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2489
+ ]),
2490
+ _: 2
2491
+ }, 1032, ["content"])), 64))
2492
+ ]),
2493
+ m(A, {
2494
+ modelValue: v.value,
2495
+ "onUpdate:modelValue": L[1] || (L[1] = (s) => v.value = s),
2496
+ label: l(o)("report.section.datasource.alignment.rotation"),
2497
+ type: "number",
2498
+ min: -180,
2499
+ max: 180,
2500
+ step: 1
2501
+ }, null, 8, ["modelValue", "label"]),
2502
+ m(A, {
2503
+ modelValue: f.value,
2504
+ "onUpdate:modelValue": L[2] || (L[2] = (s) => f.value = s),
2505
+ label: l(o)("report.section.datasource.alignment.offset"),
2506
+ type: "number"
2507
+ }, null, 8, ["modelValue", "label"]),
2508
+ m(b, {
2509
+ modelValue: D.value,
2510
+ "onUpdate:modelValue": L[3] || (L[3] = (s) => D.value = s),
2511
+ label: l(o)("report.section.datasource.fontSize"),
2512
+ type: "number",
2513
+ min: 1
2514
+ }, null, 8, ["modelValue", "label"])
2515
+ ], 512), [
2516
+ [$e, S.value]
2517
+ ])
2518
+ ]);
2519
+ };
2520
+ }
2521
+ }), ro = { class: "flex flex-col gap-8" }, so = { class: "pl-32 flex flex-col gap-8" }, uo = { class: "pl-32 flex flex-col gap-8" }, mo = { class: "pl-32 flex flex-col gap-8" }, co = { class: "pl-32 flex flex-col gap-8" }, po = { class: "pl-32 flex flex-col gap-8" }, vo = { class: "pl-32 flex flex-col gap-8" }, fo = /* @__PURE__ */ me({
2522
+ __name: "XySection",
2523
+ props: {
2524
+ model: {}
2525
+ },
2526
+ emits: ["update:model"],
2527
+ setup(B, { emit: p }) {
2528
+ const e = B, a = p, { t: o } = pe(), S = C({
2529
+ get: () => e.model.showX ?? !0,
2530
+ set: (d) => {
2531
+ a("update:model", { ...e.model, showX: d });
2532
+ }
2533
+ }), v = C({
2534
+ get: () => e.model.showXGrid ?? !1,
2535
+ set: (d) => {
2536
+ a("update:model", { ...e.model, showXGrid: d });
2537
+ }
2538
+ }), f = C({
2539
+ get: () => e.model.showXTick ?? !0,
2540
+ set: (d) => {
2541
+ a("update:model", { ...e.model, showXTick: d });
2542
+ }
2543
+ }), D = C({
2544
+ get: () => e.model.showY ?? !0,
2545
+ set: (d) => {
2546
+ a("update:model", { ...e.model, showY: d });
2547
+ }
2548
+ }), O = C({
2549
+ get: () => e.model.showYGrid ?? !1,
2550
+ set: (d) => {
2551
+ a("update:model", { ...e.model, showYGrid: d });
2552
+ }
2553
+ }), i = C({
2554
+ get: () => e.model.showYTick ?? !0,
2555
+ set: (d) => {
2556
+ a("update:model", { ...e.model, showYTick: d });
2557
+ }
2558
+ }), r = C({
2559
+ get: () => e.model.showXTitle ?? !1,
2560
+ set: (d) => {
2561
+ a("update:model", { ...e.model, showXTitle: d });
2562
+ }
2563
+ }), g = C({
2564
+ get: () => e.model.showYTitle ?? !1,
2565
+ set: (d) => {
2566
+ a("update:model", { ...e.model, showYTitle: d });
2567
+ }
2568
+ }), F = Je((d) => {
2569
+ a("update:model", { ...e.model, xTitle: d });
2570
+ }, 500), L = Je((d) => {
2571
+ a("update:model", { ...e.model, yTitle: d });
2572
+ }, 500);
2573
+ return Vl(() => {
2574
+ var d, w, R, A;
2575
+ !e.model.xTitle && ((w = (d = e.model.metrics) == null ? void 0 : d[0]) != null && w.label) && F(e.model.metrics[0].label), !e.model.yTitle && ((A = (R = e.model.dimensions) == null ? void 0 : R[0]) != null && A.label) && L(e.model.dimensions[0].label);
2576
+ }), (d, w) => {
2577
+ const R = M("FmCheckbox"), A = M("FmStepperField"), b = M("FmTextField");
2578
+ return c(), P("div", ro, [
2579
+ m(R, {
2580
+ modelValue: S.value,
2581
+ "onUpdate:modelValue": w[0] || (w[0] = (s) => S.value = s),
2582
+ label: l(o)("report.section.datasource.axis.showX"),
2583
+ "label-placement": "right",
2584
+ value: !0
2585
+ }, null, 8, ["modelValue", "label"]),
2586
+ ke(h("div", so, [
2587
+ m(R, {
2588
+ modelValue: v.value,
2589
+ "onUpdate:modelValue": w[1] || (w[1] = (s) => v.value = s),
2590
+ label: l(o)("report.section.datasource.axis.showGrid"),
2591
+ "label-placement": "right",
2592
+ value: !1
2593
+ }, null, 8, ["modelValue", "label"]),
2594
+ m(R, {
2595
+ modelValue: f.value,
2596
+ "onUpdate:modelValue": w[2] || (w[2] = (s) => f.value = s),
2597
+ label: l(o)("report.section.datasource.axis.showTick"),
2598
+ "label-placement": "right",
2599
+ value: !0
2600
+ }, null, 8, ["modelValue", "label"]),
2601
+ ke(h("div", uo, [
2602
+ m(A, {
2603
+ label: l(o)("report.section.datasource.fontSize"),
2604
+ type: "number",
2605
+ "model-value": d.model.xTickFontSize ?? 12,
2606
+ min: 1,
2607
+ "onUpdate:modelValue": w[3] || (w[3] = (s) => {
2608
+ a("update:model", { ...d.model, xTickFontSize: Number(s) });
2609
+ })
2610
+ }, null, 8, ["label", "model-value"])
2611
+ ], 512), [
2612
+ [$e, d.model.showXTick ?? !0]
2613
+ ]),
2614
+ m(R, {
2615
+ modelValue: r.value,
2616
+ "onUpdate:modelValue": w[4] || (w[4] = (s) => r.value = s),
2617
+ label: l(o)("report.section.datasource.axis.showTitle"),
2618
+ "label-placement": "right",
2619
+ value: !0
2620
+ }, null, 8, ["modelValue", "label"]),
2621
+ ke(h("div", mo, [
2622
+ m(b, {
2623
+ "model-value": d.model.xTitle,
2624
+ label: l(o)("report.common.title"),
2625
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2626
+ "onUpdate:modelValue": l(F)
2627
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2628
+ m(A, {
2629
+ label: l(o)("report.section.datasource.fontSize"),
2630
+ type: "number",
2631
+ "model-value": d.model.xTitleFontSize ?? 12,
2632
+ min: 1,
2633
+ "onUpdate:modelValue": w[5] || (w[5] = (s) => {
2634
+ a("update:model", { ...d.model, xTitleFontSize: Number(s) });
2635
+ })
2636
+ }, null, 8, ["label", "model-value"])
2637
+ ], 512), [
2638
+ [$e, r.value]
2639
+ ])
2640
+ ], 512), [
2641
+ [$e, d.model.showX ?? !0]
2642
+ ]),
2643
+ m(R, {
2644
+ modelValue: D.value,
2645
+ "onUpdate:modelValue": w[6] || (w[6] = (s) => D.value = s),
2646
+ label: l(o)("report.section.datasource.axis.showY"),
2647
+ "label-placement": "right",
2648
+ value: !0
2649
+ }, null, 8, ["modelValue", "label"]),
2650
+ ke(h("div", co, [
2651
+ m(R, {
2652
+ modelValue: O.value,
2653
+ "onUpdate:modelValue": w[7] || (w[7] = (s) => O.value = s),
2654
+ label: l(o)("report.section.datasource.axis.showGrid"),
2655
+ "label-placement": "right",
2656
+ value: !1
2657
+ }, null, 8, ["modelValue", "label"]),
2658
+ m(R, {
2659
+ modelValue: i.value,
2660
+ "onUpdate:modelValue": w[8] || (w[8] = (s) => i.value = s),
2661
+ label: l(o)("report.section.datasource.axis.showTick"),
2662
+ "label-placement": "right",
2663
+ value: !0
2664
+ }, null, 8, ["modelValue", "label"]),
2665
+ ke(h("div", po, [
2666
+ m(A, {
2667
+ label: l(o)("report.section.datasource.fontSize"),
2668
+ type: "number",
2669
+ "model-value": d.model.yTickFontSize ?? 12,
2670
+ min: 1,
2671
+ "onUpdate:modelValue": w[9] || (w[9] = (s) => {
2672
+ a("update:model", { ...d.model, yTickFontSize: Number(s) });
2673
+ })
2674
+ }, null, 8, ["label", "model-value"])
2675
+ ], 512), [
2676
+ [$e, d.model.showYTick ?? !0]
2677
+ ]),
2678
+ m(R, {
2679
+ modelValue: g.value,
2680
+ "onUpdate:modelValue": w[10] || (w[10] = (s) => g.value = s),
2681
+ label: l(o)("report.section.datasource.axis.showTitle"),
2682
+ "label-placement": "right",
2683
+ value: !0
2684
+ }, null, 8, ["modelValue", "label"]),
2685
+ ke(h("div", vo, [
2686
+ m(b, {
2687
+ "model-value": d.model.yTitle,
2688
+ label: l(o)("report.common.title"),
2689
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2690
+ "onUpdate:modelValue": l(L)
2691
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2692
+ m(A, {
2693
+ label: l(o)("report.section.datasource.fontSize"),
2694
+ type: "number",
2695
+ "model-value": d.model.yTitleFontSize ?? 12,
2696
+ min: 1,
2697
+ "onUpdate:modelValue": w[11] || (w[11] = (s) => {
2698
+ a("update:model", { ...d.model, yTitleFontSize: Number(s) });
2699
+ })
2700
+ }, null, 8, ["label", "model-value"])
2701
+ ], 512), [
2702
+ [$e, g.value]
2703
+ ])
2704
+ ], 512), [
2705
+ [$e, d.model.showY ?? !0]
2706
+ ])
2707
+ ]);
2708
+ };
2709
+ }
2710
+ }), go = { class: "flex flex-col gap-8" }, yo = { class: "pl-32 flex flex-col gap-8" }, bo = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, ho = ["onKeydown"], wo = /* @__PURE__ */ me({
2711
+ __name: "LegendSection",
2712
+ props: {
2713
+ model: {},
2714
+ isCircularWidget: { type: Boolean }
2715
+ },
2716
+ emits: ["update:model"],
2717
+ setup(B, { emit: p }) {
2718
+ const e = B, a = p, { t: o } = pe(), S = [
2719
+ { label: o("report.section.datasource.position.top"), value: "top" },
2720
+ { label: o("report.section.datasource.position.bottom"), value: "bottom" },
2721
+ { label: o("report.section.datasource.position.left"), value: "left" },
2722
+ { label: o("report.section.datasource.position.right"), value: "right" }
2723
+ ], v = C({
2724
+ get: () => e.model.showLegend !== void 0 ? e.model.showLegend : e.isCircularWidget === !0,
2725
+ set: (L) => {
2726
+ a("update:model", { ...e.model, showLegend: L });
2727
+ }
2728
+ }), f = C({
2729
+ get: () => e.model.usePointStyle ?? !0,
2730
+ set: (L) => {
2731
+ a("update:model", { ...e.model, usePointStyle: L });
2732
+ }
2733
+ }), D = C({
2734
+ get: () => e.model.legendFontSize ?? null,
2735
+ set: (L) => {
2736
+ if (L == null) {
2737
+ a("update:model", { ...e.model, legendFontSize: void 0 });
2738
+ return;
2739
+ }
2740
+ a("update:model", { ...e.model, legendFontSize: Math.min(Number(L), 24) });
2741
+ }
2742
+ }), O = C(() => e.model.legendColor ?? "#6b6b6b"), i = ae(O.value), r = ae(null);
2743
+ xe(
2744
+ () => e.model.legendColor,
2745
+ (L) => {
2746
+ i.value = L ?? "#6b6b6b";
2747
+ }
2748
+ );
2749
+ function g() {
2750
+ a("update:model", { ...e.model, legendColor: i.value });
2751
+ }
2752
+ function F() {
2753
+ var L;
2754
+ (L = r.value) == null || L.click();
2755
+ }
2756
+ return (L, d) => {
2757
+ const w = M("FmCheckbox"), R = M("FmSelect"), A = M("FmStepperField"), b = M("FmButton");
2758
+ return c(), P("div", go, [
2759
+ m(w, {
2760
+ modelValue: v.value,
2761
+ "onUpdate:modelValue": d[0] || (d[0] = (s) => v.value = s),
2762
+ class: "fm-typo-en-body-lg-400",
2763
+ value: !1,
2764
+ label: l(o)("report.section.datasource.legend.showLegend")
2765
+ }, null, 8, ["modelValue", "label"]),
2766
+ ke(h("div", yo, [
2767
+ m(w, {
2768
+ modelValue: f.value,
2769
+ "onUpdate:modelValue": d[1] || (d[1] = (s) => f.value = s),
2770
+ label: l(o)("report.section.datasource.legend.usePointStyle"),
2771
+ value: !1
2772
+ }, null, 8, ["modelValue", "label"]),
2773
+ m(R, {
2774
+ label: l(o)("report.section.datasource.position.showPosition"),
2775
+ items: S,
2776
+ "model-value": L.model.legendPosition ?? "top",
2777
+ "onUpdate:modelValue": d[2] || (d[2] = (s) => a("update:model", { ...L.model, legendPosition: s }))
2778
+ }, null, 8, ["label", "model-value"]),
2779
+ m(A, {
2780
+ modelValue: D.value,
2781
+ "onUpdate:modelValue": d[3] || (d[3] = (s) => D.value = s),
2782
+ label: l(o)("report.section.datasource.legend.fontSize"),
2783
+ max: 24,
2784
+ min: 1,
2785
+ type: "number",
2786
+ placeholder: "Auto"
2787
+ }, null, 8, ["modelValue", "label"]),
2788
+ h("p", bo, J(l(o)("report.section.datasource.legend.color")), 1),
2789
+ h("div", {
2790
+ class: "fm-field fm-field--sm flex items-center justify-between gap-8 border rounded-md p-2 border-[#c7c7cc] cursor-pointer",
2791
+ role: "button",
2792
+ tabindex: "0",
2793
+ onClick: F,
2794
+ onKeydown: [
2795
+ fl(he(F, ["prevent"]), ["enter"]),
2796
+ fl(he(F, ["prevent"]), ["space"])
2797
+ ]
2798
+ }, [
2799
+ ke(h("input", {
2800
+ ref_key: "colorInputRef",
2801
+ ref: r,
2802
+ "onUpdate:modelValue": d[4] || (d[4] = (s) => i.value = s),
2803
+ type: "color",
2804
+ class: "legend-color-input cursor-pointer"
2805
+ }, null, 512), [
2806
+ [El, i.value]
2807
+ ])
2808
+ ], 40, ho),
2809
+ m(b, {
2810
+ size: "md",
2811
+ label: l(o)("report.common.apply"),
2812
+ disabled: i.value === O.value,
2813
+ onClick: g
2814
+ }, null, 8, ["label", "disabled"])
2815
+ ], 512), [
2816
+ [$e, v.value]
2817
+ ])
2818
+ ]);
2819
+ };
2820
+ }
2821
+ }), Co = /* @__PURE__ */ Bl(wo, [["__scopeId", "data-v-0e072961"]]), xo = { class: "flex flex-col gap-8" }, ko = { class: "flex flex-col sm:flex-row items-center" }, Fo = { class: "flex flex-col gap-8" }, Vo = { class: "flex w-full gap-8 text-fm-color-system-info-300" }, So = {
2822
+ key: 1,
2823
+ class: "grid grid-cols-1 gap-8 sm:grid-cols-2"
2824
+ }, _o = ["title"], To = ["aria-label"], $o = { class: "min-w-0 truncate text-[12px] uppercase leading-none tracking-[0.02em] text-[#6b6b6b]" }, Do = ["value", "onInput", "onChange"], Uo = {
2825
+ key: 0,
2826
+ class: "flex items-center gap-8"
2827
+ }, Bo = {
2828
+ key: 2,
2829
+ class: "flex flex-col gap-8"
2830
+ }, Lo = { class: "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white p-10" }, Ao = { class: "mb-8 flex min-w-0 items-center gap-[8px] pb-8" }, Mo = ["title"], Oo = ["title"], jo = { class: "flex w-full items-center gap-8 sm:w-auto sm:shrink-0" }, No = ["aria-label"], Ro = { class: "min-w-0 truncate text-[12px] uppercase leading-none tracking-[0.02em]" }, Io = ["value", "disabled", "onInput", "onChange"], zo = {
2831
+ key: 0,
2832
+ class: "flex items-center gap-8"
2833
+ }, De = 10, Po = /* @__PURE__ */ me({
2834
+ __name: "ChartColorSection",
2835
+ props: {
2836
+ model: {},
2837
+ showLayerControl: { type: Boolean },
2838
+ limitToSeriesMode: { type: Boolean }
2839
+ },
2840
+ emits: ["update:model"],
2841
+ setup(B, { emit: p }) {
2842
+ const e = B, a = p, { t: o } = pe(), S = C(() => e.limitToSeriesMode ? [
2843
+ {
2844
+ label: o("report.section.datasource.styleTarget.series"),
2845
+ value: se.series
2846
+ }
2847
+ ] : [
2848
+ {
2849
+ label: o("report.section.datasource.styleTarget.series"),
2850
+ value: se.series
2851
+ },
2852
+ {
2853
+ label: o("report.section.datasource.styleTarget.metric"),
2854
+ value: se.metric
2855
+ },
2856
+ {
2857
+ label: o("report.section.datasource.styleTarget.breakdown"),
2858
+ value: se.breakdown
2859
+ }
2860
+ ]);
2861
+ function v(k) {
2862
+ return e.limitToSeriesMode ? se.series : k === se.breakdown ? se.breakdown : k === se.metric ? se.metric : se.series;
2863
+ }
2864
+ function f() {
2865
+ const k = Array.isArray(e.model.metrics) ? e.model.metrics : [];
2866
+ if (!e.model.isBlend)
2867
+ return k;
2868
+ const $ = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
2869
+ (U) => Array.isArray(U == null ? void 0 : U.metrics) ? U.metrics : []
2870
+ ) : [];
2871
+ return [...k, ...$];
2872
+ }
2873
+ function D(k, $) {
2874
+ var E, G;
2875
+ return k ? ((E = k.label) == null ? void 0 : E.trim()) || ((G = k.name) == null ? void 0 : G.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${$ + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${$ + 1}`;
2876
+ }
2877
+ function O(k) {
2878
+ if (k === se.breakdown)
2879
+ return [];
2880
+ if (k === se.metric) {
2881
+ const $ = f();
2882
+ if ($.length > 0)
2883
+ return $.map((U, E) => D(U, E));
2884
+ }
2885
+ return fe.map(
2886
+ ($, U) => `${o("report.section.datasource.chartColor.series")} ${U + 1}`
2887
+ );
2888
+ }
2889
+ function i(k) {
2890
+ return Array.from({ length: Math.max(1, k) }).map(
2891
+ ($, U) => `${o("report.section.datasource.chartColor.series")} ${U + 1}`
2892
+ );
2893
+ }
2894
+ function r(k, $) {
2895
+ const U = Array.isArray(k) ? k.length : 0, E = Array.isArray($) ? $.length : 0;
2896
+ return Math.max(fe.length, U, E, 1);
2897
+ }
2898
+ const g = C(() => {
2899
+ const k = f();
2900
+ return k.length === 0 ? [o("report.section.datasource.styleTarget.metric")] : k.map(($, U) => D($, U));
2901
+ }), F = ae(fe.length), L = ae(fe.length);
2902
+ function d(k, $) {
2903
+ const U = Math.max(1, $), E = Array.isArray(k) ? k.length : 0, G = E > 0 ? Math.ceil(E / U) : 0;
2904
+ return Math.max(fe.length, G, 1);
2905
+ }
2906
+ const w = C(() => {
2907
+ const k = Math.max(1, L.value);
2908
+ return Array.from({ length: k }).map(
2909
+ ($, U) => `${o("report.section.datasource.styleTarget.breakdown")} ${U + 1}`
2910
+ );
2911
+ });
2912
+ function R(k, $) {
2913
+ const U = N(k) ?? "#000000", E = (G) => {
2914
+ const X = Number.parseInt(U.slice(G, G + 2), 16);
2915
+ return Math.round(X + (255 - X) * $).toString(16).padStart(2, "0").toUpperCase();
2916
+ };
2917
+ return `#${E(1)}${E(3)}${E(5)}`;
2918
+ }
2919
+ function A(k) {
2920
+ return Math.min(0.55 + (k - 1) * 0.18, 0.95);
2921
+ }
2922
+ function b(k, $, U) {
2923
+ return k * U + $;
2924
+ }
2925
+ function s(k, $, U, E) {
2926
+ const G = $.length;
2927
+ if (k.length === 0 || G <= 0)
2928
+ return [];
2929
+ const X = al(k.length);
2930
+ return k.flatMap((q, ne) => {
2931
+ const te = X[ne], ce = U == null ? void 0 : U[b(ne, 0, G)], Me = N(ce) ?? te;
2932
+ return $.map((tl, Oe) => {
2933
+ const Pl = b(ne, Oe, G), vl = Oe === 0 ? Me : R(Me, A(Oe));
2934
+ return E && Oe > 0 ? vl : N(U == null ? void 0 : U[Pl]) ?? vl;
2935
+ });
2936
+ });
2937
+ }
2938
+ const V = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
2939
+ function N(k) {
2940
+ if (!k)
2941
+ return null;
2942
+ const $ = k.trim();
2943
+ if (!V.test($))
2944
+ return null;
2945
+ if ($.length === 4) {
2946
+ const U = $.charAt(1), E = $.charAt(2), G = $.charAt(3);
2947
+ return `#${U}${U}${E}${E}${G}${G}`.toUpperCase();
2948
+ }
2949
+ return $.toUpperCase();
2950
+ }
2951
+ function T() {
2952
+ const k = () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0").toUpperCase();
2953
+ return `#${k()}${k()}${k()}`;
2954
+ }
2955
+ function u(k, $) {
2956
+ const U = al($);
2957
+ return !Array.isArray(k) || k.length === 0 ? U : Array.from({ length: $ }).map((E, G) => {
2958
+ const X = U[G];
2959
+ return N(k[G]) ?? X;
2960
+ });
2961
+ }
2962
+ function _(k, $) {
2963
+ if ($ <= 0)
2964
+ return [];
2965
+ const U = Array.from({ length: $ }, () => 0), E = /* @__PURE__ */ new Set();
2966
+ for (let X = 0; X < $; X++) {
2967
+ const q = Number(k == null ? void 0 : k[X]);
2968
+ Number.isInteger(q) && q >= 1 && q <= $ && !E.has(q) && (U[X] = q, E.add(q));
2969
+ }
2970
+ let G = 1;
2971
+ for (let X = 0; X < $; X++)
2972
+ if (U[X] === 0) {
2973
+ for (; E.has(G) && G <= $; )
2974
+ G++;
2975
+ U[X] = Math.min(G, $), E.add(U[X]);
2976
+ }
2977
+ return U;
2978
+ }
2979
+ const y = C(() => t.value === se.series ? i(F.value) : O(t.value)), Q = C(
2980
+ () => Array.from({ length: y.value.length }).map((k, $) => ({
2981
+ label: `L${$ + 1}`,
2982
+ value: $ + 1
2983
+ }))
2984
+ ), K = C(() => typeof e.showLayerControl == "boolean" ? e.showLayerControl : !!e.model.stackBarOverlap), j = ae([]), W = ae([]), oe = ae([]), n = ae(!0), t = ae(se.series), x = ae(!0), le = ae(!1), ie = ae(!1);
2985
+ xe(
2986
+ [
2987
+ () => e.model.chartColors,
2988
+ () => e.model.chartColorBinding,
2989
+ () => e.model.chartBreakdownColors,
2990
+ () => e.model.chartUseSecondaryMetricShades,
2991
+ () => e.model.metrics,
2992
+ () => e.model.isBlend,
2993
+ () => e.model.joinDatasources
2994
+ ],
2995
+ ([k, $]) => {
2996
+ le.value = !0, t.value = v($), F.value = r(
2997
+ k,
2998
+ e.model.chartColorLayers
2999
+ ), L.value = d(
3000
+ e.model.chartBreakdownColors,
3001
+ Math.max(1, g.value.length)
3002
+ );
3003
+ const U = t.value === se.series ? F.value : O(t.value).length;
3004
+ j.value = u(k, U), W.value = _(e.model.chartColorLayers, U), n.value = e.model.chartUseSecondaryMetricShades !== !1, oe.value = s(
3005
+ w.value,
3006
+ g.value,
3007
+ e.model.chartBreakdownColors,
3008
+ n.value
3009
+ ), le.value = !1;
3010
+ },
3011
+ { immediate: !0, deep: !0 }
3012
+ );
3013
+ function H() {
3014
+ const k = t.value === se.series, $ = t.value === se.series ? fe.length : O(t.value).length, U = u(void 0, $), E = _(void 0, $), G = j.value.length === U.length && j.value.every((te, ce) => te === U[ce]), X = W.value.length === E.length && W.value.every((te, ce) => te === E[ce]), q = s(
3015
+ Array.from({ length: fe.length }, (te, ce) => `breakdown-${ce + 1}`),
3016
+ g.value,
3017
+ void 0,
3018
+ n.value
3019
+ ), ne = oe.value.length === q.length && oe.value.every((te, ce) => te === q[ce]);
3020
+ return {
3021
+ ...e.model,
3022
+ chartColorBinding: k ? void 0 : t.value,
3023
+ chartColors: G ? void 0 : [...j.value],
3024
+ chartColorLayers: X ? void 0 : [...W.value],
3025
+ chartBreakdownColors: ne ? void 0 : [...oe.value],
3026
+ chartUseSecondaryMetricShades: n.value
3027
+ };
3028
+ }
3029
+ function _e() {
3030
+ const k = H();
3031
+ Nl(k) || a("update:model", k);
3032
+ }
3033
+ function Te() {
3034
+ le.value || ie.value || _e();
3035
+ }
3036
+ xe(
3037
+ [
3038
+ j,
3039
+ W,
3040
+ oe,
3041
+ n,
3042
+ t,
3043
+ F,
3044
+ L
3045
+ ],
3046
+ () => {
3047
+ Te();
3048
+ },
3049
+ { deep: !0 }
3050
+ );
3051
+ function Be(k, $) {
3052
+ const U = [...j.value], E = al(Math.max(U.length, k + 1))[k];
3053
+ U[k] = N($) ?? E, j.value = U;
3054
+ }
3055
+ function Ie(k) {
3056
+ Be(k, T());
3057
+ }
3058
+ function ze(k) {
3059
+ if (e.limitToSeriesMode)
3060
+ return;
3061
+ const $ = v(k);
3062
+ if ($ === t.value)
3063
+ return;
3064
+ const U = $ === se.series ? F.value : O($).length;
3065
+ t.value = $, j.value = u(j.value, U), W.value = _(W.value, U), $ === se.breakdown && (oe.value = s(
3066
+ w.value,
3067
+ g.value,
3068
+ oe.value,
3069
+ n.value
3070
+ ));
3071
+ }
3072
+ function Ce(k, $) {
3073
+ return k + 1 === $ ? "add" : "remove";
3074
+ }
3075
+ function ye(k) {
3076
+ const $ = Math.max(fe.length, F.value), U = k + 1;
3077
+ if (U === $) {
3078
+ const te = $ + De;
3079
+ F.value = te, j.value = u(j.value, te), W.value = _(W.value, te);
3080
+ return;
3081
+ }
3082
+ if ($ <= fe.length)
3083
+ return;
3084
+ const G = U, X = Math.max(fe.length, $ - De), q = [...j.value], ne = [...W.value];
3085
+ q.splice(G, De), ne.splice(G, De), F.value = X, j.value = u(q, X), W.value = _(ne, X);
3086
+ }
3087
+ function we(k) {
3088
+ const $ = Math.max(fe.length, L.value), U = k + 1;
3089
+ if (U === $) {
3090
+ const Me = $ + De;
3091
+ L.value = Me, oe.value = s(
3092
+ Array.from({ length: Me }, (tl, Oe) => `breakdown-${Oe + 1}`),
3093
+ g.value,
3094
+ oe.value,
3095
+ n.value
3096
+ );
3097
+ return;
3098
+ }
3099
+ if ($ <= fe.length)
3100
+ return;
3101
+ const G = Math.max(1, g.value.length), q = U * G, ne = De * G, te = Math.max(fe.length, $ - De), ce = [...oe.value];
3102
+ ce.splice(q, ne), L.value = te, oe.value = s(
3103
+ Array.from({ length: te }, (Me, tl) => `breakdown-${tl + 1}`),
3104
+ g.value,
3105
+ ce,
3106
+ n.value
3107
+ );
3108
+ }
3109
+ function Z(k, $) {
3110
+ const U = W.value.length;
3111
+ if (U <= 0)
3112
+ return;
3113
+ const E = Number($);
3114
+ if (!Number.isInteger(E) || E < 1 || E > U)
3115
+ return;
3116
+ const G = [...W.value], X = G[k];
3117
+ if (X === E)
3118
+ return;
3119
+ const q = G.findIndex(
3120
+ (ne, te) => te !== k && ne === E
3121
+ );
3122
+ q >= 0 && (G[q] = X), G[k] = E, W.value = G;
3123
+ }
3124
+ function He(k, $) {
3125
+ const U = $.target;
3126
+ U && (ie.value = !0, Be(k, U.value));
3127
+ }
3128
+ function qe(k, $) {
3129
+ const U = $.target;
3130
+ U && (Be(k, U.value), ie.value = !1, Te());
3131
+ }
3132
+ function re(k, $, U) {
3133
+ const E = U.target;
3134
+ if (!E)
3135
+ return;
3136
+ ie.value = !0;
3137
+ const G = N(E.value);
3138
+ if (!G)
3139
+ return;
3140
+ const X = g.value.length;
3141
+ if (X <= 0)
3142
+ return;
3143
+ const q = b(k, $, X), ne = [...oe.value];
3144
+ if (ne[q] = G, n.value && $ === 0)
3145
+ for (let te = 1; te < X; te++) {
3146
+ const ce = b(k, te, X);
3147
+ ne[ce] = R(G, A(te));
3148
+ }
3149
+ oe.value = ne;
3150
+ }
3151
+ function Ml(k, $, U) {
3152
+ const E = U.target;
3153
+ if (!E)
3154
+ return;
3155
+ const G = N(E.value);
3156
+ if (!G) {
3157
+ ie.value = !1, Te();
3158
+ return;
3159
+ }
3160
+ const X = g.value.length;
3161
+ if (X <= 0) {
3162
+ ie.value = !1, Te();
3163
+ return;
3164
+ }
3165
+ const q = b(k, $, X), ne = [...oe.value];
3166
+ if (ne[q] = G, n.value && $ === 0)
3167
+ for (let te = 1; te < X; te++) {
3168
+ const ce = b(k, te, X);
3169
+ ne[ce] = R(G, A(te));
3170
+ }
3171
+ oe.value = ne, ie.value = !1, Te();
3172
+ }
3173
+ function Ol(k, $) {
3174
+ const U = T(), E = g.value.length;
3175
+ if (E <= 0)
3176
+ return;
3177
+ const G = b(k, $, E), X = [...oe.value];
3178
+ if (X[G] = U, n.value && $ === 0)
3179
+ for (let q = 1; q < E; q++) {
3180
+ const ne = b(k, q, E);
3181
+ X[ne] = R(U, A(q));
3182
+ }
3183
+ oe.value = X;
3184
+ }
3185
+ function cl(k, $) {
3186
+ const U = Array.isArray(k) ? k : [], E = Array.isArray($) ? $ : [];
3187
+ return U.length !== E.length ? !1 : U.every((G, X) => G === E[X]);
3188
+ }
3189
+ function jl(k, $) {
3190
+ const U = Array.isArray(k) ? k : [], E = Array.isArray($) ? $ : [];
3191
+ return U.length !== E.length ? !1 : U.every((G, X) => Number(G) === Number(E[X]));
3192
+ }
3193
+ function Nl(k) {
3194
+ return k.chartColorBinding === e.model.chartColorBinding && k.chartUseSecondaryMetricShades === e.model.chartUseSecondaryMetricShades && cl(k.chartColors, e.model.chartColors) && jl(k.chartColorLayers, e.model.chartColorLayers) && cl(k.chartBreakdownColors, e.model.chartBreakdownColors);
3195
+ }
3196
+ function Rl(k) {
3197
+ n.value = k, oe.value = s(
3198
+ Array.from({ length: L.value }, ($, U) => `breakdown-${U + 1}`),
3199
+ g.value,
3200
+ oe.value,
3201
+ n.value
3202
+ );
3203
+ }
3204
+ function Il() {
3205
+ t.value = se.series, F.value = fe.length, L.value = fe.length, j.value = u(void 0, fe.length), W.value = _(void 0, fe.length), n.value = !0, oe.value = s(
3206
+ Array.from({ length: fe.length }, (k, $) => `breakdown-${$ + 1}`),
3207
+ g.value,
3208
+ void 0,
3209
+ !0
3210
+ );
3211
+ }
3212
+ function zl() {
3213
+ x.value = !x.value;
3214
+ }
3215
+ function pl(k) {
3216
+ return (k + 1) % De === 0;
3217
+ }
3218
+ return ul(() => {
3219
+ ie.value = !1;
3220
+ }), (k, $) => {
3221
+ const U = M("FmButton"), E = M("FmSelect"), G = M("FmCheckbox");
3222
+ return c(), P("div", xo, [
3223
+ h("div", ko, [
3224
+ m(U, {
3225
+ variant: "tertiary",
3226
+ size: "md",
3227
+ class: "min-w-0 w-full sm:flex-1 sm:w-auto !justify-start",
3228
+ label: l(o)("report.section.datasource.chartColor.title"),
3229
+ "prepend-icon": x.value ? "expand_less" : "expand_more",
3230
+ "aria-expanded": x.value ? "true" : "false",
3231
+ onClick: zl
3232
+ }, null, 8, ["label", "prepend-icon", "aria-expanded"])
3233
+ ]),
3234
+ ke(h("div", Fo, [
3235
+ m(E, {
3236
+ "model-value": t.value,
3237
+ items: S.value,
3238
+ "onUpdate:modelValue": ze
3239
+ }, null, 8, ["model-value", "items"]),
3240
+ h("div", Vo, [
3241
+ m(U, {
3242
+ variant: "tertiary",
3243
+ "text-color": "text-fm-color-system-info-300",
3244
+ size: "md",
3245
+ class: "w-full",
3246
+ label: l(o)("report.section.datasource.chartColor.reset"),
3247
+ onClick: Il
3248
+ }, null, 8, ["label"])
3249
+ ]),
3250
+ t.value === l(se).breakdown ? (c(), I(G, {
3251
+ key: 0,
3252
+ "model-value": n.value,
3253
+ value: !1,
3254
+ label: l(o)("report.section.datasource.chartColor.secondaryMetricAutoShade"),
3255
+ "onUpdate:modelValue": $[0] || ($[0] = (X) => Rl(!!X)),
3256
+ class: "p-4"
3257
+ }, null, 8, ["model-value", "label"])) : z("", !0),
3258
+ t.value !== l(se).breakdown ? (c(), P("div", So, [
3259
+ (c(!0), P(de, null, Se(j.value, (X, q) => (c(), P(de, {
3260
+ key: `series-color-${q}`
3261
+ }, [
3262
+ h("div", {
3263
+ class: Fe([
3264
+ "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 p-10",
3265
+ K.value ? "flex flex-col gap-8" : "flex flex-col gap-8 sm:flex-row sm:items-center sm:justify-between sm:gap-12"
3266
+ ])
3267
+ }, [
3268
+ h("span", {
3269
+ class: Fe([
3270
+ "fm-typo-en-body-lg-600 min-w-0",
3271
+ K.value ? "line-clamp-2 break-words" : "whitespace-normal break-words sm:flex-1"
3272
+ ]),
3273
+ title: y.value[q] || `${l(o)("report.section.datasource.chartColor.color")} ${q + 1}`
3274
+ }, J(y.value[q] || `${l(o)("report.section.datasource.chartColor.color")} ${q + 1}`), 11, _o),
3275
+ h("div", {
3276
+ class: Fe([
3277
+ "flex items-center gap-8",
3278
+ K.value ? "justify-between" : "w-full flex-wrap items-center justify-between sm:w-auto sm:flex-nowrap sm:shrink-0"
3279
+ ])
3280
+ }, [
3281
+ K.value ? (c(), I(E, {
3282
+ key: 0,
3283
+ class: "min-w-[92px]",
3284
+ "model-value": W.value[q],
3285
+ items: Q.value,
3286
+ "onUpdate:modelValue": (ne) => Z(q, ne)
3287
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : z("", !0),
3288
+ h("label", {
3289
+ class: "relative inline-flex min-h-[34px] min-w-0 flex-1 cursor-pointer items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px] sm:flex-none",
3290
+ "aria-label": `Color ${q + 1}`
3291
+ }, [
3292
+ h("span", {
3293
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3294
+ style: il({ backgroundColor: X })
3295
+ }, null, 4),
3296
+ h("span", $o, J(X), 1),
3297
+ h("input", {
3298
+ type: "color",
3299
+ value: X,
3300
+ class: "absolute inset-0 cursor-pointer opacity-0",
3301
+ onInput: (ne) => He(q, ne),
3302
+ onChange: (ne) => qe(q, ne)
3303
+ }, null, 40, Do)
3304
+ ], 8, To),
3305
+ m(U, {
3306
+ variant: "tertiary",
3307
+ size: "md",
3308
+ icon: "casino",
3309
+ onClick: (ne) => Ie(q)
3310
+ }, null, 8, ["onClick"])
3311
+ ], 2)
3312
+ ], 2),
3313
+ pl(q) ? (c(), P("div", Uo, [
3314
+ m(U, {
3315
+ class: "w-full",
3316
+ size: "md",
3317
+ icon: Ce(q, F.value),
3318
+ onClick: (ne) => ye(q)
3319
+ }, null, 8, ["icon", "onClick"])
3320
+ ])) : z("", !0)
3321
+ ], 64))), 128))
3322
+ ])) : (c(), P("div", Bo, [
3323
+ (c(!0), P(de, null, Se(w.value, (X, q) => (c(), P(de, {
3324
+ key: `breakdown-group-${q}`
3325
+ }, [
3326
+ h("div", Lo, [
3327
+ h("div", Ao, [
3328
+ h("span", {
3329
+ class: "fm-typo-en-body-lg-600 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",
3330
+ title: X
3331
+ }, J(X), 9, Mo)
3332
+ ]),
3333
+ (c(!0), P(de, null, Se(g.value, (ne, te) => (c(), P("div", {
3334
+ key: `${X}-${ne}-${te}`,
3335
+ class: "flex flex-col items-stretch gap-8 py-4 sm:flex-row sm:items-center sm:justify-between"
3336
+ }, [
3337
+ h("span", {
3338
+ class: "fm-typo-en-body-md-400 min-w-0 flex-1 break-words sm:overflow-hidden sm:text-ellipsis sm:whitespace-nowrap",
3339
+ title: ne
3340
+ }, J(ne), 9, Oo),
3341
+ h("div", jo, [
3342
+ h("label", {
3343
+ class: Fe(["relative inline-flex min-h-[34px] min-w-0 flex-1 items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px] sm:w-full sm:max-w-[126px]", {
3344
+ "cursor-not-allowed opacity-[0.55]": n.value && te > 0,
3345
+ "cursor-pointer": !(n.value && te > 0)
3346
+ }]),
3347
+ "aria-label": `Breakdown color ${q + 1}-${te + 1}`
3348
+ }, [
3349
+ h("span", {
3350
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3351
+ style: il({
3352
+ backgroundColor: oe.value[b(q, te, g.value.length)]
3353
+ })
3354
+ }, null, 4),
3355
+ h("span", Ro, J(oe.value[b(q, te, g.value.length)]), 1),
3356
+ h("input", {
3357
+ type: "color",
3358
+ value: oe.value[b(q, te, g.value.length)],
3359
+ class: Fe(["absolute inset-0 opacity-0", {
3360
+ "cursor-not-allowed": n.value && te > 0,
3361
+ "cursor-pointer": !(n.value && te > 0)
3362
+ }]),
3363
+ disabled: n.value && te > 0,
3364
+ onInput: (ce) => re(q, te, ce),
3365
+ onChange: (ce) => Ml(q, te, ce)
3366
+ }, null, 42, Io)
3367
+ ], 10, No),
3368
+ m(U, {
3369
+ variant: "tertiary",
3370
+ size: "md",
3371
+ icon: "casino",
3372
+ class: "shrink-0",
3373
+ disabled: n.value && te > 0,
3374
+ onClick: (ce) => Ol(q, te)
3375
+ }, null, 8, ["disabled", "onClick"])
3376
+ ])
3377
+ ]))), 128))
3378
+ ]),
3379
+ pl(q) ? (c(), P("div", zo, [
3380
+ m(U, {
3381
+ class: "w-full",
3382
+ size: "md",
3383
+ icon: Ce(q, L.value),
3384
+ onClick: (ne) => we(q)
3385
+ }, null, 8, ["icon", "onClick"])
3386
+ ])) : z("", !0)
3387
+ ], 64))), 128))
3388
+ ]))
3389
+ ], 512), [
3390
+ [$e, x.value]
3391
+ ])
3392
+ ]);
3393
+ };
3394
+ }
3395
+ }), Eo = { class: "flex flex-col gap-8" }, Wo = { class: "flex items-center justify-between" }, Xo = { class: "fm-typo-en-body-lg-600" }, Ho = { class: "flex items-center gap-8 text-fm-color-system-info-300" }, qo = { class: "grid grid-cols-2 gap-8" }, Go = { class: "flex items-center gap-8" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = /* @__PURE__ */ me({
3396
+ __name: "ChartLineStyleSection",
3397
+ props: {
3398
+ model: {}
3399
+ },
3400
+ emits: ["update:model"],
3401
+ setup(B, { emit: p }) {
3402
+ const e = B, a = p, { t: o } = pe(), S = C(() => [
3403
+ {
3404
+ label: o("report.section.datasource.styleTarget.series"),
3405
+ value: se.series
3406
+ },
3407
+ {
3408
+ label: o("report.section.datasource.styleTarget.metric"),
3409
+ value: se.metric
3410
+ }
3411
+ ]);
3412
+ function v(u) {
3413
+ return u && typeof u == "object" && "value" in u ? v(u.value) : u === se.metric ? se.metric : se.series;
3414
+ }
3415
+ function f(u, _) {
3416
+ var Q, K;
3417
+ return u ? ((Q = u.label) == null ? void 0 : Q.trim()) || ((K = u.name) == null ? void 0 : K.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}`;
3418
+ }
3419
+ function D() {
3420
+ const u = Array.isArray(e.model.metrics) ? e.model.metrics : [];
3421
+ if (!e.model.isBlend)
3422
+ return u;
3423
+ const _ = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
3424
+ (y) => Array.isArray(y == null ? void 0 : y.metrics) ? y.metrics : []
3425
+ ) : [];
3426
+ return [...u, ..._];
3427
+ }
3428
+ function O(u) {
3429
+ if (u === se.metric) {
3430
+ const _ = D();
3431
+ if (_.length > 0)
3432
+ return _.map((y, Q) => f(y, Q));
3433
+ }
3434
+ return fe.map(
3435
+ (_, y) => `${o("report.section.datasource.lineStyle.series")} ${y + 1}`
3436
+ );
3437
+ }
3438
+ const i = C(() => [
3439
+ {
3440
+ label: o("report.section.datasource.lineStyle.solid"),
3441
+ value: "solid"
3442
+ },
3443
+ {
3444
+ label: o("report.section.datasource.lineStyle.dashed"),
3445
+ value: "dashed"
3446
+ },
3447
+ {
3448
+ label: o("report.section.datasource.lineStyle.dotted"),
3449
+ value: "dotted"
3450
+ }
3451
+ ]);
3452
+ function r(u) {
3453
+ return u && typeof u == "object" && "value" in u ? r(u.value) : u === "dashed" || u === "DASHED" ? "dashed" : u === "dotted" || u === "DOTTED" ? "dotted" : "solid";
3454
+ }
3455
+ function g(u) {
3456
+ return u === "dashed" ? "line-style-icon--dashed" : u === "dotted" ? "line-style-icon--dotted" : "line-style-icon--solid";
3457
+ }
3458
+ function F(u, _) {
3459
+ return !Array.isArray(u) || u.length === 0 ? Array.from({ length: _ }).map(
3460
+ (y, Q) => wl[Q] ?? "solid"
3461
+ ) : Array.from({ length: _ }).map(
3462
+ (y, Q) => r(u[Q])
3463
+ );
3464
+ }
3465
+ const L = C(
3466
+ () => v(e.model.lineStyleBinding)
3467
+ ), d = C(() => O(A.value)), w = C(
3468
+ () => F(e.model.lineStyles, O(L.value).length)
3469
+ ), R = ae([]), A = ae(se.series);
3470
+ xe(
3471
+ [
3472
+ () => e.model.lineStyles,
3473
+ () => e.model.lineStyleBinding,
3474
+ () => e.model.metrics,
3475
+ () => e.model.isBlend,
3476
+ () => e.model.joinDatasources
3477
+ ],
3478
+ ([u, _]) => {
3479
+ A.value = v(_), R.value = F(
3480
+ u,
3481
+ O(A.value).length
3482
+ );
3483
+ },
3484
+ { immediate: !0, deep: !0 }
3485
+ );
3486
+ const b = C(() => A.value !== L.value || R.value.length !== w.value.length ? !0 : R.value.some((u, _) => u !== w.value[_]));
3487
+ function s(u, _) {
3488
+ const y = [...R.value];
3489
+ y[u] = r(_), R.value = y;
3490
+ }
3491
+ function V(u) {
3492
+ const _ = v(u);
3493
+ if (_ === A.value)
3494
+ return;
3495
+ const y = O(_).length;
3496
+ A.value = _, R.value = F(R.value, y);
3497
+ }
3498
+ function N() {
3499
+ A.value = se.series, R.value = [...wl];
3500
+ }
3501
+ function T() {
3502
+ const u = A.value === se.series, _ = R.value.every((y) => y === "solid");
3503
+ a("update:model", {
3504
+ ...e.model,
3505
+ lineStyleBinding: u ? void 0 : A.value,
3506
+ lineStyles: _ ? void 0 : [...R.value]
3507
+ });
3508
+ }
3509
+ return (u, _) => {
3510
+ const y = M("FmButton"), Q = M("FmSelect");
3511
+ return c(), P("div", Eo, [
3512
+ h("div", Wo, [
3513
+ h("p", Xo, J(l(o)("report.section.datasource.lineStyle.title")), 1),
3514
+ h("div", Ho, [
3515
+ m(y, {
3516
+ variant: "tertiary",
3517
+ "text-color": "text-fm-color-system-info-300",
3518
+ size: "md",
3519
+ label: l(o)("report.section.datasource.lineStyle.reset"),
3520
+ onClick: N
3521
+ }, null, 8, ["label"])
3522
+ ])
3523
+ ]),
3524
+ m(Q, {
3525
+ "model-value": A.value,
3526
+ items: S.value,
3527
+ label: l(o)("report.section.datasource.styleTarget.title"),
3528
+ "onUpdate:modelValue": V
3529
+ }, null, 8, ["model-value", "items", "label"]),
3530
+ h("div", qo, [
3531
+ (c(!0), P(de, null, Se(R.value, (K, j) => (c(), P("div", {
3532
+ key: j,
3533
+ class: "flex items-center justify-between gap-8 rounded-md border border-fm-color-neutral-gray-100 px-8 py-6"
3534
+ }, [
3535
+ h("div", Go, [
3536
+ h("span", {
3537
+ class: Fe(["line-style-icon", g(K)]),
3538
+ "aria-hidden": "true"
3539
+ }, null, 2),
3540
+ h("span", Yo, J(d.value[j] || `${l(o)("report.section.datasource.lineStyle.line")} ${j + 1}`), 1)
3541
+ ]),
3542
+ m(Q, {
3543
+ "model-value": K,
3544
+ items: i.value,
3545
+ class: "w-[130px]",
3546
+ "onUpdate:modelValue": (W) => s(j, W)
3547
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
3548
+ ]))), 128))
3549
+ ]),
3550
+ m(y, {
3551
+ size: "md",
3552
+ label: l(o)("report.common.apply"),
3553
+ disabled: !b.value,
3554
+ onClick: T
3555
+ }, null, 8, ["label", "disabled"])
3556
+ ]);
3557
+ };
3558
+ }
3559
+ }), Ko = /* @__PURE__ */ Bl(Jo, [["__scopeId", "data-v-f1c35513"]]), Qo = { class: "flex flex-col gap-16" }, Zo = {
3560
+ key: 1,
3561
+ class: "h-px w-full bg-fm-color-neutral-gray-100"
3562
+ }, ea = { class: "flex flex-col gap-8" }, la = { class: "fm-typo-en-body-lg-600" }, ta = { class: "flex flex-col gap-8" }, oa = /* @__PURE__ */ me({
3563
+ __name: "StyleDatasource",
3564
+ props: /* @__PURE__ */ ve({
3565
+ label: {
3566
+ type: String,
3567
+ default: "Label"
3568
+ },
3569
+ config: {
3570
+ type: Object,
3571
+ default: null
3572
+ },
3573
+ closeable: {
3574
+ type: Boolean,
3575
+ default: !1
3576
+ },
3577
+ mainDatasourceConfig: {
3578
+ type: Object,
3579
+ default: () => {
3580
+ }
3581
+ },
3582
+ modelValue: {
3583
+ type: Object,
3584
+ default: () => {
3585
+ }
3586
+ }
3587
+ }, {
3588
+ modelValue: { required: !0 },
3589
+ modelModifiers: {}
3590
+ }),
3591
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
3592
+ setup(B, { emit: p }) {
3593
+ const e = ge(B, "modelValue");
3594
+ xe(
3595
+ [() => e.value.dimensions, () => e.value.metrics],
3596
+ () => {
3597
+ const { rowIds: r, columnIds: g } = Qe(e.value);
3598
+ e.value.rowIds = r, e.value.columnIds = g;
3599
+ },
3600
+ { deep: !0 }
3601
+ );
3602
+ const a = B, o = p, { t: S } = pe(), v = C(() => a.config.type === Y.Circular), f = C(
3603
+ () => a.config.type === Y.StackBarChart || a.config.type === Y.ClusteredStackBarChart
3604
+ ), D = C(
3605
+ () => a.config.type === Y.LineChart || a.config.type === Y.StackLineChart
3606
+ ), O = C({
3607
+ get: () => e.value.maxTooltipItems ?? null,
3608
+ set: (r) => {
3609
+ e.value = {
3610
+ ...e.value,
3611
+ maxTooltipItems: r ?? void 0
3612
+ };
3613
+ }
3614
+ }), i = C({
3615
+ get: () => e.value.stackBarOverlap ?? !1,
3616
+ set: (r) => {
3617
+ e.value = {
3618
+ ...e.value,
3619
+ stackBarOverlap: r
3620
+ };
3621
+ }
3622
+ });
3623
+ return (r, g) => {
3624
+ const F = M("FmButton"), L = M("FmCheckbox"), d = M("FmStepperField");
3625
+ return c(), P(de, null, [
3626
+ g[9] || (g[9] = h("div", { class: "grow" }, null, -1)),
3627
+ a.closeable ? (c(), I(F, {
3628
+ key: 0,
3629
+ icon: "close",
3630
+ variant: "tertiary",
3631
+ size: "md",
3632
+ onClick: g[0] || (g[0] = he((w) => o("click-close"), ["stop"]))
3633
+ })) : z("", !0),
3634
+ h("div", Qo, [
3635
+ a.config.hasChart ? (c(), I(Po, {
3636
+ key: 0,
3637
+ model: e.value,
3638
+ "show-layer-control": f.value && i.value,
3639
+ "limit-to-series-mode": v.value,
3640
+ "onUpdate:model": g[1] || (g[1] = (w) => e.value = w)
3641
+ }, null, 8, ["model", "show-layer-control", "limit-to-series-mode"])) : z("", !0),
3642
+ a.config.hasChart && D.value ? (c(), P("div", Zo)) : z("", !0),
3643
+ a.config.hasChart && D.value ? (c(), I(Ko, {
3644
+ key: 2,
3645
+ model: e.value,
3646
+ "onUpdate:model": g[2] || (g[2] = (w) => e.value = w)
3647
+ }, null, 8, ["model"])) : z("", !0),
3648
+ g[8] || (g[8] = h("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
3649
+ h("div", ea, [
3650
+ h("p", la, J(l(S)("report.section.style.configuration")), 1),
3651
+ h("div", ta, [
3652
+ f.value ? (c(), I(L, {
3653
+ key: 0,
3654
+ modelValue: i.value,
3655
+ "onUpdate:modelValue": g[3] || (g[3] = (w) => i.value = w),
3656
+ class: "fm-typo-en-body-lg-400",
3657
+ label: l(S)("report.section.datasource.stackBar.overlapBars")
3658
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
3659
+ a.config.hasLabel ? (c(), I(io, {
3660
+ key: 1,
3661
+ model: e.value,
3662
+ "onUpdate:model": g[4] || (g[4] = (w) => e.value = w)
3663
+ }, null, 8, ["model"])) : z("", !0),
3664
+ a.config.hasLegend ? (c(), I(Co, {
3665
+ key: 2,
3666
+ model: e.value,
3667
+ "is-circular-widget": v.value,
3668
+ "onUpdate:model": g[5] || (g[5] = (w) => e.value = w)
3669
+ }, null, 8, ["model", "is-circular-widget"])) : z("", !0),
3670
+ a.config.hasXy ? (c(), I(fo, {
3671
+ key: 3,
3672
+ model: e.value,
3673
+ "onUpdate:model": g[6] || (g[6] = (w) => e.value = w)
3674
+ }, null, 8, ["model"])) : z("", !0),
3675
+ a.config.hasXy ? (c(), I(d, {
3676
+ key: 4,
3677
+ modelValue: O.value,
3678
+ "onUpdate:modelValue": g[7] || (g[7] = (w) => O.value = w),
3679
+ type: "number",
3680
+ label: l(S)("report.section.datasource.tooltip.maxTooltipItems"),
3681
+ min: 2,
3682
+ max: 20,
3683
+ placeholder: "Auto"
3684
+ }, null, 8, ["modelValue", "label"])) : z("", !0)
3685
+ ])
3686
+ ])
3687
+ ])
3688
+ ], 64);
3689
+ };
3690
+ }
3691
+ }), aa = { class: "flex flex-col gap-8" }, na = { class: "flex flex-col border-fm-color-neutral-gray-200 p-12" }, ia = { class: "flex items-center" }, ra = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, sa = { class: "flex flex-col gap-8" }, ua = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, da = { class: "flex flex-col border-fm-color-neutral-gray-200 p-12" }, ma = { class: "flex items-center" }, ca = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, pa = {
3692
+ key: 0,
3693
+ class: "flex flex-col gap-8"
3694
+ }, va = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, fa = {
3695
+ key: 1,
3696
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
3697
+ }, ga = /* @__PURE__ */ me({
3698
+ __name: "TableResizeSection",
3699
+ props: {
3700
+ layout: {},
3701
+ columns: {}
3702
+ },
3703
+ emits: ["update:layout"],
3704
+ setup(B, { emit: p }) {
3705
+ const { t: e } = pe(), a = B, o = p, S = C({
3706
+ get: () => {
3707
+ var g;
3708
+ return (g = a.layout) != null && g.rowHeight && a.layout.rowHeight >= 30 ? a.layout.rowHeight : null;
3709
+ },
3710
+ set: (g) => {
3711
+ var F;
3712
+ o("update:layout", {
3713
+ ...a.layout,
3714
+ rowHeight: g && g >= 30 ? g : null,
3715
+ colWidths: f((F = a.layout) == null ? void 0 : F.colWidths)
3716
+ });
3717
+ }
3718
+ }), v = C(() => {
3719
+ var g;
3720
+ return ((g = a.columns) == null ? void 0 : g.length) ?? 0;
3721
+ });
3722
+ function f(g) {
3723
+ if (!g) return null;
3724
+ const F = Object.entries(g).reduce(
3725
+ (L, d) => {
3726
+ const [w, R] = d;
3727
+ return R && R >= 40 ? L[w] = R : L[w] = null, L;
3728
+ },
3729
+ {}
3730
+ );
3731
+ return Object.values(F).some((L) => (L ?? 0) >= 40) ? F : null;
3732
+ }
3733
+ function D(g) {
3734
+ var F;
3735
+ return (F = a.columns) == null ? void 0 : F[g];
3736
+ }
3737
+ function O(g, F) {
3738
+ const L = F && F >= 40 ? F : null, d = { ...a.layout.colWidths ?? {} }, w = D(g);
3739
+ w != null && w.key && (d[w.key] = L), o("update:layout", {
3740
+ ...a.layout,
3741
+ rowHeight: S.value ?? null,
3742
+ colWidths: f(d)
3743
+ });
3744
+ }
3745
+ function i(g) {
3746
+ var d, w;
3747
+ const F = D(g), L = F != null && F.key ? (w = (d = a.layout) == null ? void 0 : d.colWidths) == null ? void 0 : w[F.key] : void 0;
3748
+ return L && L >= 40 ? L : null;
3749
+ }
3750
+ function r(g) {
3751
+ var F;
3752
+ return ((F = D(g)) == null ? void 0 : F.label) || "Column " + (g + 1);
3753
+ }
3754
+ return (g, F) => {
3755
+ const L = M("FmStepperField");
3756
+ return c(), P("div", aa, [
3757
+ h("div", na, [
3758
+ h("div", ia, [
3759
+ h("p", ra, J(l(e)("report.section.datasource.rowHeight")), 1)
3760
+ ]),
3761
+ h("div", sa, [
3762
+ h("p", ua, J(l(e)("report.section.datasource.rowHeightHelper")), 1),
3763
+ m(L, {
3764
+ modelValue: S.value,
3765
+ "onUpdate:modelValue": F[0] || (F[0] = (d) => S.value = d),
3766
+ type: "number",
3767
+ suffix: "px",
3768
+ min: 30,
3769
+ placeholder: l(e)("report.common.auto")
3770
+ }, null, 8, ["modelValue", "placeholder"])
3771
+ ])
3772
+ ]),
3773
+ h("div", da, [
3774
+ h("div", ma, [
3775
+ h("p", ca, J(l(e)("report.section.datasource.columnWidth")), 1)
3776
+ ]),
3777
+ v.value > 0 ? (c(), P("div", pa, [
3778
+ h("p", va, J(l(e)("report.section.datasource.columnWidthHelper")), 1),
3779
+ (c(!0), P(de, null, Se(v.value, (d) => (c(), I(L, {
3780
+ key: r(d - 1),
3781
+ type: "number",
3782
+ "model-value": i(d - 1),
3783
+ label: r(d - 1),
3784
+ suffix: "px",
3785
+ min: 40,
3786
+ placeholder: l(e)("report.common.auto"),
3787
+ "onUpdate:modelValue": (w) => O(d - 1, Number(w) || null)
3788
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]))), 128))
3789
+ ])) : (c(), P("p", fa, J(l(e)("report.section.datasource.columnWidthUnavailable")), 1))
3790
+ ])
3791
+ ]);
3792
+ };
3793
+ }
3794
+ }), ya = {
3795
+ key: 0,
3796
+ class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]"
3797
+ }, ba = {
3798
+ key: 1,
3799
+ class: "px-6 py-16 flex flex-col overflow-y-auto overflow-x-hidden"
3800
+ }, ha = { class: "text-center" }, wa = /* @__PURE__ */ me({
3801
+ __name: "StyleEditorTab",
3802
+ props: /* @__PURE__ */ ve({
3803
+ tableResponse: {}
3804
+ }, {
3805
+ modelValue: {
3806
+ required: !0
3807
+ },
3808
+ modelModifiers: {},
3809
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
3810
+ isEditingStyleModifiers: {}
3811
+ }),
3812
+ emits: ["update:modelValue", "update:isEditingStyle"],
3813
+ setup(B) {
3814
+ const { t: p, locale: e } = pe(), a = ge(B, "modelValue"), o = C(
3815
+ () => ll.find((b) => b.type === a.value.widget.type)
3816
+ ), S = ge(B, "isEditingStyle"), v = ae(!1), { markStyleEditing: f, resetStyleEditing: D } = Ll(S), O = B, i = [
3817
+ Y.BarChart,
3818
+ Y.StackBarChart,
3819
+ Y.ClusteredStackBarChart,
3820
+ Y.LineChart,
3821
+ Y.StackLineChart,
3822
+ Y.Circular
3823
+ ], r = C(() => i.includes(a.value.widget.type)), g = C(() => a.value.widget.type === Y.Table), F = C(() => e.value.toLowerCase().startsWith("en")), L = C({
3824
+ get: () => ({
3825
+ rowHeight: a.value.widget.config.rowHeight,
3826
+ colWidths: a.value.widget.config.colWidths
3827
+ }),
3828
+ set: (b) => {
3829
+ f(), a.value.widget.config.rowHeight = b.rowHeight, a.value.widget.config.colWidths = b.colWidths;
3830
+ }
3831
+ }), d = C({
3832
+ get: () => a.value.widget.config,
3833
+ set: (b) => {
3834
+ f(), a.value.widget.config = b;
3835
+ }
3836
+ }), w = C(() => {
3837
+ var b, s;
3838
+ return g.value ? ((s = (b = O.tableResponse) == null ? void 0 : b.columns) == null ? void 0 : s.map((V) => ({
3839
+ key: V.key,
3840
+ label: V.label
3841
+ }))) ?? [] : [];
3842
+ });
3843
+ function R() {
3844
+ v.value = !0;
3845
+ }
3846
+ function A() {
3847
+ v.value = !1, D();
3848
+ }
3849
+ return (b, s) => {
3850
+ const V = M("FmCircularProgress"), N = M("FmButton");
3851
+ return v.value ? (c(), P("div", ya, [
3852
+ m(Ze, {
3853
+ "model-value": v.value,
3854
+ icon: "keyboard_double_arrow_right",
3855
+ title: l(p)("report.section.style.title"),
3856
+ "onUpdate:modelValue": s[0] || (s[0] = (T) => T ? R() : A())
3857
+ }, null, 8, ["model-value", "title"]),
3858
+ a.value ? (c(), P("div", ba, [
3859
+ r.value ? (c(), I(oa, {
3860
+ key: 0,
3861
+ modelValue: d.value,
3862
+ "onUpdate:modelValue": s[1] || (s[1] = (T) => d.value = T),
3863
+ config: o.value
3864
+ }, null, 8, ["modelValue", "config"])) : z("", !0),
3865
+ g.value ? (c(), I(ga, {
3866
+ key: 1,
3867
+ layout: L.value,
3868
+ "onUpdate:layout": s[2] || (s[2] = (T) => L.value = T),
3869
+ columns: w.value
3870
+ }, null, 8, ["layout", "columns"])) : z("", !0)
3871
+ ])) : (c(), I(V, { key: 0 }))
3872
+ ])) : (c(), P("div", {
3873
+ key: 1,
3874
+ class: Fe([
3875
+ "bg-fm-color-neutral-white pt-16",
3876
+ F.value ? "flex h-full w-[156px] flex-col items-center justify-start gap-12 px-12" : "flex h-full w-[88px] flex-col items-center justify-start gap-16"
3877
+ ])
3878
+ }, [
3879
+ F.value ? (c(), P("button", {
3880
+ key: 0,
3881
+ class: "flex flex-col items-center gap-16 fm-typo-en-title-sm-600 text-fm-color-typo-primary",
3882
+ type: "button",
3883
+ onClick: R
3884
+ }, [
3885
+ m(N, {
3886
+ variant: "secondary",
3887
+ icon: "keyboard_double_arrow_left",
3888
+ "border-color": l(Ue).ColorPrimary,
3889
+ "text-color": l(Ue).ColorPrimary,
3890
+ size: "md"
3891
+ }, null, 8, ["border-color", "text-color"]),
3892
+ h("span", ha, J(l(p)("report.section.style.title")), 1)
3893
+ ])) : (c(), P(de, { key: 1 }, [
3894
+ m(N, {
3895
+ variant: "secondary",
3896
+ icon: "keyboard_double_arrow_left",
3897
+ "border-color": l(Ue).ColorPrimary,
3898
+ "text-color": l(Ue).ColorPrimary,
3899
+ size: "md",
3900
+ onClick: R
3901
+ }, null, 8, ["border-color", "text-color"]),
3902
+ h("button", {
3903
+ class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary [text-orientation:mixed] [writing-mode:vertical-rl]",
3904
+ type: "button",
3905
+ onClick: R
3906
+ }, J(l(p)("report.section.style.title")), 1)
3907
+ ], 64))
3908
+ ], 2));
3909
+ };
3910
+ }
3911
+ }), Ca = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]" }, xa = { class: "text-center" }, ka = { class: "w-full overflow-y-auto" }, Fa = {
3912
+ class: "grid grid-cols-12 w-full p-24",
3913
+ style: { backgroundColor: "#F6F8FC" }
3914
+ }, Va = /* @__PURE__ */ me({
3915
+ __name: "TileEditorDesktop",
3916
+ props: /* @__PURE__ */ ve({
3917
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
3918
+ index: { type: Number, required: !0, default: 0 }
3919
+ }, {
3920
+ modelValue: {
3921
+ required: !0
3922
+ },
3923
+ modelModifiers: {}
3924
+ }),
3925
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
3926
+ setup(B, { emit: p }) {
3927
+ const { locale: e, t: a } = pe(), o = ge(B, "modelValue"), S = B, v = C(
3928
+ () => ll.find((L) => {
3929
+ var d, w;
3930
+ return L.type === ((w = (d = o.value) == null ? void 0 : d.widget) == null ? void 0 : w.type);
3931
+ })
3932
+ ), f = p, O = [...[
3933
+ Y.BarChart,
3934
+ Y.StackBarChart,
3935
+ Y.ClusteredStackBarChart,
3936
+ Y.LineChart,
3937
+ Y.StackLineChart,
3938
+ Y.Circular
3939
+ ], Y.Table], i = C(() => O.includes(o.value.widget.type)), r = ae(!1), g = ae(null), F = C(() => e.value.toLowerCase().startsWith("en"));
3940
+ return (L, d) => {
3941
+ const w = M("FmCircularProgress"), R = M("FmButton");
3942
+ return c(), P("div", null, [
3943
+ o.value ? (c(), P(de, { key: 1 }, [
3944
+ m(Yl, {
3945
+ "model-value": !B.hideConfiguration
3946
+ }, {
3947
+ right: ee(() => [
3948
+ h("div", Ca, [
3949
+ m(Al, {
3950
+ modelValue: o.value,
3951
+ "onUpdate:modelValue": d[0] || (d[0] = (A) => o.value = A),
3952
+ "is-editing-style": r.value,
3953
+ "onUpdate:isEditingStyle": d[1] || (d[1] = (A) => r.value = A),
3954
+ config: v.value,
3955
+ "hide-configuration": B.hideConfiguration,
3956
+ onHideConfiguration: d[2] || (d[2] = (A) => {
3957
+ f("hideConfiguration", A);
3958
+ })
3959
+ }, null, 8, ["modelValue", "is-editing-style", "config", "hide-configuration"])
3960
+ ])
3961
+ ]),
3962
+ left: ee(() => [
3963
+ h("div", {
3964
+ class: Fe([
3965
+ "bg-fm-color-neutral-white pt-16",
3966
+ F.value ? "flex h-full w-[156px] flex-col items-center justify-start gap-12 px-12" : "flex h-full w-[88px] flex-col items-center justify-start gap-16"
3967
+ ])
3968
+ }, [
3969
+ F.value ? (c(), P("button", {
3970
+ key: 0,
3971
+ class: "flex flex-col items-center gap-16 fm-typo-en-title-sm-600 text-fm-color-typo-primary",
3972
+ type: "button",
3973
+ onClick: d[3] || (d[3] = (A) => f("hideConfiguration", !S.hideConfiguration))
3974
+ }, [
3975
+ m(R, {
3976
+ variant: "secondary",
3977
+ icon: "keyboard_double_arrow_right",
3978
+ "border-color": l(Ue).ColorPrimary,
3979
+ "text-color": l(Ue).ColorPrimary,
3980
+ size: "md"
3981
+ }, null, 8, ["border-color", "text-color"]),
3982
+ h("span", xa, J(l(a)("report.tile.setupSetting")), 1)
3983
+ ])) : (c(), P(de, { key: 1 }, [
3984
+ m(R, {
3985
+ variant: "secondary",
3986
+ icon: "keyboard_double_arrow_right",
3987
+ "border-color": l(Ue).ColorPrimary,
3988
+ "text-color": l(Ue).ColorPrimary,
3989
+ size: "md",
3990
+ onClick: d[4] || (d[4] = (A) => f("hideConfiguration", !S.hideConfiguration))
3991
+ }, null, 8, ["border-color", "text-color"]),
3992
+ h("button", {
3993
+ class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary [text-orientation:mixed] [writing-mode:vertical-rl]",
3994
+ type: "button",
3995
+ onClick: d[5] || (d[5] = (A) => f("hideConfiguration", !S.hideConfiguration))
3996
+ }, J(l(a)("report.tile.setupSetting")), 1)
3997
+ ], 64))
3998
+ ], 2)
3999
+ ]),
4000
+ _: 1
4001
+ }, 8, ["model-value"]),
4002
+ h("div", ka, [
4003
+ h("div", Fa, [
4004
+ o.value ? (c(), I(Dl, {
4005
+ key: 0,
4006
+ "model-value": o.value,
4007
+ index: S.index,
4008
+ "is-tile-editor": !0,
4009
+ "hide-export": !0,
4010
+ "is-editing-style": r.value,
4011
+ "onUpdate:tableResponse": d[6] || (d[6] = (A) => g.value = A)
4012
+ }, null, 8, ["model-value", "index", "is-editing-style"])) : (c(), I(Ul, { key: 1 }))
4013
+ ])
4014
+ ]),
4015
+ i.value ? (c(), I(wa, {
4016
+ key: 0,
4017
+ modelValue: o.value,
4018
+ "onUpdate:modelValue": d[7] || (d[7] = (A) => o.value = A),
4019
+ "is-editing-style": r.value,
4020
+ "onUpdate:isEditingStyle": d[8] || (d[8] = (A) => r.value = A),
4021
+ "table-response": g.value
4022
+ }, null, 8, ["modelValue", "is-editing-style", "table-response"])) : z("", !0)
4023
+ ], 64)) : (c(), I(w, { key: 0 }))
4024
+ ]);
4025
+ };
4026
+ }
4027
+ }), Sa = {
4028
+ key: 0,
4029
+ class: "flex w-full justify-center items-center"
4030
+ }, _a = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, Ta = /* @__PURE__ */ me({
4031
+ __name: "TileEditorMobile",
4032
+ props: /* @__PURE__ */ ve({
4033
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
4034
+ index: { type: Number, required: !0, default: 0 }
4035
+ }, {
4036
+ modelValue: {
4037
+ required: !0
4038
+ },
4039
+ modelModifiers: {}
4040
+ }),
4041
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
4042
+ setup(B, { emit: p }) {
4043
+ const e = ge(B, "modelValue"), a = B, o = C(
4044
+ () => ll.find((v) => {
4045
+ var f, D;
4046
+ return v.type === ((D = (f = e.value) == null ? void 0 : f.widget) == null ? void 0 : D.type);
4047
+ })
4048
+ ), S = p;
4049
+ return (v, f) => {
4050
+ const D = M("FmCircularProgress");
4051
+ return c(), P("div", null, [
4052
+ e.value ? (c(), P(de, { key: 1 }, [
4053
+ h("div", _a, [
4054
+ e.value ? (c(), I(Dl, {
4055
+ key: 0,
4056
+ "model-value": e.value,
4057
+ index: a.index,
4058
+ "is-tile-editor": !0,
4059
+ "hide-export": !0
4060
+ }, null, 8, ["model-value", "index"])) : (c(), I(Ul, { key: 1 }))
4061
+ ]),
4062
+ m(Al, {
4063
+ modelValue: e.value,
4064
+ "onUpdate:modelValue": f[0] || (f[0] = (O) => e.value = O),
4065
+ config: o.value,
4066
+ "hide-configuration": B.hideConfiguration,
4067
+ onHideConfiguration: f[1] || (f[1] = (O) => {
4068
+ S("hideConfiguration", O);
4069
+ })
4070
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
4071
+ ], 64)) : (c(), P("div", Sa, [
4072
+ m(D)
4073
+ ]))
4074
+ ]);
4075
+ };
4076
+ }
4077
+ }), $a = {
4078
+ key: 0,
4079
+ class: "fm-typo-en-title-md-600"
4080
+ }, Da = {
4081
+ key: 0,
4082
+ class: "flex items-start justify-start px-24 py-12 flex-wrap w-full"
4083
+ }, Wa = /* @__PURE__ */ me({
4084
+ __name: "TileEditor",
4085
+ setup(B) {
4086
+ const p = Xl(), e = Hl(), a = _l(), { globalFilters: o } = Re(Ql()), { currentSelectWidgetType: S, editingReport: v, editingTile: f, editingTileIndex: D } = Re(a), { breakpoints: O } = $l(), { promptMessage: i } = Tl(), { t: r, te: g } = pe(), F = C(() => {
4087
+ var s, V;
4088
+ const A = (V = (s = f.value) == null ? void 0 : s.widget) == null ? void 0 : V.type;
4089
+ if (!A)
4090
+ return r("report.editor.newReport");
4091
+ const b = `report.widget.types.${A.toLowerCase()}`;
4092
+ return g(b) ? r(b) : A;
4093
+ }), L = ae(!1);
4094
+ function d() {
4095
+ S.value = void 0, f.value = void 0, D.value = -1, gl.value = null, e.back();
4096
+ }
4097
+ async function w() {
4098
+ var b, s;
4099
+ if (!v.value) return;
4100
+ if (await i({
4101
+ title: r("report.tile.save.title"),
4102
+ message: r("report.tile.save.confirm", { title: ((s = (b = f.value) == null ? void 0 : b.widget) == null ? void 0 : s.title) ?? "" })
4103
+ }) && f.value) {
4104
+ const V = et(v.value.tiles, gl.value);
4105
+ D.value === -1 ? V.push(f.value) : V[D.value] = f.value, d();
4106
+ }
4107
+ }
4108
+ async function R() {
4109
+ var b, s;
4110
+ if (!v.value) return;
4111
+ await i({
4112
+ title: r("report.tile.cancel.title"),
4113
+ message: r("report.tile.cancel.confirm", { title: ((s = (b = f.value) == null ? void 0 : b.widget) == null ? void 0 : s.title) ?? "" })
4114
+ }) && d();
4115
+ }
4116
+ return Vl(() => {
4117
+ v.value || e.push({ name: "reports" });
4118
+ }), (A, b) => {
4119
+ const s = M("FmPageHead");
4120
+ return c(), I(Jl, null, {
4121
+ default: ee(() => [
4122
+ m(s, {
4123
+ actions: [
4124
+ { label: l(r)("report.common.cancel"), value: "cancel", isPrimary: !1 },
4125
+ { label: l(r)("report.common.save"), value: "save", isPrimary: !0 }
4126
+ ],
4127
+ "onClick:action": b[0] || (b[0] = (V) => {
4128
+ V === "cancel" && R(), V === "save" && w();
4129
+ })
4130
+ }, {
4131
+ title: ee(() => [
4132
+ l(O).lg || l(O).md ? (c(), P("p", $a, J(F.value), 1)) : z("", !0)
4133
+ ]),
4134
+ _: 1
4135
+ }, 8, ["actions"]),
4136
+ l(f) && (l(o) || []).some((V) => {
4137
+ const N = V.tileIds, T = l(f) && l(f).id;
4138
+ return Array.isArray(N) && typeof T == "string" && N.includes(T);
4139
+ }) ? (c(), P("div", Da, [
4140
+ m(Zl)
4141
+ ])) : z("", !0),
4142
+ l(f) ? (c(), I(Fl(l(O).lg || l(O).md ? Va : Ta), {
4143
+ key: 1,
4144
+ modelValue: l(f),
4145
+ "onUpdate:modelValue": b[1] || (b[1] = (V) => Wl(f) ? f.value = V : null),
4146
+ class: Fe(`${l(O).lg || l(O).md ? "flex" : ""} w-full`),
4147
+ style: il({ height: `calc( 100% - ${l(O).lg || l(O).md ? 72 : 64}px)` }),
4148
+ "hide-configuration": L.value,
4149
+ index: Number(l(p).params.tileIndex),
4150
+ onHideConfiguration: b[2] || (b[2] = (V) => L.value = V)
4151
+ }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : z("", !0)
4152
+ ]),
4153
+ _: 1
4154
+ });
4155
+ };
4156
+ }
4157
+ });
4158
+ export {
4159
+ Wa as default
4160
+ };