@agile-team/mach-report 2.14.0 → 2.15.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 (256) hide show
  1. package/README.md +16 -11
  2. package/THIRD_PARTY_NOTICES.md +3 -1
  3. package/dist/{ExcelBindingWizard-CvsWR8Ga.js → ExcelBindingWizard-BKH1nGNS.js} +3 -3
  4. package/dist/{ExcelBindingWizard-CLT2p7P3.cjs → ExcelBindingWizard-Bs43BGNp.cjs} +1 -1
  5. package/dist/ParamEditor-Da4akw6V.cjs +1 -0
  6. package/dist/ParamEditor-DoAhzJsm.js +594 -0
  7. package/dist/{ReportBatchPanel-LqVgiqp7.js → ReportBatchPanel-BMf6boMA.js} +39 -39
  8. package/dist/{ReportBatchPanel-DkxTzBkD.cjs → ReportBatchPanel-wP9m9Pj1.cjs} +1 -1
  9. package/dist/ReportPreview-ChV19HBp.js +4619 -0
  10. package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
  11. package/dist/{ReportTemplateLibrary-MjWEtc7X.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
  12. package/dist/{ReportTemplateLibrary-cQ1sqNYo.cjs → ReportTemplateLibrary-Sxr3eD0J.cjs} +1 -1
  13. package/dist/{RuleEditor-ChuXMlei.js → RuleEditor-C_Clasvd.js} +5 -5
  14. package/dist/{RuleEditor-BaR6xUiI.cjs → RuleEditor-XhGHK8DE.cjs} +1 -1
  15. package/dist/{TemplateOutlinePanel-Dci6aRn1.js → TemplateOutlinePanel-D6Bkny59.js} +2 -2
  16. package/dist/{TemplateOutlinePanel-BHKP89Xz.cjs → TemplateOutlinePanel-JTSR53vJ.cjs} +1 -1
  17. package/dist/{TemplateReusePanel-CY5eO2Sh.cjs → TemplateReusePanel-Kx35S0Ql.cjs} +1 -1
  18. package/dist/{TemplateReusePanel-B7Gmyc1z.js → TemplateReusePanel-rVuK1kTz.js} +2 -2
  19. package/dist/{TemplateReviewPanel-DjlX3xpt.js → TemplateReviewPanel-B0ar9_zf.js} +2 -2
  20. package/dist/{TemplateReviewPanel-JvZe9_4G.cjs → TemplateReviewPanel-Dn6X9UmY.cjs} +1 -1
  21. package/dist/analytics.cjs +1 -1
  22. package/dist/analytics.d.cts +3 -1
  23. package/dist/analytics.d.ts +3 -1
  24. package/dist/analytics.js +154 -60
  25. package/dist/artifact-integrity.json +135 -0
  26. package/dist/assets-B9ImAi6_.cjs +1 -0
  27. package/dist/assets-DEaz4qsp.js +124 -0
  28. package/dist/batch-BaP6pWDE.cjs +1 -0
  29. package/dist/batch-BfZHN1do.js +220 -0
  30. package/dist/batch-CGyt-b2W.js +273 -0
  31. package/dist/batch-CLpELXBl.cjs +1 -0
  32. package/dist/capabilities-CAh2Nrue.cjs +1 -0
  33. package/dist/capabilities-DskCHs3V.js +69 -0
  34. package/dist/codes.d.cts +2 -0
  35. package/dist/codes.d.ts +2 -0
  36. package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
  37. package/dist/config-BVsJXSqS.js +842 -0
  38. package/dist/config-D10us76d.cjs +1 -0
  39. package/dist/data-explanation-B8MZRYVS.js +16 -0
  40. package/dist/data-explanation-DE55G30w.cjs +1 -0
  41. package/dist/designer-2bDlcNXQ.js +5136 -0
  42. package/dist/designer-BT7XCdbW.cjs +2 -0
  43. package/dist/designer.cjs +1 -1
  44. package/dist/designer.d.cts +144 -16
  45. package/dist/designer.d.ts +144 -16
  46. package/dist/designer.js +1 -1
  47. package/dist/drill-ByJviLXS.js +145 -0
  48. package/dist/drill-DYTxuL3A.cjs +1 -0
  49. package/dist/{font-loader-vhCT8znW.cjs → font-loader-B_UkxpzC.cjs} +1 -1
  50. package/dist/{font-loader-DHto6Lra.js → font-loader-Q3bQjmrI.js} +1 -1
  51. package/dist/index.cjs +8 -8
  52. package/dist/index.d.cts +82 -4
  53. package/dist/index.d.ts +82 -4
  54. package/dist/index.js +785 -820
  55. package/dist/json-snapshot-DFb2eWkf.js +1416 -0
  56. package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
  57. package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
  58. package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
  59. package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
  60. package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
  61. package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
  62. package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
  63. package/dist/licenses/_types_node-14.18.63.txt +22 -0
  64. package/dist/licenses/_types_pako-2.0.3.txt +22 -0
  65. package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
  66. package/dist/licenses/archiver-5.3.2.txt +23 -0
  67. package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
  68. package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
  69. package/dist/licenses/async-3.2.6.txt +20 -0
  70. package/dist/licenses/balanced-match-1.0.2.txt +22 -0
  71. package/dist/licenses/base64-js-1.5.1.txt +22 -0
  72. package/dist/licenses/big-integer-1.6.52.txt +25 -0
  73. package/dist/licenses/binary-0.3.0.txt +178 -0
  74. package/dist/licenses/bl-4.1.0.txt +14 -0
  75. package/dist/licenses/bluebird-3.4.7.txt +22 -0
  76. package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
  77. package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
  78. package/dist/licenses/buffer-5.7.1.txt +22 -0
  79. package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
  80. package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
  81. package/dist/licenses/buffers-0.1.1.txt +140 -0
  82. package/dist/licenses/chainsaw-0.1.0.txt +184 -0
  83. package/dist/licenses/compress-commons-4.1.2.txt +23 -0
  84. package/dist/licenses/concat-map-0.0.1.txt +19 -0
  85. package/dist/licenses/core-util-is-1.0.3.txt +20 -0
  86. package/dist/licenses/crc-32-1.2.2.txt +202 -0
  87. package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
  88. package/dist/licenses/dayjs-1.11.23.txt +22 -0
  89. package/dist/licenses/duplexer2-0.1.4.txt +27 -0
  90. package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
  91. package/dist/licenses/exceljs-4.4.0.txt +23 -0
  92. package/dist/licenses/fast-csv-4.3.6.txt +22 -0
  93. package/dist/licenses/fast-png-6.4.0.txt +22 -0
  94. package/dist/licenses/fs-constants-1.0.0.txt +22 -0
  95. package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
  96. package/dist/licenses/fstream-1.0.12.txt +16 -0
  97. package/dist/licenses/glob-7.2.3.txt +22 -0
  98. package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
  99. package/dist/licenses/ieee754-1.2.1.txt +12 -0
  100. package/dist/licenses/immediate-3.0.6.txt +21 -0
  101. package/dist/licenses/inflight-1.0.6.txt +16 -0
  102. package/dist/licenses/inherits-2.0.4.txt +17 -0
  103. package/dist/licenses/iobuffer-5.4.0.txt +23 -0
  104. package/dist/licenses/isarray-1.0.0.txt +61 -0
  105. package/dist/licenses/jszip-3.10.2.txt +652 -0
  106. package/dist/licenses/lazystream-1.0.1.txt +24 -0
  107. package/dist/licenses/lie-3.3.0.txt +8 -0
  108. package/dist/licenses/listenercount-1.0.1.txt +6 -0
  109. package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
  110. package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
  111. package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
  112. package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
  113. package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
  114. package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
  115. package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
  116. package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
  117. package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
  118. package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
  119. package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
  120. package/dist/licenses/lodash.union-4.6.0.txt +48 -0
  121. package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
  122. package/dist/licenses/minimatch-3.1.5.txt +16 -0
  123. package/dist/licenses/minimatch-5.1.9.txt +16 -0
  124. package/dist/licenses/minimist-1.2.8.txt +19 -0
  125. package/dist/licenses/mkdirp-0.5.6.txt +22 -0
  126. package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
  127. package/dist/licenses/normalize-path-3.0.0.txt +22 -0
  128. package/dist/licenses/once-1.4.0.txt +16 -0
  129. package/dist/licenses/pako-1.0.11.txt +22 -0
  130. package/dist/licenses/pako-2.2.0.txt +22 -0
  131. package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
  132. package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
  133. package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
  134. package/dist/licenses/readable-stream-2.3.8.txt +48 -0
  135. package/dist/licenses/readable-stream-3.6.2.txt +48 -0
  136. package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
  137. package/dist/licenses/rimraf-2.7.1.txt +16 -0
  138. package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
  139. package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
  140. package/dist/licenses/saxes-5.0.1.txt +397 -0
  141. package/dist/licenses/setimmediate-1.0.5.txt +21 -0
  142. package/dist/licenses/string_decoder-1.1.1.txt +49 -0
  143. package/dist/licenses/string_decoder-1.3.0.txt +49 -0
  144. package/dist/licenses/tar-stream-2.2.0.txt +22 -0
  145. package/dist/licenses/tmp-0.2.7.txt +22 -0
  146. package/dist/licenses/traverse-0.3.9.txt +25 -0
  147. package/dist/licenses/tslib-1.14.1.txt +13 -0
  148. package/dist/licenses/unzipper-0.10.14.txt +26 -0
  149. package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
  150. package/dist/licenses/uuid-11.1.1.txt +10 -0
  151. package/dist/licenses/wrappy-1.0.2.txt +16 -0
  152. package/dist/licenses/xmlchars-2.2.0.txt +19 -0
  153. package/dist/licenses/zip-stream-4.1.1.txt +23 -0
  154. package/dist/matrix-CGRGkn5s.js +112 -0
  155. package/dist/matrix-gEO7ZM_u.cjs +1 -0
  156. package/dist/media-B7vnpD8k.cjs +1 -0
  157. package/dist/media-Y90dHK9z.js +70 -0
  158. package/dist/param-validation-C3HlcLLO.cjs +1 -0
  159. package/dist/param-validation-Do7Eg8Zv.js +181 -0
  160. package/dist/{pdf-8UPQebOE.js → pdf-BwNyeGpt.js} +4385 -4321
  161. package/dist/{pdf-AyJGb22z.cjs → pdf-CvvrjPQg.cjs} +51 -49
  162. package/dist/pdf.cjs +1 -1
  163. package/dist/pdf.d.cts +18 -3
  164. package/dist/pdf.d.ts +18 -3
  165. package/dist/pdf.js +2 -2
  166. package/dist/{plugin-BGKf-Tqg.js → plugin-Ca_XZG3l.js} +2 -2
  167. package/dist/{plugin-CktLH_Iy.cjs → plugin-DHO7X8z2.cjs} +1 -1
  168. package/dist/prepared-CFy9B75C.cjs +1 -0
  169. package/dist/prepared-ajM-H-9B.js +69 -0
  170. package/dist/progress-B0ctFpKf.cjs +1 -0
  171. package/dist/progress-D-OTpEav.js +52 -0
  172. package/dist/record-bindings-By_UKZ2g.cjs +1 -0
  173. package/dist/record-bindings-Do_b3h4V.js +196 -0
  174. package/dist/{region-binding-workflow-DEJbhpCv.js → region-binding-workflow-BMhK_TjP.js} +1 -1
  175. package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
  176. package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
  177. package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
  178. package/dist/sbom.cdx.json +3982 -0
  179. package/dist/server/node.d.cts +20 -1
  180. package/dist/server/node.d.ts +20 -1
  181. package/dist/server-node.cjs +1 -1
  182. package/dist/server-node.js +247 -237
  183. package/dist/server.cjs +1 -1
  184. package/dist/server.d.cts +772 -4
  185. package/dist/server.d.ts +772 -4
  186. package/dist/server.js +885 -645
  187. package/dist/sha256-ArEYjaTI.cjs +1 -0
  188. package/dist/sha256-DPEuJ3nh.js +155 -0
  189. package/dist/style.css +1 -1
  190. package/dist/template-bindings-C2SpvsMU.js +58 -0
  191. package/dist/template-bindings-CEtWyiLX.cjs +1 -0
  192. package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
  193. package/dist/template-catalog-j2B1MJlL.js +414 -0
  194. package/dist/{template-fragments-CLkGo6To.js → template-fragments-BGbQLGlV.js} +21 -21
  195. package/dist/{template-fragments-DFUpq5QM.cjs → template-fragments-DcKeiylI.cjs} +1 -1
  196. package/dist/{template-outline-B3xVkzSv.cjs → template-outline-BwRV_eRo.cjs} +1 -1
  197. package/dist/{template-outline-CFenM1PV.js → template-outline-cnWfT_LK.js} +3 -3
  198. package/dist/{template-registry-COXDEJEM.js → template-registry-BtaKPELV.js} +364 -201
  199. package/dist/template-registry-Co1zPq5e.cjs +1 -0
  200. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  201. package/dist/textwrap-DE1kgcJB.js +110 -0
  202. package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
  203. package/dist/vue/async.d.cts +123 -14
  204. package/dist/vue/async.d.ts +123 -14
  205. package/dist/vue/index.d.cts +158 -22
  206. package/dist/vue/index.d.ts +158 -22
  207. package/dist/vue-async.cjs +1 -1
  208. package/dist/vue-async.js +3 -3
  209. package/dist/vue.cjs +1 -1
  210. package/dist/vue.js +80 -78
  211. package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
  212. package/dist/{workbook-session-BfK1yHOO.js → workbook-session-BvToI-Fd.js} +5440 -5288
  213. package/dist/worker.cjs +1 -1
  214. package/dist/worker.d.cts +20 -1
  215. package/dist/worker.d.ts +20 -1
  216. package/dist/worker.js +33 -32
  217. package/dist/xlsx-node.cjs +34 -34
  218. package/dist/xlsx-node.js +878 -870
  219. package/dist/xlsx.cjs +3 -4
  220. package/dist/xlsx.d.cts +22 -10
  221. package/dist/xlsx.d.ts +22 -10
  222. package/dist/xlsx.js +261 -253
  223. package/package.json +2 -2
  224. package/dist/ParamEditor-CflQV3eQ.js +0 -526
  225. package/dist/ParamEditor-vIDzvpPV.cjs +0 -1
  226. package/dist/ReportPreview-CvbqLUzM.cjs +0 -6
  227. package/dist/ReportPreview-D_ywJ_-H.js +0 -4533
  228. package/dist/assets-C2U-e-Sz.cjs +0 -4
  229. package/dist/assets-Q0wUwNrV.js +0 -217
  230. package/dist/batch-DzaTNLWI.js +0 -371
  231. package/dist/batch-xMkqYiTr.cjs +0 -1
  232. package/dist/capabilities-CK_7hizc.js +0 -63
  233. package/dist/capabilities-CsZ-pNHR.cjs +0 -1
  234. package/dist/config-0UIohTS7.cjs +0 -1
  235. package/dist/config-Dt9NtCPl.js +0 -566
  236. package/dist/data-explanation-BktvER5B.cjs +0 -1
  237. package/dist/data-explanation-C_J6jYNi.js +0 -16
  238. package/dist/designer-Ci1LizA9.js +0 -5020
  239. package/dist/designer-rtmVIIdN.cjs +0 -2
  240. package/dist/json-snapshot-BeFT3Tso.js +0 -1952
  241. package/dist/json-snapshot-D1NTP2oI.cjs +0 -2
  242. package/dist/matrix-DVyWiYsd.cjs +0 -1
  243. package/dist/matrix-yZsGnldA.js +0 -227
  244. package/dist/page-window-index-CIuT4BAv.js +0 -43
  245. package/dist/page-window-index-DEjnM6IB.cjs +0 -1
  246. package/dist/param-validation-BlHHXs6u.js +0 -153
  247. package/dist/param-validation-DCK039V1.cjs +0 -1
  248. package/dist/progress-7OSZbFok.js +0 -39
  249. package/dist/progress-BnLiS5eH.cjs +0 -1
  250. package/dist/task-events-DQ276fn2.cjs +0 -1
  251. package/dist/task-events-Dpsvf_t2.js +0 -47
  252. package/dist/template-bindings-BJR4k7qZ.cjs +0 -1
  253. package/dist/template-bindings-Daui7hLF.js +0 -252
  254. package/dist/template-registry-D3SjENi6.cjs +0 -1
  255. package/dist/validate-BJ5HIWY8.cjs +0 -1
  256. package/dist/validate-CkQBWCeg.js +0 -163
package/dist/index.js CHANGED
@@ -1,32 +1,36 @@
1
- import { D as te, a as Ce } from "./defaults-DXhiM1ZD.js";
2
- import { b as Xn, c as Zn, d as Qn, L as er, S as tr } from "./defaults-DXhiM1ZD.js";
3
- import { R as rr, e as ir, f as ar, p as or, b as sr, t as lr, d as cr } from "./template-bindings-Daui7hLF.js";
4
- import { a as j, r as U, b as ne, c as G, d as Re, m as se, e as Pe, p as W, f as Ae, P as Z } from "./style-CQ1PK8ZB.js";
5
- import { C as dr, M as hr, g as gr, h as fr } from "./style-CQ1PK8ZB.js";
6
- import { i as re, a as $e } from "./render-plan-Ck6koX9L.js";
7
- import { R as pr } from "./render-plan-Ck6koX9L.js";
8
- import { v as Xe } from "./validate-CkQBWCeg.js";
9
- import { a as br, b as yr, c as vr } from "./validate-CkQBWCeg.js";
10
- import { v as Ze } from "./dataset-H5pFuQGU.js";
11
- import { d as xr } from "./dataset-H5pFuQGU.js";
12
- import { h as le, r as ce, w as ke } from "./assets-Q0wUwNrV.js";
13
- import { O as Sr, c as Tr, a as Cr, b as Rr, m as Pr } from "./assets-Q0wUwNrV.js";
14
- import { R as me, d as Qe, a as et, p as tt, s as nt } from "./json-snapshot-BeFT3Tso.js";
15
- import { D as $r, P as kr, b as Ir, c as Nr, e as Lr, f as Dr, g as Fr, h as Or, i as Hr, j as zr, k as Br, l as Wr, m as _r, n as jr, o as Ur, q as Gr, r as Vr, t as qr, u as Jr, v as Yr, w as Kr, x as Xr, y as Zr, z as Qr, A as ei, B as ti } from "./json-snapshot-BeFT3Tso.js";
16
- import { r as Ie } from "./grid-geometry-BNptEcMm.js";
17
- import { r as Ne } from "./grid-strokes-DyyG1q_o.js";
18
- import { r as q, n as Le, O as rt } from "./capabilities-CK_7hizc.js";
19
- import { i as ri } from "./capabilities-CK_7hizc.js";
20
- import { o as it } from "./progress-7OSZbFok.js";
21
- import { c as at } from "./page-window-index-CIuT4BAv.js";
22
- import { v as De, R as Fe, p as N } from "./template-registry-COXDEJEM.js";
23
- import { a as ai, c as oi, d as si, s as li, b as ci } from "./template-registry-COXDEJEM.js";
24
- import { R as di, a as hi, f as gi, i as fi, b as ui, c as pi, p as wi, r as bi, v as yi, d as vi } from "./param-validation-BlHHXs6u.js";
25
- import { h as xi, i as Ei, a as Si } from "./data-explanation-C_J6jYNi.js";
26
- import { c as Ci, i as Ri, t as Pi } from "./template-outline-CFenM1PV.js";
27
- import { a as $i, c as ki, i as Ii, b as Ni } from "./template-fragments-CLkGo6To.js";
28
- import { T as Di, c as Fi, v as Oi } from "./tree-CqcQ99NM.js";
29
- const ot = {
1
+ import { D as te, a as Te } from "./defaults-DXhiM1ZD.js";
2
+ import { b as Yn, c as Kn, d as Jn, L as Xn, S as Zn } from "./defaults-DXhiM1ZD.js";
3
+ import { R as er, e as tr, f as nr, p as rr, b as ar, t as ir, d as or } from "./record-bindings-Do_b3h4V.js";
4
+ import { a as j, r as _, b as ne, c as G, d as Ce, m as se, e as Re, p as W, f as Pe, P as Z } from "./style-CQ1PK8ZB.js";
5
+ import { C as lr, M as cr, g as mr, h as dr } from "./style-CQ1PK8ZB.js";
6
+ import { i as re, a as Ae } from "./render-plan-Ck6koX9L.js";
7
+ import { R as gr } from "./render-plan-Ck6koX9L.js";
8
+ import { v as $e, R as ke, p as U, a as Je } from "./template-registry-BtaKPELV.js";
9
+ import { b as ur, c as pr, d as wr, e as br, s as Mr, f as yr, g as vr, h as xr } from "./template-registry-BtaKPELV.js";
10
+ import { v as Xe } from "./dataset-H5pFuQGU.js";
11
+ import { d as Sr } from "./dataset-H5pFuQGU.js";
12
+ import { h as le, w as Ie } from "./textwrap-DE1kgcJB.js";
13
+ import { c as Cr, a as Rr, b as Pr, m as Ar } from "./textwrap-DE1kgcJB.js";
14
+ import { R as ce, d as Ze, s as Qe } from "./json-snapshot-DFb2eWkf.js";
15
+ import { D as kr, P as Ir, a as Nr, b as Lr, c as Dr, e as Fr, f as Or, g as Hr, h as zr, i as Wr, p as Br, j as jr, k as _r, r as Ur, l as Gr } from "./json-snapshot-DFb2eWkf.js";
16
+ import { r as Ne } from "./grid-geometry-BNptEcMm.js";
17
+ import { r as Le } from "./grid-strokes-DyyG1q_o.js";
18
+ import { r as q, n as De, O as et } from "./capabilities-DskCHs3V.js";
19
+ import { i as qr } from "./capabilities-DskCHs3V.js";
20
+ import { o as tt } from "./progress-D-OTpEav.js";
21
+ import { r as me } from "./assets-DEaz4qsp.js";
22
+ import { O as Kr } from "./assets-DEaz4qsp.js";
23
+ import { c as nt } from "./drill-ByJviLXS.js";
24
+ import { R as Xr, a as Zr, m as Qr, r as ea, v as ta } from "./drill-ByJviLXS.js";
25
+ import { R as ra, a as aa, f as ia, i as oa, b as sa, c as la, p as ca, r as ma, v as da, d as ha } from "./param-validation-Do7Eg8Zv.js";
26
+ import { c as fa, a as ua, d as pa, r as wa, b as ba } from "./template-catalog-j2B1MJlL.js";
27
+ import { h as ya, i as va, a as xa } from "./data-explanation-B8MZRYVS.js";
28
+ import { c as Sa, i as Ta, t as Ca } from "./template-outline-cnWfT_LK.js";
29
+ import { a as Pa, c as Aa, i as $a, b as ka } from "./template-fragments-BGbQLGlV.js";
30
+ import { R as rt, p as at } from "./batch-CGyt-b2W.js";
31
+ import { a as Na, b as La, c as Da, d as Fa, e as Oa, f as Ha, g as za, r as Wa, s as Ba } from "./batch-CGyt-b2W.js";
32
+ import { T as _a, c as Ua, v as Ga } from "./tree-CjVZLRw7.js";
33
+ const it = {
30
34
  root: "mr-root",
31
35
  page: "mr-page",
32
36
  comp: "mr-comp",
@@ -44,17 +48,17 @@ const ot = {
44
48
  unknown: "mr-unknown"
45
49
  };
46
50
  function T(e, t) {
47
- return t?.classNames?.[e] ?? ot[e];
51
+ return t?.classNames?.[e] ?? it[e];
48
52
  }
49
- class st {
53
+ class ot {
50
54
  constructor() {
51
55
  this.props = [];
52
56
  }
53
57
  add(t, n) {
54
58
  return n == null || n === !1 || n === "" ? this : (this.props.push([t, String(n)]), this);
55
59
  }
56
- mm(t, n, r, i = 2) {
57
- return this.add(t, `${j(se(n, r), i)}px`);
60
+ mm(t, n, r, a = 2) {
61
+ return this.add(t, `${j(se(n, r), a)}px`);
58
62
  }
59
63
  toString() {
60
64
  let t = "";
@@ -67,176 +71,176 @@ class st {
67
71
  n && (t.style.cssText = n);
68
72
  }
69
73
  }
70
- function v(e, t = "unset") {
71
- return new st().add("all", t).add("display", e).add("box-sizing", "border-box");
74
+ function y(e, t = "unset") {
75
+ return new ot().add("all", t).add("display", e).add("box-sizing", "border-box");
72
76
  }
73
- function Oe(e, t, n) {
77
+ function Fe(e, t, n) {
74
78
  e.add("color", t.color).add("font-family", t.fontFamily).add("font-weight", t.bold != null ? t.bold ? "700" : "400" : void 0).add("font-style", t.italic != null ? t.italic ? "italic" : "normal" : void 0).add("text-decoration", t.underline != null ? t.underline ? "underline" : "none" : void 0).add("letter-spacing", t.letterSpacing != null ? `${t.letterSpacing}pt` : void 0).add("line-height", String(ne(t))).add("text-align", t.align);
75
- const r = U(t, n);
79
+ const r = _(t, n);
76
80
  e.add("font-size", `${j(r.fontSizePx, 2)}px`);
77
81
  }
78
- function lt(e, t, n) {
82
+ function st(e, t, n) {
79
83
  const r = t.style ?? {};
80
- Oe(e, r, n), e.add("background-color", r.backgroundColor).add("opacity", r.opacity != null ? String(r.opacity) : void 0).add("transform", r.rotateDeg ? `rotate(${r.rotateDeg}deg)` : void 0);
84
+ Fe(e, r, n), e.add("background-color", r.backgroundColor).add("opacity", r.opacity != null ? String(r.opacity) : void 0).add("transform", r.rotateDeg ? `rotate(${r.rotateDeg}deg)` : void 0);
81
85
  }
82
- function ct(e, t, n, r, i, o) {
83
- const s = e.cell, a = o.createElement("td");
84
- a.className = T("cell", i), a.dataset.mrRowIndex = String(e.ri), a.dataset.mrColumnIndex = String(e.ci), a.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), s.colSpan && (a.colSpan = s.colSpan), s.rowSpan && (a.rowSpan = s.rowSpan);
85
- const l = Pe(t.style, s.style), c = v("block").add("position", "absolute").mm("left", e.xMm, r).mm("top", e.yMm, r).mm("width", e.widthMm, r).mm("height", e.heightMm, r).add("background-color", l.backgroundColor).add("vertical-align", l.verticalAlign ?? "middle");
86
- Oe(c, l, r), c.applyTo(a);
86
+ function lt(e, t, n, r, a, o) {
87
+ const l = e.cell, i = o.createElement("td");
88
+ i.className = T("cell", a), i.dataset.mrRowIndex = String(e.ri), i.dataset.mrColumnIndex = String(e.ci), i.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), l.colSpan && (i.colSpan = l.colSpan), l.rowSpan && (i.rowSpan = l.rowSpan);
89
+ const s = Re(t.style, l.style), c = y("block").add("position", "absolute").mm("left", e.xMm, r).mm("top", e.yMm, r).mm("width", e.widthMm, r).mm("height", e.heightMm, r).add("background-color", s.backgroundColor).add("vertical-align", s.verticalAlign ?? "middle");
90
+ Fe(c, s, r), c.applyTo(i);
87
91
  const m = o.createElement("div");
88
- m.className = "mr-cell-content", v("flex").add("position", "absolute").mm("left", n + (s.indentMm ?? 0), r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", l.verticalAlign === "top" ? "flex-start" : l.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(m), s.text != null && m.append(s.text);
89
- for (const d of s.children ?? []) m.appendChild(He(d, r, i, o));
90
- return a.appendChild(m), a;
91
- }
92
- function mt(e, t, n, r) {
93
- return Ne(e, t).map((i) => {
94
- const o = `${j(i.widthPt * n / 72, 2)}px solid ${i.color}`, s = r.createElement("div");
95
- s.className = "mr-grid-edge", s.setAttribute("aria-hidden", "true");
96
- const a = i.kind === "h";
97
- return v("block").add("position", "absolute").add("pointer-events", "none").mm("left", a ? i.from : i.pos, n).mm("top", a ? i.pos : i.from, n).mm("width", a ? i.to - i.from : 0, n).mm("height", a ? 0 : i.to - i.from, n).add(a ? "border-top" : "border-left", o).applyTo(s), s;
92
+ m.className = "mr-cell-content", y("flex").add("position", "absolute").mm("left", n + (l.indentMm ?? 0), r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", s.verticalAlign === "top" ? "flex-start" : s.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(m), l.text != null && m.append(l.text);
93
+ for (const d of l.children ?? []) m.appendChild(Oe(d, r, a, o));
94
+ return i.appendChild(m), i;
95
+ }
96
+ function ct(e, t, n, r) {
97
+ return Le(e, t).map((a) => {
98
+ const o = `${j(a.widthPt * n / 72, 2)}px solid ${a.color}`, l = r.createElement("div");
99
+ l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
100
+ const i = a.kind === "h";
101
+ return y("block").add("position", "absolute").add("pointer-events", "none").mm("left", i ? a.from : a.pos, n).mm("top", i ? a.pos : a.from, n).mm("width", i ? a.to - a.from : 0, n).mm("height", i ? 0 : a.to - a.from, n).add(i ? "border-top" : "border-left", o).applyTo(l), l;
98
102
  });
99
103
  }
100
- function dt(e, t, n, r, i) {
101
- const o = i.createElement("table");
102
- o.className = T("grid", r), o.setAttribute("role", "table"), v("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(o);
103
- const s = Ie(e, t.widthMm, t.heightMm), a = i.createElement("tbody");
104
- v("contents").applyTo(a), o.appendChild(a);
105
- const l = e.cells.map(() => {
106
- const m = i.createElement("tr");
107
- return m.className = T("row", r), m.setAttribute("role", "row"), v("contents").applyTo(m), a.appendChild(m), m;
104
+ function mt(e, t, n, r, a) {
105
+ const o = a.createElement("table");
106
+ o.className = T("grid", r), o.setAttribute("role", "table"), y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(o);
107
+ const l = Ne(e, t.widthMm, t.heightMm), i = a.createElement("tbody");
108
+ y("contents").applyTo(i), o.appendChild(i);
109
+ const s = e.cells.map(() => {
110
+ const m = a.createElement("tr");
111
+ return m.className = T("row", r), m.setAttribute("role", "row"), y("contents").applyTo(m), i.appendChild(m), m;
108
112
  });
109
- for (const m of s.cells)
110
- l[m.ri].appendChild(ct(m, t, e.paddingMm ?? 0.5, n, r, i));
111
- const c = i.createElement("div");
112
- return v("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(o, ...mt(s, t, n, i)), c;
113
- }
114
- function ht(e, t, n, r) {
115
- const i = r.createElement("div");
116
- i.className = T("paragraph", n), v("block").add("text-align", e.align).add("line-height", e.lineHeight != null ? String(e.lineHeight) : void 0).mm("margin-top", e.spaceBeforeMm ?? 0, t).mm("margin-bottom", e.spaceAfterMm ?? 0, t).mm("text-indent", e.indentMm ?? 0, t).applyTo(i);
113
+ for (const m of l.cells)
114
+ s[m.ri].appendChild(lt(m, t, e.paddingMm ?? 0.5, n, r, a));
115
+ const c = a.createElement("div");
116
+ return y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(o, ...ct(l, t, n, a)), c;
117
+ }
118
+ function dt(e, t, n, r) {
119
+ const a = r.createElement("div");
120
+ a.className = T("paragraph", n), y("block").add("text-align", e.align).add("line-height", e.lineHeight != null ? String(e.lineHeight) : void 0).mm("margin-top", e.spaceBeforeMm ?? 0, t).mm("margin-bottom", e.spaceAfterMm ?? 0, t).mm("text-indent", e.indentMm ?? 0, t).applyTo(a);
117
121
  for (const o of e.segments || []) {
118
- const s = r.createElement("span");
119
- s.className = T("segment", n), s.textContent = o.kind === "field" ? o.field ?? "" : o.text ?? "";
120
- const a = v("inline");
122
+ const l = r.createElement("span");
123
+ l.className = T("segment", n), l.textContent = o.kind === "field" ? o.field ?? "" : o.text ?? "";
124
+ const i = y("inline");
121
125
  if (o.style) {
122
- const l = o.style;
123
- a.add("color", l.color).add("font-family", l.fontFamily).add("font-weight", l.bold != null ? l.bold ? "700" : "400" : void 0).add("font-style", l.italic != null ? l.italic ? "italic" : "normal" : void 0).add("text-decoration", l.underline != null ? l.underline ? "underline" : "none" : void 0), (l.fontSize != null || l.fontSizePx != null) && a.add("font-size", `${j(U(l, t).fontSizePx, 2)}px`);
126
+ const s = o.style;
127
+ i.add("color", s.color).add("font-family", s.fontFamily).add("font-weight", s.bold != null ? s.bold ? "700" : "400" : void 0).add("font-style", s.italic != null ? s.italic ? "italic" : "normal" : void 0).add("text-decoration", s.underline != null ? s.underline ? "underline" : "none" : void 0), (s.fontSize != null || s.fontSizePx != null) && i.add("font-size", `${j(_(s, t).fontSizePx, 2)}px`);
124
128
  }
125
- a.applyTo(s), i.appendChild(s);
129
+ i.applyTo(l), a.appendChild(l);
126
130
  }
127
- return i;
131
+ return a;
128
132
  }
129
- function gt(e, t, n, r) {
130
- if ($e(e)) {
131
- const i = r.createElement("div");
132
- i.className = T("rich", n), v("block").applyTo(i);
133
- for (const o of e.richParagraphs) i.appendChild(ht(o, t, n, r));
134
- return i;
133
+ function ht(e, t, n, r) {
134
+ if (Ae(e)) {
135
+ const a = r.createElement("div");
136
+ a.className = T("rich", n), y("block").applyTo(a);
137
+ for (const o of e.richParagraphs) a.appendChild(dt(o, t, n, r));
138
+ return a;
135
139
  }
136
140
  if (Array.isArray(e.lines) && e.lines.length > 0) {
137
- const i = r.createElement("div");
138
- i.className = T("lines", n), v("block").applyTo(i);
141
+ const a = r.createElement("div");
142
+ a.className = T("lines", n), y("block").applyTo(a);
139
143
  for (const o of e.lines) {
140
- const s = r.createElement("div");
141
- s.className = T("line", n), s.textContent = o, v("block").add("white-space", "pre").add("min-height", "1lh").applyTo(s), i.appendChild(s);
144
+ const l = r.createElement("div");
145
+ l.className = T("line", n), l.textContent = o, y("block").add("white-space", "pre").add("min-height", "1lh").applyTo(l), a.appendChild(l);
142
146
  }
143
- return i;
147
+ return a;
144
148
  }
145
149
  return e.text ?? "";
146
150
  }
147
- function ft(e, t, n, r) {
148
- const i = r.createElement("div");
149
- i.className = T("text", n);
151
+ function gt(e, t, n, r) {
152
+ const a = r.createElement("div");
153
+ a.className = T("text", n);
150
154
  const o = e.style || {};
151
- return v("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", o.verticalAlign === "middle" ? "center" : o.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(i), i.append(gt(e, t, n, r)), i;
155
+ return y("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", o.verticalAlign === "middle" ? "center" : o.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(a), a.append(ht(e, t, n, r)), a;
152
156
  }
153
- function ut(e, t, n) {
157
+ function ft(e, t, n) {
154
158
  const r = n.createElement("img");
155
- return r.className = T("image", t), r.src = e.imageData, v("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
159
+ return r.className = T("image", t), r.src = e.imageData, y("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
156
160
  }
157
161
  function be(e, t, n, r) {
158
- const i = r.createElement("div");
159
- i.className = T("shape", n);
160
- const o = e.style || {}, s = G(o), a = Re(o), l = `${j(s.widthPt * t / 72, 2)}px solid ${s.color}`, c = v("block");
161
- return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top", l), a.right && c.add("border-right", l), a.bottom && c.add("border-bottom", l), a.left && c.add("border-left", l)) : e.kind === "ellipse" ? (a.inner && c.add("border", l).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", l), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
162
- }
163
- function pt(e, t, n) {
164
- const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), i = se(e.widthMm, t), o = se(e.heightMm, t);
165
- r.setAttribute("width", String(Math.max(1, i))), r.setAttribute("height", String(Math.max(1, o))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
166
- const s = n.createElementNS("http://www.w3.org/2000/svg", "line");
167
- s.setAttribute("x1", "0"), s.setAttribute("x2", String(i)), s.setAttribute("y1", e.lineDirection === "up" ? String(o) : "0"), s.setAttribute("y2", e.lineDirection === "up" ? "0" : String(o));
168
- const a = G({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
169
- return s.setAttribute("stroke", a.color), s.setAttribute("stroke-width", String(a.widthPt * t / 72)), r.appendChild(s), r;
170
- }
171
- function He(e, t, n, r) {
172
- const i = r.createElement("div");
173
- i.className = `${T("comp", n)} mr-kind-${e.kind}`;
174
- const o = v("block").add("position", "absolute").mm("left", e.leftMm, t).mm("top", e.topMm, t).mm("width", e.widthMm, t).mm("height", e.heightMm, t).add("box-sizing", "border-box");
175
- if (lt(o, e, t), o.applyTo(i), re(e))
176
- return i.appendChild(ut(e, n, r)), i;
162
+ const a = r.createElement("div");
163
+ a.className = T("shape", n);
164
+ const o = e.style || {}, l = G(o), i = Ce(o), s = `${j(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = y("block");
165
+ return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (i.top && c.add("border-top", s), i.right && c.add("border-right", s), i.bottom && c.add("border-bottom", s), i.left && c.add("border-left", s)) : e.kind === "ellipse" ? (i.inner && c.add("border", s).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", s), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(a), a;
166
+ }
167
+ function ut(e, t, n) {
168
+ const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), a = se(e.widthMm, t), o = se(e.heightMm, t);
169
+ r.setAttribute("width", String(Math.max(1, a))), r.setAttribute("height", String(Math.max(1, o))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
170
+ const l = n.createElementNS("http://www.w3.org/2000/svg", "line");
171
+ l.setAttribute("x1", "0"), l.setAttribute("x2", String(a)), l.setAttribute("y1", e.lineDirection === "up" ? String(o) : "0"), l.setAttribute("y2", e.lineDirection === "up" ? "0" : String(o));
172
+ const i = G({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
173
+ return l.setAttribute("stroke", i.color), l.setAttribute("stroke-width", String(i.widthPt * t / 72)), r.appendChild(l), r;
174
+ }
175
+ function Oe(e, t, n, r) {
176
+ const a = r.createElement("div");
177
+ a.className = `${T("comp", n)} mr-kind-${e.kind}`;
178
+ const o = y("block").add("position", "absolute").mm("left", e.leftMm, t).mm("top", e.topMm, t).mm("width", e.widthMm, t).mm("height", e.heightMm, t).add("box-sizing", "border-box");
179
+ if (st(o, e, t), o.applyTo(a), re(e))
180
+ return a.appendChild(ft(e, n, r)), a;
177
181
  if (e.kind === "text")
178
- return i.appendChild(ft(e, t, n, r)), i;
182
+ return a.appendChild(gt(e, t, n, r)), a;
179
183
  if (e.grid) {
180
- const a = be(e, t, n, r);
181
- return a.appendChild(dt(e.grid, e, t, n, r)), i.appendChild(a), i;
184
+ const i = be(e, t, n, r);
185
+ return i.appendChild(mt(e.grid, e, t, n, r)), a.appendChild(i), a;
182
186
  }
183
187
  if (e.kind === "line" && e.lineDirection)
184
- return i.appendChild(pt(e, t, r)), i;
188
+ return a.appendChild(ut(e, t, r)), a;
185
189
  if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
186
- return i.appendChild(be(e, t, n, r)), i;
187
- const s = r.createElement("div");
188
- return s.className = T("unknown", n), v("block").applyTo(s), s.textContent = e.fallbackText ?? `[${e.kind}]`, s.dataset.mrUnsupported = e.kind, s.setAttribute("role", "note"), i.appendChild(s), i;
189
- }
190
- function wt(e, t, n, r) {
191
- const i = r.createElement("div");
192
- return i.className = T("page", n), v("block", "initial").add("position", "relative").add("font-family", te).add("font-size", `${j(U(void 0, t).fontSizePx, 2)}px`).add("line-height", String(ne(void 0))).add("white-space", "pre-wrap").add("direction", "ltr").mm("width", e.pageWidthMm, t).mm("height", e.pageHeightMm, t).add("background-color", "#fff").add("color", Ce).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((o, s) => {
193
- const a = He(o, t, n, r);
194
- a.dataset.mrComponentIndex = String(s), i.appendChild(a);
195
- }), i;
196
- }
197
- function Pn(e, t, n = {}) {
190
+ return a.appendChild(be(e, t, n, r)), a;
191
+ const l = r.createElement("div");
192
+ return l.className = T("unknown", n), y("block").applyTo(l), l.textContent = e.fallbackText ?? `[${e.kind}]`, l.dataset.mrUnsupported = e.kind, l.setAttribute("role", "note"), a.appendChild(l), a;
193
+ }
194
+ function pt(e, t, n, r) {
195
+ const a = r.createElement("div");
196
+ return a.className = T("page", n), y("block", "initial").add("position", "relative").add("font-family", te).add("font-size", `${j(_(void 0, t).fontSizePx, 2)}px`).add("line-height", String(ne(void 0))).add("white-space", "pre-wrap").add("direction", "ltr").mm("width", e.pageWidthMm, t).mm("height", e.pageHeightMm, t).add("background-color", "#fff").add("color", Te).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(a), e.components.forEach((o, l) => {
197
+ const i = Oe(o, t, n, r);
198
+ i.dataset.mrComponentIndex = String(l), a.appendChild(i);
199
+ }), a;
200
+ }
201
+ function Rn(e, t, n = {}) {
198
202
  const r = n.dpi ?? 96;
199
203
  q(e, "dom", n);
200
- const i = t.createElement("div");
201
- return i.className = T("root", n), v("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((o) => {
202
- i.appendChild(wt(o, r, n, t));
203
- }), i;
204
+ const a = t.createElement("div");
205
+ return a.className = T("root", n), y("block").applyTo(a), a.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((o) => {
206
+ a.appendChild(pt(o, r, n, t));
207
+ }), a;
204
208
  }
205
209
  function $(e) {
206
210
  if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
207
211
  }
208
- const bt = (e, t) => ($(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
209
- const i = new Image(), o = () => {
210
- i.onload = null, i.onerror = null, t?.removeEventListener("abort", s);
211
- }, s = () => {
212
- o(), i.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
212
+ const wt = (e, t) => ($(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
213
+ const a = new Image(), o = () => {
214
+ a.onload = null, a.onerror = null, t?.removeEventListener("abort", l);
215
+ }, l = () => {
216
+ o(), a.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
213
217
  };
214
- i.onload = () => {
215
- o(), n(i);
216
- }, i.onerror = () => {
218
+ a.onload = () => {
219
+ o(), n(a);
220
+ }, a.onerror = () => {
217
221
  o(), r(new Error("Image could not be decoded for Canvas output."));
218
- }, t?.addEventListener("abort", s, { once: !0 }), i.src = e;
222
+ }, t?.addEventListener("abort", l, { once: !0 }), a.src = e;
219
223
  }) : Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));
220
- function yt(e, t, n) {
221
- return $(n), n ? new Promise((r, i) => {
222
- const o = () => i(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
223
- n.addEventListener("abort", o, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, i).finally(() => n.removeEventListener("abort", o));
224
+ function bt(e, t, n) {
225
+ return $(n), n ? new Promise((r, a) => {
226
+ const o = () => a(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
227
+ n.addEventListener("abort", o, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, a).finally(() => n.removeEventListener("abort", o));
224
228
  }) : e(t);
225
229
  }
226
- async function vt(e, t, n) {
230
+ async function Mt(e, t, n) {
227
231
  const r = /* @__PURE__ */ new Map();
228
- for (const i of e.components)
229
- !re(i) || r.has(i.imageData) || r.set(i.imageData, await yt(t, i.imageData, n));
232
+ for (const a of e.components)
233
+ !re(a) || r.has(a.imageData) || r.set(a.imageData, await bt(t, a.imageData, n));
230
234
  return $(n), r;
231
235
  }
232
- function Mt(e, t, n, r, i, o) {
233
- const s = t, a = s.naturalWidth ?? s.width ?? i, l = s.naturalHeight ?? s.height ?? o;
234
- if (a <= 0 || l <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
235
- const c = Math.min(i / a, o / l), m = a * c, d = l * c;
236
- e.drawImage(t, n + (i - m) / 2, r + (o - d) / 2, m, d);
236
+ function yt(e, t, n, r, a, o) {
237
+ const l = t, i = l.naturalWidth ?? l.width ?? a, s = l.naturalHeight ?? l.height ?? o;
238
+ if (i <= 0 || s <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
239
+ const c = Math.min(a / i, o / s), m = i * c, d = s * c;
240
+ e.drawImage(t, n + (a - m) / 2, r + (o - d) / 2, m, d);
237
241
  }
238
- function xt(e) {
239
- return at(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
242
+ function vt(e) {
243
+ return nt(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
240
244
  }
241
245
  const de = 96 / 25.4;
242
246
  function he(e, t = 96) {
@@ -246,67 +250,67 @@ function he(e, t = 96) {
246
250
  heightPx: Math.max(1, Math.round(e.pageHeightMm * n))
247
251
  };
248
252
  }
249
- function ze(e, t, n, r = 64e6) {
253
+ function He(e, t, n, r = 64e6) {
250
254
  if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");
251
255
  if (!Number.isFinite(r) || r <= 0) throw new RangeError("maxCanvasPixels must be positive and finite.");
252
- const i = he(e, n), o = Math.round(i.widthPx * t), s = Math.round(i.heightPx * t);
253
- if (!Number.isSafeInteger(o) || !Number.isSafeInteger(s) || o * s > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
254
- return { width: o, height: s };
255
- }
256
- function Be(e, t, n, r) {
257
- const i = document.createElement("canvas"), { widthPx: o, heightPx: s } = he(e, n), a = ze(e, t, n, r);
258
- i.width = a.width, i.height = a.height, i.style.width = `${o}px`, i.style.height = `${s}px`;
259
- const l = i.getContext("2d");
260
- if (!l)
256
+ const a = he(e, n), o = Math.round(a.widthPx * t), l = Math.round(a.heightPx * t);
257
+ if (!Number.isSafeInteger(o) || !Number.isSafeInteger(l) || o * l > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
258
+ return { width: o, height: l };
259
+ }
260
+ function ze(e, t, n, r) {
261
+ const a = document.createElement("canvas"), { widthPx: o, heightPx: l } = he(e, n), i = He(e, t, n, r);
262
+ a.width = i.width, a.height = i.height, a.style.width = `${o}px`, a.style.height = `${l}px`;
263
+ const s = a.getContext("2d");
264
+ if (!s)
261
265
  throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");
262
- return l.scale(t, t), l.fillStyle = "#ffffff", l.fillRect(0, 0, o, s), { canvas: i, ctx: l };
266
+ return s.scale(t, t), s.fillStyle = "#ffffff", s.fillRect(0, 0, o, l), { canvas: a, ctx: s };
263
267
  }
264
- function An(e, t = 96) {
265
- return U(e, t).fontSizePx;
268
+ function Pn(e, t = 96) {
269
+ return _(e, t).fontSizePx;
266
270
  }
267
- function We(e, t, n, r, i, o, s, a = "top") {
268
- e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${s}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
269
- const l = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
270
- `), m = c.length * l;
271
+ function We(e, t, n, r, a, o, l, i = "top") {
272
+ e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${l}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
273
+ const s = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
274
+ `), m = c.length * s;
271
275
  let d = r;
272
- a === "middle" ? d = r + (o - m) / 2 : a === "bottom" && (d = r + o - m), c.forEach((h, g) => {
273
- Et(e, h, t, n, d + g * l + t.fontSizePx * 0.8, i);
276
+ i === "middle" ? d = r + (o - m) / 2 : i === "bottom" && (d = r + o - m), c.forEach((h, g) => {
277
+ xt(e, h, t, n, d + g * s + t.fontSizePx * 0.8, a);
274
278
  }), e.textAlign = "left";
275
279
  }
276
- function Et(e, t, n, r, i, o) {
277
- const s = Array.from(t), a = n.letterSpacingPx ?? 0;
278
- if (!a) {
280
+ function xt(e, t, n, r, a, o) {
281
+ const l = Array.from(t), i = n.letterSpacingPx ?? 0;
282
+ if (!i) {
279
283
  e.textAlign = n.align === "center" ? "center" : n.align === "right" ? "right" : "left";
280
284
  const d = n.align === "center" ? r + o / 2 : n.align === "right" ? r + o : r;
281
- e.fillText(t, d, i);
285
+ e.fillText(t, d, a);
282
286
  return;
283
287
  }
284
- const l = e.measureText(t).width + Math.max(0, s.length - 1) * a, c = n.align === "center" ? r + (o - l) / 2 : n.align === "right" ? r + o - l : r;
288
+ const s = e.measureText(t).width + Math.max(0, l.length - 1) * i, c = n.align === "center" ? r + (o - s) / 2 : n.align === "right" ? r + o - s : r;
285
289
  e.textAlign = "left";
286
290
  let m = "";
287
- s.forEach((d, h) => {
288
- e.fillText(d, c + e.measureText(m).width + h * a, i), m += d;
291
+ l.forEach((d, h) => {
292
+ e.fillText(d, c + e.measureText(m).width + h * i, a), m += d;
289
293
  });
290
294
  }
291
- function St(e, t, n, r, i, o, s) {
292
- for (const a of Ne(t, n))
293
- e.strokeStyle = a.color, e.lineWidth = W(a.widthPt, s), e.beginPath(), a.kind === "v" ? (e.moveTo(r + a.pos * o, i + a.from * o), e.lineTo(r + a.pos * o, i + a.to * o)) : (e.moveTo(r + a.from * o, i + a.pos * o), e.lineTo(r + a.to * o, i + a.pos * o)), e.stroke();
295
+ function Et(e, t, n, r, a, o, l) {
296
+ for (const i of Le(t, n))
297
+ e.strokeStyle = i.color, e.lineWidth = W(i.widthPt, l), e.beginPath(), i.kind === "v" ? (e.moveTo(r + i.pos * o, a + i.from * o), e.lineTo(r + i.pos * o, a + i.to * o)) : (e.moveTo(r + i.from * o, a + i.pos * o), e.lineTo(r + i.to * o, a + i.pos * o)), e.stroke();
294
298
  }
295
- function Tt(e, t, n, r, i, o) {
296
- e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + i, r)), t.right && (e.moveTo(n + i, r), e.lineTo(n + i, r + o)), t.bottom && (e.moveTo(n + i, r + o), e.lineTo(n, r + o)), t.left && (e.moveTo(n, r + o), e.lineTo(n, r)), e.stroke();
299
+ function St(e, t, n, r, a, o) {
300
+ e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + a, r)), t.right && (e.moveTo(n + a, r), e.lineTo(n + a, r + o)), t.bottom && (e.moveTo(n + a, r + o), e.lineTo(n, r + o)), t.left && (e.moveTo(n, r + o), e.lineTo(n, r)), e.stroke();
297
301
  }
298
- function Ct(e, t, n, r, i, o, s, a, l, c, m) {
299
- const d = Ie(t, o / a, s / a);
302
+ function Tt(e, t, n, r, a, o, l, i, s, c, m) {
303
+ const d = Ne(t, o / i, l / i);
300
304
  for (const g of d.cells) {
301
305
  const f = g.cell.style?.backgroundColor ?? n.style?.backgroundColor;
302
- f && (e.fillStyle = f, e.fillRect(r + g.xMm * a, i + g.yMm * a, g.widthMm * a, g.heightMm * a));
306
+ f && (e.fillStyle = f, e.fillRect(r + g.xMm * i, a + g.yMm * i, g.widthMm * i, g.heightMm * i));
303
307
  }
304
- St(e, d, n, r, i, a, l);
308
+ Et(e, d, n, r, a, i, s);
305
309
  const h = t.paddingMm ?? 0.5;
306
310
  for (const g of d.cells) {
307
311
  const f = g.cell.text ?? "";
308
312
  if (!f) continue;
309
- const w = Pe(n.style, g.cell.style), C = U(w, l), x = g.cell.indentMm ?? 0, M = Math.max(0, g.widthMm - 2 * h - x), R = ke(f, M, { fontSizePt: C.fontSizePt, bold: w.bold, italic: w.italic, fontFamily: w.fontFamily ?? c, letterSpacingPt: w.letterSpacing }, m).join(`
313
+ const w = Re(n.style, g.cell.style), C = _(w, s), x = g.cell.indentMm ?? 0, v = Math.max(0, g.widthMm - 2 * h - x), R = Ie(f, v, { fontSizePt: C.fontSizePt, bold: w.bold, italic: w.italic, fontFamily: w.fontFamily ?? c, letterSpacingPt: w.letterSpacing }, m).join(`
310
314
  `);
311
315
  We(
312
316
  e,
@@ -315,274 +319,274 @@ function Ct(e, t, n, r, i, o, s, a, l, c, m) {
315
319
  fontSizePx: C.fontSizePx,
316
320
  bold: w.bold ?? !1,
317
321
  italic: w.italic,
318
- color: Ae(w, Ce),
322
+ color: Pe(w, Te),
319
323
  align: w.align ?? "left",
320
324
  lineHeight: ne(w),
321
- letterSpacingPx: W(w.letterSpacing ?? 0, l)
325
+ letterSpacingPx: W(w.letterSpacing ?? 0, s)
322
326
  },
323
- r + (g.xMm + h + x) * a,
324
- i + (g.yMm + h) * a,
325
- M * a,
326
- Math.max(0, g.heightMm - 2 * h) * a,
327
+ r + (g.xMm + h + x) * i,
328
+ a + (g.yMm + h) * i,
329
+ v * i,
330
+ Math.max(0, g.heightMm - 2 * h) * i,
327
331
  w.fontFamily ?? c,
328
332
  w.verticalAlign ?? "middle"
329
333
  );
330
334
  }
331
335
  }
332
- function Rt(e, t, n, r, i, o, s, a, l) {
333
- const c = t.style ?? {}, m = U(c, s), d = $e(t) ? t.richParagraphs.map((h) => h.segments.map((g) => g.text ?? g.field ?? "").join("")).join(`
336
+ function Ct(e, t, n, r, a, o, l, i, s) {
337
+ const c = t.style ?? {}, m = _(c, l), d = Ae(t) ? t.richParagraphs.map((h) => h.segments.map((g) => g.text ?? g.field ?? "").join("")).join(`
334
338
  `) : t.lines?.length ? t.lines.join(`
335
- `) : ke(t.text ?? "", t.widthMm, { fontSizePt: m.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? a, letterSpacingPt: c.letterSpacing }, l).join(`
339
+ `) : Ie(t.text ?? "", t.widthMm, { fontSizePt: m.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? i, letterSpacingPt: c.letterSpacing }, s).join(`
336
340
  `);
337
341
  We(e, {
338
342
  text: d,
339
343
  fontSizePx: m.fontSizePx,
340
344
  bold: c.bold ?? !1,
341
345
  italic: c.italic,
342
- color: Ae(c),
346
+ color: Pe(c),
343
347
  align: c.align ?? "left",
344
348
  lineHeight: ne(c),
345
- letterSpacingPx: W(c.letterSpacing ?? 0, s)
346
- }, n, r, i, o, c.fontFamily ?? a, c.verticalAlign);
349
+ letterSpacingPx: W(c.letterSpacing ?? 0, l)
350
+ }, n, r, a, o, c.fontFamily ?? i, c.verticalAlign);
347
351
  }
348
- function ge(e, t, n, r, i, o, s) {
349
- const a = t.leftMm * n, l = t.topMm * n, c = t.widthMm * n, m = t.heightMm * n, d = t.style ?? {};
352
+ function ge(e, t, n, r, a, o, l) {
353
+ const i = t.leftMm * n, s = t.topMm * n, c = t.widthMm * n, m = t.heightMm * n, d = t.style ?? {};
350
354
  if (re(t)) {
351
- const h = s?.get(t.imageData);
352
- h ? Mt(e, h, a, l, c, m) : ye(e, t, a, l, c, m);
355
+ const h = l?.get(t.imageData);
356
+ h ? yt(e, h, i, s, c, m) : Me(e, t, i, s, c, m);
353
357
  return;
354
358
  }
355
359
  if (t.grid) {
356
- Ct(e, t.grid, t, a, l, c, m, n, r, i, o);
360
+ Tt(e, t.grid, t, i, s, c, m, n, r, a, o);
357
361
  return;
358
362
  }
359
363
  switch (t.kind) {
360
364
  case "text": {
361
- Rt(e, t, a, l, c, m, r, i, o);
365
+ Ct(e, t, i, s, c, m, r, a, o);
362
366
  break;
363
367
  }
364
368
  case "rect": {
365
- const h = G(d), g = Re(d);
366
- d.backgroundColor && (e.fillStyle = d.backgroundColor, e.fillRect(a, l, c, m)), g.inner && (e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), Tt(e, g, a, l, c, m));
369
+ const h = G(d), g = Ce(d);
370
+ d.backgroundColor && (e.fillStyle = d.backgroundColor, e.fillRect(i, s, c, m)), g.inner && (e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), St(e, g, i, s, c, m));
367
371
  break;
368
372
  }
369
373
  case "line": {
370
374
  const h = G({ ...d, borderColor: d.lineColor ?? d.borderColor });
371
375
  e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), e.beginPath();
372
- const g = t.lineDirection === "up" ? l + m : t.lineDirection === "down" ? l : l + m / 2, f = t.lineDirection === "up" ? l : t.lineDirection === "down" ? l + m : l + m / 2;
373
- e.moveTo(a, g), e.lineTo(a + c, f), e.stroke();
376
+ const g = t.lineDirection === "up" ? s + m : t.lineDirection === "down" ? s : s + m / 2, f = t.lineDirection === "up" ? s : t.lineDirection === "down" ? s + m : s + m / 2;
377
+ e.moveTo(i, g), e.lineTo(i + c, f), e.stroke();
374
378
  break;
375
379
  }
376
380
  case "ellipse": {
377
381
  const h = G(d);
378
- e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), d.backgroundColor && (e.fillStyle = d.backgroundColor, e.beginPath(), e.ellipse(a + c / 2, l + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(a + c / 2, l + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.stroke();
382
+ e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), d.backgroundColor && (e.fillStyle = d.backgroundColor, e.beginPath(), e.ellipse(i + c / 2, s + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(i + c / 2, s + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.stroke();
379
383
  break;
380
384
  }
381
385
  default:
382
- ye(e, t, a, l, c, m);
386
+ Me(e, t, i, s, c, m);
383
387
  break;
384
388
  }
385
389
  }
386
- function ye(e, t, n, r, i, o) {
387
- e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, i, o), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
390
+ function Me(e, t, n, r, a, o) {
391
+ e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, a, o), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
388
392
  }
389
- async function $n(e, t = {}) {
393
+ async function An(e, t = {}) {
390
394
  if (typeof document > "u")
391
395
  throw new Error("renderPlanToImages 需要浏览器环境(SSR/Node 请在客户端钩子中调用)");
392
- const { format: n = "png", quality: r = 0.92, ...i } = t;
396
+ const { format: n = "png", quality: r = 0.92, ...a } = t;
393
397
  if (n !== "png" && n !== "jpeg") throw new TypeError("Image format must be png or jpeg.");
394
398
  if (!Number.isFinite(r) || r < 0 || r > 1) throw new RangeError("Image quality must be between 0 and 1.");
395
399
  $(t.signal);
396
- const o = await ce(e, { ...t, format: "canvas" });
400
+ const o = await me(e, { ...t, format: "canvas" });
397
401
  e = o.plan;
398
- const s = [...o.diagnostics, ...q(e, "canvas", t)], a = n === "jpeg" ? "image/jpeg" : "image/png", l = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
402
+ const l = [...o.diagnostics, ...q(e, "canvas", t)], i = n === "jpeg" ? "image/jpeg" : "image/png", s = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
399
403
  for (let m = Math.max(0, t.start ?? 0); m <= c; m++) {
400
404
  $(t.signal);
401
- const d = await _e(e.pages[m], m, i, s);
405
+ const d = await Be(e.pages[m], m, a, l);
402
406
  try {
403
- l.push(await Pt(d, a, r, t.signal));
407
+ s.push(await Rt(d, i, r, t.signal));
404
408
  } finally {
405
409
  d.width = 0, d.height = 0;
406
410
  }
407
- await it(t, l.length, c - Math.max(0, t.start ?? 0) + 1);
411
+ await tt(t, s.length, c - Math.max(0, t.start ?? 0) + 1);
408
412
  }
409
- return $(t.signal), { blobs: l, diagnostics: s };
413
+ return $(t.signal), { blobs: s, diagnostics: l };
410
414
  }
411
- function Pt(e, t, n, r) {
412
- return $(r), new Promise((i, o) => {
413
- const s = () => o(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
414
- r?.addEventListener("abort", s, { once: !0 });
415
+ function Rt(e, t, n, r) {
416
+ return $(r), new Promise((a, o) => {
417
+ const l = () => o(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
418
+ r?.addEventListener("abort", l, { once: !0 });
415
419
  try {
416
- e.toBlob((a) => {
417
- r?.removeEventListener("abort", s), a ? i(a) : o(new Error("Canvas encoding failed; no empty image was emitted."));
420
+ e.toBlob((i) => {
421
+ r?.removeEventListener("abort", l), i ? a(i) : o(new Error("Canvas encoding failed; no empty image was emitted."));
418
422
  }, t, n);
419
- } catch (a) {
420
- r?.removeEventListener("abort", s), o(a);
423
+ } catch (i) {
424
+ r?.removeEventListener("abort", l), o(i);
421
425
  }
422
426
  });
423
427
  }
424
- function kn(e, t = {}) {
428
+ function $n(e, t = {}) {
425
429
  if ($(t.signal), typeof document > "u")
426
430
  throw new Error("renderPlanToCanvas 需要浏览器环境(SSR 请在客户端钩子中调用)");
427
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * de, o = t.fontFamily ?? te, s = t.measurer ?? le, a = Math.max(0, t.start ?? 0), l = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], m = q(e, "canvas", t), d = At(e, a, l);
431
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, a = r / 96 * de, o = t.fontFamily ?? te, l = t.measurer ?? le, i = Math.max(0, t.start ?? 0), s = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], m = q(e, "canvas", t), d = Pt(e, i, s);
428
432
  for (const h of d)
429
- Le(h, t), m.push(h);
430
- if (t.fidelity === "strict" && d.length) throw new rt(m);
431
- for (let h = a; h <= l; h++) {
433
+ De(h, t), m.push(h);
434
+ if (t.fidelity === "strict" && d.length) throw new et(m);
435
+ for (let h = i; h <= s; h++) {
432
436
  $(t.signal);
433
- const g = e.pages[h], { canvas: f, ctx: w } = Be(g, n, r, t.maxCanvasPixels);
437
+ const g = e.pages[h], { canvas: f, ctx: w } = ze(g, n, r, t.maxCanvasPixels);
434
438
  for (const C of g.components)
435
- ge(w, C, i, r, o, s);
439
+ ge(w, C, a, r, o, l);
436
440
  c.push(f);
437
441
  }
438
442
  return { canvases: c, diagnostics: m };
439
443
  }
440
- function At(e, t, n) {
441
- return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((o, s) => re(o) ? [{
444
+ function Pt(e, t, n) {
445
+ return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, a) => r.components.flatMap((o, l) => re(o) ? [{
442
446
  code: "async-image-required",
443
447
  severity: "warning",
444
448
  format: "canvas",
445
- pageIndex: t + i,
446
- componentIndex: s,
449
+ pageIndex: t + a,
450
+ componentIndex: l,
447
451
  kind: o.kind,
448
452
  nid: o.nid,
449
453
  message: "Use renderPlanToCanvasAsync or renderPlanToImages to decode and include images."
450
454
  }] : []));
451
455
  }
452
- async function In(e, t = {}) {
456
+ async function kn(e, t = {}) {
453
457
  if (typeof document > "u") throw new Error("renderPlanToCanvasAsync 需要浏览器环境(Node 请使用 PDF 或 XLSX 输出)");
454
458
  $(t.signal);
455
- const n = await ce(e, { ...t, format: "canvas" });
459
+ const n = await me(e, { ...t, format: "canvas" });
456
460
  e = n.plan;
457
- const r = [...n.diagnostics, ...q(e, "canvas", t)], i = [], o = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
458
- for (let s = Math.max(0, t.start ?? 0); s <= o; s++)
459
- i.push(await _e(e.pages[s], s, t, r));
460
- return { canvases: i, diagnostics: r };
461
+ const r = [...n.diagnostics, ...q(e, "canvas", t)], a = [], o = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
462
+ for (let l = Math.max(0, t.start ?? 0); l <= o; l++)
463
+ a.push(await Be(e.pages[l], l, t, r));
464
+ return { canvases: a, diagnostics: r };
461
465
  }
462
- async function _e(e, t, n, r) {
463
- const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, s = n.fontFamily ?? te, a = await je(e, t, n, r);
466
+ async function Be(e, t, n, r) {
467
+ const a = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, l = n.fontFamily ?? te, i = await je(e, t, n, r);
464
468
  $(n.signal);
465
- const { canvas: l, ctx: c } = Be(e, i, o, n.maxCanvasPixels);
466
- for (const m of e.components) ge(c, m, o / 25.4, o, s, n.measurer ?? le, a);
467
- return l;
469
+ const { canvas: s, ctx: c } = ze(e, a, o, n.maxCanvasPixels);
470
+ for (const m of e.components) ge(c, m, o / 25.4, o, l, n.measurer ?? le, i);
471
+ return s;
468
472
  }
469
473
  async function je(e, t, n, r) {
470
- const i = n.imageLoader ?? bt;
471
- return vt(e, async (o, s) => {
474
+ const a = n.imageLoader ?? wt;
475
+ return Mt(e, async (o, l) => {
472
476
  try {
473
- return await i(o, s);
474
- } catch (a) {
475
- if (s?.aborted) throw a;
476
- const l = e.components.findIndex((d) => d.imageData === o), c = e.components[l], m = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: l, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
477
- throw r.push(m), Le(m, n), a;
477
+ return await a(o, l);
478
+ } catch (i) {
479
+ if (l?.aborted) throw i;
480
+ const s = e.components.findIndex((d) => d.imageData === o), c = e.components[s], m = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: s, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
481
+ throw r.push(m), De(m, n), i;
478
482
  }
479
483
  }, n.signal);
480
484
  }
481
- function Nn(e, t = {}) {
482
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * de, o = t.fontFamily ?? te, s = t.measurer ?? le, a = t.overscan ?? 1, l = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, m = e.pages.map((u) => u.pageHeightMm * i), d = Math.max(1, ...e.pages.map((u) => u.pageWidthMm * i)), h = { start: 0, end: -1 };
483
- let g = null, f = null, w = null, C = null, x = [], M = 0, R = [], z = 0, L = new AbortController();
485
+ function In(e, t = {}) {
486
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, a = r / 96 * de, o = t.fontFamily ?? te, l = t.measurer ?? le, i = t.overscan ?? 1, s = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, m = e.pages.map((u) => u.pageHeightMm * a), d = Math.max(1, ...e.pages.map((u) => u.pageWidthMm * a)), h = { start: 0, end: -1 };
487
+ let g = null, f = null, w = null, C = null, x = [], v = 0, R = [], H = 0, N = new AbortController();
484
488
  const ue = [];
485
- function qe() {
489
+ function Ve() {
486
490
  const u = g;
487
491
  u.innerHTML = "", f = document.createElement("div"), f.style.cssText = `width:${d}px;margin:0 auto;`, w = document.createElement("div"), C = document.createElement("div"), f.appendChild(w), x = [];
488
- const E = Math.min(e.pages.length, 3 + a * 2);
489
- for (let O = 0; O < E; O++) {
490
- const y = document.createElement("div");
491
- y.style.cssText = `margin:0 auto ${l}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, f.appendChild(y), x.push(y);
492
+ const E = Math.min(e.pages.length, 3 + i * 2);
493
+ for (let F = 0; F < E; F++) {
494
+ const M = document.createElement("div");
495
+ M.style.cssText = `margin:0 auto ${s}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, f.appendChild(M), x.push(M);
492
496
  }
493
497
  f.appendChild(C), u.appendChild(f);
494
498
  }
495
- async function Je(u, E) {
496
- const O = z, y = await ce(e, { ...t, signal: L.signal, format: "canvas", start: E, end: E });
497
- ue.push(...y.diagnostics);
498
- const P = y.plan.pages[E], K = await je(P, E, { ...t, signal: L.signal }, ue);
499
- if (O !== z || !g) return;
500
- const { widthPx: ae, heightPx: oe } = he(P, r);
501
- let D = u.firstElementChild;
502
- (!D || D.tagName !== "CANVAS") && (D = document.createElement("canvas"), u.innerHTML = "", u.appendChild(D));
503
- const we = ze(P, n, r, t.maxCanvasPixels);
504
- D.width = we.width, D.height = we.height, D.style.width = `${ae}px`, D.style.height = `${oe}px`;
505
- const B = D.getContext("2d");
506
- if (B) {
507
- B.setTransform(1, 0, 0, 1, 0, 0), B.scale(n, n), B.fillStyle = "#ffffff", B.fillRect(0, 0, ae, oe);
499
+ async function qe(u, E) {
500
+ const F = H, M = await me(e, { ...t, signal: N.signal, format: "canvas", start: E, end: E });
501
+ ue.push(...M.diagnostics);
502
+ const P = M.plan.pages[E], J = await je(P, E, { ...t, signal: N.signal }, ue);
503
+ if (F !== H || !g) return;
504
+ const { widthPx: ie, heightPx: oe } = he(P, r);
505
+ let L = u.firstElementChild;
506
+ (!L || L.tagName !== "CANVAS") && (L = document.createElement("canvas"), u.innerHTML = "", u.appendChild(L));
507
+ const we = He(P, n, r, t.maxCanvasPixels);
508
+ L.width = we.width, L.height = we.height, L.style.width = `${ie}px`, L.style.height = `${oe}px`;
509
+ const z = L.getContext("2d");
510
+ if (z) {
511
+ z.setTransform(1, 0, 0, 1, 0, 0), z.scale(n, n), z.fillStyle = "#ffffff", z.fillRect(0, 0, ie, oe);
508
512
  for (const Ke of P.components)
509
- ge(B, Ke, i, r, o, s, K);
510
- D.dataset.canvasPage = String(E), u.style.height = `${oe}px`, u.style.width = `${ae}px`;
513
+ ge(z, Ke, a, r, o, l, J);
514
+ L.dataset.canvasPage = String(E), u.style.height = `${oe}px`, u.style.width = `${ie}px`;
511
515
  }
512
516
  }
513
517
  function Ye(u) {
514
- z++, h.start = u.start, h.end = u.end, w.style.height = `${u.start * l + m.slice(0, u.start).reduce((y, P) => y + P, 0)}px`;
518
+ H++, h.start = u.start, h.end = u.end, w.style.height = `${u.start * s + m.slice(0, u.start).reduce((M, P) => M + P, 0)}px`;
515
519
  const E = e.pages.length - 1 - u.end;
516
- C.style.height = `${E * l + m.slice(u.end + 1).reduce((y, P) => y + P, 0)}px`;
517
- const O = u.end - u.start + 1;
518
- x.forEach((y, P) => {
519
- if (P < O) {
520
- y.style.display = "";
521
- const K = u.start + P;
522
- y.style.height = `${m[K] ?? 0}px`;
520
+ C.style.height = `${E * s + m.slice(u.end + 1).reduce((M, P) => M + P, 0)}px`;
521
+ const F = u.end - u.start + 1;
522
+ x.forEach((M, P) => {
523
+ if (P < F) {
524
+ M.style.display = "";
525
+ const J = u.start + P;
526
+ M.style.height = `${m[J] ?? 0}px`;
523
527
  } else
524
- y.style.display = "none";
528
+ M.style.display = "none";
525
529
  }), R = [];
526
- for (let y = u.start; y <= u.end; y++) {
527
- const P = x[y - u.start];
530
+ for (let M = u.start; M <= u.end; M++) {
531
+ const P = x[M - u.start];
528
532
  if (!P) continue;
529
- P.firstElementChild?.dataset?.canvasPage !== String(y) && R.push(y);
533
+ P.firstElementChild?.dataset?.canvasPage !== String(M) && R.push(M);
530
534
  }
531
- ie();
535
+ ae();
532
536
  }
533
- function ie() {
534
- M || R.length === 0 || (M = requestAnimationFrame(() => {
535
- M = 0;
537
+ function ae() {
538
+ v || R.length === 0 || (v = requestAnimationFrame(() => {
539
+ v = 0;
536
540
  let u = Math.max(1, c);
537
541
  for (; R.length > 0 && u-- > 0; ) {
538
- const E = R.shift(), O = x[E - h.start];
539
- O && Je(O, E).catch(() => {
542
+ const E = R.shift(), F = x[E - h.start];
543
+ F && qe(F, E).catch(() => {
540
544
  });
541
545
  }
542
- R.length > 0 && ie();
546
+ R.length > 0 && ae();
543
547
  }));
544
548
  }
545
- function J() {
546
- M || (M = requestAnimationFrame(() => {
547
- M = 0;
548
- const u = g, E = xt({
549
+ function Y() {
550
+ v || (v = requestAnimationFrame(() => {
551
+ v = 0;
552
+ const u = g, E = vt({
549
553
  pageHeightsPx: m,
550
554
  viewportHeightPx: u.clientHeight,
551
555
  scrollTopPx: u.scrollTop,
552
- overscan: a,
553
- gapPx: l
556
+ overscan: i,
557
+ gapPx: s
554
558
  });
555
- E.start !== h.start || E.end !== h.end ? Ye(E) : ie();
559
+ E.start !== h.start || E.end !== h.end ? Ye(E) : ae();
556
560
  }));
557
561
  }
558
- let Y = null;
562
+ let K = null;
559
563
  return {
560
564
  attach(u) {
561
565
  if (typeof document > "u")
562
566
  throw new Error("createCanvasPager 需要浏览器环境(SSR 请在客户端钩子中调用 attach)");
563
- $(t.signal), L = new AbortController(), t.signal?.addEventListener("abort", pe, { once: !0 }), q(e, "canvas", t), g = u, qe(), u.addEventListener("scroll", J, { passive: !0 }), typeof ResizeObserver < "u" && (Y = new ResizeObserver(() => J()), Y.observe(u)), J();
567
+ $(t.signal), N = new AbortController(), t.signal?.addEventListener("abort", pe, { once: !0 }), q(e, "canvas", t), g = u, Ve(), u.addEventListener("scroll", Y, { passive: !0 }), typeof ResizeObserver < "u" && (K = new ResizeObserver(() => Y()), K.observe(u)), Y();
564
568
  },
565
569
  destroy() {
566
- z++, L.abort(), t.signal?.removeEventListener("abort", pe), M && cancelAnimationFrame(M), M = 0, Y?.disconnect(), Y = null, g?.removeEventListener("scroll", J), R = [], f?.remove(), g = null;
570
+ H++, N.abort(), t.signal?.removeEventListener("abort", pe), v && cancelAnimationFrame(v), v = 0, K?.disconnect(), K = null, g?.removeEventListener("scroll", Y), R = [], f?.remove(), g = null;
567
571
  },
568
572
  window() {
569
573
  return { ...h };
570
574
  }
571
575
  };
572
576
  function pe() {
573
- L.abort(t.signal?.reason);
577
+ N.abort(t.signal?.reason);
574
578
  }
575
579
  }
576
- function Ue(e, t, n) {
577
- let r, i;
580
+ function _e(e, t, n) {
581
+ let r, a;
578
582
  if (typeof e == "string") {
579
583
  const o = Z[e];
580
584
  if (!o) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(Z).join("/")})`);
581
- r = o.widthMm, i = o.heightMm;
582
- } else typeof e == "number" ? (r = e, i = t ?? 297) : (r = e.widthMm, i = e.heightMm);
583
- return n ? { widthMm: i, heightMm: r } : { widthMm: r, heightMm: i };
585
+ r = o.widthMm, a = o.heightMm;
586
+ } else typeof e == "number" ? (r = e, a = t ?? 297) : (r = e.widthMm, a = e.heightMm);
587
+ return n ? { widthMm: a, heightMm: r } : { widthMm: r, heightMm: a };
584
588
  }
585
- class $t {
589
+ class At {
586
590
  constructor() {
587
591
  this.pages = [], this.pending = null, this.templateParams = void 0;
588
592
  }
@@ -615,18 +619,18 @@ class $t {
615
619
  */
616
620
  page(t = "a4", n = {}, r) {
617
621
  this.collect();
618
- const o = r != null && !("margins" in r) && !("landscape" in r) && ("marginTopMm" in r || "marginBottomMm" in r || "marginLeftMm" in r || "marginRightMm" in r) ? { margins: r } : typeof n == "number" ? r ?? {} : n, { widthMm: s, heightMm: a } = Ue(
622
+ const o = r != null && !("margins" in r) && !("landscape" in r) && ("marginTopMm" in r || "marginBottomMm" in r || "marginLeftMm" in r || "marginRightMm" in r) ? { margins: r } : typeof n == "number" ? r ?? {} : n, { widthMm: l, heightMm: i } = _e(
619
623
  t,
620
624
  typeof n == "number" ? n : void 0,
621
625
  o.landscape
622
- ), l = o.margins ?? {};
623
- return this.pending = new kt(this, {
624
- widthMm: s,
625
- heightMm: a,
626
- marginTopMm: l.marginTopMm ?? 10,
627
- marginBottomMm: l.marginBottomMm ?? 10,
628
- marginLeftMm: l.marginLeftMm ?? 10,
629
- marginRightMm: l.marginRightMm ?? 10
626
+ ), s = o.margins ?? {};
627
+ return this.pending = new $t(this, {
628
+ widthMm: l,
629
+ heightMm: i,
630
+ marginTopMm: s.marginTopMm ?? 10,
631
+ marginBottomMm: s.marginBottomMm ?? 10,
632
+ marginLeftMm: s.marginLeftMm ?? 10,
633
+ marginRightMm: s.marginRightMm ?? 10
630
634
  }), this.pending;
631
635
  }
632
636
  collect() {
@@ -642,7 +646,7 @@ class $t {
642
646
  };
643
647
  }
644
648
  }
645
- class kt {
649
+ class $t {
646
650
  constructor(t, n) {
647
651
  this.parent = t, this.page = n, this.components = [];
648
652
  }
@@ -657,7 +661,7 @@ class kt {
657
661
  style: r
658
662
  }), this;
659
663
  }
660
- list(t, n, r, i = {}) {
664
+ list(t, n, r, a = {}) {
661
665
  return this.components.push({
662
666
  kind: "list",
663
667
  leftMm: n.leftMm ?? 10,
@@ -665,20 +669,20 @@ class kt {
665
669
  widthMm: n.widthMm ?? 180,
666
670
  dataset: t,
667
671
  columns: r,
668
- ...i
672
+ ...a
669
673
  }), this;
670
674
  }
671
675
  rect(t, n = {}) {
672
676
  return this.components.push({ kind: "rect", ...t, style: n }), this;
673
677
  }
674
- line(t, n, r, i = {}) {
678
+ line(t, n, r, a = {}) {
675
679
  return this.components.push({
676
680
  kind: "line",
677
681
  leftMm: t,
678
682
  topMm: n,
679
683
  widthMm: r,
680
684
  heightMm: 0.5,
681
- style: i
685
+ style: a
682
686
  }), this;
683
687
  }
684
688
  barcode(t, n) {
@@ -691,11 +695,11 @@ class kt {
691
695
  fallbackText: t
692
696
  }), this;
693
697
  }
694
- qrcode(t, n, r, i) {
698
+ qrcode(t, n, r, a) {
695
699
  return this.components.push({
696
700
  kind: "qrcode",
697
701
  leftMm: r,
698
- topMm: i,
702
+ topMm: a,
699
703
  widthMm: n,
700
704
  heightMm: n,
701
705
  fallbackText: t
@@ -711,11 +715,11 @@ class kt {
711
715
  return this.done().build();
712
716
  }
713
717
  }
714
- function Ln() {
715
- return new $t();
718
+ function Nn() {
719
+ return new At();
716
720
  }
717
- function Dn(e, t = {}) {
718
- return Ze([], e), e.fields.map((n) => ({
721
+ function Ln(e, t = {}) {
722
+ return Xe([], e), e.fields.map((n) => ({
719
723
  field: n.field,
720
724
  header: `${n.label ?? n.field}${n.unit ? ` (${n.unit})` : ""}`,
721
725
  semanticRole: n.semanticRole ?? (n.type === "number" || n.type === "decimal" ? "measure" : n.type === "date" ? "date" : n.enum ? "dimension" : "text"),
@@ -730,7 +734,7 @@ function Q(e, t, n) {
730
734
  if (e !== void 0 && !["left", "center", "right", "justify", ...n ? ["auto"] : []].includes(e))
731
735
  throw new Error(`${t} 必须是 left/center/right/justify${n ? "/auto" : ""}`);
732
736
  }
733
- function It(e) {
737
+ function kt(e) {
734
738
  const t = e.layout ?? "page";
735
739
  if (t !== "page" && t !== "wide")
736
740
  throw new Error("layout 必须是 page 或 wide");
@@ -741,16 +745,16 @@ function It(e) {
741
745
  const n = e.columnWidthMm ?? 30;
742
746
  return k(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
743
747
  }
744
- function Nt(e) {
748
+ function It(e) {
745
749
  const t = e.paper === void 0 ? "a4" : e.paper;
746
750
  if (typeof t != "string" && (typeof t != "object" || t === null) || e.landscape !== void 0 && typeof e.landscape != "boolean")
747
751
  throw new Error("paper 必须是纸张预设名或 { widthMm, heightMm } 对象,landscape 必须是布尔值");
748
752
  if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(Z, t))
749
753
  throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(Z).join("/")})`);
750
- const n = Ue(t, void 0, e.landscape), r = n.widthMm, i = n.heightMm;
751
- return k(r, "纸张 widthMm"), k(i, "纸张 heightMm"), { widthMm: r, heightMm: i };
754
+ const n = _e(t, void 0, e.landscape), r = n.widthMm, a = n.heightMm;
755
+ return k(r, "纸张 widthMm"), k(a, "纸张 heightMm"), { widthMm: r, heightMm: a };
752
756
  }
753
- function Lt(e) {
757
+ function Nt(e) {
754
758
  if (e.margins !== void 0 && (!e.margins || typeof e.margins != "object" || Array.isArray(e.margins)))
755
759
  throw new Error("margins 必须是页边距对象");
756
760
  const t = e.margins ?? {}, n = {
@@ -759,23 +763,23 @@ function Lt(e) {
759
763
  marginLeftMm: t.marginLeftMm === void 0 ? 10 : t.marginLeftMm,
760
764
  marginRightMm: t.marginRightMm === void 0 ? 10 : t.marginRightMm
761
765
  };
762
- for (const [r, i] of Object.entries(n)) k(i, r, !0);
766
+ for (const [r, a] of Object.entries(n)) k(a, r, !0);
763
767
  return n;
764
768
  }
765
- function Dt(e, t) {
769
+ function Lt(e, t) {
766
770
  const n = e.dataset === void 0 ? "detail" : e.dataset;
767
771
  if (typeof n != "string" || !n.trim())
768
772
  throw new Error("dataset 必须是非空字符串");
769
773
  if (e.title !== void 0 && typeof e.title != "string")
770
774
  throw new Error("title 必须是字符串");
771
- const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, i = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
772
- k(r, "titleHeightMm"), k(i, "titleGapMm", !0);
773
- const o = e.title !== void 0 && e.title.length > 0, s = o ? r + i : 0;
774
- if (s >= t)
775
+ const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, a = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
776
+ k(r, "titleHeightMm"), k(a, "titleGapMm", !0);
777
+ const o = e.title !== void 0 && e.title.length > 0, l = o ? r + a : 0;
778
+ if (l >= t)
775
779
  throw new Error("标题高度与间距占满页面,必须为表格保留可用高度");
776
- return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm: s };
780
+ return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm: l };
777
781
  }
778
- function Ft(e) {
782
+ function Dt(e) {
779
783
  if (e.listOptions !== void 0 && (!e.listOptions || typeof e.listOptions != "object" || Array.isArray(e.listOptions)))
780
784
  throw new Error("listOptions 必须是列表配置对象");
781
785
  const t = e.listOptions ?? {};
@@ -786,49 +790,49 @@ function Ft(e) {
786
790
  }
787
791
  return t;
788
792
  }
789
- function Ot(e) {
793
+ function Ft(e) {
790
794
  let t = 0, n = 0;
791
- for (const [r, i] of e.entries()) {
792
- if (!i || typeof i.header != "string" || typeof i.field != "string" || !i.field.trim())
795
+ for (const [r, a] of e.entries()) {
796
+ if (!a || typeof a.header != "string" || typeof a.field != "string" || !a.field.trim())
793
797
  throw new Error(`columns[${r}] 需要字符串 header 与非空 field`);
794
- Q(i.align, `columns[${r}].align`, !0), Q(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 && k(i.flex, `columns[${r}].flex`), i.widthMm !== void 0 ? (k(i.widthMm, `columns[${r}].widthMm`), t += i.widthMm) : n = Math.max(n, i.flex ?? 1);
798
+ Q(a.align, `columns[${r}].align`, !0), Q(a.headerAlign, `columns[${r}].headerAlign`, !1), a.flex !== void 0 && k(a.flex, `columns[${r}].flex`), a.widthMm !== void 0 ? (k(a.widthMm, `columns[${r}].widthMm`), t += a.widthMm) : n = Math.max(n, a.flex ?? 1);
795
799
  }
796
800
  return { fixedWidthMm: t, maxFlex: n };
797
801
  }
798
- function Ht(e, t, n, r) {
799
- const { fixedWidthMm: i, maxFlex: o } = Ot(e.columns);
800
- if (t === "page" && i > r)
801
- throw new Error(`固定列宽 ${i}mm 超出页面可用宽度 ${r}mm`);
802
- const s = r - i;
803
- if (t === "page" && o > 0 && s <= 0)
802
+ function Ot(e, t, n, r) {
803
+ const { fixedWidthMm: a, maxFlex: o } = Ft(e.columns);
804
+ if (t === "page" && a > r)
805
+ throw new Error(`固定列宽 ${a}mm 超出页面可用宽度 ${r}mm`);
806
+ const l = r - a;
807
+ if (t === "page" && o > 0 && l <= 0)
804
808
  throw new Error("固定列占满页面可用宽度,自动列需要正的剩余宽度");
805
- const a = o > 0 ? e.columns.reduce((c, m) => c + (m.widthMm === void 0 ? (m.flex ?? 1) / o : 0), 0) : 0;
809
+ const i = o > 0 ? e.columns.reduce((c, m) => c + (m.widthMm === void 0 ? (m.flex ?? 1) / o : 0), 0) : 0;
806
810
  return { columns: e.columns.map(({ widthMm: c, flex: m, ...d }, h) => {
807
- const g = c ?? (t === "wide" ? n * (m ?? 1) : s * ((m ?? 1) / o) / a);
811
+ const g = c ?? (t === "wide" ? n * (m ?? 1) : l * ((m ?? 1) / o) / i);
808
812
  return k(g, `columns[${h}] 分配后的 widthMm`), { ...d, widthMm: g };
809
- }), fixedWidthMm: i, maxFlex: o };
813
+ }), fixedWidthMm: a, maxFlex: o };
810
814
  }
811
- function Fn(e) {
815
+ function Dn(e) {
812
816
  if (!e || typeof e != "object")
813
817
  throw new Error("标准明细模板需要 options 对象");
814
818
  if (!Array.isArray(e.columns) || e.columns.length === 0)
815
819
  throw new Error("columns 至少需要一列");
816
- const { layout: t, columnWidthMm: n } = It(e), r = Nt(e);
817
- let i = r.widthMm;
818
- const o = r.heightMm, s = Lt(e);
819
- let a = i - s.marginLeftMm - s.marginRightMm;
820
- const l = o - s.marginTopMm - s.marginBottomMm;
821
- if (t === "page" && a <= 0 || l <= 0)
820
+ const { layout: t, columnWidthMm: n } = kt(e), r = It(e);
821
+ let a = r.widthMm;
822
+ const o = r.heightMm, l = Nt(e);
823
+ let i = a - l.marginLeftMm - l.marginRightMm;
824
+ const s = o - l.marginTopMm - l.marginBottomMm;
825
+ if (t === "page" && i <= 0 || s <= 0)
822
826
  throw new Error("页边距占满纸张,必须保留正的可用宽度和高度");
823
- const { dataset: c, titleHeightMm: m, hasTitle: d, titleSpaceMm: h } = Dt(e, l), g = Ft(e), { columns: f, fixedWidthMm: w, maxFlex: C } = Ht(e, t, n, a);
824
- t === "wide" && (a = f.reduce((M, R) => M + R.widthMm, 0), k(a, "宽表总列宽"), i = a + s.marginLeftMm + s.marginRightMm, k(i, "宽表总宽度"));
825
- const x = { widthMm: i, heightMm: o, ...s, components: [], ...t === "wide" ? { layout: t } : {} };
827
+ const { dataset: c, titleHeightMm: m, hasTitle: d, titleSpaceMm: h } = Lt(e, s), g = Dt(e), { columns: f, fixedWidthMm: w, maxFlex: C } = Ot(e, t, n, i);
828
+ t === "wide" && (i = f.reduce((v, R) => v + R.widthMm, 0), k(i, "宽表总列宽"), a = i + l.marginLeftMm + l.marginRightMm, k(a, "宽表总宽度"));
829
+ const x = { widthMm: a, heightMm: o, ...l, components: [], ...t === "wide" ? { layout: t } : {} };
826
830
  return d && x.components.push({
827
831
  kind: "text",
828
832
  text: e.title,
829
- leftMm: s.marginLeftMm,
830
- topMm: s.marginTopMm,
831
- widthMm: a,
833
+ leftMm: l.marginLeftMm,
834
+ topMm: l.marginTopMm,
835
+ widthMm: i,
832
836
  heightMm: m,
833
837
  style: { fontSize: 16, bold: !0, align: "center", verticalAlign: "middle", ...e.titleStyle }
834
838
  }), x.components.push({
@@ -840,52 +844,52 @@ function Fn(e) {
840
844
  ...d ? { title: e.title } : {},
841
845
  dataset: c,
842
846
  columns: f,
843
- leftMm: s.marginLeftMm,
844
- topMm: s.marginTopMm + h,
845
- widthMm: t === "wide" || C > 0 ? a : w
847
+ leftMm: l.marginLeftMm,
848
+ topMm: l.marginTopMm + h,
849
+ widthMm: t === "wide" || C > 0 ? i : w
846
850
  }), e.params === void 0 ? { pages: [x] } : { params: e.params, pages: [x] };
847
851
  }
848
- function On(e) {
852
+ function Fn(e) {
849
853
  if (e.components !== void 0 && e.pages !== void 0) throw new TypeError("标签 components 与 pages 只能选择一种");
850
- const { dataset: t, rowKey: n, copies: r, params: i } = e, o = e.pages ?? [{ components: e.components ?? [] }], s = {
854
+ const { dataset: t, rowKey: n, copies: r, params: a } = e, o = e.pages ?? [{ components: e.components ?? [] }], l = {
851
855
  repeat: { dataset: t, ...n === void 0 ? {} : { rowKey: n }, ...r === void 0 ? {} : { copies: r } },
852
- ...i === void 0 ? {} : { params: i },
853
- pages: o.map((l) => ({
854
- widthMm: l.widthMm ?? e.widthMm ?? 80,
855
- heightMm: l.heightMm ?? e.heightMm ?? 55,
856
+ ...a === void 0 ? {} : { params: a },
857
+ pages: o.map((s) => ({
858
+ widthMm: s.widthMm ?? e.widthMm ?? 80,
859
+ heightMm: s.heightMm ?? e.heightMm ?? 55,
856
860
  marginTopMm: 0,
857
861
  marginRightMm: 0,
858
862
  marginBottomMm: 0,
859
863
  marginLeftMm: 0,
860
- components: l.components,
861
- ...l.meta === void 0 ? {} : { meta: l.meta }
864
+ components: s.components,
865
+ ...s.meta === void 0 ? {} : { meta: s.meta }
862
866
  }))
863
- }, a = De(s);
864
- if (!a.ok) throw new Fe(a.errors);
865
- return JSON.parse(JSON.stringify(s));
867
+ }, i = $e(l);
868
+ if (!i.ok) throw new ke(i.errors);
869
+ return JSON.parse(JSON.stringify(l));
866
870
  }
867
- function zt(e) {
871
+ function Ht(e) {
868
872
  if (!e || typeof e != "object" || !e.repeat)
869
- throw new me("config", "defineLabelReport 需要带 repeat 的固定标签模板");
870
- const t = De(e);
871
- if (!t.ok) throw new Fe(t.errors);
873
+ throw new ce("config", "defineLabelReport 需要带 repeat 的固定标签模板");
874
+ const t = $e(e);
875
+ if (!t.ok) throw new ke(t.errors);
872
876
  return e.repeat.dataset;
873
877
  }
874
- function ve(e, t) {
875
- if (!Array.isArray(e)) throw new me("validate", "标签数据应为对象数组;请从业务响应中提取行数组");
878
+ function ye(e, t) {
879
+ if (!Array.isArray(e)) throw new ce("validate", "标签数据应为对象数组;请从业务响应中提取行数组");
876
880
  return { [t]: e };
877
881
  }
878
- function Hn(e) {
879
- const { template: t, rows: n, load: r, dataSchema: i, params: o, pagination: s, dataValidation: a } = e, l = zt(t);
882
+ function On(e) {
883
+ const { template: t, rows: n, load: r, dataSchema: a, params: o, pagination: l, dataValidation: i } = e, s = Ht(t);
880
884
  if (n !== void 0 == (r !== void 0) || r !== void 0 && typeof r != "function")
881
- throw new me("config", "标签报表应且只能配置 rows 或 load 其中一种数据来源");
882
- const c = { template: t, params: o, pagination: s, dataValidation: a, ...i === void 0 ? {} : { dataSchema: { [l]: i } } };
883
- return r ? Qe({ ...c, load: r, mapData: (m) => ve(m, l) }) : { ...c, datasets: ve(n, l) };
885
+ throw new ce("config", "标签报表应且只能配置 rows 或 load 其中一种数据来源");
886
+ const c = { template: t, params: o, pagination: l, dataValidation: i, ...a === void 0 ? {} : { dataSchema: { [s]: a } } };
887
+ return r ? Ze({ ...c, load: r, mapData: (m) => ye(m, s) }) : { ...c, datasets: ye(n, s) };
884
888
  }
885
- function zn(e) {
889
+ function Hn(e) {
886
890
  return e;
887
891
  }
888
- class F extends Error {
892
+ class D extends Error {
889
893
  constructor(t, n) {
890
894
  super(n), this.code = t, this.name = "ReportTemplateStoreError";
891
895
  }
@@ -898,73 +902,73 @@ function S(e) {
898
902
  const t = new Error("模板操作已取消");
899
903
  throw t.name = "AbortError", t;
900
904
  }
901
- function Me(e) {
905
+ function ve(e) {
902
906
  const t = e ? Number(e.revision) : 0;
903
- if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new F("history", "修订号无效或已达上限");
907
+ if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new D("history", "修订号无效或已达上限");
904
908
  return String(t + 1);
905
909
  }
906
- function Bn(e, t = {}) {
907
- const n = async (s, a) => {
908
- S(a);
909
- const l = await e.read(s, a);
910
- return S(a), l ? I(l) : void 0;
911
- }, r = async (s, a) => {
912
- const l = await n(s, a.signal);
913
- if ((l?.revision ?? null) !== a.expectedRevision) throw new F("conflict", "模板已变化,请重新读取后提交");
914
- return l;
915
- }, i = async (s, a, l) => {
916
- if (S(a.signal), !await e.compareAndSwap(s.id, a.expectedRevision, I(s), { signal: a.signal, ...l ? { publication: I(l) } : {} })) throw new F("conflict", "模板已被其他请求更新");
917
- return I(s);
918
- }, o = async (s, a, l, c) => {
910
+ function zn(e, t = {}) {
911
+ const n = async (l, i) => {
912
+ S(i);
913
+ const s = await e.read(l, i);
914
+ return S(i), s ? I(s) : void 0;
915
+ }, r = async (l, i) => {
916
+ const s = await n(l, i.signal);
917
+ if ((s?.revision ?? null) !== i.expectedRevision) throw new D("conflict", "模板已变化,请重新读取后提交");
918
+ return s;
919
+ }, a = async (l, i, s) => {
920
+ if (S(i.signal), !await e.compareAndSwap(l.id, i.expectedRevision, I(l), { signal: i.signal, ...s ? { publication: I(s) } : {} })) throw new D("conflict", "模板已被其他请求更新");
921
+ return I(l);
922
+ }, o = async (l, i, s, c) => {
919
923
  if (t.beforePublish) {
920
- S(l.signal);
921
- const g = await t.beforePublish({ document: N(a), previous: s.published ? N(s.published) : void 0, signal: l.signal });
922
- if (!g || g.ok !== !0) throw new F("review", g?.issues?.find((f) => f.severity === "error")?.message ?? "模板发布检查未通过");
923
- S(l.signal);
924
+ S(s.signal);
925
+ const g = await t.beforePublish({ document: U(i), previous: l.published ? U(l.published) : void 0, signal: s.signal });
926
+ if (!g || g.ok !== !0) throw new D("review", g?.issues?.find((f) => f.severity === "error")?.message ?? "模板发布检查未通过");
927
+ S(s.signal);
924
928
  }
925
- const m = Me(s), d = N({ ...a, revision: m }), h = { revision: m, document: d, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
926
- return c !== void 0 && (h.restoredFrom = c), i({ id: s.id, revision: m, publishedRevision: m, published: d }, l, h);
929
+ const m = ve(l), d = U({ ...i, revision: m }), h = { revision: m, document: d, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
930
+ return c !== void 0 && (h.restoredFrom = c), a({ id: l.id, revision: m, publishedRevision: m, published: d }, s, h);
927
931
  };
928
932
  return {
929
- list: async (s) => {
930
- S(s);
931
- const a = await e.list(s);
932
- return S(s), I(a);
933
+ list: async (l) => {
934
+ S(l);
935
+ const i = await e.list(l);
936
+ return S(l), I(i);
933
937
  },
934
- get: async (s, a = {}) => {
935
- const l = await n(s, a.signal), c = a.draft ? l?.draft : l?.published;
936
- return c ? N(c) : void 0;
938
+ get: async (l, i = {}) => {
939
+ const s = await n(l, i.signal), c = i.draft ? s?.draft : s?.published;
940
+ return c ? U(c) : void 0;
937
941
  },
938
- history: async (s, a) => {
939
- S(a);
940
- const l = await e.history(s, a);
941
- return S(a), I(l);
942
+ history: async (l, i) => {
943
+ S(i);
944
+ const s = await e.history(l, i);
945
+ return S(i), I(s);
942
946
  },
943
- saveDraft: async (s, a) => {
944
- a = { ...a }, S(a.signal);
945
- const l = N(t.migrate ? await t.migrate(s) : s), c = await r(l.id, a), m = Me(c);
946
- return i({
947
- id: l.id,
947
+ saveDraft: async (l, i) => {
948
+ i = { ...i }, S(i.signal);
949
+ const s = U(t.migrate ? await t.migrate(l) : l), c = await r(s.id, i), m = ve(c);
950
+ return a({
951
+ id: s.id,
948
952
  revision: m,
949
- draft: { ...l, revision: m },
953
+ draft: { ...s, revision: m },
950
954
  ...c?.publishedRevision ? { publishedRevision: c.publishedRevision, published: c.published } : {}
951
- }, a);
955
+ }, i);
952
956
  },
953
- publish: async (s, a) => {
954
- a = { ...a };
955
- const l = await r(s, a);
956
- if (!l) throw new F("missing", "模板不存在");
957
- if (!l.draft) throw new F("draft", "没有可发布的草稿");
958
- return o(l, l.draft, a);
957
+ publish: async (l, i) => {
958
+ i = { ...i };
959
+ const s = await r(l, i);
960
+ if (!s) throw new D("missing", "模板不存在");
961
+ if (!s.draft) throw new D("draft", "没有可发布的草稿");
962
+ return o(s, s.draft, i);
959
963
  },
960
- rollback: async (s, a, l) => {
961
- l = { ...l };
962
- const c = await r(s, l);
963
- if (!c) throw new F("missing", "模板不存在");
964
- S(l.signal);
965
- const m = await e.getVersion(s, a, l.signal);
966
- if (!m) throw new F("history", "历史修订不存在");
967
- return o(c, m.document, l, a);
964
+ rollback: async (l, i, s) => {
965
+ s = { ...s };
966
+ const c = await r(l, s);
967
+ if (!c) throw new D("missing", "模板不存在");
968
+ S(s.signal);
969
+ const m = await e.getVersion(l, i, s.signal);
970
+ if (!m) throw new D("history", "历史修订不存在");
971
+ return o(c, m.document, s, i);
968
972
  }
969
973
  };
970
974
  }
@@ -973,188 +977,143 @@ function Wn() {
973
977
  return {
974
978
  read: async (n, r) => {
975
979
  S(r);
976
- const i = e.get(n);
977
- return i ? I(i) : void 0;
980
+ const a = e.get(n);
981
+ return a ? I(a) : void 0;
978
982
  },
979
- list: async (n) => (S(n), Array.from(e.values(), ({ id: r, revision: i, publishedRevision: o }) => ({ id: r, revision: i, ...o ? { publishedRevision: o } : {} }))),
980
- history: async (n, r) => (S(r), Array.from(t.get(n)?.values() ?? [], (i) => I(i))),
981
- getVersion: async (n, r, i) => {
982
- S(i);
983
+ list: async (n) => (S(n), Array.from(e.values(), ({ id: r, revision: a, publishedRevision: o }) => ({ id: r, revision: a, ...o ? { publishedRevision: o } : {} }))),
984
+ history: async (n, r) => (S(r), Array.from(t.get(n)?.values() ?? [], (a) => I(a))),
985
+ getVersion: async (n, r, a) => {
986
+ S(a);
983
987
  const o = t.get(n)?.get(r);
984
988
  return o ? I(o) : void 0;
985
989
  },
986
- compareAndSwap: async (n, r, i, o) => {
990
+ compareAndSwap: async (n, r, a, o) => {
987
991
  if (S(o.signal), (e.get(n)?.revision ?? null) !== r) return !1;
988
- if (i.id !== n) throw new F("history", "状态 ID 与存储 ID 不一致");
989
- const s = I(i), a = o.publication;
990
- if (a) {
991
- const l = t.get(n) ?? /* @__PURE__ */ new Map();
992
- if (l.has(a.revision) || a.revision !== i.revision || a.document.id !== n) throw new F("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
993
- l.set(a.revision, I(a)), t.set(n, l);
992
+ if (a.id !== n) throw new D("history", "状态 ID 与存储 ID 不一致");
993
+ const l = I(a), i = o.publication;
994
+ if (i) {
995
+ const s = t.get(n) ?? /* @__PURE__ */ new Map();
996
+ if (s.has(i.revision) || i.revision !== a.revision || i.document.id !== n) throw new D("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
997
+ s.set(i.revision, I(i)), t.set(n, s);
994
998
  }
995
- return e.set(n, s), !0;
996
- }
997
- };
998
- }
999
- function Bt(e, t) {
1000
- const n = e.publishedRevision ?? e.published?.revision;
1001
- for (const r of [e.draftRevision, n]) if (r !== void 0 && (typeof r != "string" || !r.trim())) throw new TypeError("模板生命周期修订应为非空字符串");
1002
- if (e.draftRevision !== void 0 && e.draftRevision !== t.revision) throw new TypeError("可编辑文档应与草稿修订一致");
1003
- if (e.published && (e.published.id !== t.id || e.published.revision !== n)) throw new TypeError("发布文档身份或修订不一致");
1004
- if (!e.published && n !== void 0 && n !== t.revision) throw new TypeError("发布修订需要对应的独立文档");
1005
- return { ...e.draftRevision === void 0 ? {} : { draftRevision: e.draftRevision }, ...n === void 0 ? {} : { publishedRevision: n } };
1006
- }
1007
- function _n(e, t) {
1008
- const n = N(e);
1009
- if (t.id === n.id) throw new Error("复制模板应使用新的 ID");
1010
- const { revision: r, ...i } = n;
1011
- return N({ ...i, id: t.id, name: t.name });
1012
- }
1013
- function jn(e) {
1014
- if (!Array.isArray(e) || e.length > 1e3) throw new RangeError("本地模板目录最多 1000 项");
1015
- const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = [];
1016
- for (const i of e) {
1017
- const o = N(i.document);
1018
- if (t.has(o.id)) throw new Error(`模板 ID 重复:${o.id}`);
1019
- if (i.category !== void 0 && (typeof i.category != "string" || i.category.length > 128) || i.tags !== void 0 && (!Array.isArray(i.tags) || i.tags.length > 20 || i.tags.some((c) => typeof c != "string" || c.length > 128))) throw new TypeError("模板分类和标签无效");
1020
- const s = Bt(i, o), { template: a, ...l } = o;
1021
- t.set(o.id, o), i.published ? n.set(o.id, N(i.published)) : s.publishedRevision && n.set(o.id, N(o)), r.push({ ...l, ...s, ...i.category ? { category: i.category } : {}, ...i.tags ? { tags: [...i.tags] } : {} });
1022
- }
1023
- return r.sort((i, o) => i.id < o.id ? -1 : 1), {
1024
- search: async (i) => {
1025
- xe(i.signal);
1026
- const o = i.limit ?? 30;
1027
- if (!Number.isSafeInteger(o) || o < 1 || o > 100) throw new RangeError("模板每页数量应为 1–100");
1028
- const s = i.query?.trim().toLocaleLowerCase() ?? "", a = r.filter((c) => (!i.category || c.category === i.category) && (!i.cursor || c.id > i.cursor) && (!s || [c.id, c.name, c.description, ...c.tags ?? []].some((m) => m?.toLocaleLowerCase().includes(s)))), l = /* @__PURE__ */ new Map();
1029
- for (const c of r) c.category && l.set(c.category, (l.get(c.category) ?? 0) + 1);
1030
- return JSON.parse(JSON.stringify({ items: a.slice(0, o), ...a.length > o ? { next: a[o - 1].id } : {}, categories: Array.from(l, ([c, m]) => ({ id: c, label: c, count: m })) }));
1031
- },
1032
- get: async (i, o) => {
1033
- xe(o.signal);
1034
- const s = o.mode === "published" ? n.get(i) : t.get(i);
1035
- return s ? N(s) : void 0;
999
+ return e.set(n, l), !0;
1036
1000
  }
1037
1001
  };
1038
1002
  }
1039
- function xe(e) {
1040
- if (!e?.aborted) return;
1041
- const t = new Error("模板目录操作已取消");
1042
- throw t.name = "AbortError", t;
1043
- }
1044
- function Un(e) {
1003
+ function Bn(e) {
1045
1004
  return e.map((t) => t.map((n) => /[\t\r\n"]/.test(n) ? `"${n.replace(/"/g, '""')}"` : n).join(" ")).join(`\r
1046
1005
  `);
1047
1006
  }
1048
- function Wt(e, t) {
1007
+ function zt(e, t) {
1049
1008
  const n = e[e.length - 1];
1050
1009
  e.length > 1 && n?.length === 1 && n[0] === "" && /[\r\n]$/.test(t) && e.pop();
1051
1010
  }
1052
- function Gn(e, t = 1e4) {
1011
+ function jn(e, t = 1e4) {
1053
1012
  if (e.length > 4 * 1024 * 1024) throw new Error("Clipboard text limit exceeded");
1054
1013
  const n = [[]];
1055
- let r = "", i = !1, o = !1, s = 0;
1056
- function a() {
1057
- if (++s > t) throw new Error("Clipboard cell limit exceeded");
1014
+ let r = "", a = !1, o = !1, l = 0;
1015
+ function i() {
1016
+ if (++l > t) throw new Error("Clipboard cell limit exceeded");
1058
1017
  n[n.length - 1].push(r), r = "", o = !1;
1059
1018
  }
1060
- for (let l = 0; l < e.length; l++) {
1061
- const c = e[l];
1062
- if (i) {
1019
+ for (let s = 0; s < e.length; s++) {
1020
+ const c = e[s];
1021
+ if (a) {
1063
1022
  if (c !== '"') {
1064
1023
  r += c;
1065
1024
  continue;
1066
1025
  }
1067
- if (e[l + 1] === '"') {
1068
- r += '"', l++;
1026
+ if (e[s + 1] === '"') {
1027
+ r += '"', s++;
1069
1028
  continue;
1070
1029
  }
1071
- i = !1, o = !0;
1030
+ a = !1, o = !0;
1072
1031
  continue;
1073
1032
  }
1074
1033
  if (c === '"' && !r && !o) {
1075
- i = !0;
1034
+ a = !0;
1076
1035
  continue;
1077
1036
  }
1078
1037
  if (c === " ") {
1079
- a();
1038
+ i();
1080
1039
  continue;
1081
1040
  }
1082
1041
  if (c === "\r" || c === `
1083
1042
  `) {
1084
- a(), n.push([]), c === "\r" && e[l + 1] === `
1085
- ` && l++;
1043
+ i(), n.push([]), c === "\r" && e[s + 1] === `
1044
+ ` && s++;
1086
1045
  continue;
1087
1046
  }
1088
1047
  if (o) throw new Error("Invalid quoted clipboard value");
1089
1048
  r += c;
1090
1049
  }
1091
- if (i) throw new Error("Unclosed clipboard quote");
1092
- return a(), Wt(n, e), n;
1050
+ if (a) throw new Error("Unclosed clipboard quote");
1051
+ return i(), zt(n, e), n;
1093
1052
  }
1094
- class _t extends Error {
1053
+ class Wt extends Error {
1095
1054
  constructor(t, n, r) {
1096
- const i = typeof n.label == "string" ? n.label : "单元格", o = {
1097
- definition: `${i}的编辑器配置无效`,
1098
- type: `${i}的编辑器与数据类型不一致`,
1099
- required: `${i}不能为空`,
1100
- min: `${i}不能小于 ${r}`,
1101
- max: `${i}不能大于 ${r}`,
1102
- precision: `${i}最多保留 ${r} 位小数`,
1103
- length: `${i}最多允许 ${r} 个字符`,
1104
- choice: `${i}请选择有效选项`,
1105
- date: `${i}请输入有效日期(YYYY-MM-DD)`
1055
+ const a = typeof n.label == "string" ? n.label : "单元格", o = {
1056
+ definition: `${a}的编辑器配置无效`,
1057
+ type: `${a}的编辑器与数据类型不一致`,
1058
+ required: `${a}不能为空`,
1059
+ min: `${a}不能小于 ${r}`,
1060
+ max: `${a}不能大于 ${r}`,
1061
+ precision: `${a}最多保留 ${r} 位小数`,
1062
+ length: `${a}最多允许 ${r} 个字符`,
1063
+ choice: `${a}请选择有效选项`,
1064
+ date: `${a}请输入有效日期(YYYY-MM-DD)`
1106
1065
  };
1107
1066
  super(o[t]), this.code = t, this.field = n, this.expected = r, this.name = "ReportCellFieldError";
1108
1067
  }
1109
1068
  }
1110
1069
  function p(e, t, n) {
1111
- throw new _t(t, e, n);
1070
+ throw new Wt(t, e, n);
1112
1071
  }
1113
- function Ge(e) {
1072
+ function Ue(e) {
1114
1073
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
1115
1074
  const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
1116
1075
  return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
1117
1076
  }
1118
- function jt(e) {
1077
+ function Bt(e) {
1119
1078
  const [t = "", n = "0"] = String(e).toLowerCase().split("e");
1120
1079
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
1121
1080
  }
1122
- function Ut(e, t) {
1123
- e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && jt(t) > e.precision && p(e, "precision", e.precision);
1081
+ function jt(e, t) {
1082
+ e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && Bt(t) > e.precision && p(e, "precision", e.precision);
1124
1083
  }
1125
- function Gt(e, t) {
1126
- Ge(t) || p(e, "date"), e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max);
1084
+ function _t(e, t) {
1085
+ Ue(t) || p(e, "date"), e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max);
1127
1086
  }
1128
- function Vt(e) {
1087
+ function Ut(e) {
1129
1088
  [e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition"), e.precision !== void 0 && (!Number.isInteger(e.precision) || e.precision < 0 || e.precision > 15) && p(e, "definition");
1130
1089
  }
1131
- function qt(e) {
1132
- [e.min, e.max].some((t) => t !== void 0 && !Ge(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition");
1090
+ function Gt(e) {
1091
+ [e.min, e.max].some((t) => t !== void 0 && !Ue(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition");
1133
1092
  }
1134
- function Jt(e, t) {
1093
+ function Vt(e, t) {
1135
1094
  (!Array.isArray(t.options) || !t.options.length) && p(t, "definition");
1136
1095
  const n = e.valueType === "text" ? "string" : e.valueType, r = /* @__PURE__ */ new Set();
1137
- for (const i of t.options)
1138
- (!i || typeof i.value !== n || typeof i.value == "number" && !Number.isFinite(i.value)) && p(t, "definition"), i.label !== void 0 && typeof i.label != "string" && p(t, "definition"), r.has(i.value) && p(t, "definition"), r.add(i.value);
1096
+ for (const a of t.options)
1097
+ (!a || typeof a.value !== n || typeof a.value == "number" && !Number.isFinite(a.value)) && p(t, "definition"), a.label !== void 0 && typeof a.label != "string" && p(t, "definition"), r.has(a.value) && p(t, "definition"), r.add(a.value);
1139
1098
  }
1140
- function Yt(e) {
1099
+ function qt(e) {
1141
1100
  e.required !== void 0 && typeof e.required != "boolean" && p(e, "definition"), [e.label, e.hint, e.unit].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition"), e.type === "boolean" && [e.trueLabel, e.falseLabel].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition");
1142
1101
  }
1143
- function Kt(e, t) {
1144
- (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"), Yt(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && p(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && p(t, "type"), t.type === "number" && Vt(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && p(t, "definition"), t.type === "date" && qt(t), t.type === "enum" && Jt(e, t);
1102
+ function Yt(e, t) {
1103
+ (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"), qt(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && p(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && p(t, "type"), t.type === "number" && Ut(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && p(t, "definition"), t.type === "date" && Gt(t), t.type === "enum" && Vt(e, t);
1145
1104
  }
1146
- function Vn(e, t, n) {
1147
- if (!e.editable) throw new et("readonly");
1148
- n && Kt(e, n);
1149
- const r = tt(e, t);
1150
- return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" && Ut(n, r), n.type === "date" && Gt(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && p(n, "length", n.maxLength), n.type === "enum" && !n.options.some((i) => Object.is(i.value, r)) && p(n, "choice"), r)) : r;
1105
+ function _n(e, t, n) {
1106
+ if (!e.editable) throw new rt("readonly");
1107
+ n && Yt(e, n);
1108
+ const r = at(e, t);
1109
+ return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" && jt(n, r), n.type === "date" && _t(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && p(n, "length", n.maxLength), n.type === "enum" && !n.options.some((a) => Object.is(a.value, r)) && p(n, "choice"), r)) : r;
1151
1110
  }
1152
1111
  class b extends Error {
1153
1112
  constructor(t) {
1154
1113
  super(`Report calculation: ${t}`), this.code = t, this.name = "ReportCalculationError";
1155
1114
  }
1156
1115
  }
1157
- function _(e) {
1116
+ function B(e) {
1158
1117
  if (!e?.aborted) return;
1159
1118
  const t = new Error("Calculation cancelled");
1160
1119
  throw t.name = "AbortError", t;
@@ -1162,95 +1121,95 @@ function _(e) {
1162
1121
  async function ee(e, t = 1) {
1163
1122
  const n = Math.floor(e.scanned / 2048);
1164
1123
  if (e.scanned += t, e.scanned > e.maxScanned) throw new b("limit");
1165
- _(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), _(e.signal));
1124
+ B(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), B(e.signal));
1166
1125
  }
1167
1126
  function fe(e) {
1168
1127
  return e.table?.role === "header" ? -Math.max(1, e.grid?.cells.length ?? 1) : e.table?.rowIndex ?? 0;
1169
1128
  }
1170
- function Ee(e, t, n) {
1171
- if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((a) => Number.isSafeInteger(a) && a >= 0)) throw new b("selection");
1129
+ function xe(e, t, n) {
1130
+ if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((i) => Number.isSafeInteger(i) && i >= 0)) throw new b("selection");
1172
1131
  const r = e.pages[t.pageIndex]?.components[t.componentIndex];
1173
1132
  if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new b("selection");
1174
- const i = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((a, l) => Math.max(a, l.length), 1);
1175
- if (t.columnIndex >= i) throw new b("selection");
1176
- const o = r.table, s = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
1177
- if (o && s && o.id === s.id) {
1178
- const a = s.columnKeys.indexOf(o.columnKeys[t.columnIndex] ?? "");
1179
- if (a < 0) throw new b("selection");
1180
- return { grid: o.id, row: fe(r) + t.rowIndex, column: a };
1133
+ const a = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((i, s) => Math.max(i, s.length), 1);
1134
+ if (t.columnIndex >= a) throw new b("selection");
1135
+ const o = r.table, l = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
1136
+ if (o && l && o.id === l.id) {
1137
+ const i = l.columnKeys.indexOf(o.columnKeys[t.columnIndex] ?? "");
1138
+ if (i < 0) throw new b("selection");
1139
+ return { grid: o.id, row: fe(r) + t.rowIndex, column: i };
1181
1140
  }
1182
1141
  return { grid: `${t.pageIndex}:${t.componentIndex}`, row: t.rowIndex, column: t.columnIndex };
1183
1142
  }
1184
- function Xt(e, t, n) {
1185
- const r = Ee(e, t.anchor, t.anchor), i = Ee(e, t.focus, t.anchor);
1186
- if (r.grid !== i.grid) throw new b("selection");
1187
- const o = (Math.abs(r.row - i.row) + 1) * (Math.abs(r.column - i.column) + 1);
1143
+ function Kt(e, t, n) {
1144
+ const r = xe(e, t.anchor, t.anchor), a = xe(e, t.focus, t.anchor);
1145
+ if (r.grid !== a.grid) throw new b("selection");
1146
+ const o = (Math.abs(r.row - a.row) + 1) * (Math.abs(r.column - a.column) + 1);
1188
1147
  if (!Number.isSafeInteger(o) || o > n) throw new b("limit");
1189
- return { grid: r.grid, rowStart: Math.min(r.row, i.row), rowEnd: Math.max(r.row, i.row), columnStart: Math.min(r.column, i.column), columnEnd: Math.max(r.column, i.column), origin: e.pages[t.anchor.pageIndex].components[t.anchor.componentIndex].table };
1148
+ return { grid: r.grid, rowStart: Math.min(r.row, a.row), rowEnd: Math.max(r.row, a.row), columnStart: Math.min(r.column, a.column), columnEnd: Math.max(r.column, a.column), origin: e.pages[t.anchor.pageIndex].components[t.anchor.componentIndex].table };
1190
1149
  }
1191
- function Zt(e) {
1150
+ function Jt(e) {
1192
1151
  if (!e) return !1;
1193
1152
  const t = e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "");
1194
1153
  return /[ymdhs]/i.test(t);
1195
1154
  }
1196
- function Qt(e) {
1197
- if (e.valueType === "text" || e.valueType === "boolean" || Zt(e.numberFormat)) return null;
1155
+ function Xt(e) {
1156
+ if (e.valueType === "text" || e.valueType === "boolean" || Jt(e.numberFormat)) return null;
1198
1157
  const t = e.value;
1199
1158
  if (typeof t != "number" || !Number.isFinite(t)) return null;
1200
1159
  if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new b("precision");
1201
1160
  return t;
1202
1161
  }
1203
- function en(e, t, n) {
1162
+ function Zt(e, t, n) {
1204
1163
  if (e.seen.has(n)) return;
1205
1164
  e.seen.add(n), e.selected++;
1206
- const r = t ? Qt(t) : null;
1165
+ const r = t ? Xt(t) : null;
1207
1166
  r === null ? e.excluded++ : e.values.push(r);
1208
1167
  }
1209
- function tn(e, t, n, r) {
1168
+ function Qt(e, t, n, r) {
1210
1169
  return r.origin ? e.table?.id === r.origin.id : `${t}:${n}` === r.grid;
1211
1170
  }
1212
- function nn(e, t, n) {
1171
+ function en(e, t, n) {
1213
1172
  return n.origin ? n.origin.columnKeys.indexOf(e.table.columnKeys[t] ?? "") : t;
1214
1173
  }
1215
- function rn(e, t, n, r) {
1216
- const i = r.origin ? fe(e) + t : t, o = nn(e, n, r);
1217
- return i < r.rowStart || i > r.rowEnd || o < r.columnStart || o > r.columnEnd ? null : `${r.grid}:${i}:${o}`;
1174
+ function tn(e, t, n, r) {
1175
+ const a = r.origin ? fe(e) + t : t, o = en(e, n, r);
1176
+ return a < r.rowStart || a > r.rowEnd || o < r.columnStart || o > r.columnEnd ? null : `${r.grid}:${a}:${o}`;
1218
1177
  }
1219
- function an(e, t) {
1220
- const n = t.origin ? fe(e) : 0, r = Math.max(0, t.rowStart - n), i = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
1221
- return i > r ? i : 0;
1178
+ function nn(e, t) {
1179
+ const n = t.origin ? fe(e) : 0, r = Math.max(0, t.rowStart - n), a = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
1180
+ return a > r ? a : 0;
1222
1181
  }
1223
- async function on(e, t, n, r, i) {
1182
+ async function rn(e, t, n, r, a) {
1224
1183
  const o = e.grid;
1225
1184
  if (t > r.maxScanned) throw new b("limit");
1226
- const s = o.colWidthsMm?.length ?? o.cells.reduce((l, c) => Math.max(l, c.length), 1);
1227
- if (s > r.maxScanned) throw new b("limit");
1228
- const a = /* @__PURE__ */ new Map();
1229
- for (let l = 0; l < t; l++) {
1230
- l > 0 && l % 2048 === 0 && (await r.yieldToHost(), _(r.signal));
1185
+ const l = o.colWidthsMm?.length ?? o.cells.reduce((s, c) => Math.max(s, c.length), 1);
1186
+ if (l > r.maxScanned) throw new b("limit");
1187
+ const i = /* @__PURE__ */ new Map();
1188
+ for (let s = 0; s < t; s++) {
1189
+ s > 0 && s % 2048 === 0 && (await r.yieldToHost(), B(r.signal));
1231
1190
  let c = 0;
1232
- for (const m of o.cells[l]) {
1233
- for (await ee(r); c < s && (a.get(c) ?? 0) > l; ) c++;
1234
- if (c >= s) break;
1235
- const d = Math.max(1, Math.min(m?.colSpan ?? 1, s - c)), h = Math.min(o.cells.length, l + Math.max(1, m?.rowSpan ?? 1));
1191
+ for (const m of o.cells[s]) {
1192
+ for (await ee(r); c < l && (i.get(c) ?? 0) > s; ) c++;
1193
+ if (c >= l) break;
1194
+ const d = Math.max(1, Math.min(m?.colSpan ?? 1, l - c)), h = Math.min(o.cells.length, s + Math.max(1, m?.rowSpan ?? 1));
1236
1195
  d > 1 && await ee(r, d - 1);
1237
- for (let f = c; f < c + d; f++) a.set(f, h);
1238
- const g = rn(e, l, c, n);
1239
- g && en(i, m, g), c += d;
1196
+ for (let f = c; f < c + d; f++) i.set(f, h);
1197
+ const g = tn(e, s, c, n);
1198
+ g && Zt(a, m, g), c += d;
1240
1199
  }
1241
1200
  }
1242
1201
  }
1243
- async function sn(e, t, n) {
1202
+ async function an(e, t, n) {
1244
1203
  const r = { values: [], seen: /* @__PURE__ */ new Set(), excluded: 0, selected: 0 };
1245
- for (let i = 0; i < e.pages.length; i++) {
1204
+ for (let a = 0; a < e.pages.length; a++) {
1246
1205
  await ee(n);
1247
- const o = e.pages[i];
1248
- for (let s = 0; s < o.components.length; s++) {
1206
+ const o = e.pages[a];
1207
+ for (let l = 0; l < o.components.length; l++) {
1249
1208
  await ee(n);
1250
- const a = o.components[s];
1251
- if (!a.grid || !tn(a, i, s, t) || a.table && a.table.role !== "body") continue;
1252
- const l = an(a, t);
1253
- l && await on(a, l, t, n, r);
1209
+ const i = o.components[l];
1210
+ if (!i.grid || !Qt(i, a, l, t) || i.table && i.table.role !== "body") continue;
1211
+ const s = nn(i, t);
1212
+ s && await rn(i, s, t, n, r);
1254
1213
  }
1255
1214
  }
1256
1215
  return r;
@@ -1259,90 +1218,90 @@ function V(e) {
1259
1218
  if (!Number.isFinite(e)) throw new b("overflow");
1260
1219
  return e;
1261
1220
  }
1262
- function ln(e) {
1221
+ function on(e) {
1263
1222
  let t = 0, n = 0;
1264
1223
  for (const r of e) {
1265
- const i = r - n, o = V(t + i);
1266
- n = o - t - i, t = o;
1224
+ const a = r - n, o = V(t + a);
1225
+ n = o - t - a, t = o;
1267
1226
  }
1268
1227
  return t;
1269
1228
  }
1270
- async function Se(e, t) {
1229
+ async function Ee(e, t) {
1271
1230
  let n = [...e], r = new Array(e.length);
1272
1231
  for (let o = 1; o < e.length; o *= 2) {
1273
- for (let s = 0; s < e.length; s += o * 2) {
1274
- const a = Math.min(s + o, e.length), l = Math.min(s + o * 2, e.length);
1275
- let c = s, m = a;
1276
- for (let d = s; d < l; d++)
1277
- r[d] = m >= l || c < a && n[c] <= n[m] ? n[c++] : n[m++], d % 2048 === 0 && (await t.yieldToHost(), _(t.signal));
1232
+ for (let l = 0; l < e.length; l += o * 2) {
1233
+ const i = Math.min(l + o, e.length), s = Math.min(l + o * 2, e.length);
1234
+ let c = l, m = i;
1235
+ for (let d = l; d < s; d++)
1236
+ r[d] = m >= s || c < i && n[c] <= n[m] ? n[c++] : n[m++], d % 2048 === 0 && (await t.yieldToHost(), B(t.signal));
1278
1237
  }
1279
1238
  [n, r] = [r, n];
1280
1239
  }
1281
- const i = Math.floor(n.length / 2);
1282
- return n.length % 2 ? n[i] : V(n[i - 1] / 2 + n[i] / 2);
1240
+ const a = Math.floor(n.length / 2);
1241
+ return n.length % 2 ? n[a] : V(n[a - 1] / 2 + n[a] / 2);
1283
1242
  }
1284
- function cn(e) {
1285
- const t = ln(e);
1243
+ function sn(e) {
1244
+ const t = on(e);
1286
1245
  let n = 1 / 0, r = -1 / 0;
1287
- for (const i of e)
1288
- n = Math.min(n, i), r = Math.max(r, i);
1246
+ for (const a of e)
1247
+ n = Math.min(n, a), r = Math.max(r, a);
1289
1248
  return { SUM: t, AVERAGE: t / e.length, AVG: t / e.length, MIN: n, MAX: r, COUNT: e.length };
1290
1249
  }
1291
- function mn(e, t) {
1250
+ function ln(e, t) {
1292
1251
  if (typeof e != "string" || e.length > 256) throw new b("expression");
1293
1252
  const n = e.toUpperCase().match(/(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?|[A-Z_]+|[()+\-*/]|\S/g) ?? [];
1294
1253
  if (!n.length || n.length > 64) throw new b("expression");
1295
1254
  let r = 0;
1296
- function i(a) {
1297
- if (a > 16) throw new b("expression");
1298
- const l = n[r++];
1299
- if (l === "+" || l === "-") return (l === "-" ? -1 : 1) * i(a + 1);
1300
- if (l === "(") {
1301
- const c = o(0, a + 1);
1255
+ function a(i) {
1256
+ if (i > 16) throw new b("expression");
1257
+ const s = n[r++];
1258
+ if (s === "+" || s === "-") return (s === "-" ? -1 : 1) * a(i + 1);
1259
+ if (s === "(") {
1260
+ const c = o(0, i + 1);
1302
1261
  if (n[r++] !== ")") throw new b("expression");
1303
1262
  return c;
1304
1263
  }
1305
- if (l && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(l) && Object.prototype.hasOwnProperty.call(t, l)) return V(t[l]);
1306
- if (l && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(l)) return V(Number(l));
1264
+ if (s && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(s) && Object.prototype.hasOwnProperty.call(t, s)) return V(t[s]);
1265
+ if (s && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(s)) return V(Number(s));
1307
1266
  throw new b("expression");
1308
1267
  }
1309
- function o(a, l) {
1310
- let c = i(l);
1268
+ function o(i, s) {
1269
+ let c = a(s);
1311
1270
  for (; r < n.length; ) {
1312
1271
  const m = n[r], d = m === "+" || m === "-" ? 1 : m === "*" || m === "/" ? 2 : 0;
1313
- if (!d || d < a) break;
1272
+ if (!d || d < i) break;
1314
1273
  r++;
1315
- const h = o(d + 1, l + 1);
1274
+ const h = o(d + 1, s + 1);
1316
1275
  if (m === "/" && h === 0) throw new b("division");
1317
1276
  c = V(m === "+" ? c + h : m === "-" ? c - h : m === "*" ? c * h : c / h);
1318
1277
  }
1319
1278
  return c;
1320
1279
  }
1321
- const s = o(1, 0);
1280
+ const l = o(1, 0);
1322
1281
  if (r !== n.length) throw new b("expression");
1323
- return s;
1282
+ return l;
1324
1283
  }
1325
- function dn(e) {
1284
+ function cn(e) {
1326
1285
  const t = e.maxCells ?? 1e5, n = e.maxScannedCells ?? 2e5, r = e.precision ?? 2;
1327
- if (![t, n].every((i) => Number.isSafeInteger(i) && i >= 1 && i <= 2e6)) throw new b("limit");
1286
+ if (![t, n].every((a) => Number.isSafeInteger(a) && a >= 1 && a <= 2e6)) throw new b("limit");
1328
1287
  if (!Number.isInteger(r) || r < 0 || r > 12) throw new b("precision");
1329
1288
  return { maxCells: t, maxScanned: n, precision: r };
1330
1289
  }
1331
- async function qn(e, t, n = {}) {
1332
- const r = dn(n), i = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((l) => setTimeout(l, 0))) };
1333
- _(i.signal);
1334
- const o = await sn(e, Xt(e, t, r.maxCells), i), s = n.operation ?? "sum";
1335
- if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(s)) throw new b("expression");
1336
- let a = null;
1337
- if (s === "count") a = o.values.length;
1290
+ async function Un(e, t, n = {}) {
1291
+ const r = cn(n), a = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((s) => setTimeout(s, 0))) };
1292
+ B(a.signal);
1293
+ const o = await an(e, Kt(e, t, r.maxCells), a), l = n.operation ?? "sum";
1294
+ if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new b("expression");
1295
+ let i = null;
1296
+ if (l === "count") i = o.values.length;
1338
1297
  else if (o.values.length)
1339
- if (s === "median") a = await Se(o.values, i);
1298
+ if (l === "median") i = await Ee(o.values, a);
1340
1299
  else {
1341
- const l = cn(o.values);
1342
- s === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (l.MEDIAN = await Se(o.values, i)), a = mn(n.expression ?? "", l)) : a = l[s.toUpperCase()];
1300
+ const s = sn(o.values);
1301
+ l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (s.MEDIAN = await Ee(o.values, a)), i = ln(n.expression ?? "", s)) : i = s[l.toUpperCase()];
1343
1302
  }
1344
- if (_(i.signal), a !== null && Number.isInteger(a) && !Number.isSafeInteger(a)) throw new b("precision");
1345
- return { value: a, formatted: a === null ? "—" : a.toFixed(r.precision), numericCells: o.values.length, excludedCells: o.excluded, selectedCells: o.selected, precision: r.precision };
1303
+ if (B(a.signal), i !== null && Number.isInteger(i) && !Number.isSafeInteger(i)) throw new b("precision");
1304
+ return { value: i, formatted: i === null ? "—" : i.toFixed(r.precision), numericCells: o.values.length, excludedCells: o.excluded, selectedCells: o.selected, precision: r.precision };
1346
1305
  }
1347
1306
  class A extends Error {
1348
1307
  constructor(t, n) {
@@ -1355,203 +1314,209 @@ function X(e) {
1355
1314
  throw t.name = "AbortError", t;
1356
1315
  }
1357
1316
  }
1358
- function H(e, t, n = !1) {
1317
+ function O(e, t, n = !1) {
1359
1318
  if (!Number.isFinite(e) || e <= 0 || n && !Number.isSafeInteger(e)) throw new A("应为正有限数字,数量应为安全整数", t);
1360
1319
  return e;
1361
1320
  }
1362
- function Te(e, t) {
1321
+ function Se(e, t) {
1363
1322
  if (!Number.isFinite(e) || e < 0) throw new A("应为非负有限数字", t);
1364
1323
  return e;
1365
1324
  }
1366
- function hn(e) {
1325
+ function mn(e) {
1367
1326
  const t = typeof e.marginMm == "object" ? e.marginMm : { top: e.marginMm ?? 0, left: e.marginMm ?? 0, bottom: e.marginMm ?? 0, right: e.marginMm ?? 0 }, n = typeof e.gapMm == "object" ? e.gapMm : { horizontal: e.gapMm ?? 0, vertical: e.gapMm ?? 0 };
1368
- for (const r of ["top", "left", "bottom", "right"]) Te(t?.[r], `$.marginMm.${r}`);
1369
- for (const r of ["horizontal", "vertical"]) Te(n?.[r], `$.gapMm.${r}`);
1327
+ for (const r of ["top", "left", "bottom", "right"]) Se(t?.[r], `$.marginMm.${r}`);
1328
+ for (const r of ["horizontal", "vertical"]) Se(n?.[r], `$.gapMm.${r}`);
1370
1329
  return { margin: t, gap: n };
1371
1330
  }
1372
- function gn(e) {
1331
+ function dn(e) {
1373
1332
  const t = e.paper === void 0 || e.paper === "a4" ? { widthMm: 210, heightMm: 297 } : e.paper;
1374
- H(t.widthMm, "$.paper.widthMm"), H(t.heightMm, "$.paper.heightMm");
1375
- const n = H(e.columns, "$.columns", !0), r = H(e.rows, "$.rows", !0), i = n * r;
1376
- if (i > 1e3) throw new A("每张纸不能超过 1000 个位置", "$.columns");
1377
- const { margin: o, gap: s } = hn(e), a = e.startSlot ?? 0, l = e.offsetMm ?? { x: 0, y: 0 };
1378
- if (!Number.isSafeInteger(a) || a < 0 || a >= i) throw new A("起始位置应在首张纸的有效位置内", "$.startSlot");
1379
- if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) throw new A("校准偏移应为有限毫米值", "$.offsetMm");
1380
- return { paper: t, columns: n, rows: r, capacity: i, margin: o, gap: s, startSlot: a, offset: l };
1381
- }
1382
- function Ve(e) {
1383
- return 1 + (e.grid?.cells.reduce((t, n) => t + n.length + 1 + n.reduce((r, i) => r + (i?.children?.reduce((o, s) => o + Ve(s), 0) ?? 0), 0), 0) ?? 0);
1384
- }
1385
- function fn(e, t, n) {
1386
- if (!Xe(e).ok) throw new A("标签计划无效", "$.plan");
1333
+ O(t.widthMm, "$.paper.widthMm"), O(t.heightMm, "$.paper.heightMm");
1334
+ const n = O(e.columns, "$.columns", !0), r = O(e.rows, "$.rows", !0), a = n * r;
1335
+ if (a > 1e3) throw new A("每张纸不能超过 1000 个位置", "$.columns");
1336
+ const { margin: o, gap: l } = mn(e), i = e.startSlot ?? 0, s = e.offsetMm ?? { x: 0, y: 0 };
1337
+ if (!Number.isSafeInteger(i) || i < 0 || i >= a) throw new A("起始位置应在首张纸的有效位置内", "$.startSlot");
1338
+ if (!Number.isFinite(s.x) || !Number.isFinite(s.y)) throw new A("校准偏移应为有限毫米值", "$.offsetMm");
1339
+ return { paper: t, columns: n, rows: r, capacity: a, margin: o, gap: l, startSlot: i, offset: s };
1340
+ }
1341
+ function Ge(e) {
1342
+ return 1 + (e.grid?.cells.reduce((t, n) => t + n.length + 1 + n.reduce((r, a) => r + (a?.children?.reduce((o, l) => o + Ge(l), 0) ?? 0), 0), 0) ?? 0);
1343
+ }
1344
+ function hn(e, t, n) {
1345
+ if (!Je(e).ok) throw new A("标签计划无效", "$.plan");
1387
1346
  const r = e.pages[0];
1388
1347
  if (!r) return;
1389
- const { paper: i, columns: o, rows: s, margin: a, gap: l, offset: c } = n;
1390
- if (a.left + c.x < 0 || a.top + c.y < 0 || a.left + c.x + o * r.pageWidthMm + (o - 1) * l.horizontal + a.right > i.widthMm + 1e-6 || a.top + c.y + s * r.pageHeightMm + (s - 1) * l.vertical + a.bottom > i.heightMm + 1e-6) throw new A("标签、间距、边距及校准偏移超过纸张尺寸;不会自动缩小标签", "$.paper");
1348
+ const { paper: a, columns: o, rows: l, margin: i, gap: s, offset: c } = n;
1349
+ if (i.left + c.x < 0 || i.top + c.y < 0 || i.left + c.x + o * r.pageWidthMm + (o - 1) * s.horizontal + i.right > a.widthMm + 1e-6 || i.top + c.y + l * r.pageHeightMm + (l - 1) * s.vertical + i.bottom > a.heightMm + 1e-6) throw new A("标签、间距、边距及校准偏移超过纸张尺寸;不会自动缩小标签", "$.paper");
1391
1350
  let m = 0;
1392
1351
  for (const [d, h] of e.pages.entries()) {
1393
1352
  if (X(t.signal), h.layout === "wide" || h.pageWidthMm !== r.pageWidthMm || h.pageHeightMm !== r.pageHeightMm) throw new A("拼版需要尺寸相同的固定标签页面", `$.pages.${d}`);
1394
- if (m += h.components.reduce((g, f) => g + Ve(f), 0), m > H(t.maxComponents ?? 25e4, "$.maxComponents", !0)) throw new A("拼版组件总量超过预算", "$.maxComponents");
1353
+ if (m += h.components.reduce((g, f) => g + Ge(f), 0), m > O(t.maxComponents ?? 25e4, "$.maxComponents", !0)) throw new A("拼版组件总量超过预算", "$.maxComponents");
1395
1354
  for (const g of h.components) if (g.leftMm < 0 || g.topMm < 0 || g.leftMm + g.widthMm > h.pageWidthMm + 1e-6 || g.topMm + g.heightMm > h.pageHeightMm + 1e-6) throw new A("标签内容超出标签边界", `$.pages.${d}.components`);
1396
1355
  }
1397
1356
  }
1398
- function Jn(e, t) {
1357
+ function Gn(e, t) {
1399
1358
  X(t.signal);
1400
- const n = gn(t), { paper: r, columns: i, capacity: o, margin: s, gap: a, startSlot: l, offset: c } = n, m = e.pages.length ? Math.ceil((l + e.pages.length) / o) : 0;
1401
- if (m > H(t.maxSheets ?? 1e4, "$.maxSheets", !0)) throw new A("拼版纸张数量超过预算", "$.maxSheets");
1402
- H(t.maxComponents ?? 25e4, "$.maxComponents", !0), fn(e, t, n);
1403
- const d = nt(e, { maxBytes: H(t.maxSnapshotBytes ?? 64e6, "$.maxSnapshotBytes", !0), check: () => X(t.signal), error: (g, f) => new A(f, "$.maxSnapshotBytes") }), h = Array.from({ length: m }, () => ({ pageWidthMm: r.widthMm, pageHeightMm: r.heightMm, components: [], meta: { labelSheet: { columns: i, rows: n.rows, slots: [] } } }));
1359
+ const n = dn(t), { paper: r, columns: a, capacity: o, margin: l, gap: i, startSlot: s, offset: c } = n, m = e.pages.length ? Math.ceil((s + e.pages.length) / o) : 0;
1360
+ if (m > O(t.maxSheets ?? 1e4, "$.maxSheets", !0)) throw new A("拼版纸张数量超过预算", "$.maxSheets");
1361
+ O(t.maxComponents ?? 25e4, "$.maxComponents", !0), hn(e, t, n);
1362
+ const d = Qe(e, { maxBytes: O(t.maxSnapshotBytes ?? 64e6, "$.maxSnapshotBytes", !0), check: () => X(t.signal), error: (g, f) => new A(f, "$.maxSnapshotBytes") }), h = Array.from({ length: m }, () => ({ pageWidthMm: r.widthMm, pageHeightMm: r.heightMm, components: [], meta: { labelSheet: { columns: a, rows: n.rows, slots: [] } } }));
1404
1363
  for (const [g, f] of d.pages.entries()) {
1405
1364
  X(t.signal);
1406
- const w = l + g, C = w % o, x = h[Math.floor(w / o)], M = s.left + c.x + C % i * (f.pageWidthMm + a.horizontal), R = s.top + c.y + Math.floor(C / i) * (f.pageHeightMm + a.vertical), z = { sourcePageIndex: g, slotIndex: C, xMm: M, yMm: R, widthMm: f.pageWidthMm, heightMm: f.pageHeightMm, ...f.meta ? { sourceMeta: f.meta } : {} };
1407
- x.meta.labelSheet.slots.push(z), x.components.push(...f.components.map((L) => ({ ...L, leftMm: L.leftMm + M, topMm: L.topMm + R, meta: { ...L.meta, labelSheet: z } })));
1365
+ const w = s + g, C = w % o, x = h[Math.floor(w / o)], v = l.left + c.x + C % a * (f.pageWidthMm + i.horizontal), R = l.top + c.y + Math.floor(C / a) * (f.pageHeightMm + i.vertical), H = { sourcePageIndex: g, slotIndex: C, xMm: v, yMm: R, widthMm: f.pageWidthMm, heightMm: f.pageHeightMm, ...f.meta ? { sourceMeta: f.meta } : {} };
1366
+ x.meta.labelSheet.slots.push(H), x.components.push(...f.components.map((N) => ({ ...N, leftMm: N.leftMm + v, topMm: N.topMm + R, meta: { ...N.meta, labelSheet: H } })));
1408
1367
  }
1409
1368
  return { ...d, pages: h };
1410
1369
  }
1411
1370
  export {
1412
- dr as CSS_DPI,
1413
- Xn as DEFAULT_BORDER_PT,
1371
+ lr as CSS_DPI,
1372
+ Yn as DEFAULT_BORDER_PT,
1414
1373
  te as DEFAULT_FONT_FAMILY,
1415
- Zn as DEFAULT_FONT_PT,
1416
- $r as DEFAULT_LABEL_PAGE_LIMIT,
1417
- Qn as DEFAULT_STROKE_COLOR,
1418
- Ce as DEFAULT_TEXT_COLOR,
1419
- er as LINE_HEIGHT,
1374
+ Kn as DEFAULT_FONT_PT,
1375
+ kr as DEFAULT_LABEL_PAGE_LIMIT,
1376
+ Jn as DEFAULT_STROKE_COLOR,
1377
+ Te as DEFAULT_TEXT_COLOR,
1378
+ Xn as LINE_HEIGHT,
1420
1379
  A as LabelSheetError,
1421
- hr as MM_PER_INCH,
1422
- Sr as OutputAssetError,
1423
- rt as OutputFidelityError,
1380
+ cr as MM_PER_INCH,
1381
+ Kr as OutputAssetError,
1382
+ et as OutputFidelityError,
1424
1383
  Z as PAPER_SIZES,
1425
- kt as PageBuilder,
1426
- kr as PaginateCellLimitError,
1427
- Ir as PaginatePageLimitError,
1428
- pr as RENDER_PLAN_SCHEMA_VERSION,
1429
- ai as REPORT_TEMPLATE_DOCUMENT_VERSION,
1430
- rr as ReportBindingError,
1384
+ $t as PageBuilder,
1385
+ Ir as PaginateCellLimitError,
1386
+ Nr as PaginatePageLimitError,
1387
+ gr as RENDER_PLAN_SCHEMA_VERSION,
1388
+ ur as REPORT_TEMPLATE_DOCUMENT_VERSION,
1389
+ er as ReportBindingError,
1431
1390
  b as ReportCalculationError,
1432
- et as ReportCellEditError,
1433
- _t as ReportCellFieldError,
1434
- di as ReportParamValidationError,
1435
- me as ReportSourceError,
1436
- Fe as ReportTemplateError,
1437
- F as ReportTemplateStoreError,
1438
- tr as SCHEMA_VERSION_MACH,
1439
- $t as TemplateBuilder,
1440
- Di as TreeRowLimitError,
1441
- Nr as applyReportCellEdit,
1442
- Lr as applyReportCellEditBatch,
1443
- $i as applyReportDocumentStyle,
1444
- Dr as applyReportEditResult,
1445
- br as assertRenderPlan,
1446
- hi as assertReportParams,
1447
- qn as calculateReportSelection,
1448
- ki as captureTemplateFragment,
1449
- Tr as charWidthEm,
1391
+ rt as ReportCellEditError,
1392
+ Wt as ReportCellFieldError,
1393
+ Xr as ReportDrillError,
1394
+ ra as ReportParamValidationError,
1395
+ ce as ReportSourceError,
1396
+ ke as ReportTemplateError,
1397
+ D as ReportTemplateStoreError,
1398
+ Zn as SCHEMA_VERSION_MACH,
1399
+ At as TemplateBuilder,
1400
+ _a as TreeRowLimitError,
1401
+ Na as applyReportCellEdit,
1402
+ La as applyReportCellEditBatch,
1403
+ Pa as applyReportDocumentStyle,
1404
+ Lr as applyReportEditResult,
1405
+ Dr as applyReportSourceMetadata,
1406
+ pr as assertRenderPlan,
1407
+ aa as assertReportParams,
1408
+ Un as calculateReportSelection,
1409
+ Aa as captureTemplateFragment,
1410
+ Cr as charWidthEm,
1450
1411
  T as classOf,
1451
- _n as cloneReportTemplate,
1452
- Ci as collectTemplateOutline,
1453
- Dn as columnsFromContract,
1454
- xt as computePageWindow,
1412
+ fa as cloneReportTemplate,
1413
+ Sa as collectTemplateOutline,
1414
+ Ln as columnsFromContract,
1415
+ vt as computePageWindow,
1455
1416
  Fr as countTemplatePages,
1456
- Cr as createCanvasMeasurer,
1457
- Nn as createCanvasPager,
1458
- Rr as createHeuristicMeasurer,
1459
- On as createLabelTemplate,
1460
- jn as createLocalTemplateCatalog,
1417
+ Rr as createCanvasMeasurer,
1418
+ In as createCanvasPager,
1419
+ Pr as createHeuristicMeasurer,
1420
+ Fn as createLabelTemplate,
1421
+ ua as createLocalTemplateCatalog,
1461
1422
  Wn as createMemoryTemplateStore,
1462
- zn as createProviderReport,
1463
- Or as createReportCellEdit,
1464
- Hr as createReportCellEditBatch,
1465
- zr as createReportCellResolver,
1466
- Br as createReportEditSession,
1467
- Wr as createReportSource,
1468
- Fn as createTableTemplate,
1469
- Ln as createTemplate,
1470
- Bn as createTemplateManager,
1471
- oi as createTemplateRegistry,
1472
- Fi as createTreeTable,
1473
- xr as datasetJsonSchema,
1474
- Hn as defineLabelReport,
1475
- Qe as defineReport,
1476
- si as defineReportTemplate,
1477
- _r as diffReportTemplates,
1478
- jr as estimateListLayoutCells,
1479
- ir as evalStyleRule,
1480
- mn as evaluateReportAggregateExpression,
1481
- Ur as formatReportCellEdit,
1482
- Un as formatReportClipboard,
1483
- gi as formatReportDateRange,
1484
- ar as formatValue,
1485
- Gr as getReportCellContext,
1486
- Vr as getReportEditSession,
1487
- xi as hasValidDataExplanation,
1423
+ Hn as createProviderReport,
1424
+ Da as createReportCellEdit,
1425
+ Fa as createReportCellEditBatch,
1426
+ Oa as createReportCellResolver,
1427
+ Zr as createReportDrillRequest,
1428
+ Or as createReportEditSession,
1429
+ Hr as createReportSource,
1430
+ Dn as createTableTemplate,
1431
+ Nn as createTemplate,
1432
+ zn as createTemplateManager,
1433
+ wr as createTemplateRegistry,
1434
+ Ua as createTreeTable,
1435
+ Sr as datasetJsonSchema,
1436
+ On as defineLabelReport,
1437
+ Ze as defineReport,
1438
+ br as defineReportTemplate,
1439
+ pa as diffReportTemplates,
1440
+ zr as estimateListLayoutCells,
1441
+ tr as evalStyleRule,
1442
+ ln as evaluateReportAggregateExpression,
1443
+ Ha as formatReportCellEdit,
1444
+ Bn as formatReportClipboard,
1445
+ ia as formatReportDateRange,
1446
+ nr as formatValue,
1447
+ za as getReportCellContext,
1448
+ Wr as getReportEditSession,
1449
+ ya as hasValidDataExplanation,
1488
1450
  le as heuristicMeasurer,
1489
- Jn as imposeLabelSheets,
1490
- Ii as insertTemplateFragment,
1491
- ri as inspectOutputCapabilities,
1492
- Ri as inspectTemplateFieldUsage,
1493
- Ni as inspectTemplateFragmentBindings,
1451
+ Gn as imposeLabelSheets,
1452
+ $a as insertTemplateFragment,
1453
+ qr as inspectOutputCapabilities,
1454
+ Ta as inspectTemplateFieldUsage,
1455
+ ka as inspectTemplateFragmentBindings,
1494
1456
  re as isImageBackedComponent,
1495
- Ei as isReportDataTarget,
1496
- fi as isReportDate,
1497
- ui as isReportMonth,
1498
- Si as isReportValueState,
1499
- pi as isReportYear,
1500
- $e as isRichText,
1457
+ va as isReportDataTarget,
1458
+ oa as isReportDate,
1459
+ sa as isReportMonth,
1460
+ xa as isReportValueState,
1461
+ la as isReportYear,
1462
+ Ae as isRichText,
1463
+ Qr as matchReportDrillActions,
1501
1464
  he as measurePageSizePx,
1502
- Pr as measureTextMm,
1503
- Pe as mergeComponentStyles,
1465
+ Ar as measureTextMm,
1466
+ Re as mergeComponentStyles,
1504
1467
  se as mmToPx,
1505
- gr as mmToPxFactor,
1506
- qr as paginateTemplate,
1507
- Jr as paginateTemplatePages,
1508
- or as parseDateLocal,
1509
- Vn as parseReportCellFieldInput,
1510
- tt as parseReportCellInput,
1511
- Gn as parseReportClipboard,
1512
- wi as parseReportDateRange,
1513
- N as parseReportTemplate,
1514
- An as planFontSizePx,
1515
- Yr as projectListColumns,
1468
+ mr as mmToPxFactor,
1469
+ Br as paginateTemplate,
1470
+ jr as paginateTemplatePages,
1471
+ rr as parseDateLocal,
1472
+ _n as parseReportCellFieldInput,
1473
+ at as parseReportCellInput,
1474
+ jn as parseReportClipboard,
1475
+ ca as parseReportDateRange,
1476
+ U as parseReportTemplate,
1477
+ Pn as planFontSizePx,
1478
+ _r as projectListColumns,
1516
1479
  W as ptToPx,
1517
- fr as pxToMm,
1518
- Kr as registerReportEditSession,
1519
- Xr as relocateReportCellEdits,
1520
- He as renderComponent,
1521
- wt as renderPage,
1522
- Pn as renderPlan,
1523
- kn as renderPlanToCanvas,
1524
- In as renderPlanToCanvasAsync,
1525
- $n as renderPlanToImages,
1526
- Zr as reportCellEditKey,
1480
+ dr as pxToMm,
1481
+ Ur as registerReportEditSession,
1482
+ Gr as relocateReportCellEdits,
1483
+ Oe as renderComponent,
1484
+ pt as renderPage,
1485
+ Rn as renderPlan,
1486
+ $n as renderPlanToCanvas,
1487
+ kn as renderPlanToCanvasAsync,
1488
+ An as renderPlanToImages,
1489
+ Wa as reportCellEditKey,
1527
1490
  q as reportOutputDiagnostics,
1528
- bi as reportParamsJsonSchema,
1529
- Re as resolveBoxBorders,
1530
- sr as resolveComponentBinding,
1531
- U as resolveFontSize,
1532
- Ie as resolveGridLayout,
1491
+ ma as reportParamsJsonSchema,
1492
+ Ce as resolveBoxBorders,
1493
+ ar as resolveComponentBinding,
1494
+ _ as resolveFontSize,
1495
+ Ne as resolveGridLayout,
1533
1496
  ne as resolveLineHeight,
1534
- Ue as resolvePaper,
1535
- ce as resolvePlanAssets,
1497
+ _e as resolvePaper,
1498
+ me as resolvePlanAssets,
1499
+ ea as resolveReportDrillReturn,
1536
1500
  G as resolveStroke,
1537
- Ae as resolveTextColor,
1538
- Qr as reviewReportTemplate,
1539
- ei as reviewReportTemplateAsync,
1501
+ Pe as resolveTextColor,
1502
+ wa as reviewReportTemplate,
1503
+ ba as reviewReportTemplateAsync,
1540
1504
  j as round,
1541
- li as serializeReportTemplate,
1542
- ti as summarizeReportCellEdits,
1543
- Pi as templatePathLocation,
1544
- lr as toExcelNumberFormat,
1545
- cr as toNumber,
1505
+ Mr as serializeReportTemplate,
1506
+ Ba as summarizeReportCellEdits,
1507
+ Ca as templatePathLocation,
1508
+ ir as toExcelNumberFormat,
1509
+ or as toNumber,
1546
1510
  yr as validateComponent,
1547
- Ze as validateDatasetRows,
1511
+ Xe as validateDatasetRows,
1548
1512
  vr as validatePage,
1549
- Xe as validateRenderPlan,
1550
- Kt as validateReportCellFieldDefinition,
1551
- yi as validateReportParamDefinitions,
1552
- vi as validateReportParams,
1553
- De as validateReportTemplate,
1554
- ci as validateReportTemplateDocument,
1555
- Oi as validateTreeOptions,
1556
- ke as wrapText
1513
+ Je as validateRenderPlan,
1514
+ Yt as validateReportCellFieldDefinition,
1515
+ ta as validateReportDrillActions,
1516
+ da as validateReportParamDefinitions,
1517
+ ha as validateReportParams,
1518
+ $e as validateReportTemplate,
1519
+ xr as validateReportTemplateDocument,
1520
+ Ga as validateTreeOptions,
1521
+ Ie as wrapText
1557
1522
  };