@agile-team/mach-report 2.26.1 → 2.27.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 (155) hide show
  1. package/README.md +16 -5
  2. package/dist/ExcelBindingWizard-CnjjpYxD.cjs +1 -0
  3. package/dist/{ExcelBindingWizard-Bzndrp_z.js → ExcelBindingWizard-DAprCgn-.js} +4 -4
  4. package/dist/{ParamEditor-BrUrInJH.js → ParamEditor-CY9d8QZD.js} +3 -3
  5. package/dist/ParamEditor-CiVjpbc-.cjs +1 -0
  6. package/dist/ReportBatchPanel-0-Oymcdm.cjs +1 -0
  7. package/dist/{ReportBatchPanel-2mXS1uol.js → ReportBatchPanel-CDp7xRHp.js} +4 -4
  8. package/dist/ReportLabelStudio-CsyHqBco.cjs +1 -0
  9. package/dist/{ReportLabelStudio-BUKNmYUY.js → ReportLabelStudio-DtKxk9n0.js} +4 -4
  10. package/dist/ReportParamPanel-CoKcXzSy.cjs +1 -0
  11. package/dist/{ReportParamPanel-Czm3OPo_.js → ReportParamPanel-jKDJVar2.js} +2 -2
  12. package/dist/ReportPreview-D0UTiSpz.js +7507 -0
  13. package/dist/ReportPreview-ratPQxxZ.cjs +6 -0
  14. package/dist/ReportTemplateLibrary-CsUm6edm.cjs +1 -0
  15. package/dist/{ReportTemplateLibrary-ovj03u0F.js → ReportTemplateLibrary-qPQX0Dt_.js} +2 -2
  16. package/dist/RuleEditor-CJBibiLY.cjs +1 -0
  17. package/dist/{RuleEditor-4JTKq_N7.js → RuleEditor-Di-JZ2Lb.js} +6 -6
  18. package/dist/{TemplateOutlinePanel-DfFRc91I.js → TemplateOutlinePanel-D0mKfVWf.js} +3 -3
  19. package/dist/TemplateOutlinePanel-RiRgXnnH.cjs +1 -0
  20. package/dist/TemplateReusePanel-BdK91T7z.cjs +1 -0
  21. package/dist/{TemplateReusePanel-CmX1rq69.js → TemplateReusePanel-J6PvD2Sf.js} +3 -3
  22. package/dist/TemplateReviewPanel-B5yUgOgb.cjs +1 -0
  23. package/dist/{TemplateReviewPanel-BKMo7Qd7.js → TemplateReviewPanel-BlUbD2GY.js} +3 -3
  24. package/dist/analytics.cjs +1 -1
  25. package/dist/analytics.js +5 -5
  26. package/dist/artifact-integrity.json +112 -114
  27. package/dist/assets-CylgPA6P.cjs +1 -0
  28. package/dist/assets-Vt10jCtl.js +136 -0
  29. package/dist/auto-D3UNXBrM.cjs +1 -0
  30. package/dist/{auto-C7udkeAa.js → auto-Hq-xgrvS.js} +28 -25
  31. package/dist/{batch-DGCt44XM.js → batch-Be_NbW7U.js} +1 -1
  32. package/dist/{batch-DYcokH4v.cjs → batch-CI4ZpuoX.cjs} +1 -1
  33. package/dist/{charts-D-Vg-ak9.cjs → charts-Cy7muNWi.cjs} +1 -1
  34. package/dist/{charts-D48XCefN.js → charts-DLTz0OEG.js} +1 -1
  35. package/dist/{computed-BQgBrma-.cjs → computed-8nFyVnok.cjs} +1 -1
  36. package/dist/{computed-CH3NYPOW.js → computed-BR_O8uAv.js} +14 -20
  37. package/dist/{data-bar-DzceAVeR.cjs → data-bar--_aPWr-W.cjs} +1 -1
  38. package/dist/{data-bar-DjOgTLqu.js → data-bar-BVnzVbE9.js} +1 -1
  39. package/dist/designer-Bc5AXS38.cjs +2 -0
  40. package/dist/designer-CZqnLTyE.js +8350 -0
  41. package/dist/designer.cjs +1 -1
  42. package/dist/designer.d.cts +108 -1
  43. package/dist/designer.d.ts +108 -1
  44. package/dist/designer.js +1 -1
  45. package/dist/{diagnostic-collector-C-JBA016.js → diagnostic-collector-CZ8DV6wA.js} +208 -186
  46. package/dist/diagnostic-collector-DwMJWEHo.cjs +1 -0
  47. package/dist/{dom-DgWc-DY1.js → dom-CbOWY7KE.js} +5 -5
  48. package/dist/dom-VuLh_fhL.cjs +1 -0
  49. package/dist/{encoding-tWc2Wn89.cjs → encoding-D0ITsCCp.cjs} +1 -1
  50. package/dist/{encoding-D480EM2r.js → encoding-TbA3oQLr.js} +2 -2
  51. package/dist/{execution-result-Ba65gieT.js → execution-result-BUPPNlaS.js} +3 -3
  52. package/dist/{execution-result-7sG_mdcD.cjs → execution-result-BgZtqlOT.cjs} +1 -1
  53. package/dist/{font-loader-CHmEwkHl.js → font-loader-BSRR-a0C.js} +1 -1
  54. package/dist/{font-loader-BIxme_9g.cjs → font-loader-BZ4CRPys.cjs} +1 -1
  55. package/dist/{grid-strokes-DsoICRjZ.js → grid-strokes-CovSH3A2.js} +1 -1
  56. package/dist/{grid-strokes-RFMR91jn.cjs → grid-strokes-G5omPT3s.cjs} +1 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.js +23 -23
  59. package/dist/{json-snapshot-BZ0CIQln.js → json-snapshot-DRQmh_k5.js} +718 -683
  60. package/dist/json-snapshot-HR8bez8j.cjs +2 -0
  61. package/dist/{matrix-CB9TqTEy.js → matrix-6wjFVN0Z.js} +149 -142
  62. package/dist/matrix-DeA6__cd.cjs +1 -0
  63. package/dist/media-IV_r4Sp7.cjs +1 -0
  64. package/dist/media-jiLdCn3i.js +208 -0
  65. package/dist/{pdf-DTR7fAIr.js → pdf-BqnoP1L_.js} +14 -15
  66. package/dist/{pdf-d9oJ6V0P.cjs → pdf-Ddm0HCuT.cjs} +48 -48
  67. package/dist/pdf.cjs +1 -1
  68. package/dist/pdf.js +2 -2
  69. package/dist/{plugin-OKDFQFS4.js → plugin-CK8Mm9VY.js} +1 -1
  70. package/dist/{plugin-B7Bi-1te.cjs → plugin-CmkPYdRI.cjs} +1 -1
  71. package/dist/{prefill-C8fF91JB.js → prefill-BqbuktRt.js} +3 -3
  72. package/dist/{prefill-C_Bf_AMo.cjs → prefill-DPLV68I7.cjs} +1 -1
  73. package/dist/prepared-Cl7C69N7.cjs +1 -0
  74. package/dist/{prepared-DhgQ0d-h.js → prepared-V7tYf1qj.js} +68 -64
  75. package/dist/{protocol-CZ-BILne.cjs → protocol-BVhKnBmX.cjs} +1 -1
  76. package/dist/{protocol-DHO91-Jt.js → protocol-Bf33Gu9J.js} +3 -3
  77. package/dist/{record-bindings-KEs-DKCS.cjs → record-bindings-DVs_g_No.cjs} +1 -1
  78. package/dist/{record-bindings-DBrCu6zO.js → record-bindings-hxJqcLSK.js} +3 -3
  79. package/dist/{region-binding-workflow-ikpY1Kbw.cjs → region-binding-workflow-Bu31bqCr.cjs} +1 -1
  80. package/dist/{region-binding-workflow-FSyIZge8.js → region-binding-workflow-DRvX25XH.js} +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-BYbIc3eJ.cjs → rich-text-layout-6VphrIcj.cjs} +1 -1
  84. package/dist/{rich-text-layout-BtygMWZC.js → rich-text-layout-BCdxMT4m.js} +1 -1
  85. package/dist/{runtime-BsvAqz4a.js → runtime-ChdUbPvs.js} +9 -9
  86. package/dist/{runtime-B5HG8poy.cjs → runtime-D2noLfgC.cjs} +1 -1
  87. package/dist/sbom.cdx.json +1 -1
  88. package/dist/server-node.cjs +5 -5
  89. package/dist/server-node.js +2099 -1959
  90. package/dist/server.cjs +1 -1
  91. package/dist/server.js +17 -13
  92. package/dist/sha256-C26wdjDi.cjs +1 -0
  93. package/dist/sha256-D-msitGX.js +166 -0
  94. package/dist/style.css +1 -1
  95. package/dist/{template-catalog-BbrN9dgu.js → template-catalog-CZfnMXKc.js} +4 -4
  96. package/dist/template-catalog-Dv4sOYaB.cjs +1 -0
  97. package/dist/{template-fragments-CUTE8-_I.js → template-fragments-BO6i19kt.js} +3 -3
  98. package/dist/{template-fragments-cyAQu7aw.cjs → template-fragments-CTfJeHoM.cjs} +1 -1
  99. package/dist/{template-registry-PSuLsnyq.js → template-registry-CIaC6qBW.js} +168 -171
  100. package/dist/template-registry-CKo-bogM.cjs +1 -0
  101. package/dist/template-serialization-Cb1ospyK.js +367 -0
  102. package/dist/template-serialization-D4Fofl9c.cjs +1 -0
  103. package/dist/{textwrap-LhJkHWb1.cjs → textwrap-BYSqmGGV.cjs} +1 -1
  104. package/dist/{textwrap-Bt_tnI6V.js → textwrap-CGjFy7gf.js} +1 -1
  105. package/dist/usePopoverBounds-C3hn7F1s.js +84 -0
  106. package/dist/usePopoverBounds-mJhJ-VqG.cjs +1 -0
  107. package/dist/vue/async.d.cts +28 -0
  108. package/dist/vue/async.d.ts +28 -0
  109. package/dist/vue/index.d.cts +36 -0
  110. package/dist/vue/index.d.ts +36 -0
  111. package/dist/vue-async.cjs +1 -1
  112. package/dist/vue-async.js +3 -3
  113. package/dist/vue.cjs +1 -1
  114. package/dist/vue.js +164 -157
  115. package/dist/{workbook-session-BJfZVp4q.cjs → workbook-session-DL3uBAl8.cjs} +1 -1
  116. package/dist/{workbook-session-DRnMjIFK.js → workbook-session-nkvroJUE.js} +2 -2
  117. package/dist/worker.cjs +1 -1
  118. package/dist/worker.js +4 -4
  119. package/dist/xlsx.cjs +4 -4
  120. package/dist/xlsx.js +28 -29
  121. package/package.json +1 -1
  122. package/dist/ExcelBindingWizard-D1LZxm93.cjs +0 -1
  123. package/dist/ParamEditor-BTIx9UDt.cjs +0 -1
  124. package/dist/ReportBatchPanel-CU2BbpBg.cjs +0 -1
  125. package/dist/ReportLabelStudio-BXKE0GVs.cjs +0 -1
  126. package/dist/ReportParamPanel-Chxu4MTx.cjs +0 -1
  127. package/dist/ReportPreview-C9c0Rp7Y.js +0 -7380
  128. package/dist/ReportPreview-CIMR4ERo.cjs +0 -6
  129. package/dist/ReportTemplateLibrary-tv1sNa78.cjs +0 -1
  130. package/dist/RuleEditor-CvyjPyR6.cjs +0 -1
  131. package/dist/TemplateOutlinePanel-hb8cKkKR.cjs +0 -1
  132. package/dist/TemplateReusePanel-CR5jF00y.cjs +0 -1
  133. package/dist/TemplateReviewPanel-BU35FHwG.cjs +0 -1
  134. package/dist/_plugin-vue_export-helper-8SL1F89S.js +0 -53
  135. package/dist/_plugin-vue_export-helper-BLmdZLlg.cjs +0 -1
  136. package/dist/assets-BFTP-0WR.js +0 -137
  137. package/dist/assets-CZiZhTf2.cjs +0 -1
  138. package/dist/auto-CXd2E2aZ.cjs +0 -1
  139. package/dist/capabilities-D8UU2clQ.cjs +0 -1
  140. package/dist/capabilities-g0a2j9Yy.js +0 -125
  141. package/dist/designer-CEMTZomv.cjs +0 -2
  142. package/dist/designer-_IKm_n5N.js +0 -8002
  143. package/dist/diagnostic-collector-wASg6Fzs.cjs +0 -1
  144. package/dist/dom-Fk4NF-gN.cjs +0 -1
  145. package/dist/json-snapshot-DGFeI30h.cjs +0 -2
  146. package/dist/matrix-CcqYOuq_.cjs +0 -1
  147. package/dist/media-B7vnpD8k.cjs +0 -1
  148. package/dist/media-Y90dHK9z.js +0 -70
  149. package/dist/prepared-BLhV7vdE.cjs +0 -1
  150. package/dist/sha256-BDQ1Qk7A.js +0 -158
  151. package/dist/sha256-DgZAKXqI.cjs +0 -1
  152. package/dist/template-catalog-DDH-5J57.cjs +0 -1
  153. package/dist/template-registry-D24Z8aQf.cjs +0 -1
  154. package/dist/template-serialization-BOUidUlh.cjs +0 -1
  155. package/dist/template-serialization-BgGWYV_1.js +0 -307
