@agile-team/mach-report 2.22.0 → 2.23.1

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 (171) hide show
  1. package/README.md +8 -6
  2. package/dist/ExcelBindingWizard-BrTmdo7f.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CcDMLO8Q.js +1486 -0
  4. package/dist/ParamEditor-BGjovFUe.js +737 -0
  5. package/dist/ParamEditor-CeNp4_zQ.cjs +1 -0
  6. package/dist/ReportBatchPanel-CHxBtG9R.cjs +1 -0
  7. package/dist/ReportBatchPanel-CJB67WNd.js +351 -0
  8. package/dist/ReportLabelStudio-Tplc1TLJ.js +784 -0
  9. package/dist/ReportLabelStudio-g8PkqJWn.cjs +1 -0
  10. package/dist/ReportParamPanel-C7fZTllk.cjs +1 -0
  11. package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-GI43aGa0.js} +146 -127
  12. package/dist/ReportPreview-BoGBGyRr.cjs +6 -0
  13. package/dist/ReportPreview-QLONCyci.js +6257 -0
  14. package/dist/ReportTemplateLibrary-BFQIX0sg.cjs +1 -0
  15. package/dist/ReportTemplateLibrary-KqX4E2sN.js +312 -0
  16. package/dist/RuleEditor-BZUP9yvL.cjs +1 -0
  17. package/dist/RuleEditor-OPX1awrH.js +2342 -0
  18. package/dist/TemplateOutlinePanel-CVYKVLv_.cjs +1 -0
  19. package/dist/TemplateOutlinePanel-DQS-eOs6.js +97 -0
  20. package/dist/TemplateReusePanel-CY6O93Zk.cjs +1 -0
  21. package/dist/TemplateReusePanel-DKXiFTyB.js +389 -0
  22. package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +1 -0
  23. package/dist/TemplateReviewPanel-Dijwm9YE.js +593 -0
  24. package/dist/analytics.cjs +1 -1
  25. package/dist/analytics.js +26 -26
  26. package/dist/artifact-integrity.json +106 -104
  27. package/dist/assets-D2gHc4Mz.cjs +1 -0
  28. package/dist/assets-T_gDeFaz.js +132 -0
  29. package/dist/auto-BB99S802.js +257 -0
  30. package/dist/auto-BrPWo7Xm.cjs +1 -0
  31. package/dist/capabilities-DiBj4Qgl.cjs +1 -0
  32. package/dist/capabilities-pg7j7VLT.js +106 -0
  33. package/dist/charts-Cjw5AYkg.cjs +1 -0
  34. package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
  35. package/dist/computed-DK6BruFz.cjs +1 -0
  36. package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
  37. package/dist/data-bar-CeZuFmYl.cjs +1 -0
  38. package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
  39. package/dist/designer-BZoVWTgl.js +7172 -0
  40. package/dist/designer-zS2uKJmY.cjs +2 -0
  41. package/dist/designer.cjs +1 -1
  42. package/dist/designer.d.cts +105 -45
  43. package/dist/designer.d.ts +105 -45
  44. package/dist/designer.js +4 -4
  45. package/dist/dom-ChE5D-L-.cjs +1 -0
  46. package/dist/dom-JWrchIre.js +452 -0
  47. package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
  48. package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
  49. package/dist/{encoding-ncQAvyOv.cjs → encoding-7lquyj0w.cjs} +1 -1
  50. package/dist/{encoding-DbnhbwI8.js → encoding-CEd-dq9A.js} +2 -2
  51. package/dist/{font-loader-Di0lQKFf.js → font-loader-CNWXomuV.js} +1 -1
  52. package/dist/{font-loader-BB372_XN.cjs → font-loader-D8pI87fL.cjs} +1 -1
  53. package/dist/grid-strokes-Be24LGuV.cjs +1 -0
  54. package/dist/grid-strokes-EoY66L2f.js +53 -0
  55. package/dist/index.cjs +8 -8
  56. package/dist/index.d.cts +6 -1
  57. package/dist/index.d.ts +6 -1
  58. package/dist/index.js +944 -1259
  59. package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-BRnzKudk.js} +763 -776
  60. package/dist/json-snapshot-DNiIbpOr.cjs +2 -0
  61. package/dist/matrix-B8QWbsGM.cjs +1 -0
  62. package/dist/matrix-C6e_r_vp.js +302 -0
  63. package/dist/{pdf-DmlnL5eB.js → pdf-CJToa81Z.js} +20 -20
  64. package/dist/{pdf-CARdBcuw.cjs → pdf-DpMkW72B.cjs} +42 -42
  65. package/dist/pdf.cjs +1 -1
  66. package/dist/pdf.js +2 -2
  67. package/dist/{plugin-AcAQ2m9X.cjs → plugin-BWTp-X7b.cjs} +1 -1
  68. package/dist/{plugin-w5Nyt08U.js → plugin-_BkUVc2z.js} +1 -1
  69. package/dist/{prefill-BXBxx5We.js → prefill-CWGdnqQd.js} +21 -21
  70. package/dist/prefill-PaAy6wLk.cjs +1 -0
  71. package/dist/prepared-CJy_qk7d.js +94 -0
  72. package/dist/prepared-D0yCSxSO.cjs +1 -0
  73. package/dist/progress-ByiOxUD3.js +250 -0
  74. package/dist/progress-WomPRP3B.cjs +1 -0
  75. package/dist/{protocol-fjaeKkjf.js → protocol-BG16rz6D.js} +3 -3
  76. package/dist/{protocol-C9ZaylID.cjs → protocol-wzhl1Fim.cjs} +1 -1
  77. package/dist/record-bindings-DatJZv_e.js +200 -0
  78. package/dist/record-bindings-MBxbeBsi.cjs +1 -0
  79. package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
  80. package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
  81. package/dist/report-encoding-worker.cjs +1 -1
  82. package/dist/report-encoding-worker.js +1 -1
  83. package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
  84. package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
  85. package/dist/runtime-DYMOS_gz.cjs +1 -0
  86. package/dist/{runtime-BTtpjF3D.js → runtime-PiCax9zQ.js} +52 -51
  87. package/dist/sbom.cdx.json +1 -1
  88. package/dist/server-node.cjs +5 -5
  89. package/dist/server-node.js +1676 -1619
  90. package/dist/server.cjs +1 -1
  91. package/dist/server.js +24 -24
  92. package/dist/style.css +1 -1
  93. package/dist/{template-catalog-JSxSqk5y.js → template-catalog-CRuZL3pi.js} +17 -17
  94. package/dist/template-catalog-DtrtT1FY.cjs +1 -0
  95. package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
  96. package/dist/template-fragments-GVjpew_q.cjs +1 -0
  97. package/dist/template-registry-DI59PXVK.cjs +1 -0
  98. package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
  99. package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
  100. package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
  101. package/dist/textwrap-D4ZksyMK.js +111 -0
  102. package/dist/textwrap-DEHqAjKZ.cjs +4 -0
  103. package/dist/vue/async.d.cts +31 -0
  104. package/dist/vue/async.d.ts +31 -0
  105. package/dist/vue/index.d.cts +32 -1
  106. package/dist/vue/index.d.ts +32 -1
  107. package/dist/vue-async.cjs +1 -1
  108. package/dist/vue-async.js +3 -3
  109. package/dist/vue.cjs +1 -1
  110. package/dist/vue.js +52 -47
  111. package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
  112. package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
  113. package/dist/worker.cjs +1 -1
  114. package/dist/worker.js +4 -4
  115. package/dist/xlsx.cjs +4 -4
  116. package/dist/xlsx.js +184 -179
  117. package/package.json +1 -1
  118. package/dist/ExcelBindingWizard-CW79I6Gl.cjs +0 -1
  119. package/dist/ExcelBindingWizard-CZyppD7I.js +0 -1485
  120. package/dist/ParamEditor-CiYCJI0b.cjs +0 -1
  121. package/dist/ParamEditor-DQit-Gdf.js +0 -732
  122. package/dist/ReportBatchPanel-DKTpV7MU.js +0 -350
  123. package/dist/ReportBatchPanel-Db6TAfG5.cjs +0 -1
  124. package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
  125. package/dist/ReportLabelStudio-BYnRqmje.js +0 -780
  126. package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
  127. package/dist/ReportPreview-BDgKssYR.js +0 -5887
  128. package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
  129. package/dist/ReportTemplateLibrary-BZuKn0YK.js +0 -311
  130. package/dist/ReportTemplateLibrary-DEXH07ND.cjs +0 -1
  131. package/dist/RuleEditor-CIQn547x.js +0 -2341
  132. package/dist/RuleEditor-zSUmPjKa.cjs +0 -1
  133. package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
  134. package/dist/TemplateOutlinePanel-D0PgOSQE.js +0 -96
  135. package/dist/TemplateReusePanel-BKlAEF8-.js +0 -388
  136. package/dist/TemplateReusePanel-DAy_Hwqz.cjs +0 -1
  137. package/dist/TemplateReviewPanel-CowmHaQQ.cjs +0 -1
  138. package/dist/TemplateReviewPanel-div-EH_m.js +0 -592
  139. package/dist/assets-CxHunY_9.js +0 -232
  140. package/dist/assets-vbjAGgk8.cjs +0 -1
  141. package/dist/auto-DcUHlKob.cjs +0 -1
  142. package/dist/auto-moShblh1.js +0 -240
  143. package/dist/charts-aCtoswXq.cjs +0 -1
  144. package/dist/component-tree-1_QCiQJX.js +0 -67
  145. package/dist/component-tree-BjZIp6w9.cjs +0 -1
  146. package/dist/computed-4TnxzgIh.cjs +0 -1
  147. package/dist/data-bar-YltqGTaC.cjs +0 -1
  148. package/dist/designer-B7jJeAeG.js +0 -6914
  149. package/dist/designer-BWQVpJeN.cjs +0 -2
  150. package/dist/grid-geometry-D3SJgWFv.js +0 -136
  151. package/dist/grid-geometry-D8ReblRV.cjs +0 -1
  152. package/dist/json-snapshot-nyV63AbB.cjs +0 -2
  153. package/dist/matrix-0hywp0-F.cjs +0 -1
  154. package/dist/matrix-Dy-tyY7E.js +0 -381
  155. package/dist/prefill-DUvejVt1.cjs +0 -1
  156. package/dist/prepared-YXy-fVLw.cjs +0 -1
  157. package/dist/prepared-rXCKqdHY.js +0 -88
  158. package/dist/progress-B0ctFpKf.cjs +0 -1
  159. package/dist/progress-Hc2vxoCs.js +0 -52
  160. package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
  161. package/dist/record-bindings-VZGS-Qd8.js +0 -155
  162. package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
  163. package/dist/rich-text-layout-wxBhnAS7.js +0 -102
  164. package/dist/runtime-Dq0LUsyS.cjs +0 -1
  165. package/dist/template-catalog-CLAM4w7H.cjs +0 -1
  166. package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
  167. package/dist/template-outline-CDWXptuj.js +0 -88
  168. package/dist/template-outline-K4jGhATu.cjs +0 -1
  169. package/dist/template-registry-CWnuGqyP.cjs +0 -1
  170. package/dist/textwrap-CkGjRFT3.js +0 -110
  171. package/dist/textwrap-OTOUMr4f.cjs +0 -4
