@agile-team/mach-report 2.12.0 → 2.14.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 (97) hide show
  1. package/README.md +27 -3
  2. package/dist/ExcelBindingWizard-CLT2p7P3.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CvsWR8Ga.js +1485 -0
  4. package/dist/{ParamEditor-BLaE5q5W.js → ParamEditor-CflQV3eQ.js} +191 -187
  5. package/dist/ParamEditor-vIDzvpPV.cjs +1 -0
  6. package/dist/ReportBatchPanel-DkxTzBkD.cjs +1 -0
  7. package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-LqVgiqp7.js} +3 -3
  8. package/dist/ReportPreview-CvbqLUzM.cjs +6 -0
  9. package/dist/ReportPreview-D_ywJ_-H.js +4533 -0
  10. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-MjWEtc7X.js} +1 -1
  11. package/dist/ReportTemplateLibrary-cQ1sqNYo.cjs +1 -0
  12. package/dist/RuleEditor-BaR6xUiI.cjs +1 -0
  13. package/dist/RuleEditor-ChuXMlei.js +2037 -0
  14. package/dist/TemplateOutlinePanel-BHKP89Xz.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-Dci6aRn1.js +96 -0
  16. package/dist/TemplateReusePanel-B7Gmyc1z.js +388 -0
  17. package/dist/TemplateReusePanel-CY5eO2Sh.cjs +1 -0
  18. package/dist/TemplateReviewPanel-DjlX3xpt.js +592 -0
  19. package/dist/TemplateReviewPanel-JvZe9_4G.cjs +1 -0
  20. package/dist/{batch-mRqhhhjt.js → batch-DzaTNLWI.js} +23 -16
  21. package/dist/batch-xMkqYiTr.cjs +1 -0
  22. package/dist/config-0UIohTS7.cjs +1 -0
  23. package/dist/{config-B612mw0x.js → config-Dt9NtCPl.js} +227 -186
  24. package/dist/data-explanation-BktvER5B.cjs +1 -0
  25. package/dist/data-explanation-C_J6jYNi.js +16 -0
  26. package/dist/designer-Ci1LizA9.js +5020 -0
  27. package/dist/designer-rtmVIIdN.cjs +2 -0
  28. package/dist/designer.cjs +1 -2
  29. package/dist/designer.d.cts +306 -3
  30. package/dist/designer.d.ts +306 -3
  31. package/dist/designer.js +21 -4266
  32. package/dist/font-loader-DHto6Lra.js +297 -0
  33. package/dist/font-loader-vhCT8znW.cjs +1 -0
  34. package/dist/index.cjs +8 -8
  35. package/dist/index.d.cts +182 -1
  36. package/dist/index.d.ts +182 -1
  37. package/dist/index.js +728 -628
  38. package/dist/{template-review-BzpcI-tR.js → json-snapshot-BeFT3Tso.js} +867 -637
  39. package/dist/json-snapshot-D1NTP2oI.cjs +2 -0
  40. package/dist/pdf-8UPQebOE.js +36288 -0
  41. package/dist/pdf-AyJGb22z.cjs +101 -0
  42. package/dist/pdf.cjs +1 -101
  43. package/dist/pdf.js +9 -36579
  44. package/dist/plugin-BGKf-Tqg.js +22 -0
  45. package/dist/{plugin-BDTU4D94.cjs → plugin-CktLH_Iy.cjs} +1 -1
  46. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-DEJbhpCv.js} +1 -1
  47. package/dist/server/node.d.cts +46 -11
  48. package/dist/server/node.d.ts +46 -11
  49. package/dist/server-node.cjs +1 -1
  50. package/dist/server-node.js +294 -280
  51. package/dist/server.cjs +1 -1
  52. package/dist/server.d.cts +107 -12
  53. package/dist/server.d.ts +107 -12
  54. package/dist/server.js +713 -453
  55. package/dist/style.css +1 -1
  56. package/dist/template-bindings-BJR4k7qZ.cjs +1 -0
  57. package/dist/template-bindings-Daui7hLF.js +252 -0
  58. package/dist/template-fragments-CLkGo6To.js +187 -0
  59. package/dist/template-fragments-DFUpq5QM.cjs +1 -0
  60. package/dist/template-outline-B3xVkzSv.cjs +1 -0
  61. package/dist/template-outline-CFenM1PV.js +88 -0
  62. package/dist/{template-registry-BjE1VS6g.js → template-registry-COXDEJEM.js} +1 -1
  63. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  64. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  65. package/dist/{validate-DbgEM1Hh.js → validate-CkQBWCeg.js} +3 -3
  66. package/dist/vue/async.d.cts +72 -2
  67. package/dist/vue/async.d.ts +72 -2
  68. package/dist/vue/index.d.cts +124 -5
  69. package/dist/vue/index.d.ts +124 -5
  70. package/dist/vue-async.cjs +1 -1
  71. package/dist/vue-async.js +5 -5
  72. package/dist/vue.cjs +1 -1
  73. package/dist/vue.js +78 -71
  74. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BfK1yHOO.js} +1 -1
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +46 -11
  77. package/dist/worker.d.ts +46 -11
  78. package/dist/worker.js +59 -55
  79. package/dist/xlsx.js +3 -3
  80. package/package.json +1 -1
  81. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  82. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  83. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  84. package/dist/ReportBatchPanel-Dc-SDkYA.cjs +0 -1
  85. package/dist/ReportPreview-DWXROHBP.cjs +0 -6
  86. package/dist/ReportPreview-DiNXhQI0.js +0 -4138
  87. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  88. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  89. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  90. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  91. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  92. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  93. package/dist/config-BRoLo2oj.cjs +0 -1
  94. package/dist/plugin-Cd5G2QQn.js +0 -22
  95. package/dist/record-bindings-By_UKZ2g.cjs +0 -1
  96. package/dist/record-bindings-D-5jQlTj.js +0 -196
  97. package/dist/template-review-BfCC8Ng9.cjs +0 -2
