@agile-team/mach-report 2.22.0 → 2.23.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 (154) hide show
  1. package/README.md +7 -6
  2. package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
  3. package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
  4. package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
  5. package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
  6. package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
  7. package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
  8. package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
  9. package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
  10. package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
  11. package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
  12. package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
  13. package/dist/ReportPreview-FFIryrIr.cjs +6 -0
  14. package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
  15. package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
  16. package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
  17. package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
  18. package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
  19. package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
  20. package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
  21. package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
  22. package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
  23. package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
  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-4pK9HePf.cjs +1 -0
  30. package/dist/auto-CTIJ6PnR.js +257 -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-DhrE7jzw.js +7169 -0
  40. package/dist/designer-IAZu6kBX.cjs +2 -0
  41. package/dist/designer.cjs +1 -1
  42. package/dist/designer.d.cts +98 -45
  43. package/dist/designer.d.ts +98 -45
  44. package/dist/designer.js +3 -3
  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-BefcaHdp.cjs} +1 -1
  50. package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
  51. package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
  52. package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.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-1tvQNzQE.cjs +2 -0
  60. package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
  61. package/dist/matrix-B8QWbsGM.cjs +1 -0
  62. package/dist/matrix-C6e_r_vp.js +302 -0
  63. package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
  64. package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
  65. package/dist/pdf.cjs +1 -1
  66. package/dist/pdf.js +2 -2
  67. package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
  68. package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
  69. package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
  70. package/dist/prefill-DsUD5OoK.cjs +1 -0
  71. package/dist/prepared-DCIxhKFo.js +94 -0
  72. package/dist/prepared-Dv-XM3i1.cjs +1 -0
  73. package/dist/progress-ByiOxUD3.js +250 -0
  74. package/dist/progress-WomPRP3B.cjs +1 -0
  75. package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
  76. package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
  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-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
  86. package/dist/runtime-DKlGd_D4.cjs +1 -0
  87. package/dist/sbom.cdx.json +1 -1
  88. package/dist/server-node.cjs +5 -5
  89. package/dist/server-node.js +1642 -1586
  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--cjxzgH7.js} +17 -17
  94. package/dist/template-catalog-CoT7jm_6.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-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
  102. package/dist/textwrap-Cy7o1hIR.cjs +4 -0
  103. package/dist/vue/async.d.cts +24 -0
  104. package/dist/vue/async.d.ts +24 -0
  105. package/dist/vue/index.d.cts +25 -1
  106. package/dist/vue/index.d.ts +25 -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/ReportLabelStudio-B0i9ohQj.cjs +0 -1
  119. package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
  120. package/dist/ReportPreview-BDgKssYR.js +0 -5887
  121. package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
  122. package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
  123. package/dist/assets-CxHunY_9.js +0 -232
  124. package/dist/assets-vbjAGgk8.cjs +0 -1
  125. package/dist/auto-DcUHlKob.cjs +0 -1
  126. package/dist/auto-moShblh1.js +0 -240
  127. package/dist/charts-aCtoswXq.cjs +0 -1
  128. package/dist/component-tree-1_QCiQJX.js +0 -67
  129. package/dist/component-tree-BjZIp6w9.cjs +0 -1
  130. package/dist/computed-4TnxzgIh.cjs +0 -1
  131. package/dist/data-bar-YltqGTaC.cjs +0 -1
  132. package/dist/designer-B7jJeAeG.js +0 -6914
  133. package/dist/designer-BWQVpJeN.cjs +0 -2
  134. package/dist/grid-geometry-D3SJgWFv.js +0 -136
  135. package/dist/grid-geometry-D8ReblRV.cjs +0 -1
  136. package/dist/json-snapshot-nyV63AbB.cjs +0 -2
  137. package/dist/matrix-0hywp0-F.cjs +0 -1
  138. package/dist/matrix-Dy-tyY7E.js +0 -381
  139. package/dist/prefill-DUvejVt1.cjs +0 -1
  140. package/dist/prepared-YXy-fVLw.cjs +0 -1
  141. package/dist/prepared-rXCKqdHY.js +0 -88
  142. package/dist/progress-B0ctFpKf.cjs +0 -1
  143. package/dist/progress-Hc2vxoCs.js +0 -52
  144. package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
  145. package/dist/record-bindings-VZGS-Qd8.js +0 -155
  146. package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
  147. package/dist/rich-text-layout-wxBhnAS7.js +0 -102
  148. package/dist/runtime-Dq0LUsyS.cjs +0 -1
  149. package/dist/template-catalog-CLAM4w7H.cjs +0 -1
  150. package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
  151. package/dist/template-outline-CDWXptuj.js +0 -88
  152. package/dist/template-outline-K4jGhATu.cjs +0 -1
  153. package/dist/template-registry-CWnuGqyP.cjs +0 -1
  154. package/dist/textwrap-OTOUMr4f.cjs +0 -4
