@feedmepos/mf-report 5.27.35 → 5.27.36

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