@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,784 @@
1
+ import { computed as b, shallowRef as _e, ref as R, onMounted as vt, onScopeDispose as Qe, watch as W, defineComponent as pt, markRaw as bt, nextTick as gt, openBlock as w, createElementBlock as k, unref as t, normalizeStyle as ht, normalizeClass as Be, createElementVNode as r, createVNode as be, toDisplayString as c, createTextVNode as _, Fragment as ge, renderList as Ne, createCommentVNode as E, withDirectives as K, isRef as se, vModelText as Ce, vModelSelect as yt, withKeys as wt, withModifiers as St, createBlock as He, withCtx as Mt, vModelCheckbox as Ct, vShow as Ke, resolveDynamicComponent as kt } from "vue";
2
+ import { useMachReport as _t, provideMachReportConfig as Lt, ReportPreview as Rt } from "@agile-team/mach-report/vue";
3
+ import { a as he } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { L as Dt, d as Ft, u as xt, e as Et } from "./designer-BZoVWTgl.js";
5
+ import { defineReportTemplate as Nt, createLabelTemplate as Tt, parseReportTemplate as T, serializeReportTemplate as ke, createReportSource as Vt, defineLabelReport as Ot, inspectReportTemplateCompatibility as $t, imposeLabelSheets as It } from "@agile-team/mach-report";
6
+ import { v as Ue } from "./progress-ByiOxUD3.js";
7
+ function Pt() {
8
+ let e;
9
+ const s = () => e ??= import("@agile-team/mach-report/codes").then((i) => i.createCodeAssetRenderers()).catch((i) => {
10
+ throw e = void 0, i;
11
+ }), o = (i) => async (u) => {
12
+ Ue(u.signal);
13
+ const d = await s();
14
+ return Ue(u.signal), d[i](u);
15
+ };
16
+ return { assetRenderers: { barcode: o("barcode"), qrcode: o("qrcode") } };
17
+ }
18
+ function zt(e) {
19
+ const s = e.pages[0];
20
+ if (!s || e.pages.some((u) => u.layout === "wide" || u.widthMm !== s.widthMm || u.heightMm !== s.heightMm)) return;
21
+ const o = Math.floor(190 / (s.widthMm + 4)), i = Math.floor(277 / (s.heightMm + 4));
22
+ if (!(o < 1 || i < 1 || o * i > 1e3))
23
+ return { paper: "a4", columns: o, rows: i, marginMm: 12, gapMm: 4, capacity: o * i };
24
+ }
25
+ const Le = [
26
+ { id: "material", widthMm: 80, heightMm: 55, faces: 1 },
27
+ { id: "paired", widthMm: 80, heightMm: 55, faces: 2 },
28
+ { id: "warehouse", widthMm: 100, heightMm: 60, faces: 1 }
29
+ ];
30
+ function Ye(e, s) {
31
+ return s ?? e.fields.find((o) => o.semanticRole === "identifier" && o.field !== e.rowKey)?.field ?? e.rowKey ?? e.fields[0]?.field;
32
+ }
33
+ function De(e, s, o) {
34
+ const i = e.fields.filter((a) => a.field !== s && a.field !== e.rowKey);
35
+ if (o === void 0)
36
+ return i.map((a, l) => ({ field: a, index: l, priority: Jt(a) })).sort((a, l) => a.priority - l.priority || a.index - l.index).slice(0, 5).map((a) => a.field);
37
+ const u = new Map(i.map((a) => [a.field, a])), d = [...new Set(o)];
38
+ if (d.length > 5) throw new Error("成品标签最多显示 5 个字段,请先精简显示字段");
39
+ return d.map((a) => {
40
+ const l = u.get(a);
41
+ if (!l) throw new Error(`标签显示字段未在业务契约中声明:${a}`);
42
+ return l;
43
+ });
44
+ }
45
+ function Jt(e) {
46
+ return /^(?:name|title|label|category)$/i.test(e.field) || /名称|品名|品类|类别/.test(e.label ?? "") ? 0 : e.semanticRole === "dimension" ? 1 : e.semanticRole === "measure" && e.unit ? 2 : e.semanticRole === "identifier" ? 3 : e.semanticRole === "date" ? 4 : 5;
47
+ }
48
+ function At(e = "paired") {
49
+ return Le.find((s) => s.id === e) ?? Le[1];
50
+ }
51
+ const Ve = "#173450", Fe = "#586c82";
52
+ function B(e, s, o, i, u = 4, d = 7) {
53
+ return {
54
+ kind: "text",
55
+ text: e,
56
+ leftMm: s,
57
+ topMm: o,
58
+ widthMm: i,
59
+ heightMm: u,
60
+ style: { fontSize: d, lineHeight: 1.1, color: Ve, verticalAlign: "middle" }
61
+ };
62
+ }
63
+ function Oe(e, s) {
64
+ return {
65
+ kind: "line",
66
+ leftMm: 4,
67
+ topMm: e,
68
+ widthMm: s - 8,
69
+ heightMm: 0.2,
70
+ style: { lineColor: "#c9d7e5", lineWidthPt: 0.55 }
71
+ };
72
+ }
73
+ function Ze(e, s, o) {
74
+ const i = [];
75
+ let u = 4;
76
+ if (o?.logoData) {
77
+ if (!/^data:image\/(?:png|jpeg);base64,/i.test(o.logoData))
78
+ throw new Error("标签Logo须使用PNG或JPEG图片数据");
79
+ i.push({ kind: "image", leftMm: 4, topMm: 3, widthMm: 12, heightMm: 7, imageData: o.logoData, meta: { labelBrandLogo: !0 } }), u = 19;
80
+ }
81
+ return i.push({ ...B(o?.name?.trim() || e, u, 3, s - u - 4, 5, 9), style: { fontSize: 9, color: "#205582" }, meta: { labelStudioRole: "brand-name" } }), o?.tagline?.trim() && i.push({ ...B(o.tagline.trim(), u, 8, s - u - 4, 3, 5.5), style: { fontSize: 5.5, color: Fe }, meta: { labelStudioRole: "brand-tagline" } }), i.push(Oe(12, s)), i;
82
+ }
83
+ function We(e, s, o, i, u = 4.7) {
84
+ return e.flatMap((d, a) => {
85
+ const l = s + a * u;
86
+ return [
87
+ { ...B(d.label ?? d.field, 4, l, o, 4, 6), style: { fontSize: 6, color: Fe }, meta: { labelStudioRole: "field-label", labelStudioField: d.field } },
88
+ { ...B("", 4 + o, l, i, 4, 7), binding: { field: d.field, ...d.format ? { format: d.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: d.field } }
89
+ ];
90
+ });
91
+ }
92
+ function qt(e, s) {
93
+ return e ? [{ ...B("", 4, 14, s, 7, 14), binding: { field: e }, style: { fontSize: 14, color: Ve } }] : [];
94
+ }
95
+ function Bt(e, s, o, i) {
96
+ const u = De(e, o, i.fields), d = [
97
+ ...Ze(s, 80, i.brand),
98
+ ...qt(o, 71),
99
+ ...We(u, 23, 21, 27)
100
+ ];
101
+ o && d.push({ kind: "qrcode", leftMm: 55, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } }), d.push(Oe(48, 80));
102
+ const a = e.fields.find((l) => l.field === o)?.label ?? s;
103
+ return d.push({ ...B(a, 4, 49, 71, 3, 5.8), style: { fontSize: 5.8, color: Fe } }), d;
104
+ }
105
+ function je(e, s, o, i, u = 80) {
106
+ const d = Ze(s, u, i.brand);
107
+ o && (d.push({ ...B("", 4, 14, u - 8, 8, 16), binding: { field: o }, style: { fontSize: 16, align: "center", color: Ve } }), d.push({ kind: "qrcode", leftMm: (u - 20) / 2, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } })), d.push(Oe(44, u));
108
+ const a = De(e, o, i.fields);
109
+ return u === 100 ? a.forEach((l, S) => {
110
+ const h = S % 2 === 0 ? 4 : 52, v = 46 + Math.floor(S / 2) * 4.3;
111
+ d.push({ ...B(l.label ?? l.field, h, v, 19, 3.7, 5.8), style: { fontSize: 5.8, color: Fe }, meta: { labelStudioRole: "field-label", labelStudioField: l.field } }), d.push({ ...B("", h + 19, v, 25, 3.7, 6.5), binding: { field: l.field, ...l.format ? { format: l.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: l.field } });
112
+ }) : d.push(...We(a.slice(0, 1), 46, 24, u - 32, 5)), d;
113
+ }
114
+ function ye(e, s, o, i = {}, u) {
115
+ const d = Ye(e, o), a = At(i.preset), l = Object.fromEntries(["name", "tagline"].flatMap((g) => {
116
+ const M = i.brand?.[g];
117
+ return typeof M == "string" ? [[g, M]] : [];
118
+ })), S = { preset: a.id, brand: l, fields: De(e, d, i.fields).map((g) => g.field) }, h = a.id === "warehouse" ? je(e, s, d, i, a.widthMm) : Bt(e, s, d, i), v = [{ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 1`, labelStudio: S }, components: h }];
119
+ return a.faces === 2 && v.push({ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 2`, labelStudio: S }, components: je(e, s, d, i) }), Nt({ id: "record-label", name: s, template: { ...Tt({ dataset: "records", rowKey: e.rowKey, pages: v }), ...u ? { dataContract: u } : {} } });
120
+ }
121
+ const z = (e) => e.meta?.labelStudioRole, Te = (e) => typeof z(e) == "string";
122
+ function Re(e) {
123
+ const s = { ...e, ...e.meta ? { meta: { ...e.meta } } : {} };
124
+ return s.meta && (delete s.meta.labelStudioRole, delete s.meta.labelStudioField, Object.keys(s.meta).length || delete s.meta), s;
125
+ }
126
+ function Ht(e, s) {
127
+ for (const o of s.components.filter(Te)) {
128
+ if (e.components.some((u) => z(u) === z(o) && u.meta?.labelStudioField === o.meta?.labelStudioField)) continue;
129
+ const i = e.components.find((u) => !Te(u) && JSON.stringify(Re(u)) === JSON.stringify(Re(o)));
130
+ i && (i.meta = { ...i.meta, ...o.meta });
131
+ }
132
+ }
133
+ function Kt(e, s) {
134
+ const o = e.kind === "list" ? Number.POSITIVE_INFINITY : e.heightMm, i = s.kind === "list" ? Number.POSITIVE_INFINITY : s.heightMm;
135
+ return e.leftMm < s.leftMm + s.widthMm && e.leftMm + e.widthMm > s.leftMm && e.topMm < s.topMm + i && e.topMm + o > s.topMm;
136
+ }
137
+ function Ut(e, s) {
138
+ const o = { ...e, meta: { ...e.meta, ...s.meta } };
139
+ return o.kind === "text" && s.kind === "text" && (o.text = s.text, s.binding ? o.binding = s.binding : delete o.binding), o;
140
+ }
141
+ function jt(e, s, o, i) {
142
+ const u = i.has("field-value");
143
+ Ht(e, s);
144
+ const d = new Set(e.components.filter((v) => z(v) === "field-label" || z(v) === "field-value")), a = [...d], l = /* @__PURE__ */ new Map(), S = [];
145
+ for (const v of o.components.filter(Te)) {
146
+ const g = z(v);
147
+ if (!i.has(String(g))) continue;
148
+ const M = g === "field-label" || g === "field-value" ? a.find((D) => z(D) === g && !l.has(D)) : e.components.find((D) => z(D) === g);
149
+ M ? l.set(M, Ut(M, v)) : S.push(v);
150
+ }
151
+ const h = e.components.filter((v) => (!u || !d.has(v) || l.has(v)) && (!i.has("brand-tagline") || z(v) !== "brand-tagline" || o.components.some((g) => z(g) === "brand-tagline"))).map((v) => l.get(v) ?? v);
152
+ for (const v of S) {
153
+ if (h.some((g) => Kt(g, v))) return !1;
154
+ h.push(v);
155
+ }
156
+ return e.components = h, e.meta = { ...e.meta, labelStudio: o.meta?.labelStudio }, !0;
157
+ }
158
+ function Gt(e, s, o, i, u, d) {
159
+ const a = ye(s, o, i, u), l = ye(s, o, i, d), S = T(e), h = /* @__PURE__ */ new Set();
160
+ JSON.stringify(u.fields) !== JSON.stringify(d.fields) && (h.add("field-label"), h.add("field-value")), (u.brand?.name ?? "").trim() !== (d.brand?.name ?? "").trim() && h.add("brand-name"), (u.brand?.tagline ?? "").trim() !== (d.brand?.tagline ?? "").trim() && h.add("brand-tagline");
161
+ for (const [v, g] of S.template.pages.entries()) {
162
+ const M = a.template.pages[v], D = l.template.pages[v];
163
+ if (M && D && !jt(g, M, D, h)) return;
164
+ }
165
+ return S;
166
+ }
167
+ function Qt(e, s) {
168
+ const o = e.template.pages, i = s.template.pages;
169
+ return o.length !== i.length || o.some((u, d) => u.components.length !== i[d].components.length) ? !0 : o.some((u, d) => {
170
+ const a = i[d], l = { ...u, meta: void 0, components: void 0 }, S = { ...a, meta: void 0, components: void 0 };
171
+ return JSON.stringify(l) !== JSON.stringify(S) || u.components.some((h, v) => JSON.stringify(Re(h)) !== JSON.stringify(Re(a.components[v])));
172
+ });
173
+ }
174
+ function Yt(e, s, o, i, u) {
175
+ const d = { ...e, template: ye(s, o, i, u, e.template.dataContract).template }, a = e.template.repeat;
176
+ return a?.copies !== void 0 && d.template.repeat && (d.template.repeat.copies = a.copies), d;
177
+ }
178
+ function P(e) {
179
+ const s = e.template.pages[0]?.meta?.labelStudio;
180
+ if (!s || typeof s != "object") return;
181
+ const o = s, i = Le.find((l) => l.id === o.preset);
182
+ if (!i) return;
183
+ const u = Array.isArray(o.fields) ? o.fields.filter((l) => typeof l == "string") : void 0;
184
+ if (u && u.length > 5) return;
185
+ const d = o.brand && typeof o.brand == "object" ? o.brand : {}, a = {};
186
+ for (const l of ["name", "tagline", "logoData"])
187
+ typeof d[l] == "string" && (a[l] = d[l]);
188
+ return { preset: i.id, fields: u, brand: a };
189
+ }
190
+ function Ge(e, s, o) {
191
+ const i = new Set(e.fields.filter((d) => d.field !== s && d.field !== e.rowKey).map((d) => d.field)), u = o?.filter((d) => i.has(d));
192
+ return De(e, s, u).map((d) => d.field);
193
+ }
194
+ function Zt(e, s) {
195
+ const o = _t(), i = b(() => ({ ...Dt, ...e.messages })), u = b(() => e.title ?? i.value.title), d = { preset: e.preset, brand: e.brand, fields: e.fields }, a = _e(e.modelValue ? T(e.modelValue) : ye(e.schema, u.value, e.identityField, d, e.dataContract)), l = _e(T(a.value)), S = R(!1), h = _e();
196
+ let v, g;
197
+ vt(() => {
198
+ e.modelValue || s(T(a.value));
199
+ });
200
+ const M = R("preview"), D = R("all"), J = R(1), O = R(!1), oe = R(!1), y = R(), U = Ft(() => e.beforeDiscard), H = b(() => oe.value || U.pending.value || S.value && !y.value || y.value?.saving === !0 || y.value?.blocked === !0 || o.state.printing || o.state.exporting !== null), L = R(""), X = b(() => Ye(e.schema, e.identityField)), $ = R(P(a.value)?.preset ?? (e.modelValue ? void 0 : e.preset ?? "paired")), j = R(P(a.value)?.brand?.name ?? e.brand?.name ?? ""), V = R(P(a.value)?.brand?.tagline ?? e.brand?.tagline ?? ""), x = R(Ge(e.schema, X.value, P(a.value)?.fields ?? e.fields)), ee = R(""), te = b(() => e.schema.fields.filter((n) => n.field !== X.value && n.field !== e.schema.rowKey)), ae = b(() => x.value.map((n) => ({ field: n, label: e.schema.fields.find((p) => p.field === n)?.label ?? n }))), re = b(() => {
201
+ const n = ee.value.trim().toLocaleLowerCase();
202
+ return te.value.filter((p) => `${p.label ?? ""} ${p.field}`.toLocaleLowerCase().includes(n)).slice(0, 30);
203
+ }), G = b(() => {
204
+ const n = a.value.template.pages[0]?.components.find((p) => p.kind === "image" && p.meta?.labelBrandLogo);
205
+ return n?.kind === "image" ? n.imageData : e.brand?.logoData;
206
+ }), ue = b(() => ({
207
+ preset: $.value,
208
+ fields: x.value,
209
+ brand: { ...e.brand, ...G.value ? { logoData: G.value } : {}, name: j.value, tagline: V.value }
210
+ }));
211
+ let de = JSON.stringify(P(a.value));
212
+ const ce = b(() => {
213
+ const n = P(a.value);
214
+ if (!n) return !0;
215
+ try {
216
+ const p = ye(e.schema, u.value, e.identityField, { ...n, brand: { ...n.brand, ...G.value ? { logoData: G.value } : {} } });
217
+ return Qt(a.value, p);
218
+ } catch {
219
+ return !0;
220
+ }
221
+ }), A = R(!1), Q = b(() => $.value !== P(a.value)?.preset), Y = () => JSON.stringify({ preset: $.value, fields: x.value, name: j.value, tagline: V.value }), fe = R(Y()), q = b(() => Y() !== fe.value), me = b(() => ke(a.value)), xe = b(() => ke(l.value)), le = b(() => me.value !== xe.value), we = b(() => q.value || le.value || y.value?.pendingLocalChanges === !0);
222
+ function ve() {
223
+ A.value = !1;
224
+ const n = P(a.value);
225
+ $.value = n?.preset, x.value = Ge(e.schema, X.value, n?.fields ?? e.fields), j.value = n?.brand?.name ?? e.brand?.name ?? "", V.value = n?.brand?.tagline ?? e.brand?.tagline ?? "", de = JSON.stringify(n), fe.value = Y();
226
+ }
227
+ function Se(n) {
228
+ const p = P(n), C = JSON.stringify(p);
229
+ C !== de && (de = C, ve());
230
+ }
231
+ let F = !1;
232
+ Qe(() => {
233
+ F = !0, g?.abort();
234
+ });
235
+ const ne = Pt();
236
+ Lt({ get defaults() {
237
+ return { ...e.preview, assets: { ...ne, ...e.preview?.assets, assetRenderers: { ...ne.assetRenderers, ...e.preview?.assets?.assetRenderers } } };
238
+ } }), W(y, (n) => {
239
+ const p = h.value;
240
+ if (!n || !p) return;
241
+ const C = a.value;
242
+ ke(p) !== me.value && n.applyTemplate?.(C.template), h.value = void 0, v = void 0;
243
+ }, { flush: "post" }), W([$, x, j, V], () => {
244
+ A.value = !1;
245
+ }), W(() => e.modelValue, (n) => {
246
+ n && ke(n) !== me.value && (a.value = T(n), l.value = T(n), v = void 0, Se(n));
247
+ }), W(() => e.rows, () => {
248
+ D.value = "all", J.value = 1;
249
+ });
250
+ function Z(n) {
251
+ L.value = "", a.value = n, Se(n), s(n);
252
+ }
253
+ function ie(n, p) {
254
+ p && x.value.length < 5 && !x.value.includes(n) ? x.value = [...x.value, n] : p || (x.value = x.value.filter((C) => C !== n));
255
+ }
256
+ function I(n = !1) {
257
+ if (H.value || F) return !1;
258
+ if (!$.value)
259
+ return L.value = i.value.choosePreset, !1;
260
+ if (y.value?.canApply === !1)
261
+ return L.value = y.value.saveReason || i.value.applyFirst, !1;
262
+ if (Q.value && !n)
263
+ return A.value = !0, !1;
264
+ try {
265
+ const p = P(a.value);
266
+ let C;
267
+ if (n ? C = Yt(a.value, e.schema, u.value, e.identityField, ue.value) : p && (C = Gt(a.value, e.schema, u.value, e.identityField, p, ue.value)), !C)
268
+ return L.value = i.value.contentNeedsDesign, !1;
269
+ if (y.value?.applyTemplate) {
270
+ if (!y.value.applyTemplate(C.template))
271
+ return L.value = i.value.saveFailed, !1;
272
+ } else
273
+ v = T(a.value), Z(C);
274
+ return A.value = !1, fe.value = Y(), !0;
275
+ } catch (p) {
276
+ return L.value = p instanceof Error ? p.message : i.value.saveFailed, !1;
277
+ }
278
+ }
279
+ const f = b(() => D.value === "all" ? e.rows : Number.isSafeInteger(J.value) && e.rows[J.value - 1] ? [e.rows[J.value - 1]] : []), m = b(() => a.value.template.repeat?.dataset ?? "records"), pe = b(() => ({ [m.value]: f.value })), Xe = b(() => ({ [m.value]: f.value.slice(0, 3) })), et = b(() => ({ [m.value]: e.schema })), tt = b(() => [{ id: m.value, label: u.value, rowKey: e.schema.rowKey, fields: e.schema.fields }]), at = b(() => a.value.template.pages[0]), $e = b(() => a.value.template.pages.length), lt = b(() => {
280
+ const n = a.value.template.repeat?.copies ?? 1;
281
+ return typeof n == "number" ? n : void 0;
282
+ }), nt = b(() => {
283
+ const n = a.value.template.repeat?.copies;
284
+ return typeof n == "object" ? n.field : void 0;
285
+ }), Ie = b(() => {
286
+ const n = nt.value;
287
+ if (!n) return;
288
+ let p = 0;
289
+ for (const C of f.value) {
290
+ const N = Object.getOwnPropertyDescriptor(C, n)?.value;
291
+ if (typeof N != "number" || !Number.isSafeInteger(N) || N < 1 || N > 1e3) return;
292
+ p += N;
293
+ }
294
+ return p;
295
+ }), it = b(() => {
296
+ const n = lt.value;
297
+ return n !== void 0 ? Number.isSafeInteger(n) && n >= 1 && n <= 1e3 ? f.value.length * n * $e.value : void 0 : Ie.value === void 0 ? void 0 : Ie.value * $e.value;
298
+ }), Me = b(() => zt(a.value.template)), st = b(() => {
299
+ const n = Me.value;
300
+ return n ? i.value.sheetHint.replace("{columns}", String(n.columns)).replace("{rows}", String(n.rows)).replace("{capacity}", String(n.capacity)) : i.value.sheetUnavailable;
301
+ });
302
+ W(Me, (n) => {
303
+ n || (O.value = !1);
304
+ });
305
+ const ot = b(() => {
306
+ const n = Vt({ labels: Ot({ template: a.value.template, rows: f.value, dataSchema: e.schema }) }), p = O.value ? Me.value : void 0, C = e.dataContract ? $t(a.value.template, e.dataContract) : void 0;
307
+ return async (N) => {
308
+ if (C && !C.ok) throw new Error(C.issues.map((mt) => mt.message).join(";"));
309
+ const qe = await n(N);
310
+ return p ? It(qe, { ...p, signal: N.signal }) : qe;
311
+ };
312
+ }), Pe = async (n, p) => {
313
+ if (F || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
314
+ const C = T(n), N = T(e.save ? await e.save(C, p) : C);
315
+ if (N.id !== n.id) throw new Error(i.value.invalidSavedTemplate);
316
+ if (F || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
317
+ return l.value = T(N), Z(N), N;
318
+ };
319
+ async function ze() {
320
+ if (!(H.value || F)) {
321
+ if (q.value && Q.value) {
322
+ L.value = i.value.applyLayoutFirst;
323
+ return;
324
+ }
325
+ if (!(q.value && !I())) {
326
+ oe.value = !0;
327
+ try {
328
+ if (y.value) {
329
+ if (y.value.canApply === !1) {
330
+ L.value = y.value.saveReason || i.value.applyFirst;
331
+ return;
332
+ }
333
+ if (y.value.pendingLocalChanges && await y.value.save(), y.value.pendingLocalChanges) {
334
+ L.value = i.value.saveFailed;
335
+ return;
336
+ }
337
+ } else le.value && (g = new AbortController(), await Pe(a.value, { expectedRevision: a.value.revision, signal: g.signal }), v = void 0);
338
+ if (!F)
339
+ return L.value = "", T(a.value);
340
+ } catch (n) {
341
+ F || (L.value = n instanceof Error ? n.message : i.value.saveFailed);
342
+ } finally {
343
+ oe.value = !1, g = void 0;
344
+ }
345
+ }
346
+ }
347
+ }
348
+ async function Je(n) {
349
+ if (!(H.value || n === M.value))
350
+ if (n === "design" && !S.value) {
351
+ if (q.value && Q.value) {
352
+ L.value = i.value.applyLayoutFirst;
353
+ return;
354
+ }
355
+ if (q.value && !I()) return;
356
+ h.value = v, S.value = !0, M.value = n;
357
+ } else await ze() && (M.value = n);
358
+ }
359
+ function rt(n) {
360
+ S.value = !1, M.value = "preview", L.value = `${i.value.designLoadFailed} ${n instanceof Error ? n.message : String(n)}`;
361
+ }
362
+ let Ee = !1;
363
+ const ut = (n) => Ee || U.request(n);
364
+ async function dt() {
365
+ if (H.value) return !1;
366
+ const n = y.value?.pendingLocalChanges === !0;
367
+ if (!n && !le.value && !q.value) return !0;
368
+ if (!(n && y.value ? await y.value.guardChanges() : await U.request({ reason: "replace", document: T(a.value), pendingLocalChanges: !0 })) || F) return !1;
369
+ if (n && y.value) {
370
+ Ee = !0;
371
+ try {
372
+ await y.value.reset();
373
+ } finally {
374
+ Ee = !1;
375
+ }
376
+ }
377
+ return Z(T(l.value)), v = void 0, ve(), !0;
378
+ }
379
+ const Ae = b(() => M.value === "preview" && !H.value && o.state.canPrint);
380
+ async function ct() {
381
+ return await Je("preview"), !F && M.value === "preview";
382
+ }
383
+ async function ft() {
384
+ Ae.value && await o.print();
385
+ }
386
+ return { m: i, notice: L, title: u, document: a, mode: M, preview: o, showPreview: ct, print: ft, canPrint: Ae, editorVisited: S, editorInitialDocument: h, failDesignLoad: rt, sheetLayout: Me, sheetHint: st, rebuilding: A, layoutChanged: Q, record: D, recordIndex: J, sheet: O, busy: H, editor: y, rows: f, datasets: pe, designDatasets: Xe, schemas: et, bindings: tt, paper: at, labelCount: it, fetcher: ot, update: Z, save: Pe, navigate: Je, prepare: ze, guardChanges: dt, preset: $, presets: Le, brandName: j, brandTagline: V, fields: x, fieldQuery: ee, selectedFields: ae, availableFields: re, fieldCount: b(() => te.value.length), configurationDirty: q, pendingLocalChanges: we, custom: ce, toggleField: ie, applyConfiguration: I, requestRebuild: () => {
387
+ A.value = !0;
388
+ }, cancelRebuild: () => {
389
+ A.value = !1;
390
+ }, restoreConfiguration: ve, beforeDiscard: ut, confirmation: U.confirmation, decideDiscard: U.decide };
391
+ }
392
+ const Wt = ["aria-label"], Xt = { class: "mr-label-context" }, ea = { class: "mr-label-identity" }, ta = { class: "mr-label-spec" }, aa = ["disabled"], la = ["aria-label"], na = ["aria-pressed", "onClick"], ia = { class: "mr-label-fields" }, sa = {
393
+ key: 0,
394
+ class: "mr-label-selected-fields"
395
+ }, oa = ["aria-label", "onClick"], ra = { class: "mr-label-field-search" }, ua = ["aria-label", "placeholder"], da = { class: "mr-label-field-options" }, ca = ["checked", "disabled", "onChange"], fa = { key: 0 }, ma = { key: 1 }, va = { class: "mr-label-brand" }, pa = ["placeholder"], ba = ["disabled"], ga = {
396
+ key: 1,
397
+ class: "mr-label-rebuild",
398
+ role: "alert"
399
+ }, ha = {
400
+ key: 3,
401
+ class: "mr-label-reflow-hint"
402
+ }, ya = { class: "mr-label-reflow-hint" }, wa = { class: "mr-label-record" }, Sa = ["disabled"], Ma = { value: "all" }, Ca = { value: "single" }, ka = {
403
+ key: 0,
404
+ class: "mr-label-record-index"
405
+ }, _a = ["max", "aria-label", "disabled"], La = { class: "mr-label-count" }, Ra = { class: "mr-label-help" }, Da = { class: "mr-label-main" }, Fa = { class: "mr-label-bar" }, xa = ["aria-label"], Ea = ["aria-pressed", "disabled"], Na = ["aria-pressed", "disabled"], Ta = {
406
+ key: 0,
407
+ class: "mr-label-notice",
408
+ role: "status"
409
+ }, Va = ["aria-label"], Oa = { class: "mr-label-imposition" }, $a = ["disabled"], Ia = {
410
+ key: 3,
411
+ class: "mr-label-editor"
412
+ }, Pa = {
413
+ key: 0,
414
+ class: "mr-label-editor-loading",
415
+ role: "status"
416
+ }, Ka = /* @__PURE__ */ pt({
417
+ __name: "ReportLabelStudio",
418
+ props: {
419
+ showSave: { type: Boolean, default: !0 },
420
+ rows: {},
421
+ schema: {},
422
+ title: {},
423
+ identityField: {},
424
+ dataContract: {},
425
+ modelValue: {},
426
+ preview: {},
427
+ save: {},
428
+ beforeDiscard: {},
429
+ messages: {},
430
+ preset: {},
431
+ brand: {},
432
+ fields: {}
433
+ },
434
+ emits: ["update:modelValue"],
435
+ setup(e, { expose: s, emit: o }) {
436
+ const i = e, u = xt(() => i.preview?.theme), d = o, a = Zt(i, (I) => d("update:modelValue", I)), { m: l, notice: S, title: h, document: v, mode: g, record: M, recordIndex: D, sheet: J, busy: O, editor: oe, rows: y, designDatasets: U, schemas: H, bindings: L, paper: X, labelCount: $, fetcher: j, preset: V, presets: x, brandName: ee, brandTagline: te, fields: ae, fieldQuery: re, selectedFields: G, availableFields: ue, fieldCount: de, configurationDirty: ce, pendingLocalChanges: A, custom: Q, confirmation: Y, editorVisited: fe, editorInitialDocument: q, sheetLayout: me, sheetHint: xe, rebuilding: le, layoutChanged: we } = a, { previewVisited: ve, visibleFetcher: Se } = Et(v, g, j), F = _e();
437
+ let ne = !1;
438
+ Qe(() => {
439
+ ne = !0;
440
+ }), W(a.editorVisited, async (I) => {
441
+ if (!(!I || F.value))
442
+ try {
443
+ const f = await import("./designer-BZoVWTgl.js").then((m) => m.x);
444
+ ne || (F.value = bt(f.default));
445
+ } catch (f) {
446
+ ne || a.failDesignLoad(f);
447
+ }
448
+ });
449
+ const Z = R();
450
+ let ie = null;
451
+ return W(Y, async (I) => {
452
+ I ? (ie = window.document.activeElement, await gt(), Z.value?.focus()) : ie?.isConnected && (ie.focus(), ie = null);
453
+ }), s({ guardChanges: a.guardChanges, prepare: a.prepare, preview: a.showPreview, print: a.print, get mode() {
454
+ return g.value;
455
+ }, get canPrint() {
456
+ return a.canPrint.value;
457
+ }, get busy() {
458
+ return O.value;
459
+ }, get pendingLocalChanges() {
460
+ return A.value;
461
+ } }), (I, f) => (w(), k("section", {
462
+ class: Be(["mr-label-studio", { "is-design": t(g) === "design" }]),
463
+ style: ht(t(u)),
464
+ "aria-label": t(h)
465
+ }, [
466
+ r("aside", Xt, [
467
+ r("div", ea, [
468
+ be(he, {
469
+ name: "file",
470
+ size: 18
471
+ }),
472
+ r("strong", null, c(t(h)), 1),
473
+ r("small", null, c(t(Q) ? t(l).customTemplate : t(l).readyTemplate), 1)
474
+ ]),
475
+ r("div", ta, [
476
+ r("strong", null, [
477
+ _(c(t(X)?.widthMm) + " ", 1),
478
+ f[16] || (f[16] = r("i", null, "×", -1)),
479
+ _(" " + c(t(X)?.heightMm), 1)
480
+ ]),
481
+ r("span", null, "mm · " + c(t(v).template.pages.length) + " " + c(t(l).faces), 1)
482
+ ]),
483
+ r("fieldset", {
484
+ class: "mr-label-quick",
485
+ disabled: t(O)
486
+ }, [
487
+ r("legend", null, c(t(l).layout), 1),
488
+ r("div", {
489
+ class: "mr-label-presets",
490
+ "aria-label": t(l).layout
491
+ }, [
492
+ (w(!0), k(ge, null, Ne(t(x), (m) => (w(), k("button", {
493
+ key: m.id,
494
+ type: "button",
495
+ "aria-pressed": t(V) === m.id,
496
+ onClick: (pe) => V.value = m.id
497
+ }, [
498
+ r("span", {
499
+ class: Be(["mr-label-preset-art", `is-${m.id}`]),
500
+ "aria-hidden": "true"
501
+ }, [...f[17] || (f[17] = [
502
+ r("i", null, null, -1),
503
+ r("i", null, null, -1),
504
+ r("i", null, null, -1)
505
+ ])], 2),
506
+ r("span", null, [
507
+ r("strong", null, c(t(l)[`${m.id}Preset`]), 1),
508
+ r("small", null, c(m.widthMm) + " × " + c(m.heightMm) + " · " + c(m.faces) + " " + c(t(l).faces), 1)
509
+ ])
510
+ ], 8, na))), 128))
511
+ ], 8, la),
512
+ r("details", ia, [
513
+ r("summary", null, [
514
+ _(c(t(l).fields) + " ", 1),
515
+ r("span", null, c(t(ae).length) + " / 5", 1)
516
+ ]),
517
+ t(G).length ? (w(), k("div", sa, [
518
+ (w(!0), k(ge, null, Ne(t(G), (m) => (w(), k("button", {
519
+ key: m.field,
520
+ type: "button",
521
+ "aria-label": `${t(l).removeField} ${m.label}`,
522
+ onClick: (pe) => t(a).toggleField(m.field, !1)
523
+ }, [
524
+ _(c(m.label) + " ", 1),
525
+ f[18] || (f[18] = r("span", { "aria-hidden": "true" }, "×", -1))
526
+ ], 8, oa))), 128))
527
+ ])) : E("", !0),
528
+ r("label", ra, [
529
+ be(he, {
530
+ name: "search",
531
+ size: 13
532
+ }),
533
+ K(r("input", {
534
+ "onUpdate:modelValue": f[0] || (f[0] = (m) => se(re) ? re.value = m : null),
535
+ type: "search",
536
+ "aria-label": t(l).findField,
537
+ placeholder: t(l).findField
538
+ }, null, 8, ua), [
539
+ [Ce, t(re)]
540
+ ])
541
+ ]),
542
+ r("div", da, [
543
+ (w(!0), k(ge, null, Ne(t(ue), (m) => (w(), k("label", {
544
+ key: m.field
545
+ }, [
546
+ r("input", {
547
+ type: "checkbox",
548
+ checked: t(ae).includes(m.field),
549
+ disabled: !t(ae).includes(m.field) && t(ae).length >= 5,
550
+ onChange: (pe) => t(a).toggleField(m.field, pe.target.checked)
551
+ }, null, 40, ca),
552
+ r("span", null, c(m.label ?? m.field), 1)
553
+ ]))), 128)),
554
+ t(ue).length ? E("", !0) : (w(), k("p", fa, c(t(l).noFields), 1))
555
+ ]),
556
+ r("small", null, c(t(l).fieldLimit), 1),
557
+ t(de) > 30 ? (w(), k("small", ma, c(t(l).fieldSearchHint), 1)) : E("", !0)
558
+ ]),
559
+ r("details", va, [
560
+ r("summary", null, c(t(l).brand), 1),
561
+ r("label", null, [
562
+ _(c(t(l).brandName), 1),
563
+ K(r("input", {
564
+ "onUpdate:modelValue": f[1] || (f[1] = (m) => se(ee) ? ee.value = m : null),
565
+ maxlength: "80",
566
+ placeholder: t(h)
567
+ }, null, 8, pa), [
568
+ [Ce, t(ee)]
569
+ ])
570
+ ]),
571
+ r("label", null, [
572
+ _(c(t(l).brandTagline), 1),
573
+ K(r("input", {
574
+ "onUpdate:modelValue": f[2] || (f[2] = (m) => se(te) ? te.value = m : null),
575
+ maxlength: "120"
576
+ }, null, 512), [
577
+ [Ce, t(te)]
578
+ ])
579
+ ])
580
+ ]),
581
+ r("button", {
582
+ class: "mr-label-apply",
583
+ type: "button",
584
+ disabled: !t(ce) || !t(V),
585
+ onClick: f[3] || (f[3] = (m) => t(a).applyConfiguration())
586
+ }, [
587
+ be(he, {
588
+ name: "arrow-right",
589
+ size: 13
590
+ }),
591
+ _(c(t(we) ? t(l).applyLayout : t(l).applyContent), 1)
592
+ ], 8, ba),
593
+ t(Q) && t(V) && !t(le) ? (w(), k("button", {
594
+ key: 0,
595
+ class: "mr-label-reset-configuration mr-label-rebuild-current",
596
+ type: "button",
597
+ onClick: f[4] || (f[4] = //@ts-ignore
598
+ (...m) => t(a).requestRebuild && t(a).requestRebuild(...m))
599
+ }, c(t(l).rebuildCurrent), 1)) : E("", !0),
600
+ t(le) ? (w(), k("div", ga, [
601
+ r("strong", null, c(t(l).rebuildTitle), 1),
602
+ r("p", null, c(t(l).rebuildDescription), 1),
603
+ r("div", null, [
604
+ r("button", {
605
+ type: "button",
606
+ onClick: f[5] || (f[5] = //@ts-ignore
607
+ (...m) => t(a).cancelRebuild && t(a).cancelRebuild(...m))
608
+ }, c(t(l).cancelRebuild), 1),
609
+ r("button", {
610
+ type: "button",
611
+ onClick: f[6] || (f[6] = (m) => t(a).applyConfiguration(!0))
612
+ }, c(t(l).confirmRebuild), 1)
613
+ ])
614
+ ])) : E("", !0),
615
+ t(ce) ? (w(), k("button", {
616
+ key: 2,
617
+ class: "mr-label-reset-configuration",
618
+ type: "button",
619
+ onClick: f[7] || (f[7] = //@ts-ignore
620
+ (...m) => t(a).restoreConfiguration && t(a).restoreConfiguration(...m))
621
+ }, c(t(l).restoreConfiguration), 1)) : E("", !0),
622
+ t(ce) && !t(V) ? (w(), k("p", ha, c(t(l).choosePreset), 1)) : E("", !0),
623
+ r("p", ya, c(t(we) ? t(l).reflowHint : t(l).contentHint), 1)
624
+ ], 8, aa),
625
+ r("label", wa, [
626
+ _(c(t(l).records), 1),
627
+ K(r("select", {
628
+ "onUpdate:modelValue": f[8] || (f[8] = (m) => se(M) ? M.value = m : null),
629
+ disabled: t(O) || !i.rows.length
630
+ }, [
631
+ r("option", Ma, c(t(l).all) + " · " + c(i.rows.length), 1),
632
+ r("option", Ca, c(t(l).single), 1)
633
+ ], 8, Sa), [
634
+ [yt, t(M)]
635
+ ])
636
+ ]),
637
+ t(M) === "single" ? (w(), k("label", ka, [
638
+ _(c(t(l).record), 1),
639
+ K(r("input", {
640
+ "onUpdate:modelValue": f[9] || (f[9] = (m) => se(D) ? D.value = m : null),
641
+ type: "number",
642
+ min: "1",
643
+ max: i.rows.length,
644
+ "aria-label": t(l).record,
645
+ disabled: t(O)
646
+ }, null, 8, _a), [
647
+ [
648
+ Ce,
649
+ t(D),
650
+ void 0,
651
+ { number: !0 }
652
+ ]
653
+ ]),
654
+ _(" / " + c(i.rows.length), 1)
655
+ ])) : E("", !0),
656
+ r("p", La, [
657
+ r("strong", null, c(t(y).length), 1),
658
+ _(" " + c(t(l).count) + " ", 1),
659
+ f[19] || (f[19] = r("span", null, "→", -1)),
660
+ f[20] || (f[20] = _()),
661
+ t($) !== void 0 ? (w(), k(ge, { key: 0 }, [
662
+ r("strong", null, c(t($)), 1),
663
+ _(" " + c(t(l).labels), 1)
664
+ ], 64)) : (w(), k(ge, { key: 1 }, [
665
+ _(c(t(l).invalidCopies), 1)
666
+ ], 64))
667
+ ]),
668
+ r("details", Ra, [
669
+ r("summary", null, c(t(l).guide), 1),
670
+ r("p", null, c(t(l).help), 1),
671
+ r("p", null, c(t(l).printHint), 1)
672
+ ])
673
+ ]),
674
+ r("div", Da, [
675
+ r("header", Fa, [
676
+ r("nav", { "aria-label": t(h) }, [
677
+ r("button", {
678
+ type: "button",
679
+ "aria-pressed": t(g) === "preview",
680
+ disabled: t(O),
681
+ onClick: f[10] || (f[10] = (m) => t(a).navigate("preview"))
682
+ }, [
683
+ be(he, {
684
+ name: "file",
685
+ size: 14
686
+ }),
687
+ _(c(t(l).preview), 1)
688
+ ], 8, Ea),
689
+ r("button", {
690
+ type: "button",
691
+ "aria-pressed": t(g) === "design",
692
+ disabled: t(O),
693
+ onClick: f[11] || (f[11] = (m) => t(a).navigate("design"))
694
+ }, [
695
+ be(he, {
696
+ name: "settings",
697
+ size: 14
698
+ }),
699
+ _(c(t(l).design), 1)
700
+ ], 8, Na)
701
+ ], 8, xa),
702
+ r("span", null, c(t(g) === "design" ? t(l).designHint : t(l).flow), 1)
703
+ ]),
704
+ t(S) ? (w(), k("p", Ta, c(t(S)), 1)) : E("", !0),
705
+ t(Y) ? (w(), k("div", {
706
+ key: 1,
707
+ class: "mr-label-confirm",
708
+ role: "alertdialog",
709
+ "aria-label": t(l).discardTitle,
710
+ onKeydown: f[14] || (f[14] = wt(St((m) => t(a).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
711
+ }, [
712
+ r("div", null, [
713
+ r("strong", null, c(t(l).discardTitle), 1),
714
+ r("p", null, c(t(l).discardDescription), 1)
715
+ ]),
716
+ r("button", {
717
+ ref_key: "keepEditingButton",
718
+ ref: Z,
719
+ type: "button",
720
+ onClick: f[12] || (f[12] = (m) => t(a).decideDiscard(!1))
721
+ }, c(t(l).keepEditing), 513),
722
+ r("button", {
723
+ type: "button",
724
+ onClick: f[13] || (f[13] = (m) => t(a).decideDiscard(!0))
725
+ }, c(t(l).discard), 1)
726
+ ], 40, Va)) : E("", !0),
727
+ t(ve) ? K((w(), He(t(Rt), {
728
+ key: t(v).id,
729
+ ref: t(a).preview.ref,
730
+ "report-id": "labels",
731
+ fetcher: t(Se),
732
+ refresh: { retainPrevious: !0, key: t(v).id },
733
+ "show-params": !1,
734
+ height: "100%",
735
+ toolbar: { exportFormats: ["pdf", "png", "html"], editing: !1, excelImport: !1 },
736
+ messages: { title: t(h), empty: t(l).empty }
737
+ }, {
738
+ settings: Mt(() => [
739
+ r("label", Oa, [
740
+ K(r("input", {
741
+ "onUpdate:modelValue": f[15] || (f[15] = (m) => se(J) ? J.value = m : null),
742
+ type: "checkbox",
743
+ disabled: !t(me)
744
+ }, null, 8, $a), [
745
+ [Ct, t(J)]
746
+ ]),
747
+ _(c(t(l).sheet), 1),
748
+ r("small", null, c(t(xe)), 1)
749
+ ])
750
+ ]),
751
+ _: 1
752
+ }, 8, ["fetcher", "refresh", "messages"])), [
753
+ [Ke, t(g) === "preview"]
754
+ ]) : E("", !0),
755
+ t(fe) ? K((w(), k("div", Ia, [
756
+ F.value ? E("", !0) : (w(), k("p", Pa, c(t(l).designLoading), 1)),
757
+ F.value ? (w(), He(kt(F.value), {
758
+ key: 1,
759
+ ref_key: "editor",
760
+ ref: oe,
761
+ "model-value": t(q) ?? t(v),
762
+ mode: "design",
763
+ "show-mode-switch": !1,
764
+ "show-save": e.showSave,
765
+ capabilities: { params: !1 },
766
+ datasets: t(U),
767
+ "data-schemas": t(H),
768
+ "binding-datasets": t(L),
769
+ "binding-data-contract": e.dataContract,
770
+ save: t(a).save,
771
+ "before-discard": t(a).beforeDiscard,
772
+ preview: e.preview,
773
+ "onUpdate:modelValue": t(a).update
774
+ }, null, 8, ["model-value", "show-save", "datasets", "data-schemas", "binding-datasets", "binding-data-contract", "save", "before-discard", "preview", "onUpdate:modelValue"])) : E("", !0)
775
+ ], 512)), [
776
+ [Ke, t(g) === "design"]
777
+ ]) : E("", !0)
778
+ ])
779
+ ], 14, Wt));
780
+ }
781
+ });
782
+ export {
783
+ Ka as default
784
+ };