@@ -1,16 +1,16 @@
1
- import { l as ee, n as te, v as ie, c as se } from "./computed-CH3NYPOW.js";
2
- import { v as ne } from "./matrix-CB9TqTEy.js";
3
- import { J as D, E as ae, K as oe, R as fe } from "./diagnostic-collector-C-JBA016.js";
4
- import { c as re } from "./code-options-BKXXY7NI.js";
5
- import { v as de, m as he } from "./param-validation-CnDEd2l-.js";
6
- import { a as ue, d as ce, b as me, M as K, v as ge, s as pe } from "./template-serialization-BgGWYV_1.js";
7
- function ye(e, i, t) {
1
+ import { l as Z, n as ee, v as te, c as ie } from "./computed-BR_O8uAv.js";
2
+ import { v as se } from "./matrix-6wjFVN0Z.js";
3
+ import { J as D, E as ne, K as ae, R as oe } from "./diagnostic-collector-CZ8DV6wA.js";
4
+ import { c as fe } from "./code-options-BKXXY7NI.js";
5
+ import { v as re, m as de } from "./param-validation-CnDEd2l-.js";
6
+ import { a as he, d as ue, b as ce, M as K, v as me, s as ge } from "./template-serialization-Cb1ospyK.js";
7
+ function pe(e, i, t) {
8
8
  e !== void 0 && (typeof e != "string" || !e.trim() || e.length > 4096) && t.push({ path: i, message: "来源范围应为不超过 4096 字符的非空字符串" });
9
9
  }
10
10
  function V(e, i, t) {
11
11
  e.editable !== void 0 && typeof e.editable != "boolean" && t.push({ path: `${i}.editable`, message: "编辑控制应为布尔值" }), e.valueType !== void 0 && !["text", "number", "boolean"].includes(e.valueType) && t.push({ path: `${i}.valueType`, message: "编辑类型应为 text、number 或 boolean" });
12
12
  }
13
- function le(e, i, t) {
13
+ function ye(e, i, t) {
14
14
  V(e, i, t), e.indentMm !== void 0 && (typeof e.indentMm != "number" || !Number.isFinite(e.indentMm) || e.indentMm < 0) && t.push({ path: `${i}.indentMm`, message: "单元格缩进应为有限非负数" }), e.derived !== void 0 && typeof e.derived != "boolean" && t.push({ path: `${i}.derived`, message: "派生结果标记应为布尔值" }), H(e.source, `${i}.source`, t, !0), e.formula !== void 0 && typeof e.formula != "string" && t.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
15
15
  }
16
16
  function H(e, i, t, s = !1) {
@@ -20,7 +20,7 @@ function H(e, i, t, s = !1) {
20
20
  return;
21
21
  }
22
22
  const n = e;
23
- ye(n.sourceScope, `${i}.sourceScope`, t);
23
+ pe(n.sourceScope, `${i}.sourceScope`, t);
24
24
  for (const a of ["datasetId", ...s ? ["field"] : []])
25
25
  (typeof n[a] != "string" || !n[a].trim()) && t.push({ path: `${i}.${a}`, message: "业务标识应为非空字符串" });
26
26
  for (const a of ["rowKey", "revision"]) {
@@ -29,7 +29,7 @@ function H(e, i, t, s = !1) {
29
29
  }
30
30
  n.sourceToken !== void 0 && typeof n.sourceToken != "string" && t.push({ path: `${i}.sourceToken`, message: "来源令牌应为字符串" });
31
31
  }
32
- const $e = /* @__PURE__ */ new Set([
32
+ const le = /* @__PURE__ */ new Set([
33
33
  "text",
34
34
  "image",
35
35
  "barcode",
@@ -42,14 +42,14 @@ const $e = /* @__PURE__ */ new Set([
42
42
  function p(e) {
43
43
  return typeof e == "object" && e !== null && !Array.isArray(e);
44
44
  }
45
- function v(e) {
45
+ function S(e) {
46
46
  return e === null ? "null" : typeof e == "string" ? JSON.stringify(e.slice(0, 120)) : ["number", "boolean", "undefined"].includes(typeof e) ? String(e) : `[${typeof e}]`;
47
47
  }
48
- function be(e, i, t, s) {
48
+ function $e(e, i, t, s) {
49
49
  const n = e[i];
50
- (typeof n != "number" || !Number.isFinite(n)) && s.push({ path: `${t}.${i}`, message: `应为有限数字,实际 ${v(n)}` });
50
+ (typeof n != "number" || !Number.isFinite(n)) && s.push({ path: `${t}.${i}`, message: `应为有限数字,实际 ${S(n)}` });
51
51
  }
52
- function Ae(e, i, t) {
52
+ function be(e, i, t) {
53
53
  if (e !== void 0) {
54
54
  const s = `${i}.table`;
55
55
  if (!p(e)) t.push({ path: s, message: "逻辑表来源应为对象" });
@@ -62,7 +62,7 @@ function Ae(e, i, t) {
62
62
  }
63
63
  }
64
64
  }
65
- function we(e, i, t, s) {
65
+ function Ae(e, i, t, s) {
66
66
  if (e !== void 0)
67
67
  if (!p(e) || !Array.isArray(e.cells))
68
68
  t.push({ path: `${i}.grid.cells`, message: "grid.cells 应为二维数组" });
@@ -80,8 +80,8 @@ function we(e, i, t, s) {
80
80
  t.push({ path: d, message: "网格单元格应为对象或 null" });
81
81
  return;
82
82
  }
83
- le(f, d, t), f.dataBar !== void 0 && !ae(f.dataBar) && t.push({ path: `${d}.dataBar`, message: "数据条应包含 0–1 有序比例与 #RRGGBB 颜色" }), J(f.richParagraphs, d, t), Array.isArray(f.children) && f.children.forEach((h, m) => {
84
- O(h, `${i}.grid.cells.${o}.${r}.children.${m}`, t, s);
83
+ ye(f, d, t), f.dataBar !== void 0 && !ne(f.dataBar) && t.push({ path: `${d}.dataBar`, message: "数据条应包含 0–1 有序比例与 #RRGGBB 颜色" }), J(f.richParagraphs, d, t), Array.isArray(f.children) && f.children.forEach((h, m) => {
84
+ _(h, `${i}.grid.cells.${o}.${r}.children.${m}`, t, s);
85
85
  });
86
86
  });
87
87
  });
@@ -96,7 +96,7 @@ function F(e, i, t, s, n = 0) {
96
96
  o !== void 0 && (typeof o != "number" || !Number.isFinite(o) || o < n) && s.push({ path: `${t}.${a}`, message: "富文本数值应为范围内有限数字" });
97
97
  }
98
98
  }
99
- function Me(e, i, t) {
99
+ function we(e, i, t) {
100
100
  if (e !== void 0) {
101
101
  if (!p(e)) {
102
102
  t.push({ path: i, message: "富文本样式应为对象" });
@@ -109,7 +109,7 @@ function Me(e, i, t) {
109
109
  F(e, ["fontSize", "fontSizePx", "lineWidthPt", "lineHeight", "opacity"], i, t), F(e, ["letterSpacing", "rotateDeg"], i, t, -1 / 0), typeof e.opacity == "number" && e.opacity > 1 && t.push({ path: `${i}.opacity`, message: "透明度不能大于1" }), N(e.align, ["left", "center", "right", "justify"], `${i}.align`, t), N(e.verticalAlign, ["top", "middle", "bottom"], `${i}.verticalAlign`, t);
110
110
  }
111
111
  }
112
- function ke(e, i, t) {
112
+ function Me(e, i, t) {
113
113
  if (!p(e)) {
114
114
  t.push({ path: i, message: "富文本片段应为对象" });
115
115
  return;
@@ -117,7 +117,7 @@ function ke(e, i, t) {
117
117
  N(e.kind, ["text", "field"], `${i}.kind`, t);
118
118
  for (const s of ["text", "field"])
119
119
  e[s] !== void 0 && typeof e[s] != "string" && t.push({ path: `${i}.${s}`, message: "富文本内容应为字符串" });
120
- Me(e.style, `${i}.style`, t);
120
+ we(e.style, `${i}.style`, t);
121
121
  }
122
122
  function J(e, i, t) {
123
123
  if (e !== void 0) {
@@ -131,7 +131,7 @@ function J(e, i, t) {
131
131
  t.push({ path: a, message: "段落缺少 segments 数组" });
132
132
  return;
133
133
  }
134
- N(s.align, ["left", "center", "right", "justify"], `${a}.align`, t), F(s, ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"], a, t), s.segments.forEach((o, f) => ke(o, `${a}.segments.${f}`, t));
134
+ N(s.align, ["left", "center", "right", "justify"], `${a}.align`, t), F(s, ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"], a, t), s.segments.forEach((o, f) => Me(o, `${a}.segments.${f}`, t));
135
135
  });
136
136
  }
137
137
  }
@@ -141,37 +141,37 @@ function W(e, i, t, s = []) {
141
141
  t.push(n);
142
142
  return;
143
143
  }
144
- O(e, i, t, s);
144
+ _(e, i, t, s);
145
145
  }
146
- function O(e, i, t, s = []) {
146
+ function _(e, i, t, s = []) {
147
147
  if (!p(e)) {
148
148
  t.push({ path: i, message: "组件应为对象" });
149
149
  return;
150
150
  }
151
151
  const n = e.kind;
152
- typeof n != "string" ? t.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : $e.has(n) || s.push({
152
+ typeof n != "string" ? t.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : le.has(n) || s.push({
153
153
  path: `${i}.kind`,
154
- message: `未知组件类型 ${v(n)},将以兜底方式渲染`
154
+ message: `未知组件类型 ${S(n)},将以兜底方式渲染`
155
155
  });
156
156
  for (const a of ["leftMm", "topMm", "widthMm", "heightMm"])
157
- be(e, a, i, t);
157
+ $e(e, a, i, t);
158
158
  typeof e.leftMm == "number" && e.leftMm < -100 && t.push({ path: `${i}.leftMm`, message: "几何数值异常(leftMm<-100)" });
159
159
  for (const a of ["widthMm", "heightMm"])
160
160
  typeof e[a] == "number" && e[a] < 0 && t.push({ path: `${i}.${a}`, message: "组件尺寸不能为负数" });
161
- Ae(e.table, i, t), Se(e.code, n, i, t), Ee(e, i, t), e.pageAnchor !== void 0 && !["header", "footer"].includes(e.pageAnchor) && t.push({ path: `${i}.pageAnchor`, message: "页面锚点应为 header 或 footer" }), e.lineDirection !== void 0 && !["down", "up"].includes(e.lineDirection) && t.push({ path: `${i}.lineDirection`, message: "线段方向应为 down 或 up" }), we(e.grid, i, t, s), J(e.richParagraphs, i, t);
161
+ be(e.table, i, t), Ee(e.code, n, i, t), ke(e, i, t), e.pageAnchor !== void 0 && !["header", "footer"].includes(e.pageAnchor) && t.push({ path: `${i}.pageAnchor`, message: "页面锚点应为 header 或 footer" }), e.lineDirection !== void 0 && !["down", "up"].includes(e.lineDirection) && t.push({ path: `${i}.lineDirection`, message: "线段方向应为 down 或 up" }), Ae(e.grid, i, t, s), J(e.richParagraphs, i, t);
162
162
  }
163
- function Ee(e, i, t) {
163
+ function ke(e, i, t) {
164
164
  if (e.chartBinding !== void 0)
165
165
  try {
166
- if (ee(e.chartBinding), e.kind !== "chart" || ["binding", "imageData", "grid", "pageAnchor"].some((s) => e[s] !== void 0)) throw new Error("绑定图表不能设置图片、网格、记录绑定或页眉页脚");
166
+ if (Z(e.chartBinding), e.kind !== "chart" || ["binding", "imageData", "grid", "pageAnchor"].some((s) => e[s] !== void 0)) throw new Error("绑定图表不能设置图片、网格、记录绑定或页眉页脚");
167
167
  if (typeof e.widthMm != "number" || e.widthMm < 45 || typeof e.heightMm != "number" || e.heightMm < 35) throw new Error("绑定图表至少需要 45×35mm");
168
168
  } catch (s) {
169
169
  t.push({ path: `${i}.chartBinding`, message: s instanceof Error ? s.message : String(s) });
170
170
  }
171
171
  }
172
- function Se(e, i, t, s) {
172
+ function Ee(e, i, t, s) {
173
173
  if (e !== void 0)
174
- for (const n of re(e, i)) s.push({ path: `${t}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
174
+ for (const n of fe(e, i)) s.push({ path: `${t}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
175
175
  }
176
176
  function G(e, i, t) {
177
177
  if (!p(e)) return;
@@ -189,7 +189,7 @@ function ve(e, i, t, s = []) {
189
189
  return;
190
190
  }
191
191
  const n = e.pageWidthMm, a = e.pageHeightMm;
192
- (typeof n != "number" || !Number.isFinite(n) || n <= 0) && t.push({ path: `${i}.pageWidthMm`, message: `页宽非法: ${v(n)}` }), (typeof a != "number" || !(a > 0 && a < 5e3)) && t.push({ path: `${i}.pageHeightMm`, message: `页高非法: ${v(a)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" });
192
+ (typeof n != "number" || !Number.isFinite(n) || n <= 0) && t.push({ path: `${i}.pageWidthMm`, message: `页宽非法: ${S(n)}` }), (typeof a != "number" || !(a > 0 && a < 5e3)) && t.push({ path: `${i}.pageHeightMm`, message: `页高非法: ${S(a)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" });
193
193
  const o = e.components;
194
194
  if (!Array.isArray(o))
195
195
  t.push({ path: `${i}.components`, message: "components 应为数组" });
@@ -200,11 +200,11 @@ function ve(e, i, t, s = []) {
200
200
  return;
201
201
  }
202
202
  o.forEach((r, d) => {
203
- O(r, `${i}.components.${d}`, t, s), G(r, `${i}.components.${d}`, t);
203
+ _(r, `${i}.components.${d}`, t, s), G(r, `${i}.components.${d}`, t);
204
204
  });
205
205
  }
206
206
  }
207
- function Ne(e) {
207
+ function Se(e) {
208
208
  const i = [], t = [], s = p(e) ? e.pages : void 0;
209
209
  if (p(e) && e.requiresRecalculation !== void 0 && typeof e.requiresRecalculation != "boolean" && i.push({ path: "$.requiresRecalculation", message: "重算能力要求应为布尔值" }), !Array.isArray(s))
210
210
  i.push({
@@ -212,7 +212,7 @@ function Ne(e) {
212
212
  message: e == null ? "渲染计划为空" : "渲染计划缺少 pages 数组"
213
213
  });
214
214
  else {
215
- const n = oe(s);
215
+ const n = ae(s);
216
216
  if (n) return { ok: !1, errors: [...i, n], warnings: t };
217
217
  s.forEach((o, f) => ve(o, `$.pages.${f}`, i, t)), s.length > 2e3 && t.push({
218
218
  path: "$.pages",
@@ -229,72 +229,70 @@ function Ne(e) {
229
229
  }
230
230
  return { ok: i.length === 0, errors: i, warnings: t };
231
231
  }
232
- function mt(e) {
233
- const i = Ne(e);
232
+ function gt(e) {
233
+ const i = Se(e);
234
234
  if (!i.ok) {
235
235
  const t = i.errors.slice(0, 3).map((s) => `${s.path}: ${s.message}`).join("; ");
236
236
  throw new Error(`渲染计划校验失败(${i.errors.length} 处): ${t}`);
237
237
  }
238
238
  return e.pages;
239
239
  }
240
- function U(e) {
240
+ function Ne(e) {
241
241
  return e.kind === "list" ? e.id : e.nid;
242
242
  }
243
- function z(e) {
243
+ function xe(e) {
244
244
  return e.kind === "list" ? !1 : e.pageAnchor !== void 0 || e.kind === "text" && typeof e.text == "string" && /\{(?:page|totalPages)\}/.test(e.text);
245
245
  }
246
- function xe(e, i) {
246
+ function Re(e, i) {
247
247
  if (e.filter((s) => s.kind === "list" && s.cardinality !== "record").length && e.length !== 1) throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");
248
248
  for (const s of e) {
249
249
  const n = s.kind === "list" ? s.topMm + (s.rowHeightMm ?? 0) : s.topMm + s.heightMm;
250
250
  if (s.topMm < i.topMm - 1e-3 || n > i.topMm + i.heightMm + 1e-3) throw new Error("流式分段应完整包含其组件的原始纵向范围");
251
251
  }
252
252
  }
253
- function gt(e, i) {
254
- if (!i) return e.map((s) => ({ components: [s] }));
255
- const t = new Map(e.filter((s) => !z(s)).map((s) => [U(s), s]));
256
- return i.bands.map((s) => ({ band: s, components: s.componentIds.map((n) => {
257
- const a = t.get(n);
258
- if (!a) throw new Error(`流式区域引用不存在的组件:${n}`);
259
- return a;
260
- }) }));
253
+ function Te(e, i) {
254
+ U(e, i);
261
255
  }
262
- function Re(e, i) {
256
+ function pt(e, i) {
257
+ const t = [];
258
+ return U(e, i, t), t;
259
+ }
260
+ function U(e, i, t) {
263
261
  if (!i || !Array.isArray(i.bands) || !i.bands.length || i.bands.length > 1e4) throw new Error("流式排版应包含 1–10000 个区域");
264
- const t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
265
- for (const n of e) {
266
- if (z(n)) continue;
267
- const a = U(n);
268
- if (!a || t.has(a)) throw new Error("流式排版组件应具有唯一标识");
269
- t.set(a, n);
270
- }
271
- if (Te(i, t, s), s.size !== t.size) throw new Error("流式排版必须显式包含每个非锚点组件");
272
- }
273
- function Te(e, i, t) {
274
- let s = -1 / 0;
275
- for (const n of e.bands) {
276
- if (!Number.isFinite(n.topMm) || !Number.isFinite(n.heightMm) || n.topMm < 0 || n.heightMm <= 0 || n.topMm < s - 1e-3) throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");
277
- if (!Array.isArray(n.componentIds) || !n.componentIds.length) throw new Error("流式区域不能没有组件");
278
- const a = [];
279
- for (const o of n.componentIds) {
280
- const f = i.get(o);
281
- if (!f || t.has(o)) throw new Error(`流式区域组件缺失、重复或包含页锚点:${o}`);
282
- t.add(o), a.push(f);
262
+ const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
263
+ for (const a of e) {
264
+ if (xe(a)) continue;
265
+ const o = Ne(a);
266
+ if (!o || s.has(o)) throw new Error("流式排版组件应具有唯一标识");
267
+ s.set(o, a);
268
+ }
269
+ if (Fe(i, s, n, t), n.size !== s.size) throw new Error("流式排版必须显式包含每个非锚点组件");
270
+ }
271
+ function Fe(e, i, t, s) {
272
+ let n = -1 / 0;
273
+ for (const a of e.bands) {
274
+ if (!Number.isFinite(a.topMm) || !Number.isFinite(a.heightMm) || a.topMm < 0 || a.heightMm <= 0 || a.topMm < n - 1e-3) throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");
275
+ if (!Array.isArray(a.componentIds) || !a.componentIds.length) throw new Error("流式区域不能没有组件");
276
+ const o = [];
277
+ for (const f of a.componentIds) {
278
+ const r = i.get(f);
279
+ if (!r || t.has(f)) throw new Error(`流式区域组件缺失、重复或包含页锚点:${f}`);
280
+ t.add(f), o.push(r);
283
281
  }
284
- xe(a, n), s = n.topMm + n.heightMm;
282
+ Re(o, a), s?.push({ band: a, components: o }), n = a.topMm + a.heightMm;
285
283
  }
286
284
  }
287
- const Fe = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
285
+ const Ce = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
288
286
  function $(e) {
289
287
  return !!e && typeof e == "object" && !Array.isArray(e);
290
288
  }
291
289
  function k(e) {
292
- return typeof e == "string" && !!e.trim() && !Fe.has(e);
290
+ return typeof e == "string" && !!e.trim() && !Ce.has(e);
293
291
  }
294
292
  function x(e, i, t, s) {
295
293
  for (const n of Object.keys(e)) i.includes(n) || s.push({ path: `${t}.${n}`, message: "存在未知配置字段" });
296
294
  }
297
- function Ce(e, i, t) {
295
+ function Pe(e, i, t) {
298
296
  if (e !== void 0) {
299
297
  if (!$(e) || !["number", "percent", "date"].includes(String(e.kind))) {
300
298
  t.push({ path: i, message: "绑定格式应为 number、percent 或 date" });
@@ -303,7 +301,7 @@ function Ce(e, i, t) {
303
301
  x(e, e.kind === "date" ? ["kind", "pattern"] : e.kind === "number" ? ["kind", "digits", "thousands"] : ["kind", "digits"], i, t), e.digits !== void 0 && (!Number.isInteger(e.digits) || Number(e.digits) < 0 || Number(e.digits) > 100) && t.push({ path: `${i}.digits`, message: "精度应为 0..100 整数" }), e.thousands !== void 0 && typeof e.thousands != "boolean" && t.push({ path: `${i}.thousands`, message: "千分位开关应为布尔值" }), e.pattern !== void 0 && typeof e.pattern != "string" && t.push({ path: `${i}.pattern`, message: "日期格式应为字符串" });
304
302
  }
305
303
  }
306
- function Pe(e, i, t) {
304
+ function Oe(e, i, t) {
307
305
  const s = e.binding;
308
306
  if (s === void 0) return;
309
307
  const n = `${i}.binding`;
@@ -313,9 +311,9 @@ function Pe(e, i, t) {
313
311
  }
314
312
  (!["text", "image", "barcode", "qrcode"].includes(String(e.kind)) || e.grid !== void 0) && t.push({ path: n, message: "绑定仅支持独立文本、图片、条码与二维码组件" }), x(s, ["field", "format", "prefix", "suffix", "emptyText"], n, t), k(s.field) || t.push({ path: `${n}.field`, message: "绑定字段应为安全的非空字段名(按字面读取自有字段)" });
315
313
  for (const a of ["prefix", "suffix", "emptyText"]) s[a] !== void 0 && typeof s[a] != "string" && t.push({ path: `${n}.${a}`, message: "应为字符串" });
316
- Ce(s.format, `${n}.format`, t), e.kind === "image" && ["format", "prefix", "suffix"].some((a) => s[a] !== void 0) && t.push({ path: n, message: "图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀" });
314
+ Pe(s.format, `${n}.format`, t), e.kind === "image" && ["format", "prefix", "suffix"].some((a) => s[a] !== void 0) && t.push({ path: n, message: "图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀" });
317
315
  }
318
- function Ie(e, i) {
316
+ function _e(e, i) {
319
317
  if (!$(e)) {
320
318
  i.push({ path: "$.repeat", message: "逐记录配置应为对象" });
321
319
  return;
@@ -324,41 +322,41 @@ function Ie(e, i) {
324
322
  const t = e.copies;
325
323
  t !== void 0 && ($(t) ? (x(t, ["field"], "$.repeat.copies", i), k(t.field) || i.push({ path: "$.repeat.copies.field", message: "复制数字段应为安全的非空字段名" })) : (!Number.isSafeInteger(t) || Number(t) < 1 || Number(t) > 1e3) && i.push({ path: "$.repeat.copies", message: "每条记录复制数应为 1..1000 整数" }));
326
324
  }
327
- function q(e, i, t, s) {
325
+ function z(e, i, t, s) {
328
326
  if (!$(e)) return;
329
- Pe(e, i, s), e.binding !== void 0 && !t && s.push({ path: `${i}.binding`, message: "字段绑定需要模板 repeat 数据集;普通报表请使用列表字段" }), t && e.kind === "list" && s.push({ path: i, message: "逐记录标签使用固定组件;动态列表请使用普通报表模板" }), e.chartBinding !== void 0 && (t || i.includes(".children.")) && s.push({ path: `${i}.chartBinding`, message: "数据图表应放在普通报表的页面或流式分区,不放在逐记录标签或嵌套单元格内" });
327
+ Oe(e, i, s), e.binding !== void 0 && !t && s.push({ path: `${i}.binding`, message: "字段绑定需要模板 repeat 数据集;普通报表请使用列表字段" }), t && e.kind === "list" && s.push({ path: i, message: "逐记录标签使用固定组件;动态列表请使用普通报表模板" }), e.chartBinding !== void 0 && (t || i.includes(".children.")) && s.push({ path: `${i}.chartBinding`, message: "数据图表应放在普通报表的页面或流式分区,不放在逐记录标签或嵌套单元格内" });
330
328
  const n = e.grid;
331
329
  $(n) && Array.isArray(n.cells) && n.cells.forEach((a, o) => {
332
330
  Array.isArray(a) && a.forEach((f, r) => {
333
- $(f) && Array.isArray(f.children) && f.children.forEach((d, h) => q(d, `${i}.grid.cells.${o}.${r}.children.${h}`, t, s));
331
+ $(f) && Array.isArray(f.children) && f.children.forEach((d, h) => z(d, `${i}.grid.cells.${o}.${r}.children.${h}`, t, s));
334
332
  });
335
333
  });
336
334
  }
337
- function Oe(e, i) {
335
+ function Ie(e, i) {
338
336
  const t = e.repeat !== void 0;
339
- t && Ie(e.repeat, i), Array.isArray(e.pages) && e.pages.forEach((s, n) => {
337
+ t && _e(e.repeat, i), Array.isArray(e.pages) && e.pages.forEach((s, n) => {
340
338
  if (!$(s)) return;
341
339
  const a = `$.pages.${n}`;
342
340
  t && (s.layout === "wide" || s.flow !== void 0) && i.push({ path: a, message: "逐记录标签仅支持固定尺寸页面,不支持宽表或流式分区" }), Array.isArray(s.components) && s.components.forEach((o, f) => {
343
341
  const r = `${a}.components.${f}`;
344
- if (q(o, r, t, i), !t || !$(o)) return;
342
+ if (z(o, r, t, i), !t || !$(o)) return;
345
343
  const { leftMm: d, topMm: h, widthMm: m, heightMm: y } = o;
346
344
  [d, h, m, y, s.widthMm, s.heightMm].every((l) => typeof l == "number" && Number.isFinite(l)) && (Number(d) < 0 || Number(h) < 0 || Number(d) + Number(m) > Number(s.widthMm) + 1e-3 || Number(h) + Number(y) > Number(s.heightMm) + 1e-3) && i.push({ path: r, message: "标签组件超出纸张边界,请调整位置或尺寸" });
347
345
  });
348
346
  });
349
347
  }
350
- function _e(e) {
348
+ function Le(e) {
351
349
  return !!e && typeof e == "object" && !Array.isArray(e);
352
350
  }
353
351
  function C(e, i, t) {
354
352
  if (e !== void 0)
355
353
  try {
356
- te(e);
354
+ ee(e);
357
355
  } catch (s) {
358
356
  t.push({ path: i, message: s instanceof Error ? s.message : String(s) });
359
357
  }
360
358
  }
361
- function X(e, i, t) {
359
+ function q(e, i, t) {
362
360
  if (e === void 0) return;
363
361
  if (!Array.isArray(e) || e.length > 2048) {
364
362
  t.push({ path: i, message: "聚合应为数组且最多 2048 项" });
@@ -367,7 +365,7 @@ function X(e, i, t) {
367
365
  const s = /* @__PURE__ */ new Set();
368
366
  e.forEach((n, a) => {
369
367
  const o = `${i}.${a}`;
370
- if (!_e(n)) {
368
+ if (!Le(n)) {
371
369
  t.push({ path: o, message: "聚合应为对象" });
372
370
  return;
373
371
  }
@@ -383,7 +381,7 @@ function X(e, i, t) {
383
381
  message: "小数位应为 0–100 的整数"
384
382
  });
385
383
  try {
386
- se({
384
+ ie({
387
385
  ...n,
388
386
  field: n.valueField ?? f
389
387
  });
@@ -395,15 +393,15 @@ function X(e, i, t) {
395
393
  }
396
394
  });
397
395
  }
398
- function Le(e, i, t) {
396
+ function je(e, i, t) {
399
397
  if (e === void 0) return;
400
- const s = ie(e);
398
+ const s = te(e);
401
399
  for (const n of s.errors) t.push({ path: i, message: n });
402
400
  }
403
- function je(e, i, t) {
401
+ function Be(e, i, t) {
404
402
  if (e !== void 0)
405
403
  try {
406
- ne(e);
404
+ se(e);
407
405
  } catch (s) {
408
406
  t.push({
409
407
  path: i,
@@ -411,28 +409,28 @@ function je(e, i, t) {
411
409
  });
412
410
  }
413
411
  }
414
- function Be(e, i, t) {
412
+ function De(e, i, t) {
415
413
  if (e.tree === void 0) return;
416
414
  const s = `${i}.tree`;
417
415
  try {
418
- ue(e.tree);
416
+ he(e.tree);
419
417
  const n = e.tree;
420
418
  if (e.matrix || e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.rowVisibleWhen) throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");
421
419
  if (e.rowKey !== void 0 && e.rowKey !== n.idField) throw new Error("树形 rowKey 应与 idField 一致");
422
420
  if (!Array.isArray(e.columns) || !e.columns.some((a) => a && a.field === n.labelField && !a.hidden)) throw new Error("树形布局需要可见的标签列");
423
- Array.isArray(e.computed) && ce(n, e.computed);
421
+ Array.isArray(e.computed) && ue(n, e.computed);
424
422
  } catch (n) {
425
423
  t.push({ path: s, message: n instanceof Error ? n.message : String(n) });
426
424
  }
427
425
  }
428
- const De = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), Ke = /* @__PURE__ */ new Set(["text", "number", "boolean", "date", "decimal"]);
426
+ const Ke = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), Ve = /* @__PURE__ */ new Set(["text", "number", "boolean", "date", "decimal"]);
429
427
  function E(e) {
430
428
  return !!e && typeof e == "object" && !Array.isArray(e);
431
429
  }
432
430
  function P(e) {
433
- return typeof e == "string" && !!e.trim() && e.length <= 4096 && !De.has(e);
431
+ return typeof e == "string" && !!e.trim() && e.length <= 4096 && !Ke.has(e);
434
432
  }
435
- function Ve(e, i, t) {
433
+ function He(e, i, t) {
436
434
  if (!Array.isArray(e) || !e.length || e.length > 2048) {
437
435
  t.push({ path: i, message: "绑定契约应包含 1–2048 个字段" });
438
436
  return;
@@ -447,10 +445,10 @@ function Ve(e, i, t) {
447
445
  s.add(n.field);
448
446
  for (const f of ["label", "semanticKey", "unit"])
449
447
  n[f] !== void 0 && (typeof n[f] != "string" || String(n[f]).length > 4096) && t.push({ path: `${o}.${f}`, message: "应为不超过 4096 位的字符串" });
450
- n.type !== void 0 && !Ke.has(String(n.type)) && t.push({ path: `${o}.type`, message: "未知绑定字段类型" });
448
+ n.type !== void 0 && !Ve.has(String(n.type)) && t.push({ path: `${o}.type`, message: "未知绑定字段类型" });
451
449
  });
452
450
  }
453
- function I(e, i, t) {
451
+ function O(e, i, t) {
454
452
  if (e === void 0) return;
455
453
  if (!E(e) || !E(e.datasets)) {
456
454
  t.push({ path: i, message: "模板数据契约应声明 datasets" });
@@ -461,25 +459,25 @@ function I(e, i, t) {
461
459
  (!s.length || s.length > 256) && t.push({ path: `${i}.datasets`, message: "应声明 1–256 个数据集" });
462
460
  for (const [n, a] of s) {
463
461
  const o = `${i}.datasets.${n}`;
464
- !P(n) || !E(a) ? t.push({ path: o, message: "数据集应使用安全名称和字段契约" }) : Ve(a.fields, `${o}.fields`, t);
462
+ !P(n) || !E(a) ? t.push({ path: o, message: "数据集应使用安全名称和字段契约" }) : He(a.fields, `${o}.fields`, t);
465
463
  }
466
464
  }
467
465
  function j(e, i) {
468
466
  return new Map(e.datasets[i]?.fields.map((t) => [t.field, t]) ?? []);
469
467
  }
470
- function He(e, i, t, s) {
468
+ function Je(e, i, t, s) {
471
469
  const n = e.label || e.field;
472
470
  for (const [a, o, f] of [["semanticKey", "semantic", "业务含义"], ["type", "type", "类型"], ["unit", "unit", "单位"]])
473
471
  e[a] !== i[a] && (e[a] !== void 0 || i[a] !== void 0) && s.push({ ...t, code: o, message: `字段“${n}”的${f}不兼容(${e[a] ?? "未声明"} → ${i[a] ?? "未声明"}),请重新绑定` });
474
472
  }
475
- function pt(e, i) {
473
+ function yt(e, i) {
476
474
  const t = [], s = [];
477
- if (I(i, "$.target", s), I(e.dataContract, "$.template.dataContract", s), s.length) return { ok: !1, issues: s.map((o) => ({ ...o, code: "contract" })) };
475
+ if (O(i, "$.target", s), O(e.dataContract, "$.template.dataContract", s), s.length) return { ok: !1, issues: s.map((o) => ({ ...o, code: "contract" })) };
478
476
  const n = e.dataContract;
479
477
  if (!n) return { ok: !1, issues: [{ code: "contract", path: "$.template.dataContract", message: "模板未声明数据来源,请核对业务字段并重新绑定" }] };
480
478
  n.source !== i.source && t.push({ code: "source", path: "$.template.dataContract.source", message: `模板来源与当前报表不一致(${n.source ?? "未声明"} → ${i.source ?? "未声明"}),请从当前报表创建或重新绑定模板` });
481
479
  const a = /* @__PURE__ */ new Set();
482
- for (const o of me(e)) {
480
+ for (const o of ce(e)) {
483
481
  const f = j(n, o.dataset), r = j(i, o.dataset);
484
482
  if (!f.size || !r.size) {
485
483
  t.push({ code: "dataset", dataset: o.dataset, path: o.path, message: `数据集“${o.dataset}”缺少来源或目标字段契约` });
@@ -491,22 +489,22 @@ function pt(e, i) {
491
489
  if (a.has(h)) continue;
492
490
  a.add(h);
493
491
  const m = f.get(d.field), y = r.get(d.field), l = { ...d, dataset: o.dataset };
494
- !m || !y ? t.push({ ...l, code: "field", message: `数据集“${o.dataset}”的字段“${d.field}”未声明,请重新绑定` }) : He(m, y, l, t);
492
+ !m || !y ? t.push({ ...l, code: "field", message: `数据集“${o.dataset}”的字段“${d.field}”未声明,请重新绑定` }) : Je(m, y, l, t);
495
493
  }
496
494
  }
497
495
  return { ok: t.length === 0, issues: t };
498
496
  }
499
- const Y = "1.0";
497
+ const X = "1.0";
500
498
  class w extends Error {
501
499
  constructor(i) {
502
500
  super(`模板校验失败:${i.slice(0, 3).map((t) => `${t.path}: ${t.message}`).join("; ")}`), this.errors = i, this.name = "ReportTemplateError";
503
501
  }
504
502
  }
505
- const Je = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), We = /* @__PURE__ */ new Set(["schemaVersion", "id", "name", "revision", "description", "template"]), Ge = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), S = 2e5, Ue = 64;
503
+ const We = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), Ge = /* @__PURE__ */ new Set(["schemaVersion", "id", "name", "revision", "description", "template"]), Ue = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), v = 2e5, ze = 64;
506
504
  function u(e) {
507
505
  return !!e && typeof e == "object" && !Array.isArray(e);
508
506
  }
509
- function ze(e, i, t) {
507
+ function qe(e, i, t) {
510
508
  const s = Object.getPrototypeOf(e), n = Array.isArray(e);
511
509
  if (n ? s !== Array.prototype : s !== Object.prototype && s !== null)
512
510
  return t.push({ path: i, message: "模板对象必须使用普通 JSON 对象原型" }), !1;
@@ -517,22 +515,22 @@ function ze(e, i, t) {
517
515
  }
518
516
  return Object.getOwnPropertySymbols(e).length > 0 ? (t.push({ path: i, message: "模板不能包含 Symbol 键" }), !1) : !0;
519
517
  }
520
- function qe(e, i, t, s) {
521
- return Je.has(e) ? (s.push({ path: t, message: "模板不能包含可能污染原型的键" }), !1) : i.get || i.set || !i.enumerable ? (s.push({ path: t, message: "模板不能包含访问器或不可枚举字段" }), !1) : !0;
518
+ function Xe(e, i, t, s) {
519
+ return We.has(e) ? (s.push({ path: t, message: "模板不能包含可能污染原型的键" }), !1) : i.get || i.set || !i.enumerable ? (s.push({ path: t, message: "模板不能包含访问器或不可枚举字段" }), !1) : !0;
522
520
  }
523
- function Xe(e) {
521
+ function Ye(e) {
524
522
  return e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
525
523
  }
526
- function _(e, i) {
524
+ function I(e, i) {
527
525
  const t = /* @__PURE__ */ new Set();
528
526
  let s = 0, n = 0, a = !1;
529
527
  const o = (f, r, d) => {
530
528
  if (!a) {
531
- if (++s > S) {
532
- s === S + 1 && i.push({ path: r, message: "模板超过 JSON 节点安全上限" });
529
+ if (++s > v) {
530
+ s === v + 1 && i.push({ path: r, message: "模板超过 JSON 节点安全上限" });
533
531
  return;
534
532
  }
535
- if (d > Ue) {
533
+ if (d > ze) {
536
534
  i.push({ path: r, message: "模板嵌套层级过深" });
537
535
  return;
538
536
  }
@@ -540,7 +538,7 @@ function _(e, i) {
540
538
  n += f.length, n > K && (a = !0, i.push({ path: r, message: "模板文本超过 1000 万字符的安全上限" }));
541
539
  return;
542
540
  }
543
- if (!Xe(f)) {
541
+ if (!Ye(f)) {
544
542
  if (!f || typeof f != "object") {
545
543
  i.push({ path: r, message: "模板只允许 JSON 值,不允许函数、undefined 或非有限数字" });
546
544
  return;
@@ -549,12 +547,12 @@ function _(e, i) {
549
547
  i.push({ path: r, message: "模板不能包含循环引用" });
550
548
  return;
551
549
  }
552
- if (ze(f, r, i)) {
550
+ if (qe(f, r, i)) {
553
551
  t.add(f);
554
552
  for (const [h, m] of Object.entries(Object.getOwnPropertyDescriptors(f))) {
555
553
  if (Array.isArray(f) && h === "length") continue;
556
554
  const y = `${r}.${h}`;
557
- if (qe(h, m, y, i) && o(m.value, y, d + 1), s > S || a) break;
555
+ if (Xe(h, m, y, i) && o(m.value, y, d + 1), s > v || a) break;
558
556
  }
559
557
  t.delete(f);
560
558
  }
@@ -575,7 +573,7 @@ function A(e, i, t, s) {
575
573
  e[i] !== void 0 && typeof e[i] != "boolean" && s.push({ path: `${t}.${i}`, message: "应为布尔值" });
576
574
  }
577
575
  function M(e, i, t, s = !1) {
578
- e !== void 0 && !Ge.has(e) && !(s && e === "auto") && t.push({ path: i, message: `未知对齐方式${s ? "(支持 auto)" : ""}` });
576
+ e !== void 0 && !Ue.has(e) && !(s && e === "auto") && t.push({ path: i, message: `未知对齐方式${s ? "(支持 auto)" : ""}` });
579
577
  }
580
578
  function b(e, i, t) {
581
579
  if (e !== void 0) {
@@ -591,7 +589,7 @@ function b(e, i, t) {
591
589
  for (const s of ["fontFamily", "color", "backgroundColor", "lineColor", "borderColor"]) c(e, s, i, t);
592
590
  }
593
591
  }
594
- function Ye(e, i, t) {
592
+ function Qe(e, i, t) {
595
593
  if (e === void 0) return;
596
594
  if (!Array.isArray(e)) {
597
595
  t.push({ path: i, message: "参数定义应为数组" });
@@ -611,24 +609,24 @@ function Ye(e, i, t) {
611
609
  const d = a[r];
612
610
  d !== void 0 && (typeof d != "number" || !Number.isSafeInteger(d) || d < 0) && t.push({ path: `${f}.${r}`, message: "长度边界应为非负整数" });
613
611
  }
614
- Qe(a, f, t), a.options !== void 0 && (Array.isArray(a.options) ? a.options.forEach((r, d) => {
612
+ Ze(a, f, t), a.options !== void 0 && (Array.isArray(a.options) ? a.options.forEach((r, d) => {
615
613
  const h = `${f}.options.${d}`;
616
614
  if (!u(r)) t.push({ path: h, message: "选项应为对象" });
617
615
  else
618
616
  for (const m of ["label", "value"]) typeof r[m] != "string" && t.push({ path: `${h}.${m}`, message: "选项标签与值应为字符串(允许空白选项)" });
619
617
  }) : t.push({ path: `${f}.options`, message: "选项应为数组" }));
620
- }), t.length === n && t.push(...de(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
618
+ }), t.length === n && t.push(...re(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
621
619
  }
622
- function Qe(e, i, t) {
620
+ function Ze(e, i, t) {
623
621
  for (const a of ["min", "max"]) {
624
622
  const o = e[a];
625
623
  if (o === void 0) continue;
626
- he(e.type, o) || ["number", "numberRange"].includes(e.type) && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
624
+ de(e.type, o) || ["number", "numberRange"].includes(e.type) && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
627
625
  }
628
626
  const s = typeof e.min == "number" && typeof e.max == "number" && e.min > e.max, n = typeof e.min == "string" && typeof e.max == "string" && e.min > e.max;
629
627
  (s || n) && t.push({ path: i, message: "最小边界不能大于最大边界" }), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && t.push({ path: i, message: "最小长度不能大于最大长度" });
630
628
  }
631
- function Q(e, i, t) {
629
+ function Y(e, i, t) {
632
630
  if (!Array.isArray(e) || e.length === 0) {
633
631
  t.push({ path: i, message: "列表至少需要一列" });
634
632
  return;
@@ -639,7 +637,7 @@ function Q(e, i, t) {
639
637
  t.push({ path: a, message: "列应为对象" });
640
638
  return;
641
639
  }
642
- if (V(s, a, t), s.visual !== void 0 && !ge(s.visual) && t.push({ path: `${a}.visual`, message: "列可视化配置无效,请检查类型、数值范围和颜色" }), A(s, "hidden", a, t), C(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), c(s, "field", a, t, !0), g(s, "widthMm", a, t, Number.MIN_VALUE, !0), b(s.style, `${a}.style`, t), b(s.headerStyle, `${a}.headerStyle`, t), M(s.align, `${a}.align`, t, !0), M(s.headerAlign, `${a}.headerAlign`, t), s.semanticRole !== void 0 && !["identifier", "dimension", "measure", "date", "text"].includes(s.semanticRole) && t.push({ path: `${a}.semanticRole`, message: "未知列语义" }), s.format !== void 0)
640
+ if (V(s, a, t), s.visual !== void 0 && !me(s.visual) && t.push({ path: `${a}.visual`, message: "列可视化配置无效,请检查类型、数值范围和颜色" }), A(s, "hidden", a, t), C(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), c(s, "field", a, t, !0), g(s, "widthMm", a, t, Number.MIN_VALUE, !0), b(s.style, `${a}.style`, t), b(s.headerStyle, `${a}.headerStyle`, t), M(s.align, `${a}.align`, t, !0), M(s.headerAlign, `${a}.headerAlign`, t), s.semanticRole !== void 0 && !["identifier", "dimension", "measure", "date", "text"].includes(s.semanticRole) && t.push({ path: `${a}.semanticRole`, message: "未知列语义" }), s.format !== void 0)
643
641
  if (!u(s.format) || !["number", "percent", "date"].includes(s.format.kind))
644
642
  t.push({ path: `${a}.format`, message: "未知列格式" });
645
643
  else {
@@ -656,7 +654,7 @@ function Q(e, i, t) {
656
654
  }) : t.push({ path: `${a}.rules`, message: "条件格式应为数组" }));
657
655
  });
658
656
  }
659
- function Z(e, i, t) {
657
+ function Q(e, i, t) {
660
658
  if (e !== void 0) {
661
659
  if (!u(e)) {
662
660
  t.push({ path: i, message: "分组应为对象" });
@@ -665,29 +663,29 @@ function Z(e, i, t) {
665
663
  c(e, "field", i, t, !0);
666
664
  for (const s of ["headerTemplate", "subtotalLabel"]) c(e, s, i, t);
667
665
  for (const s of ["headerStyle", "subtotalStyle"]) b(e[s], `${i}.${s}`, t);
668
- A(e, "keepWithNext", i, t), A(e, "repeatHeader", i, t), X(e.aggregates, `${i}.aggregates`, t), e.subtotal !== void 0 && (!Array.isArray(e.subtotal) || e.subtotal.some((s) => typeof s != "string")) && t.push({ path: `${i}.subtotal`, message: "小计字段应为字符串数组" });
666
+ A(e, "keepWithNext", i, t), A(e, "repeatHeader", i, t), q(e.aggregates, `${i}.aggregates`, t), e.subtotal !== void 0 && (!Array.isArray(e.subtotal) || e.subtotal.some((s) => typeof s != "string")) && t.push({ path: `${i}.subtotal`, message: "小计字段应为字符串数组" });
669
667
  }
670
668
  }
671
- function Ze(e, i, t) {
669
+ function et(e, i, t) {
672
670
  if (!(e === void 0 || typeof e == "boolean")) {
673
671
  if (!u(e)) {
674
672
  t.push({ path: i, message: "合计应为布尔值或对象" });
675
673
  return;
676
674
  }
677
- c(e, "label", i, t), X(e.aggregates, `${i}.aggregates`, t), b(e.style, `${i}.style`, t), e.fields !== void 0 && (!Array.isArray(e.fields) || e.fields.some((s) => typeof s != "string")) && t.push({ path: `${i}.fields`, message: "合计字段应为字符串数组" });
675
+ c(e, "label", i, t), q(e.aggregates, `${i}.aggregates`, t), b(e.style, `${i}.style`, t), e.fields !== void 0 && (!Array.isArray(e.fields) || e.fields.some((s) => typeof s != "string")) && t.push({ path: `${i}.fields`, message: "合计字段应为字符串数组" });
678
676
  }
679
677
  }
680
- function et(e, i, t, s) {
678
+ function tt(e, i, t, s) {
681
679
  const n = { kind: "rect", leftMm: 0, topMm: 0, widthMm: 1, heightMm: 1, grid: e };
682
680
  if (W(n, t, s, []), L(n, t, s), !u(e) || !Array.isArray(e.cells)) return;
683
681
  const a = e.cells, o = Array.isArray(i) ? i.length : 0;
684
- if (a.length * o > S) {
682
+ if (a.length * o > v) {
685
683
  s.push({ path: t, message: "表头逻辑网格超过 20 万格安全上限" });
686
684
  return;
687
685
  }
688
- e.cells.length || s.push({ path: `${t}.cells`, message: "表头至少需要一行" }), Array.isArray(e.colWidthsMm) && e.colWidthsMm.length !== o && s.push({ path: `${t}.colWidthsMm`, message: "表头列宽数量应与列表列数一致" }), Array.isArray(e.rowHeightsMm) && e.rowHeightsMm.length !== e.cells.length && s.push({ path: `${t}.rowHeightsMm`, message: "表头行高数量应与行数一致" }), tt(a, o, t, s);
686
+ e.cells.length || s.push({ path: `${t}.cells`, message: "表头至少需要一行" }), Array.isArray(e.colWidthsMm) && e.colWidthsMm.length !== o && s.push({ path: `${t}.colWidthsMm`, message: "表头列宽数量应与列表列数一致" }), Array.isArray(e.rowHeightsMm) && e.rowHeightsMm.length !== e.cells.length && s.push({ path: `${t}.rowHeightsMm`, message: "表头行高数量应与行数一致" }), it(a, o, t, s);
689
687
  }
690
- function tt(e, i, t, s) {
688
+ function it(e, i, t, s) {
691
689
  const n = /* @__PURE__ */ new Set();
692
690
  e.forEach((a, o) => {
693
691
  if (!Array.isArray(a)) return;
@@ -703,8 +701,8 @@ function tt(e, i, t, s) {
703
701
  });
704
702
  });
705
703
  }
706
- function it(e, i, t) {
707
- if (Be(e, i, t), Le(e.computed, `${i}.computed`, t), je(e.matrix, `${i}.matrix`, t), e.matrix && (e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.grandTotal) && t.push({ path: `${i}.matrix`, message: "矩阵请使用自身 totals 汇总,不能同时配置普通分组、总计或主从明细" }), C(e.rowVisibleWhen, `${i}.rowVisibleWhen`, t), e.groups !== void 0 && (!Array.isArray(e.groups) || e.groups.length > 16 ? t.push({ path: `${i}.groups`, message: "分组应为数组,最多 16 级" }) : e.groups.forEach((a, o) => Z(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
704
+ function st(e, i, t) {
705
+ if (De(e, i, t), je(e.computed, `${i}.computed`, t), Be(e.matrix, `${i}.matrix`, t), e.matrix && (e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.grandTotal) && t.push({ path: `${i}.matrix`, message: "矩阵请使用自身 totals 汇总,不能同时配置普通分组、总计或主从明细" }), C(e.rowVisibleWhen, `${i}.rowVisibleWhen`, t), e.groups !== void 0 && (!Array.isArray(e.groups) || e.groups.length > 16 ? t.push({ path: `${i}.groups`, message: "分组应为数组,最多 16 级" }) : e.groups.forEach((a, o) => Q(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
708
706
  const s = e.detail, n = `${i}.detail`;
709
707
  if (!u(s)) {
710
708
  t.push({ path: n, message: "主从关联应为对象" });
@@ -712,17 +710,17 @@ function it(e, i, t) {
712
710
  }
713
711
  for (const a of ["dataset", "parentKey", "foreignKey"]) c(s, a, n, t, !0);
714
712
  for (const a of ["rowKey", "revisionField", "sourceTokenField"]) c(s, a, n, t, s[a] !== void 0);
715
- c(s, "label", n, t), A(s, "header", n, t), g(s, "rowHeightMm", n, t, Number.MIN_VALUE), Q(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
713
+ c(s, "label", n, t), A(s, "header", n, t), g(s, "rowHeightMm", n, t, Number.MIN_VALUE), Y(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
716
714
  }
717
- function st(e, i, t) {
715
+ function nt(e, i, t) {
718
716
  for (const s of ["leftMm", "topMm"]) g(e, s, i, t, -1 / 0, !0);
719
717
  g(e, "widthMm", i, t, Number.MIN_VALUE, !0), c(e, "dataset", i, t, !0), c(e, "title", i, t);
720
718
  for (const s of ["rowKey", "revisionField", "sourceTokenField"]) c(e, s, i, t, e[s] !== void 0);
721
- e.headerGrid !== void 0 && et(e.headerGrid, e.columns, `${i}.headerGrid`, t), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" }), Q(e.columns, `${i}.columns`, t);
719
+ e.headerGrid !== void 0 && tt(e.headerGrid, e.columns, `${i}.headerGrid`, t), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" }), Y(e.columns, `${i}.columns`, t);
722
720
  for (const s of ["fontSizePt", "rowHeightMm"]) g(e, s, i, t, Number.MIN_VALUE);
723
721
  g(e, "paddingMm", i, t);
724
722
  for (const s of ["header", "headerBold", "headerEveryPage", "border"]) A(e, s, i, t);
725
- e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), c(e, "headerBackgroundColor", i, t), M(e.align, `${i}.align`, t, !0), M(e.headerAlign, `${i}.headerAlign`, t), b(e.headerStyle, `${i}.headerStyle`, t), it(e, i, t), Z(e.groupBy, `${i}.groupBy`, t), Ze(e.grandTotal, `${i}.grandTotal`, t);
723
+ e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), c(e, "headerBackgroundColor", i, t), M(e.align, `${i}.align`, t, !0), M(e.headerAlign, `${i}.headerAlign`, t), b(e.headerStyle, `${i}.headerStyle`, t), st(e, i, t), Q(e.groupBy, `${i}.groupBy`, t), et(e.grandTotal, `${i}.grandTotal`, t);
726
724
  }
727
725
  function B(e, i, t) {
728
726
  Array.isArray(e.richParagraphs) && e.richParagraphs.forEach((s, n) => {
@@ -772,17 +770,17 @@ function L(e, i, t) {
772
770
  });
773
771
  });
774
772
  }
775
- function nt(e, i, t) {
773
+ function at(e, i, t) {
776
774
  if (!(e.flow === void 0 || !Array.isArray(e.components)))
777
775
  try {
778
- Re(e.components, e.flow);
776
+ Te(e.components, e.flow);
779
777
  } catch (s) {
780
778
  t.push({ path: `${i}.flow`, message: s instanceof Error ? s.message : String(s) });
781
779
  }
782
780
  }
783
- function at(e) {
781
+ function ot(e) {
784
782
  const i = [], t = [];
785
- return _(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (u(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== fe && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), Ye(e.params, "$.params", i), I(e.dataContract, "$.dataContract", i), Oe(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
783
+ return I(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (u(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== oe && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), Qe(e.params, "$.params", i), O(e.dataContract, "$.dataContract", i), Ie(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
786
784
  const a = `$.pages.${n}`;
787
785
  if (!u(s)) {
788
786
  i.push({ path: a, message: "页应为对象" });
@@ -792,36 +790,36 @@ function at(e) {
792
790
  for (const o of ["marginTopMm", "marginBottomMm", "marginLeftMm", "marginRightMm"]) g(s, o, a, i);
793
791
  typeof s.widthMm == "number" && Number(s.marginLeftMm ?? 0) + Number(s.marginRightMm ?? 0) >= s.widthMm && i.push({ path: a, message: "横向页边距占满页面" }), typeof s.heightMm == "number" && Number(s.marginTopMm ?? 0) + Number(s.marginBottomMm ?? 0) >= s.heightMm && i.push({ path: a, message: "纵向页边距占满页面" }), Array.isArray(s.components) ? s.components.forEach((o, f) => {
794
792
  const r = `${a}.components.${f}`;
795
- u(o) && o.kind === "list" ? st(o, r, i) : (W(o, r, i, t), u(o) && L(o, r, i));
796
- }) : i.push({ path: `${a}.components`, message: "组件应为数组" }), nt(s, a, i);
793
+ u(o) && o.kind === "list" ? nt(o, r, i) : (W(o, r, i, t), u(o) && L(o, r, i));
794
+ }) : i.push({ path: `${a}.components`, message: "组件应为数组" }), at(s, a, i);
797
795
  })) : i.push({ path: "$", message: "模板应为对象" }), { ok: i.length === 0, errors: i, warnings: t });
798
796
  }
799
- function ot(e) {
797
+ function ft(e) {
800
798
  const i = [], t = [];
801
- if (_(e, i), i.length) return { ok: !1, errors: i, warnings: t };
799
+ if (I(e, i), i.length) return { ok: !1, errors: i, warnings: t };
802
800
  if (!u(e)) i.push({ path: "$", message: "模板文档应为对象" });
803
801
  else {
804
802
  for (const n of Object.keys(e))
805
- We.has(n) || i.push({ path: `$.${n}`, message: "模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据" });
806
- e.schemaVersion !== Y && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
803
+ Ge.has(n) || i.push({ path: `$.${n}`, message: "模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据" });
804
+ e.schemaVersion !== X && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
807
805
  for (const n of ["id", "name"]) c(e, n, "$", i, !0);
808
806
  for (const n of ["revision", "description"]) c(e, n, "$", i);
809
- const s = at(e.template);
807
+ const s = ot(e.template);
810
808
  i.push(...s.errors.map((n) => ({ ...n, path: `$.template${n.path.slice(1)}` }))), t.push(...s.warnings.map((n) => ({ ...n, path: `$.template${n.path.slice(1)}` })));
811
809
  }
812
810
  return { ok: i.length === 0, errors: i, warnings: t };
813
811
  }
814
812
  function T(e) {
815
- const i = ot(e);
813
+ const i = ft(e);
816
814
  if (!i.ok) throw new w(i.errors);
817
815
  }
818
- function yt(e) {
816
+ function lt(e) {
819
817
  const i = [];
820
- if (_(e, i), i.length) throw new w(i);
821
- const t = { ...e, schemaVersion: e.schemaVersion ?? Y };
818
+ if (I(e, i), i.length) throw new w(i);
819
+ const t = { ...e, schemaVersion: e.schemaVersion ?? X };
822
820
  return T(t), R(t);
823
821
  }
824
- function lt(e) {
822
+ function $t(e) {
825
823
  let i = e;
826
824
  if (typeof e == "string") {
827
825
  if (e.length > K)
@@ -834,10 +832,10 @@ function lt(e) {
834
832
  }
835
833
  return T(i), R(i);
836
834
  }
837
- function $t(e) {
835
+ function bt(e) {
838
836
  T(e);
839
837
  try {
840
- return pe(e);
838
+ return ge(e);
841
839
  } catch (i) {
842
840
  throw i instanceof RangeError ? new w([{ path: "$", message: i.message }]) : i;
843
841
  }
@@ -845,7 +843,7 @@ function $t(e) {
845
843
  function R(e) {
846
844
  return JSON.parse(JSON.stringify(e));
847
845
  }
848
- function bt(e = []) {
846
+ function At(e = []) {
849
847
  const i = /* @__PURE__ */ new Map(), t = {
850
848
  get: (s) => {
851
849
  const n = i.get(s);
@@ -863,19 +861,18 @@ function bt(e = []) {
863
861
  }
864
862
  export {
865
863
  w as R,
866
- Y as a,
867
- Ne as b,
868
- mt as c,
869
- bt as d,
870
- yt as e,
864
+ X as a,
865
+ Se as b,
866
+ gt as c,
867
+ At as d,
868
+ lt as e,
871
869
  W as f,
872
870
  ve as g,
873
- ot as h,
874
- pt as i,
875
- Re as j,
876
- Oe as k,
877
- lt as p,
878
- gt as r,
879
- $t as s,
880
- at as v
871
+ ft as h,
872
+ yt as i,
873
+ pt as j,
874
+ Ie as k,
875
+ $t as p,
876
+ bt as s,
877
+ ot as v
881
878
  };