@@ -1,381 +0,0 @@
1
- import { n as m, c as w } from "./computed-C8NRZQss.js";
2
- function M(e, r, t) {
3
- if (!Array.isArray(e) || Object.getPrototypeOf(e) !== Array.prototype || e.length > r) throw new TypeError(`${t}应为有界普通数组`);
4
- if (Reflect.ownKeys(e).length !== e.length + 1) throw new TypeError(`${t}不支持自定义数组方法或迭代器`);
5
- const l = [];
6
- for (let a = 0; a < e.length; a++) {
7
- const n = Object.getOwnPropertyDescriptor(e, String(a));
8
- if (!n || !Object.prototype.hasOwnProperty.call(n, "value")) throw new TypeError(`${t}不支持空洞或访问器`);
9
- l.push(n.value);
10
- }
11
- return l;
12
- }
13
- function g(e, r, t) {
14
- if (e === void 0) return r;
15
- if (!Number.isSafeInteger(e) || Number(e) < 1 || Number(e) > t) throw new RangeError("图表预算超出允许范围");
16
- return Number(e);
17
- }
18
- function x(e) {
19
- if (!e || typeof e != "object" || Array.isArray(e)) throw new TypeError("图表绑定应为对象");
20
- if (m(e.dataset), m(e.categoryField), !["bar", "line", "stackedBar", "percentBar"].includes(e.type)) throw new TypeError("图表类型无效");
21
- if (e.sort !== void 0 && !["asc", "desc"].includes(e.sort)) throw new TypeError("图表排序无效");
22
- if (e.title !== void 0 && (typeof e.title != "string" || e.title.length > 512)) throw new TypeError("图表标题过长");
23
- if (e.showValues !== void 0 && typeof e.showValues != "boolean") throw new TypeError("图表数值标签应为布尔值");
24
- if (!Array.isArray(e.measures) || !e.measures.length || e.measures.length > 12) throw new RangeError("图表支持 1–12 个度量");
25
- for (const r of M(e.measures, 12, "图表度量")) C(r);
26
- g(e.maxRows, 1e5, 1e5), g(e.maxCategories, 200, 200);
27
- }
28
- function C(e) {
29
- if (!e || typeof e != "object" || Array.isArray(e)) throw new TypeError("图表度量应为对象");
30
- if (e.field !== void 0 && m(e.field), e.weightField !== void 0 && m(e.weightField), e.label !== void 0 && (typeof e.label != "string" || e.label.length > 256)) throw new TypeError("图表系列名称过长");
31
- if (e.color !== void 0 && !/^#[\da-f]{6}$/i.test(e.color)) throw new TypeError("图表颜色应为 #RRGGBB");
32
- w(e);
33
- }
34
- function O(e) {
35
- if (e == null) return { key: "null", label: "—" };
36
- if (typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e))) throw new TypeError("图表分类应为文本、布尔或有限数字");
37
- const r = String(e);
38
- if (r.length > 512) throw new RangeError("图表分类名称过长");
39
- return { key: JSON.stringify([typeof e, e]), label: r };
40
- }
41
- function j(e) {
42
- if (e === null) return null;
43
- const r = Number(e);
44
- if (!Number.isFinite(r)) throw new RangeError("聚合结果超出图表有限数值范围");
45
- return r;
46
- }
47
- function Q(e, r, t) {
48
- if (t?.aborted) {
49
- const s = new Error("图表数据处理已取消");
50
- throw s.name = "AbortError", s;
51
- }
52
- x(r);
53
- const l = M(r.measures, 12, "图表度量");
54
- if (!Array.isArray(e) || e.length > g(r.maxRows, 1e5, 1e5)) throw new RangeError("图表数据超出行数预算");
55
- const a = /* @__PURE__ */ new Map(), n = g(r.maxCategories, 200, 200);
56
- for (let s = 0; s < e.length; s++) {
57
- if (t?.aborted) {
58
- const u = new Error("图表数据处理已取消");
59
- throw u.name = "AbortError", u;
60
- }
61
- const c = e[s];
62
- if (!c || typeof c != "object" || Array.isArray(c)) throw new TypeError("图表数据行应为对象");
63
- const f = O(Object.prototype.hasOwnProperty.call(c, r.categoryField) ? c[r.categoryField] : null);
64
- let i = a.get(f.key);
65
- if (!i) {
66
- if (a.size >= n) throw new RangeError("图表分类超出预算,请明确筛选或聚合数据");
67
- i = { label: f.label, accumulators: l.map(w) }, a.set(f.key, i);
68
- }
69
- i.accumulators.forEach((u) => u.add(c));
70
- }
71
- const o = [...a.values()];
72
- return r.sort && o.sort((s, c) => (r.sort === "desc" ? -1 : 1) * (s.label < c.label ? -1 : s.label > c.label ? 1 : 0)), { categories: o.map((s) => s.label), series: l.map((s, c) => ({
73
- name: s.label ?? `${s.field ?? "记录"} · ${s.op}`,
74
- values: o.map((f) => j(f.accumulators[c].value())),
75
- ...s.color ? { color: s.color } : {}
76
- })) };
77
- }
78
- function T(e, r) {
79
- const t = () => r.measures.map((c) => w(c)), l = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = r.totals ? t() : void 0, s = (c, f) => c?.forEach((i) => i.add(f));
80
- for (const c of e) {
81
- const f = r.row(c), i = r.column(c);
82
- a.has(i.key) || a.set(i.key, i.label);
83
- let u = l.get(f.key);
84
- u || (u = { label: f.label, cells: /* @__PURE__ */ new Map(), ...r.totals ? { totals: t() } : {} }, l.set(f.key, u)), r.check(l.size, a.size);
85
- let h = u.cells.get(i.key);
86
- if (h || (h = t(), u.cells.set(i.key, h)), s(h, c), !r.totals) continue;
87
- let y = n.get(i.key);
88
- y || (y = t(), n.set(i.key, y)), s(u.totals, c), s(y, c), s(o, c);
89
- }
90
- return { groups: l, columns: a, columnTotals: n, totals: o };
91
- }
92
- function d(e, r) {
93
- return JSON.stringify([e.slice(0, r.length), r.map((t) => [t === null ? "null" : typeof t, t])]);
94
- }
95
- function R(e, r) {
96
- return r.map((t) => {
97
- const l = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : null;
98
- if (l == null) return null;
99
- if (typeof l == "string" || typeof l == "boolean" || typeof l == "number" && Number.isFinite(l)) return l;
100
- throw new Error("矩阵维度必须是有限 JSON 标量");
101
- });
102
- }
103
- function L(e, r, t) {
104
- if (!e || typeof e != "object" || Array.isArray(e)) throw new Error("矩阵层级应为对象");
105
- for (const l of [e.emptyLabel, e.subtotalLabel, e.totalLabel]) if (l !== void 0 && typeof l != "string") throw new Error("矩阵层级标签应为字符串");
106
- p(e.row, r.length), p(e.column, t.length);
107
- }
108
- function p(e, r) {
109
- if (e !== void 0) {
110
- if (!e || typeof e != "object" || Array.isArray(e)) throw new Error("矩阵轴配置应为对象");
111
- if (e.labels !== void 0 && (!Array.isArray(e.labels) || e.labels.length !== r || e.labels.some((t) => typeof t != "string"))) throw new Error("矩阵维度标签必须与维度字段一一对应");
112
- if (e.sort !== void 0 && (!Array.isArray(e.sort) || e.sort.length > r || e.sort.some((t) => !["source", "asc", "desc"].includes(t)))) throw new Error("矩阵维度排序应为 source、asc 或 desc");
113
- if (e.subtotals !== void 0 && (!Array.isArray(e.subtotals) || new Set(e.subtotals).size !== e.subtotals.length || e.subtotals.some((t) => !Number.isInteger(t) || t < 1 || t >= r))) throw new Error("矩阵小计深度应唯一且位于 1 至末级之前");
114
- }
115
- }
116
- function A(e, r, t) {
117
- return { fields: e, options: r ?? {}, hierarchy: t, root: { values: [], children: /* @__PURE__ */ new Map() }, leaves: 0, expanded: 0 };
118
- }
119
- function F(e, r) {
120
- const t = R(r, e.fields);
121
- let l = e.root;
122
- for (let a = 1; a <= t.length; a++) {
123
- const n = t.slice(0, a), o = d(e.fields, n);
124
- let s = l.children.get(o);
125
- s || (s = { values: n, children: /* @__PURE__ */ new Map() }, l.children.set(o, s), a === t.length ? (e.leaves++, e.expanded++) : e.options.subtotals?.includes(a) && e.expanded++), l = s;
126
- }
127
- }
128
- function z(e, r) {
129
- if (e === r) return 0;
130
- if (e === null) return -1;
131
- if (r === null) return 1;
132
- if (typeof e == "number" && typeof r == "number") return e - r;
133
- const t = `${typeof e}:${e}`, l = `${typeof r}:${r}`;
134
- return t < l ? -1 : 1;
135
- }
136
- function P(e, r) {
137
- const t = [...e.children.values()];
138
- return r && r !== "source" && t.sort((l, a) => z(l.values[l.values.length - 1], a.values[a.values.length - 1]) * (r === "desc" ? -1 : 1)), t;
139
- }
140
- function E(e, r, t) {
141
- return {
142
- key: d(e.fields, r),
143
- kind: t,
144
- depth: r.length,
145
- fields: e.fields.slice(0, r.length),
146
- values: r,
147
- labels: r.map((l) => l === null ? e.hierarchy.emptyLabel ?? "(空)" : String(l))
148
- };
149
- }
150
- function k(e, r) {
151
- const t = [];
152
- function l(a) {
153
- for (const n of P(a, e.options.sort?.[a.values.length]))
154
- n.children.size ? (l(n), e.options.subtotals?.includes(n.values.length) && t.push(E(e, n.values, "subtotal"))) : t.push(E(e, n.values, "member"));
155
- }
156
- return l(e.root), r && e.leaves && t.push(E(e, [], "total")), t;
157
- }
158
- function $(e, r, t) {
159
- const l = R(r, e.fields), a = [d(e.fields, l), ...(e.options.subtotals ?? []).map((n) => d(e.fields, l.slice(0, n)))];
160
- return t && a.push(d(e.fields, [])), a;
161
- }
162
- function I(e, r, t) {
163
- if (!(e.kind !== "member" && r > e.depth))
164
- return e.kind === "total" ? { key: "total", text: t.totalLabel ?? "合计", rowSpan: 0 } : e.kind === "subtotal" && r === e.depth ? { key: e.key, text: t.subtotalLabel ?? "小计", rowSpan: 0 } : { key: JSON.stringify(e.values.slice(0, r + 1).map((l) => [typeof l, l])), text: e.labels[r], rowSpan: 1 };
165
- }
166
- function K(e, r) {
167
- const t = e.columnFields.length + 1, l = e.rowFields.length, a = Array.from({ length: t }, () => Array(l + r.length).fill(null));
168
- for (let n = 0; n < e.columnFields.length; n++) {
169
- let o;
170
- r.forEach((s, c) => {
171
- const f = I(s, n, e.hierarchy);
172
- if (!f) {
173
- o = void 0;
174
- return;
175
- }
176
- if (o?.key === f.key) {
177
- o.cell.colSpan = (o.cell.colSpan ?? 1) + 1;
178
- return;
179
- }
180
- const i = { text: f.text, rowSpan: f.rowSpan || e.columnFields.length - n, editable: !1, derived: !0 };
181
- a[n][l + c] = i, o = { key: f.key, cell: i };
182
- });
183
- }
184
- return e.rowFields.forEach((n, o) => {
185
- a[0][o] = { text: e.hierarchy.row?.labels?.[o] ?? n, rowSpan: t, editable: !1, derived: !0 };
186
- }), r.forEach((n, o) => {
187
- const s = e.measures[n.measure];
188
- a[t - 1][l + o] = { text: s.label ?? `${s.field} (${s.op})`, editable: !1, derived: !0 };
189
- }), {
190
- cells: a.map((n) => n.filter((o) => o !== null)),
191
- colWidthsMm: [...e.rowFields.map(() => e.rowWidthMm ?? 40), ...r.map(() => e.columnWidthMm ?? 28)]
192
- };
193
- }
194
- function v(e, r, t, l) {
195
- const a = +(!!r.totals && e > 0), n = t.expanded + a, o = (l.expanded + a) * r.measures.length + r.rowFields.length;
196
- if (n > (r.maxRows ?? 1e3) || l.expanded + a > (r.maxColumns ?? 200)) throw new Error("矩阵层级展开数量超出预算(包含小计/总计)");
197
- if (n * o > (r.maxCells ?? 2e6)) throw new Error("矩阵输出超出 maxCells 预算");
198
- return { rowCount: n, columnCount: o, cells: n * o };
199
- }
200
- function N(e, r) {
201
- if (!Array.isArray(e) || e.length > (r.maxInputRows ?? 1e5)) throw new Error("矩阵输入超出预算");
202
- const t = A(r.rowFields, r.hierarchy.row, r.hierarchy), l = A(r.columnFields, r.hierarchy.column, r.hierarchy);
203
- if (e.length * (1 + (t.options.subtotals?.length ?? 0) + +!!r.totals) * (1 + (l.options.subtotals?.length ?? 0) + +!!r.totals) * r.measures.length > (r.maxAggregateUpdates ?? 1e7)) throw new Error("矩阵聚合更新超出 maxAggregateUpdates 预算");
204
- let n = v(0, r, t, l);
205
- for (const o of e) {
206
- if (!o || typeof o != "object" || Array.isArray(o)) throw new Error("矩阵数据行应为对象");
207
- F(t, o), F(l, o), n = v(e.length, r, t, l);
208
- }
209
- return { row: t, column: l, shape: n };
210
- }
211
- function B(e, r) {
212
- return N(e, r).shape;
213
- }
214
- function H(e, r, t) {
215
- const l = /* @__PURE__ */ new Map();
216
- for (const a of e) {
217
- const n = $(t.row, a, !!r.totals), o = $(t.column, a, !!r.totals);
218
- for (const s of n) {
219
- let c = l.get(s);
220
- c || (c = /* @__PURE__ */ new Map(), l.set(s, c));
221
- for (const f of o) {
222
- let i = c.get(f);
223
- i || (i = r.measures.map((u) => w({ ...u, field: u.valueField ?? u.field })), c.set(f, i)), i.forEach((u) => u.add(a));
224
- }
225
- }
226
- }
227
- return l;
228
- }
229
- function J(e, r) {
230
- return e.flatMap((t, l) => r.measures.map((a, n) => ({
231
- ...t,
232
- field: t.kind === "total" ? `total_${n}` : `c${l}_${n}`,
233
- measure: n,
234
- measureField: a.field,
235
- valueField: a.valueField ?? a.field,
236
- operation: a.op
237
- })));
238
- }
239
- function _(e, r) {
240
- return e.kind === "total" ? r.hierarchy.totalLabel ?? "合计" : [...e.labels, ...e.kind === "subtotal" ? [r.hierarchy.subtotalLabel ?? "小计"] : []].join(" / ");
241
- }
242
- function V(e, r) {
243
- return [
244
- ...r.rowFields.map((t, l) => ({ field: `r${l}`, header: r.hierarchy.row?.labels?.[l] ?? t, semanticRole: "dimension" })),
245
- ...e.map((t) => {
246
- const l = r.measures[t.measure];
247
- return {
248
- field: t.field,
249
- header: `${_(t, r)} · ${l.label ?? `${l.field} (${l.op})`}`,
250
- semanticRole: "measure",
251
- ...l.digits === void 0 ? {} : { format: { kind: "number", digits: l.digits } }
252
- };
253
- })
254
- ];
255
- }
256
- function W(e, r, t, l) {
257
- return e.map((a) => {
258
- const n = {};
259
- t.rowFields.forEach((o, s) => {
260
- n[`r${s}`] = a.kind === "total" ? s === 0 ? t.hierarchy.totalLabel ?? "合计" : null : a.labels[s] ?? (s === a.depth ? t.hierarchy.subtotalLabel ?? "小计" : null);
261
- });
262
- for (const o of r) n[o.field] = l.get(a.key)?.get(o.key)?.[o.measure]?.value() ?? (t.measures[o.measure].op === "count" ? 0 : null);
263
- return n;
264
- });
265
- }
266
- function D(e, r) {
267
- const t = N(e, r), l = k(t.row, !!r.totals), a = J(k(t.column, !!r.totals), r), n = H(e, r, t);
268
- return { columns: V(a, r), rows: W(l, a, r, n), headerGrid: K(r, a), metadata: {
269
- rowFields: [...r.rowFields],
270
- rowLabels: [...r.hierarchy.row?.labels ?? r.rowFields],
271
- columnFields: [...r.columnFields],
272
- columnLabels: [...r.hierarchy.column?.labels ?? r.columnFields],
273
- rows: l,
274
- columns: a
275
- } };
276
- }
277
- function b(e, r) {
278
- const t = r.map(
279
- (l) => Object.prototype.hasOwnProperty.call(e, l) ? e[l] : null
280
- );
281
- if (t.some(
282
- (l) => l != null && typeof l != "string" && typeof l != "boolean" && !(typeof l == "number" && Number.isFinite(l))
283
- ))
284
- throw new Error("矩阵维度必须是有限 JSON 标量");
285
- return {
286
- key: JSON.stringify(t.map((l) => [typeof l, l ?? null])),
287
- label: t.map((l) => l == null ? "" : String(l)).join(" / ")
288
- };
289
- }
290
- function G(e) {
291
- for (const r of [
292
- "maxRows",
293
- "maxColumns",
294
- "maxInputRows",
295
- "maxCells",
296
- "maxAggregateUpdates"
297
- ])
298
- if (e[r] !== void 0 && (!Number.isSafeInteger(e[r]) || e[r] < 1))
299
- throw new Error("矩阵预算应为正安全整数");
300
- for (const r of ["columnWidthMm", "rowWidthMm"])
301
- if (e[r] !== void 0 && (!Number.isFinite(e[r]) || e[r] <= 0))
302
- throw new Error("矩阵列宽应为正数");
303
- }
304
- function S(e) {
305
- if (!e || !Array.isArray(e.rowFields) || !Array.isArray(e.columnFields) || !Array.isArray(e.measures))
306
- throw new Error("矩阵需要行维度、列维度和度量数组");
307
- for (const t of [e.rowFields, e.columnFields])
308
- if (t.some((l) => typeof l != "string" || !l.trim()) || new Set(t).size !== t.length)
309
- throw new Error("矩阵维度字段应非空且唯一");
310
- if (G(e), !e.rowFields.length || !e.columnFields.length || e.rowFields.length > 16 || e.columnFields.length > 16)
311
- throw new Error("矩阵需要 1–16 个行/列维度");
312
- if (!e.measures.length || e.measures.length > 32)
313
- throw new Error("矩阵需要 1–32 个度量");
314
- if (e.measures.map((t) => {
315
- if (!t || typeof t != "object") throw new Error("矩阵度量应为对象");
316
- if (w({
317
- ...t,
318
- field: t.valueField ?? t.field
319
- }), t.label !== void 0 && typeof t.label != "string")
320
- throw new Error("矩阵度量标签应为字符串");
321
- return t.field;
322
- }).some((t) => typeof t != "string" || !t.trim()))
323
- throw new Error("矩阵度量字段应非空");
324
- e.hierarchy !== void 0 && L(e.hierarchy, e.rowFields, e.columnFields);
325
- }
326
- function U(e, r) {
327
- if (S(r), r.hierarchy) return B(e, r);
328
- if (!Array.isArray(e) || e.length > (r.maxInputRows ?? 1e5))
329
- throw new Error("矩阵输入超出预算");
330
- const t = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
331
- for (const o of e) {
332
- if (!o || typeof o != "object" || Array.isArray(o))
333
- throw new Error("矩阵数据行应为对象");
334
- if (t.add(b(o, r.rowFields).key), l.add(b(o, r.columnFields).key), t.size > (r.maxRows ?? 1e3) || l.size > (r.maxColumns ?? 200))
335
- throw new Error("矩阵维度数量超出预算");
336
- if ((t.size + +!!r.totals) * ((l.size + +!!r.totals) * r.measures.length + 1) > (r.maxCells ?? 2e6))
337
- throw new Error("矩阵输出超出 maxCells 预算");
338
- }
339
- const a = t.size + +(!!r.totals && e.length > 0), n = (l.size + +!!r.totals) * r.measures.length + 1;
340
- return { rowCount: a, columnCount: n, cells: a * n };
341
- }
342
- function X(e, r) {
343
- if (r?.hierarchy)
344
- return S(r), D(e, r);
345
- U(e, r);
346
- const t = T(e, {
347
- row: (o) => b(o, r.rowFields),
348
- column: (o) => b(o, r.columnFields),
349
- measures: r.measures.map((o) => ({ ...o, field: o.valueField ?? o.field })),
350
- totals: r.totals,
351
- check: () => {
352
- }
353
- // Cardinality/budgets were checked before allocating accumulators.
354
- }), l = [...t.groups.values()].map((o) => ({ rowLabel: o.label })), a = [{ field: "rowLabel", header: r.rowHeader ?? r.rowFields.join(" / "), semanticRole: "dimension" }], n = { rowLabel: "合计" };
355
- return r.measures.forEach((o, s) => {
356
- const c = [...t.columns.entries()].map(([f, i], u) => ({ key: f, label: i, field: `c${u}_${s}` }));
357
- r.totals && c.push({ key: "", label: "合计", field: `total_${s}` });
358
- for (const f of c) {
359
- const i = f.field === `total_${s}`;
360
- a.push({
361
- field: f.field,
362
- header: `${f.label} · ${o.label ?? `${o.field} (${o.op})`}`,
363
- semanticRole: "measure",
364
- ...o.digits === void 0 ? {} : { format: { kind: "number", digits: o.digits } }
365
- });
366
- let u = 0;
367
- for (const h of t.groups.values())
368
- l[u++][f.field] = (i ? h.totals?.[s] : h.cells.get(f.key)?.[s])?.value() ?? (o.op === "count" ? 0 : null);
369
- n[f.field] = (i ? t.totals?.[s] : t.columnTotals.get(f.key)?.[s])?.value() ?? (o.op === "count" ? 0 : null);
370
- }
371
- }), r.totals && e.length && l.push(n), { rows: l, columns: a };
372
- }
373
- export {
374
- T as a,
375
- Q as b,
376
- X as c,
377
- x as d,
378
- U as e,
379
- M as f,
380
- S as v
381
- };
@@ -1 +0,0 @@
1
- "use strict";const g=require("./json-snapshot-nyV63AbB.cjs"),N=require("./grid-geometry-D8ReblRV.cjs"),y=require("./computed-4TnxzgIh.cjs");function R(e){return Number.isFinite(e)?Math.max(0,e):0}function B(e,t=0){const r=e.length,o=R(t),n=new Array(r+1);n[0]=0;for(let i=0;i<r;i++)n[i+1]=n[i]+R(e[i]??0)+o;const c=n[r];function s(i){let a=0,u=r-1,p=0;for(;a<=u;){const f=a+u>>>1;n[f]<=i?(p=f,a=f+1):u=f-1}return p}function d(i,a,u=1){if(r===0)return{start:0,end:-1,padTopPx:0,padBottomPx:0};const p=Math.floor(R(u)),f=R(a),m=s(f),w=Math.max(0,m-p),I=f+R(i);let h=m,D=r-1,z=r-1;for(;h<=D;){const S=h+D>>>1;n[S+1]<I?h=S+1:(z=S,D=S-1)}const E=Math.min(r-1,z+p);return{start:w,end:E,padTopPx:n[w],padBottomPx:Math.max(0,c-n[E+1])}}return{totalHeightPx:c,pageAt:s,offsetAt:i=>n[Math.max(0,Math.min(r,Math.floor(i)))]??0,window:d}}class v extends Error{constructor(t){super(`Report drill: ${t}`),this.code=t,this.name="ReportDrillError"}}function x(e){return typeof e=="string"&&e.trim().length>0&&e.length<=256}function V(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="boolean")return String(e);if(typeof e=="string"&&e.length>0&&e.length<=4096)return e;throw new v("missing-value")}function G(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function A(e){if(!Array.isArray(e)||e.length>64)throw new v("config");const t=new Set;for(const r of e){if(!r||!x(r.id)||!x(r.label)||!r.target||!x(r.target.field)||t.has(r.id))throw new v("config");t.add(r.id);const o=r.target;if(o.datasetId!==void 0&&!x(o.datasetId)||o.reportScope!==void 0&&!x(o.reportScope))throw new v("config");if(o.roles!==void 0&&(!Array.isArray(o.roles)||o.roles.length>16||o.roles.some(n=>!x(n))))throw new v("config");$(r.params)}}function $(e){if(e!==void 0){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).length>32)throw new v("config");for(const[t,r]of Object.entries(e)){if(!x(t)||["__proto__","constructor","prototype"].includes(t)||!r||typeof r!="object")throw new v("config");if("value"in r)try{V(r.value)}catch{throw new v("config")}else if(!["value","rowKey","query","field"].includes(r.from)||(r.from==="query"||r.from==="field")&&!x(r.field))throw new v("config")}}}function T(e,t,r){const{target:o}=r,n=t.source?.datasetId??t.component.table?.source?.datasetId;return(t.source?.field??t.table?.columnKey)===o.field&&(o.datasetId===void 0||n===o.datasetId)&&(o.reportScope===void 0||e.pages[t.address.pageIndex]?.meta?.reportScope===o.reportScope)&&(o.roles?o.roles.includes(t.table?.role??""):t.table?.role!=="header")}function U(e,t,r){A(r);const o=g.getReportCellContext(e,t);return o?r.filter(n=>T(e,o,n)):[]}function W(e,t,r,o){if("value"in e)return e.value;switch(e.from){case"value":return r.value;case"rowKey":return r.source?.rowKey;case"query":return G(o,e.field);case"field":{const n=r.component.table?.columnKeys.indexOf(e.field)??-1;return n<0?void 0:g.getReportCellContext(t,{...r.address,columnIndex:n})?.value}}}function Z(e,t,r,o={}){A([r]);const n=g.getReportCellContext(e,t);if(!n||!T(e,n,r))throw new v("target");const c=Object.fromEntries(Object.entries(r.params??{}).map(([i,a])=>[i,V(W(a,e,n,o))])),s=Object.entries(o);if(s.length>128||s.some(([i,a])=>!x(i)||typeof a!="string"||a.length>4096))throw new v("config");const d=e.pages[t.pageIndex]?.meta?.reportScope;return Object.freeze({actionId:r.id,params:Object.freeze(c),returnState:Object.freeze({params:Object.freeze(Object.fromEntries(s)),address:Object.freeze({...t}),...typeof d=="string"?{reportScope:d}:{},...n.source?{source:Object.freeze({sourceScope:n.source.sourceScope,datasetId:n.source.datasetId,rowKey:n.source.rowKey,field:n.source.field})}:{}})})}function H(e,t){if(!t.source)return e.pages[t.address.pageIndex]?.meta?.reportScope===t.reportScope&&g.getReportCellContext(e,t.address)?{...t.address}:null;const r=g.createReportCellResolver(e),o=g.reportCellEditKey({address:t.address,source:t.source});for(const[n,c]of e.pages.entries())if(!(t.reportScope!==void 0&&c.meta?.reportScope!==t.reportScope)){for(const[s,d]of c.components.entries())if(d.grid)for(const i of N.resolveGridLayout(d.grid,d.widthMm,d.heightMm).cells){const a={pageIndex:n,componentIndex:s,rowIndex:i.ri,columnIndex:i.ci},u=r(a);if(u?.source&&g.reportCellEditKey(u)===o)return a}}return null}class l extends Error{constructor(t,r){super(r),this.code=t,this.name="ReportDataError"}}function b(e,t,r){const o=e??t;if(!Number.isSafeInteger(o)||o<1||o>r)throw new l("limit","Invalid report data budget");return o}function k(e){if(typeof e=="string"&&e.length>0&&e.length<=2048)return`s:${e}`;if(typeof e=="number"&&Number.isSafeInteger(e))return`n:${Object.is(e,-0)?0:e}`;throw new l("identity","A stable string or safe integer business key is required")}function O(e){if(typeof e.datasetId!="string"||!e.datasetId.trim()||e.datasetId.length>2048)throw new l("identity","A dataset identity is required");if(e.sourceScope!==void 0&&(typeof e.sourceScope!="string"||!e.sourceScope.trim()||e.sourceScope.length>2048))throw new l("identity","Invalid source scope")}function j(e,t=256){if(!Array.isArray(e)||!e.length||e.length>t)throw new l("limit","A bounded explicit field allowlist is required");const r=new Set;for(const o of e){if(typeof o!="string"||!o.trim()||o.length>2048||["__proto__","constructor","prototype"].includes(o))throw new l("identity","Invalid report field");if(r.has(o))throw new l("duplicate","Duplicate report field");r.add(o)}}function C(e,t){const r=Object.getOwnPropertyDescriptor(e.values,t);if(!r)return;if(!("value"in r))throw new l("value","Report values must be plain scalar data");const o=r.value;if(o===null||typeof o=="boolean"||typeof o=="string"||typeof o=="number"&&Number.isFinite(o))return o;throw new l("value","Report values must be finite scalar data")}function J(e){if(!e||typeof e!="object"||![Object.prototype,null].includes(Object.getPrototypeOf(e)))throw new l("value","Report records must be plain data");const t=Object.getOwnPropertyDescriptor(e,"rowKey"),r=Object.getOwnPropertyDescriptor(e,"values");if(!t||!("value"in t)||!r||!("value"in r)||!r.value||typeof r.value!="object"||![Object.prototype,null].includes(Object.getPrototypeOf(r.value)))throw new l("value","Report records require own scalar keys and plain values");return{rowKey:t.value,values:r.value}}function q(e,t,r={}){const o=b(r.maxRows,5e4,1e5),n=b(r.maxCells,1e6,2e6);if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype||e.length>o||e.length*t.length>n)throw new l("limit","Report data exceeds its budget");const c=new Map;for(let s=0;s<e.length;s++){const d=Object.getOwnPropertyDescriptor(e,s);if(!d||!("value"in d))throw new l("value","Sparse or accessor report records are unsupported");const i=J(d.value),a=k(i.rowKey);if(c.has(a))throw new l("duplicate","Duplicate business row key");const u=Object.create(null);for(const p of t){const f=C(i,p);f!==void 0&&(u[p]=f)}c.set(a,{rowKey:i.rowKey,values:u})}return c}function P(e){return e==null||e===""}function F(e,t){return P(e)?t.missing==="zero"?y.parseDecimal(0):void 0:y.parseDecimal(e)}function Q(e){return{coefficient:-e.coefficient,scale:e.scale}}function X(e,t,r,o){const n=F(e,r),c=Object.is(e,t)?n:F(t,r);if(!n||!c)return{equal:L(e,t,r),ratioUnavailable:"missing"};const s=y.addDecimal(c,Q(n)),d={...s,coefficient:s.coefficient<0n?-s.coefficient:s.coefficient},i=y.compareDecimal(d,r.toleranceValue)<=0;return i&&!o?{equal:i}:n.coefficient===0n?{equal:i,delta:y.printDecimal(s),...s.coefficient===0n&&r.zeroDenominator==="zero-if-equal"?{changeRatio:"0"}:{ratioUnavailable:"zero-denominator"}}:{equal:i,delta:y.printDecimal(s),changeRatio:y.printDecimal(y.divideDecimal(s,n,r.ratioDigits??12))}}function L(e,t,r){return r.missing==="empty-equivalent"&&P(e)&&P(t)||Object.is(e,t)}function Y(e){j(e.fields.map(t=>t.field),b(e.maxFields,256,1024));for(const t of e.fields){if(t.type!==void 0&&!["decimal","value"].includes(t.type))throw new l("value","Invalid comparison field type");if(t.missing&&!["distinct","empty-equivalent","zero"].includes(t.missing))throw new l("value","Invalid missing-value policy");if(t.zeroDenominator&&!["omit","zero-if-equal"].includes(t.zeroDenominator))throw new l("value","Invalid zero-denominator policy");if(t.missing==="zero"&&t.type!=="decimal")throw new l("value","Zero missing-value policy requires a decimal field");if(t.tolerance!==void 0&&(t.type!=="decimal"||y.compareDecimal(y.parseDecimal(t.tolerance),y.parseDecimal(0))<0))throw new l("value","Tolerance requires a non-negative decimal");if(t.ratioDigits!==void 0&&(!Number.isInteger(t.ratioDigits)||t.ratioDigits<0||t.ratioDigits>100))throw new l("value","Invalid ratio precision")}return e.fields.map(t=>({...t,toleranceValue:y.parseDecimal(t.tolerance??"0")}))}function M(e,t,r,o,n){let c=!1;for(const s of r){const d=e?C(e,s.field):void 0,i=t?C(t,s.field):void 0,a=s.type==="decimal"?X(d,i,s,!e||!t):{equal:L(d,i,s)};if(e&&t&&a.equal)continue;if(c=!0,o.length>=n)throw new l("limit","Report differences exceed their budget");const{equal:u,...p}=a;o.push({rowKey:(t??e).rowKey,kind:e?t?"changed":"removed":"added",field:s.field,label:s.label??s.field,before:d,after:i,...p})}return c}function ee(e,t,r){O(e),O(t);const o=Y(r);if(e.datasetId!==t.datasetId||e.sourceScope!==t.sourceScope)throw new l("identity","Comparison requires the same business dataset and source scope");const n=r.fields.map(u=>u.field),c=q(e.rows,n,r),s=q(t.rows,n,r),d=b(r.maxDifferences,2e4,1e5),i=[],a={added:0,removed:0,changed:0,unchanged:0,cells:0};for(const[u,p]of c){const f=s.get(u),m=M(p,f,o,i,d);f?m?a.changed++:a.unchanged++:a.removed++}for(const[u,p]of s)c.has(u)||(M(void 0,p,o,i,d),a.added++);return a.cells=i.length,{sourceScope:t.sourceScope,datasetId:t.datasetId,differences:i,counts:a}}function K(e,t){O(t),j(t.fields,b(t.maxFields,256,1024));const r=b(t.maxCells,1e6,2e6),o=new Set(t.fields),n=new Map,c=g.createReportCellResolver(e);let s=0;for(const[d,i]of e.pages.entries())for(const[a,u]of i.components.entries()){if(!u.grid)continue;for(const f of u.grid.cells)if(s+=f.length,s>r)throw new l("limit","Report cell scan exceeds its budget");const p=N.resolveGridLayout(u.grid,u.widthMm,u.heightMm).cells;for(const f of p){const m=c({pageIndex:d,componentIndex:a,rowIndex:f.ri,columnIndex:f.ci}),w=m?.source;if(!m||!w||w.datasetId!==t.datasetId||w.sourceScope!==t.sourceScope||!o.has(w.field))continue;k(w.rowKey);const I=g.reportCellEditKey(m),h=n.get(I);h?(!Object.is(h.context.value,m.value)||h.context.source?.revision!==w.revision||h.context.source?.sourceToken!==w.sourceToken||h.context.editable!==m.editable)&&(h.ambiguous=!0):n.set(I,{context:m,ambiguous:!1})}}return n}function te(e,t){const r=K(e,t),o=new Map,n=b(t.maxRows,5e4,1e5);for(const{context:c,ambiguous:s}of r.values()){if(s)throw new l("conflict","Repeated report cells disagree for the same business field");const d=c.source,i=k(d.rowKey);let a=o.get(i);if(!a){if(o.size>=n)throw new l("limit","Report row extraction exceeds its budget");a={rowKey:d.rowKey,values:Object.create(null)},o.set(i,a)}a.values[d.field]=c.value}return{sourceScope:t.sourceScope,datasetId:t.datasetId,rows:[...o.values()]}}function _(e){return e==null||e===""}function re(e,t,r){if(!t){e.reason="missing-target";return}const{context:o,ambiguous:n}=t;if(e.before=o.value,n){e.status="conflict",e.reason="ambiguous";return}if(!o.editable||r.canEdit?.(o)===!1){e.reason="readonly";return}if(_(e.after)){e.reason="missing-source";return}if(Object.is(o.value,e.after)){e.status="matched",e.reason="unchanged";return}if(r.mode!=="replace"&&!_(o.value)){e.reason="occupied";return}try{const c=g.editFromContext(o,e.after);if(Object.is(c.value,c.previousValue)){e.status="matched",e.reason="unchanged";return}return e.after=c.value,e.status="changed",c}catch{e.status="conflict",e.reason="invalid";return}}function oe(e,t){if(O(t),t.mode!==void 0&&t.mode!=="empty"&&t.mode!=="replace")throw new l("value","Invalid prefill policy");const r=b(t.maxFields,256,1024),o=t.fields.map(f=>f.field),n=[...new Set(t.fields.map(f=>f.sourceField??f.field))];j(o,r),j(n,r);const c=q(t.rows,n,t),s=K(e,{...t,fields:o}),d=b(t.maxChanges,1e4,1e4),i=b(t.maxCells,1e6,2e6);if(c.size*o.length>i)throw new l("limit","Prefill review exceeds its budget");const a=[],u=[],p={matched:0,changed:0,skipped:0,conflict:0};for(const f of c.values())for(const m of t.fields){const w={sourceScope:t.sourceScope,datasetId:t.datasetId,rowKey:f.rowKey,field:m.field},I={source:w,label:m.label??m.field,status:"skipped",after:C(f,m.sourceField??m.field)},h=g.reportCellEditKey({address:{pageIndex:0,componentIndex:0,rowIndex:0,columnIndex:0},source:w}),D=re(I,s.get(h),t);if(D){if(u.length>=d)throw new l("limit","Prefill changes exceed the atomic edit budget");u.push(D)}p[I.status]++,a.push(I)}return{sourceScope:t.sourceScope,datasetId:t.datasetId,items:a,counts:p,edits:u}}function ne(e,t,r){if(t.counts.conflict>0)throw new l("conflict","Resolve prefill conflicts before applying");if(t.edits.length>1e4)throw new l("limit","Prefill changes exceed the atomic edit budget");if(!t.edits.length)return[];const o=[...new Set(t.edits.map(s=>s.source.field))],n=K(e,{sourceScope:t.sourceScope,datasetId:t.datasetId,fields:o}),c=new Set;return t.edits.map(s=>{if(!s.source||s.source.datasetId!==t.datasetId||s.source.sourceScope!==t.sourceScope)throw new l("identity","Prefill identity changed");const d=g.reportCellEditKey(s),i=n.get(d);if(c.has(d))throw new l("duplicate","Duplicate prefill target");if(c.add(d),!i||i.ambiguous||g.sourceChanged(i.context,s)||!Object.is(i.context.value,s.previousValue))throw new l("conflict","Prefill target changed; reload the preview");if(!i.context.editable||r?.(i.context)===!1)throw new l("conflict","Prefill target is read-only");return{address:{...i.context.address},value:g.editFromContext(i.context,s.value).value}})}exports.ReportDataError=l;exports.ReportDrillError=v;exports.compareReportData=ee;exports.createPageWindowIndex=B;exports.createReportDrillRequest=Z;exports.createReportPrefill=oe;exports.dataLimit=b;exports.indexReportDataCells=K;exports.matchReportDrillActions=U;exports.reportDataSnapshotFromPlan=te;exports.reportPrefillInputs=ne;exports.resolveReportDrillReturn=H;exports.validateReportDrillActions=A;
@@ -1 +0,0 @@
1
- "use strict";const i=require("./json-snapshot-nyV63AbB.cjs"),a=require("./sha256-DgZAKXqI.cjs"),f=require("./workbook-sheets-CaPAulQ6.cjs");function g(e){return e&&{...e,sheetNames:f.snapshotSheetNames(e.sheetNames),additionalSheets:f.snapshotAdditionalSheets(e.additionalSheets)}}function w(e){if(!e)return;const t=r=>{if(!(r instanceof Uint8Array)&&!(r instanceof ArrayBuffer))throw new i.ReportSourceError("validate","字体应为 Uint8Array 或 ArrayBuffer");if(r.byteLength>32e6)throw new a.ReportRuntimeError("budget","单份字体超过 32 MB","$.pdf");return new Uint8Array(r instanceof Uint8Array?r:new Uint8Array(r))};if(e.customFontFaces){const r=e.customFontFaces;return{customFontName:e.customFontName,customFontFaces:{regular:t(r.regular),...r.bold?{bold:t(r.bold)}:{},...r.italic?{italic:t(r.italic)}:{},...r.boldItalic?{boldItalic:t(r.boldItalic)}:{}}}}return{customFontName:e.customFontName,...e.customFontBytes?{customFontBytes:t(e.customFontBytes)}:{}}}function u(e){const t=e?.customFontFaces??(e?.customFontBytes?{regular:e.customFontBytes}:void 0);if(!t)return;const r=["regular","bold","italic","boldItalic"].map(o=>{const n=t[o];if(!n)return[o,null];const s=n instanceof Uint8Array?n:new Uint8Array(n);if(s.byteLength>32e6)throw new a.ReportRuntimeError("budget","单份字体超过 32 MB","$.pdf");return[o,a.portableSha256Hex(s)]});return a.portableSha256Hex(new TextEncoder().encode(JSON.stringify(r)))}const d=new WeakMap;function v(e,t,r){const o=p(e,t,r);let n=!0;return{prepared:o,forward(){if(!n)throw new Error("报表快照只能交接一次");return n=!1,d.set(o,t),o}}}function p(e,t,r){if(a.throwIfAborted(r),!Number.isSafeInteger(t)||t<=0)throw new a.ReportRuntimeError("budget","快照预算应为正安全整数","$.budget.maxPreparedBytes");const o=d.get(e);if(d.delete(e),o!==void 0&&o<=t)return e;const n=i.snapshotReportJson(e,{maxBytes:t,maxNodes:t,check:()=>a.throwIfAborted(r),error:(s,c)=>s==="budget"?new a.ReportRuntimeError("budget",c,"$.budget.maxPreparedBytes"):new i.ReportSourceError("validate",c)});return y(n),n}function l(e){if(e===void 0)return!0;if(!Array.isArray(e))return!1;const t=new Set;return e.every(r=>!r||typeof r!="object"||Array.isArray(r)||typeof r.reportId!="string"||!r.reportId.trim()||!Number.isSafeInteger(r.reportIndex)||r.reportIndex<0||t.has(r.reportIndex)||typeof r.reportScope!="string"||!r.reportScope.trim()||r.reportScope.length>4096||r.revision!==void 0&&typeof r.revision!="string"||r.sourceToken!==void 0&&typeof r.sourceToken!="string"?!1:(t.add(r.reportIndex),!0))}function y(e){if(!l(e.sources))throw new i.ReportSourceError("validate","准备结果来源清单无效");if(!e?.stats||["rows","pages","cells"].some(t=>!Number.isSafeInteger(e.stats[t])||e.stats[t]<0)||!Number.isFinite(e.stats.durationMs)||e.stats.durationMs<0)throw new i.ReportSourceError("validate","准备结果统计无效");if(!Array.isArray(e.diagnostics)||e.diagnostics.some(t=>!t||typeof t.code!="string"||typeof t.message!="string"||!["info","warning","error"].includes(t.severity)||!i.hasValidDataExplanation(t)))throw new i.ReportSourceError("validate","准备结果诊断无效");if(!e.revisions||typeof e.revisions!="object"||Array.isArray(e.revisions)||Object.values(e.revisions).some(t=>!t||typeof t!="object"||t.revision!==void 0&&typeof t.revision!="string"||t.sourceToken!==void 0&&typeof t.sourceToken!="string"))throw new i.ReportSourceError("validate","准备结果修订无效");if(e.layout&&(!["heuristic","provided","font-bytes"].includes(e.layout.textMetrics)||e.layout.fontFingerprint!==void 0&&!/^[a-f0-9]{64}$/.test(e.layout.fontFingerprint)))throw new i.ReportSourceError("validate","准备结果字体度量标识无效")}function m(e){if(e.layoutPolicy!==void 0&&!["verify","preserve"].includes(e.layoutPolicy))throw new i.ReportSourceError("validate","无效的 layoutPolicy");if(e.format!=="pdf")return;if(e.layoutPolicy==="preserve"&&!e.prepared.layout?.fontFingerprint){e.prepared.diagnostics.push({code:"prepared-layout-preserved",severity:"info",message:"显式保持现有分页与几何;未验证排版字体身份,实际 PDF 输出仍遵循 fidelity 校验。"});return}const t=e.prepared.layout?.fontFingerprint,r=u(e.pdf);if(t===r&&(t!==void 0||e.prepared.layout?.textMetrics==="heuristic"&&!r))return;const o="已准备计划的字体度量无法与本次 PDF 字体确认一致;保持现有分页,未重新查询或排版。请在 prepare 和 exportPrepared 提供相同字体字节。";if(e.fidelity==="strict")throw new i.ReportSourceError("validate",o);e.prepared.diagnostics.push({code:"prepared-font-metrics",severity:"warning",message:o})}exports.capturePreparedHandoff=v;exports.checkPreparedFont=m;exports.reportFontFingerprint=u;exports.snapshotPdfFonts=w;exports.snapshotPreparedReport=p;exports.snapshotXlsxOptions=g;exports.validPreparedSources=l;exports.validatePreparedMetadata=y;
@@ -1,88 +0,0 @@
1
- import { R as a, x as u, s as p } from "./json-snapshot-DvQbZlD7.js";
2
- import { R as s, t as c, p as l } from "./sha256-BDQ1Qk7A.js";
3
- import { s as y, a as g } from "./workbook-sheets-D4M7XXBh.js";
4
- function P(e) {
5
- return e && { ...e, sheetNames: g(e.sheetNames), additionalSheets: y(e.additionalSheets) };
6
- }
7
- function S(e) {
8
- if (!e) return;
9
- const t = (r) => {
10
- if (!(r instanceof Uint8Array) && !(r instanceof ArrayBuffer)) throw new a("validate", "字体应为 Uint8Array 或 ArrayBuffer");
11
- if (r.byteLength > 32e6) throw new s("budget", "单份字体超过 32 MB", "$.pdf");
12
- return new Uint8Array(r instanceof Uint8Array ? r : new Uint8Array(r));
13
- };
14
- if (e.customFontFaces) {
15
- const r = e.customFontFaces;
16
- return { customFontName: e.customFontName, customFontFaces: { regular: t(r.regular), ...r.bold ? { bold: t(r.bold) } : {}, ...r.italic ? { italic: t(r.italic) } : {}, ...r.boldItalic ? { boldItalic: t(r.boldItalic) } : {} } };
17
- }
18
- return { customFontName: e.customFontName, ...e.customFontBytes ? { customFontBytes: t(e.customFontBytes) } : {} };
19
- }
20
- function m(e) {
21
- const t = e?.customFontFaces ?? (e?.customFontBytes ? { regular: e.customFontBytes } : void 0);
22
- if (!t) return;
23
- const r = ["regular", "bold", "italic", "boldItalic"].map((o) => {
24
- const i = t[o];
25
- if (!i) return [o, null];
26
- const n = i instanceof Uint8Array ? i : new Uint8Array(i);
27
- if (n.byteLength > 32e6) throw new s("budget", "单份字体超过 32 MB", "$.pdf");
28
- return [o, l(n)];
29
- });
30
- return l(new TextEncoder().encode(JSON.stringify(r)));
31
- }
32
- const d = /* @__PURE__ */ new WeakMap();
33
- function I(e, t, r) {
34
- const o = w(e, t, r);
35
- let i = !0;
36
- return { prepared: o, forward() {
37
- if (!i) throw new Error("报表快照只能交接一次");
38
- return i = !1, d.set(o, t), o;
39
- } };
40
- }
41
- function w(e, t, r) {
42
- if (c(r), !Number.isSafeInteger(t) || t <= 0) throw new s("budget", "快照预算应为正安全整数", "$.budget.maxPreparedBytes");
43
- const o = d.get(e);
44
- if (d.delete(e), o !== void 0 && o <= t) return e;
45
- const i = p(e, {
46
- maxBytes: t,
47
- maxNodes: t,
48
- check: () => c(r),
49
- error: (n, f) => n === "budget" ? new s("budget", f, "$.budget.maxPreparedBytes") : new a("validate", f)
50
- });
51
- return b(i), i;
52
- }
53
- function v(e) {
54
- if (e === void 0) return !0;
55
- if (!Array.isArray(e)) return !1;
56
- const t = /* @__PURE__ */ new Set();
57
- return e.every((r) => !r || typeof r != "object" || Array.isArray(r) || typeof r.reportId != "string" || !r.reportId.trim() || !Number.isSafeInteger(r.reportIndex) || r.reportIndex < 0 || t.has(r.reportIndex) || typeof r.reportScope != "string" || !r.reportScope.trim() || r.reportScope.length > 4096 || r.revision !== void 0 && typeof r.revision != "string" || r.sourceToken !== void 0 && typeof r.sourceToken != "string" ? !1 : (t.add(r.reportIndex), !0));
58
- }
59
- function b(e) {
60
- if (!v(e.sources)) throw new a("validate", "准备结果来源清单无效");
61
- if (!e?.stats || ["rows", "pages", "cells"].some((t) => !Number.isSafeInteger(e.stats[t]) || e.stats[t] < 0) || !Number.isFinite(e.stats.durationMs) || e.stats.durationMs < 0) throw new a("validate", "准备结果统计无效");
62
- if (!Array.isArray(e.diagnostics) || e.diagnostics.some((t) => !t || typeof t.code != "string" || typeof t.message != "string" || !["info", "warning", "error"].includes(t.severity) || !u(t))) throw new a("validate", "准备结果诊断无效");
63
- if (!e.revisions || typeof e.revisions != "object" || Array.isArray(e.revisions) || Object.values(e.revisions).some((t) => !t || typeof t != "object" || t.revision !== void 0 && typeof t.revision != "string" || t.sourceToken !== void 0 && typeof t.sourceToken != "string")) throw new a("validate", "准备结果修订无效");
64
- if (e.layout && (!["heuristic", "provided", "font-bytes"].includes(e.layout.textMetrics) || e.layout.fontFingerprint !== void 0 && !/^[a-f0-9]{64}$/.test(e.layout.fontFingerprint))) throw new a("validate", "准备结果字体度量标识无效");
65
- }
66
- function x(e) {
67
- if (e.layoutPolicy !== void 0 && !["verify", "preserve"].includes(e.layoutPolicy)) throw new a("validate", "无效的 layoutPolicy");
68
- if (e.format !== "pdf") return;
69
- if (e.layoutPolicy === "preserve" && !e.prepared.layout?.fontFingerprint) {
70
- e.prepared.diagnostics.push({ code: "prepared-layout-preserved", severity: "info", message: "显式保持现有分页与几何;未验证排版字体身份,实际 PDF 输出仍遵循 fidelity 校验。" });
71
- return;
72
- }
73
- const t = e.prepared.layout?.fontFingerprint, r = m(e.pdf);
74
- if (t === r && (t !== void 0 || e.prepared.layout?.textMetrics === "heuristic" && !r)) return;
75
- const o = "已准备计划的字体度量无法与本次 PDF 字体确认一致;保持现有分页,未重新查询或排版。请在 prepare 和 exportPrepared 提供相同字体字节。";
76
- if (e.fidelity === "strict") throw new a("validate", o);
77
- e.prepared.diagnostics.push({ code: "prepared-font-metrics", severity: "warning", message: o });
78
- }
79
- export {
80
- P as a,
81
- v as b,
82
- I as c,
83
- w as d,
84
- x as e,
85
- m as r,
86
- S as s,
87
- b as v
88
- };
@@ -1 +0,0 @@
1
- "use strict";function o(t){if(t?.aborted)throw t.reason??new DOMException("The operation was aborted.","AbortError")}function c(t){try{Promise.resolve(t()).catch(()=>{})}catch{}}function b(t,e,r){o(t.signal),c(()=>t.onProgress?.(e,r)),o(t.signal)}function d(t,e){const r=Promise.resolve(t);return e?.aborted?(r.catch(()=>{}),Promise.reject(e.reason??new DOMException("The operation was aborted.","AbortError"))):e?new Promise((n,u)=>{const a=()=>e.removeEventListener("abort",i),i=()=>{a(),u(e.reason??new DOMException("The operation was aborted.","AbortError"))};e.addEventListener("abort",i,{once:!0}),r.then(s=>{a(),n(s)},s=>{a(),u(s)}),e.aborted&&i()}):r}function f(t,e){const r=()=>e.abort(t?.reason);return t?.addEventListener("abort",r,{once:!0}),t?.aborted&&r(),()=>t?.removeEventListener("abort",r)}async function w(t,e,r){b(t,e,r),(t.signal||t.onProgress)&&await new Promise(n=>setTimeout(n,0)),o(t.signal)}function p(t){let e=0,r=Date.now();return(n=1)=>{if(o(t.signal),e+=n,!(e<4096&&Date.now()-r<8))return e=0,new Promise(u=>setTimeout(u,0)).then(()=>{r=Date.now(),o(t.signal)})}}exports.assertOutputActive=o;exports.createOutputScheduler=p;exports.forwardOutputAbort=f;exports.notifyOutputProgress=b;exports.observeOutput=c;exports.outputCheckpoint=w;exports.waitForOutput=d;
@@ -1,52 +0,0 @@
1
- function n(e) {
2
- if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
3
- }
4
- function c(e) {
5
- try {
6
- Promise.resolve(e()).catch(() => {
7
- });
8
- } catch {
9
- }
10
- }
11
- function b(e, t, r) {
12
- n(e.signal), c(() => e.onProgress?.(t, r)), n(e.signal);
13
- }
14
- function d(e, t) {
15
- const r = Promise.resolve(e);
16
- return t?.aborted ? (r.catch(() => {
17
- }), Promise.reject(t.reason ?? new DOMException("The operation was aborted.", "AbortError"))) : t ? new Promise((o, a) => {
18
- const s = () => t.removeEventListener("abort", i), i = () => {
19
- s(), a(t.reason ?? new DOMException("The operation was aborted.", "AbortError"));
20
- };
21
- t.addEventListener("abort", i, { once: !0 }), r.then((u) => {
22
- s(), o(u);
23
- }, (u) => {
24
- s(), a(u);
25
- }), t.aborted && i();
26
- }) : r;
27
- }
28
- function f(e, t) {
29
- const r = () => t.abort(e?.reason);
30
- return e?.addEventListener("abort", r, { once: !0 }), e?.aborted && r(), () => e?.removeEventListener("abort", r);
31
- }
32
- async function w(e, t, r) {
33
- b(e, t, r), (e.signal || e.onProgress) && await new Promise((o) => setTimeout(o, 0)), n(e.signal);
34
- }
35
- function v(e) {
36
- let t = 0, r = Date.now();
37
- return (o = 1) => {
38
- if (n(e.signal), t += o, !(t < 4096 && Date.now() - r < 8))
39
- return t = 0, new Promise((a) => setTimeout(a, 0)).then(() => {
40
- r = Date.now(), n(e.signal);
41
- });
42
- };
43
- }
44
- export {
45
- c as a,
46
- n as b,
47
- v as c,
48
- f,
49
- b as n,
50
- w as o,
51
- d as w
52
- };
@@ -1 +0,0 @@
1
- "use strict";const d=require("./grid-geometry-D8ReblRV.cjs"),u=require("./computed-4TnxzgIh.cjs");function y(e){if(!e||e.kind==="date")return;const t=e.digits;if(!(t!==void 0&&(!Number.isInteger(t)||t<0||t>100))){if(e.kind==="percent"){const r=t??2;return`0${r?`.${"0".repeat(r)}`:""}%`}return t===void 0?e.thousands?"#,##0.###############":void 0:`${e.thousands?"#,##0":"0"}${t?`.${"0".repeat(t)}`:""}`}}function h(e){const t=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(e.trim());if(t){const n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(n.getTime())?null:n}const r=new Date(e);return Number.isNaN(r.getTime())?null:r}function g(e,t){return e.toLocaleString("en-US",{minimumFractionDigits:t,maximumFractionDigits:t})}function $(e,t){const r=n=>String(n).padStart(2,"0");return t.replace(/YYYY/g,String(e.getFullYear())).replace(/MM/g,r(e.getMonth()+1)).replace(/DD/g,r(e.getDate())).replace(/hh/g,r(e.getHours())).replace(/mm/g,r(e.getMinutes())).replace(/ss/g,r(e.getSeconds()))}function x(e,t,r){return r!=null?t?g(e,r):e.toFixed(r):t?g(e):String(e)}function c(e){const t=typeof e=="number"?e:Number(String(e).replace(/,/g,""));return Number.isFinite(t)?t:null}function b(e,t){if(e==null||e===""||!t)return String(e??"");switch(t.kind){case"number":{if(typeof e=="string")try{return u.formatDecimal(e,t.digits,t.thousands===!0)}catch{return e}const r=c(e);return r==null?String(e):x(r,t.thousands===!0,t.digits)}case"percent":{if(typeof e=="string")try{return u.formatDecimal(e,t.digits??2,!0,!0)}catch{return e}const r=c(e);return r==null?String(e):`${g(r*100,t.digits??2)}%`}case"date":{const r=t.pattern??"YYYY-MM-DD",n=e instanceof Date?e:h(String(e));return n?$(n,r):String(e)}default:return String(e)}}function p(e,t){return u.compileReportPredicate(t)(e)}function S(e,t,r,n=e.paddingMm??1){return t.field!==e.tree.labelField?0:Math.min(r.depth*(e.tree.indentMm??3),Math.max(0,t.widthMm-n*2-4))}function N(e,t,r,n){const i=n.tree;(i.input==="nested"||[i.idField,i.parentField].includes(t.field))&&(e.editable=!1),r.hasChildren&&i.parentValues==="leaf-aggregate"&&i.aggregates?.some(s=>s.field===t.field)&&(e.derived=!0,e.editable=!1)}function D(e,t,r){return r==="identifier"||r==="dimension"||r==="date"?"center":r==="measure"?"right":r==="text"?"left":t?.kind==="number"||t?.kind==="percent"?"right":t?.kind==="date"||e instanceof Date||typeof e=="boolean"?"center":typeof e=="number"&&Number.isFinite(e)?"right":"left"}function T(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="boolean")return e?"是":"否";if(e instanceof Date)return e.toISOString().slice(0,10);try{return JSON.stringify(e)}catch{return String(e)}}function C(e,t){let r=d.mergeComponentStyles({fontSize:e.fontSizePt??d.DEFAULT_FONT_PT,bold:e.headerBold??!0,align:"center",verticalAlign:"middle",backgroundColor:e.headerBackgroundColor},t.style);return e.headerAlign!==void 0&&(r.align=e.headerAlign),r=d.mergeComponentStyles(r,e.headerStyle),t.headerAlign!==void 0&&(r.align=t.headerAlign),d.mergeComponentStyles(r,t.headerStyle)}function M(e,t,r){(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"&&Number.isFinite(r))&&(e.value=r);const n=t.format?.kind==="number"||t.format?.kind==="percent";t.valueType!==void 0?e.valueType=t.valueType:n&&(e.valueType="number"),t.editable!==void 0&&(e.editable=t.editable);const i=y(t.format);(typeof e.value=="number"||e.value==null)&&i!==void 0&&(e.numberFormat=i)}function F(e,t,r){const n=!!t.visibleWhen&&!p(r,t.visibleWhen),i=n?null:r[t.field],s=t.align??t.style?.align??e.align??"left";let a=d.mergeComponentStyles({fontSize:e.fontSizePt??d.DEFAULT_FONT_PT,verticalAlign:"middle"},t.style);a.align=s==="auto"?D(i,t.format,t.semanticRole):s;const o=t.rules?.find(f=>p(r,f.when));o&&(a=d.mergeComponentStyles(a,o.style));const l={text:t.format?b(i,t.format):T(i),style:a};return M(l,t,i),e.computed?.some(f=>f.field===t.field)&&(l.derived=!0,l.editable=!1),n&&(l.editable=!1),l}function w(e,t,r){const n=F(e,t,r.row),i=S(e,t,r);return t.field===e.tree.labelField&&(n.style={...n.style,align:"left"}),i&&(n.indentMm=i),N(n,t,r,e),n}function A(e){return typeof e=="string"&&/^data:image\/(png|jpe?g);base64,[A-Za-z0-9+/\r\n]+=*$/.test(e)}class m extends Error{constructor(t,r,n,i){super(`${t}: ${r}`),this.path=t,this.rowIndex=n,this.field=i,this.code="report-binding",this.name="ReportBindingError"}}function L(e,t,r={}){const n=r.rowIndex??0,s=`$.datasets.${r.dataset??"label"}[${n}].${t}`,a=Object.getOwnPropertyDescriptor(e,t);if(!a||a.get||a.set)throw new m(s,"字段必须是记录的自有数据字段,不能缺失、使用访问器或从原型继承",n,t);const o=a.value;if(o==null||typeof o=="string"||typeof o=="boolean"||typeof o=="number"&&Number.isFinite(o))return o;throw new m(s,"绑定值应为字符串、有限数字、布尔值或空值",n,t)}function k(e,t,r={}){const n=L(t,e.field,r);return n==null||n===""?e.emptyText??"":`${e.prefix??""}${b(n,e.format)}${e.suffix??""}`}exports.ReportBindingError=m;exports.applyListTreeMetadata=N;exports.evalStyleRule=p;exports.formatValue=b;exports.isLabelImageData=A;exports.listCellText=T;exports.listTreeIndent=S;exports.parseDateLocal=h;exports.readRecordScalar=L;exports.resolveComponentBinding=k;exports.resolveListAutoAlignment=D;exports.resolveListHeaderStyle=C;exports.resolveListSampleCell=F;exports.resolveTreeListSampleCell=w;exports.toExcelNumberFormat=y;exports.toNumber=c;