@agile-team/mach-report 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +27 -3
  2. package/dist/ExcelBindingWizard-CLT2p7P3.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CvsWR8Ga.js +1485 -0
  4. package/dist/{ParamEditor-BLaE5q5W.js → ParamEditor-CflQV3eQ.js} +191 -187
  5. package/dist/ParamEditor-vIDzvpPV.cjs +1 -0
  6. package/dist/ReportBatchPanel-DkxTzBkD.cjs +1 -0
  7. package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-LqVgiqp7.js} +3 -3
  8. package/dist/ReportPreview-CvbqLUzM.cjs +6 -0
  9. package/dist/ReportPreview-D_ywJ_-H.js +4533 -0
  10. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-MjWEtc7X.js} +1 -1
  11. package/dist/ReportTemplateLibrary-cQ1sqNYo.cjs +1 -0
  12. package/dist/RuleEditor-BaR6xUiI.cjs +1 -0
  13. package/dist/RuleEditor-ChuXMlei.js +2037 -0
  14. package/dist/TemplateOutlinePanel-BHKP89Xz.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-Dci6aRn1.js +96 -0
  16. package/dist/TemplateReusePanel-B7Gmyc1z.js +388 -0
  17. package/dist/TemplateReusePanel-CY5eO2Sh.cjs +1 -0
  18. package/dist/TemplateReviewPanel-DjlX3xpt.js +592 -0
  19. package/dist/TemplateReviewPanel-JvZe9_4G.cjs +1 -0
  20. package/dist/{batch-mRqhhhjt.js → batch-DzaTNLWI.js} +23 -16
  21. package/dist/batch-xMkqYiTr.cjs +1 -0
  22. package/dist/config-0UIohTS7.cjs +1 -0
  23. package/dist/{config-B612mw0x.js → config-Dt9NtCPl.js} +227 -186
  24. package/dist/data-explanation-BktvER5B.cjs +1 -0
  25. package/dist/data-explanation-C_J6jYNi.js +16 -0
  26. package/dist/designer-Ci1LizA9.js +5020 -0
  27. package/dist/designer-rtmVIIdN.cjs +2 -0
  28. package/dist/designer.cjs +1 -2
  29. package/dist/designer.d.cts +306 -3
  30. package/dist/designer.d.ts +306 -3
  31. package/dist/designer.js +21 -4266
  32. package/dist/font-loader-DHto6Lra.js +297 -0
  33. package/dist/font-loader-vhCT8znW.cjs +1 -0
  34. package/dist/index.cjs +8 -8
  35. package/dist/index.d.cts +182 -1
  36. package/dist/index.d.ts +182 -1
  37. package/dist/index.js +728 -628
  38. package/dist/{template-review-BzpcI-tR.js → json-snapshot-BeFT3Tso.js} +867 -637
  39. package/dist/json-snapshot-D1NTP2oI.cjs +2 -0
  40. package/dist/pdf-8UPQebOE.js +36288 -0
  41. package/dist/pdf-AyJGb22z.cjs +101 -0
  42. package/dist/pdf.cjs +1 -101
  43. package/dist/pdf.js +9 -36579
  44. package/dist/plugin-BGKf-Tqg.js +22 -0
  45. package/dist/{plugin-BDTU4D94.cjs → plugin-CktLH_Iy.cjs} +1 -1
  46. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-DEJbhpCv.js} +1 -1
  47. package/dist/server/node.d.cts +46 -11
  48. package/dist/server/node.d.ts +46 -11
  49. package/dist/server-node.cjs +1 -1
  50. package/dist/server-node.js +294 -280
  51. package/dist/server.cjs +1 -1
  52. package/dist/server.d.cts +107 -12
  53. package/dist/server.d.ts +107 -12
  54. package/dist/server.js +713 -453
  55. package/dist/style.css +1 -1
  56. package/dist/template-bindings-BJR4k7qZ.cjs +1 -0
  57. package/dist/template-bindings-Daui7hLF.js +252 -0
  58. package/dist/template-fragments-CLkGo6To.js +187 -0
  59. package/dist/template-fragments-DFUpq5QM.cjs +1 -0
  60. package/dist/template-outline-B3xVkzSv.cjs +1 -0
  61. package/dist/template-outline-CFenM1PV.js +88 -0
  62. package/dist/{template-registry-BjE1VS6g.js → template-registry-COXDEJEM.js} +1 -1
  63. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  64. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  65. package/dist/{validate-DbgEM1Hh.js → validate-CkQBWCeg.js} +3 -3
  66. package/dist/vue/async.d.cts +72 -2
  67. package/dist/vue/async.d.ts +72 -2
  68. package/dist/vue/index.d.cts +124 -5
  69. package/dist/vue/index.d.ts +124 -5
  70. package/dist/vue-async.cjs +1 -1
  71. package/dist/vue-async.js +5 -5
  72. package/dist/vue.cjs +1 -1
  73. package/dist/vue.js +78 -71
  74. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BfK1yHOO.js} +1 -1
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +46 -11
  77. package/dist/worker.d.ts +46 -11
  78. package/dist/worker.js +59 -55
  79. package/dist/xlsx.js +3 -3
  80. package/package.json +1 -1
  81. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  82. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  83. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  84. package/dist/ReportBatchPanel-Dc-SDkYA.cjs +0 -1
  85. package/dist/ReportPreview-DWXROHBP.cjs +0 -6
  86. package/dist/ReportPreview-DiNXhQI0.js +0 -4138
  87. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  88. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  89. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  90. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  91. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  92. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  93. package/dist/config-BRoLo2oj.cjs +0 -1
  94. package/dist/plugin-Cd5G2QQn.js +0 -22
  95. package/dist/record-bindings-By_UKZ2g.cjs +0 -1
  96. package/dist/record-bindings-D-5jQlTj.js +0 -196
  97. package/dist/template-review-BfCC8Ng9.cjs +0 -2
