@feedmepos/mf-report 5.31.1-beta.0 → 5.31.2-beta.0

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