@@ -0,0 +1,2342 @@
1
+ import { ref as J, computed as P, defineComponent as me, resolveComponent as fe, openBlock as i, createElementBlock as s, normalizeClass as be, createElementVNode as a, createTextVNode as k, toDisplayString as t, createCommentVNode as x, Fragment as C, renderList as M, createVNode as ce, watch as se, withDirectives as F, isRef as ue, vModelCheckbox as oe, unref as l, vModelSelect as O, vModelText as Q, createBlock as he, normalizeStyle as Ee, vShow as Te } from "vue";
2
+ import { a as ke, D as Ke, u as Le } from "./designer-BZoVWTgl.js";
3
+ import { r as Be, j as ge, v as Oe, e as Ae } from "./computed-f3pOqWLX.js";
4
+ import { _ as ve } from "./_plugin-vue_export-helper-8SL1F89S.js";
5
+ import { u as re } from "./useLocalDraft-BnhcxXk_.js";
6
+ import { c as Ie } from "./matrix-C6e_r_vp.js";
7
+ import { v as $e } from "./template-registry-O0hNIOfB.js";
8
+ import { c as We } from "./template-serialization-CWmHq7lX.js";
9
+ function Ve(e, W = /* @__PURE__ */ new Set()) {
10
+ return typeof e == "string" || ("field" in e && e.field && W.add(e.field), "weightField" in e && e.weightField && W.add(e.weightField), "args" in e && e.condition && Be(e.condition).forEach(($) => W.add($)), "args" in e && e.args.forEach(($) => Ve($, W))), W;
11
+ }
12
+ function we(e, W) {
13
+ return typeof e == "string" ? e : "value" in e ? e.value === null ? W.null : String(e.value) : "aggregate" in e ? `${W[e.aggregate]}(${e.field ?? W.allRows})` : "field" in e ? e.field : `${W[e.op]}(${e.args.map(($) => we($, W)).join(", ")})`;
14
+ }
15
+ function Ge(e, W, $) {
16
+ const j = J("");
17
+ function w(T) {
18
+ const y = e.list.columns.find((L) => L.field === T)?.format;
19
+ return y && "digits" in y && y.digits !== void 0 ? `${y.digits} ${$.value.digits}` : void 0;
20
+ }
21
+ const U = P(() => {
22
+ const T = /* @__PURE__ */ new Map();
23
+ for (const y of e.datasetSchema?.fields ?? []) T.set(y.field, {
24
+ field: y.field,
25
+ label: y.label ?? y.field,
26
+ meta: [y.type, y.unit, w(y.field)].filter(Boolean).join(" · ")
27
+ });
28
+ for (const y of e.list.columns) T.has(y.field) || T.set(y.field, { field: y.field, label: y.header || y.field, meta: y.semanticRole ?? "" });
29
+ return [...T.values()];
30
+ }), r = P(() => {
31
+ const T = j.value.trim().toLocaleLowerCase();
32
+ return U.value.filter((y) => `${y.field} ${y.label} ${y.meta}`.toLocaleLowerCase().includes(T));
33
+ }), d = P(() => we(W.value.expression, $.value)), V = P(() => {
34
+ const T = [...Ve(W.value.expression)];
35
+ return (e.datasets?.[e.list.dataset] ?? []).slice(0, 5).map((y, L) => ({
36
+ row: L + 1,
37
+ values: T.map((R) => `${R} = ${y[R] == null ? $.value.null : String(y[R])}`).join(" · ")
38
+ }));
39
+ });
40
+ return { query: j, matches: r, fieldWindow: P(() => r.value.slice(0, 50)), expression: d, sources: V };
41
+ }
42
+ const Je = { class: "mr-predicate__mode" }, je = ["aria-label", "value", "disabled"], He = { value: "comparison" }, Pe = {
43
+ key: 0,
44
+ value: "all"
45
+ }, ze = {
46
+ key: 1,
47
+ value: "any"
48
+ }, qe = {
49
+ key: 2,
50
+ value: "not"
51
+ }, Ze = { class: "mr-predicate__pair" }, Qe = ["aria-label", "value", "disabled"], Xe = ["value"], Ye = ["aria-label", "value", "disabled"], pe = ["value"], _e = ["value"], el = ["aria-label", "value", "disabled"], ll = { value: "text" }, al = { value: "number" }, tl = { value: "decimal" }, nl = { value: "date" }, il = { value: "boolean" }, sl = {
52
+ key: 0,
53
+ class: "mr-predicate__pair"
54
+ }, dl = ["value", "disabled"], ol = ["value", "disabled"], ul = ["aria-label", "value", "disabled"], rl = { value: "value" }, cl = { value: "field" }, ml = ["value", "aria-label", "disabled"], vl = ["value"], bl = ["value", "aria-label", "disabled"], gl = ["aria-label", "disabled", "onClick"], yl = ["disabled"], fl = /* @__PURE__ */ me({
55
+ __name: "ReportPredicateEditor",
56
+ props: {
57
+ modelValue: {},
58
+ fields: {},
59
+ messages: {},
60
+ readonly: { type: Boolean },
61
+ depth: {}
62
+ },
63
+ emits: ["update:modelValue"],
64
+ setup(e, { emit: W }) {
65
+ const $ = e, j = W, w = P(() => "all" in $.modelValue ? "all" : "any" in $.modelValue ? "any" : "not" in $.modelValue ? "not" : "comparison"), U = P(() => "all" in $.modelValue ? $.modelValue.all : "any" in $.modelValue ? $.modelValue.any : "not" in $.modelValue ? [$.modelValue.not] : []), r = P(() => "field" in $.modelValue ? $.modelValue : void 0);
66
+ function d(n) {
67
+ $.readonly || j("update:modelValue", n);
68
+ }
69
+ function V() {
70
+ return { field: $.fields[0]?.field ?? "", op: ">", value: 0, valueType: "number" };
71
+ }
72
+ function T(n) {
73
+ const v = $.modelValue;
74
+ d(n === "all" ? { all: [v] } : n === "any" ? { any: [v] } : n === "not" ? { not: v } : V());
75
+ }
76
+ function y(n, v) {
77
+ const o = [...U.value];
78
+ v ? o[n] = v : o.splice(n, 1), d(w.value === "all" ? { all: o } : w.value === "any" ? { any: o } : { not: o[0] });
79
+ }
80
+ function L() {
81
+ const n = [...U.value, V()];
82
+ d(w.value === "all" ? { all: n } : { any: n });
83
+ }
84
+ function R(n) {
85
+ r.value && d({ ...r.value, ...n });
86
+ }
87
+ function K(n) {
88
+ if (!r.value) return;
89
+ const v = { ...r.value, op: n };
90
+ delete v.right, delete v.values, n === "between" ? (v.values = [0, 1], delete v.value) : n === "isNull" || n === "isNotNull" ? delete v.value : v.value = n === "contains" ? "" : 0, d(v);
91
+ }
92
+ function z(n) {
93
+ const v = r.value?.valueType ?? r.value?.numeric;
94
+ return v === "number" && n.trim() && Number.isFinite(Number(n)) ? Number(n) : v === "boolean" ? n === "true" : n;
95
+ }
96
+ function G(n, v) {
97
+ if (r.value)
98
+ if (v !== void 0) {
99
+ const o = [...r.value.values ?? [0, 1]];
100
+ o[v] = z(n), R({ values: o });
101
+ } else R({ value: z(n), right: void 0 });
102
+ }
103
+ function c(n) {
104
+ R(n === "field" ? { value: void 0, right: { field: $.fields[0]?.field ?? "" } } : { value: 0, right: void 0 });
105
+ }
106
+ return (n, v) => {
107
+ const o = fe("ReportPredicateEditor", !0);
108
+ return i(), s("div", {
109
+ class: be(["mr-predicate", { "is-nested": (e.depth ?? 0) > 0 }])
110
+ }, [
111
+ a("label", Je, [
112
+ k(t(e.messages.conditionGroup), 1),
113
+ a("select", {
114
+ "aria-label": e.messages.conditionGroup,
115
+ value: w.value,
116
+ disabled: e.readonly,
117
+ onChange: v[0] || (v[0] = (h) => T(h.target.value))
118
+ }, [
119
+ a("option", He, t(e.messages.comparison), 1),
120
+ (e.depth ?? 0) < 8 ? (i(), s("option", Pe, t(e.messages.all), 1)) : x("", !0),
121
+ (e.depth ?? 0) < 8 ? (i(), s("option", ze, t(e.messages.any), 1)) : x("", !0),
122
+ (e.depth ?? 0) < 8 ? (i(), s("option", qe, t(e.messages.not), 1)) : x("", !0)
123
+ ], 40, je)
124
+ ]),
125
+ r.value ? (i(), s(C, { key: 0 }, [
126
+ a("div", Ze, [
127
+ a("label", null, [
128
+ k(t(e.messages.field), 1),
129
+ a("select", {
130
+ "aria-label": e.messages.condition,
131
+ value: r.value.field,
132
+ disabled: e.readonly,
133
+ onChange: v[1] || (v[1] = (h) => R({ field: h.target.value }))
134
+ }, [
135
+ (i(!0), s(C, null, M(e.fields, (h) => (i(), s("option", {
136
+ key: h.field,
137
+ value: h.field
138
+ }, t(h.label), 9, Xe))), 128))
139
+ ], 40, Qe)
140
+ ]),
141
+ a("label", null, [
142
+ k(t(e.messages.comparison), 1),
143
+ a("select", {
144
+ "aria-label": e.messages.comparison,
145
+ value: r.value.op,
146
+ disabled: e.readonly,
147
+ onChange: v[2] || (v[2] = (h) => K(h.target.value))
148
+ }, [
149
+ (i(), s(C, null, M([">", ">=", "<", "<=", "==", "!="], (h) => a("option", {
150
+ key: h,
151
+ value: h
152
+ }, t(h), 9, pe)), 64)),
153
+ (i(), s(C, null, M(["between", "contains", "isNull", "isNotNull"], (h) => a("option", {
154
+ key: h,
155
+ value: h
156
+ }, t(e.messages[h]), 9, _e)), 64))
157
+ ], 40, Ye)
158
+ ])
159
+ ]),
160
+ ["isNull", "isNotNull"].includes(r.value.op) ? x("", !0) : (i(), s(C, { key: 0 }, [
161
+ a("label", null, [
162
+ k(t(e.messages.valueKind), 1),
163
+ a("select", {
164
+ "aria-label": e.messages.valueKind,
165
+ value: r.value.valueType ?? r.value.numeric ?? (typeof r.value.value == "number" ? "number" : "text"),
166
+ disabled: e.readonly,
167
+ onChange: v[3] || (v[3] = (h) => R({ valueType: h.target.value }))
168
+ }, [
169
+ a("option", ll, t(e.messages.text), 1),
170
+ a("option", al, t(e.messages.number), 1),
171
+ a("option", tl, t(e.messages.decimal), 1),
172
+ a("option", nl, t(e.messages.calendarDate), 1),
173
+ a("option", il, t(e.messages.boolean), 1)
174
+ ], 40, el)
175
+ ]),
176
+ r.value.op === "between" ? (i(), s("div", sl, [
177
+ a("label", null, [
178
+ k(t(e.messages.lowerBound), 1),
179
+ a("input", {
180
+ value: r.value.values?.[0],
181
+ disabled: e.readonly,
182
+ onInput: v[4] || (v[4] = (h) => G(h.target.value, 0))
183
+ }, null, 40, dl)
184
+ ]),
185
+ a("label", null, [
186
+ k(t(e.messages.upperBound), 1),
187
+ a("input", {
188
+ value: r.value.values?.[1],
189
+ disabled: e.readonly,
190
+ onInput: v[5] || (v[5] = (h) => G(h.target.value, 1))
191
+ }, null, 40, ol)
192
+ ])
193
+ ])) : (i(), s(C, { key: 1 }, [
194
+ a("label", null, [
195
+ k(t(e.messages.threshold), 1),
196
+ a("select", {
197
+ "aria-label": e.messages.threshold,
198
+ value: r.value.right && "field" in r.value.right ? "field" : "value",
199
+ disabled: e.readonly,
200
+ onChange: v[6] || (v[6] = (h) => c(h.target.value))
201
+ }, [
202
+ a("option", rl, t(e.messages.compareValue), 1),
203
+ a("option", cl, t(e.messages.compareField), 1)
204
+ ], 40, ul)
205
+ ]),
206
+ r.value.right && "field" in r.value.right ? (i(), s("select", {
207
+ key: 0,
208
+ value: r.value.right.field,
209
+ "aria-label": e.messages.compareField,
210
+ disabled: e.readonly,
211
+ onChange: v[7] || (v[7] = (h) => R({ right: { field: h.target.value } }))
212
+ }, [
213
+ (i(!0), s(C, null, M(e.fields, (h) => (i(), s("option", {
214
+ key: h.field,
215
+ value: h.field
216
+ }, t(h.label), 9, vl))), 128))
217
+ ], 40, ml)) : (i(), s("input", {
218
+ key: 1,
219
+ value: r.value.right && "value" in r.value.right ? r.value.right.value : r.value.value,
220
+ "aria-label": e.messages.compareValue,
221
+ disabled: e.readonly,
222
+ onInput: v[8] || (v[8] = (h) => G(h.target.value))
223
+ }, null, 40, bl))
224
+ ], 64))
225
+ ], 64))
226
+ ], 64)) : (i(), s(C, { key: 1 }, [
227
+ (i(!0), s(C, null, M(U.value, (h, A) => (i(), s("div", {
228
+ key: A,
229
+ class: "mr-predicate__child"
230
+ }, [
231
+ ce(o, {
232
+ "model-value": h,
233
+ fields: e.fields,
234
+ messages: e.messages,
235
+ readonly: e.readonly,
236
+ depth: (e.depth ?? 0) + 1,
237
+ "onUpdate:modelValue": (Z) => y(A, Z)
238
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
239
+ U.value.length > 1 ? (i(), s("button", {
240
+ key: 0,
241
+ type: "button",
242
+ "aria-label": e.messages.removeCondition,
243
+ disabled: e.readonly,
244
+ onClick: (Z) => y(A)
245
+ }, "×", 8, gl)) : x("", !0)
246
+ ]))), 128)),
247
+ w.value !== "not" && U.value.length < 8 ? (i(), s("button", {
248
+ key: 0,
249
+ type: "button",
250
+ disabled: e.readonly,
251
+ onClick: L
252
+ }, "+ " + t(e.messages.addCondition), 9, yl)) : x("", !0)
253
+ ], 64))
254
+ ], 2);
255
+ };
256
+ }
257
+ }), Ce = /* @__PURE__ */ ve(fl, [["__scopeId", "data-v-22a42478"]]), ie = (e) => JSON.parse(JSON.stringify(e));
258
+ function hl(e, W) {
259
+ const $ = J(!1), j = J(""), w = J({
260
+ dataset: "",
261
+ parentKey: "",
262
+ foreignKey: "",
263
+ columns: []
264
+ }), U = J({
265
+ rowFields: [],
266
+ columnFields: [],
267
+ measures: []
268
+ }), r = J({ input: "flat", idField: "id", parentField: "parentId", labelField: "", parentValues: "source" }), d = re(() => ({ enabled: $.value, detail: w.value, matrix: U.value, tree: r.value }));
269
+ let V;
270
+ const T = J(), y = P(() => [
271
+ .../* @__PURE__ */ new Set([
272
+ ...Object.keys(e.datasets ?? {}),
273
+ ...Object.keys(e.datasetSchemas ?? {})
274
+ ])
275
+ ]), L = P(
276
+ () => K(e.list.dataset, e.datasetSchema)
277
+ ), R = P(() => K(w.value.dataset));
278
+ function K(m, S) {
279
+ const N = /* @__PURE__ */ new Map();
280
+ for (const E of (S ?? e.datasetSchemas?.[m])?.fields ?? [])
281
+ N.set(E.field, E.label ?? E.field);
282
+ const D = e.datasets?.[m]?.[0];
283
+ for (const E of Object.keys(D ?? {}))
284
+ N.has(E) || N.set(E, E);
285
+ if (m === e.list.dataset)
286
+ for (const E of e.list.columns)
287
+ N.has(E.field) || N.set(E.field, E.header || E.field);
288
+ return [...N].map(([E, f]) => ({ field: E, label: f }));
289
+ }
290
+ function z() {
291
+ if (V === JSON.stringify(e.list)) {
292
+ V = void 0;
293
+ return;
294
+ }
295
+ $.value = !!e.list[e.mode];
296
+ const m = y.value.find((S) => S !== e.list.dataset) ?? "";
297
+ w.value = ie(
298
+ e.list.detail ?? {
299
+ dataset: m,
300
+ parentKey: e.list.rowKey ?? e.datasetSchema?.rowKey ?? L.value[0]?.field ?? "",
301
+ foreignKey: "",
302
+ columns: [],
303
+ header: !0,
304
+ unmatched: "error"
305
+ }
306
+ ), U.value = ie(
307
+ e.list.matrix ?? {
308
+ rowFields: [],
309
+ columnFields: [],
310
+ measures: [],
311
+ totals: !0
312
+ }
313
+ ), U.value.measures = U.value.measures.map((S) => ({ ...S, numeric: S.numeric ?? "number" })), r.value = ie(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 }), j.value = "", T.value = void 0, d.accept();
314
+ }
315
+ se(() => [e.mode, e.list.dataset, e.list[e.mode]], z, { immediate: !0 });
316
+ function G(m) {
317
+ w.value.dataset = m, w.value.columns = [], w.value.foreignKey = R.value[0]?.field ?? "", w.value.rowKey = e.datasetSchemas?.[m]?.rowKey;
318
+ }
319
+ function c(m, S) {
320
+ if (S && !w.value.columns.some((N) => N.field === m)) {
321
+ const N = e.datasetSchemas?.[w.value.dataset]?.fields.find((D) => D.field === m);
322
+ w.value.columns.push({
323
+ field: m,
324
+ header: R.value.find((D) => D.field === m)?.label ?? m,
325
+ widthMm: 30,
326
+ align: "auto",
327
+ semanticRole: N?.semanticRole,
328
+ editable: !1
329
+ });
330
+ } else S || (w.value.columns = w.value.columns.filter(
331
+ (N) => N.field !== m
332
+ ));
333
+ }
334
+ function n(m, S, N) {
335
+ if (e.readonly) return;
336
+ const D = U.value[m];
337
+ v(m, N ? [.../* @__PURE__ */ new Set([...D, S])] : D.filter((E) => E !== S));
338
+ }
339
+ function v(m, S) {
340
+ const N = U.value[m];
341
+ U.value[m] = S;
342
+ const D = U.value.hierarchy?.[m === "rowFields" ? "row" : "column"];
343
+ D && (D.sort && (D.sort = S.map((E) => D.sort?.[N.indexOf(E)] ?? "source")), D.labels && (D.labels = S.map((E) => D.labels?.[N.indexOf(E)] ?? E)), D.subtotals && (D.subtotals = D.subtotals.map((E) => S.indexOf(N[E - 1]) + 1).filter((E) => E > 0 && E < S.length)));
344
+ }
345
+ function o(m, S, N) {
346
+ const D = [...U.value[m]], E = S + N;
347
+ e.readonly || S < 0 || S >= D.length || E < 0 || E >= D.length || ([D[S], D[E]] = [D[E], D[S]], v(m, D));
348
+ }
349
+ function h() {
350
+ U.value.measures = [
351
+ ...U.value.measures,
352
+ { field: L.value[0]?.field ?? "", op: "sum", numeric: "number" }
353
+ ];
354
+ }
355
+ function A(m) {
356
+ U.value.measures = U.value.measures.filter(
357
+ (S, N) => N !== m
358
+ );
359
+ }
360
+ function Z(m) {
361
+ e.readonly || (m ? U.value.hierarchy ??= {} : delete U.value.hierarchy);
362
+ }
363
+ function ee(m, S, N) {
364
+ if (e.readonly || !U.value.hierarchy) return;
365
+ const D = U.value.hierarchy[m] ??= {}, f = (m === "row" ? U.value.rowFields : U.value.columnFields).map((u, H) => D.sort?.[H] ?? "source");
366
+ f[S] = N, D.sort = f;
367
+ }
368
+ function p(m, S, N) {
369
+ if (e.readonly || !U.value.hierarchy) return;
370
+ const D = U.value.hierarchy[m] ??= {};
371
+ D.subtotals = [...new Set(N ? [...D.subtotals ?? [], S] : (D.subtotals ?? []).filter((E) => E !== S))];
372
+ }
373
+ function _() {
374
+ r.value.aggregates = [...r.value.aggregates ?? [], { field: L.value.find((m) => m.field !== r.value.labelField && m.field !== r.value.idField)?.field ?? "", op: "sum", numeric: "number" }];
375
+ }
376
+ function le(m) {
377
+ r.value.aggregates = r.value.aggregates?.filter((S, N) => N !== m);
378
+ }
379
+ function Y() {
380
+ j.value = "", T.value = void 0;
381
+ try {
382
+ const m = e.datasets?.[e.list.dataset] ?? [];
383
+ if (!m.length) throw new Error(e.messages.noData);
384
+ if (m.length > 1e3) throw new Error(e.messages.treeBudget);
385
+ const S = We(m, { ...r.value, aggregates: r.value.parentValues === "leaf-aggregate" ? r.value.aggregates : void 0, maxRows: 1e3 }), N = e.list.columns.slice(0, 5);
386
+ T.value = { columns: N.map((D) => D.header), rows: S.entries.slice(0, 8).map((D) => N.map((E) => E.field === r.value.labelField ? `${" ".repeat(Math.min(6, D.depth))}${D.row[E.field] ?? ""}` : D.row[E.field])) };
387
+ } catch (m) {
388
+ j.value = m instanceof Error ? m.message : String(m);
389
+ }
390
+ }
391
+ function ae(m) {
392
+ if (!$.value) {
393
+ delete m.tree;
394
+ return;
395
+ }
396
+ m.tree = ie(r.value), m.tree.parentValues !== "leaf-aggregate" && delete m.tree.aggregates, m.rowKey = m.tree.idField, delete m.detail, delete m.matrix, delete m.groupBy, delete m.groups, delete m.rowVisibleWhen;
397
+ }
398
+ function ne() {
399
+ j.value = "", T.value = void 0;
400
+ try {
401
+ const m = e.datasets?.[e.list.dataset] ?? [];
402
+ if (!m.length) throw new Error(e.messages.noData);
403
+ const S = Ie(m.slice(0, 1e3), {
404
+ ...U.value,
405
+ maxInputRows: 1e3
406
+ });
407
+ T.value = {
408
+ columns: S.columns.slice(0, 5).map((N) => N.header),
409
+ rows: S.rows.slice(0, 5).map(
410
+ (N) => S.columns.slice(0, 5).map((D) => N[D.field])
411
+ )
412
+ };
413
+ } catch (m) {
414
+ j.value = m instanceof Error ? m.message : String(m);
415
+ }
416
+ }
417
+ function te() {
418
+ if (e.readonly) return;
419
+ const m = ie(e.list);
420
+ e.mode === "tree" ? ae(m) : e.mode === "detail" ? $.value ? (m.detail = ie(w.value), delete m.matrix, delete m.tree) : delete m.detail : $.value ? (m.matrix = ie(U.value), delete m.detail, delete m.tree, delete m.groups, delete m.groupBy, delete m.grandTotal) : delete m.matrix;
421
+ const S = $e({ pages: [{ widthMm: Math.max(1, m.leftMm + m.widthMm), heightMm: 297, components: [m] }] });
422
+ if (!S.ok) {
423
+ j.value = S.errors.slice(0, 3).map((N) => N.message).join(";");
424
+ return;
425
+ }
426
+ e.accept && !e.accept(m) || (V = JSON.stringify(m), e.accept || W(m), d.accept());
427
+ }
428
+ return ke({ key: () => `${e.recoveryKey ?? "rules:0:0"}:${e.mode}`, baseline: () => JSON.stringify(e.list[e.mode]), pending: () => d.pending.value, reset: () => {
429
+ V = void 0, z();
430
+ }, snapshot: () => JSON.stringify({ enabled: $.value, detail: w.value, matrix: U.value, tree: r.value, baseline: d.baseline.value }), restore(m) {
431
+ const S = JSON.parse(m);
432
+ $.value = S.enabled, w.value = S.detail, U.value = S.matrix, r.value = S.tree, d.baseline.value = S.baseline;
433
+ } }), {
434
+ enabled: $,
435
+ pendingLocalChanges: d.pending,
436
+ detail: w,
437
+ matrix: U,
438
+ tree: r,
439
+ datasets: y,
440
+ sourceFields: L,
441
+ childFields: R,
442
+ error: j,
443
+ preview: T,
444
+ chooseDataset: G,
445
+ toggleChildColumn: c,
446
+ toggleDimension: n,
447
+ moveDimension: o,
448
+ addMeasure: h,
449
+ removeMeasure: A,
450
+ checkMatrix: ne,
451
+ toggleHierarchy: Z,
452
+ setDimensionSort: ee,
453
+ toggleMatrixSubtotal: p,
454
+ addTreeAggregate: _,
455
+ removeTreeAggregate: le,
456
+ checkTree: Y,
457
+ apply: te
458
+ };
459
+ }
460
+ const kl = { class: "mr-data-layout" }, $l = { class: "mr-data-layout__check" }, Vl = ["disabled"], wl = { class: "mr-data-layout__hint" }, Cl = ["aria-label", "value", "disabled"], Ul = {
461
+ value: "",
462
+ disabled: ""
463
+ }, Fl = ["value"], Sl = { class: "mr-data-layout__pair" }, Ml = ["aria-label", "disabled"], Dl = ["value"], xl = ["aria-label", "disabled"], Nl = {
464
+ value: "",
465
+ disabled: ""
466
+ }, Rl = ["value"], El = ["aria-label", "disabled"], Tl = { value: void 0 }, Kl = ["value"], Ll = { class: "mr-data-layout__choices" }, Bl = ["checked", "disabled", "onChange"], Ol = ["aria-label", "disabled"], Al = { class: "mr-data-layout__pair" }, Il = ["aria-label", "disabled"], Wl = { value: "error" }, Gl = { value: "ignore" }, Jl = { class: "mr-data-layout__check" }, jl = ["disabled"], Hl = { class: "mr-data-layout__hint" }, Pl = { class: "mr-data-layout__pair" }, zl = ["aria-label", "disabled"], ql = { value: "flat" }, Zl = { value: "nested" }, Ql = ["aria-label", "disabled"], Xl = ["value"], Yl = { class: "mr-data-layout__pair" }, pl = { key: 0 }, _l = ["aria-label", "disabled"], ea = ["value"], la = { key: 1 }, aa = ["aria-label", "disabled"], ta = ["aria-label", "disabled"], na = ["value"], ia = { class: "mr-data-layout__pair" }, sa = ["aria-label", "disabled"], da = { key: 0 }, oa = ["aria-label", "disabled"], ua = { value: "error" }, ra = { value: "root" }, ca = ["aria-label", "disabled"], ma = { value: "source" }, va = { value: "leaf-aggregate" }, ba = { class: "mr-data-layout__pair" }, ga = ["onUpdate:modelValue", "aria-label", "disabled"], ya = ["value"], fa = ["onUpdate:modelValue", "aria-label", "disabled"], ha = ["value"], ka = { key: 0 }, $a = ["onUpdate:modelValue", "aria-label", "disabled"], Va = ["value"], wa = { class: "mr-data-layout__pair" }, Ca = ["onUpdate:modelValue", "aria-label", "disabled"], Ua = { value: "number" }, Fa = { value: "decimal" }, Sa = ["onUpdate:modelValue", "aria-label", "disabled"], Ma = ["disabled", "onClick"], Da = ["disabled"], xa = { class: "mr-data-layout__pair" }, Na = ["aria-label", "disabled"], Ra = ["aria-label", "disabled"], Ea = { class: "mr-data-layout__hint" }, Ta = { class: "mr-data-layout__hint" }, Ka = ["checked", "disabled", "onChange"], La = { class: "mr-data-layout__pair" }, Ba = ["aria-label", "onUpdate:modelValue", "disabled"], Oa = ["value"], Aa = ["aria-label", "onUpdate:modelValue", "disabled"], Ia = ["value"], Wa = ["aria-label", "onUpdate:modelValue", "disabled", "placeholder"], Ga = { key: 0 }, Ja = ["aria-label", "onUpdate:modelValue", "disabled"], ja = ["value"], Ha = { class: "mr-data-layout__pair" }, Pa = ["aria-label", "onUpdate:modelValue", "disabled"], za = { value: "number" }, qa = { value: "decimal" }, Za = ["aria-label", "onUpdate:modelValue", "disabled"], Qa = ["disabled", "onClick"], Xa = ["disabled"], Ya = { class: "mr-data-layout__check" }, pa = ["disabled"], _a = { class: "mr-data-layout__check" }, et = ["checked", "disabled"], lt = { class: "mr-data-layout__hint" }, at = ["aria-label", "disabled"], tt = ["aria-label", "value", "disabled", "onChange"], nt = { value: "source" }, it = { value: "asc" }, st = { value: "desc" }, dt = ["aria-label", "disabled", "onClick"], ot = ["aria-label", "disabled", "onClick"], ut = {
467
+ key: 0,
468
+ class: "mr-data-layout__check"
469
+ }, rt = ["checked", "disabled", "onChange"], ct = { class: "mr-data-layout__pair" }, mt = ["disabled"], vt = ["disabled"], bt = { class: "mr-data-layout__actions" }, gt = ["disabled"], yt = ["disabled"], ft = ["disabled"], ht = {
470
+ key: 3,
471
+ class: "mr-data-layout__preview"
472
+ }, kt = {
473
+ key: 4,
474
+ class: "mr-data-layout__error",
475
+ role: "alert"
476
+ }, $t = /* @__PURE__ */ me({
477
+ __name: "RuleDataLayout",
478
+ props: {
479
+ recoveryKey: {},
480
+ list: {},
481
+ accept: { type: Function },
482
+ mode: {},
483
+ datasets: {},
484
+ datasetSchema: {},
485
+ datasetSchemas: {},
486
+ readonly: { type: Boolean },
487
+ messages: {}
488
+ },
489
+ emits: ["change", "dirty"],
490
+ setup(e, { emit: W }) {
491
+ const $ = e, j = W, w = hl($, (G) => j("change", G)), {
492
+ enabled: U,
493
+ detail: r,
494
+ matrix: d,
495
+ tree: V,
496
+ datasets: T,
497
+ sourceFields: y,
498
+ childFields: L,
499
+ error: R,
500
+ preview: K
501
+ } = w;
502
+ se([w.pendingLocalChanges, U, r, d, V], () => j("dirty", w.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
503
+ const z = ge();
504
+ return (G, c) => (i(), s("div", kl, [
505
+ a("label", $l, [
506
+ F(a("input", {
507
+ "onUpdate:modelValue": c[0] || (c[0] = (n) => ue(U) ? U.value = n : null),
508
+ type: "checkbox",
509
+ disabled: e.readonly
510
+ }, null, 8, Vl), [
511
+ [oe, l(U)]
512
+ ]),
513
+ k(t(e.messages.enabled) + t(e.messages[e.mode]), 1)
514
+ ]),
515
+ l(U) && e.mode === "detail" ? (i(), s(C, { key: 0 }, [
516
+ a("p", wl, t(e.messages.detailHint), 1),
517
+ a("label", null, [
518
+ k(t(e.messages.childDataset), 1),
519
+ a("select", {
520
+ "aria-label": e.messages.childDataset,
521
+ value: l(r).dataset,
522
+ disabled: e.readonly,
523
+ onChange: c[1] || (c[1] = (n) => l(w).chooseDataset(n.target.value))
524
+ }, [
525
+ a("option", Ul, t(e.messages.select), 1),
526
+ (i(!0), s(C, null, M(l(T), (n) => (i(), s("option", {
527
+ key: n,
528
+ value: n
529
+ }, t(n), 9, Fl))), 128))
530
+ ], 40, Cl)
531
+ ]),
532
+ a("div", Sl, [
533
+ a("label", null, [
534
+ k(t(e.messages.parentKey), 1),
535
+ F(a("select", {
536
+ "aria-label": e.messages.parentKey,
537
+ "onUpdate:modelValue": c[2] || (c[2] = (n) => l(r).parentKey = n),
538
+ disabled: e.readonly
539
+ }, [
540
+ (i(!0), s(C, null, M(l(y), (n) => (i(), s("option", {
541
+ key: n.field,
542
+ value: n.field
543
+ }, t(n.label), 9, Dl))), 128))
544
+ ], 8, Ml), [
545
+ [O, l(r).parentKey]
546
+ ])
547
+ ]),
548
+ a("label", null, [
549
+ k(t(e.messages.foreignKey), 1),
550
+ F(a("select", {
551
+ "aria-label": e.messages.foreignKey,
552
+ "onUpdate:modelValue": c[3] || (c[3] = (n) => l(r).foreignKey = n),
553
+ disabled: e.readonly
554
+ }, [
555
+ a("option", Nl, t(e.messages.select), 1),
556
+ (i(!0), s(C, null, M(l(L), (n) => (i(), s("option", {
557
+ key: n.field,
558
+ value: n.field
559
+ }, t(n.label), 9, Rl))), 128))
560
+ ], 8, xl), [
561
+ [O, l(r).foreignKey]
562
+ ])
563
+ ])
564
+ ]),
565
+ a("label", null, [
566
+ k(t(e.messages.rowKey), 1),
567
+ F(a("select", {
568
+ "aria-label": e.messages.rowKey,
569
+ "onUpdate:modelValue": c[4] || (c[4] = (n) => l(r).rowKey = n),
570
+ disabled: e.readonly
571
+ }, [
572
+ a("option", Tl, t(e.messages.noRowKey), 1),
573
+ (i(!0), s(C, null, M(l(L), (n) => (i(), s("option", {
574
+ key: n.field,
575
+ value: n.field
576
+ }, t(n.label), 9, Kl))), 128))
577
+ ], 8, El), [
578
+ [O, l(r).rowKey]
579
+ ])
580
+ ]),
581
+ a("fieldset", Ll, [
582
+ a("legend", null, t(e.messages.childColumns), 1),
583
+ (i(!0), s(C, null, M(l(L), (n) => (i(), s("label", {
584
+ key: n.field
585
+ }, [
586
+ a("input", {
587
+ type: "checkbox",
588
+ checked: l(r).columns.some((v) => v.field === n.field),
589
+ disabled: e.readonly,
590
+ onChange: (v) => l(w).toggleChildColumn(
591
+ n.field,
592
+ v.target.checked
593
+ )
594
+ }, null, 40, Bl),
595
+ k(t(n.label), 1)
596
+ ]))), 128))
597
+ ]),
598
+ a("label", null, [
599
+ k(t(e.messages.title), 1),
600
+ F(a("input", {
601
+ "aria-label": e.messages.title,
602
+ "onUpdate:modelValue": c[5] || (c[5] = (n) => l(r).label = n),
603
+ disabled: e.readonly
604
+ }, null, 8, Ol), [
605
+ [Q, l(r).label]
606
+ ])
607
+ ]),
608
+ a("div", Al, [
609
+ a("label", null, [
610
+ k(t(e.messages.unmatched), 1),
611
+ F(a("select", {
612
+ "aria-label": e.messages.unmatched,
613
+ "onUpdate:modelValue": c[6] || (c[6] = (n) => l(r).unmatched = n),
614
+ disabled: e.readonly
615
+ }, [
616
+ a("option", Wl, t(e.messages.error), 1),
617
+ a("option", Gl, t(e.messages.ignore), 1)
618
+ ], 8, Il), [
619
+ [O, l(r).unmatched]
620
+ ])
621
+ ]),
622
+ a("label", Jl, [
623
+ F(a("input", {
624
+ "onUpdate:modelValue": c[7] || (c[7] = (n) => l(r).header = n),
625
+ type: "checkbox",
626
+ disabled: e.readonly
627
+ }, null, 8, jl), [
628
+ [oe, l(r).header]
629
+ ]),
630
+ k(t(e.messages.childHeader), 1)
631
+ ])
632
+ ])
633
+ ], 64)) : l(U) && e.mode === "tree" ? (i(), s(C, { key: 1 }, [
634
+ a("p", Hl, t(e.messages.treeHint), 1),
635
+ a("div", Pl, [
636
+ a("label", null, [
637
+ k(t(e.messages.treeInput), 1),
638
+ F(a("select", {
639
+ "onUpdate:modelValue": c[8] || (c[8] = (n) => l(V).input = n),
640
+ "aria-label": e.messages.treeInput,
641
+ disabled: e.readonly
642
+ }, [
643
+ a("option", ql, t(e.messages.treeFlat), 1),
644
+ a("option", Zl, t(e.messages.treeNested), 1)
645
+ ], 8, zl), [
646
+ [O, l(V).input]
647
+ ])
648
+ ]),
649
+ a("label", null, [
650
+ k(t(e.messages.treeId), 1),
651
+ F(a("select", {
652
+ "onUpdate:modelValue": c[9] || (c[9] = (n) => l(V).idField = n),
653
+ "aria-label": e.messages.treeId,
654
+ disabled: e.readonly
655
+ }, [
656
+ (i(!0), s(C, null, M(l(y), (n) => (i(), s("option", {
657
+ key: n.field,
658
+ value: n.field
659
+ }, t(n.label), 9, Xl))), 128))
660
+ ], 8, Ql), [
661
+ [O, l(V).idField]
662
+ ])
663
+ ])
664
+ ]),
665
+ a("div", Yl, [
666
+ l(V).input === "flat" ? (i(), s("label", pl, [
667
+ k(t(e.messages.treeParent), 1),
668
+ F(a("select", {
669
+ "onUpdate:modelValue": c[10] || (c[10] = (n) => l(V).parentField = n),
670
+ "aria-label": e.messages.treeParent,
671
+ disabled: e.readonly
672
+ }, [
673
+ (i(!0), s(C, null, M(l(y), (n) => (i(), s("option", {
674
+ key: n.field,
675
+ value: n.field
676
+ }, t(n.label), 9, ea))), 128))
677
+ ], 8, _l), [
678
+ [O, l(V).parentField]
679
+ ])
680
+ ])) : (i(), s("label", la, [
681
+ k(t(e.messages.treeChildren), 1),
682
+ F(a("input", {
683
+ "onUpdate:modelValue": c[11] || (c[11] = (n) => l(V).childrenField = n),
684
+ "aria-label": e.messages.treeChildren,
685
+ disabled: e.readonly,
686
+ placeholder: "children"
687
+ }, null, 8, aa), [
688
+ [Q, l(V).childrenField]
689
+ ])
690
+ ])),
691
+ a("label", null, [
692
+ k(t(e.messages.treeLabel), 1),
693
+ F(a("select", {
694
+ "onUpdate:modelValue": c[12] || (c[12] = (n) => l(V).labelField = n),
695
+ "aria-label": e.messages.treeLabel,
696
+ disabled: e.readonly
697
+ }, [
698
+ (i(!0), s(C, null, M(e.list.columns.filter((n) => !n.hidden), (n) => (i(), s("option", {
699
+ key: n.field,
700
+ value: n.field
701
+ }, t(n.header), 9, na))), 128))
702
+ ], 8, ta), [
703
+ [O, l(V).labelField]
704
+ ])
705
+ ])
706
+ ]),
707
+ a("div", ia, [
708
+ a("label", null, [
709
+ k(t(e.messages.treeIndent), 1),
710
+ F(a("input", {
711
+ "onUpdate:modelValue": c[13] || (c[13] = (n) => l(V).indentMm = n),
712
+ "aria-label": e.messages.treeIndent,
713
+ type: "number",
714
+ min: "0",
715
+ max: "20",
716
+ step: "0.5",
717
+ disabled: e.readonly
718
+ }, null, 8, sa), [
719
+ [
720
+ Q,
721
+ l(V).indentMm,
722
+ void 0,
723
+ { number: !0 }
724
+ ]
725
+ ])
726
+ ]),
727
+ l(V).input === "flat" ? (i(), s("label", da, [
728
+ k(t(e.messages.treeOrphan), 1),
729
+ F(a("select", {
730
+ "onUpdate:modelValue": c[14] || (c[14] = (n) => l(V).orphan = n),
731
+ "aria-label": e.messages.treeOrphan,
732
+ disabled: e.readonly
733
+ }, [
734
+ a("option", ua, t(e.messages.error), 1),
735
+ a("option", ra, t(e.messages.treeAsRoot), 1)
736
+ ], 8, oa), [
737
+ [O, l(V).orphan]
738
+ ])
739
+ ])) : x("", !0)
740
+ ]),
741
+ a("label", null, [
742
+ k(t(e.messages.treeValues), 1),
743
+ F(a("select", {
744
+ "onUpdate:modelValue": c[15] || (c[15] = (n) => l(V).parentValues = n),
745
+ "aria-label": e.messages.treeValues,
746
+ disabled: e.readonly
747
+ }, [
748
+ a("option", ma, t(e.messages.treeSource), 1),
749
+ a("option", va, t(e.messages.treeLeaves), 1)
750
+ ], 8, ca), [
751
+ [O, l(V).parentValues]
752
+ ])
753
+ ]),
754
+ l(V).parentValues === "leaf-aggregate" ? (i(), s(C, { key: 0 }, [
755
+ (i(!0), s(C, null, M(l(V).aggregates, (n, v) => (i(), s("div", {
756
+ key: v,
757
+ class: "mr-data-layout__measure"
758
+ }, [
759
+ a("div", ba, [
760
+ a("label", null, [
761
+ k(t(e.messages.measure), 1),
762
+ F(a("select", {
763
+ "onUpdate:modelValue": (o) => n.field = o,
764
+ "aria-label": e.messages.measure,
765
+ disabled: e.readonly
766
+ }, [
767
+ (i(!0), s(C, null, M(l(y), (o) => (i(), s("option", {
768
+ key: o.field,
769
+ value: o.field
770
+ }, t(o.label), 9, ya))), 128))
771
+ ], 8, ga), [
772
+ [O, n.field]
773
+ ])
774
+ ]),
775
+ a("label", null, [
776
+ k(t(e.messages.aggregate), 1),
777
+ F(a("select", {
778
+ "onUpdate:modelValue": (o) => n.op = o,
779
+ "aria-label": e.messages.aggregate,
780
+ disabled: e.readonly
781
+ }, [
782
+ (i(!0), s(C, null, M(l(z).aggregates, (o) => (i(), s("option", {
783
+ key: o,
784
+ value: o
785
+ }, t(e.messages[o]), 9, ha))), 128))
786
+ ], 8, fa), [
787
+ [O, n.op]
788
+ ])
789
+ ])
790
+ ]),
791
+ n.op === "weightedAvg" ? (i(), s("label", ka, [
792
+ k(t(e.messages.weight), 1),
793
+ F(a("select", {
794
+ "onUpdate:modelValue": (o) => n.weightField = o,
795
+ "aria-label": e.messages.weight,
796
+ disabled: e.readonly
797
+ }, [
798
+ (i(!0), s(C, null, M(l(y), (o) => (i(), s("option", {
799
+ key: o.field,
800
+ value: o.field
801
+ }, t(o.label), 9, Va))), 128))
802
+ ], 8, $a), [
803
+ [O, n.weightField]
804
+ ])
805
+ ])) : x("", !0),
806
+ a("div", wa, [
807
+ a("label", null, [
808
+ k(t(e.messages.numeric), 1),
809
+ F(a("select", {
810
+ "onUpdate:modelValue": (o) => n.numeric = o,
811
+ "aria-label": e.messages.numeric,
812
+ disabled: e.readonly
813
+ }, [
814
+ a("option", Ua, t(e.messages.number), 1),
815
+ a("option", Fa, t(e.messages.decimal), 1)
816
+ ], 8, Ca), [
817
+ [O, n.numeric]
818
+ ])
819
+ ]),
820
+ a("label", null, [
821
+ k(t(e.messages.digits), 1),
822
+ F(a("input", {
823
+ "onUpdate:modelValue": (o) => n.digits = o,
824
+ "aria-label": e.messages.digits,
825
+ type: "number",
826
+ min: "0",
827
+ max: "100",
828
+ disabled: e.readonly
829
+ }, null, 8, Sa), [
830
+ [
831
+ Q,
832
+ n.digits,
833
+ void 0,
834
+ { number: !0 }
835
+ ]
836
+ ])
837
+ ])
838
+ ]),
839
+ a("button", {
840
+ type: "button",
841
+ disabled: e.readonly,
842
+ onClick: (o) => l(w).removeTreeAggregate(v)
843
+ }, t(e.messages.remove), 9, Ma)
844
+ ]))), 128)),
845
+ a("button", {
846
+ type: "button",
847
+ disabled: e.readonly || (l(V).aggregates?.length ?? 0) >= 32,
848
+ onClick: c[16] || (c[16] = //@ts-ignore
849
+ (...n) => l(w).addTreeAggregate && l(w).addTreeAggregate(...n))
850
+ }, "+ " + t(e.messages.addAggregate), 9, Da)
851
+ ], 64)) : x("", !0),
852
+ a("details", null, [
853
+ a("summary", null, t(e.messages.advanced), 1),
854
+ a("div", xa, [
855
+ a("label", null, [
856
+ k(t(e.messages.treeRows), 1),
857
+ F(a("input", {
858
+ "onUpdate:modelValue": c[17] || (c[17] = (n) => l(V).maxRows = n),
859
+ "aria-label": e.messages.treeRows,
860
+ type: "number",
861
+ min: "1",
862
+ max: "1000000",
863
+ disabled: e.readonly
864
+ }, null, 8, Na), [
865
+ [
866
+ Q,
867
+ l(V).maxRows,
868
+ void 0,
869
+ { number: !0 }
870
+ ]
871
+ ])
872
+ ]),
873
+ a("label", null, [
874
+ k(t(e.messages.treeDepth), 1),
875
+ F(a("input", {
876
+ "onUpdate:modelValue": c[18] || (c[18] = (n) => l(V).maxDepth = n),
877
+ "aria-label": e.messages.treeDepth,
878
+ type: "number",
879
+ min: "1",
880
+ max: "256",
881
+ disabled: e.readonly
882
+ }, null, 8, Ra), [
883
+ [
884
+ Q,
885
+ l(V).maxDepth,
886
+ void 0,
887
+ { number: !0 }
888
+ ]
889
+ ])
890
+ ])
891
+ ])
892
+ ]),
893
+ a("p", Ea, t(e.messages.treeReadonly), 1)
894
+ ], 64)) : l(U) ? (i(), s(C, { key: 2 }, [
895
+ a("p", Ta, t(e.messages.matrixHint), 1),
896
+ (i(), s(C, null, M(["rowFields", "columnFields"], (n) => a("fieldset", {
897
+ key: n,
898
+ class: "mr-data-layout__choices"
899
+ }, [
900
+ a("legend", null, t(e.messages[n]), 1),
901
+ (i(!0), s(C, null, M(l(y), (v) => (i(), s("label", {
902
+ key: v.field
903
+ }, [
904
+ a("input", {
905
+ type: "checkbox",
906
+ checked: l(d)[n].includes(v.field),
907
+ disabled: e.readonly,
908
+ onChange: (o) => l(w).toggleDimension(
909
+ n,
910
+ v.field,
911
+ o.target.checked
912
+ )
913
+ }, null, 40, Ka),
914
+ k(t(v.label), 1)
915
+ ]))), 128))
916
+ ])), 64)),
917
+ (i(!0), s(C, null, M(l(d).measures, (n, v) => (i(), s("div", {
918
+ key: v,
919
+ class: "mr-data-layout__measure"
920
+ }, [
921
+ a("div", La, [
922
+ a("label", null, [
923
+ k(t(e.messages.measure), 1),
924
+ F(a("select", {
925
+ "aria-label": e.messages.measure,
926
+ "onUpdate:modelValue": (o) => n.field = o,
927
+ disabled: e.readonly
928
+ }, [
929
+ (i(!0), s(C, null, M(l(y), (o) => (i(), s("option", {
930
+ key: o.field,
931
+ value: o.field
932
+ }, t(o.label), 9, Oa))), 128))
933
+ ], 8, Ba), [
934
+ [O, n.field]
935
+ ])
936
+ ]),
937
+ a("label", null, [
938
+ k(t(e.messages.aggregate), 1),
939
+ F(a("select", {
940
+ "aria-label": e.messages.aggregate,
941
+ "onUpdate:modelValue": (o) => n.op = o,
942
+ disabled: e.readonly
943
+ }, [
944
+ (i(!0), s(C, null, M(l(z).aggregates, (o) => (i(), s("option", {
945
+ key: o,
946
+ value: o
947
+ }, t(e.messages[o]), 9, Ia))), 128))
948
+ ], 8, Aa), [
949
+ [O, n.op]
950
+ ])
951
+ ])
952
+ ]),
953
+ a("label", null, [
954
+ k(t(e.messages.measureLabel), 1),
955
+ F(a("input", {
956
+ "aria-label": e.messages.measureLabel,
957
+ "onUpdate:modelValue": (o) => n.label = o,
958
+ disabled: e.readonly,
959
+ placeholder: n.field
960
+ }, null, 8, Wa), [
961
+ [Q, n.label]
962
+ ])
963
+ ]),
964
+ n.op === "weightedAvg" ? (i(), s("label", Ga, [
965
+ k(t(e.messages.weight), 1),
966
+ F(a("select", {
967
+ "aria-label": e.messages.weight,
968
+ "onUpdate:modelValue": (o) => n.weightField = o,
969
+ disabled: e.readonly
970
+ }, [
971
+ (i(!0), s(C, null, M(l(y), (o) => (i(), s("option", {
972
+ key: o.field,
973
+ value: o.field
974
+ }, t(o.label), 9, ja))), 128))
975
+ ], 8, Ja), [
976
+ [O, n.weightField]
977
+ ])
978
+ ])) : x("", !0),
979
+ a("div", Ha, [
980
+ a("label", null, [
981
+ k(t(e.messages.numeric), 1),
982
+ F(a("select", {
983
+ "aria-label": e.messages.numeric,
984
+ "onUpdate:modelValue": (o) => n.numeric = o,
985
+ disabled: e.readonly
986
+ }, [
987
+ a("option", za, t(e.messages.number), 1),
988
+ a("option", qa, t(e.messages.decimal), 1)
989
+ ], 8, Pa), [
990
+ [O, n.numeric]
991
+ ])
992
+ ]),
993
+ a("label", null, [
994
+ k(t(e.messages.digits), 1),
995
+ F(a("input", {
996
+ "aria-label": e.messages.digits,
997
+ "onUpdate:modelValue": (o) => n.digits = o,
998
+ type: "number",
999
+ min: "0",
1000
+ max: "100",
1001
+ disabled: e.readonly
1002
+ }, null, 8, Za), [
1003
+ [
1004
+ Q,
1005
+ n.digits,
1006
+ void 0,
1007
+ { number: !0 }
1008
+ ]
1009
+ ])
1010
+ ])
1011
+ ]),
1012
+ a("button", {
1013
+ type: "button",
1014
+ disabled: e.readonly,
1015
+ onClick: (o) => l(w).removeMeasure(v)
1016
+ }, t(e.messages.remove), 9, Qa)
1017
+ ]))), 128)),
1018
+ a("button", {
1019
+ type: "button",
1020
+ disabled: e.readonly || l(d).measures.length >= 32,
1021
+ onClick: c[19] || (c[19] = //@ts-ignore
1022
+ (...n) => l(w).addMeasure && l(w).addMeasure(...n))
1023
+ }, " + " + t(e.messages.addAggregate), 9, Xa),
1024
+ a("label", Ya, [
1025
+ F(a("input", {
1026
+ "onUpdate:modelValue": c[20] || (c[20] = (n) => l(d).totals = n),
1027
+ type: "checkbox",
1028
+ disabled: e.readonly
1029
+ }, null, 8, pa), [
1030
+ [oe, l(d).totals]
1031
+ ]),
1032
+ k(t(e.messages.totals), 1)
1033
+ ]),
1034
+ a("details", null, [
1035
+ a("summary", null, t(e.messages.matrixHierarchy), 1),
1036
+ a("label", _a, [
1037
+ a("input", {
1038
+ type: "checkbox",
1039
+ checked: !!l(d).hierarchy,
1040
+ disabled: e.readonly,
1041
+ onChange: c[21] || (c[21] = (n) => l(w).toggleHierarchy(n.target.checked))
1042
+ }, null, 40, et),
1043
+ k(t(e.messages.enabled), 1)
1044
+ ]),
1045
+ l(d).hierarchy ? (i(), s(C, { key: 0 }, [
1046
+ a("p", lt, t(e.messages.matrixHierarchyHint), 1),
1047
+ a("label", null, [
1048
+ k(t(e.messages.matrixEmptyLabel), 1),
1049
+ F(a("input", {
1050
+ "onUpdate:modelValue": c[22] || (c[22] = (n) => l(d).hierarchy.emptyLabel = n),
1051
+ "aria-label": e.messages.matrixEmptyLabel,
1052
+ disabled: e.readonly,
1053
+ placeholder: "(空)"
1054
+ }, null, 8, at), [
1055
+ [Q, l(d).hierarchy.emptyLabel]
1056
+ ])
1057
+ ]),
1058
+ (i(), s(C, null, M(["row", "column"], (n) => a("fieldset", {
1059
+ key: n,
1060
+ class: "mr-data-layout__choices"
1061
+ }, [
1062
+ a("legend", null, t(n === "row" ? e.messages.rowFields : e.messages.columnFields), 1),
1063
+ (i(!0), s(C, null, M(l(d)[n === "row" ? "rowFields" : "columnFields"], (v, o) => (i(), s("div", {
1064
+ key: v,
1065
+ class: "mr-data-layout__pair"
1066
+ }, [
1067
+ a("label", null, [
1068
+ k(t(v), 1),
1069
+ a("select", {
1070
+ "aria-label": `${v} · ${e.messages.matrixSort}`,
1071
+ value: l(d).hierarchy[n]?.sort?.[o] ?? "source",
1072
+ disabled: e.readonly,
1073
+ onChange: (h) => l(w).setDimensionSort(n, o, h.target.value)
1074
+ }, [
1075
+ a("option", nt, t(e.messages.matrixSourceOrder), 1),
1076
+ a("option", it, t(e.messages.matrixAscending), 1),
1077
+ a("option", st, t(e.messages.matrixDescending), 1)
1078
+ ], 40, tt)
1079
+ ]),
1080
+ a("div", null, [
1081
+ a("button", {
1082
+ type: "button",
1083
+ "aria-label": `${v} · ${e.messages.moveUp}`,
1084
+ disabled: e.readonly || o === 0,
1085
+ onClick: (h) => l(w).moveDimension(n === "row" ? "rowFields" : "columnFields", o, -1)
1086
+ }, "↑", 8, dt),
1087
+ a("button", {
1088
+ type: "button",
1089
+ "aria-label": `${v} · ${e.messages.moveDown}`,
1090
+ disabled: e.readonly || o === l(d)[n === "row" ? "rowFields" : "columnFields"].length - 1,
1091
+ onClick: (h) => l(w).moveDimension(n === "row" ? "rowFields" : "columnFields", o, 1)
1092
+ }, "↓", 8, ot)
1093
+ ]),
1094
+ o < l(d)[n === "row" ? "rowFields" : "columnFields"].length - 1 ? (i(), s("label", ut, [
1095
+ a("input", {
1096
+ type: "checkbox",
1097
+ checked: l(d).hierarchy[n]?.subtotals?.includes(o + 1) ?? !1,
1098
+ disabled: e.readonly,
1099
+ onChange: (h) => l(w).toggleMatrixSubtotal(n, o + 1, h.target.checked)
1100
+ }, null, 40, rt),
1101
+ k(t(e.messages.matrixPrefixSubtotal), 1)
1102
+ ])) : x("", !0)
1103
+ ]))), 128))
1104
+ ])), 64))
1105
+ ], 64)) : x("", !0)
1106
+ ]),
1107
+ a("details", null, [
1108
+ a("summary", null, t(e.messages.widthSettings), 1),
1109
+ a("div", ct, [
1110
+ a("label", null, [
1111
+ k(t(e.messages.dimensionWidth), 1),
1112
+ F(a("input", {
1113
+ "onUpdate:modelValue": c[23] || (c[23] = (n) => l(d).rowWidthMm = n),
1114
+ type: "number",
1115
+ min: "1",
1116
+ disabled: e.readonly,
1117
+ placeholder: "40"
1118
+ }, null, 8, mt), [
1119
+ [
1120
+ Q,
1121
+ l(d).rowWidthMm,
1122
+ void 0,
1123
+ { number: !0 }
1124
+ ]
1125
+ ])
1126
+ ]),
1127
+ a("label", null, [
1128
+ k(t(e.messages.measureWidth), 1),
1129
+ F(a("input", {
1130
+ "onUpdate:modelValue": c[24] || (c[24] = (n) => l(d).columnWidthMm = n),
1131
+ type: "number",
1132
+ min: "1",
1133
+ disabled: e.readonly,
1134
+ placeholder: "28"
1135
+ }, null, 8, vt), [
1136
+ [
1137
+ Q,
1138
+ l(d).columnWidthMm,
1139
+ void 0,
1140
+ { number: !0 }
1141
+ ]
1142
+ ])
1143
+ ])
1144
+ ])
1145
+ ])
1146
+ ], 64)) : x("", !0),
1147
+ a("div", bt, [
1148
+ l(U) && e.mode === "matrix" ? (i(), s("button", {
1149
+ key: 0,
1150
+ type: "button",
1151
+ disabled: e.readonly,
1152
+ onClick: c[25] || (c[25] = //@ts-ignore
1153
+ (...n) => l(w).checkMatrix && l(w).checkMatrix(...n))
1154
+ }, t(e.messages.check), 9, gt)) : x("", !0),
1155
+ l(U) && e.mode === "tree" ? (i(), s("button", {
1156
+ key: 1,
1157
+ type: "button",
1158
+ disabled: e.readonly,
1159
+ onClick: c[26] || (c[26] = //@ts-ignore
1160
+ (...n) => l(w).checkTree && l(w).checkTree(...n))
1161
+ }, t(e.messages.check), 9, yt)) : x("", !0),
1162
+ a("button", {
1163
+ type: "button",
1164
+ class: "mr-data-layout__primary",
1165
+ disabled: e.readonly,
1166
+ onClick: c[27] || (c[27] = //@ts-ignore
1167
+ (...n) => l(w).apply && l(w).apply(...n))
1168
+ }, t(e.messages.apply), 9, ft)
1169
+ ]),
1170
+ l(K) ? (i(), s("div", ht, [
1171
+ a("p", null, t(e.messages.sample), 1),
1172
+ a("table", null, [
1173
+ a("thead", null, [
1174
+ a("tr", null, [
1175
+ (i(!0), s(C, null, M(l(K).columns, (n, v) => (i(), s("th", { key: v }, t(n), 1))), 128))
1176
+ ])
1177
+ ]),
1178
+ a("tbody", null, [
1179
+ (i(!0), s(C, null, M(l(K).rows, (n, v) => (i(), s("tr", { key: v }, [
1180
+ (i(!0), s(C, null, M(n, (o, h) => (i(), s("td", { key: h }, t(o ?? "—"), 1))), 128))
1181
+ ]))), 128))
1182
+ ])
1183
+ ])
1184
+ ])) : x("", !0),
1185
+ l(R) ? (i(), s("p", kt, t(l(R)), 1)) : x("", !0)
1186
+ ]));
1187
+ }
1188
+ }), Vt = /* @__PURE__ */ ve($t, [["__scopeId", "data-v-61513558"]]), wt = { class: "mr-expression__row" }, Ct = ["value", "disabled", "aria-label"], Ut = { value: "field" }, Ft = { value: "constant" }, St = {
1189
+ key: 0,
1190
+ value: "operation"
1191
+ }, Mt = { value: "aggregate" }, Dt = ["value", "disabled", "aria-label"], xt = ["value"], Nt = ["value", "disabled", "aria-label"], Rt = ["value"], Et = ["value", "disabled", "aria-label"], Tt = ["value"], Kt = ["value", "disabled", "aria-label"], Lt = { value: "text" }, Bt = { value: "number" }, Ot = { value: "boolean" }, At = { value: "null" }, It = ["value", "disabled", "aria-label"], Wt = {
1192
+ key: 0,
1193
+ value: ""
1194
+ }, Gt = ["value"], Jt = ["value", "disabled", "aria-label"], jt = {
1195
+ value: "",
1196
+ disabled: ""
1197
+ }, Ht = ["value"], Pt = ["value", "disabled", "aria-label"], zt = { value: "true" }, qt = { value: "false" }, Zt = ["type", "value", "disabled", "aria-label"], Qt = { class: "mr-expression__help" }, Xt = ["disabled", "aria-label", "onClick"], Yt = ["disabled"], pt = /* @__PURE__ */ me({
1198
+ __name: "ReportExpressionEditor",
1199
+ props: {
1200
+ modelValue: {},
1201
+ fields: {},
1202
+ messages: {},
1203
+ readonly: { type: Boolean },
1204
+ depth: {}
1205
+ },
1206
+ emits: ["update:modelValue"],
1207
+ setup(e, { emit: W }) {
1208
+ const $ = e, j = W, w = ge(), U = P(() => "op" in $.modelValue ? w.functions.find((c) => c.name === $.modelValue.op) : void 0), r = P(
1209
+ () => "aggregate" in $.modelValue ? "aggregate" : "field" in $.modelValue ? "field" : "value" in $.modelValue ? "constant" : "operation"
1210
+ ), d = J("text");
1211
+ se(
1212
+ () => $.modelValue,
1213
+ (c) => {
1214
+ "value" in c && (d.value = c.value === null ? "null" : typeof c.value == "string" ? "text" : typeof c.value);
1215
+ },
1216
+ { immediate: !0 }
1217
+ );
1218
+ function V(c) {
1219
+ $.readonly || j("update:modelValue", c);
1220
+ }
1221
+ function T(c) {
1222
+ V(c === "aggregate" ? { aggregate: "sum", field: $.fields[0]?.field ?? "" } : c === "field" ? { field: $.fields[0]?.field ?? "" } : c === "constant" ? { value: "" } : {
1223
+ op: "add",
1224
+ args: [{ field: $.fields[0]?.field ?? "" }, { value: 0 }]
1225
+ });
1226
+ }
1227
+ function y(c) {
1228
+ const n = c, v = "args" in $.modelValue ? $.modelValue.args : [{ value: 0 }, { value: 0 }], o = w.functions.find((A) => A.name === n), h = [...v.slice(0, o.maxArgs)];
1229
+ for (; h.length < o.minArgs; ) h.push({ value: 0 });
1230
+ V({ op: n, args: h, ...n === "if" ? { condition: "args" in $.modelValue && $.modelValue.condition ? $.modelValue.condition : { field: $.fields[0]?.field ?? "", op: ">", value: 0 } } : {} });
1231
+ }
1232
+ function L(c, n) {
1233
+ "args" in $.modelValue && V({
1234
+ ...$.modelValue,
1235
+ args: $.modelValue.args.map(
1236
+ (v, o) => o === c ? n : v
1237
+ )
1238
+ });
1239
+ }
1240
+ function R(c) {
1241
+ if (!("args" in $.modelValue)) return;
1242
+ const n = c === void 0 ? [...$.modelValue.args, { value: 0 }] : $.modelValue.args.filter((v, o) => o !== c);
1243
+ V({ ...$.modelValue, args: n });
1244
+ }
1245
+ function K(c) {
1246
+ d.value = c, V({
1247
+ value: c === "null" ? null : c === "boolean" ? !1 : c === "number" ? 0 : ""
1248
+ });
1249
+ }
1250
+ function z(c) {
1251
+ d.value === "number" ? c.trim() && Number.isFinite(Number(c)) && V({ value: Number(c) }) : V({ value: c });
1252
+ }
1253
+ function G(c, n) {
1254
+ if (!("aggregate" in $.modelValue)) return;
1255
+ const v = { ...$.modelValue, [c]: n };
1256
+ c === "aggregate" && (v.aggregate = n), c === "field" && !n && delete v.field, V(v);
1257
+ }
1258
+ return (c, n) => {
1259
+ const v = fe("ReportExpressionEditor", !0);
1260
+ return i(), s("div", {
1261
+ class: be(["mr-expression", { "mr-expression--nested": (e.depth ?? 0) > 0 }])
1262
+ }, [
1263
+ a("div", wt, [
1264
+ a("select", {
1265
+ value: r.value,
1266
+ disabled: e.readonly,
1267
+ "aria-label": e.messages.argument,
1268
+ onChange: n[0] || (n[0] = (o) => T(o.target.value))
1269
+ }, [
1270
+ a("option", Ut, t(e.messages.field), 1),
1271
+ a("option", Ft, t(e.messages.constant), 1),
1272
+ (e.depth ?? 0) < 12 ? (i(), s("option", St, t(e.messages.operation), 1)) : x("", !0),
1273
+ a("option", Mt, t(e.messages.aggregate), 1)
1274
+ ], 40, Ct),
1275
+ "field" in e.modelValue && !("aggregate" in e.modelValue) ? (i(), s("select", {
1276
+ key: 0,
1277
+ value: e.modelValue.field,
1278
+ disabled: e.readonly,
1279
+ "aria-label": e.messages.field,
1280
+ onChange: n[1] || (n[1] = (o) => V({ field: o.target.value }))
1281
+ }, [
1282
+ (i(!0), s(C, null, M(e.fields, (o) => (i(), s("option", {
1283
+ key: o.field,
1284
+ value: o.field
1285
+ }, t(o.label), 9, xt))), 128))
1286
+ ], 40, Dt)) : "op" in e.modelValue ? (i(), s("select", {
1287
+ key: 1,
1288
+ value: e.modelValue.op,
1289
+ disabled: e.readonly,
1290
+ "aria-label": e.messages.operation,
1291
+ onChange: n[2] || (n[2] = (o) => y(o.target.value))
1292
+ }, [
1293
+ (i(!0), s(C, null, M(l(w).operations, (o) => (i(), s("option", {
1294
+ key: o,
1295
+ value: o
1296
+ }, t(e.messages[o]), 9, Rt))), 128))
1297
+ ], 40, Nt)) : "aggregate" in e.modelValue ? (i(), s("select", {
1298
+ key: 2,
1299
+ value: e.modelValue.aggregate,
1300
+ disabled: e.readonly,
1301
+ "aria-label": e.messages.aggregate,
1302
+ onChange: n[3] || (n[3] = (o) => G("aggregate", o.target.value))
1303
+ }, [
1304
+ (i(!0), s(C, null, M(l(w).aggregates, (o) => (i(), s("option", {
1305
+ key: o,
1306
+ value: o
1307
+ }, t(e.messages[o]), 9, Tt))), 128))
1308
+ ], 40, Et)) : (i(), s("select", {
1309
+ key: 3,
1310
+ value: d.value,
1311
+ disabled: e.readonly,
1312
+ "aria-label": e.messages.resultType,
1313
+ onChange: n[4] || (n[4] = (o) => K(o.target.value))
1314
+ }, [
1315
+ a("option", Lt, t(e.messages.text), 1),
1316
+ a("option", Bt, t(e.messages.number), 1),
1317
+ a("option", Ot, t(e.messages.boolean), 1),
1318
+ a("option", At, t(e.messages.null), 1)
1319
+ ], 40, Kt))
1320
+ ]),
1321
+ "aggregate" in e.modelValue ? (i(), s(C, { key: 0 }, [
1322
+ a("select", {
1323
+ value: e.modelValue.field ?? "",
1324
+ disabled: e.readonly,
1325
+ "aria-label": e.messages.measure,
1326
+ onChange: n[5] || (n[5] = (o) => G("field", o.target.value))
1327
+ }, [
1328
+ e.modelValue.aggregate === "count" ? (i(), s("option", Wt, t(e.messages.allRows), 1)) : x("", !0),
1329
+ (i(!0), s(C, null, M(e.fields, (o) => (i(), s("option", {
1330
+ key: o.field,
1331
+ value: o.field
1332
+ }, t(o.label), 9, Gt))), 128))
1333
+ ], 40, It),
1334
+ e.modelValue.aggregate === "weightedAvg" ? (i(), s("select", {
1335
+ key: 0,
1336
+ value: e.modelValue.weightField ?? "",
1337
+ disabled: e.readonly,
1338
+ "aria-label": e.messages.weight,
1339
+ onChange: n[6] || (n[6] = (o) => G(
1340
+ "weightField",
1341
+ o.target.value
1342
+ ))
1343
+ }, [
1344
+ a("option", jt, t(e.messages.weight), 1),
1345
+ (i(!0), s(C, null, M(e.fields, (o) => (i(), s("option", {
1346
+ key: o.field,
1347
+ value: o.field
1348
+ }, t(o.label), 9, Ht))), 128))
1349
+ ], 40, Jt)) : x("", !0)
1350
+ ], 64)) : "value" in e.modelValue ? (i(), s(C, { key: 1 }, [
1351
+ d.value === "boolean" ? (i(), s("select", {
1352
+ key: 0,
1353
+ value: String(e.modelValue.value),
1354
+ disabled: e.readonly,
1355
+ "aria-label": e.messages.constant,
1356
+ onChange: n[7] || (n[7] = (o) => V({
1357
+ value: o.target.value === "true"
1358
+ }))
1359
+ }, [
1360
+ a("option", zt, t(e.messages.true), 1),
1361
+ a("option", qt, t(e.messages.false), 1)
1362
+ ], 40, Pt)) : d.value !== "null" ? (i(), s("input", {
1363
+ key: 1,
1364
+ type: d.value === "number" ? "number" : "text",
1365
+ value: e.modelValue.value ?? "",
1366
+ disabled: e.readonly,
1367
+ "aria-label": e.messages.constant,
1368
+ onInput: n[8] || (n[8] = (o) => z(o.target.value))
1369
+ }, null, 40, Zt)) : x("", !0)
1370
+ ], 64)) : "args" in e.modelValue ? (i(), s(C, { key: 2 }, [
1371
+ e.modelValue.op === "if" && e.modelValue.condition ? (i(), he(Ce, {
1372
+ key: 0,
1373
+ "model-value": e.modelValue.condition,
1374
+ fields: e.fields,
1375
+ messages: e.messages,
1376
+ readonly: e.readonly,
1377
+ "onUpdate:modelValue": n[9] || (n[9] = (o) => V({ ...e.modelValue, condition: o }))
1378
+ }, null, 8, ["model-value", "fields", "messages", "readonly"])) : x("", !0),
1379
+ a("small", Qt, t(U.value?.example), 1),
1380
+ (i(!0), s(C, null, M(e.modelValue.args, (o, h) => (i(), s("div", {
1381
+ key: h,
1382
+ class: "mr-expression__argument"
1383
+ }, [
1384
+ ce(v, {
1385
+ "model-value": o,
1386
+ fields: e.fields,
1387
+ messages: e.messages,
1388
+ readonly: e.readonly,
1389
+ depth: (e.depth ?? 0) + 1,
1390
+ "onUpdate:modelValue": (A) => L(h, A)
1391
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
1392
+ e.modelValue.args.length > (U.value?.minArgs ?? 2) ? (i(), s("button", {
1393
+ key: 0,
1394
+ type: "button",
1395
+ disabled: e.readonly,
1396
+ "aria-label": `${e.messages.remove} ${e.messages.argument} ${h + 1}`,
1397
+ onClick: (A) => R(h)
1398
+ }, " × ", 8, Xt)) : x("", !0)
1399
+ ]))), 128)),
1400
+ e.modelValue.args.length < Math.min(16, U.value?.maxArgs ?? 16) ? (i(), s("button", {
1401
+ key: 1,
1402
+ type: "button",
1403
+ disabled: e.readonly,
1404
+ onClick: n[10] || (n[10] = (o) => R())
1405
+ }, " + " + t(e.messages.addArgument), 9, Yt)) : x("", !0)
1406
+ ], 64)) : x("", !0)
1407
+ ], 2);
1408
+ };
1409
+ }
1410
+ }), _t = /* @__PURE__ */ ve(pt, [["__scopeId", "data-v-e610e9c4"]]), q = (e) => JSON.parse(JSON.stringify(e));
1411
+ function en(e, W) {
1412
+ const $ = P(() => ({
1413
+ ...Ke,
1414
+ ...e.messages
1415
+ })), j = J("computations"), w = J(""), U = J(""), r = J({
1416
+ field: "",
1417
+ expression: { field: "" },
1418
+ scope: "row"
1419
+ }), d = J([]), V = J(0), T = J(""), y = J(-1), L = J("style"), R = J({ field: "", op: ">", value: 0 }), K = J(null), z = P(() => K.value ?? R.value), G = J({
1420
+ color: "#b91c1c",
1421
+ backgroundColor: "#fff1f2",
1422
+ bold: !1
1423
+ }), c = J([]), n = re(() => r.value), v = re(() => d.value), o = re(() => ({ when: R.value, composedWhen: K.value, style: G.value })), h = J(/* @__PURE__ */ new Map()), A = J(/* @__PURE__ */ new Map());
1424
+ let Z = "", ee = !1;
1425
+ const p = P(() => n.pending.value || v.pending.value || o.pending.value || h.value.size > 0 || A.value.size > 0);
1426
+ let _;
1427
+ const le = P(() => {
1428
+ const b = /* @__PURE__ */ new Map();
1429
+ for (const g of e.datasetSchema?.fields ?? [])
1430
+ b.set(g.field, g.label ?? g.field);
1431
+ for (const g of e.list.columns)
1432
+ b.has(g.field) || b.set(g.field, g.header || g.field);
1433
+ for (const g of Object.keys(
1434
+ e.datasets?.[e.list.dataset]?.[0] ?? {}
1435
+ ))
1436
+ b.has(g) || b.set(g, g);
1437
+ return [...b].map(([g, B]) => ({ field: g, label: B }));
1438
+ }), Y = P(() => d.value[V.value]), ae = P(
1439
+ () => e.list.columns.find((b) => b.field === T.value)
1440
+ ), ne = P(() => Oe(S()));
1441
+ function te() {
1442
+ if (_ === JSON.stringify(e.list)) {
1443
+ _ = void 0;
1444
+ return;
1445
+ }
1446
+ ee = !0, h.value = /* @__PURE__ */ new Map(), A.value = /* @__PURE__ */ new Map(), d.value = q(
1447
+ e.list.groups ?? (e.list.groupBy ? [e.list.groupBy] : [])
1448
+ );
1449
+ for (const b of d.value) for (const g of b.aggregates ?? []) g.numeric ??= "number";
1450
+ e.list.columns.some((b) => b.field === T.value) || (T.value = e.list.columns[0]?.field ?? ""), w.value = "", c.value = [], m(U.value), ye(-1), v.accept(), ee = !1;
1451
+ }
1452
+ se(() => e.list, te, { immediate: !0 }), se(r, () => {
1453
+ c.value = [];
1454
+ }, { deep: !0 }), se(() => e.datasets, () => {
1455
+ c.value = [];
1456
+ }, { deep: !0 });
1457
+ function m(b) {
1458
+ !ee && n.pending.value && (h.value = new Map(h.value).set(U.value, q(r.value))), U.value = b, r.value = q(
1459
+ e.list.computed?.find((B) => B.field === b) ?? {
1460
+ field: "",
1461
+ expression: { field: le.value[0]?.field ?? "" },
1462
+ scope: "row"
1463
+ }
1464
+ ), r.value.numeric ??= "number", c.value = [], w.value = "", n.accept();
1465
+ const g = h.value.get(b);
1466
+ if (g) {
1467
+ r.value = q(g);
1468
+ const B = new Map(h.value);
1469
+ B.delete(b), h.value = B;
1470
+ }
1471
+ }
1472
+ function S() {
1473
+ return [
1474
+ ...(e.list.computed ?? []).filter((g) => g.field !== U.value),
1475
+ q(r.value)
1476
+ ];
1477
+ }
1478
+ function N(b) {
1479
+ if (e.readonly) return !1;
1480
+ const g = $e({
1481
+ pages: [
1482
+ {
1483
+ widthMm: Math.max(1, b.leftMm + b.widthMm),
1484
+ heightMm: 297,
1485
+ components: [b]
1486
+ }
1487
+ ]
1488
+ });
1489
+ return g.ok ? (w.value = "", _ = JSON.stringify(b), W(b), !0) : (w.value = g.errors.map((B) => B.message).slice(0, 3).join(";"), !1);
1490
+ }
1491
+ function D() {
1492
+ if (!r.value.field.trim()) {
1493
+ w.value = $.value.missingTarget;
1494
+ return;
1495
+ }
1496
+ const b = q(e.list);
1497
+ if (b.computed = S(), b.columns.some((g) => g.field === r.value.field) || b.columns.push({
1498
+ field: r.value.field,
1499
+ header: r.value.field,
1500
+ widthMm: 30,
1501
+ semanticRole: "measure",
1502
+ align: "right",
1503
+ editable: !1,
1504
+ format: {
1505
+ kind: "number",
1506
+ ...r.value.digits === void 0 ? {} : { digits: r.value.digits }
1507
+ }
1508
+ }), N(b)) {
1509
+ const g = new Map(h.value);
1510
+ g.delete(U.value), g.delete(r.value.field), h.value = g, U.value = r.value.field, n.accept();
1511
+ }
1512
+ }
1513
+ function E() {
1514
+ if (!U.value) return;
1515
+ const b = q(e.list);
1516
+ if (b.computed = (b.computed ?? []).filter(
1517
+ (g) => g.field !== U.value
1518
+ ), N(b)) {
1519
+ const g = new Map(h.value);
1520
+ g.delete(U.value), h.value = g, n.accept(), m("");
1521
+ }
1522
+ }
1523
+ function f() {
1524
+ c.value = [], w.value = "";
1525
+ const b = e.datasets?.[e.list.dataset];
1526
+ if (!b?.length) {
1527
+ w.value = $.value.noData;
1528
+ return;
1529
+ }
1530
+ try {
1531
+ const g = Ae(b.slice(0, 1e3), {
1532
+ fields: S(),
1533
+ maxRows: 1e3,
1534
+ maxCells: 2e6
1535
+ });
1536
+ c.value = g.rows.slice(0, 5).map((B, X) => ({
1537
+ row: X + 1,
1538
+ value: B[r.value.field]
1539
+ }));
1540
+ } catch (g) {
1541
+ w.value = g instanceof Error ? g.message : String(g);
1542
+ }
1543
+ }
1544
+ function u(b) {
1545
+ r.value.expression = b;
1546
+ }
1547
+ function H(b, g) {
1548
+ r.value.groupBy = g ? [...r.value.groupBy ?? [], b] : (r.value.groupBy ?? []).filter((B) => B !== b);
1549
+ }
1550
+ function I() {
1551
+ d.value.push({
1552
+ field: le.value[0]?.field ?? "",
1553
+ headerTemplate: "{value}",
1554
+ subtotalLabel: $.value.subtotalLabel,
1555
+ aggregates: [],
1556
+ keepWithNext: !0
1557
+ }), V.value = d.value.length - 1;
1558
+ }
1559
+ function Ue(b) {
1560
+ const g = V.value, B = g + b;
1561
+ B < 0 || B >= d.value.length || ([d.value[g], d.value[B]] = [
1562
+ d.value[B],
1563
+ d.value[g]
1564
+ ], V.value = B);
1565
+ }
1566
+ function Fe() {
1567
+ d.value.splice(V.value, 1), V.value = Math.max(
1568
+ 0,
1569
+ Math.min(V.value, d.value.length - 1)
1570
+ );
1571
+ }
1572
+ function Se() {
1573
+ Y.value && (Y.value.aggregates ??= []).push({
1574
+ field: le.value[0]?.field ?? "",
1575
+ op: "sum",
1576
+ numeric: "number"
1577
+ });
1578
+ }
1579
+ function Me() {
1580
+ const b = q(e.list);
1581
+ b.groups = q(d.value), delete b.groupBy, N(b) && v.accept();
1582
+ }
1583
+ function De(b) {
1584
+ K.value = b && !("field" in b) ? q(b) : null, R.value = q(b && "field" in b ? b : { field: T.value, op: ">", value: 0 });
1585
+ }
1586
+ function ye(b) {
1587
+ !ee && o.pending.value && (A.value = new Map(A.value).set(Z, { when: q(R.value), composedWhen: q(K.value), style: { ...G.value } })), Z = `${T.value}|${L.value}|${b}`, y.value = b;
1588
+ const g = L.value === "cell" ? ae.value?.visibleWhen : L.value === "rowVisibility" ? e.list.rowVisibleWhen : ae.value?.rules?.[b]?.when;
1589
+ De(g);
1590
+ const B = ae.value?.rules?.[b]?.style;
1591
+ G.value = {
1592
+ color: String(B?.color ?? "#b91c1c"),
1593
+ backgroundColor: String(B?.backgroundColor ?? "#fff1f2"),
1594
+ bold: B?.bold === !0
1595
+ }, o.accept();
1596
+ const X = A.value.get(Z);
1597
+ if (X) {
1598
+ R.value = q(X.when), K.value = q(X.composedWhen), G.value = { ...X.style };
1599
+ const de = new Map(A.value);
1600
+ de.delete(Z), A.value = de;
1601
+ }
1602
+ }
1603
+ function xe(b) {
1604
+ const g = e.datasetSchema?.fields.find(
1605
+ (de) => de.field === R.value.field
1606
+ ), B = e.datasets?.[e.list.dataset]?.find(
1607
+ (de) => de[R.value.field] != null
1608
+ )?.[R.value.field], X = g?.type === "number" || !g && typeof B == "number";
1609
+ g?.type === "decimal" ? R.value.numeric = "decimal" : X ? R.value.numeric = "number" : delete R.value.numeric, R.value.value = X && b.trim() && Number.isFinite(Number(b)) ? Number(b) : b;
1610
+ }
1611
+ function Ne(b = !1) {
1612
+ const g = q(e.list), B = g.columns.find((X) => X.field === T.value);
1613
+ if (!B) {
1614
+ w.value = $.value.noSelection;
1615
+ return;
1616
+ }
1617
+ if (L.value === "rowVisibility")
1618
+ b ? delete g.rowVisibleWhen : g.rowVisibleWhen = q(z.value);
1619
+ else if (L.value === "cell")
1620
+ b ? delete B.visibleWhen : B.visibleWhen = q(z.value);
1621
+ else if (B.rules ??= [], b && y.value >= 0)
1622
+ B.rules.splice(y.value, 1);
1623
+ else {
1624
+ if (b) return;
1625
+ y.value < 0 ? B.rules.push({
1626
+ when: q(z.value),
1627
+ style: { ...G.value }
1628
+ }) : B.rules[y.value] = {
1629
+ when: q(z.value),
1630
+ style: { ...G.value }
1631
+ };
1632
+ }
1633
+ if (N(g)) {
1634
+ const X = new Map(A.value);
1635
+ X.delete(Z), A.value = X, o.accept();
1636
+ }
1637
+ }
1638
+ ke({ key: () => e.recoveryKey ?? "rules:0:0", baseline: () => JSON.stringify(e.list), pending: () => p.value, reset: () => {
1639
+ _ = void 0, te();
1640
+ }, snapshot: () => JSON.stringify(Re()), restore(b) {
1641
+ const g = JSON.parse(b);
1642
+ r.value = g.formula, d.value = g.groups, R.value = g.when, K.value = g.composedWhen, G.value = g.style, U.value = g.selectedComputed, T.value = g.column, y.value = g.conditionIndex, Z = g.conditionKey, L.value = g.effect, j.value = g.tab, h.value = new Map(g.computedDrafts), A.value = new Map(g.conditionDrafts), n.baseline.value = g.formulaBaseline, v.baseline.value = g.groupBaseline, o.baseline.value = g.conditionBaseline;
1643
+ } });
1644
+ function Re() {
1645
+ return { formula: r.value, groups: d.value, when: R.value, composedWhen: K.value, style: G.value, selectedComputed: U.value, column: T.value, conditionIndex: y.value, conditionKey: Z, effect: L.value, tab: j.value, computedDrafts: [...h.value], conditionDrafts: [...A.value], formulaBaseline: n.baseline.value, groupBaseline: v.baseline.value, conditionBaseline: o.baseline.value };
1646
+ }
1647
+ return {
1648
+ m: $,
1649
+ pendingLocalChanges: p,
1650
+ draftSnapshot: () => JSON.stringify({ formula: r.value, groups: d.value, when: R.value, composedWhen: K.value, style: G.value, computedDrafts: [...h.value], conditionDrafts: [...A.value] }),
1651
+ tab: j,
1652
+ fields: le,
1653
+ formula: r,
1654
+ groups: d,
1655
+ groupIndex: V,
1656
+ currentGroup: Y,
1657
+ column: T,
1658
+ currentColumn: ae,
1659
+ conditionIndex: y,
1660
+ effect: L,
1661
+ when: R,
1662
+ condition: z,
1663
+ setCondition(b) {
1664
+ "field" in b ? (R.value = b, K.value = null) : K.value = b;
1665
+ },
1666
+ style: G,
1667
+ error: w,
1668
+ preview: c,
1669
+ diagnostics: ne,
1670
+ selectedComputed: U,
1671
+ loadComputed: m,
1672
+ applyComputed: D,
1673
+ removeComputed: E,
1674
+ check: f,
1675
+ setExpression: u,
1676
+ toggleGroupField: H,
1677
+ addGroup: I,
1678
+ moveGroup: Ue,
1679
+ removeGroup: Fe,
1680
+ addAggregate: Se,
1681
+ applyGroups: Me,
1682
+ loadCondition: ye,
1683
+ setThreshold: xe,
1684
+ applyCondition: Ne,
1685
+ applyLayout: N,
1686
+ resetDraft: () => {
1687
+ _ = void 0, te();
1688
+ }
1689
+ };
1690
+ }
1691
+ const ln = ["aria-label"], an = { class: "mr-rule-editor__directory" }, tn = ["aria-label"], nn = ["aria-selected", "onClick"], sn = { key: 0 }, dn = { key: 1 }, on = { class: "mr-rule-editor__catalog" }, un = ["disabled"], rn = ["aria-label"], cn = { class: "mr-rule-editor__field-list" }, mn = ["disabled", "title", "onClick"], vn = { key: 1 }, bn = {
1692
+ key: 0,
1693
+ class: "mr-rule-editor__panel"
1694
+ }, gn = ["aria-label", "value", "disabled"], yn = { value: "" }, fn = ["value"], hn = ["aria-label", "disabled"], kn = { class: "mr-rule-editor__pair" }, $n = ["aria-label", "disabled"], Vn = ["value"], wn = ["aria-label", "disabled"], Cn = { value: "number" }, Un = { value: "decimal" }, Fn = {
1695
+ key: 0,
1696
+ class: "mr-rule-editor__checks"
1697
+ }, Sn = ["checked", "disabled", "onChange"], Mn = {
1698
+ key: 2,
1699
+ class: "mr-rule-editor__hint"
1700
+ }, Dn = { class: "mr-rule-editor__advanced" }, xn = ["aria-label", "disabled"], Nn = ["aria-label", "disabled"], Rn = { value: "propagate" }, En = { value: "error" }, Tn = ["aria-label", "disabled"], Kn = { value: "error" }, Ln = { value: "null" }, Bn = {
1701
+ key: 3,
1702
+ class: "mr-rule-editor__hint"
1703
+ }, On = {
1704
+ key: 4,
1705
+ class: "mr-rule-editor__diagnostic"
1706
+ }, An = { class: "mr-rule-editor__actions" }, In = ["disabled"], Wn = ["disabled"], Gn = ["disabled"], Jn = {
1707
+ key: 5,
1708
+ class: "mr-rule-editor__error"
1709
+ }, jn = {
1710
+ key: 1,
1711
+ class: "mr-rule-editor__panel"
1712
+ }, Hn = { class: "mr-rule-editor__pair" }, Pn = ["aria-label"], zn = ["value"], qn = {
1713
+ key: 0,
1714
+ value: 0
1715
+ }, Zn = ["disabled"], Qn = ["aria-label", "disabled"], Xn = ["value"], Yn = { class: "mr-rule-editor__pair" }, pn = ["aria-label", "disabled"], _n = ["aria-label", "disabled"], ei = { class: "mr-rule-editor__checks" }, li = ["disabled"], ai = ["disabled"], ti = { class: "mr-rule-editor__pair" }, ni = ["aria-label", "onUpdate:modelValue", "disabled"], ii = ["value"], si = ["aria-label", "onUpdate:modelValue", "disabled"], di = ["value"], oi = ["aria-label", "onUpdate:modelValue", "disabled"], ui = { value: void 0 }, ri = ["value"], ci = { key: 0 }, mi = ["aria-label", "onUpdate:modelValue", "disabled"], vi = ["value"], bi = { class: "mr-rule-editor__pair" }, gi = ["onUpdate:modelValue", "disabled", "aria-label"], yi = { value: "number" }, fi = { value: "decimal" }, hi = ["disabled", "onClick"], ki = ["disabled"], $i = { class: "mr-rule-editor__actions" }, Vi = ["disabled", "aria-label"], wi = ["disabled", "aria-label"], Ci = ["disabled"], Ui = ["disabled"], Fi = {
1716
+ key: 2,
1717
+ class: "mr-rule-editor__panel"
1718
+ }, Si = ["aria-label", "disabled"], Mi = ["value"], Di = ["aria-label", "disabled"], xi = { value: "style" }, Ni = { value: "cell" }, Ri = { value: "rowVisibility" }, Ei = { key: 0 }, Ti = ["aria-label", "value", "disabled"], Ki = { value: -1 }, Li = ["value"], Bi = { class: "mr-rule-editor__pair" }, Oi = ["disabled"], Ai = ["disabled"], Ii = { class: "mr-rule-editor__check" }, Wi = ["disabled"], Gi = { class: "mr-rule-editor__actions" }, Ji = ["disabled"], ji = ["disabled"], Hi = { class: "mr-rule-editor__explanation" }, Pi = { key: 0 }, zi = { class: "mr-rule-editor__results" }, qi = { key: 0 }, Zi = { key: 1 }, Qi = {
1719
+ key: 1,
1720
+ class: "mr-rule-editor__error",
1721
+ role: "alert"
1722
+ }, Xi = /* @__PURE__ */ me({
1723
+ __name: "RuleEditor",
1724
+ props: {
1725
+ recoveryKey: {},
1726
+ list: {},
1727
+ datasets: {},
1728
+ datasetSchema: {},
1729
+ datasetSchemas: {},
1730
+ readonly: { type: Boolean },
1731
+ messages: {}
1732
+ },
1733
+ emits: ["change", "dirty"],
1734
+ setup(e, { expose: W, emit: $ }) {
1735
+ const j = Le(), w = e, U = $, r = en(w, (E) => U("change", E)), {
1736
+ m: d,
1737
+ tab: V,
1738
+ fields: T,
1739
+ formula: y,
1740
+ groups: L,
1741
+ groupIndex: R,
1742
+ currentGroup: K,
1743
+ column: z,
1744
+ currentColumn: G,
1745
+ conditionIndex: c,
1746
+ effect: n,
1747
+ condition: v,
1748
+ style: o,
1749
+ error: h,
1750
+ preview: A,
1751
+ diagnostics: Z,
1752
+ selectedComputed: ee
1753
+ } = r, p = J({}), _ = J(0);
1754
+ function le() {
1755
+ r.resetDraft(), p.value = {}, _.value++;
1756
+ }
1757
+ const Y = P(() => r.pendingLocalChanges.value || Object.values(p.value).some(Boolean));
1758
+ se([Y, r.draftSnapshot, p], () => U("dirty", Y.value), { immediate: !0, deep: !0, flush: "sync" }), W({ get pendingLocalChanges() {
1759
+ return Y.value;
1760
+ } });
1761
+ const ae = Ge(w, r.formula, d), { query: ne, matches: te, fieldWindow: m, expression: S, sources: N } = ae, D = ge();
1762
+ return (E, f) => (i(), s("section", {
1763
+ class: "mr-rule-editor",
1764
+ style: Ee(l(j)),
1765
+ "aria-label": l(d).settings
1766
+ }, [
1767
+ a("aside", an, [
1768
+ a("div", {
1769
+ class: "mr-rule-editor__tabs",
1770
+ role: "tablist",
1771
+ "aria-label": l(d).settings
1772
+ }, [
1773
+ (i(), s(C, null, M([
1774
+ "computations",
1775
+ "groups",
1776
+ "conditions",
1777
+ "detail",
1778
+ "matrix",
1779
+ "tree"
1780
+ ], (u) => a("button", {
1781
+ key: u,
1782
+ type: "button",
1783
+ role: "tab",
1784
+ "aria-selected": l(V) === u,
1785
+ class: be({ "is-active": l(V) === u }),
1786
+ onClick: (H) => V.value = u
1787
+ }, [
1788
+ k(t(l(d)[u]), 1),
1789
+ u === "computations" && e.list.computed?.length ? (i(), s("span", sn, t(e.list.computed.length), 1)) : x("", !0),
1790
+ u === "groups" && l(L).length ? (i(), s("span", dn, t(l(L).length), 1)) : x("", !0)
1791
+ ], 10, nn)), 64))
1792
+ ], 8, tn),
1793
+ a("div", on, [
1794
+ a("strong", null, t(l(d).catalog), 1),
1795
+ Y.value ? (i(), s("button", {
1796
+ key: 0,
1797
+ type: "button",
1798
+ disabled: e.readonly,
1799
+ onClick: le
1800
+ }, t(l(d).restoreDraft), 9, un)) : x("", !0),
1801
+ a("label", null, [
1802
+ k(t(l(d).searchFields), 1),
1803
+ F(a("input", {
1804
+ "onUpdate:modelValue": f[0] || (f[0] = (u) => ue(ne) ? ne.value = u : null),
1805
+ type: "search",
1806
+ "aria-label": l(d).searchFields
1807
+ }, null, 8, rn), [
1808
+ [Q, l(ne)]
1809
+ ])
1810
+ ]),
1811
+ a("div", cn, [
1812
+ (i(!0), s(C, null, M(l(m), (u) => (i(), s("button", {
1813
+ key: u.field,
1814
+ type: "button",
1815
+ disabled: e.readonly || l(V) !== "computations",
1816
+ title: l(d).useField,
1817
+ onClick: (H) => l(r).setExpression({ field: u.field })
1818
+ }, [
1819
+ a("strong", null, t(u.label), 1),
1820
+ a("code", null, t(u.field), 1),
1821
+ a("small", null, t(u.meta), 1)
1822
+ ], 8, mn))), 128))
1823
+ ]),
1824
+ l(te).length > 50 ? (i(), s("small", vn, t(l(d).shown) + " 50 / " + t(l(te).length), 1)) : x("", !0)
1825
+ ])
1826
+ ]),
1827
+ l(V) === "computations" ? (i(), s("div", bn, [
1828
+ a("label", null, [
1829
+ k(t(l(d).existing), 1),
1830
+ a("select", {
1831
+ "aria-label": l(d).existing,
1832
+ value: l(ee),
1833
+ disabled: e.readonly,
1834
+ onChange: f[1] || (f[1] = (u) => l(r).loadComputed(u.target.value))
1835
+ }, [
1836
+ a("option", yn, "+ " + t(l(d).newField), 1),
1837
+ (i(!0), s(C, null, M(e.list.computed, (u) => (i(), s("option", {
1838
+ key: u.field,
1839
+ value: u.field
1840
+ }, t(u.field), 9, fn))), 128))
1841
+ ], 40, gn)
1842
+ ]),
1843
+ a("label", null, [
1844
+ k(t(l(d).target), 1),
1845
+ F(a("input", {
1846
+ "aria-label": l(d).target,
1847
+ "onUpdate:modelValue": f[2] || (f[2] = (u) => l(y).field = u),
1848
+ disabled: e.readonly,
1849
+ autocomplete: "off"
1850
+ }, null, 8, hn), [
1851
+ [Q, l(y).field]
1852
+ ])
1853
+ ]),
1854
+ a("div", kn, [
1855
+ a("label", null, [
1856
+ k(t(l(d).scope), 1),
1857
+ F(a("select", {
1858
+ "aria-label": l(d).scope,
1859
+ "onUpdate:modelValue": f[3] || (f[3] = (u) => l(y).scope = u),
1860
+ disabled: e.readonly
1861
+ }, [
1862
+ (i(!0), s(C, null, M(l(D).scopes, (u) => (i(), s("option", {
1863
+ key: u,
1864
+ value: u
1865
+ }, t(l(d)[u]), 9, Vn))), 128))
1866
+ ], 8, $n), [
1867
+ [O, l(y).scope]
1868
+ ])
1869
+ ]),
1870
+ a("label", null, [
1871
+ k(t(l(d).numeric), 1),
1872
+ F(a("select", {
1873
+ "aria-label": l(d).numeric,
1874
+ "onUpdate:modelValue": f[4] || (f[4] = (u) => l(y).numeric = u),
1875
+ disabled: e.readonly
1876
+ }, [
1877
+ a("option", Cn, t(l(d).number), 1),
1878
+ a("option", Un, t(l(d).decimal), 1)
1879
+ ], 8, wn), [
1880
+ [O, l(y).numeric]
1881
+ ])
1882
+ ])
1883
+ ]),
1884
+ l(y).scope === "group" ? (i(), s("fieldset", Fn, [
1885
+ a("legend", null, t(l(d).groupFields), 1),
1886
+ (i(!0), s(C, null, M(l(T), (u) => (i(), s("label", {
1887
+ key: u.field
1888
+ }, [
1889
+ a("input", {
1890
+ type: "checkbox",
1891
+ checked: l(y).groupBy?.includes(u.field),
1892
+ disabled: e.readonly,
1893
+ onChange: (H) => l(r).toggleGroupField(
1894
+ u.field,
1895
+ H.target.checked
1896
+ )
1897
+ }, null, 40, Sn),
1898
+ k(t(u.label), 1)
1899
+ ]))), 128))
1900
+ ])) : x("", !0),
1901
+ typeof l(y).expression != "string" ? (i(), he(_t, {
1902
+ key: 1,
1903
+ "model-value": l(y).expression,
1904
+ fields: l(T),
1905
+ messages: l(d),
1906
+ readonly: e.readonly,
1907
+ "onUpdate:modelValue": l(r).setExpression
1908
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"])) : (i(), s("p", Mn, t(l(y).expression), 1)),
1909
+ a("details", null, [
1910
+ a("summary", null, t(l(d).advanced), 1),
1911
+ a("div", Dn, [
1912
+ a("label", null, [
1913
+ k(t(l(d).digits), 1),
1914
+ F(a("input", {
1915
+ "aria-label": l(d).digits,
1916
+ "onUpdate:modelValue": f[5] || (f[5] = (u) => l(y).digits = u),
1917
+ type: "number",
1918
+ min: "0",
1919
+ max: "100",
1920
+ disabled: e.readonly
1921
+ }, null, 8, xn), [
1922
+ [
1923
+ Q,
1924
+ l(y).digits,
1925
+ void 0,
1926
+ { number: !0 }
1927
+ ]
1928
+ ])
1929
+ ]),
1930
+ a("label", null, [
1931
+ k(t(l(d).nulls), 1),
1932
+ F(a("select", {
1933
+ "aria-label": l(d).nulls,
1934
+ "onUpdate:modelValue": f[6] || (f[6] = (u) => l(y).nulls = u),
1935
+ disabled: e.readonly
1936
+ }, [
1937
+ a("option", Rn, t(l(d).propagate), 1),
1938
+ a("option", En, t(l(d).error), 1)
1939
+ ], 8, Nn), [
1940
+ [O, l(y).nulls]
1941
+ ])
1942
+ ]),
1943
+ a("label", null, [
1944
+ k(t(l(d).division), 1),
1945
+ F(a("select", {
1946
+ "aria-label": l(d).division,
1947
+ "onUpdate:modelValue": f[7] || (f[7] = (u) => l(y).divisionByZero = u),
1948
+ disabled: e.readonly
1949
+ }, [
1950
+ a("option", Kn, t(l(d).error), 1),
1951
+ a("option", Ln, t(l(d).propagate), 1)
1952
+ ], 8, Tn), [
1953
+ [O, l(y).divisionByZero]
1954
+ ])
1955
+ ])
1956
+ ])
1957
+ ]),
1958
+ l(y).numeric === "decimal" ? (i(), s("p", Bn, t(l(d).decimalHint), 1)) : x("", !0),
1959
+ l(Z).valid && l(y).field ? (i(), s("div", On, [
1960
+ k(t(l(d).dependencies), 1),
1961
+ a("strong", null, t(l(Z).order.join(" → ")), 1)
1962
+ ])) : x("", !0),
1963
+ a("div", An, [
1964
+ a("button", {
1965
+ type: "button",
1966
+ disabled: e.readonly,
1967
+ onClick: f[8] || (f[8] = //@ts-ignore
1968
+ (...u) => l(r).check && l(r).check(...u))
1969
+ }, t(l(d).check), 9, In),
1970
+ a("button", {
1971
+ type: "button",
1972
+ class: "mr-rule-editor__primary",
1973
+ disabled: e.readonly || !l(Z).valid,
1974
+ onClick: f[9] || (f[9] = //@ts-ignore
1975
+ (...u) => l(r).applyComputed && l(r).applyComputed(...u))
1976
+ }, t(l(d).apply), 9, Wn),
1977
+ l(ee) ? (i(), s("button", {
1978
+ key: 0,
1979
+ type: "button",
1980
+ disabled: e.readonly,
1981
+ onClick: f[10] || (f[10] = //@ts-ignore
1982
+ (...u) => l(r).removeComputed && l(r).removeComputed(...u))
1983
+ }, t(l(d).remove), 9, Gn)) : x("", !0)
1984
+ ]),
1985
+ !l(Z).valid && l(y).field ? (i(), s("p", Jn, t(l(Z).errors.join(";")), 1)) : x("", !0)
1986
+ ])) : l(V) === "groups" ? (i(), s("div", jn, [
1987
+ a("div", Hn, [
1988
+ F(a("select", {
1989
+ "onUpdate:modelValue": f[11] || (f[11] = (u) => ue(R) ? R.value = u : null),
1990
+ "aria-label": l(d).groups
1991
+ }, [
1992
+ (i(!0), s(C, null, M(l(L), (u, H) => (i(), s("option", {
1993
+ key: H,
1994
+ value: H
1995
+ }, t(H + 1) + " · " + t(u.field), 9, zn))), 128)),
1996
+ l(L).length ? x("", !0) : (i(), s("option", qn, t(l(d).noGroups), 1))
1997
+ ], 8, Pn), [
1998
+ [
1999
+ O,
2000
+ l(R),
2001
+ void 0,
2002
+ { number: !0 }
2003
+ ]
2004
+ ]),
2005
+ a("button", {
2006
+ type: "button",
2007
+ disabled: e.readonly || l(L).length >= 16,
2008
+ onClick: f[12] || (f[12] = //@ts-ignore
2009
+ (...u) => l(r).addGroup && l(r).addGroup(...u))
2010
+ }, " + " + t(l(d).addGroup), 9, Zn)
2011
+ ]),
2012
+ l(K) ? (i(), s(C, { key: 0 }, [
2013
+ a("label", null, [
2014
+ k(t(l(d).field), 1),
2015
+ F(a("select", {
2016
+ "aria-label": l(d).field,
2017
+ "onUpdate:modelValue": f[13] || (f[13] = (u) => l(K).field = u),
2018
+ disabled: e.readonly
2019
+ }, [
2020
+ (i(!0), s(C, null, M(l(T), (u) => (i(), s("option", {
2021
+ key: u.field,
2022
+ value: u.field
2023
+ }, t(u.label), 9, Xn))), 128))
2024
+ ], 8, Qn), [
2025
+ [O, l(K).field]
2026
+ ])
2027
+ ]),
2028
+ a("div", Yn, [
2029
+ a("label", null, [
2030
+ k(t(l(d).header), 1),
2031
+ F(a("input", {
2032
+ "aria-label": l(d).header,
2033
+ "onUpdate:modelValue": f[14] || (f[14] = (u) => l(K).headerTemplate = u),
2034
+ disabled: e.readonly,
2035
+ placeholder: "{value}"
2036
+ }, null, 8, pn), [
2037
+ [Q, l(K).headerTemplate]
2038
+ ])
2039
+ ]),
2040
+ a("label", null, [
2041
+ k(t(l(d).footer), 1),
2042
+ F(a("input", {
2043
+ "aria-label": l(d).footer,
2044
+ "onUpdate:modelValue": f[15] || (f[15] = (u) => l(K).subtotalLabel = u),
2045
+ disabled: e.readonly
2046
+ }, null, 8, _n), [
2047
+ [Q, l(K).subtotalLabel]
2048
+ ])
2049
+ ])
2050
+ ]),
2051
+ a("div", ei, [
2052
+ a("label", null, [
2053
+ F(a("input", {
2054
+ "onUpdate:modelValue": f[16] || (f[16] = (u) => l(K).keepWithNext = u),
2055
+ type: "checkbox",
2056
+ disabled: e.readonly
2057
+ }, null, 8, li), [
2058
+ [oe, l(K).keepWithNext]
2059
+ ]),
2060
+ k(t(l(d).orphan), 1)
2061
+ ]),
2062
+ a("label", null, [
2063
+ F(a("input", {
2064
+ "onUpdate:modelValue": f[17] || (f[17] = (u) => l(K).repeatHeader = u),
2065
+ type: "checkbox",
2066
+ disabled: e.readonly
2067
+ }, null, 8, ai), [
2068
+ [oe, l(K).repeatHeader]
2069
+ ]),
2070
+ k(t(l(d).repeat), 1)
2071
+ ])
2072
+ ]),
2073
+ (i(!0), s(C, null, M(l(K).aggregates, (u, H) => (i(), s("div", {
2074
+ key: H,
2075
+ class: "mr-rule-editor__aggregate"
2076
+ }, [
2077
+ a("div", ti, [
2078
+ a("label", null, [
2079
+ k(t(l(d).output), 1),
2080
+ F(a("select", {
2081
+ "aria-label": l(d).output,
2082
+ "onUpdate:modelValue": (I) => u.field = I,
2083
+ disabled: e.readonly
2084
+ }, [
2085
+ (i(!0), s(C, null, M(l(T), (I) => (i(), s("option", {
2086
+ key: I.field,
2087
+ value: I.field
2088
+ }, t(I.label), 9, ii))), 128))
2089
+ ], 8, ni), [
2090
+ [O, u.field]
2091
+ ])
2092
+ ]),
2093
+ a("label", null, [
2094
+ k(t(l(d).aggregate), 1),
2095
+ F(a("select", {
2096
+ "aria-label": l(d).aggregate,
2097
+ "onUpdate:modelValue": (I) => u.op = I,
2098
+ disabled: e.readonly
2099
+ }, [
2100
+ (i(!0), s(C, null, M(l(D).aggregates, (I) => (i(), s("option", {
2101
+ key: I,
2102
+ value: I
2103
+ }, t(l(d)[I]), 9, di))), 128))
2104
+ ], 8, si), [
2105
+ [O, u.op]
2106
+ ])
2107
+ ])
2108
+ ]),
2109
+ a("label", null, [
2110
+ k(t(l(d).measure), 1),
2111
+ F(a("select", {
2112
+ "aria-label": l(d).measure,
2113
+ "onUpdate:modelValue": (I) => u.valueField = I,
2114
+ disabled: e.readonly
2115
+ }, [
2116
+ a("option", ui, t(u.field), 1),
2117
+ (i(!0), s(C, null, M(l(T), (I) => (i(), s("option", {
2118
+ key: I.field,
2119
+ value: I.field
2120
+ }, t(I.label), 9, ri))), 128))
2121
+ ], 8, oi), [
2122
+ [O, u.valueField]
2123
+ ])
2124
+ ]),
2125
+ u.op === "weightedAvg" ? (i(), s("label", ci, [
2126
+ k(t(l(d).weight), 1),
2127
+ F(a("select", {
2128
+ "aria-label": l(d).weight,
2129
+ "onUpdate:modelValue": (I) => u.weightField = I,
2130
+ disabled: e.readonly
2131
+ }, [
2132
+ (i(!0), s(C, null, M(l(T), (I) => (i(), s("option", {
2133
+ key: I.field,
2134
+ value: I.field
2135
+ }, t(I.label), 9, vi))), 128))
2136
+ ], 8, mi), [
2137
+ [O, u.weightField]
2138
+ ])
2139
+ ])) : x("", !0),
2140
+ a("div", bi, [
2141
+ F(a("select", {
2142
+ "onUpdate:modelValue": (I) => u.numeric = I,
2143
+ disabled: e.readonly,
2144
+ "aria-label": l(d).numeric
2145
+ }, [
2146
+ a("option", yi, t(l(d).number), 1),
2147
+ a("option", fi, t(l(d).decimal), 1)
2148
+ ], 8, gi), [
2149
+ [O, u.numeric]
2150
+ ]),
2151
+ a("button", {
2152
+ type: "button",
2153
+ disabled: e.readonly,
2154
+ onClick: (I) => l(K).aggregates?.splice(H, 1)
2155
+ }, t(l(d).remove), 9, hi)
2156
+ ])
2157
+ ]))), 128)),
2158
+ a("button", {
2159
+ type: "button",
2160
+ disabled: e.readonly,
2161
+ onClick: f[18] || (f[18] = //@ts-ignore
2162
+ (...u) => l(r).addAggregate && l(r).addAggregate(...u))
2163
+ }, " + " + t(l(d).addAggregate), 9, ki),
2164
+ a("div", $i, [
2165
+ a("button", {
2166
+ type: "button",
2167
+ disabled: e.readonly || l(R) === 0,
2168
+ "aria-label": l(d).moveUp,
2169
+ onClick: f[19] || (f[19] = (u) => l(r).moveGroup(-1))
2170
+ }, " ↑ " + t(l(d).outer), 9, Vi),
2171
+ a("button", {
2172
+ type: "button",
2173
+ disabled: e.readonly || l(R) >= l(L).length - 1,
2174
+ "aria-label": l(d).moveDown,
2175
+ onClick: f[20] || (f[20] = (u) => l(r).moveGroup(1))
2176
+ }, " ↓ " + t(l(d).inner), 9, wi),
2177
+ a("button", {
2178
+ type: "button",
2179
+ disabled: e.readonly,
2180
+ onClick: f[21] || (f[21] = //@ts-ignore
2181
+ (...u) => l(r).removeGroup && l(r).removeGroup(...u))
2182
+ }, t(l(d).remove), 9, Ci)
2183
+ ])
2184
+ ], 64)) : x("", !0),
2185
+ a("button", {
2186
+ type: "button",
2187
+ class: "mr-rule-editor__primary",
2188
+ disabled: e.readonly,
2189
+ onClick: f[22] || (f[22] = //@ts-ignore
2190
+ (...u) => l(r).applyGroups && l(r).applyGroups(...u))
2191
+ }, t(l(d).apply), 9, Ui)
2192
+ ])) : l(V) === "conditions" ? (i(), s("div", Fi, [
2193
+ a("label", null, [
2194
+ k(t(l(d).column), 1),
2195
+ F(a("select", {
2196
+ "aria-label": l(d).column,
2197
+ "onUpdate:modelValue": f[23] || (f[23] = (u) => ue(z) ? z.value = u : null),
2198
+ disabled: e.readonly,
2199
+ onChange: f[24] || (f[24] = (u) => l(r).loadCondition(-1))
2200
+ }, [
2201
+ (i(!0), s(C, null, M(e.list.columns, (u) => (i(), s("option", {
2202
+ key: u.field,
2203
+ value: u.field
2204
+ }, t(u.header || u.field), 9, Mi))), 128))
2205
+ ], 40, Si), [
2206
+ [O, l(z)]
2207
+ ])
2208
+ ]),
2209
+ a("label", null, [
2210
+ k(t(l(d).effect), 1),
2211
+ F(a("select", {
2212
+ "aria-label": l(d).effect,
2213
+ "onUpdate:modelValue": f[25] || (f[25] = (u) => ue(n) ? n.value = u : null),
2214
+ disabled: e.readonly,
2215
+ onChange: f[26] || (f[26] = (u) => l(r).loadCondition(-1))
2216
+ }, [
2217
+ a("option", xi, t(l(d).style), 1),
2218
+ a("option", Ni, t(l(d).cell), 1),
2219
+ a("option", Ri, t(l(d).rowVisibility), 1)
2220
+ ], 40, Di), [
2221
+ [O, l(n)]
2222
+ ])
2223
+ ]),
2224
+ l(n) === "style" ? (i(), s("label", Ei, [
2225
+ k(t(l(d).existing), 1),
2226
+ a("select", {
2227
+ "aria-label": l(d).existing,
2228
+ value: l(c),
2229
+ disabled: e.readonly,
2230
+ onChange: f[27] || (f[27] = (u) => l(r).loadCondition(
2231
+ Number(u.target.value)
2232
+ ))
2233
+ }, [
2234
+ a("option", Ki, "+ " + t(l(d).newCondition), 1),
2235
+ (i(!0), s(C, null, M(l(G)?.rules, (u, H) => (i(), s("option", {
2236
+ key: H,
2237
+ value: H
2238
+ }, t(H + 1) + " · " + t("field" in u.when ? u.when.field : l(d).conditionGroup), 9, Li))), 128))
2239
+ ], 40, Ti)
2240
+ ])) : x("", !0),
2241
+ ce(Ce, {
2242
+ "model-value": l(v),
2243
+ fields: l(T),
2244
+ messages: l(d),
2245
+ readonly: e.readonly,
2246
+ "onUpdate:modelValue": l(r).setCondition
2247
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"]),
2248
+ l(n) === "style" ? (i(), s(C, { key: 1 }, [
2249
+ a("div", Bi, [
2250
+ a("label", null, [
2251
+ k(t(l(d).color), 1),
2252
+ F(a("input", {
2253
+ "onUpdate:modelValue": f[28] || (f[28] = (u) => l(o).color = u),
2254
+ type: "color",
2255
+ disabled: e.readonly
2256
+ }, null, 8, Oi), [
2257
+ [Q, l(o).color]
2258
+ ])
2259
+ ]),
2260
+ a("label", null, [
2261
+ k(t(l(d).background), 1),
2262
+ F(a("input", {
2263
+ "onUpdate:modelValue": f[29] || (f[29] = (u) => l(o).backgroundColor = u),
2264
+ type: "color",
2265
+ disabled: e.readonly
2266
+ }, null, 8, Ai), [
2267
+ [Q, l(o).backgroundColor]
2268
+ ])
2269
+ ])
2270
+ ]),
2271
+ a("label", Ii, [
2272
+ F(a("input", {
2273
+ "onUpdate:modelValue": f[30] || (f[30] = (u) => l(o).bold = u),
2274
+ type: "checkbox",
2275
+ disabled: e.readonly
2276
+ }, null, 8, Wi), [
2277
+ [oe, l(o).bold]
2278
+ ]),
2279
+ k(t(l(d).bold), 1)
2280
+ ])
2281
+ ], 64)) : x("", !0),
2282
+ a("div", Gi, [
2283
+ a("button", {
2284
+ type: "button",
2285
+ class: "mr-rule-editor__primary",
2286
+ disabled: e.readonly,
2287
+ onClick: f[31] || (f[31] = (u) => l(r).applyCondition())
2288
+ }, t(l(d).apply), 9, Ji),
2289
+ l(c) >= 0 || l(n) !== "style" ? (i(), s("button", {
2290
+ key: 0,
2291
+ type: "button",
2292
+ disabled: e.readonly,
2293
+ onClick: f[32] || (f[32] = (u) => l(r).applyCondition(!0))
2294
+ }, t(l(d).removeCondition), 9, ji)) : x("", !0)
2295
+ ])
2296
+ ])) : x("", !0),
2297
+ (i(), s(C, null, M(["detail", "matrix", "tree"], (u) => F(ce(Vt, {
2298
+ key: `${u}-${_.value}`,
2299
+ list: e.list,
2300
+ "recovery-key": e.recoveryKey,
2301
+ mode: u,
2302
+ datasets: e.datasets,
2303
+ "dataset-schema": e.datasetSchema,
2304
+ "dataset-schemas": e.datasetSchemas,
2305
+ readonly: e.readonly,
2306
+ messages: l(d),
2307
+ accept: l(r).applyLayout,
2308
+ onDirty: (H) => p.value = { ...p.value, [u]: H }
2309
+ }, null, 8, ["list", "recovery-key", "mode", "datasets", "dataset-schema", "dataset-schemas", "readonly", "messages", "accept", "onDirty"]), [
2310
+ [Te, l(V) === u]
2311
+ ])), 64)),
2312
+ a("aside", Hi, [
2313
+ a("header", null, [
2314
+ a("strong", null, t(l(d).explanation), 1),
2315
+ Y.value ? (i(), s("span", Pi, t(l(d).pending), 1)) : x("", !0)
2316
+ ]),
2317
+ a("p", null, t(l(d).sourceHint), 1),
2318
+ l(V) === "computations" ? (i(), s(C, { key: 0 }, [
2319
+ a("h4", null, t(l(d).expression), 1),
2320
+ a("code", null, t(l(S)), 1),
2321
+ a("div", zi, [
2322
+ a("h4", null, t(l(d).sourceValues) + " → " + t(l(d).result), 1),
2323
+ (i(!0), s(C, null, M(l(N), (u) => (i(), s("div", {
2324
+ key: u.row,
2325
+ class: "mr-rule-editor__trace"
2326
+ }, [
2327
+ a("small", null, "#" + t(u.row), 1),
2328
+ a("code", null, t(u.values), 1),
2329
+ a("strong", null, t(l(A).find((H) => H.row === u.row)?.value ?? (l(A).length ? "—" : l(d).notChecked)), 1)
2330
+ ]))), 128)),
2331
+ l(A).some((u) => u.value == null) ? (i(), s("p", qi, t(l(d).nullReason), 1)) : x("", !0),
2332
+ l(A).length ? (i(), s("p", Zi, t(l(d).sample), 1)) : x("", !0)
2333
+ ])
2334
+ ], 64)) : x("", !0),
2335
+ l(h) ? (i(), s("p", Qi, t(l(h)), 1)) : x("", !0)
2336
+ ])
2337
+ ], 12, ln));
2338
+ }
2339
+ }), ss = /* @__PURE__ */ ve(Xi, [["__scopeId", "data-v-a23accc9"]]);
2340
+ export {
2341
+ ss as default
2342
+ };