@@ -1,1465 +0,0 @@
1
- import { defineComponent as Fe, ref as F, computed as S, watch as ie, nextTick as Ee, openBlock as c, createElementBlock as v, createElementVNode as n, createTextVNode as P, toDisplayString as l, createVNode as W, Fragment as O, renderList as J, normalizeClass as xe, createCommentVNode as T, unref as e, withDirectives as De, vModelText as Xe, shallowRef as Qe, onBeforeUnmount as Ye, normalizeStyle as Ze, createBlock as et, vShow as tt } from "vue";
2
- import { o as pe, q as Me, f as nt, n as at, m as lt, h as ot, k as it, v as st, i as rt, p as ut, d as dt, c as ct, e as vt, a as gt, g as ft } from "./region-binding-workflow-CcUq8W2Q.js";
3
- import { a as A } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
- import { u as bt } from "./useLocalDraft-C07SYRnC.js";
5
- import { EXCEL_BINDING_MESSAGES as mt } from "./designer.js";
6
- function ze(t, x) {
7
- const g = /^\$\.datasets\[(\d+)\]/.exec(t.path)?.[1];
8
- return g !== void 0 ? x[Number(g)]?.id : x.find((b) => t.path.startsWith(`$.datasets.${b.id}.samples`))?.id;
9
- }
10
- function Te(t, x) {
11
- const g = /\.fields\[(\d+)\]/.exec(t)?.[1];
12
- return g !== void 0 ? { control: "field", fieldIndex: Number(g) } : { control: t.split(".").at(-1) || x };
13
- }
14
- function Be(t, x, g) {
15
- const b = /^\$\.recipe\.regions\[(\d+)\]/.exec(t.path)?.[1], y = ze(t, g), o = b === void 0 ? x.regions.find((M) => M.dataset === y) : x.regions[Number(b)];
16
- if (!o) return { control: t.path.endsWith("footerRange") ? "footer" : "regions", ...x.footerRange ? { range: x.footerRange } : {} };
17
- if (t.path.startsWith("$.datasets")) return { regionId: o.id, range: o.range, control: t.code === "row-key" ? "rowKey" : "contract" };
18
- const E = Te(t.path, "range"), C = t.code === "row-key" ? "rowKey" : E.control.startsWith("regions[") ? "range" : E.control;
19
- return { ...E, control: C, regionId: o.id, range: o.range };
20
- }
21
- function ht(t, x, g) {
22
- if (t.path.startsWith("$.datasets")) {
23
- const y = ze(t, g);
24
- return y === void 0 ? [] : x.regions.filter((o) => o.dataset === y).map((o) => o.id);
25
- }
26
- const b = Be(t, x, g).regionId;
27
- return b ? [b] : [];
28
- }
29
- function yt(t, x) {
30
- const g = /^\$\.recipe\.regions\.(title|header|detail|footer)$/.exec(t.path)?.[1];
31
- return g ? { control: g, range: x.regions[g] } : t.path.startsWith("$.datasets") ? { control: t.code === "row-key" ? "rowKey" : "contract", range: x.regions.detail } : { ...Te(t.path, "detail"), range: x.regions.detail };
32
- }
33
- function ye(t) {
34
- if (t.range)
35
- try {
36
- const x = pe(t.range);
37
- return t.fieldIndex !== void 0 && (x.left = x.right = x.left + t.fieldIndex), x;
38
- } catch {
39
- return;
40
- }
41
- }
42
- function pt(t, x, g) {
43
- return x.control === "dataset" ? !g.dataset : x.control === "rowKey" ? !g.rowKey : x.control === "field" && x.fieldIndex !== void 0 ? !g.fields[x.fieldIndex] : !1;
44
- }
45
- const wt = ["aria-label"], $t = { class: "mr-binding-group" }, kt = { class: "mr-binding-note" }, xt = ["title", "disabled"], Ct = {
46
- class: "mr-binding-region-list",
47
- role: "list",
48
- tabindex: "-1",
49
- "data-binding-control": "regions"
50
- }, Rt = ["data-state"], It = ["aria-pressed", "onClick"], Mt = ["title"], St = { class: "mr-binding-region-state" }, Kt = { key: 0 }, Ft = ["aria-label", "disabled", "onClick"], Et = ["disabled"], Dt = {
51
- key: 0,
52
- class: "mr-binding-group"
53
- }, zt = {
54
- class: "mr-binding-label",
55
- tabindex: "-1"
56
- }, Tt = ["value", "aria-label"], Bt = { class: "mr-binding-label" }, Lt = ["value", "aria-label"], Nt = { value: "record" }, Pt = { value: "repeat" }, Wt = { class: "mr-binding-note" }, At = {
57
- class: "mr-binding-label",
58
- tabindex: "-1"
59
- }, Ht = ["value", "aria-label"], _t = { value: "" }, qt = ["value"], Ot = {
60
- key: 0,
61
- class: "mr-binding-label",
62
- tabindex: "-1"
63
- }, Vt = ["value", "aria-label"], Jt = { value: "" }, Ut = ["value"], jt = { class: "mr-binding-region-tools" }, Gt = ["disabled"], Xt = ["aria-label"], Qt = {
64
- key: 1,
65
- class: "mr-binding-mappings"
66
- }, Yt = { class: "mr-binding-field-search" }, Zt = ["placeholder", "aria-label"], en = {
67
- key: 0,
68
- class: "mr-binding-note"
69
- }, tn = ["data-binding-control", "value", "onChange", "aria-label"], nn = { value: "" }, an = ["value"], ln = { key: 0 }, on = {
70
- key: 2,
71
- class: "mr-binding-map-pages"
72
- }, sn = ["disabled", "aria-label"], rn = ["disabled", "aria-label"], un = {
73
- key: 3,
74
- class: "mr-binding-concurrency"
75
- }, dn = ["data-binding-control", "value", "onChange"], cn = { value: "" }, vn = ["value"], gn = {
76
- class: "mr-binding-group",
77
- tabindex: "-1",
78
- "data-binding-control": "footer"
79
- }, fn = { class: "mr-binding-note" }, bn = { class: "mr-binding-region-tools" }, mn = ["disabled"], hn = ["aria-label"], yn = /* @__PURE__ */ Fe({
80
- __name: "ExcelRegionBindingPanel",
81
- props: {
82
- controller: {},
83
- datasets: {},
84
- disabled: { type: Boolean },
85
- messages: {}
86
- },
87
- setup(t) {
88
- const x = t, g = F(0), b = F(), y = F(""), o = x.controller.active, E = S(() => x.datasets.find((h) => h.id === o.value?.dataset)), C = S(() => {
89
- if (!o.value) return [];
90
- let h = 1;
91
- try {
92
- h = pe(o.value.range).left;
93
- } catch {
94
- }
95
- return o.value.fields.slice(g.value * 12, g.value * 12 + 12).map(($, r) => ({ field: $, index: g.value * 12 + r, physical: Me(h + g.value * 12 + r) }));
96
- }), M = S(() => Math.max(1, Math.ceil((o.value?.fields.length ?? 0) / 12))), N = S(() => {
97
- const h = y.value.trim().toLocaleLowerCase(), $ = E.value?.fields ?? [], r = $.filter((B) => [B.field, B.label, B.unit].some((U) => U?.toLocaleLowerCase().includes(h))).slice(0, 64), R = new Set(C.value.map((B) => B.field));
98
- return [...r, ...$.filter((B) => R.has(B.field) && !r.includes(B))];
99
- });
100
- function G(h) {
101
- return h.target.value;
102
- }
103
- function se(h) {
104
- x.controller.setActive(h), g.value = 0, y.value = "";
105
- }
106
- ie(() => x.controller.focusTarget.value, async (h) => {
107
- if (!h) return;
108
- g.value = Math.floor((h.target.fieldIndex ?? 0) / 12), y.value = "", await Ee();
109
- const $ = h.target.control === "field" ? `field-${h.target.fieldIndex}` : h.target.control === "contract" ? "dataset" : h.target.control, r = b.value?.querySelector(`[data-binding-control="${$}"]`), R = r?.closest("details");
110
- R && (R.open = !0);
111
- const B = x.disabled && r?.matches("input,select,textarea,button") ? r.closest("label") : r;
112
- B?.focus(), B?.scrollIntoView?.({ block: "nearest" });
113
- });
114
- function le(h) {
115
- if (!(!o.value || x.disabled)) {
116
- o.value.range = G(h);
117
- try {
118
- const $ = pe(o.value.range), r = $.right - $.left + 1;
119
- r <= 2048 && (o.value.fields = Array.from({ length: r }, (R, B) => o.value.fields[B] ?? ""));
120
- } catch {
121
- }
122
- }
123
- }
124
- return (h, $) => (c(), v("section", {
125
- ref_key: "panel",
126
- ref: b,
127
- class: "mr-binding-multi",
128
- "aria-label": t.messages.multiRegions
129
- }, [
130
- n("div", $t, [
131
- n("h3", null, [
132
- P(l(t.messages.multiRegions), 1),
133
- n("span", null, l(t.controller.recipe.value.regions.length) + "/128", 1)
134
- ]),
135
- n("p", kt, l(t.messages.multiHint), 1),
136
- n("button", {
137
- type: "button",
138
- class: "mr-binding-add-region",
139
- title: t.controller.recipe.value.regions.length >= 128 ? t.messages.limitRegions : t.controller.selection.value ? t.messages.addRegion : t.messages.noCellSelection,
140
- disabled: t.disabled || !t.controller.selection.value || t.controller.recipe.value.regions.length >= 128,
141
- onClick: $[0] || ($[0] = //@ts-ignore
142
- (...r) => t.controller.add && t.controller.add(...r))
143
- }, [
144
- W(A, {
145
- name: "grid",
146
- size: 13
147
- }),
148
- P(l(t.messages.addRegion), 1),
149
- n("code", null, l(t.controller.selection.value || "—"), 1)
150
- ], 8, xt),
151
- n("div", Ct, [
152
- (c(!0), v(O, null, J(t.controller.directory.value, (r) => (c(), v("div", {
153
- key: r.region.id,
154
- class: xe(["mr-binding-region-entry", { "is-active": r.region.id === t.controller.activeId.value }]),
155
- "data-state": r.state
156
- }, [
157
- n("button", {
158
- type: "button",
159
- "aria-pressed": r.region.id === t.controller.activeId.value,
160
- onClick: (R) => se(r.region.id)
161
- }, [
162
- n("strong", {
163
- title: r.region.id
164
- }, l(r.region.id), 9, Mt),
165
- n("code", null, l(r.region.range), 1),
166
- n("small", null, l(r.region.mode === "record" ? t.messages.recordMode : t.messages.repeatMode) + " · " + l(r.region.dataset || t.messages.chooseDataset), 1),
167
- n("span", St, [
168
- P(l(r.state === "ready" ? t.messages.regionReady : r.state === "pending" ? t.messages.regionPending : t.messages.regionError), 1),
169
- r.issues.length ? (c(), v("span", Kt, " · " + l(r.issues.length), 1)) : T("", !0)
170
- ])
171
- ], 8, It),
172
- n("button", {
173
- type: "button",
174
- "aria-label": `${t.messages.removeRegion} ${r.region.id}`,
175
- disabled: t.disabled,
176
- onClick: (R) => t.controller.remove(r.region.id)
177
- }, [
178
- W(A, {
179
- name: "close",
180
- size: 12
181
- })
182
- ], 8, Ft)
183
- ], 10, Rt))), 128))
184
- ])
185
- ]),
186
- n("fieldset", {
187
- disabled: t.disabled,
188
- class: "mr-binding-region-editor"
189
- }, [
190
- e(o) ? (c(), v("section", Dt, [
191
- n("h3", null, [
192
- P(l(t.messages.regionProperties), 1),
193
- n("code", null, l(e(o).id), 1)
194
- ]),
195
- n("label", zt, [
196
- P(l(t.messages.regionCoordinates), 1),
197
- n("input", {
198
- "data-binding-control": "range",
199
- value: e(o).range,
200
- "aria-label": t.messages.regionCoordinates,
201
- onChange: le
202
- }, null, 40, Tt)
203
- ]),
204
- n("label", Bt, [
205
- P(l(t.messages.regionMode), 1),
206
- n("select", {
207
- value: e(o).mode,
208
- "aria-label": t.messages.regionMode,
209
- onChange: $[1] || ($[1] = (r) => t.controller.property("mode", G(r)))
210
- }, [
211
- n("option", Nt, l(t.messages.recordMode), 1),
212
- n("option", Pt, l(t.messages.repeatMode), 1)
213
- ], 40, Lt)
214
- ]),
215
- n("p", Wt, l(e(o).mode === "record" ? t.messages.recordHint : t.messages.repeatHint), 1),
216
- n("label", At, [
217
- P(l(t.messages.dataset), 1),
218
- n("select", {
219
- "data-binding-control": "dataset",
220
- value: e(o).dataset,
221
- "aria-label": t.messages.dataset,
222
- onChange: $[2] || ($[2] = (r) => t.controller.dataset(G(r)))
223
- }, [
224
- n("option", _t, l(t.messages.chooseDataset), 1),
225
- (c(!0), v(O, null, J(t.datasets, (r) => (c(), v("option", {
226
- key: r.id,
227
- value: r.id
228
- }, l(r.label || r.id), 9, qt))), 128))
229
- ], 40, Ht)
230
- ]),
231
- E.value ? (c(), v("label", Ot, [
232
- P(l(t.messages.rowKey), 1),
233
- n("select", {
234
- "data-binding-control": "rowKey",
235
- value: e(o).rowKey,
236
- "aria-label": t.messages.rowKey,
237
- onChange: $[3] || ($[3] = (r) => t.controller.property("rowKey", G(r)))
238
- }, [
239
- n("option", Jt, l(t.messages.chooseRowKey), 1),
240
- (c(!0), v(O, null, J(E.value.fields.filter((r) => r.type !== "boolean"), (r) => (c(), v("option", {
241
- key: r.field,
242
- value: r.field
243
- }, l(r.label || r.field), 9, Ut))), 128))
244
- ], 40, Vt)
245
- ])) : T("", !0),
246
- n("div", jt, [
247
- n("button", {
248
- type: "button",
249
- disabled: !t.controller.selection.value,
250
- onClick: $[4] || ($[4] = //@ts-ignore
251
- (...r) => t.controller.header && t.controller.header(...r))
252
- }, l(t.messages.bindRegionHeader), 9, Gt),
253
- n("code", null, l(e(o).headerRange || t.messages.noRegionHeader), 1),
254
- e(o).headerRange ? (c(), v("button", {
255
- key: 0,
256
- type: "button",
257
- "aria-label": t.messages.clearHeader,
258
- onClick: $[5] || ($[5] = //@ts-ignore
259
- (...r) => t.controller.clearHeader && t.controller.clearHeader(...r))
260
- }, [
261
- W(A, {
262
- name: "close",
263
- size: 11
264
- })
265
- ], 8, Xt)) : T("", !0)
266
- ]),
267
- E.value ? (c(), v("div", Qt, [
268
- n("label", Yt, [
269
- W(A, {
270
- name: "search",
271
- size: 13
272
- }),
273
- De(n("input", {
274
- "onUpdate:modelValue": $[6] || ($[6] = (r) => y.value = r),
275
- type: "search",
276
- placeholder: t.messages.searchFields,
277
- "aria-label": t.messages.searchFields
278
- }, null, 8, Zt), [
279
- [Xe, y.value]
280
- ])
281
- ]),
282
- E.value.fields.length > 64 ? (c(), v("small", en, l(t.messages.fieldLimit), 1)) : T("", !0),
283
- (c(!0), v(O, null, J(C.value, (r) => (c(), v("label", {
284
- key: r.index,
285
- class: "mr-binding-map",
286
- tabindex: "-1"
287
- }, [
288
- n("span", null, l(r.physical), 1),
289
- n("div", null, [
290
- n("select", {
291
- "data-binding-control": `field-${r.index}`,
292
- value: e(o).fields[r.index],
293
- onChange: (R) => t.controller.mapping(r.index, G(R)),
294
- "aria-label": `${t.messages.physical} ${r.physical} · ${t.messages.business}`
295
- }, [
296
- n("option", nn, l(t.messages.chooseField), 1),
297
- (c(!0), v(O, null, J(N.value, (R) => (c(), v("option", {
298
- key: R.field,
299
- value: R.field
300
- }, l(R.label || R.field) + " · " + l(R.field), 9, an))), 128))
301
- ], 40, tn),
302
- r.field ? (c(), v("small", ln, l(E.value.fields.find((R) => R.field === r.field)?.type) + " · " + l(E.value.fields.find((R) => R.field === r.field)?.unit || "—"), 1)) : T("", !0)
303
- ])
304
- ]))), 128))
305
- ])) : T("", !0),
306
- M.value > 1 ? (c(), v("div", on, [
307
- n("button", {
308
- type: "button",
309
- disabled: g.value <= 0,
310
- "aria-label": t.messages.previousColumns,
311
- onClick: $[7] || ($[7] = (r) => g.value--)
312
- }, [
313
- W(A, {
314
- name: "chevron-left",
315
- size: 13
316
- })
317
- ], 8, sn),
318
- n("span", null, l(g.value + 1) + "/" + l(M.value), 1),
319
- n("button", {
320
- type: "button",
321
- disabled: g.value + 1 >= M.value,
322
- "aria-label": t.messages.nextColumns,
323
- onClick: $[8] || ($[8] = (r) => g.value++)
324
- }, [
325
- W(A, {
326
- name: "chevron-right",
327
- size: 13
328
- })
329
- ], 8, rn)
330
- ])) : T("", !0),
331
- E.value ? (c(), v("details", un, [
332
- n("summary", null, l(t.messages.concurrency), 1),
333
- (c(), v(O, null, J(["revisionField", "sourceTokenField"], (r) => n("label", {
334
- key: r,
335
- class: "mr-binding-label",
336
- tabindex: "-1"
337
- }, [
338
- P(l(r === "revisionField" ? t.messages.revisionField : t.messages.sourceTokenField), 1),
339
- n("select", {
340
- "data-binding-control": r,
341
- value: e(o)[r] || "",
342
- onChange: (R) => t.controller.property(r, G(R))
343
- }, [
344
- n("option", cn, l(t.messages.optional), 1),
345
- (c(!0), v(O, null, J(E.value.fields, (R) => (c(), v("option", {
346
- key: R.field,
347
- value: R.field
348
- }, l(R.label || R.field), 9, vn))), 128))
349
- ], 40, dn)
350
- ])), 64))
351
- ])) : T("", !0)
352
- ])) : T("", !0),
353
- n("section", gn, [
354
- n("h3", null, l(t.messages.flowFooter), 1),
355
- n("p", fn, l(t.messages.flowFooterHint), 1),
356
- n("div", bn, [
357
- n("button", {
358
- type: "button",
359
- disabled: !t.controller.selection.value,
360
- onClick: $[9] || ($[9] = //@ts-ignore
361
- (...r) => t.controller.footer && t.controller.footer(...r))
362
- }, l(t.messages.bindFooter), 9, mn),
363
- n("code", null, l(t.controller.recipe.value.footerRange || "—"), 1),
364
- t.controller.recipe.value.footerRange ? (c(), v("button", {
365
- key: 0,
366
- type: "button",
367
- "aria-label": t.messages.clearFooter,
368
- onClick: $[10] || ($[10] = //@ts-ignore
369
- (...r) => t.controller.clearFooter && t.controller.clearFooter(...r))
370
- }, [
371
- W(A, {
372
- name: "close",
373
- size: 11
374
- })
375
- ], 8, hn)) : T("", !0)
376
- ])
377
- ])
378
- ], 8, Et)
379
- ], 8, wt));
380
- }
381
- });
382
- function Ke(t = "") {
383
- return { version: "2.0", sheet: t, regions: [] };
384
- }
385
- function pn(t, x, g, b) {
386
- const y = F(Ke()), o = F(""), E = F(), C = F(), M = F(), N = S(() => !t.value || !C.value || !M.value ? "" : nt(t.value, x.value, C.value, M.value)), G = S(() => ({ ...y.value, regions: y.value.regions.map((d) => ({ ...d, fields: [] })) })), se = S(() => t.value ? at(t.value, G.value) : []), le = S(() => {
387
- const d = lt(y.value, b()), p = [...se.value, ...d.issues];
388
- return { ...d, ok: !p.length, issues: p };
389
- }), h = S(() => y.value.regions.find((d) => d.id === o.value));
390
- function $(d) {
391
- return Be(d, y.value, b());
392
- }
393
- const r = S(() => {
394
- const d = /* @__PURE__ */ new Map();
395
- for (const p of le.value.issues) {
396
- const q = $(p);
397
- for (const I of ht(p, y.value, b())) {
398
- const ae = d.get(I) ?? [];
399
- ae.push({ issue: p, target: { ...q, regionId: I } }), d.set(I, ae);
400
- }
401
- }
402
- return y.value.regions.map((p) => {
403
- const q = d.get(p.id) ?? [], I = q.length ? q.every((ae) => pt(ae.issue, ae.target, p)) ? "pending" : "error" : "ready";
404
- return { region: p, state: I, issues: q };
405
- });
406
- });
407
- function R(d = Ke(x.value)) {
408
- y.value = JSON.parse(JSON.stringify(d)), o.value = y.value.regions[0]?.id ?? "", C.value = void 0, M.value = void 0, E.value = void 0;
409
- }
410
- function B(d) {
411
- d.regionId && (o.value = d.regionId);
412
- const p = ye(d);
413
- p && (C.value = { row: p.top, column: p.left }, M.value = { row: p.bottom, column: p.right }), E.value = { target: d, sequence: (E.value?.sequence ?? 0) + 1 };
414
- }
415
- function U(d) {
416
- B($(d));
417
- }
418
- function u(d, p, q) {
419
- g.value || ((!q || !C.value) && (C.value = { row: d, column: p }), M.value = { row: d, column: p });
420
- }
421
- function K() {
422
- if (g.value || !N.value || y.value.regions.length >= 128) return;
423
- let d = 1;
424
- for (; y.value.regions.some((I) => I.id === `region-${d}`); ) d++;
425
- const p = `region-${d}`, q = Math.abs(M.value.column - C.value.column) + 1;
426
- y.value.regions.push({ id: p, range: N.value, mode: "repeat", dataset: "", fields: Array.from({ length: q }, () => ""), rowKey: "" }), o.value = p;
427
- }
428
- function X(d) {
429
- g.value || (y.value.regions = y.value.regions.filter((p) => p.id !== d), o.value === d && (o.value = y.value.regions[0]?.id ?? ""));
430
- }
431
- function z(d) {
432
- !g.value && h.value && (h.value.dataset = d, h.value.rowKey = "", h.value.fields.fill(""), delete h.value.revisionField, delete h.value.sourceTokenField);
433
- }
434
- function V(d, p) {
435
- if (!(g.value || !h.value)) {
436
- if (d === "mode") {
437
- (p === "record" || p === "repeat") && (h.value.mode = p);
438
- return;
439
- }
440
- p || d === "rowKey" ? h.value[d] = p : delete h.value[d];
441
- }
442
- }
443
- function L(d, p) {
444
- !g.value && h.value && d >= 0 && d < h.value.fields.length && (h.value.fields[d] = p);
445
- }
446
- function Q() {
447
- !g.value && h.value && delete h.value.headerRange;
448
- }
449
- function ne() {
450
- !g.value && h.value && N.value && (h.value.headerRange = N.value);
451
- }
452
- function te() {
453
- !g.value && N.value && (y.value.footerRange = N.value);
454
- }
455
- function H() {
456
- g.value || delete y.value.footerRange;
457
- }
458
- function Z(d) {
459
- const p = y.value.regions.find((q) => q.id === d);
460
- p && B({ regionId: d, control: "range", range: p.range });
461
- }
462
- function k(d, p) {
463
- return !!C.value && !!M.value && d >= Math.min(C.value.row, M.value.row) && d <= Math.max(C.value.row, M.value.row) && p >= Math.min(C.value.column, M.value.column) && p <= Math.max(C.value.column, M.value.column);
464
- }
465
- return { recipe: y, activeId: o, active: h, selection: N, validation: le, directory: r, focusTarget: E, target: $, locate: U, reset: R, select: u, add: K, remove: X, dataset: z, property: V, mapping: L, header: ne, clearHeader: Q, footer: te, clearFooter: H, setActive: Z, selected: k };
466
- }
467
- function he(t = "", x = 0) {
468
- return {
469
- version: "1.0",
470
- sheet: t,
471
- dataset: "",
472
- regions: { header: "", detail: "" },
473
- fields: Array.from({ length: x }, () => ""),
474
- rowKey: ""
475
- };
476
- }
477
- function ke(t) {
478
- return t instanceof Error ? t.message : String(t);
479
- }
480
- function wn(t, x) {
481
- const g = Qe(), b = F(he()), y = F("table"), o = pn(g, S(() => b.value.sheet), S(() => d.value), () => t.datasets), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), M = F({ table: [], regions: [] });
482
- function N() {
483
- E.clear(), C.clear(), M.value = { table: [], regions: [] };
484
- }
485
- function G() {
486
- b.value.sheet && (E.set(b.value.sheet, se(b.value)), C.set(b.value.sheet, JSON.parse(JSON.stringify(o.recipe.value))), M.value = { table: [...E.values()], regions: [...C.values()] });
487
- }
488
- const se = (s) => JSON.parse(JSON.stringify(s));
489
- function le(s, f) {
490
- return se(E.get(s) ?? he(s, f));
491
- }
492
- const h = F({
493
- id: t.identity?.id ?? "excel-template",
494
- name: t.identity?.name ?? "Excel 业务模板"
495
- }), $ = F(""), r = F(0), R = bt(() => ({ source: r.value, recipe: b.value, mode: y.value, regions: o.recipe.value, cached: M.value, identity: h.value })), B = F([]);
496
- let U;
497
- function u() {
498
- U?.dispose(), U = void 0;
499
- }
500
- const K = F(""), X = F(!1), z = F(!1), V = F(!1), L = F(!1), Q = F(1), ne = F(1), te = F(), H = F(), Z = F(0), k = S(() => ({ ...mt, ...t.messages })), d = S(() => !!t.readonly || X.value || L.value), p = S(() => !X.value && !L.value), q = S(
501
- () => g.value?.sheets.find((s) => s.name === b.value.sheet)
502
- ), I = S(
503
- () => q.value ? pe(q.value.range) : void 0
504
- ), ae = S(
505
- () => t.datasets.find((s) => s.id === b.value.dataset)
506
- ), de = S(
507
- () => g.value && q.value ? ot(g.value, q.value.name, {
508
- row: Q.value,
509
- column: ne.value
510
- }) : void 0
511
- ), ve = S(
512
- () => g.value ? it(g.value, b.value) : []
513
- ), oe = S(() => {
514
- if (!g.value) return { ok: !1, issues: [], mapped: 0, total: 0 };
515
- const s = st(
516
- g.value,
517
- b.value,
518
- t.datasets
519
- ), f = [...ve.value, ...s.issues];
520
- return { ...s, ok: f.length === 0, issues: f };
521
- }), re = S(() => y.value === "regions" ? o.validation.value : oe.value), ge = F(), we = S(() => y.value === "regions" ? o.focusTarget.value : ge.value);
522
- function fe(s) {
523
- return y.value === "regions" ? o.target(s) : yt(s, b.value);
524
- }
525
- function Ce(s) {
526
- const f = { dataset: k.value.dataset, contract: k.value.dataContract, rowKey: k.value.rowKey, range: k.value.regionCoordinates, field: k.value.mapping, fields: k.value.mapping, footer: k.value.flowFooter, header: k.value.headerRegion, detail: k.value.detailRegion, title: k.value.titleRegion, sheet: k.value.sheet, regions: y.value === "regions" ? k.value.multiRegions : k.value.regionLegend, revisionField: k.value.revisionField, sourceTokenField: k.value.sourceTokenField }, D = ye(s), _ = s.fieldIndex === void 0 ? "" : ` ${Me(D?.left ?? s.fieldIndex + 1)}`;
527
- return `${s.regionId ? `${s.regionId} · ` : ""}${f[s.control] ?? k.value.regionCoordinates}${_}`;
528
- }
529
- const Re = S(() => re.value.issues.map((s) => ({
530
- issue: s,
531
- label: Ce(fe(s)),
532
- message: s.message.replace(/\$\.recipe\.regions\[(\d+)\]/g, (f, D) => o.recipe.value.regions[Number(D)]?.id ?? k.value.regionProperties)
533
- })));
534
- function $e(s) {
535
- return s ? { dataset: k.value.nextDataset, rowKey: k.value.nextRowKey, field: k.value.nextField, fields: k.value.nextField, range: k.value.nextRange, regions: k.value.nextRegion, footer: k.value.nextFooter, header: k.value.nextHeader, detail: k.value.nextHeader, title: k.value.nextHeader }[s.control] ?? k.value.nextContract : y.value === "regions" ? k.value.nextRegion : k.value.nextHeader;
536
- }
537
- const m = S(() => t.readonly ? k.value.readonly : X.value ? k.value.loading : L.value ? k.value.applying : V.value ? k.value.applied : re.value.ok ? k.value.ready : $e(re.value.issues[0] ? fe(re.value.issues[0]) : void 0));
538
- ie(we, (s) => {
539
- const f = s && ye(s.target);
540
- !f || !I.value || (Q.value = Math.max(I.value.top, Math.min(I.value.bottom, f.top)), ne.value = Math.max(I.value.left, Math.min(I.value.right, f.left)));
541
- });
542
- function i(s) {
543
- if (y.value === "regions") {
544
- o.locate(s);
545
- return;
546
- }
547
- const f = fe(s), D = ye(f);
548
- D && (te.value = D.top, H.value = D.bottom), f.fieldIndex !== void 0 && (Z.value = Math.floor(f.fieldIndex / 12)), ge.value = { target: f, sequence: (ge.value?.sequence ?? 0) + 1 };
549
- }
550
- const a = S(
551
- () => b.value.fields.slice(Z.value * 12, (Z.value + 1) * 12).map((s, f) => ({
552
- index: Z.value * 12 + f,
553
- field: s,
554
- physical: Me(
555
- (I.value?.left ?? 1) + Z.value * 12 + f
556
- )
557
- }))
558
- ), w = S(
559
- () => ae.value?.fields.filter((s) => s.type !== "boolean") ?? []
560
- ), j = S(
561
- () => te.value !== void 0 && H.value !== void 0 ? {
562
- top: Math.min(te.value, H.value),
563
- bottom: Math.max(te.value, H.value)
564
- } : void 0
565
- );
566
- let ee, Y = 0;
567
- function ue() {
568
- Y++, ee?.abort(), ee = void 0, X.value = !1;
569
- }
570
- function be() {
571
- Q.value = I.value?.top ?? 1, ne.value = I.value?.left ?? 1, te.value = void 0, H.value = void 0, Z.value = 0, z.value = !1, V.value = !1;
572
- }
573
- function Se(s) {
574
- ue();
575
- try {
576
- const f = s.version === "2.0" ? rt(s) : ut(s);
577
- ue(), u(), B.value = f.source.sheets.map((D) => ({
578
- name: D.name,
579
- index: D.index
580
- })), g.value = f.source, N(), f.version === "2.0" ? (b.value = he(f.recipe.sheet, f.source.sheets.find((D) => D.name === f.recipe.sheet).columnCount), o.reset(f.recipe), y.value = "regions") : (b.value = f.recipe, o.reset(), y.value = "table"), h.value = { ...f.identity, ...t.lockId && t.identity ? { id: t.identity.id } : {} }, $.value = f.recipe.sheet, K.value = "", be(), r.value++, R.accept();
581
- } catch (f) {
582
- K.value = ke(f);
583
- }
584
- }
585
- ie(
586
- () => t.session,
587
- (s) => {
588
- s && Se(s);
589
- },
590
- { immediate: !0 }
591
- ), ie(
592
- () => t.readonly,
593
- (s) => {
594
- s && (ue(), u());
595
- }
596
- ), ie(
597
- [b, h, y, o.recipe],
598
- () => {
599
- z.value = !1, V.value = !1;
600
- },
601
- { deep: !0, flush: "sync" }
602
- ), ie(
603
- () => t.datasets,
604
- () => {
605
- z.value = !1, V.value = !1;
606
- }
607
- ), Ye(() => {
608
- ue(), u();
609
- });
610
- async function Le(s) {
611
- if (t.readonly) return;
612
- if (ue(), !/\.xlsx$/i.test(s.name)) {
613
- K.value = k.value.invalidFile;
614
- return;
615
- }
616
- const f = ++Y;
617
- ee = new AbortController(), X.value = !0, K.value = "";
618
- let D;
619
- try {
620
- const { openExcelWorkbook: _ } = await import("./workbook-session-BPb3TMnT.js").then((ce) => ce.w);
621
- if (f !== Y || t.readonly || (D = await _(s, { ...t.importOptions, signal: ee.signal }), f !== Y || t.readonly)) return;
622
- const me = D.inspect().sheets.filter((ce) => ce.visible);
623
- if (!me.length) throw new Error("Excel 中没有可导入的可见工作表");
624
- const Ie = await D.importTemplate({ sheets: [me[0].name], signal: ee.signal });
625
- if (f !== Y || t.readonly) return;
626
- u(), U = D, D = void 0, g.value = Ie, r.value++, $.value = s.name, B.value = me.map((ce) => ({
627
- name: ce.name,
628
- index: ce.index
629
- })), N(), b.value = he(
630
- Ie.sheets[0].name,
631
- Ie.sheets[0].columnCount
632
- ), o.reset(), be();
633
- } catch (_) {
634
- f === Y && (K.value = ke(_));
635
- } finally {
636
- D?.dispose(), f === Y && (X.value = !1, ee = void 0);
637
- }
638
- }
639
- async function Ne(s) {
640
- if (d.value || !B.value.some((_) => _.name === s) || b.value.sheet === s)
641
- return;
642
- G();
643
- const f = g.value?.sheets.find((_) => _.name === s);
644
- if (f) {
645
- b.value = le(s, f.columnCount), o.reset(C.get(s)), K.value = "", be();
646
- return;
647
- }
648
- if (!U || U.disposed) return;
649
- ue();
650
- const D = ++Y;
651
- ee = new AbortController(), X.value = !0, K.value = "";
652
- try {
653
- const _ = await U.importTemplate({ sheets: [s], signal: ee.signal });
654
- if (D !== Y || t.readonly) return;
655
- g.value = _, b.value = le(s, _.sheets[0].columnCount), o.reset(C.get(s)), be();
656
- } catch (_) {
657
- D === Y && (K.value = ke(_));
658
- } finally {
659
- D === Y && (X.value = !1, ee = void 0);
660
- }
661
- }
662
- function Pe(s) {
663
- d.value || (b.value.dataset = s, b.value.rowKey = "", b.value.fields.fill(""), z.value = !1, V.value = !1);
664
- }
665
- function We(s, f) {
666
- d.value || !I.value || s < I.value.top || s > I.value.bottom || ((!f || te.value === void 0) && (te.value = s), H.value = s);
667
- }
668
- function Ae(s) {
669
- if (d.value || !g.value || !j.value) {
670
- d.value || (K.value = k.value.emptySelection);
671
- return;
672
- }
673
- b.value.regions[s] = ft(
674
- g.value,
675
- b.value.sheet,
676
- j.value.top,
677
- j.value.bottom
678
- ), z.value = !1, V.value = !1, K.value = "";
679
- }
680
- function He(s) {
681
- d.value || (delete b.value.regions[s], z.value = !1, V.value = !1);
682
- }
683
- function _e(s, f) {
684
- !d.value && s >= 0 && s < b.value.fields.length && (b.value.fields[s] = f, z.value = !1, V.value = !1);
685
- }
686
- function qe(s) {
687
- d.value || (b.value.rowKey = s);
688
- }
689
- function Oe(s, f) {
690
- !d.value && !(s === "id" && t.lockId) && (h.value[s] = f);
691
- }
692
- function Ve(s) {
693
- for (const f of ["title", "header", "detail", "footer"]) {
694
- const D = b.value.regions[f];
695
- if (!D) continue;
696
- const _ = pe(D);
697
- if (s >= _.top && s <= _.bottom) return f;
698
- }
699
- }
700
- function Je(s, f) {
701
- I.value && (s === "row" ? Q.value = Math.max(
702
- I.value.top,
703
- Math.min(I.value.bottom, Q.value + f)
704
- ) : ne.value = Math.max(
705
- I.value.left,
706
- Math.min(I.value.right, ne.value + f)
707
- ));
708
- }
709
- function Ue() {
710
- if (!t.readonly) {
711
- if (t.session) {
712
- Se(t.session);
713
- return;
714
- }
715
- ue(), u(), g.value = void 0, B.value = [], $.value = "", N(), b.value = he(), h.value = { id: t.identity?.id ?? "excel-template", name: t.identity?.name ?? "Excel 业务模板" }, o.reset(), y.value = "table", be(), r.value++, R.accept(), K.value = "";
716
- }
717
- }
718
- function je() {
719
- p.value && (z.value = !0, K.value = "");
720
- }
721
- async function Ge() {
722
- if (!(d.value || !g.value) && (z.value = !0, K.value = "", !!re.value.ok)) {
723
- L.value = !0;
724
- try {
725
- const s = { ...h.value, ...t.lockId && t.identity ? { id: t.identity.id } : {} }, f = y.value === "regions" ? dt(g.value, o.recipe.value, t.datasets, s) : ct(g.value, b.value, t.datasets, s), D = y.value === "regions" ? vt(g.value, o.recipe.value, s) : gt(g.value, b.value, s), _ = { ...f, session: D }, me = R.snapshot();
726
- if (t.accept && !await t.accept(_) || t.readonly || me !== R.snapshot() && R.pending.value) return;
727
- t.accept || x(_), N(), R.accept(), V.value = !0;
728
- } catch (s) {
729
- K.value = ke(s);
730
- } finally {
731
- L.value = !1;
732
- }
733
- }
734
- }
735
- return {
736
- imported: g,
737
- mode: y,
738
- regionBindings: o,
739
- pendingLocalChanges: R.pending,
740
- recipe: b,
741
- identity: h,
742
- sourceName: $,
743
- sheetChoices: B,
744
- error: K,
745
- loading: X,
746
- checked: z,
747
- applied: V,
748
- row: Q,
749
- column: ne,
750
- mappingPage: Z,
751
- m: k,
752
- disabled: d,
753
- canCheck: p,
754
- sheet: q,
755
- sourceRange: I,
756
- dataset: ae,
757
- window: de,
758
- validation: re,
759
- focusTarget: we,
760
- issueEntries: Re,
761
- guidance: m,
762
- locateIssue: i,
763
- mappings: a,
764
- rowKeys: w,
765
- selection: j,
766
- cancel: ue,
767
- importFile: Le,
768
- chooseSheet: Ne,
769
- chooseDataset: Pe,
770
- chooseRow: We,
771
- markRegion: Ae,
772
- clearRegion: He,
773
- setMapping: _e,
774
- setRowKey: qe,
775
- setIdentity: Oe,
776
- regionAt: Ve,
777
- moveWindow: Je,
778
- check: je,
779
- restoreDraft: Ue,
780
- apply: Ge
781
- };
782
- }
783
- const $n = ["aria-label", "aria-busy"], kn = { class: "mr-binding-bar" }, xn = { class: "mr-binding-heading" }, Cn = ["aria-label", "disabled"], Rn = ["disabled"], In = {
784
- key: 0,
785
- class: "mr-binding-error",
786
- role: "alert"
787
- }, Mn = {
788
- key: 1,
789
- class: "mr-binding-placeholder",
790
- role: "status"
791
- }, Sn = {
792
- key: 2,
793
- class: "mr-binding-placeholder"
794
- }, Kn = ["disabled"], Fn = { class: "mr-binding-sourcebar" }, En = ["value", "aria-label", "disabled"], Dn = ["value"], zn = ["aria-label"], Tn = ["aria-pressed", "disabled"], Bn = ["aria-pressed", "disabled"], Ln = { class: "mr-binding-range" }, Nn = { class: "mr-binding-sample-note" }, Pn = { class: "mr-binding-layout" }, Wn = { class: "mr-binding-source" }, An = { class: "mr-binding-grid-heading" }, Hn = ["aria-label"], _n = { class: "mr-binding-grid" }, qn = ["data-region"], On = { scope: "row" }, Vn = ["data-source-row", "aria-label", "aria-pressed", "disabled", "onPointerdown", "onPointerenter", "onKeydown"], Jn = ["rowspan", "colspan", "title", "data-source-cell", "tabindex", "aria-label", "aria-selected", "onPointerdown", "onPointerenter", "onKeydown"], Un = {
795
- key: 1,
796
- class: "mr-binding-grid-footer"
797
- }, jn = { class: "mr-binding-window" }, Gn = ["aria-label", "disabled"], Xn = ["min", "max", "value", "aria-label"], Qn = ["aria-label", "disabled"], Yn = { class: "mr-binding-window" }, Zn = ["aria-label", "disabled"], ea = ["min", "max", "value", "aria-label"], ta = ["aria-label", "disabled"], na = { class: "mr-binding-inspector" }, aa = ["disabled"], la = { class: "mr-binding-group" }, oa = ["data-role"], ia = { key: 0 }, sa = ["aria-label", "data-binding-control", "title", "disabled", "onClick"], ra = ["aria-label", "onClick"], ua = {
798
- key: 0,
799
- class: "mr-binding-note"
800
- }, da = { class: "mr-binding-group" }, ca = {
801
- class: "mr-binding-label",
802
- tabindex: "-1"
803
- }, va = ["value", "aria-label"], ga = { value: "" }, fa = ["value"], ba = {
804
- key: 0,
805
- class: "mr-binding-note"
806
- }, ma = {
807
- key: 1,
808
- class: "mr-binding-label",
809
- tabindex: "-1"
810
- }, ha = ["value", "aria-label"], ya = { value: "" }, pa = ["value"], wa = {
811
- key: 2,
812
- class: "mr-binding-mappings"
813
- }, $a = ["data-binding-control", "aria-label", "value", "onChange"], ka = { value: "" }, xa = ["value"], Ca = { key: 0 }, Ra = {
814
- key: 3,
815
- class: "mr-binding-map-pages"
816
- }, Ia = ["disabled", "aria-label"], Ma = ["disabled", "aria-label"], Sa = ["disabled"], Ka = { class: "mr-binding-group" }, Fa = { class: "mr-binding-label" }, Ea = ["value", "readonly"], Da = { class: "mr-binding-label" }, za = ["value"], Ta = {
817
- key: 0,
818
- class: "mr-binding-issues",
819
- open: ""
820
- }, Ba = ["aria-label", "onClick"], La = {
821
- key: 0,
822
- class: "mr-binding-issue-pages"
823
- }, Na = ["disabled", "aria-label"], Pa = ["disabled", "aria-label"], Wa = {
824
- key: 1,
825
- class: "mr-binding-warnings"
826
- }, Aa = { class: "mr-binding-actions" }, Ha = ["title"], _a = ["disabled"], qa = ["disabled"], Oa = ["disabled", "title"], Xa = /* @__PURE__ */ Fe({
827
- __name: "ExcelBindingWizard",
828
- props: {
829
- datasets: {},
830
- accept: { type: Function },
831
- session: {},
832
- identity: {},
833
- lockId: { type: Boolean },
834
- readonly: { type: Boolean },
835
- importOptions: {},
836
- messages: {}
837
- },
838
- emits: ["apply", "dirty"],
839
- setup(t, { expose: x, emit: g }) {
840
- const b = t, y = g, o = wn(b, (m) => y("apply", m)), {
841
- imported: E,
842
- mode: C,
843
- regionBindings: M,
844
- recipe: N,
845
- identity: G,
846
- sourceName: se,
847
- sheetChoices: le,
848
- error: h,
849
- loading: $,
850
- checked: r,
851
- row: R,
852
- column: B,
853
- mappingPage: U,
854
- m: u,
855
- disabled: K,
856
- sheet: X,
857
- sourceRange: z,
858
- dataset: V,
859
- window: L,
860
- validation: Q,
861
- mappings: ne,
862
- rowKeys: te,
863
- selection: H
864
- } = o;
865
- ie([o.pendingLocalChanges, N, G], () => y("dirty", o.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
866
- const Z = F(), k = F(), d = F(0), p = S(() => Math.max(1, Math.ceil(o.issueEntries.value.length / 12))), q = S(() => o.issueEntries.value.slice(d.value * 12, (d.value + 1) * 12));
867
- ie(p, (m) => {
868
- d.value = Math.min(d.value, m - 1);
869
- }), ie(o.focusTarget, async (m) => {
870
- if (!m) return;
871
- await Ee();
872
- const i = ye(m.target);
873
- if (i && k.value?.querySelector(`td[data-source-cell="${i.top}:${i.left}"]`)?.scrollIntoView?.({ block: "nearest", inline: "nearest" }), C.value === "regions") return;
874
- const a = m.target.control === "field" ? `field-${m.target.fieldIndex}` : m.target.control === "contract" ? "dataset" : m.target.control, w = k.value?.querySelector(`.mr-binding-table-editor [data-binding-control="${a}"]`), j = K.value ? w?.closest("label") : w;
875
- j?.focus(), j?.scrollIntoView?.({ block: "nearest" });
876
- });
877
- const I = F(!1), ae = ["title", "header", "detail", "footer"], de = S(() => ({
878
- title: u.value.titleRegion,
879
- header: u.value.headerRegion,
880
- detail: u.value.detailRegion,
881
- footer: u.value.footerRegion
882
- })), ve = S(
883
- () => Math.max(1, Math.ceil(N.value.fields.length / 12))
884
- );
885
- function oe(m) {
886
- return m.target.value;
887
- }
888
- function re(m) {
889
- const i = m.target, a = i.files?.[0];
890
- a && o.importFile(a), i.value = "";
891
- }
892
- function ge(m, i) {
893
- m.button !== 0 || K.value || (m.preventDefault(), I.value = !0, o.chooseRow(i, m.shiftKey), C.value === "regions" && z.value && (M.select(i, z.value.left, !1), M.select(i, z.value.right, !0)), m.currentTarget.focus());
894
- }
895
- function we(m, i, a) {
896
- C.value !== "regions" || m.button !== 0 || K.value || (m.preventDefault(), I.value = !0, M.select(i, a, m.shiftKey), m.currentTarget.focus());
897
- }
898
- function fe(m, i, a) {
899
- if (C.value !== "regions") return;
900
- (m.key === " " || m.key === "Enter") && (m.preventDefault(), M.select(i, a, m.shiftKey));
901
- const j = { ArrowUp: [-1, 0], ArrowDown: [1, 0], ArrowLeft: [0, -1], ArrowRight: [0, 1] }[m.key];
902
- if (!j || !z.value) return;
903
- m.preventDefault();
904
- const ee = Math.max(z.value.top, Math.min(z.value.bottom, i + j[0])), Y = Math.max(z.value.left, Math.min(z.value.right, a + j[1]));
905
- m.shiftKey && M.select(ee, Y, !0), m.currentTarget.closest("table")?.querySelector(`td[data-source-cell="${ee}:${Y}"]`)?.focus();
906
- }
907
- function Ce(m, i) {
908
- if ((m.key === " " || m.key === "Enter") && (m.preventDefault(), o.chooseRow(i, m.shiftKey)), m.key === "ArrowDown" || m.key === "ArrowUp") {
909
- m.preventDefault();
910
- const a = i + (m.key === "ArrowDown" ? 1 : -1);
911
- m.shiftKey && o.chooseRow(a, !0), m.currentTarget.closest("table")?.querySelector(`button[data-source-row="${a}"]`)?.focus();
912
- }
913
- }
914
- function Re(m) {
915
- const i = V.value?.fields.find((a) => a.field === m);
916
- return i ? [
917
- i.type,
918
- i.unit,
919
- i.digits === void 0 ? void 0 : `${i.digits}${u.value.precision}`,
920
- i.sample === void 0 ? void 0 : `${u.value.sample}: ${String(i.sample)}`
921
- ].filter((a) => a !== void 0 && a !== "").join(" · ") : "";
922
- }
923
- function $e(m, i) {
924
- const a = Number(oe(m));
925
- !Number.isInteger(a) || !z.value || (i === "row" ? R.value = Math.max(
926
- z.value.top,
927
- Math.min(z.value.bottom, a)
928
- ) : B.value = Math.max(
929
- z.value.left,
930
- Math.min(z.value.right, a)
931
- ));
932
- }
933
- return x({
934
- get pendingLocalChanges() {
935
- return o.pendingLocalChanges.value;
936
- },
937
- importFile: o.importFile,
938
- apply: o.apply,
939
- cancel: o.cancel
940
- }), (m, i) => (c(), v("section", {
941
- ref_key: "element",
942
- ref: k,
943
- class: "mr-binding",
944
- "aria-label": e(u).title,
945
- "aria-busy": e($),
946
- onPointerup: i[23] || (i[23] = (a) => I.value = !1),
947
- onPointercancel: i[24] || (i[24] = (a) => I.value = !1),
948
- onPointerleave: i[25] || (i[25] = (a) => I.value = !1)
949
- }, [
950
- n("header", kn, [
951
- n("div", xn, [
952
- W(A, {
953
- name: "file",
954
- size: 17
955
- }),
956
- n("strong", null, l(e(u).title), 1),
957
- n("span", null, l(e(se) || e(u).intro), 1)
958
- ]),
959
- n("input", {
960
- ref_key: "input",
961
- ref: Z,
962
- type: "file",
963
- accept: ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
964
- "aria-label": e(u).upload,
965
- class: "mr-binding-file",
966
- disabled: t.readonly,
967
- onChange: re
968
- }, null, 40, Cn),
969
- e($) ? (c(), v("button", {
970
- key: 0,
971
- type: "button",
972
- onClick: i[0] || (i[0] = //@ts-ignore
973
- (...a) => e(o).cancel && e(o).cancel(...a))
974
- }, l(e(u).cancel), 1)) : (c(), v("button", {
975
- key: 1,
976
- type: "button",
977
- disabled: t.readonly,
978
- onClick: i[1] || (i[1] = (a) => Z.value?.click())
979
- }, [
980
- W(A, {
981
- name: "upload",
982
- size: 14
983
- }),
984
- P(l(e(E) ? e(u).replace : e(u).upload), 1)
985
- ], 8, Rn))
986
- ]),
987
- e(h) ? (c(), v("div", In, l(e(h)), 1)) : T("", !0),
988
- e($) ? (c(), v("div", Mn, [
989
- i[26] || (i[26] = n("span", { class: "mr-binding-loader" }, null, -1)),
990
- P(l(e(u).loading), 1)
991
- ])) : e(E) ? (c(), v(O, { key: 3 }, [
992
- n("div", Fn, [
993
- n("label", null, [
994
- P(l(e(u).sheet), 1),
995
- n("select", {
996
- value: e(N).sheet,
997
- "aria-label": e(u).sheet,
998
- disabled: e(K),
999
- onChange: i[3] || (i[3] = (a) => e(o).chooseSheet(oe(a)))
1000
- }, [
1001
- (c(!0), v(O, null, J(e(le), (a) => (c(), v("option", {
1002
- key: a.name,
1003
- value: a.name
1004
- }, l(a.name), 9, Dn))), 128))
1005
- ], 40, En)
1006
- ]),
1007
- n("div", {
1008
- class: "mr-binding-mode",
1009
- role: "group",
1010
- "aria-label": e(u).regionMode
1011
- }, [
1012
- n("button", {
1013
- type: "button",
1014
- "aria-pressed": e(C) === "table",
1015
- disabled: e(K),
1016
- onClick: i[4] || (i[4] = (a) => C.value = "table")
1017
- }, l(e(u).tableMode), 9, Tn),
1018
- n("button", {
1019
- type: "button",
1020
- "aria-pressed": e(C) === "regions",
1021
- disabled: e(K),
1022
- onClick: i[5] || (i[5] = (a) => C.value = "regions")
1023
- }, [
1024
- W(A, {
1025
- name: "grid",
1026
- size: 12
1027
- }),
1028
- P(l(e(u).multiRegions), 1)
1029
- ], 8, Bn)
1030
- ], 8, zn),
1031
- n("span", Ln, l(e(X)?.range) + " · " + l(e(X)?.rowCount) + " × " + l(e(X)?.columnCount), 1),
1032
- n("span", Nn, l(e(u).sourceOnly), 1)
1033
- ]),
1034
- n("div", Pn, [
1035
- n("div", Wn, [
1036
- n("div", An, [
1037
- n("strong", null, l(e(u).source), 1),
1038
- n("span", null, l(e(C) === "regions" ? e(u).multiHint : e(u).sourceHint), 1)
1039
- ]),
1040
- e(L) ? (c(), v("div", {
1041
- key: 0,
1042
- class: "mr-binding-grid-scroll",
1043
- "aria-label": e(u).source
1044
- }, [
1045
- n("table", _n, [
1046
- n("thead", null, [
1047
- n("tr", null, [
1048
- i[28] || (i[28] = n("th", {
1049
- class: "mr-binding-corner",
1050
- "aria-label": "#"
1051
- }, "#", -1)),
1052
- (c(!0), v(O, null, J(e(L).columns, (a) => (c(), v("th", {
1053
- key: a.column,
1054
- scope: "col"
1055
- }, l(a.name), 1))), 128))
1056
- ])
1057
- ]),
1058
- n("tbody", null, [
1059
- (c(!0), v(O, null, J(e(L).rows, (a) => (c(), v("tr", {
1060
- key: a.row,
1061
- "data-region": e(o).regionAt(a.row),
1062
- class: xe({
1063
- "is-selected": e(H) && a.row >= e(H).top && a.row <= e(H).bottom
1064
- })
1065
- }, [
1066
- n("th", On, [
1067
- n("button", {
1068
- type: "button",
1069
- "data-source-row": a.row,
1070
- "aria-label": `${e(u).selectionLabel} ${a.row}`,
1071
- "aria-pressed": !!e(H) && a.row >= e(H).top && a.row <= e(H).bottom,
1072
- disabled: e(K),
1073
- onPointerdown: (w) => ge(w, a.row),
1074
- onPointerenter: (w) => I.value && e(o).chooseRow(a.row, !0),
1075
- onKeydown: (w) => Ce(w, a.row)
1076
- }, l(a.row), 41, Vn)
1077
- ]),
1078
- (c(!0), v(O, null, J(a.cells, (w) => (c(), v("td", {
1079
- key: w.column,
1080
- rowspan: w.rowSpan,
1081
- colspan: w.colSpan,
1082
- title: `${w.address} · ${w.text}`,
1083
- "data-source-cell": `${w.row}:${w.column}`,
1084
- tabindex: e(C) === "regions" ? 0 : void 0,
1085
- "aria-label": e(C) === "regions" ? `${e(u).selectionCellLabel} ${w.address}` : void 0,
1086
- "aria-selected": e(C) === "regions" ? e(M).selected(w.row, w.column) : void 0,
1087
- class: xe({ "is-continued": w.continued, "is-cell-selected": e(C) === "regions" && e(M).selected(w.row, w.column) }),
1088
- onPointerdown: (j) => we(j, w.row, w.column),
1089
- onPointerenter: (j) => e(C) === "regions" && I.value && e(M).select(w.row, w.column, !0),
1090
- onKeydown: (j) => fe(j, w.row, w.column),
1091
- style: Ze({
1092
- textAlign: w.style?.align,
1093
- fontWeight: w.style?.bold ? "600" : void 0
1094
- })
1095
- }, [
1096
- n("span", null, l(w.text), 1)
1097
- ], 46, Jn))), 128))
1098
- ], 10, qn))), 128))
1099
- ])
1100
- ])
1101
- ], 8, Hn)) : T("", !0),
1102
- e(L) ? (c(), v("footer", Un, [
1103
- n("span", null, [
1104
- P(l(e(u).selected) + " ", 1),
1105
- n("strong", null, l(e(C) === "regions" ? e(M).selection.value || "—" : e(H) ? `${e(H).top}–${e(H).bottom}` : "—"), 1)
1106
- ]),
1107
- n("div", jn, [
1108
- n("button", {
1109
- type: "button",
1110
- "aria-label": e(u).previousRows,
1111
- disabled: e(L).top <= e(L).source.top,
1112
- onClick: i[6] || (i[6] = (a) => e(o).moveWindow("row", -24))
1113
- }, [
1114
- W(A, {
1115
- name: "chevron-left",
1116
- size: 13
1117
- })
1118
- ], 8, Gn),
1119
- n("label", null, [
1120
- P(l(e(u).rowStart), 1),
1121
- n("input", {
1122
- type: "number",
1123
- min: e(L).source.top,
1124
- max: e(L).source.bottom,
1125
- value: e(R),
1126
- "aria-label": e(u).rowStart,
1127
- onChange: i[7] || (i[7] = (a) => $e(a, "row"))
1128
- }, null, 40, Xn)
1129
- ]),
1130
- n("button", {
1131
- type: "button",
1132
- "aria-label": e(u).nextRows,
1133
- disabled: e(L).bottom >= e(L).source.bottom,
1134
- onClick: i[8] || (i[8] = (a) => e(o).moveWindow("row", 24))
1135
- }, [
1136
- W(A, {
1137
- name: "chevron-right",
1138
- size: 13
1139
- })
1140
- ], 8, Qn)
1141
- ]),
1142
- n("div", Yn, [
1143
- n("button", {
1144
- type: "button",
1145
- "aria-label": e(u).previousColumns,
1146
- disabled: e(L).left <= e(L).source.left,
1147
- onClick: i[9] || (i[9] = (a) => e(o).moveWindow("column", -12))
1148
- }, [
1149
- W(A, {
1150
- name: "chevron-left",
1151
- size: 13
1152
- })
1153
- ], 8, Zn),
1154
- n("label", null, [
1155
- P(l(e(u).columnStart), 1),
1156
- n("input", {
1157
- type: "number",
1158
- min: e(L).source.left,
1159
- max: e(L).source.right,
1160
- value: e(B),
1161
- "aria-label": e(u).columnStart,
1162
- onChange: i[10] || (i[10] = (a) => $e(a, "column"))
1163
- }, null, 40, ea)
1164
- ]),
1165
- n("button", {
1166
- type: "button",
1167
- "aria-label": e(u).nextColumns,
1168
- disabled: e(L).right >= e(L).source.right,
1169
- onClick: i[11] || (i[11] = (a) => e(o).moveWindow("column", 12))
1170
- }, [
1171
- W(A, {
1172
- name: "chevron-right",
1173
- size: 13
1174
- })
1175
- ], 8, ta)
1176
- ])
1177
- ])) : T("", !0)
1178
- ]),
1179
- n("div", na, [
1180
- e(C) === "regions" ? (c(), et(yn, {
1181
- key: 0,
1182
- controller: e(M),
1183
- datasets: t.datasets,
1184
- disabled: e(K),
1185
- messages: e(u)
1186
- }, null, 8, ["controller", "datasets", "disabled", "messages"])) : T("", !0),
1187
- De(n("fieldset", {
1188
- disabled: e(K),
1189
- class: "mr-binding-table-editor"
1190
- }, [
1191
- n("section", la, [
1192
- n("h3", null, [
1193
- i[29] || (i[29] = n("b", null, "1", -1)),
1194
- P(l(e(u).regionLegend), 1)
1195
- ]),
1196
- (c(), v(O, null, J(ae, (a) => n("div", {
1197
- key: a,
1198
- class: "mr-binding-region",
1199
- "data-role": a
1200
- }, [
1201
- n("div", null, [
1202
- n("strong", null, [
1203
- P(l(de.value[a]), 1),
1204
- a === "title" || a === "footer" ? (c(), v("small", ia, l(e(u).optional), 1)) : T("", !0)
1205
- ]),
1206
- n("code", null, l(e(N).regions[a] || e(u).unnamed), 1)
1207
- ]),
1208
- n("button", {
1209
- type: "button",
1210
- "aria-label": `${e(u).selectRegion} · ${de.value[a]}`,
1211
- "data-binding-control": a,
1212
- title: e(H) ? `${e(u).selectRegion} · ${de.value[a]}` : e(u).emptySelection,
1213
- disabled: !e(H),
1214
- onClick: (w) => e(o).markRegion(a)
1215
- }, [
1216
- W(A, {
1217
- name: "arrow-right",
1218
- size: 13
1219
- })
1220
- ], 8, sa),
1221
- (a === "title" || a === "footer") && e(N).regions[a] ? (c(), v("button", {
1222
- key: 0,
1223
- type: "button",
1224
- "aria-label": `${e(u).clear} · ${de.value[a]}`,
1225
- onClick: (w) => e(o).clearRegion(a)
1226
- }, [
1227
- W(A, {
1228
- name: "close",
1229
- size: 13
1230
- })
1231
- ], 8, ra)) : T("", !0)
1232
- ], 8, oa)), 64)),
1233
- e(N).regions.footer ? (c(), v("p", ua, l(e(u).footerHint), 1)) : T("", !0)
1234
- ]),
1235
- n("section", da, [
1236
- n("h3", null, [
1237
- i[30] || (i[30] = n("b", null, "2", -1)),
1238
- P(l(e(u).mapping), 1),
1239
- n("span", null, l(e(Q).mapped) + "/" + l(e(Q).total), 1)
1240
- ]),
1241
- n("label", ca, [
1242
- P(l(e(u).dataset), 1),
1243
- n("select", {
1244
- "data-binding-control": "dataset",
1245
- value: e(N).dataset,
1246
- "aria-label": e(u).dataset,
1247
- onChange: i[12] || (i[12] = (a) => e(o).chooseDataset(oe(a)))
1248
- }, [
1249
- n("option", ga, l(e(u).chooseDataset), 1),
1250
- (c(!0), v(O, null, J(t.datasets, (a) => (c(), v("option", {
1251
- key: a.id,
1252
- value: a.id
1253
- }, l(a.label || a.id), 9, fa))), 128))
1254
- ], 40, va)
1255
- ]),
1256
- t.datasets.length ? T("", !0) : (c(), v("p", ba, l(e(u).noContract), 1)),
1257
- e(V) ? (c(), v("label", ma, [
1258
- P(l(e(u).rowKey), 1),
1259
- n("select", {
1260
- "data-binding-control": "rowKey",
1261
- value: e(N).rowKey,
1262
- "aria-label": e(u).rowKey,
1263
- onChange: i[13] || (i[13] = (a) => e(o).setRowKey(oe(a)))
1264
- }, [
1265
- n("option", ya, l(e(u).chooseRowKey), 1),
1266
- (c(!0), v(O, null, J(e(te), (a) => (c(), v("option", {
1267
- key: a.field,
1268
- value: a.field
1269
- }, l(a.label || a.field) + " · " + l(a.field), 9, pa))), 128))
1270
- ], 40, ha)
1271
- ])) : T("", !0),
1272
- e(V) ? (c(), v("div", wa, [
1273
- (c(!0), v(O, null, J(e(ne), (a) => (c(), v("label", {
1274
- key: a.index,
1275
- class: "mr-binding-map",
1276
- tabindex: "-1"
1277
- }, [
1278
- n("span", null, l(a.physical), 1),
1279
- n("div", null, [
1280
- n("select", {
1281
- "data-binding-control": `field-${a.index}`,
1282
- "aria-label": `${e(u).physical} ${a.physical} · ${e(u).business}`,
1283
- value: a.field,
1284
- onChange: (w) => e(o).setMapping(a.index, oe(w))
1285
- }, [
1286
- n("option", ka, l(e(u).chooseField), 1),
1287
- (c(!0), v(O, null, J(e(V).fields, (w) => (c(), v("option", {
1288
- key: w.field,
1289
- value: w.field
1290
- }, l(w.label || w.field) + " · " + l(w.field), 9, xa))), 128))
1291
- ], 40, $a),
1292
- a.field ? (c(), v("small", Ca, l(Re(a.field)), 1)) : T("", !0)
1293
- ])
1294
- ]))), 128))
1295
- ])) : T("", !0),
1296
- e(V) && ve.value > 1 ? (c(), v("div", Ra, [
1297
- n("button", {
1298
- type: "button",
1299
- disabled: e(U) <= 0,
1300
- "aria-label": e(u).previousColumns,
1301
- onClick: i[14] || (i[14] = (a) => U.value--)
1302
- }, [
1303
- W(A, {
1304
- name: "chevron-left",
1305
- size: 13
1306
- })
1307
- ], 8, Ia),
1308
- n("span", null, l(e(U) + 1) + " / " + l(ve.value), 1),
1309
- n("button", {
1310
- type: "button",
1311
- disabled: e(U) + 1 >= ve.value,
1312
- "aria-label": e(u).nextColumns,
1313
- onClick: i[15] || (i[15] = (a) => U.value++)
1314
- }, [
1315
- W(A, {
1316
- name: "chevron-right",
1317
- size: 13
1318
- })
1319
- ], 8, Ma)
1320
- ])) : T("", !0)
1321
- ])
1322
- ], 8, aa), [
1323
- [tt, e(C) === "table"]
1324
- ]),
1325
- n("fieldset", { disabled: e(K) }, [
1326
- n("section", Ka, [
1327
- n("h3", null, l(e(u).identity), 1),
1328
- n("label", Fa, [
1329
- P(l(e(u).templateId), 1),
1330
- n("input", {
1331
- value: t.lockId ? b.identity?.id ?? e(G).id : e(G).id,
1332
- autocomplete: "off",
1333
- readonly: t.lockId,
1334
- onInput: i[16] || (i[16] = (a) => e(o).setIdentity("id", oe(a)))
1335
- }, null, 40, Ea)
1336
- ]),
1337
- n("label", Da, [
1338
- P(l(e(u).templateName), 1),
1339
- n("input", {
1340
- value: e(G).name,
1341
- autocomplete: "off",
1342
- onInput: i[17] || (i[17] = (a) => e(o).setIdentity("name", oe(a)))
1343
- }, null, 40, za)
1344
- ])
1345
- ])
1346
- ], 8, Sa)
1347
- ])
1348
- ]),
1349
- e(r) && e(Q).issues.length ? (c(), v("details", Ta, [
1350
- n("summary", null, l(e(u).issues) + " · " + l(e(Q).issues.length) + " " + l(e(u).errors), 1),
1351
- n("ul", null, [
1352
- (c(!0), v(O, null, J(q.value, (a) => (c(), v("li", {
1353
- key: `${a.issue.path}:${a.issue.message}`
1354
- }, [
1355
- n("button", {
1356
- type: "button",
1357
- class: "mr-binding-issue-link",
1358
- "aria-label": `${e(u).locateIssue} · ${a.label}`,
1359
- onClick: (w) => e(o).locateIssue(a.issue)
1360
- }, [
1361
- n("strong", null, l(a.label), 1),
1362
- n("span", null, l(a.message), 1),
1363
- W(A, {
1364
- name: "arrow-right",
1365
- size: 12
1366
- })
1367
- ], 8, Ba)
1368
- ]))), 128))
1369
- ]),
1370
- p.value > 1 ? (c(), v("div", La, [
1371
- n("button", {
1372
- type: "button",
1373
- disabled: d.value === 0,
1374
- "aria-label": e(u).previousIssues,
1375
- onClick: i[18] || (i[18] = (a) => d.value--)
1376
- }, [
1377
- W(A, {
1378
- name: "chevron-left",
1379
- size: 12
1380
- })
1381
- ], 8, Na),
1382
- n("span", null, l(d.value + 1) + "/" + l(p.value), 1),
1383
- n("button", {
1384
- type: "button",
1385
- disabled: d.value + 1 >= p.value,
1386
- "aria-label": e(u).nextIssues,
1387
- onClick: i[19] || (i[19] = (a) => d.value++)
1388
- }, [
1389
- W(A, {
1390
- name: "chevron-right",
1391
- size: 12
1392
- })
1393
- ], 8, Pa)
1394
- ])) : T("", !0)
1395
- ])) : T("", !0),
1396
- e(E).warnings.length ? (c(), v("details", Wa, [
1397
- n("summary", null, l(e(u).inspectWarning) + " · " + l(e(E).warnings.length), 1),
1398
- n("ul", null, [
1399
- (c(!0), v(O, null, J(e(E).warnings, (a, w) => (c(), v("li", { key: w }, l(a), 1))), 128))
1400
- ])
1401
- ])) : T("", !0),
1402
- n("footer", Aa, [
1403
- n("span", {
1404
- class: xe({ "is-ready": e(Q).ok }),
1405
- role: "status",
1406
- title: e(o).guidance.value
1407
- }, l(e(o).guidance.value), 11, Ha),
1408
- e(o).pendingLocalChanges.value ? (c(), v("button", {
1409
- key: 0,
1410
- type: "button",
1411
- disabled: e(K),
1412
- onClick: i[20] || (i[20] = //@ts-ignore
1413
- (...a) => e(o).restoreDraft && e(o).restoreDraft(...a))
1414
- }, l(e(u).restoreDraft), 9, _a)) : T("", !0),
1415
- n("button", {
1416
- type: "button",
1417
- disabled: !e(o).canCheck.value,
1418
- onClick: i[21] || (i[21] = //@ts-ignore
1419
- (...a) => e(o).check && e(o).check(...a))
1420
- }, l(e(u).check), 9, qa),
1421
- n("button", {
1422
- type: "button",
1423
- class: "mr-binding-primary",
1424
- disabled: e(K) || !e(Q).ok,
1425
- title: e(o).guidance.value,
1426
- onClick: i[22] || (i[22] = //@ts-ignore
1427
- (...a) => e(o).apply && e(o).apply(...a))
1428
- }, l(e(u).apply), 9, Oa)
1429
- ])
1430
- ], 64)) : (c(), v("div", Sn, [
1431
- i[27] || (i[27] = n("svg", {
1432
- viewBox: "0 0 80 80",
1433
- fill: "none",
1434
- "aria-hidden": "true"
1435
- }, [
1436
- n("rect", {
1437
- x: "15",
1438
- y: "10",
1439
- width: "50",
1440
- height: "60",
1441
- rx: "8",
1442
- fill: "#eff6ff",
1443
- stroke: "#bfdbfe"
1444
- }),
1445
- n("path", {
1446
- d: "M25 25h30M25 35h30M25 45h30M35 25v30M45 25v30M25 55h30",
1447
- stroke: "#93c5fd",
1448
- "stroke-width": "1.5"
1449
- })
1450
- ], -1)),
1451
- n("strong", null, l(e(u).noSource), 1),
1452
- n("span", null, l(e(u).sourceOnly), 1),
1453
- n("button", {
1454
- type: "button",
1455
- class: "mr-binding-primary",
1456
- disabled: t.readonly,
1457
- onClick: i[2] || (i[2] = (a) => Z.value?.click())
1458
- }, l(e(u).upload), 9, Kn)
1459
- ]))
1460
- ], 40, $n));
1461
- }
1462
- });
1463
- export {
1464
- Xa as default
1465
- };