@@ -0,0 +1,2037 @@
1
+ import { ref as A, computed as P, watch as ae, defineComponent as re, openBlock as d, createElementBlock as o, createElementVNode as a, withDirectives as k, isRef as ie, vModelCheckbox as se, unref as l, createTextVNode as y, toDisplayString as t, Fragment as w, renderList as S, vModelSelect as E, vModelText as q, createCommentVNode as D, resolveComponent as Fe, normalizeClass as ve, createVNode as ge, createBlock as Me, vShow as Se } from "vue";
2
+ import { i as ce, v as De, d as Re } from "./computed-Bvk0W15F.js";
3
+ import { u as fe, D as Ke } from "./designer-Ci1LizA9.js";
4
+ import { u as oe } from "./useLocalDraft-BnhcxXk_.js";
5
+ import { a as Ee } from "./matrix-yZsGnldA.js";
6
+ import { v as ye } from "./template-registry-COXDEJEM.js";
7
+ import { c as Ne } from "./tree-CqcQ99NM.js";
8
+ import { _ as me } from "./_plugin-vue_export-helper-8SL1F89S.js";
9
+ function he(e, O = /* @__PURE__ */ new Set()) {
10
+ return typeof e == "string" || ("field" in e && e.field && O.add(e.field), "weightField" in e && e.weightField && O.add(e.weightField), "args" in e && e.args.forEach((F) => he(F, O))), O;
11
+ }
12
+ function ke(e, O) {
13
+ return typeof e == "string" ? e : "value" in e ? e.value === null ? O.null : String(e.value) : "aggregate" in e ? `${O[e.aggregate]}(${e.field ?? O.allRows})` : "field" in e ? e.field : `${O[e.op]}(${e.args.map((F) => ke(F, O)).join(", ")})`;
14
+ }
15
+ function Te(e, O, F) {
16
+ const W = A("");
17
+ function V(C) {
18
+ const $ = e.list.columns.find((T) => T.field === C)?.format;
19
+ return $ && "digits" in $ && $.digits !== void 0 ? `${$.digits} ${F.value.digits}` : void 0;
20
+ }
21
+ const m = P(() => {
22
+ const C = /* @__PURE__ */ new Map();
23
+ for (const $ of e.datasetSchema?.fields ?? []) C.set($.field, {
24
+ field: $.field,
25
+ label: $.label ?? $.field,
26
+ meta: [$.type, $.unit, V($.field)].filter(Boolean).join(" · ")
27
+ });
28
+ for (const $ of e.list.columns) C.has($.field) || C.set($.field, { field: $.field, label: $.header || $.field, meta: $.semanticRole ?? "" });
29
+ return [...C.values()];
30
+ }), s = P(() => {
31
+ const C = W.value.trim().toLocaleLowerCase();
32
+ return m.value.filter(($) => `${$.field} ${$.label} ${$.meta}`.toLocaleLowerCase().includes(C));
33
+ }), h = P(() => ke(O.value.expression, F.value)), U = P(() => {
34
+ const C = [...he(O.value.expression)];
35
+ return (e.datasets?.[e.list.dataset] ?? []).slice(0, 5).map(($, T) => ({
36
+ row: T + 1,
37
+ values: C.map((M) => `${M} = ${$[M] == null ? F.value.null : String($[M])}`).join(" · ")
38
+ }));
39
+ });
40
+ return { query: W, matches: s, fieldWindow: P(() => s.value.slice(0, 50)), expression: h, sources: U };
41
+ }
42
+ const le = (e) => JSON.parse(JSON.stringify(e));
43
+ function Le(e, O) {
44
+ const F = A(!1), W = A(""), V = A({
45
+ dataset: "",
46
+ parentKey: "",
47
+ foreignKey: "",
48
+ columns: []
49
+ }), m = A({
50
+ rowFields: [],
51
+ columnFields: [],
52
+ measures: []
53
+ }), s = A({ input: "flat", idField: "id", parentField: "parentId", labelField: "", parentValues: "source" }), h = oe(() => ({ enabled: F.value, detail: V.value, matrix: m.value, tree: s.value }));
54
+ let U;
55
+ const C = A(), $ = P(() => [
56
+ .../* @__PURE__ */ new Set([
57
+ ...Object.keys(e.datasets ?? {}),
58
+ ...Object.keys(e.datasetSchemas ?? {})
59
+ ])
60
+ ]), T = P(
61
+ () => I(e.list.dataset, e.datasetSchema)
62
+ ), M = P(() => I(V.value.dataset));
63
+ function I(c, K) {
64
+ const R = /* @__PURE__ */ new Map();
65
+ for (const B of (K ?? e.datasetSchemas?.[c])?.fields ?? [])
66
+ R.set(B.field, B.label ?? B.field);
67
+ const G = e.datasets?.[c]?.[0];
68
+ for (const B of Object.keys(G ?? {}))
69
+ R.has(B) || R.set(B, B);
70
+ if (c === e.list.dataset)
71
+ for (const B of e.list.columns)
72
+ R.has(B.field) || R.set(B.field, B.header || B.field);
73
+ return [...R].map(([B, p]) => ({ field: B, label: p }));
74
+ }
75
+ function H() {
76
+ if (U === JSON.stringify(e.list)) {
77
+ U = void 0;
78
+ return;
79
+ }
80
+ F.value = !!e.list[e.mode];
81
+ const c = $.value.find((K) => K !== e.list.dataset) ?? "";
82
+ V.value = le(
83
+ e.list.detail ?? {
84
+ dataset: c,
85
+ parentKey: e.list.rowKey ?? e.datasetSchema?.rowKey ?? T.value[0]?.field ?? "",
86
+ foreignKey: "",
87
+ columns: [],
88
+ header: !0,
89
+ unmatched: "error"
90
+ }
91
+ ), m.value = le(
92
+ e.list.matrix ?? {
93
+ rowFields: [],
94
+ columnFields: [],
95
+ measures: [],
96
+ totals: !0
97
+ }
98
+ ), m.value.measures = m.value.measures.map((K) => ({ ...K, numeric: K.numeric ?? "number" })), s.value = le(e.list.tree ?? { input: "flat", idField: e.list.rowKey ?? "id", parentField: "parentId", childrenField: "children", labelField: e.list.columns[0]?.field ?? "", parentValues: "source", orphan: "error", indentMm: 3, maxRows: 1e5, maxDepth: 64 }), W.value = "", C.value = void 0, h.accept();
99
+ }
100
+ ae(() => [e.mode, e.list.dataset, e.list[e.mode]], H, { immediate: !0 });
101
+ function x(c) {
102
+ V.value.dataset = c, V.value.columns = [], V.value.foreignKey = M.value[0]?.field ?? "", V.value.rowKey = e.datasetSchemas?.[c]?.rowKey;
103
+ }
104
+ function u(c, K) {
105
+ if (K && !V.value.columns.some((R) => R.field === c)) {
106
+ const R = e.datasetSchemas?.[V.value.dataset]?.fields.find((G) => G.field === c);
107
+ V.value.columns.push({
108
+ field: c,
109
+ header: M.value.find((G) => G.field === c)?.label ?? c,
110
+ widthMm: 30,
111
+ align: "auto",
112
+ semanticRole: R?.semanticRole,
113
+ editable: !1
114
+ });
115
+ } else K || (V.value.columns = V.value.columns.filter(
116
+ (R) => R.field !== c
117
+ ));
118
+ }
119
+ function i(c, K, R) {
120
+ const G = m.value[c];
121
+ m.value[c] = R ? [.../* @__PURE__ */ new Set([...G, K])] : G.filter((B) => B !== K);
122
+ }
123
+ function r() {
124
+ m.value.measures = [
125
+ ...m.value.measures,
126
+ { field: T.value[0]?.field ?? "", op: "sum", numeric: "number" }
127
+ ];
128
+ }
129
+ function b(c) {
130
+ m.value.measures = m.value.measures.filter(
131
+ (K, R) => R !== c
132
+ );
133
+ }
134
+ function j() {
135
+ s.value.aggregates = [...s.value.aggregates ?? [], { field: T.value.find((c) => c.field !== s.value.labelField && c.field !== s.value.idField)?.field ?? "", op: "sum", numeric: "number" }];
136
+ }
137
+ function Q(c) {
138
+ s.value.aggregates = s.value.aggregates?.filter((K, R) => R !== c);
139
+ }
140
+ function _() {
141
+ W.value = "", C.value = void 0;
142
+ try {
143
+ const c = e.datasets?.[e.list.dataset] ?? [];
144
+ if (!c.length) throw new Error(e.messages.noData);
145
+ if (c.length > 1e3) throw new Error(e.messages.treeBudget);
146
+ const K = Ne(c, { ...s.value, aggregates: s.value.parentValues === "leaf-aggregate" ? s.value.aggregates : void 0, maxRows: 1e3 }), R = e.list.columns.slice(0, 5);
147
+ C.value = { columns: R.map((G) => G.header), rows: K.entries.slice(0, 8).map((G) => R.map((B) => B.field === s.value.labelField ? `${" ".repeat(Math.min(6, G.depth))}${G.row[B.field] ?? ""}` : G.row[B.field])) };
148
+ } catch (c) {
149
+ W.value = c instanceof Error ? c.message : String(c);
150
+ }
151
+ }
152
+ function X(c) {
153
+ if (!F.value) {
154
+ delete c.tree;
155
+ return;
156
+ }
157
+ c.tree = le(s.value), c.tree.parentValues !== "leaf-aggregate" && delete c.tree.aggregates, c.rowKey = c.tree.idField, delete c.detail, delete c.matrix, delete c.groupBy, delete c.groups, delete c.rowVisibleWhen;
158
+ }
159
+ function Y() {
160
+ W.value = "", C.value = void 0;
161
+ try {
162
+ const c = e.datasets?.[e.list.dataset] ?? [];
163
+ if (!c.length) throw new Error(e.messages.noData);
164
+ const K = Ee(c.slice(0, 1e3), {
165
+ ...m.value,
166
+ maxInputRows: 1e3
167
+ });
168
+ C.value = {
169
+ columns: K.columns.slice(0, 5).map((R) => R.header),
170
+ rows: K.rows.slice(0, 5).map(
171
+ (R) => K.columns.slice(0, 5).map((G) => R[G.field])
172
+ )
173
+ };
174
+ } catch (c) {
175
+ W.value = c instanceof Error ? c.message : String(c);
176
+ }
177
+ }
178
+ function ee() {
179
+ if (e.readonly) return;
180
+ const c = le(e.list);
181
+ e.mode === "tree" ? X(c) : e.mode === "detail" ? F.value ? (c.detail = le(V.value), delete c.matrix, delete c.tree) : delete c.detail : F.value ? (c.matrix = le(m.value), delete c.detail, delete c.tree, delete c.groups, delete c.groupBy, delete c.grandTotal) : delete c.matrix;
182
+ const K = ye({ pages: [{ widthMm: Math.max(1, c.leftMm + c.widthMm), heightMm: 297, components: [c] }] });
183
+ if (!K.ok) {
184
+ W.value = K.errors.slice(0, 3).map((R) => R.message).join(";");
185
+ return;
186
+ }
187
+ e.accept && !e.accept(c) || (U = JSON.stringify(c), e.accept || O(c), h.accept());
188
+ }
189
+ return fe({ key: () => `${e.recoveryKey ?? "rules:0:0"}:${e.mode}`, baseline: () => JSON.stringify(e.list[e.mode]), pending: () => h.pending.value, snapshot: () => JSON.stringify({ enabled: F.value, detail: V.value, matrix: m.value, tree: s.value, baseline: h.baseline.value }), restore(c) {
190
+ const K = JSON.parse(c);
191
+ F.value = K.enabled, V.value = K.detail, m.value = K.matrix, s.value = K.tree, h.baseline.value = K.baseline;
192
+ } }), {
193
+ enabled: F,
194
+ pendingLocalChanges: h.pending,
195
+ detail: V,
196
+ matrix: m,
197
+ tree: s,
198
+ datasets: $,
199
+ sourceFields: T,
200
+ childFields: M,
201
+ error: W,
202
+ preview: C,
203
+ chooseDataset: x,
204
+ toggleChildColumn: u,
205
+ toggleDimension: i,
206
+ addMeasure: r,
207
+ removeMeasure: b,
208
+ checkMatrix: Y,
209
+ addTreeAggregate: j,
210
+ removeTreeAggregate: Q,
211
+ checkTree: _,
212
+ apply: ee
213
+ };
214
+ }
215
+ const Be = { class: "mr-data-layout" }, Oe = { class: "mr-data-layout__check" }, Ae = ["disabled"], Ie = { class: "mr-data-layout__hint" }, Ge = ["aria-label", "value", "disabled"], We = {
216
+ value: "",
217
+ disabled: ""
218
+ }, Je = ["value"], je = { class: "mr-data-layout__pair" }, He = ["aria-label", "disabled"], ze = ["value"], qe = ["aria-label", "disabled"], Pe = {
219
+ value: "",
220
+ disabled: ""
221
+ }, Ze = ["value"], Qe = ["aria-label", "disabled"], Xe = { value: void 0 }, Ye = ["value"], pe = { class: "mr-data-layout__choices" }, _e = ["checked", "disabled", "onChange"], el = ["aria-label", "disabled"], ll = { class: "mr-data-layout__pair" }, al = ["aria-label", "disabled"], tl = { value: "error" }, sl = { value: "ignore" }, il = { class: "mr-data-layout__check" }, nl = ["disabled"], dl = { class: "mr-data-layout__hint" }, ol = { class: "mr-data-layout__pair" }, ul = ["aria-label", "disabled"], rl = { value: "flat" }, cl = { value: "nested" }, ml = ["aria-label", "disabled"], bl = ["value"], vl = { class: "mr-data-layout__pair" }, gl = { key: 0 }, fl = ["aria-label", "disabled"], yl = ["value"], hl = { key: 1 }, kl = ["aria-label", "disabled"], $l = ["aria-label", "disabled"], wl = ["value"], Vl = { class: "mr-data-layout__pair" }, Cl = ["aria-label", "disabled"], Ul = { key: 0 }, xl = ["aria-label", "disabled"], Fl = { value: "error" }, Ml = { value: "root" }, Sl = ["aria-label", "disabled"], Dl = { value: "source" }, Rl = { value: "leaf-aggregate" }, Kl = { class: "mr-data-layout__pair" }, El = ["onUpdate:modelValue", "aria-label", "disabled"], Nl = ["value"], Tl = ["onUpdate:modelValue", "aria-label", "disabled"], Ll = ["value"], Bl = { key: 0 }, Ol = ["onUpdate:modelValue", "aria-label", "disabled"], Al = ["value"], Il = { class: "mr-data-layout__pair" }, Gl = ["onUpdate:modelValue", "aria-label", "disabled"], Wl = { value: "number" }, Jl = { value: "decimal" }, jl = ["onUpdate:modelValue", "aria-label", "disabled"], Hl = ["disabled", "onClick"], zl = ["disabled"], ql = { class: "mr-data-layout__pair" }, Pl = ["aria-label", "disabled"], Zl = ["aria-label", "disabled"], Ql = { class: "mr-data-layout__hint" }, Xl = { class: "mr-data-layout__hint" }, Yl = ["checked", "disabled", "onChange"], pl = { class: "mr-data-layout__pair" }, _l = ["aria-label", "onUpdate:modelValue", "disabled"], ea = ["value"], la = ["aria-label", "onUpdate:modelValue", "disabled"], aa = ["value"], ta = ["aria-label", "onUpdate:modelValue", "disabled", "placeholder"], sa = { key: 0 }, ia = ["aria-label", "onUpdate:modelValue", "disabled"], na = ["value"], da = { class: "mr-data-layout__pair" }, oa = ["aria-label", "onUpdate:modelValue", "disabled"], ua = { value: "number" }, ra = { value: "decimal" }, ca = ["aria-label", "onUpdate:modelValue", "disabled"], ma = ["disabled", "onClick"], ba = ["disabled"], va = { class: "mr-data-layout__check" }, ga = ["disabled"], fa = { class: "mr-data-layout__pair" }, ya = ["disabled"], ha = ["disabled"], ka = { class: "mr-data-layout__actions" }, $a = ["disabled"], wa = ["disabled"], Va = ["disabled"], Ca = {
222
+ key: 3,
223
+ class: "mr-data-layout__preview"
224
+ }, Ua = {
225
+ key: 4,
226
+ class: "mr-data-layout__error",
227
+ role: "alert"
228
+ }, xa = /* @__PURE__ */ re({
229
+ __name: "RuleDataLayout",
230
+ props: {
231
+ recoveryKey: {},
232
+ list: {},
233
+ accept: { type: Function },
234
+ mode: {},
235
+ datasets: {},
236
+ datasetSchema: {},
237
+ datasetSchemas: {},
238
+ readonly: { type: Boolean },
239
+ messages: {}
240
+ },
241
+ emits: ["change", "dirty"],
242
+ setup(e, { emit: O }) {
243
+ const F = e, W = O, V = Le(F, (x) => W("change", x)), {
244
+ enabled: m,
245
+ detail: s,
246
+ matrix: h,
247
+ tree: U,
248
+ datasets: C,
249
+ sourceFields: $,
250
+ childFields: T,
251
+ error: M,
252
+ preview: I
253
+ } = V;
254
+ ae([V.pendingLocalChanges, m, s, h, U], () => W("dirty", V.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
255
+ const H = ce();
256
+ return (x, u) => (d(), o("div", Be, [
257
+ a("label", Oe, [
258
+ k(a("input", {
259
+ "onUpdate:modelValue": u[0] || (u[0] = (i) => ie(m) ? m.value = i : null),
260
+ type: "checkbox",
261
+ disabled: e.readonly
262
+ }, null, 8, Ae), [
263
+ [se, l(m)]
264
+ ]),
265
+ y(t(e.messages.enabled) + t(e.messages[e.mode]), 1)
266
+ ]),
267
+ l(m) && e.mode === "detail" ? (d(), o(w, { key: 0 }, [
268
+ a("p", Ie, t(e.messages.detailHint), 1),
269
+ a("label", null, [
270
+ y(t(e.messages.childDataset), 1),
271
+ a("select", {
272
+ "aria-label": e.messages.childDataset,
273
+ value: l(s).dataset,
274
+ disabled: e.readonly,
275
+ onChange: u[1] || (u[1] = (i) => l(V).chooseDataset(i.target.value))
276
+ }, [
277
+ a("option", We, t(e.messages.select), 1),
278
+ (d(!0), o(w, null, S(l(C), (i) => (d(), o("option", {
279
+ key: i,
280
+ value: i
281
+ }, t(i), 9, Je))), 128))
282
+ ], 40, Ge)
283
+ ]),
284
+ a("div", je, [
285
+ a("label", null, [
286
+ y(t(e.messages.parentKey), 1),
287
+ k(a("select", {
288
+ "aria-label": e.messages.parentKey,
289
+ "onUpdate:modelValue": u[2] || (u[2] = (i) => l(s).parentKey = i),
290
+ disabled: e.readonly
291
+ }, [
292
+ (d(!0), o(w, null, S(l($), (i) => (d(), o("option", {
293
+ key: i.field,
294
+ value: i.field
295
+ }, t(i.label), 9, ze))), 128))
296
+ ], 8, He), [
297
+ [E, l(s).parentKey]
298
+ ])
299
+ ]),
300
+ a("label", null, [
301
+ y(t(e.messages.foreignKey), 1),
302
+ k(a("select", {
303
+ "aria-label": e.messages.foreignKey,
304
+ "onUpdate:modelValue": u[3] || (u[3] = (i) => l(s).foreignKey = i),
305
+ disabled: e.readonly
306
+ }, [
307
+ a("option", Pe, t(e.messages.select), 1),
308
+ (d(!0), o(w, null, S(l(T), (i) => (d(), o("option", {
309
+ key: i.field,
310
+ value: i.field
311
+ }, t(i.label), 9, Ze))), 128))
312
+ ], 8, qe), [
313
+ [E, l(s).foreignKey]
314
+ ])
315
+ ])
316
+ ]),
317
+ a("label", null, [
318
+ y(t(e.messages.rowKey), 1),
319
+ k(a("select", {
320
+ "aria-label": e.messages.rowKey,
321
+ "onUpdate:modelValue": u[4] || (u[4] = (i) => l(s).rowKey = i),
322
+ disabled: e.readonly
323
+ }, [
324
+ a("option", Xe, t(e.messages.noRowKey), 1),
325
+ (d(!0), o(w, null, S(l(T), (i) => (d(), o("option", {
326
+ key: i.field,
327
+ value: i.field
328
+ }, t(i.label), 9, Ye))), 128))
329
+ ], 8, Qe), [
330
+ [E, l(s).rowKey]
331
+ ])
332
+ ]),
333
+ a("fieldset", pe, [
334
+ a("legend", null, t(e.messages.childColumns), 1),
335
+ (d(!0), o(w, null, S(l(T), (i) => (d(), o("label", {
336
+ key: i.field
337
+ }, [
338
+ a("input", {
339
+ type: "checkbox",
340
+ checked: l(s).columns.some((r) => r.field === i.field),
341
+ disabled: e.readonly,
342
+ onChange: (r) => l(V).toggleChildColumn(
343
+ i.field,
344
+ r.target.checked
345
+ )
346
+ }, null, 40, _e),
347
+ y(t(i.label), 1)
348
+ ]))), 128))
349
+ ]),
350
+ a("label", null, [
351
+ y(t(e.messages.title), 1),
352
+ k(a("input", {
353
+ "aria-label": e.messages.title,
354
+ "onUpdate:modelValue": u[5] || (u[5] = (i) => l(s).label = i),
355
+ disabled: e.readonly
356
+ }, null, 8, el), [
357
+ [q, l(s).label]
358
+ ])
359
+ ]),
360
+ a("div", ll, [
361
+ a("label", null, [
362
+ y(t(e.messages.unmatched), 1),
363
+ k(a("select", {
364
+ "aria-label": e.messages.unmatched,
365
+ "onUpdate:modelValue": u[6] || (u[6] = (i) => l(s).unmatched = i),
366
+ disabled: e.readonly
367
+ }, [
368
+ a("option", tl, t(e.messages.error), 1),
369
+ a("option", sl, t(e.messages.ignore), 1)
370
+ ], 8, al), [
371
+ [E, l(s).unmatched]
372
+ ])
373
+ ]),
374
+ a("label", il, [
375
+ k(a("input", {
376
+ "onUpdate:modelValue": u[7] || (u[7] = (i) => l(s).header = i),
377
+ type: "checkbox",
378
+ disabled: e.readonly
379
+ }, null, 8, nl), [
380
+ [se, l(s).header]
381
+ ]),
382
+ y(t(e.messages.childHeader), 1)
383
+ ])
384
+ ])
385
+ ], 64)) : l(m) && e.mode === "tree" ? (d(), o(w, { key: 1 }, [
386
+ a("p", dl, t(e.messages.treeHint), 1),
387
+ a("div", ol, [
388
+ a("label", null, [
389
+ y(t(e.messages.treeInput), 1),
390
+ k(a("select", {
391
+ "onUpdate:modelValue": u[8] || (u[8] = (i) => l(U).input = i),
392
+ "aria-label": e.messages.treeInput,
393
+ disabled: e.readonly
394
+ }, [
395
+ a("option", rl, t(e.messages.treeFlat), 1),
396
+ a("option", cl, t(e.messages.treeNested), 1)
397
+ ], 8, ul), [
398
+ [E, l(U).input]
399
+ ])
400
+ ]),
401
+ a("label", null, [
402
+ y(t(e.messages.treeId), 1),
403
+ k(a("select", {
404
+ "onUpdate:modelValue": u[9] || (u[9] = (i) => l(U).idField = i),
405
+ "aria-label": e.messages.treeId,
406
+ disabled: e.readonly
407
+ }, [
408
+ (d(!0), o(w, null, S(l($), (i) => (d(), o("option", {
409
+ key: i.field,
410
+ value: i.field
411
+ }, t(i.label), 9, bl))), 128))
412
+ ], 8, ml), [
413
+ [E, l(U).idField]
414
+ ])
415
+ ])
416
+ ]),
417
+ a("div", vl, [
418
+ l(U).input === "flat" ? (d(), o("label", gl, [
419
+ y(t(e.messages.treeParent), 1),
420
+ k(a("select", {
421
+ "onUpdate:modelValue": u[10] || (u[10] = (i) => l(U).parentField = i),
422
+ "aria-label": e.messages.treeParent,
423
+ disabled: e.readonly
424
+ }, [
425
+ (d(!0), o(w, null, S(l($), (i) => (d(), o("option", {
426
+ key: i.field,
427
+ value: i.field
428
+ }, t(i.label), 9, yl))), 128))
429
+ ], 8, fl), [
430
+ [E, l(U).parentField]
431
+ ])
432
+ ])) : (d(), o("label", hl, [
433
+ y(t(e.messages.treeChildren), 1),
434
+ k(a("input", {
435
+ "onUpdate:modelValue": u[11] || (u[11] = (i) => l(U).childrenField = i),
436
+ "aria-label": e.messages.treeChildren,
437
+ disabled: e.readonly,
438
+ placeholder: "children"
439
+ }, null, 8, kl), [
440
+ [q, l(U).childrenField]
441
+ ])
442
+ ])),
443
+ a("label", null, [
444
+ y(t(e.messages.treeLabel), 1),
445
+ k(a("select", {
446
+ "onUpdate:modelValue": u[12] || (u[12] = (i) => l(U).labelField = i),
447
+ "aria-label": e.messages.treeLabel,
448
+ disabled: e.readonly
449
+ }, [
450
+ (d(!0), o(w, null, S(e.list.columns.filter((i) => !i.hidden), (i) => (d(), o("option", {
451
+ key: i.field,
452
+ value: i.field
453
+ }, t(i.header), 9, wl))), 128))
454
+ ], 8, $l), [
455
+ [E, l(U).labelField]
456
+ ])
457
+ ])
458
+ ]),
459
+ a("div", Vl, [
460
+ a("label", null, [
461
+ y(t(e.messages.treeIndent), 1),
462
+ k(a("input", {
463
+ "onUpdate:modelValue": u[13] || (u[13] = (i) => l(U).indentMm = i),
464
+ "aria-label": e.messages.treeIndent,
465
+ type: "number",
466
+ min: "0",
467
+ max: "20",
468
+ step: "0.5",
469
+ disabled: e.readonly
470
+ }, null, 8, Cl), [
471
+ [
472
+ q,
473
+ l(U).indentMm,
474
+ void 0,
475
+ { number: !0 }
476
+ ]
477
+ ])
478
+ ]),
479
+ l(U).input === "flat" ? (d(), o("label", Ul, [
480
+ y(t(e.messages.treeOrphan), 1),
481
+ k(a("select", {
482
+ "onUpdate:modelValue": u[14] || (u[14] = (i) => l(U).orphan = i),
483
+ "aria-label": e.messages.treeOrphan,
484
+ disabled: e.readonly
485
+ }, [
486
+ a("option", Fl, t(e.messages.error), 1),
487
+ a("option", Ml, t(e.messages.treeAsRoot), 1)
488
+ ], 8, xl), [
489
+ [E, l(U).orphan]
490
+ ])
491
+ ])) : D("", !0)
492
+ ]),
493
+ a("label", null, [
494
+ y(t(e.messages.treeValues), 1),
495
+ k(a("select", {
496
+ "onUpdate:modelValue": u[15] || (u[15] = (i) => l(U).parentValues = i),
497
+ "aria-label": e.messages.treeValues,
498
+ disabled: e.readonly
499
+ }, [
500
+ a("option", Dl, t(e.messages.treeSource), 1),
501
+ a("option", Rl, t(e.messages.treeLeaves), 1)
502
+ ], 8, Sl), [
503
+ [E, l(U).parentValues]
504
+ ])
505
+ ]),
506
+ l(U).parentValues === "leaf-aggregate" ? (d(), o(w, { key: 0 }, [
507
+ (d(!0), o(w, null, S(l(U).aggregates, (i, r) => (d(), o("div", {
508
+ key: r,
509
+ class: "mr-data-layout__measure"
510
+ }, [
511
+ a("div", Kl, [
512
+ a("label", null, [
513
+ y(t(e.messages.measure), 1),
514
+ k(a("select", {
515
+ "onUpdate:modelValue": (b) => i.field = b,
516
+ "aria-label": e.messages.measure,
517
+ disabled: e.readonly
518
+ }, [
519
+ (d(!0), o(w, null, S(l($), (b) => (d(), o("option", {
520
+ key: b.field,
521
+ value: b.field
522
+ }, t(b.label), 9, Nl))), 128))
523
+ ], 8, El), [
524
+ [E, i.field]
525
+ ])
526
+ ]),
527
+ a("label", null, [
528
+ y(t(e.messages.aggregate), 1),
529
+ k(a("select", {
530
+ "onUpdate:modelValue": (b) => i.op = b,
531
+ "aria-label": e.messages.aggregate,
532
+ disabled: e.readonly
533
+ }, [
534
+ (d(!0), o(w, null, S(l(H).aggregates, (b) => (d(), o("option", {
535
+ key: b,
536
+ value: b
537
+ }, t(e.messages[b]), 9, Ll))), 128))
538
+ ], 8, Tl), [
539
+ [E, i.op]
540
+ ])
541
+ ])
542
+ ]),
543
+ i.op === "weightedAvg" ? (d(), o("label", Bl, [
544
+ y(t(e.messages.weight), 1),
545
+ k(a("select", {
546
+ "onUpdate:modelValue": (b) => i.weightField = b,
547
+ "aria-label": e.messages.weight,
548
+ disabled: e.readonly
549
+ }, [
550
+ (d(!0), o(w, null, S(l($), (b) => (d(), o("option", {
551
+ key: b.field,
552
+ value: b.field
553
+ }, t(b.label), 9, Al))), 128))
554
+ ], 8, Ol), [
555
+ [E, i.weightField]
556
+ ])
557
+ ])) : D("", !0),
558
+ a("div", Il, [
559
+ a("label", null, [
560
+ y(t(e.messages.numeric), 1),
561
+ k(a("select", {
562
+ "onUpdate:modelValue": (b) => i.numeric = b,
563
+ "aria-label": e.messages.numeric,
564
+ disabled: e.readonly
565
+ }, [
566
+ a("option", Wl, t(e.messages.number), 1),
567
+ a("option", Jl, t(e.messages.decimal), 1)
568
+ ], 8, Gl), [
569
+ [E, i.numeric]
570
+ ])
571
+ ]),
572
+ a("label", null, [
573
+ y(t(e.messages.digits), 1),
574
+ k(a("input", {
575
+ "onUpdate:modelValue": (b) => i.digits = b,
576
+ "aria-label": e.messages.digits,
577
+ type: "number",
578
+ min: "0",
579
+ max: "100",
580
+ disabled: e.readonly
581
+ }, null, 8, jl), [
582
+ [
583
+ q,
584
+ i.digits,
585
+ void 0,
586
+ { number: !0 }
587
+ ]
588
+ ])
589
+ ])
590
+ ]),
591
+ a("button", {
592
+ type: "button",
593
+ disabled: e.readonly,
594
+ onClick: (b) => l(V).removeTreeAggregate(r)
595
+ }, t(e.messages.remove), 9, Hl)
596
+ ]))), 128)),
597
+ a("button", {
598
+ type: "button",
599
+ disabled: e.readonly || (l(U).aggregates?.length ?? 0) >= 32,
600
+ onClick: u[16] || (u[16] = //@ts-ignore
601
+ (...i) => l(V).addTreeAggregate && l(V).addTreeAggregate(...i))
602
+ }, "+ " + t(e.messages.addAggregate), 9, zl)
603
+ ], 64)) : D("", !0),
604
+ a("details", null, [
605
+ a("summary", null, t(e.messages.advanced), 1),
606
+ a("div", ql, [
607
+ a("label", null, [
608
+ y(t(e.messages.treeRows), 1),
609
+ k(a("input", {
610
+ "onUpdate:modelValue": u[17] || (u[17] = (i) => l(U).maxRows = i),
611
+ "aria-label": e.messages.treeRows,
612
+ type: "number",
613
+ min: "1",
614
+ max: "1000000",
615
+ disabled: e.readonly
616
+ }, null, 8, Pl), [
617
+ [
618
+ q,
619
+ l(U).maxRows,
620
+ void 0,
621
+ { number: !0 }
622
+ ]
623
+ ])
624
+ ]),
625
+ a("label", null, [
626
+ y(t(e.messages.treeDepth), 1),
627
+ k(a("input", {
628
+ "onUpdate:modelValue": u[18] || (u[18] = (i) => l(U).maxDepth = i),
629
+ "aria-label": e.messages.treeDepth,
630
+ type: "number",
631
+ min: "1",
632
+ max: "256",
633
+ disabled: e.readonly
634
+ }, null, 8, Zl), [
635
+ [
636
+ q,
637
+ l(U).maxDepth,
638
+ void 0,
639
+ { number: !0 }
640
+ ]
641
+ ])
642
+ ])
643
+ ])
644
+ ]),
645
+ a("p", Ql, t(e.messages.treeReadonly), 1)
646
+ ], 64)) : l(m) ? (d(), o(w, { key: 2 }, [
647
+ a("p", Xl, t(e.messages.matrixHint), 1),
648
+ (d(), o(w, null, S(["rowFields", "columnFields"], (i) => a("fieldset", {
649
+ key: i,
650
+ class: "mr-data-layout__choices"
651
+ }, [
652
+ a("legend", null, t(e.messages[i]), 1),
653
+ (d(!0), o(w, null, S(l($), (r) => (d(), o("label", {
654
+ key: r.field
655
+ }, [
656
+ a("input", {
657
+ type: "checkbox",
658
+ checked: l(h)[i].includes(r.field),
659
+ disabled: e.readonly,
660
+ onChange: (b) => l(V).toggleDimension(
661
+ i,
662
+ r.field,
663
+ b.target.checked
664
+ )
665
+ }, null, 40, Yl),
666
+ y(t(r.label), 1)
667
+ ]))), 128))
668
+ ])), 64)),
669
+ (d(!0), o(w, null, S(l(h).measures, (i, r) => (d(), o("div", {
670
+ key: r,
671
+ class: "mr-data-layout__measure"
672
+ }, [
673
+ a("div", pl, [
674
+ a("label", null, [
675
+ y(t(e.messages.measure), 1),
676
+ k(a("select", {
677
+ "aria-label": e.messages.measure,
678
+ "onUpdate:modelValue": (b) => i.field = b,
679
+ disabled: e.readonly
680
+ }, [
681
+ (d(!0), o(w, null, S(l($), (b) => (d(), o("option", {
682
+ key: b.field,
683
+ value: b.field
684
+ }, t(b.label), 9, ea))), 128))
685
+ ], 8, _l), [
686
+ [E, i.field]
687
+ ])
688
+ ]),
689
+ a("label", null, [
690
+ y(t(e.messages.aggregate), 1),
691
+ k(a("select", {
692
+ "aria-label": e.messages.aggregate,
693
+ "onUpdate:modelValue": (b) => i.op = b,
694
+ disabled: e.readonly
695
+ }, [
696
+ (d(!0), o(w, null, S(l(H).aggregates, (b) => (d(), o("option", {
697
+ key: b,
698
+ value: b
699
+ }, t(e.messages[b]), 9, aa))), 128))
700
+ ], 8, la), [
701
+ [E, i.op]
702
+ ])
703
+ ])
704
+ ]),
705
+ a("label", null, [
706
+ y(t(e.messages.measureLabel), 1),
707
+ k(a("input", {
708
+ "aria-label": e.messages.measureLabel,
709
+ "onUpdate:modelValue": (b) => i.label = b,
710
+ disabled: e.readonly,
711
+ placeholder: i.field
712
+ }, null, 8, ta), [
713
+ [q, i.label]
714
+ ])
715
+ ]),
716
+ i.op === "weightedAvg" ? (d(), o("label", sa, [
717
+ y(t(e.messages.weight), 1),
718
+ k(a("select", {
719
+ "aria-label": e.messages.weight,
720
+ "onUpdate:modelValue": (b) => i.weightField = b,
721
+ disabled: e.readonly
722
+ }, [
723
+ (d(!0), o(w, null, S(l($), (b) => (d(), o("option", {
724
+ key: b.field,
725
+ value: b.field
726
+ }, t(b.label), 9, na))), 128))
727
+ ], 8, ia), [
728
+ [E, i.weightField]
729
+ ])
730
+ ])) : D("", !0),
731
+ a("div", da, [
732
+ a("label", null, [
733
+ y(t(e.messages.numeric), 1),
734
+ k(a("select", {
735
+ "aria-label": e.messages.numeric,
736
+ "onUpdate:modelValue": (b) => i.numeric = b,
737
+ disabled: e.readonly
738
+ }, [
739
+ a("option", ua, t(e.messages.number), 1),
740
+ a("option", ra, t(e.messages.decimal), 1)
741
+ ], 8, oa), [
742
+ [E, i.numeric]
743
+ ])
744
+ ]),
745
+ a("label", null, [
746
+ y(t(e.messages.digits), 1),
747
+ k(a("input", {
748
+ "aria-label": e.messages.digits,
749
+ "onUpdate:modelValue": (b) => i.digits = b,
750
+ type: "number",
751
+ min: "0",
752
+ max: "100",
753
+ disabled: e.readonly
754
+ }, null, 8, ca), [
755
+ [
756
+ q,
757
+ i.digits,
758
+ void 0,
759
+ { number: !0 }
760
+ ]
761
+ ])
762
+ ])
763
+ ]),
764
+ a("button", {
765
+ type: "button",
766
+ disabled: e.readonly,
767
+ onClick: (b) => l(V).removeMeasure(r)
768
+ }, t(e.messages.remove), 9, ma)
769
+ ]))), 128)),
770
+ a("button", {
771
+ type: "button",
772
+ disabled: e.readonly || l(h).measures.length >= 32,
773
+ onClick: u[19] || (u[19] = //@ts-ignore
774
+ (...i) => l(V).addMeasure && l(V).addMeasure(...i))
775
+ }, " + " + t(e.messages.addAggregate), 9, ba),
776
+ a("label", va, [
777
+ k(a("input", {
778
+ "onUpdate:modelValue": u[20] || (u[20] = (i) => l(h).totals = i),
779
+ type: "checkbox",
780
+ disabled: e.readonly
781
+ }, null, 8, ga), [
782
+ [se, l(h).totals]
783
+ ]),
784
+ y(t(e.messages.totals), 1)
785
+ ]),
786
+ a("details", null, [
787
+ a("summary", null, t(e.messages.widthSettings), 1),
788
+ a("div", fa, [
789
+ a("label", null, [
790
+ y(t(e.messages.dimensionWidth), 1),
791
+ k(a("input", {
792
+ "onUpdate:modelValue": u[21] || (u[21] = (i) => l(h).rowWidthMm = i),
793
+ type: "number",
794
+ min: "1",
795
+ disabled: e.readonly,
796
+ placeholder: "40"
797
+ }, null, 8, ya), [
798
+ [
799
+ q,
800
+ l(h).rowWidthMm,
801
+ void 0,
802
+ { number: !0 }
803
+ ]
804
+ ])
805
+ ]),
806
+ a("label", null, [
807
+ y(t(e.messages.measureWidth), 1),
808
+ k(a("input", {
809
+ "onUpdate:modelValue": u[22] || (u[22] = (i) => l(h).columnWidthMm = i),
810
+ type: "number",
811
+ min: "1",
812
+ disabled: e.readonly,
813
+ placeholder: "28"
814
+ }, null, 8, ha), [
815
+ [
816
+ q,
817
+ l(h).columnWidthMm,
818
+ void 0,
819
+ { number: !0 }
820
+ ]
821
+ ])
822
+ ])
823
+ ])
824
+ ])
825
+ ], 64)) : D("", !0),
826
+ a("div", ka, [
827
+ l(m) && e.mode === "matrix" ? (d(), o("button", {
828
+ key: 0,
829
+ type: "button",
830
+ disabled: e.readonly,
831
+ onClick: u[23] || (u[23] = //@ts-ignore
832
+ (...i) => l(V).checkMatrix && l(V).checkMatrix(...i))
833
+ }, t(e.messages.check), 9, $a)) : D("", !0),
834
+ l(m) && e.mode === "tree" ? (d(), o("button", {
835
+ key: 1,
836
+ type: "button",
837
+ disabled: e.readonly,
838
+ onClick: u[24] || (u[24] = //@ts-ignore
839
+ (...i) => l(V).checkTree && l(V).checkTree(...i))
840
+ }, t(e.messages.check), 9, wa)) : D("", !0),
841
+ a("button", {
842
+ type: "button",
843
+ class: "mr-data-layout__primary",
844
+ disabled: e.readonly,
845
+ onClick: u[25] || (u[25] = //@ts-ignore
846
+ (...i) => l(V).apply && l(V).apply(...i))
847
+ }, t(e.messages.apply), 9, Va)
848
+ ]),
849
+ l(I) ? (d(), o("div", Ca, [
850
+ a("p", null, t(e.messages.sample), 1),
851
+ a("table", null, [
852
+ a("thead", null, [
853
+ a("tr", null, [
854
+ (d(!0), o(w, null, S(l(I).columns, (i, r) => (d(), o("th", { key: r }, t(i), 1))), 128))
855
+ ])
856
+ ]),
857
+ a("tbody", null, [
858
+ (d(!0), o(w, null, S(l(I).rows, (i, r) => (d(), o("tr", { key: r }, [
859
+ (d(!0), o(w, null, S(i, (b, j) => (d(), o("td", { key: j }, t(b ?? "—"), 1))), 128))
860
+ ]))), 128))
861
+ ])
862
+ ])
863
+ ])) : D("", !0),
864
+ l(M) ? (d(), o("p", Ua, t(l(M)), 1)) : D("", !0)
865
+ ]));
866
+ }
867
+ }), Fa = /* @__PURE__ */ me(xa, [["__scopeId", "data-v-e089d1c9"]]), Ma = { class: "mr-expression__row" }, Sa = ["value", "disabled", "aria-label"], Da = { value: "field" }, Ra = { value: "constant" }, Ka = {
868
+ key: 0,
869
+ value: "operation"
870
+ }, Ea = { value: "aggregate" }, Na = ["value", "disabled", "aria-label"], Ta = ["value"], La = ["value", "disabled", "aria-label"], Ba = ["value"], Oa = ["value", "disabled", "aria-label"], Aa = ["value"], Ia = ["value", "disabled", "aria-label"], Ga = { value: "text" }, Wa = { value: "number" }, Ja = { value: "boolean" }, ja = { value: "null" }, Ha = ["value", "disabled", "aria-label"], za = {
871
+ key: 0,
872
+ value: ""
873
+ }, qa = ["value"], Pa = ["value", "disabled", "aria-label"], Za = {
874
+ value: "",
875
+ disabled: ""
876
+ }, Qa = ["value"], Xa = ["value", "disabled", "aria-label"], Ya = { value: "true" }, pa = { value: "false" }, _a = ["type", "value", "disabled", "aria-label"], et = ["disabled", "aria-label", "onClick"], lt = ["disabled"], at = /* @__PURE__ */ re({
877
+ __name: "ReportExpressionEditor",
878
+ props: {
879
+ modelValue: {},
880
+ fields: {},
881
+ messages: {},
882
+ readonly: { type: Boolean },
883
+ depth: {}
884
+ },
885
+ emits: ["update:modelValue"],
886
+ setup(e, { emit: O }) {
887
+ const F = e, W = O, V = ce(), m = P(
888
+ () => "aggregate" in F.modelValue ? "aggregate" : "field" in F.modelValue ? "field" : "value" in F.modelValue ? "constant" : "operation"
889
+ ), s = A("text");
890
+ ae(
891
+ () => F.modelValue,
892
+ (x) => {
893
+ "value" in x && (s.value = x.value === null ? "null" : typeof x.value == "string" ? "text" : typeof x.value);
894
+ },
895
+ { immediate: !0 }
896
+ );
897
+ function h(x) {
898
+ F.readonly || W("update:modelValue", x);
899
+ }
900
+ function U(x) {
901
+ h(x === "aggregate" ? { aggregate: "sum", field: F.fields[0]?.field ?? "" } : x === "field" ? { field: F.fields[0]?.field ?? "" } : x === "constant" ? { value: "" } : {
902
+ op: "add",
903
+ args: [{ field: F.fields[0]?.field ?? "" }, { value: 0 }]
904
+ });
905
+ }
906
+ function C(x) {
907
+ const u = x, i = "args" in F.modelValue ? F.modelValue.args : [{ value: 0 }, { value: 0 }];
908
+ h({
909
+ op: u,
910
+ args: u === "divide" || u === "subtract" ? i.slice(0, 2) : i
911
+ });
912
+ }
913
+ function $(x, u) {
914
+ "args" in F.modelValue && h({
915
+ ...F.modelValue,
916
+ args: F.modelValue.args.map(
917
+ (i, r) => r === x ? u : i
918
+ )
919
+ });
920
+ }
921
+ function T(x) {
922
+ if (!("args" in F.modelValue)) return;
923
+ const u = x === void 0 ? [...F.modelValue.args, { value: 0 }] : F.modelValue.args.filter((i, r) => r !== x);
924
+ h({ ...F.modelValue, args: u });
925
+ }
926
+ function M(x) {
927
+ s.value = x, h({
928
+ value: x === "null" ? null : x === "boolean" ? !1 : x === "number" ? 0 : ""
929
+ });
930
+ }
931
+ function I(x) {
932
+ s.value === "number" ? x.trim() && Number.isFinite(Number(x)) && h({ value: Number(x) }) : h({ value: x });
933
+ }
934
+ function H(x, u) {
935
+ if (!("aggregate" in F.modelValue)) return;
936
+ const i = { ...F.modelValue, [x]: u };
937
+ x === "aggregate" && (i.aggregate = u), x === "field" && !u && delete i.field, h(i);
938
+ }
939
+ return (x, u) => {
940
+ const i = Fe("ReportExpressionEditor", !0);
941
+ return d(), o("div", {
942
+ class: ve(["mr-expression", { "mr-expression--nested": (e.depth ?? 0) > 0 }])
943
+ }, [
944
+ a("div", Ma, [
945
+ a("select", {
946
+ value: m.value,
947
+ disabled: e.readonly,
948
+ "aria-label": e.messages.argument,
949
+ onChange: u[0] || (u[0] = (r) => U(r.target.value))
950
+ }, [
951
+ a("option", Da, t(e.messages.field), 1),
952
+ a("option", Ra, t(e.messages.constant), 1),
953
+ (e.depth ?? 0) < 12 ? (d(), o("option", Ka, t(e.messages.operation), 1)) : D("", !0),
954
+ a("option", Ea, t(e.messages.aggregate), 1)
955
+ ], 40, Sa),
956
+ "field" in e.modelValue && !("aggregate" in e.modelValue) ? (d(), o("select", {
957
+ key: 0,
958
+ value: e.modelValue.field,
959
+ disabled: e.readonly,
960
+ "aria-label": e.messages.field,
961
+ onChange: u[1] || (u[1] = (r) => h({ field: r.target.value }))
962
+ }, [
963
+ (d(!0), o(w, null, S(e.fields, (r) => (d(), o("option", {
964
+ key: r.field,
965
+ value: r.field
966
+ }, t(r.label), 9, Ta))), 128))
967
+ ], 40, Na)) : "op" in e.modelValue ? (d(), o("select", {
968
+ key: 1,
969
+ value: e.modelValue.op,
970
+ disabled: e.readonly,
971
+ "aria-label": e.messages.operation,
972
+ onChange: u[2] || (u[2] = (r) => C(r.target.value))
973
+ }, [
974
+ (d(!0), o(w, null, S(l(V).operations, (r) => (d(), o("option", {
975
+ key: r,
976
+ value: r
977
+ }, t(e.messages[r]), 9, Ba))), 128))
978
+ ], 40, La)) : "aggregate" in e.modelValue ? (d(), o("select", {
979
+ key: 2,
980
+ value: e.modelValue.aggregate,
981
+ disabled: e.readonly,
982
+ "aria-label": e.messages.aggregate,
983
+ onChange: u[3] || (u[3] = (r) => H("aggregate", r.target.value))
984
+ }, [
985
+ (d(!0), o(w, null, S(l(V).aggregates, (r) => (d(), o("option", {
986
+ key: r,
987
+ value: r
988
+ }, t(e.messages[r]), 9, Aa))), 128))
989
+ ], 40, Oa)) : (d(), o("select", {
990
+ key: 3,
991
+ value: s.value,
992
+ disabled: e.readonly,
993
+ "aria-label": e.messages.resultType,
994
+ onChange: u[4] || (u[4] = (r) => M(r.target.value))
995
+ }, [
996
+ a("option", Ga, t(e.messages.text), 1),
997
+ a("option", Wa, t(e.messages.number), 1),
998
+ a("option", Ja, t(e.messages.boolean), 1),
999
+ a("option", ja, t(e.messages.null), 1)
1000
+ ], 40, Ia))
1001
+ ]),
1002
+ "aggregate" in e.modelValue ? (d(), o(w, { key: 0 }, [
1003
+ a("select", {
1004
+ value: e.modelValue.field ?? "",
1005
+ disabled: e.readonly,
1006
+ "aria-label": e.messages.measure,
1007
+ onChange: u[5] || (u[5] = (r) => H("field", r.target.value))
1008
+ }, [
1009
+ e.modelValue.aggregate === "count" ? (d(), o("option", za, t(e.messages.allRows), 1)) : D("", !0),
1010
+ (d(!0), o(w, null, S(e.fields, (r) => (d(), o("option", {
1011
+ key: r.field,
1012
+ value: r.field
1013
+ }, t(r.label), 9, qa))), 128))
1014
+ ], 40, Ha),
1015
+ e.modelValue.aggregate === "weightedAvg" ? (d(), o("select", {
1016
+ key: 0,
1017
+ value: e.modelValue.weightField ?? "",
1018
+ disabled: e.readonly,
1019
+ "aria-label": e.messages.weight,
1020
+ onChange: u[6] || (u[6] = (r) => H(
1021
+ "weightField",
1022
+ r.target.value
1023
+ ))
1024
+ }, [
1025
+ a("option", Za, t(e.messages.weight), 1),
1026
+ (d(!0), o(w, null, S(e.fields, (r) => (d(), o("option", {
1027
+ key: r.field,
1028
+ value: r.field
1029
+ }, t(r.label), 9, Qa))), 128))
1030
+ ], 40, Pa)) : D("", !0)
1031
+ ], 64)) : "value" in e.modelValue ? (d(), o(w, { key: 1 }, [
1032
+ s.value === "boolean" ? (d(), o("select", {
1033
+ key: 0,
1034
+ value: String(e.modelValue.value),
1035
+ disabled: e.readonly,
1036
+ "aria-label": e.messages.constant,
1037
+ onChange: u[7] || (u[7] = (r) => h({
1038
+ value: r.target.value === "true"
1039
+ }))
1040
+ }, [
1041
+ a("option", Ya, t(e.messages.true), 1),
1042
+ a("option", pa, t(e.messages.false), 1)
1043
+ ], 40, Xa)) : s.value !== "null" ? (d(), o("input", {
1044
+ key: 1,
1045
+ type: s.value === "number" ? "number" : "text",
1046
+ value: e.modelValue.value ?? "",
1047
+ disabled: e.readonly,
1048
+ "aria-label": e.messages.constant,
1049
+ onInput: u[8] || (u[8] = (r) => I(r.target.value))
1050
+ }, null, 40, _a)) : D("", !0)
1051
+ ], 64)) : "args" in e.modelValue ? (d(), o(w, { key: 2 }, [
1052
+ (d(!0), o(w, null, S(e.modelValue.args, (r, b) => (d(), o("div", {
1053
+ key: b,
1054
+ class: "mr-expression__argument"
1055
+ }, [
1056
+ ge(i, {
1057
+ "model-value": r,
1058
+ fields: e.fields,
1059
+ messages: e.messages,
1060
+ readonly: e.readonly,
1061
+ depth: (e.depth ?? 0) + 1,
1062
+ "onUpdate:modelValue": (j) => $(b, j)
1063
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
1064
+ e.modelValue.args.length > 2 ? (d(), o("button", {
1065
+ key: 0,
1066
+ type: "button",
1067
+ disabled: e.readonly,
1068
+ "aria-label": `${e.messages.remove} ${e.messages.argument} ${b + 1}`,
1069
+ onClick: (j) => T(b)
1070
+ }, " × ", 8, et)) : D("", !0)
1071
+ ]))), 128)),
1072
+ !["subtract", "divide"].includes(e.modelValue.op) && e.modelValue.args.length < 16 ? (d(), o("button", {
1073
+ key: 0,
1074
+ type: "button",
1075
+ disabled: e.readonly,
1076
+ onClick: u[9] || (u[9] = (r) => T())
1077
+ }, " + " + t(e.messages.addArgument), 9, lt)) : D("", !0)
1078
+ ], 64)) : D("", !0)
1079
+ ], 2);
1080
+ };
1081
+ }
1082
+ }), tt = /* @__PURE__ */ me(at, [["__scopeId", "data-v-84e5c0e5"]]), z = (e) => JSON.parse(JSON.stringify(e));
1083
+ function st(e, O) {
1084
+ const F = P(() => ({
1085
+ ...Ke,
1086
+ ...e.messages
1087
+ })), W = A("computations"), V = A(""), m = A(""), s = A({
1088
+ field: "",
1089
+ expression: { field: "" },
1090
+ scope: "row"
1091
+ }), h = A([]), U = A(0), C = A(""), $ = A(-1), T = A("style"), M = A({ field: "", op: ">", value: 0 }), I = A({
1092
+ color: "#b91c1c",
1093
+ backgroundColor: "#fff1f2",
1094
+ bold: !1
1095
+ }), H = A([]), x = oe(() => s.value), u = oe(() => h.value), i = oe(() => ({ when: M.value, style: I.value })), r = A(/* @__PURE__ */ new Map()), b = A(/* @__PURE__ */ new Map());
1096
+ let j = "", Q = !1;
1097
+ const _ = P(() => x.pending.value || u.pending.value || i.pending.value || r.value.size > 0 || b.value.size > 0);
1098
+ let X;
1099
+ const Y = P(() => {
1100
+ const f = /* @__PURE__ */ new Map();
1101
+ for (const g of e.datasetSchema?.fields ?? [])
1102
+ f.set(g.field, g.label ?? g.field);
1103
+ for (const g of e.list.columns)
1104
+ f.has(g.field) || f.set(g.field, g.header || g.field);
1105
+ for (const g of Object.keys(
1106
+ e.datasets?.[e.list.dataset]?.[0] ?? {}
1107
+ ))
1108
+ f.has(g) || f.set(g, g);
1109
+ return [...f].map(([g, N]) => ({ field: g, label: N }));
1110
+ }), ee = P(() => h.value[U.value]), c = P(
1111
+ () => e.list.columns.find((f) => f.field === C.value)
1112
+ ), K = P(() => De(B()));
1113
+ function R() {
1114
+ if (X === JSON.stringify(e.list)) {
1115
+ X = void 0;
1116
+ return;
1117
+ }
1118
+ Q = !0, r.value = /* @__PURE__ */ new Map(), b.value = /* @__PURE__ */ new Map(), h.value = z(
1119
+ e.list.groups ?? (e.list.groupBy ? [e.list.groupBy] : [])
1120
+ );
1121
+ for (const f of h.value) for (const g of f.aggregates ?? []) g.numeric ??= "number";
1122
+ e.list.columns.some((f) => f.field === C.value) || (C.value = e.list.columns[0]?.field ?? ""), V.value = "", H.value = [], G(m.value), be(-1), u.accept(), Q = !1;
1123
+ }
1124
+ ae(() => e.list, R, { immediate: !0 }), ae(s, () => {
1125
+ H.value = [];
1126
+ }, { deep: !0 }), ae(() => e.datasets, () => {
1127
+ H.value = [];
1128
+ }, { deep: !0 });
1129
+ function G(f) {
1130
+ !Q && x.pending.value && (r.value = new Map(r.value).set(m.value, z(s.value))), m.value = f, s.value = z(
1131
+ e.list.computed?.find((N) => N.field === f) ?? {
1132
+ field: "",
1133
+ expression: { field: Y.value[0]?.field ?? "" },
1134
+ scope: "row"
1135
+ }
1136
+ ), s.value.numeric ??= "number", H.value = [], V.value = "", x.accept();
1137
+ const g = r.value.get(f);
1138
+ if (g) {
1139
+ s.value = z(g);
1140
+ const N = new Map(r.value);
1141
+ N.delete(f), r.value = N;
1142
+ }
1143
+ }
1144
+ function B() {
1145
+ return [
1146
+ ...(e.list.computed ?? []).filter((g) => g.field !== m.value),
1147
+ z(s.value)
1148
+ ];
1149
+ }
1150
+ function p(f) {
1151
+ if (e.readonly) return !1;
1152
+ const g = ye({
1153
+ pages: [
1154
+ {
1155
+ widthMm: Math.max(1, f.leftMm + f.widthMm),
1156
+ heightMm: 297,
1157
+ components: [f]
1158
+ }
1159
+ ]
1160
+ });
1161
+ return g.ok ? (V.value = "", X = JSON.stringify(f), O(f), !0) : (V.value = g.errors.map((N) => N.message).slice(0, 3).join(";"), !1);
1162
+ }
1163
+ function ue() {
1164
+ if (!s.value.field.trim()) {
1165
+ V.value = F.value.missingTarget;
1166
+ return;
1167
+ }
1168
+ const f = z(e.list);
1169
+ if (f.computed = B(), f.columns.some((g) => g.field === s.value.field) || f.columns.push({
1170
+ field: s.value.field,
1171
+ header: s.value.field,
1172
+ widthMm: 30,
1173
+ semanticRole: "measure",
1174
+ align: "right",
1175
+ editable: !1,
1176
+ format: {
1177
+ kind: "number",
1178
+ ...s.value.digits === void 0 ? {} : { digits: s.value.digits }
1179
+ }
1180
+ }), p(f)) {
1181
+ const g = new Map(r.value);
1182
+ g.delete(m.value), g.delete(s.value.field), r.value = g, m.value = s.value.field, x.accept();
1183
+ }
1184
+ }
1185
+ function ne() {
1186
+ if (!m.value) return;
1187
+ const f = z(e.list);
1188
+ if (f.computed = (f.computed ?? []).filter(
1189
+ (g) => g.field !== m.value
1190
+ ), p(f)) {
1191
+ const g = new Map(r.value);
1192
+ g.delete(m.value), r.value = g, x.accept(), G("");
1193
+ }
1194
+ }
1195
+ function de() {
1196
+ H.value = [], V.value = "";
1197
+ const f = e.datasets?.[e.list.dataset];
1198
+ if (!f?.length) {
1199
+ V.value = F.value.noData;
1200
+ return;
1201
+ }
1202
+ try {
1203
+ const g = Re(f.slice(0, 1e3), {
1204
+ fields: B(),
1205
+ maxRows: 1e3,
1206
+ maxCells: 2e6
1207
+ });
1208
+ H.value = g.rows.slice(0, 5).map((N, Z) => ({
1209
+ row: Z + 1,
1210
+ value: N[s.value.field]
1211
+ }));
1212
+ } catch (g) {
1213
+ V.value = g instanceof Error ? g.message : String(g);
1214
+ }
1215
+ }
1216
+ function v(f) {
1217
+ s.value.expression = f;
1218
+ }
1219
+ function n(f, g) {
1220
+ s.value.groupBy = g ? [...s.value.groupBy ?? [], f] : (s.value.groupBy ?? []).filter((N) => N !== f);
1221
+ }
1222
+ function J() {
1223
+ h.value.push({
1224
+ field: Y.value[0]?.field ?? "",
1225
+ headerTemplate: "{value}",
1226
+ subtotalLabel: F.value.subtotalLabel,
1227
+ aggregates: [],
1228
+ keepWithNext: !0
1229
+ }), U.value = h.value.length - 1;
1230
+ }
1231
+ function L(f) {
1232
+ const g = U.value, N = g + f;
1233
+ N < 0 || N >= h.value.length || ([h.value[g], h.value[N]] = [
1234
+ h.value[N],
1235
+ h.value[g]
1236
+ ], U.value = N);
1237
+ }
1238
+ function $e() {
1239
+ h.value.splice(U.value, 1), U.value = Math.max(
1240
+ 0,
1241
+ Math.min(U.value, h.value.length - 1)
1242
+ );
1243
+ }
1244
+ function we() {
1245
+ ee.value && (ee.value.aggregates ??= []).push({
1246
+ field: Y.value[0]?.field ?? "",
1247
+ op: "sum",
1248
+ numeric: "number"
1249
+ });
1250
+ }
1251
+ function Ve() {
1252
+ const f = z(e.list);
1253
+ f.groups = z(h.value), delete f.groupBy, p(f) && u.accept();
1254
+ }
1255
+ function be(f) {
1256
+ !Q && i.pending.value && (b.value = new Map(b.value).set(j, { when: z(M.value), style: { ...I.value } })), j = `${C.value}|${T.value}|${f}`, $.value = f;
1257
+ const g = T.value === "cell" ? c.value?.visibleWhen : T.value === "rowVisibility" ? e.list.rowVisibleWhen : c.value?.rules?.[f]?.when;
1258
+ M.value = z(g ?? { field: C.value, op: ">", value: 0 });
1259
+ const N = c.value?.rules?.[f]?.style;
1260
+ I.value = {
1261
+ color: String(N?.color ?? "#b91c1c"),
1262
+ backgroundColor: String(N?.backgroundColor ?? "#fff1f2"),
1263
+ bold: N?.bold === !0
1264
+ }, i.accept();
1265
+ const Z = b.value.get(j);
1266
+ if (Z) {
1267
+ M.value = z(Z.when), I.value = { ...Z.style };
1268
+ const te = new Map(b.value);
1269
+ te.delete(j), b.value = te;
1270
+ }
1271
+ }
1272
+ function Ce(f) {
1273
+ const g = e.datasetSchema?.fields.find(
1274
+ (te) => te.field === M.value.field
1275
+ ), N = e.datasets?.[e.list.dataset]?.find(
1276
+ (te) => te[M.value.field] != null
1277
+ )?.[M.value.field], Z = g?.type === "number" || !g && typeof N == "number";
1278
+ g?.type === "decimal" ? M.value.numeric = "decimal" : Z ? M.value.numeric = "number" : delete M.value.numeric, M.value.value = Z && f.trim() && Number.isFinite(Number(f)) ? Number(f) : f;
1279
+ }
1280
+ function Ue(f = !1) {
1281
+ const g = z(e.list), N = g.columns.find((Z) => Z.field === C.value);
1282
+ if (!N) {
1283
+ V.value = F.value.noSelection;
1284
+ return;
1285
+ }
1286
+ if (T.value === "rowVisibility")
1287
+ f ? delete g.rowVisibleWhen : g.rowVisibleWhen = z(M.value);
1288
+ else if (T.value === "cell")
1289
+ f ? delete N.visibleWhen : N.visibleWhen = z(M.value);
1290
+ else if (N.rules ??= [], f && $.value >= 0)
1291
+ N.rules.splice($.value, 1);
1292
+ else {
1293
+ if (f) return;
1294
+ $.value < 0 ? N.rules.push({
1295
+ when: z(M.value),
1296
+ style: { ...I.value }
1297
+ }) : N.rules[$.value] = {
1298
+ when: z(M.value),
1299
+ style: { ...I.value }
1300
+ };
1301
+ }
1302
+ if (p(g)) {
1303
+ const Z = new Map(b.value);
1304
+ Z.delete(j), b.value = Z, i.accept();
1305
+ }
1306
+ }
1307
+ fe({ key: () => e.recoveryKey ?? "rules:0:0", baseline: () => JSON.stringify(e.list), pending: () => _.value, snapshot: () => JSON.stringify(xe()), restore(f) {
1308
+ const g = JSON.parse(f);
1309
+ s.value = g.formula, h.value = g.groups, M.value = g.when, I.value = g.style, m.value = g.selectedComputed, C.value = g.column, $.value = g.conditionIndex, j = g.conditionKey, T.value = g.effect, W.value = g.tab, r.value = new Map(g.computedDrafts), b.value = new Map(g.conditionDrafts), x.baseline.value = g.formulaBaseline, u.baseline.value = g.groupBaseline, i.baseline.value = g.conditionBaseline;
1310
+ } });
1311
+ function xe() {
1312
+ return { formula: s.value, groups: h.value, when: M.value, style: I.value, selectedComputed: m.value, column: C.value, conditionIndex: $.value, conditionKey: j, effect: T.value, tab: W.value, computedDrafts: [...r.value], conditionDrafts: [...b.value], formulaBaseline: x.baseline.value, groupBaseline: u.baseline.value, conditionBaseline: i.baseline.value };
1313
+ }
1314
+ return {
1315
+ m: F,
1316
+ pendingLocalChanges: _,
1317
+ draftSnapshot: () => JSON.stringify({ formula: s.value, groups: h.value, when: M.value, style: I.value, computedDrafts: [...r.value], conditionDrafts: [...b.value] }),
1318
+ tab: W,
1319
+ fields: Y,
1320
+ formula: s,
1321
+ groups: h,
1322
+ groupIndex: U,
1323
+ currentGroup: ee,
1324
+ column: C,
1325
+ currentColumn: c,
1326
+ conditionIndex: $,
1327
+ effect: T,
1328
+ when: M,
1329
+ style: I,
1330
+ error: V,
1331
+ preview: H,
1332
+ diagnostics: K,
1333
+ selectedComputed: m,
1334
+ loadComputed: G,
1335
+ applyComputed: ue,
1336
+ removeComputed: ne,
1337
+ check: de,
1338
+ setExpression: v,
1339
+ toggleGroupField: n,
1340
+ addGroup: J,
1341
+ moveGroup: L,
1342
+ removeGroup: $e,
1343
+ addAggregate: we,
1344
+ applyGroups: Ve,
1345
+ loadCondition: be,
1346
+ setThreshold: Ce,
1347
+ applyCondition: Ue,
1348
+ applyLayout: p,
1349
+ resetDraft: () => {
1350
+ X = void 0, R();
1351
+ }
1352
+ };
1353
+ }
1354
+ const it = ["aria-label"], nt = { class: "mr-rule-editor__directory" }, dt = ["aria-label"], ot = ["aria-selected", "onClick"], ut = { key: 0 }, rt = { key: 1 }, ct = { class: "mr-rule-editor__catalog" }, mt = ["disabled"], bt = ["aria-label"], vt = { class: "mr-rule-editor__field-list" }, gt = ["disabled", "title", "onClick"], ft = { key: 1 }, yt = {
1355
+ key: 0,
1356
+ class: "mr-rule-editor__panel"
1357
+ }, ht = ["aria-label", "value", "disabled"], kt = { value: "" }, $t = ["value"], wt = ["aria-label", "disabled"], Vt = { class: "mr-rule-editor__pair" }, Ct = ["aria-label", "disabled"], Ut = ["value"], xt = ["aria-label", "disabled"], Ft = { value: "number" }, Mt = { value: "decimal" }, St = {
1358
+ key: 0,
1359
+ class: "mr-rule-editor__checks"
1360
+ }, Dt = ["checked", "disabled", "onChange"], Rt = {
1361
+ key: 2,
1362
+ class: "mr-rule-editor__hint"
1363
+ }, Kt = { class: "mr-rule-editor__advanced" }, Et = ["aria-label", "disabled"], Nt = ["aria-label", "disabled"], Tt = { value: "propagate" }, Lt = { value: "error" }, Bt = ["aria-label", "disabled"], Ot = { value: "error" }, At = { value: "null" }, It = {
1364
+ key: 3,
1365
+ class: "mr-rule-editor__hint"
1366
+ }, Gt = {
1367
+ key: 4,
1368
+ class: "mr-rule-editor__diagnostic"
1369
+ }, Wt = { class: "mr-rule-editor__actions" }, Jt = ["disabled"], jt = ["disabled"], Ht = ["disabled"], zt = {
1370
+ key: 5,
1371
+ class: "mr-rule-editor__error"
1372
+ }, qt = {
1373
+ key: 1,
1374
+ class: "mr-rule-editor__panel"
1375
+ }, Pt = { class: "mr-rule-editor__pair" }, Zt = ["aria-label"], Qt = ["value"], Xt = {
1376
+ key: 0,
1377
+ value: 0
1378
+ }, Yt = ["disabled"], pt = ["aria-label", "disabled"], _t = ["value"], es = { class: "mr-rule-editor__pair" }, ls = ["aria-label", "disabled"], as = ["aria-label", "disabled"], ts = { class: "mr-rule-editor__checks" }, ss = ["disabled"], is = ["disabled"], ns = { class: "mr-rule-editor__pair" }, ds = ["aria-label", "onUpdate:modelValue", "disabled"], os = ["value"], us = ["aria-label", "onUpdate:modelValue", "disabled"], rs = ["value"], cs = ["aria-label", "onUpdate:modelValue", "disabled"], ms = { value: void 0 }, bs = ["value"], vs = { key: 0 }, gs = ["aria-label", "onUpdate:modelValue", "disabled"], fs = ["value"], ys = { class: "mr-rule-editor__pair" }, hs = ["onUpdate:modelValue", "disabled", "aria-label"], ks = { value: "number" }, $s = { value: "decimal" }, ws = ["disabled", "onClick"], Vs = ["disabled"], Cs = { class: "mr-rule-editor__actions" }, Us = ["disabled", "aria-label"], xs = ["disabled", "aria-label"], Fs = ["disabled"], Ms = ["disabled"], Ss = {
1379
+ key: 2,
1380
+ class: "mr-rule-editor__panel"
1381
+ }, Ds = ["aria-label", "disabled"], Rs = ["value"], Ks = ["aria-label", "disabled"], Es = { value: "style" }, Ns = { value: "cell" }, Ts = { value: "rowVisibility" }, Ls = { key: 0 }, Bs = ["aria-label", "value", "disabled"], Os = { value: -1 }, As = ["value"], Is = ["aria-label", "disabled"], Gs = ["value"], Ws = { class: "mr-rule-editor__pair" }, Js = ["aria-label", "disabled"], js = ["value"], Hs = ["value", "disabled"], zs = { class: "mr-rule-editor__pair" }, qs = ["disabled"], Ps = ["disabled"], Zs = { class: "mr-rule-editor__check" }, Qs = ["disabled"], Xs = { class: "mr-rule-editor__actions" }, Ys = ["disabled"], ps = ["disabled"], _s = { class: "mr-rule-editor__explanation" }, ei = { key: 0 }, li = { class: "mr-rule-editor__results" }, ai = { key: 0 }, ti = { key: 1 }, si = {
1382
+ key: 1,
1383
+ class: "mr-rule-editor__error",
1384
+ role: "alert"
1385
+ }, ii = /* @__PURE__ */ re({
1386
+ __name: "RuleEditor",
1387
+ props: {
1388
+ recoveryKey: {},
1389
+ list: {},
1390
+ datasets: {},
1391
+ datasetSchema: {},
1392
+ datasetSchemas: {},
1393
+ readonly: { type: Boolean },
1394
+ messages: {}
1395
+ },
1396
+ emits: ["change", "dirty"],
1397
+ setup(e, { expose: O, emit: F }) {
1398
+ const W = e, V = F, m = st(W, (de) => V("change", de)), {
1399
+ m: s,
1400
+ tab: h,
1401
+ fields: U,
1402
+ formula: C,
1403
+ groups: $,
1404
+ groupIndex: T,
1405
+ currentGroup: M,
1406
+ column: I,
1407
+ currentColumn: H,
1408
+ conditionIndex: x,
1409
+ effect: u,
1410
+ when: i,
1411
+ style: r,
1412
+ error: b,
1413
+ preview: j,
1414
+ diagnostics: Q,
1415
+ selectedComputed: _
1416
+ } = m, X = A({}), Y = A(0);
1417
+ function ee() {
1418
+ m.resetDraft(), X.value = {}, Y.value++;
1419
+ }
1420
+ const c = P(() => m.pendingLocalChanges.value || Object.values(X.value).some(Boolean));
1421
+ ae([c, m.draftSnapshot, X], () => V("dirty", c.value), { immediate: !0, deep: !0, flush: "sync" }), O({ get pendingLocalChanges() {
1422
+ return c.value;
1423
+ } });
1424
+ const K = Te(W, m.formula, s), { query: R, matches: G, fieldWindow: B, expression: p, sources: ue } = K, ne = ce();
1425
+ return (de, v) => (d(), o("section", {
1426
+ class: "mr-rule-editor",
1427
+ "aria-label": l(s).settings
1428
+ }, [
1429
+ a("aside", nt, [
1430
+ a("div", {
1431
+ class: "mr-rule-editor__tabs",
1432
+ role: "tablist",
1433
+ "aria-label": l(s).settings
1434
+ }, [
1435
+ (d(), o(w, null, S([
1436
+ "computations",
1437
+ "groups",
1438
+ "conditions",
1439
+ "detail",
1440
+ "matrix",
1441
+ "tree"
1442
+ ], (n) => a("button", {
1443
+ key: n,
1444
+ type: "button",
1445
+ role: "tab",
1446
+ "aria-selected": l(h) === n,
1447
+ class: ve({ "is-active": l(h) === n }),
1448
+ onClick: (J) => h.value = n
1449
+ }, [
1450
+ y(t(l(s)[n]), 1),
1451
+ n === "computations" && e.list.computed?.length ? (d(), o("span", ut, t(e.list.computed.length), 1)) : D("", !0),
1452
+ n === "groups" && l($).length ? (d(), o("span", rt, t(l($).length), 1)) : D("", !0)
1453
+ ], 10, ot)), 64))
1454
+ ], 8, dt),
1455
+ a("div", ct, [
1456
+ a("strong", null, t(l(s).catalog), 1),
1457
+ c.value ? (d(), o("button", {
1458
+ key: 0,
1459
+ type: "button",
1460
+ disabled: e.readonly,
1461
+ onClick: ee
1462
+ }, t(l(s).restoreDraft), 9, mt)) : D("", !0),
1463
+ a("label", null, [
1464
+ y(t(l(s).searchFields), 1),
1465
+ k(a("input", {
1466
+ "onUpdate:modelValue": v[0] || (v[0] = (n) => ie(R) ? R.value = n : null),
1467
+ type: "search",
1468
+ "aria-label": l(s).searchFields
1469
+ }, null, 8, bt), [
1470
+ [q, l(R)]
1471
+ ])
1472
+ ]),
1473
+ a("div", vt, [
1474
+ (d(!0), o(w, null, S(l(B), (n) => (d(), o("button", {
1475
+ key: n.field,
1476
+ type: "button",
1477
+ disabled: e.readonly || l(h) !== "computations",
1478
+ title: l(s).useField,
1479
+ onClick: (J) => l(m).setExpression({ field: n.field })
1480
+ }, [
1481
+ a("strong", null, t(n.label), 1),
1482
+ a("code", null, t(n.field), 1),
1483
+ a("small", null, t(n.meta), 1)
1484
+ ], 8, gt))), 128))
1485
+ ]),
1486
+ l(G).length > 50 ? (d(), o("small", ft, t(l(s).shown) + " 50 / " + t(l(G).length), 1)) : D("", !0)
1487
+ ])
1488
+ ]),
1489
+ l(h) === "computations" ? (d(), o("div", yt, [
1490
+ a("label", null, [
1491
+ y(t(l(s).existing), 1),
1492
+ a("select", {
1493
+ "aria-label": l(s).existing,
1494
+ value: l(_),
1495
+ disabled: e.readonly,
1496
+ onChange: v[1] || (v[1] = (n) => l(m).loadComputed(n.target.value))
1497
+ }, [
1498
+ a("option", kt, "+ " + t(l(s).newField), 1),
1499
+ (d(!0), o(w, null, S(e.list.computed, (n) => (d(), o("option", {
1500
+ key: n.field,
1501
+ value: n.field
1502
+ }, t(n.field), 9, $t))), 128))
1503
+ ], 40, ht)
1504
+ ]),
1505
+ a("label", null, [
1506
+ y(t(l(s).target), 1),
1507
+ k(a("input", {
1508
+ "aria-label": l(s).target,
1509
+ "onUpdate:modelValue": v[2] || (v[2] = (n) => l(C).field = n),
1510
+ disabled: e.readonly,
1511
+ autocomplete: "off"
1512
+ }, null, 8, wt), [
1513
+ [q, l(C).field]
1514
+ ])
1515
+ ]),
1516
+ a("div", Vt, [
1517
+ a("label", null, [
1518
+ y(t(l(s).scope), 1),
1519
+ k(a("select", {
1520
+ "aria-label": l(s).scope,
1521
+ "onUpdate:modelValue": v[3] || (v[3] = (n) => l(C).scope = n),
1522
+ disabled: e.readonly
1523
+ }, [
1524
+ (d(!0), o(w, null, S(l(ne).scopes, (n) => (d(), o("option", {
1525
+ key: n,
1526
+ value: n
1527
+ }, t(l(s)[n]), 9, Ut))), 128))
1528
+ ], 8, Ct), [
1529
+ [E, l(C).scope]
1530
+ ])
1531
+ ]),
1532
+ a("label", null, [
1533
+ y(t(l(s).numeric), 1),
1534
+ k(a("select", {
1535
+ "aria-label": l(s).numeric,
1536
+ "onUpdate:modelValue": v[4] || (v[4] = (n) => l(C).numeric = n),
1537
+ disabled: e.readonly
1538
+ }, [
1539
+ a("option", Ft, t(l(s).number), 1),
1540
+ a("option", Mt, t(l(s).decimal), 1)
1541
+ ], 8, xt), [
1542
+ [E, l(C).numeric]
1543
+ ])
1544
+ ])
1545
+ ]),
1546
+ l(C).scope === "group" ? (d(), o("fieldset", St, [
1547
+ a("legend", null, t(l(s).groupFields), 1),
1548
+ (d(!0), o(w, null, S(l(U), (n) => (d(), o("label", {
1549
+ key: n.field
1550
+ }, [
1551
+ a("input", {
1552
+ type: "checkbox",
1553
+ checked: l(C).groupBy?.includes(n.field),
1554
+ disabled: e.readonly,
1555
+ onChange: (J) => l(m).toggleGroupField(
1556
+ n.field,
1557
+ J.target.checked
1558
+ )
1559
+ }, null, 40, Dt),
1560
+ y(t(n.label), 1)
1561
+ ]))), 128))
1562
+ ])) : D("", !0),
1563
+ typeof l(C).expression != "string" ? (d(), Me(tt, {
1564
+ key: 1,
1565
+ "model-value": l(C).expression,
1566
+ fields: l(U),
1567
+ messages: l(s),
1568
+ readonly: e.readonly,
1569
+ "onUpdate:modelValue": l(m).setExpression
1570
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"])) : (d(), o("p", Rt, t(l(C).expression), 1)),
1571
+ a("details", null, [
1572
+ a("summary", null, t(l(s).advanced), 1),
1573
+ a("div", Kt, [
1574
+ a("label", null, [
1575
+ y(t(l(s).digits), 1),
1576
+ k(a("input", {
1577
+ "aria-label": l(s).digits,
1578
+ "onUpdate:modelValue": v[5] || (v[5] = (n) => l(C).digits = n),
1579
+ type: "number",
1580
+ min: "0",
1581
+ max: "100",
1582
+ disabled: e.readonly
1583
+ }, null, 8, Et), [
1584
+ [
1585
+ q,
1586
+ l(C).digits,
1587
+ void 0,
1588
+ { number: !0 }
1589
+ ]
1590
+ ])
1591
+ ]),
1592
+ a("label", null, [
1593
+ y(t(l(s).nulls), 1),
1594
+ k(a("select", {
1595
+ "aria-label": l(s).nulls,
1596
+ "onUpdate:modelValue": v[6] || (v[6] = (n) => l(C).nulls = n),
1597
+ disabled: e.readonly
1598
+ }, [
1599
+ a("option", Tt, t(l(s).propagate), 1),
1600
+ a("option", Lt, t(l(s).error), 1)
1601
+ ], 8, Nt), [
1602
+ [E, l(C).nulls]
1603
+ ])
1604
+ ]),
1605
+ a("label", null, [
1606
+ y(t(l(s).division), 1),
1607
+ k(a("select", {
1608
+ "aria-label": l(s).division,
1609
+ "onUpdate:modelValue": v[7] || (v[7] = (n) => l(C).divisionByZero = n),
1610
+ disabled: e.readonly
1611
+ }, [
1612
+ a("option", Ot, t(l(s).error), 1),
1613
+ a("option", At, t(l(s).propagate), 1)
1614
+ ], 8, Bt), [
1615
+ [E, l(C).divisionByZero]
1616
+ ])
1617
+ ])
1618
+ ])
1619
+ ]),
1620
+ l(C).numeric === "decimal" ? (d(), o("p", It, t(l(s).decimalHint), 1)) : D("", !0),
1621
+ l(Q).valid && l(C).field ? (d(), o("div", Gt, [
1622
+ y(t(l(s).dependencies), 1),
1623
+ a("strong", null, t(l(Q).order.join(" → ")), 1)
1624
+ ])) : D("", !0),
1625
+ a("div", Wt, [
1626
+ a("button", {
1627
+ type: "button",
1628
+ disabled: e.readonly,
1629
+ onClick: v[8] || (v[8] = //@ts-ignore
1630
+ (...n) => l(m).check && l(m).check(...n))
1631
+ }, t(l(s).check), 9, Jt),
1632
+ a("button", {
1633
+ type: "button",
1634
+ class: "mr-rule-editor__primary",
1635
+ disabled: e.readonly || !l(Q).valid,
1636
+ onClick: v[9] || (v[9] = //@ts-ignore
1637
+ (...n) => l(m).applyComputed && l(m).applyComputed(...n))
1638
+ }, t(l(s).apply), 9, jt),
1639
+ l(_) ? (d(), o("button", {
1640
+ key: 0,
1641
+ type: "button",
1642
+ disabled: e.readonly,
1643
+ onClick: v[10] || (v[10] = //@ts-ignore
1644
+ (...n) => l(m).removeComputed && l(m).removeComputed(...n))
1645
+ }, t(l(s).remove), 9, Ht)) : D("", !0)
1646
+ ]),
1647
+ !l(Q).valid && l(C).field ? (d(), o("p", zt, t(l(Q).errors.join(";")), 1)) : D("", !0)
1648
+ ])) : l(h) === "groups" ? (d(), o("div", qt, [
1649
+ a("div", Pt, [
1650
+ k(a("select", {
1651
+ "onUpdate:modelValue": v[11] || (v[11] = (n) => ie(T) ? T.value = n : null),
1652
+ "aria-label": l(s).groups
1653
+ }, [
1654
+ (d(!0), o(w, null, S(l($), (n, J) => (d(), o("option", {
1655
+ key: J,
1656
+ value: J
1657
+ }, t(J + 1) + " · " + t(n.field), 9, Qt))), 128)),
1658
+ l($).length ? D("", !0) : (d(), o("option", Xt, t(l(s).noGroups), 1))
1659
+ ], 8, Zt), [
1660
+ [
1661
+ E,
1662
+ l(T),
1663
+ void 0,
1664
+ { number: !0 }
1665
+ ]
1666
+ ]),
1667
+ a("button", {
1668
+ type: "button",
1669
+ disabled: e.readonly || l($).length >= 16,
1670
+ onClick: v[12] || (v[12] = //@ts-ignore
1671
+ (...n) => l(m).addGroup && l(m).addGroup(...n))
1672
+ }, " + " + t(l(s).addGroup), 9, Yt)
1673
+ ]),
1674
+ l(M) ? (d(), o(w, { key: 0 }, [
1675
+ a("label", null, [
1676
+ y(t(l(s).field), 1),
1677
+ k(a("select", {
1678
+ "aria-label": l(s).field,
1679
+ "onUpdate:modelValue": v[13] || (v[13] = (n) => l(M).field = n),
1680
+ disabled: e.readonly
1681
+ }, [
1682
+ (d(!0), o(w, null, S(l(U), (n) => (d(), o("option", {
1683
+ key: n.field,
1684
+ value: n.field
1685
+ }, t(n.label), 9, _t))), 128))
1686
+ ], 8, pt), [
1687
+ [E, l(M).field]
1688
+ ])
1689
+ ]),
1690
+ a("div", es, [
1691
+ a("label", null, [
1692
+ y(t(l(s).header), 1),
1693
+ k(a("input", {
1694
+ "aria-label": l(s).header,
1695
+ "onUpdate:modelValue": v[14] || (v[14] = (n) => l(M).headerTemplate = n),
1696
+ disabled: e.readonly,
1697
+ placeholder: "{value}"
1698
+ }, null, 8, ls), [
1699
+ [q, l(M).headerTemplate]
1700
+ ])
1701
+ ]),
1702
+ a("label", null, [
1703
+ y(t(l(s).footer), 1),
1704
+ k(a("input", {
1705
+ "aria-label": l(s).footer,
1706
+ "onUpdate:modelValue": v[15] || (v[15] = (n) => l(M).subtotalLabel = n),
1707
+ disabled: e.readonly
1708
+ }, null, 8, as), [
1709
+ [q, l(M).subtotalLabel]
1710
+ ])
1711
+ ])
1712
+ ]),
1713
+ a("div", ts, [
1714
+ a("label", null, [
1715
+ k(a("input", {
1716
+ "onUpdate:modelValue": v[16] || (v[16] = (n) => l(M).keepWithNext = n),
1717
+ type: "checkbox",
1718
+ disabled: e.readonly
1719
+ }, null, 8, ss), [
1720
+ [se, l(M).keepWithNext]
1721
+ ]),
1722
+ y(t(l(s).orphan), 1)
1723
+ ]),
1724
+ a("label", null, [
1725
+ k(a("input", {
1726
+ "onUpdate:modelValue": v[17] || (v[17] = (n) => l(M).repeatHeader = n),
1727
+ type: "checkbox",
1728
+ disabled: e.readonly
1729
+ }, null, 8, is), [
1730
+ [se, l(M).repeatHeader]
1731
+ ]),
1732
+ y(t(l(s).repeat), 1)
1733
+ ])
1734
+ ]),
1735
+ (d(!0), o(w, null, S(l(M).aggregates, (n, J) => (d(), o("div", {
1736
+ key: J,
1737
+ class: "mr-rule-editor__aggregate"
1738
+ }, [
1739
+ a("div", ns, [
1740
+ a("label", null, [
1741
+ y(t(l(s).output), 1),
1742
+ k(a("select", {
1743
+ "aria-label": l(s).output,
1744
+ "onUpdate:modelValue": (L) => n.field = L,
1745
+ disabled: e.readonly
1746
+ }, [
1747
+ (d(!0), o(w, null, S(l(U), (L) => (d(), o("option", {
1748
+ key: L.field,
1749
+ value: L.field
1750
+ }, t(L.label), 9, os))), 128))
1751
+ ], 8, ds), [
1752
+ [E, n.field]
1753
+ ])
1754
+ ]),
1755
+ a("label", null, [
1756
+ y(t(l(s).aggregate), 1),
1757
+ k(a("select", {
1758
+ "aria-label": l(s).aggregate,
1759
+ "onUpdate:modelValue": (L) => n.op = L,
1760
+ disabled: e.readonly
1761
+ }, [
1762
+ (d(!0), o(w, null, S(l(ne).aggregates, (L) => (d(), o("option", {
1763
+ key: L,
1764
+ value: L
1765
+ }, t(l(s)[L]), 9, rs))), 128))
1766
+ ], 8, us), [
1767
+ [E, n.op]
1768
+ ])
1769
+ ])
1770
+ ]),
1771
+ a("label", null, [
1772
+ y(t(l(s).measure), 1),
1773
+ k(a("select", {
1774
+ "aria-label": l(s).measure,
1775
+ "onUpdate:modelValue": (L) => n.valueField = L,
1776
+ disabled: e.readonly
1777
+ }, [
1778
+ a("option", ms, t(n.field), 1),
1779
+ (d(!0), o(w, null, S(l(U), (L) => (d(), o("option", {
1780
+ key: L.field,
1781
+ value: L.field
1782
+ }, t(L.label), 9, bs))), 128))
1783
+ ], 8, cs), [
1784
+ [E, n.valueField]
1785
+ ])
1786
+ ]),
1787
+ n.op === "weightedAvg" ? (d(), o("label", vs, [
1788
+ y(t(l(s).weight), 1),
1789
+ k(a("select", {
1790
+ "aria-label": l(s).weight,
1791
+ "onUpdate:modelValue": (L) => n.weightField = L,
1792
+ disabled: e.readonly
1793
+ }, [
1794
+ (d(!0), o(w, null, S(l(U), (L) => (d(), o("option", {
1795
+ key: L.field,
1796
+ value: L.field
1797
+ }, t(L.label), 9, fs))), 128))
1798
+ ], 8, gs), [
1799
+ [E, n.weightField]
1800
+ ])
1801
+ ])) : D("", !0),
1802
+ a("div", ys, [
1803
+ k(a("select", {
1804
+ "onUpdate:modelValue": (L) => n.numeric = L,
1805
+ disabled: e.readonly,
1806
+ "aria-label": l(s).numeric
1807
+ }, [
1808
+ a("option", ks, t(l(s).number), 1),
1809
+ a("option", $s, t(l(s).decimal), 1)
1810
+ ], 8, hs), [
1811
+ [E, n.numeric]
1812
+ ]),
1813
+ a("button", {
1814
+ type: "button",
1815
+ disabled: e.readonly,
1816
+ onClick: (L) => l(M).aggregates?.splice(J, 1)
1817
+ }, t(l(s).remove), 9, ws)
1818
+ ])
1819
+ ]))), 128)),
1820
+ a("button", {
1821
+ type: "button",
1822
+ disabled: e.readonly,
1823
+ onClick: v[18] || (v[18] = //@ts-ignore
1824
+ (...n) => l(m).addAggregate && l(m).addAggregate(...n))
1825
+ }, " + " + t(l(s).addAggregate), 9, Vs),
1826
+ a("div", Cs, [
1827
+ a("button", {
1828
+ type: "button",
1829
+ disabled: e.readonly || l(T) === 0,
1830
+ "aria-label": l(s).moveUp,
1831
+ onClick: v[19] || (v[19] = (n) => l(m).moveGroup(-1))
1832
+ }, " ↑ " + t(l(s).outer), 9, Us),
1833
+ a("button", {
1834
+ type: "button",
1835
+ disabled: e.readonly || l(T) >= l($).length - 1,
1836
+ "aria-label": l(s).moveDown,
1837
+ onClick: v[20] || (v[20] = (n) => l(m).moveGroup(1))
1838
+ }, " ↓ " + t(l(s).inner), 9, xs),
1839
+ a("button", {
1840
+ type: "button",
1841
+ disabled: e.readonly,
1842
+ onClick: v[21] || (v[21] = //@ts-ignore
1843
+ (...n) => l(m).removeGroup && l(m).removeGroup(...n))
1844
+ }, t(l(s).remove), 9, Fs)
1845
+ ])
1846
+ ], 64)) : D("", !0),
1847
+ a("button", {
1848
+ type: "button",
1849
+ class: "mr-rule-editor__primary",
1850
+ disabled: e.readonly,
1851
+ onClick: v[22] || (v[22] = //@ts-ignore
1852
+ (...n) => l(m).applyGroups && l(m).applyGroups(...n))
1853
+ }, t(l(s).apply), 9, Ms)
1854
+ ])) : l(h) === "conditions" ? (d(), o("div", Ss, [
1855
+ a("label", null, [
1856
+ y(t(l(s).column), 1),
1857
+ k(a("select", {
1858
+ "aria-label": l(s).column,
1859
+ "onUpdate:modelValue": v[23] || (v[23] = (n) => ie(I) ? I.value = n : null),
1860
+ disabled: e.readonly,
1861
+ onChange: v[24] || (v[24] = (n) => l(m).loadCondition(-1))
1862
+ }, [
1863
+ (d(!0), o(w, null, S(e.list.columns, (n) => (d(), o("option", {
1864
+ key: n.field,
1865
+ value: n.field
1866
+ }, t(n.header || n.field), 9, Rs))), 128))
1867
+ ], 40, Ds), [
1868
+ [E, l(I)]
1869
+ ])
1870
+ ]),
1871
+ a("label", null, [
1872
+ y(t(l(s).effect), 1),
1873
+ k(a("select", {
1874
+ "aria-label": l(s).effect,
1875
+ "onUpdate:modelValue": v[25] || (v[25] = (n) => ie(u) ? u.value = n : null),
1876
+ disabled: e.readonly,
1877
+ onChange: v[26] || (v[26] = (n) => l(m).loadCondition(-1))
1878
+ }, [
1879
+ a("option", Es, t(l(s).style), 1),
1880
+ a("option", Ns, t(l(s).cell), 1),
1881
+ a("option", Ts, t(l(s).rowVisibility), 1)
1882
+ ], 40, Ks), [
1883
+ [E, l(u)]
1884
+ ])
1885
+ ]),
1886
+ l(u) === "style" ? (d(), o("label", Ls, [
1887
+ y(t(l(s).existing), 1),
1888
+ a("select", {
1889
+ "aria-label": l(s).existing,
1890
+ value: l(x),
1891
+ disabled: e.readonly,
1892
+ onChange: v[27] || (v[27] = (n) => l(m).loadCondition(
1893
+ Number(n.target.value)
1894
+ ))
1895
+ }, [
1896
+ a("option", Os, "+ " + t(l(s).newCondition), 1),
1897
+ (d(!0), o(w, null, S(l(H)?.rules, (n, J) => (d(), o("option", {
1898
+ key: J,
1899
+ value: J
1900
+ }, t(J + 1) + " · " + t(n.when.field) + " " + t(n.when.op) + " " + t(n.when.value), 9, As))), 128))
1901
+ ], 40, Bs)
1902
+ ])) : D("", !0),
1903
+ a("label", null, [
1904
+ y(t(l(s).condition), 1),
1905
+ k(a("select", {
1906
+ "aria-label": l(s).condition,
1907
+ "onUpdate:modelValue": v[28] || (v[28] = (n) => l(i).field = n),
1908
+ disabled: e.readonly
1909
+ }, [
1910
+ (d(!0), o(w, null, S(l(U), (n) => (d(), o("option", {
1911
+ key: n.field,
1912
+ value: n.field
1913
+ }, t(n.label), 9, Gs))), 128))
1914
+ ], 8, Is), [
1915
+ [E, l(i).field]
1916
+ ])
1917
+ ]),
1918
+ a("div", Ws, [
1919
+ a("label", null, [
1920
+ y(t(l(s).comparison), 1),
1921
+ k(a("select", {
1922
+ "aria-label": l(s).comparison,
1923
+ "onUpdate:modelValue": v[29] || (v[29] = (n) => l(i).op = n),
1924
+ disabled: e.readonly
1925
+ }, [
1926
+ (d(), o(w, null, S([">", ">=", "<", "<=", "==", "!="], (n) => a("option", {
1927
+ key: n,
1928
+ value: n
1929
+ }, t(n), 9, js)), 64))
1930
+ ], 8, Js), [
1931
+ [E, l(i).op]
1932
+ ])
1933
+ ]),
1934
+ a("label", null, [
1935
+ y(t(l(s).threshold), 1),
1936
+ a("input", {
1937
+ value: l(i).value,
1938
+ disabled: e.readonly,
1939
+ onInput: v[30] || (v[30] = (n) => l(m).setThreshold(n.target.value))
1940
+ }, null, 40, Hs)
1941
+ ])
1942
+ ]),
1943
+ l(u) === "style" ? (d(), o(w, { key: 1 }, [
1944
+ a("div", zs, [
1945
+ a("label", null, [
1946
+ y(t(l(s).color), 1),
1947
+ k(a("input", {
1948
+ "onUpdate:modelValue": v[31] || (v[31] = (n) => l(r).color = n),
1949
+ type: "color",
1950
+ disabled: e.readonly
1951
+ }, null, 8, qs), [
1952
+ [q, l(r).color]
1953
+ ])
1954
+ ]),
1955
+ a("label", null, [
1956
+ y(t(l(s).background), 1),
1957
+ k(a("input", {
1958
+ "onUpdate:modelValue": v[32] || (v[32] = (n) => l(r).backgroundColor = n),
1959
+ type: "color",
1960
+ disabled: e.readonly
1961
+ }, null, 8, Ps), [
1962
+ [q, l(r).backgroundColor]
1963
+ ])
1964
+ ])
1965
+ ]),
1966
+ a("label", Zs, [
1967
+ k(a("input", {
1968
+ "onUpdate:modelValue": v[33] || (v[33] = (n) => l(r).bold = n),
1969
+ type: "checkbox",
1970
+ disabled: e.readonly
1971
+ }, null, 8, Qs), [
1972
+ [se, l(r).bold]
1973
+ ]),
1974
+ y(t(l(s).bold), 1)
1975
+ ])
1976
+ ], 64)) : D("", !0),
1977
+ a("div", Xs, [
1978
+ a("button", {
1979
+ type: "button",
1980
+ class: "mr-rule-editor__primary",
1981
+ disabled: e.readonly,
1982
+ onClick: v[34] || (v[34] = (n) => l(m).applyCondition())
1983
+ }, t(l(s).apply), 9, Ys),
1984
+ l(x) >= 0 || l(u) !== "style" ? (d(), o("button", {
1985
+ key: 0,
1986
+ type: "button",
1987
+ disabled: e.readonly,
1988
+ onClick: v[35] || (v[35] = (n) => l(m).applyCondition(!0))
1989
+ }, t(l(s).removeCondition), 9, ps)) : D("", !0)
1990
+ ])
1991
+ ])) : D("", !0),
1992
+ (d(), o(w, null, S(["detail", "matrix", "tree"], (n) => k(ge(Fa, {
1993
+ key: `${n}-${Y.value}`,
1994
+ list: e.list,
1995
+ "recovery-key": e.recoveryKey,
1996
+ mode: n,
1997
+ datasets: e.datasets,
1998
+ "dataset-schema": e.datasetSchema,
1999
+ "dataset-schemas": e.datasetSchemas,
2000
+ readonly: e.readonly,
2001
+ messages: l(s),
2002
+ accept: l(m).applyLayout,
2003
+ onDirty: (J) => X.value = { ...X.value, [n]: J }
2004
+ }, null, 8, ["list", "recovery-key", "mode", "datasets", "dataset-schema", "dataset-schemas", "readonly", "messages", "accept", "onDirty"]), [
2005
+ [Se, l(h) === n]
2006
+ ])), 64)),
2007
+ a("aside", _s, [
2008
+ a("header", null, [
2009
+ a("strong", null, t(l(s).explanation), 1),
2010
+ c.value ? (d(), o("span", ei, t(l(s).pending), 1)) : D("", !0)
2011
+ ]),
2012
+ a("p", null, t(l(s).sourceHint), 1),
2013
+ l(h) === "computations" ? (d(), o(w, { key: 0 }, [
2014
+ a("h4", null, t(l(s).expression), 1),
2015
+ a("code", null, t(l(p)), 1),
2016
+ a("div", li, [
2017
+ a("h4", null, t(l(s).sourceValues) + " → " + t(l(s).result), 1),
2018
+ (d(!0), o(w, null, S(l(ue), (n) => (d(), o("div", {
2019
+ key: n.row,
2020
+ class: "mr-rule-editor__trace"
2021
+ }, [
2022
+ a("small", null, "#" + t(n.row), 1),
2023
+ a("code", null, t(n.values), 1),
2024
+ a("strong", null, t(l(j).find((J) => J.row === n.row)?.value ?? (l(j).length ? "—" : l(s).notChecked)), 1)
2025
+ ]))), 128)),
2026
+ l(j).some((n) => n.value == null) ? (d(), o("p", ai, t(l(s).nullReason), 1)) : D("", !0),
2027
+ l(j).length ? (d(), o("p", ti, t(l(s).sample), 1)) : D("", !0)
2028
+ ])
2029
+ ], 64)) : D("", !0),
2030
+ l(b) ? (d(), o("p", si, t(l(b)), 1)) : D("", !0)
2031
+ ])
2032
+ ], 8, it));
2033
+ }
2034
+ }), gi = /* @__PURE__ */ me(ii, [["__scopeId", "data-v-f5eea239"]]);
2035
+ export {
2036
+ gi as default
2037
+ };