@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
@@ -0,0 +1,26 @@
1
+ --- LICENSE ---
2
+ Copyright (c) 2012 - 2013 Near Infinity Corporation
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
23
+ ---
24
+
25
+ Commits in this fork are (c) Ziggy Jonsson (ziggy.jonsson.nyc@gmail.com)
26
+ and fall under same licence structure as the original repo (MIT)
@@ -0,0 +1,25 @@
1
+ --- LICENSE ---
2
+ (The MIT License)
3
+
4
+ Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
5
+
6
+ Permission is hereby granted, free of charge, to any person
7
+ obtaining a copy of this software and associated documentation
8
+ files (the "Software"), to deal in the Software without
9
+ restriction, including without limitation the rights to use,
10
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the
12
+ Software is furnished to do so, subject to the following
13
+ conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,10 @@
1
+ --- LICENSE.md ---
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2010-2020 Robert Kieffer and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ --- LICENSE ---
2
+ The ISC License
3
+
4
+ Copyright (c) Isaac Z. Schlueter and Contributors
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted, provided that the above
8
+ copyright notice and this permission notice appear in all copies.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
16
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,19 @@
1
+ --- LICENSE ---
2
+ Copyright Louis-Dominique Dubeau and contributors to xmlchars
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ --- LICENSE ---
2
+ Copyright (c) 2014 Chris Talkington, contributors.
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,112 @@
1
+ import { c as h } from "./computed-C-4C2S5h.js";
2
+ function y(l, e) {
3
+ const r = () => e.measures.map((c) => h(c)), t = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = e.totals ? r() : void 0, n = (c, s) => c?.forEach((o) => o.add(s));
4
+ for (const c of l) {
5
+ const s = e.row(c), o = e.column(c);
6
+ f.has(o.key) || f.set(o.key, o.label);
7
+ let u = t.get(s.key);
8
+ u || (u = { label: s.label, cells: /* @__PURE__ */ new Map(), ...e.totals ? { totals: r() } : {} }, t.set(s.key, u)), e.check(t.size, f.size);
9
+ let w = u.cells.get(o.key);
10
+ if (w || (w = r(), u.cells.set(o.key, w)), n(w, c), !e.totals) continue;
11
+ let d = i.get(o.key);
12
+ d || (d = r(), i.set(o.key, d)), n(u.totals, c), n(d, c), n(a, c);
13
+ }
14
+ return { groups: t, columns: f, columnTotals: i, totals: a };
15
+ }
16
+ function m(l, e) {
17
+ const r = e.map(
18
+ (t) => Object.prototype.hasOwnProperty.call(l, t) ? l[t] : null
19
+ );
20
+ if (r.some(
21
+ (t) => t != null && typeof t != "string" && typeof t != "boolean" && !(typeof t == "number" && Number.isFinite(t))
22
+ ))
23
+ throw new Error("矩阵维度必须是有限 JSON 标量");
24
+ return {
25
+ key: JSON.stringify(r.map((t) => [typeof t, t ?? null])),
26
+ label: r.map((t) => t == null ? "" : String(t)).join(" / ")
27
+ };
28
+ }
29
+ function g(l) {
30
+ for (const e of [
31
+ "maxRows",
32
+ "maxColumns",
33
+ "maxInputRows",
34
+ "maxCells"
35
+ ])
36
+ if (l[e] !== void 0 && (!Number.isSafeInteger(l[e]) || l[e] < 1))
37
+ throw new Error("矩阵预算应为正安全整数");
38
+ for (const e of ["columnWidthMm", "rowWidthMm"])
39
+ if (l[e] !== void 0 && (!Number.isFinite(l[e]) || l[e] <= 0))
40
+ throw new Error("矩阵列宽应为正数");
41
+ }
42
+ function b(l) {
43
+ if (!l || !Array.isArray(l.rowFields) || !Array.isArray(l.columnFields) || !Array.isArray(l.measures))
44
+ throw new Error("矩阵需要行维度、列维度和度量数组");
45
+ for (const r of [l.rowFields, l.columnFields])
46
+ if (r.some((t) => typeof t != "string" || !t.trim()) || new Set(r).size !== r.length)
47
+ throw new Error("矩阵维度字段应非空且唯一");
48
+ if (g(l), !l.rowFields.length || !l.columnFields.length || l.rowFields.length > 16 || l.columnFields.length > 16)
49
+ throw new Error("矩阵需要 1–16 个行/列维度");
50
+ if (!l.measures.length || l.measures.length > 32)
51
+ throw new Error("矩阵需要 1–32 个度量");
52
+ if (l.measures.map((r) => {
53
+ if (!r || typeof r != "object") throw new Error("矩阵度量应为对象");
54
+ if (h({
55
+ ...r,
56
+ field: r.valueField ?? r.field
57
+ }), r.label !== void 0 && typeof r.label != "string")
58
+ throw new Error("矩阵度量标签应为字符串");
59
+ return r.field;
60
+ }).some((r) => typeof r != "string" || !r.trim()))
61
+ throw new Error("矩阵度量字段应非空");
62
+ }
63
+ function k(l, e) {
64
+ if (b(e), !Array.isArray(l) || l.length > (e.maxInputRows ?? 1e5))
65
+ throw new Error("矩阵输入超出预算");
66
+ const r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
67
+ for (const a of l) {
68
+ if (!a || typeof a != "object" || Array.isArray(a))
69
+ throw new Error("矩阵数据行应为对象");
70
+ if (r.add(m(a, e.rowFields).key), t.add(m(a, e.columnFields).key), r.size > (e.maxRows ?? 1e3) || t.size > (e.maxColumns ?? 200))
71
+ throw new Error("矩阵维度数量超出预算");
72
+ if ((r.size + +!!e.totals) * ((t.size + +!!e.totals) * e.measures.length + 1) > (e.maxCells ?? 2e6))
73
+ throw new Error("矩阵输出超出 maxCells 预算");
74
+ }
75
+ const f = r.size + +(!!e.totals && l.length > 0), i = (t.size + +!!e.totals) * e.measures.length + 1;
76
+ return { rowCount: f, columnCount: i, cells: f * i };
77
+ }
78
+ function E(l, e) {
79
+ k(l, e);
80
+ const r = y(l, {
81
+ row: (a) => m(a, e.rowFields),
82
+ column: (a) => m(a, e.columnFields),
83
+ measures: e.measures.map((a) => ({ ...a, field: a.valueField ?? a.field })),
84
+ totals: e.totals,
85
+ check: () => {
86
+ }
87
+ // Cardinality/budgets were checked before allocating accumulators.
88
+ }), t = [...r.groups.values()].map((a) => ({ rowLabel: a.label })), f = [{ field: "rowLabel", header: e.rowHeader ?? e.rowFields.join(" / "), semanticRole: "dimension" }], i = { rowLabel: "合计" };
89
+ return e.measures.forEach((a, n) => {
90
+ const c = [...r.columns.entries()].map(([s, o], u) => ({ key: s, label: o, field: `c${u}_${n}` }));
91
+ e.totals && c.push({ key: "", label: "合计", field: `total_${n}` });
92
+ for (const s of c) {
93
+ const o = s.field === `total_${n}`;
94
+ f.push({
95
+ field: s.field,
96
+ header: `${s.label} · ${a.label ?? `${a.field} (${a.op})`}`,
97
+ semanticRole: "measure",
98
+ ...a.digits === void 0 ? {} : { format: { kind: "number", digits: a.digits } }
99
+ });
100
+ let u = 0;
101
+ for (const w of r.groups.values())
102
+ t[u++][s.field] = (o ? w.totals?.[n] : w.cells.get(s.key)?.[n])?.value() ?? (a.op === "count" ? 0 : null);
103
+ i[s.field] = (o ? r.totals?.[n] : r.columnTotals.get(s.key)?.[n])?.value() ?? (a.op === "count" ? 0 : null);
104
+ }
105
+ }), e.totals && l.length && t.push(i), { rows: t, columns: f };
106
+ }
107
+ export {
108
+ y as a,
109
+ E as c,
110
+ k as e,
111
+ b as v
112
+ };
@@ -0,0 +1 @@
1
+ "use strict";const h=require("./computed-CGV2a809.cjs");function g(r,e){const l=()=>e.measures.map(c=>h.createAggregateAccumulator(c)),t=new Map,u=new Map,i=new Map,a=e.totals?l():void 0,n=(c,s)=>c?.forEach(o=>o.add(s));for(const c of r){const s=e.row(c),o=e.column(c);u.has(o.key)||u.set(o.key,o.label);let f=t.get(s.key);f||(f={label:s.label,cells:new Map,...e.totals?{totals:l()}:{}},t.set(s.key,f)),e.check(t.size,u.size);let w=f.cells.get(o.key);if(w||(w=l(),f.cells.set(o.key,w)),n(w,c),!e.totals)continue;let d=i.get(o.key);d||(d=l(),i.set(o.key,d)),n(f.totals,c),n(d,c),n(a,c)}return{groups:t,columns:u,columnTotals:i,totals:a}}function m(r,e){const l=e.map(t=>Object.prototype.hasOwnProperty.call(r,t)?r[t]:null);if(l.some(t=>t!=null&&typeof t!="string"&&typeof t!="boolean"&&!(typeof t=="number"&&Number.isFinite(t))))throw new Error("矩阵维度必须是有限 JSON 标量");return{key:JSON.stringify(l.map(t=>[typeof t,t??null])),label:l.map(t=>t==null?"":String(t)).join(" / ")}}function k(r){for(const e of["maxRows","maxColumns","maxInputRows","maxCells"])if(r[e]!==void 0&&(!Number.isSafeInteger(r[e])||r[e]<1))throw new Error("矩阵预算应为正安全整数");for(const e of["columnWidthMm","rowWidthMm"])if(r[e]!==void 0&&(!Number.isFinite(r[e])||r[e]<=0))throw new Error("矩阵列宽应为正数")}function y(r){if(!r||!Array.isArray(r.rowFields)||!Array.isArray(r.columnFields)||!Array.isArray(r.measures))throw new Error("矩阵需要行维度、列维度和度量数组");for(const l of[r.rowFields,r.columnFields])if(l.some(t=>typeof t!="string"||!t.trim())||new Set(l).size!==l.length)throw new Error("矩阵维度字段应非空且唯一");if(k(r),!r.rowFields.length||!r.columnFields.length||r.rowFields.length>16||r.columnFields.length>16)throw new Error("矩阵需要 1–16 个行/列维度");if(!r.measures.length||r.measures.length>32)throw new Error("矩阵需要 1–32 个度量");if(r.measures.map(l=>{if(!l||typeof l!="object")throw new Error("矩阵度量应为对象");if(h.createAggregateAccumulator({...l,field:l.valueField??l.field}),l.label!==void 0&&typeof l.label!="string")throw new Error("矩阵度量标签应为字符串");return l.field}).some(l=>typeof l!="string"||!l.trim()))throw new Error("矩阵度量字段应非空")}function b(r,e){if(y(e),!Array.isArray(r)||r.length>(e.maxInputRows??1e5))throw new Error("矩阵输入超出预算");const l=new Set,t=new Set;for(const a of r){if(!a||typeof a!="object"||Array.isArray(a))throw new Error("矩阵数据行应为对象");if(l.add(m(a,e.rowFields).key),t.add(m(a,e.columnFields).key),l.size>(e.maxRows??1e3)||t.size>(e.maxColumns??200))throw new Error("矩阵维度数量超出预算");if((l.size+ +!!e.totals)*((t.size+ +!!e.totals)*e.measures.length+1)>(e.maxCells??2e6))throw new Error("矩阵输出超出 maxCells 预算")}const u=l.size+ +(!!e.totals&&r.length>0),i=(t.size+ +!!e.totals)*e.measures.length+1;return{rowCount:u,columnCount:i,cells:u*i}}function x(r,e){b(r,e);const l=g(r,{row:a=>m(a,e.rowFields),column:a=>m(a,e.columnFields),measures:e.measures.map(a=>({...a,field:a.valueField??a.field})),totals:e.totals,check:()=>{}}),t=[...l.groups.values()].map(a=>({rowLabel:a.label})),u=[{field:"rowLabel",header:e.rowHeader??e.rowFields.join(" / "),semanticRole:"dimension"}],i={rowLabel:"合计"};return e.measures.forEach((a,n)=>{const c=[...l.columns.entries()].map(([s,o],f)=>({key:s,label:o,field:`c${f}_${n}`}));e.totals&&c.push({key:"",label:"合计",field:`total_${n}`});for(const s of c){const o=s.field===`total_${n}`;u.push({field:s.field,header:`${s.label} · ${a.label??`${a.field} (${a.op})`}`,semanticRole:"measure",...a.digits===void 0?{}:{format:{kind:"number",digits:a.digits}}});let f=0;for(const w of l.groups.values())t[f++][s.field]=(o?w.totals?.[n]:w.cells.get(s.key)?.[n])?.value()??(a.op==="count"?0:null);i[s.field]=(o?l.totals?.[n]:l.columnTotals.get(s.key)?.[n])?.value()??(a.op==="count"?0:null)}}),e.totals&&r.length&&t.push(i),{rows:t,columns:u}}exports.accumulatePivotRows=g;exports.createMatrixTable=x;exports.estimateMatrixTable=b;exports.validateMatrixOptions=y;
@@ -0,0 +1 @@
1
+ "use strict";class f extends Error{constructor(e,n){super(n),this.code=e,this.name="ImageMediaError"}}const h={maxImageBytes:16*1024*1024,maxTotalImageBytes:32*1024*1024,maxImages:1e3,maxImagePixels:16e6,maxTotalImagePixels:64e6,maxImageDimension:16384};function i(t){throw new f("invalid-image-data",t)}function d(t){throw new f("image-budget-exceeded",t)}function l(t){const e={...h};for(const n of Object.keys(h)){const a=t[n]??h[n];if(!Number.isSafeInteger(a)||a<=0||a>2147483647)throw new RangeError(`${n} 图片预算须为1至2147483647的整数。`);e[n]=a}return e}function x(t){if(t.length<33||![137,80,78,71,13,10,26,10].every((n,a)=>t[a]===n))return i("图片内容与 PNG/JPEG 类型不一致。");const e=new DataView(t.buffer,t.byteOffset,t.byteLength);return e.getUint32(8)!==13||String.fromCharCode(...t.subarray(12,16))!=="IHDR"?i("PNG must begin with an IHDR header."):[e.getUint32(16),e.getUint32(20)]}const I=new Set([192,193,194,195,197,198,199,201,202,203,205,206,207]);function p(t){if(t[0]!==255||t[1]!==216)return i("图片内容与 PNG/JPEG 类型不一致。");let e=2;for(;e+3<t.length;){if(t[e++]!==255)return i("JPEG marker is malformed.");for(;t[e]===255;)e++;const n=t[e++];if(n===217||n===218)break;if(n===1||n>=208&&n<=215)continue;const a=t[e]*256+t[e+1];if(a<2||e+a>t.length)return i("JPEG segment exceeds its data boundary.");if(I.has(n))return a<8?i("JPEG frame header is incomplete."):[t[e+5]*256+t[e+6],t[e+3]*256+t[e+4]];e+=a}return i("JPEG has no supported dimension header.")}function w(t,e){if(t.length>Math.ceil(e.maxImageBytes/3)*4+64)return d("单张图片超过字节预算。");const n=/^data:image\/(png|jpe?g);base64,([A-Za-z0-9+/]+={0,2})$/i.exec(t);if(!n||n[2].length%4)return i("Image must contain valid PNG/JPEG base64 data.");const a=n[2],g=a.length/4*3-(a.endsWith("==")?2:a.endsWith("=")?1:0);if(g>e.maxImageBytes)return d("单张图片超过字节预算。");const s=n[1].toLowerCase()==="png"?"png":"jpeg",u=atob(a),o=new Uint8Array(g);for(let m=0;m<g;m++)o[m]=u.charCodeAt(m);const[r,c]=s==="png"?x(o):p(o);return!r||!c?i("Image dimensions must be positive."):r>e.maxImageDimension||c>e.maxImageDimension||r*c>e.maxImagePixels?d("Image exceeds its decoded dimension or pixel budget."):{dataUrl:`data:image/${s};base64,${a}`,bytes:o,extension:s,width:r,height:c}}function P(t={}){const e=l(t),n=new Map;let a=0,g=0;return s=>{const u=s.replace(/^data:image\/(png|jpe?g);base64,/i,(c,m)=>`data:image/${m.toLowerCase()==="png"?"png":"jpeg"};base64,`),o=n.get(u);if(o)return o;if(n.size>=e.maxImages)return d("唯一图片数量超过预算。");const r=w(s,e);return a+r.bytes.length>e.maxTotalImageBytes||g+r.width*r.height>e.maxTotalImagePixels?d("图片总字节或总像素超过预算。"):(a+=r.bytes.length,g+=r.width*r.height,n.set(u,r),r)}}exports.ImageMediaError=f;exports.createImageMediaInspector=P;
@@ -0,0 +1,70 @@
1
+ class f extends Error {
2
+ constructor(e, n) {
3
+ super(n), this.code = e, this.name = "ImageMediaError";
4
+ }
5
+ }
6
+ const h = { maxImageBytes: 16 * 1024 * 1024, maxTotalImageBytes: 32 * 1024 * 1024, maxImages: 1e3, maxImagePixels: 16e6, maxTotalImagePixels: 64e6, maxImageDimension: 16384 };
7
+ function r(t) {
8
+ throw new f("invalid-image-data", t);
9
+ }
10
+ function d(t) {
11
+ throw new f("image-budget-exceeded", t);
12
+ }
13
+ function l(t) {
14
+ const e = { ...h };
15
+ for (const n of Object.keys(h)) {
16
+ const a = t[n] ?? h[n];
17
+ if (!Number.isSafeInteger(a) || a <= 0 || a > 2147483647) throw new RangeError(`${n} 图片预算须为1至2147483647的整数。`);
18
+ e[n] = a;
19
+ }
20
+ return e;
21
+ }
22
+ function x(t) {
23
+ if (t.length < 33 || ![137, 80, 78, 71, 13, 10, 26, 10].every((n, a) => t[a] === n)) return r("图片内容与 PNG/JPEG 类型不一致。");
24
+ const e = new DataView(t.buffer, t.byteOffset, t.byteLength);
25
+ return e.getUint32(8) !== 13 || String.fromCharCode(...t.subarray(12, 16)) !== "IHDR" ? r("PNG must begin with an IHDR header.") : [e.getUint32(16), e.getUint32(20)];
26
+ }
27
+ const p = /* @__PURE__ */ new Set([192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207]);
28
+ function I(t) {
29
+ if (t[0] !== 255 || t[1] !== 216) return r("图片内容与 PNG/JPEG 类型不一致。");
30
+ let e = 2;
31
+ for (; e + 3 < t.length; ) {
32
+ if (t[e++] !== 255) return r("JPEG marker is malformed.");
33
+ for (; t[e] === 255; ) e++;
34
+ const n = t[e++];
35
+ if (n === 217 || n === 218) break;
36
+ if (n === 1 || n >= 208 && n <= 215) continue;
37
+ const a = t[e] * 256 + t[e + 1];
38
+ if (a < 2 || e + a > t.length) return r("JPEG segment exceeds its data boundary.");
39
+ if (p.has(n))
40
+ return a < 8 ? r("JPEG frame header is incomplete.") : [t[e + 5] * 256 + t[e + 6], t[e + 3] * 256 + t[e + 4]];
41
+ e += a;
42
+ }
43
+ return r("JPEG has no supported dimension header.");
44
+ }
45
+ function w(t, e) {
46
+ if (t.length > Math.ceil(e.maxImageBytes / 3) * 4 + 64) return d("单张图片超过字节预算。");
47
+ const n = /^data:image\/(png|jpe?g);base64,([A-Za-z0-9+/]+={0,2})$/i.exec(t);
48
+ if (!n || n[2].length % 4) return r("Image must contain valid PNG/JPEG base64 data.");
49
+ const a = n[2], g = a.length / 4 * 3 - (a.endsWith("==") ? 2 : a.endsWith("=") ? 1 : 0);
50
+ if (g > e.maxImageBytes) return d("单张图片超过字节预算。");
51
+ const s = n[1].toLowerCase() === "png" ? "png" : "jpeg", u = atob(a), o = new Uint8Array(g);
52
+ for (let m = 0; m < g; m++) o[m] = u.charCodeAt(m);
53
+ const [i, c] = s === "png" ? x(o) : I(o);
54
+ return !i || !c ? r("Image dimensions must be positive.") : i > e.maxImageDimension || c > e.maxImageDimension || i * c > e.maxImagePixels ? d("Image exceeds its decoded dimension or pixel budget.") : { dataUrl: `data:image/${s};base64,${a}`, bytes: o, extension: s, width: i, height: c };
55
+ }
56
+ function P(t = {}) {
57
+ const e = l(t), n = /* @__PURE__ */ new Map();
58
+ let a = 0, g = 0;
59
+ return (s) => {
60
+ const u = s.replace(/^data:image\/(png|jpe?g);base64,/i, (c, m) => `data:image/${m.toLowerCase() === "png" ? "png" : "jpeg"};base64,`), o = n.get(u);
61
+ if (o) return o;
62
+ if (n.size >= e.maxImages) return d("唯一图片数量超过预算。");
63
+ const i = w(s, e);
64
+ return a + i.bytes.length > e.maxTotalImageBytes || g + i.width * i.height > e.maxTotalImagePixels ? d("图片总字节或总像素超过预算。") : (a += i.bytes.length, g += i.width * i.height, n.set(u, i), i);
65
+ };
66
+ }
67
+ export {
68
+ f as I,
69
+ P as c
70
+ };
@@ -0,0 +1 @@
1
+ "use strict";function v(e){const t=[];return e.optionsSource!==void 0&&((e.type!=="select"||typeof e.optionsSource!="string"||!/^[\w][\w.:-]{0,127}$/.test(e.optionsSource))&&t.push("远程选项来源应为 select 的有效来源键(最多 128 字符)"),e.options!==void 0&&t.push("远程选项来源与静态选项不能同时配置")),e.dependsOn!==void 0&&(!e.optionsSource||!Array.isArray(e.dependsOn)||e.dependsOn.length>32||e.dependsOn.some(n=>typeof n!="string"||!n)||new Set(e.dependsOn).size!==e.dependsOn.length)&&t.push("联动依赖应为远程选项的最多 32 个唯一参数名"),t}function Y(e){const t=new Map(e.map((i,s)=>[i.field,{def:i,index:s,degree:0,children:[]}])),n=[];for(const i of t.values())for(const s of i.def.dependsOn??[]){const o=t.get(s);if(!o){n.push({index:i.index,message:`联动依赖参数 ${s} 未声明`});continue}i.degree++,o.children.push(i.def.field)}const r=[...t.values()].filter(i=>i.degree===0);for(let i=0;i<r.length;i++)for(const s of r[i].children){const o=t.get(s);--o.degree===0&&r.push(o)}for(const i of t.values())i.degree>0&&n.push({index:i.index,message:"联动依赖不能形成循环"});return n}function p(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||e.startsWith("0000-"))return!1;const t=new Date(`${e}T00:00:00.000Z`);return Number.isFinite(t.getTime())&&t.toISOString().slice(0,10)===e}function m(e){return e.length===4&&/^\d{4}$/.test(e)&&e!=="0000"}function f(e){return e.length===7&&/^\d{4}-(?:0[1-9]|1[0-2])$/.test(e)&&m(e.slice(0,4))}function c(e){const[t,n,r]=e.split("/");if(!(r!==void 0||!t||!n||!p(t)||!p(n)||t>n))return{start:t,end:n}}function D(e){const t=`${e.start}/${e.end}`;if(!c(t))throw new RangeError("日期范围必须为完整且有序的 YYYY-MM-DD/YYYY-MM-DD");return t}function b(e,t){return typeof t!="string"?!1:e==="month"?f(t):e==="year"?m(t):(e==="date"||e==="dateRange")&&p(t)}function L(e,t){if(e==="date"&&!p(t))return"应为有效的 YYYY-MM-DD 日期";if(e==="month"&&!f(t))return"应为有效的 YYYY-MM 月份";if(e==="year"&&!m(t))return"应为 0001 至 9999 的四位年份";if(e==="dateRange"&&!c(t))return"应为完整且有序的 YYYY-MM-DD/YYYY-MM-DD 日期范围"}class y extends Error{constructor(t){super(t.map(n=>`${n.field}: ${n.message}`).join("; ")),this.issues=t,this.code="params",this.name="ReportParamValidationError"}}function x(e){return/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)&&Number.isFinite(Number(e))}function R(e,t){if(e.type==="number"&&!x(t))return[["type","应为有限数字"]];const n=L(e.type,t);if(n)return[["type",n]];const r=[];e.type==="select"&&e.options&&!e.options.some(s=>s.value===t)&&r.push(["option","不在允许的选项中"]);const i=Array.from(t).length;return e.minLength!==void 0&&i<e.minLength&&r.push(["minLength",`至少 ${e.minLength} 个字符`]),e.maxLength!==void 0&&i>e.maxLength&&r.push(["maxLength",`最多 ${e.maxLength} 个字符`]),r.push(...O(e,t)),r}function O(e,t){const n=e.type==="dateRange"?c(t):void 0,r=n?.start??(e.type==="number"?Number(t):t),i=n?.end??r,s=[];return e.min!==void 0&&r<e.min&&s.push(["minimum",`不能小于 ${e.min}`]),e.max!==void 0&&i>e.max&&s.push(["maximum",`不能大于 ${e.max}`]),s}function S(e){const t=[];for(const i of["min","max"]){const s=e[i];if(s===void 0)continue;b(e.type,s)||e.type==="number"&&typeof s=="number"&&Number.isFinite(s)||t.push(`${i} 应为数字的有限边界或日期/月/年的规范字符串边界`)}const n=typeof e.min=="number"&&typeof e.max=="number"&&e.min>e.max,r=typeof e.min=="string"&&typeof e.max=="string"&&e.min>e.max;return(n||r)&&t.push("最小边界不能大于最大边界"),[...t,...w(e)]}function w(e){const t=[];e.type==="number"&&(e.minLength!==void 0||e.maxLength!==void 0)&&t.push("number 参数使用 min/max 而不是文本长度约束");for(const n of["minLength","maxLength"]){const r=e[n];r!==void 0&&(!Number.isSafeInteger(r)||r<0)&&t.push(`${n} 应为非负整数`)}return typeof e.minLength=="number"&&typeof e.maxLength=="number"&&e.minLength>e.maxLength&&t.push("最小长度不能大于最大长度"),t}function d(e){if(!Array.isArray(e))return[{code:"definition",field:"",path:"$.paramDefs",message:"参数定义应为数组"}];const t=new Set,n=e.flatMap((r,i)=>{const s=r&&typeof r.field=="string"?r.field:"";return P(r,t).map(a=>({code:"definition",field:s,path:`$.paramDefs.${i}`,message:a}))});return n.length?n:Y(e).map(({index:r,message:i})=>({code:"definition",field:e[r].field,path:`$.paramDefs.${r}`,message:i}))}function M(e){return Array.isArray(e)&&e.every(t=>!!t&&typeof t=="object"&&typeof t.value=="string"&&typeof t.label=="string")}function V(e){const t=[];return e.type!==void 0&&!["text","number","date","month","year","dateRange","select"].includes(e.type)&&t.push("未知参数类型"),e.label!==void 0&&typeof e.label!="string"&&t.push("参数标签应为字符串"),e.placeholder!==void 0&&typeof e.placeholder!="string"&&t.push("提示文字应为字符串"),e.required!==void 0&&typeof e.required!="boolean"&&t.push("required 应为布尔值"),e.defaultValue!==void 0&&typeof e.defaultValue!="string"&&t.push("默认值应为字符串"),e.options!==void 0&&!M(e.options)&&t.push("选项应为包含字符串 label/value 的数组"),[...t,...v(e)]}function P(e,t){if(!e||typeof e!="object"||Array.isArray(e))return["参数定义项应为对象"];const n=V(e);return typeof e.field!="string"||!e.field.trim()||t.has(e.field)?n.push("参数名应为非空且不重复的字符串"):t.add(e.field),n.length||(n.push(...S(e)),n.length)||(e.options&&new Set(e.options.map(r=>r.value)).size!==e.options.length&&n.push("选项值不能重复"),e.defaultValue!==void 0&&(e.required&&!e.defaultValue.trim()?n.push("必填参数的默认值不能为空"):e.defaultValue.trim()&&n.push(...R(e,e.defaultValue).map(([,r])=>`默认值${r}`)))),n}function j(e,t,n){for(const[r,i]of Object.entries(e))(typeof i=="string"||typeof i=="number"&&Number.isFinite(i))&&(Object.defineProperty(t,r,{value:String(i),writable:!0,enumerable:!0,configurable:!0}),Object.defineProperty(n,r,{value:i,writable:!0,enumerable:!0,configurable:!0}))}function g(e){return e==null||typeof e=="string"&&!e.trim()}function $(e,t={}){const n=Object.create(null),r=Object.create(null),i=d(e);if((!t||typeof t!="object"||Array.isArray(t))&&i.push({code:"type",field:"",path:"$.params",message:"参数应为对象"}),i.length)return{ok:!1,values:n,typedValues:r,issues:i};j(t,n,r);for(const s of e){const o=Object.prototype.hasOwnProperty.call(t,s.field)&&t[s.field]!==void 0?t[s.field]:s.defaultValue,a=(l,h)=>i.push({code:l,path:`$.params.${s.field}`,field:s.field,message:h});if(g(o)){s.required&&a("required","此参数为必填项"),typeof o=="string"&&(n[s.field]=o),delete r[s.field];continue}if(typeof o!="string"&&!(typeof o=="number"&&Number.isFinite(o))){a("type","参数应为字符串或有限数字");continue}const u=String(o);n[s.field]=u,R(s,u).forEach(([l,h])=>a(l,h)),r[s.field]=s.type==="number"&&x(u)?Number(u):u}return i.push(...I(e,n)),{ok:i.length===0,values:n,typedValues:r,issues:i}}function I(e,t){return e.flatMap(n=>!g(t[n.field])&&n.dependsOn?.some(r=>g(t[r]))?[{code:"dependency",path:`$.params.${n.field}`,field:n.field,message:"请先填写联动依赖的上级参数"}]:[])}function N(e,t={}){const n=$(e,t);if(!n.ok)throw new y(n.issues);return n.values}function A(e){const t={},n="(?![\\s\\S])";return e.type==="date"&&(t.format="date"),e.type==="month"&&(t.pattern=`^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])${n}`),e.type==="year"&&(t.pattern=`^(?!0000)[0-9]{4}${n}`),e.type==="dateRange"&&(t.pattern=`^[0-9]{4}-[0-9]{2}-[0-9]{2}/[0-9]{4}-[0-9]{2}-[0-9]{2}${n}`),e.type==="dateRange"&&(t["x-report-date-range"]={separator:"/",ordered:!0,calendarDates:!0}),t}function q(e){const t={type:e.type==="number"?"number":"string",title:e.label??e.field,...A(e)};return e.required&&e.type!=="number"&&!t.pattern&&(t.pattern="\\S"),e.type==="select"&&e.options&&(t.enum=e.options.map(n=>n.value)),Object.assign(t,E(e)),e.defaultValue!==void 0&&(e.type!=="number"||e.defaultValue.trim())&&(t.default=e.type==="number"?Number(e.defaultValue):e.defaultValue),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),typeof e.min=="number"&&(t.minimum=e.min),typeof e.max=="number"&&(t.maximum=e.max),typeof e.min=="string"&&(t["x-report-minimum"]=e.min),typeof e.max=="string"&&(t["x-report-maximum"]=e.max),t}function E(e){return{...e.optionsSource?{"x-report-options-source":e.optionsSource}:{},...e.dependsOn?.length?{"x-report-depends-on":[...e.dependsOn]}:{}}}function k(e){const t=d(e);if(t.length)throw new y(t);return{$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:Object.fromEntries(e.map(n=>[n.field,q(n)])),required:e.filter(n=>n.required).map(n=>n.field),additionalProperties:!0}}exports.ReportParamValidationError=y;exports.assertReportParams=N;exports.formatReportDateRange=D;exports.isReportDate=p;exports.isReportMonth=f;exports.isReportTemporalBound=b;exports.isReportYear=m;exports.parseReportDateRange=c;exports.reportParamsJsonSchema=k;exports.validateReportParamDefinitions=d;exports.validateReportParams=$;
@@ -0,0 +1,181 @@
1
+ function $(e) {
2
+ const t = [];
3
+ return e.optionsSource !== void 0 && ((e.type !== "select" || typeof e.optionsSource != "string" || !/^[\w][\w.:-]{0,127}$/.test(e.optionsSource)) && t.push("远程选项来源应为 select 的有效来源键(最多 128 字符)"), e.options !== void 0 && t.push("远程选项来源与静态选项不能同时配置")), e.dependsOn !== void 0 && (!e.optionsSource || !Array.isArray(e.dependsOn) || e.dependsOn.length > 32 || e.dependsOn.some((n) => typeof n != "string" || !n) || new Set(e.dependsOn).size !== e.dependsOn.length) && t.push("联动依赖应为远程选项的最多 32 个唯一参数名"), t;
4
+ }
5
+ function v(e) {
6
+ const t = new Map(e.map((i, s) => [i.field, { def: i, index: s, degree: 0, children: [] }])), n = [];
7
+ for (const i of t.values()) for (const s of i.def.dependsOn ?? []) {
8
+ const o = t.get(s);
9
+ if (!o) {
10
+ n.push({ index: i.index, message: `联动依赖参数 ${s} 未声明` });
11
+ continue;
12
+ }
13
+ i.degree++, o.children.push(i.def.field);
14
+ }
15
+ const r = [...t.values()].filter((i) => i.degree === 0);
16
+ for (let i = 0; i < r.length; i++) for (const s of r[i].children) {
17
+ const o = t.get(s);
18
+ --o.degree === 0 && r.push(o);
19
+ }
20
+ for (const i of t.values()) i.degree > 0 && n.push({ index: i.index, message: "联动依赖不能形成循环" });
21
+ return n;
22
+ }
23
+ function p(e) {
24
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
25
+ const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
26
+ return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
27
+ }
28
+ function h(e) {
29
+ return e.length === 4 && /^\d{4}$/.test(e) && e !== "0000";
30
+ }
31
+ function f(e) {
32
+ return e.length === 7 && /^\d{4}-(?:0[1-9]|1[0-2])$/.test(e) && h(e.slice(0, 4));
33
+ }
34
+ function g(e) {
35
+ const [t, n, r] = e.split("/");
36
+ if (!(r !== void 0 || !t || !n || !p(t) || !p(n) || t > n))
37
+ return { start: t, end: n };
38
+ }
39
+ function E(e) {
40
+ const t = `${e.start}/${e.end}`;
41
+ if (!g(t)) throw new RangeError("日期范围必须为完整且有序的 YYYY-MM-DD/YYYY-MM-DD");
42
+ return t;
43
+ }
44
+ function Y(e, t) {
45
+ return typeof t != "string" ? !1 : e === "month" ? f(t) : e === "year" ? h(t) : (e === "date" || e === "dateRange") && p(t);
46
+ }
47
+ function L(e, t) {
48
+ if (e === "date" && !p(t)) return "应为有效的 YYYY-MM-DD 日期";
49
+ if (e === "month" && !f(t)) return "应为有效的 YYYY-MM 月份";
50
+ if (e === "year" && !h(t)) return "应为 0001 至 9999 的四位年份";
51
+ if (e === "dateRange" && !g(t)) return "应为完整且有序的 YYYY-MM-DD/YYYY-MM-DD 日期范围";
52
+ }
53
+ class y extends Error {
54
+ constructor(t) {
55
+ super(t.map((n) => `${n.field}: ${n.message}`).join("; ")), this.issues = t, this.code = "params", this.name = "ReportParamValidationError";
56
+ }
57
+ }
58
+ function d(e) {
59
+ return /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e) && Number.isFinite(Number(e));
60
+ }
61
+ function b(e, t) {
62
+ if (e.type === "number" && !d(t)) return [["type", "应为有限数字"]];
63
+ const n = L(e.type, t);
64
+ if (n) return [["type", n]];
65
+ const r = [];
66
+ e.type === "select" && e.options && !e.options.some((s) => s.value === t) && r.push(["option", "不在允许的选项中"]);
67
+ const i = Array.from(t).length;
68
+ return e.minLength !== void 0 && i < e.minLength && r.push(["minLength", `至少 ${e.minLength} 个字符`]), e.maxLength !== void 0 && i > e.maxLength && r.push(["maxLength", `最多 ${e.maxLength} 个字符`]), r.push(...D(e, t)), r;
69
+ }
70
+ function D(e, t) {
71
+ const n = e.type === "dateRange" ? g(t) : void 0, r = n?.start ?? (e.type === "number" ? Number(t) : t), i = n?.end ?? r, s = [];
72
+ return e.min !== void 0 && r < e.min && s.push(["minimum", `不能小于 ${e.min}`]), e.max !== void 0 && i > e.max && s.push(["maximum", `不能大于 ${e.max}`]), s;
73
+ }
74
+ function O(e) {
75
+ const t = [];
76
+ for (const i of ["min", "max"]) {
77
+ const s = e[i];
78
+ if (s === void 0) continue;
79
+ Y(e.type, s) || e.type === "number" && typeof s == "number" && Number.isFinite(s) || t.push(`${i} 应为数字的有限边界或日期/月/年的规范字符串边界`);
80
+ }
81
+ const n = typeof e.min == "number" && typeof e.max == "number" && e.min > e.max, r = typeof e.min == "string" && typeof e.max == "string" && e.min > e.max;
82
+ return (n || r) && t.push("最小边界不能大于最大边界"), [...t, ...R(e)];
83
+ }
84
+ function R(e) {
85
+ const t = [];
86
+ e.type === "number" && (e.minLength !== void 0 || e.maxLength !== void 0) && t.push("number 参数使用 min/max 而不是文本长度约束");
87
+ for (const n of ["minLength", "maxLength"]) {
88
+ const r = e[n];
89
+ r !== void 0 && (!Number.isSafeInteger(r) || r < 0) && t.push(`${n} 应为非负整数`);
90
+ }
91
+ return typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && t.push("最小长度不能大于最大长度"), t;
92
+ }
93
+ function x(e) {
94
+ if (!Array.isArray(e)) return [{ code: "definition", field: "", path: "$.paramDefs", message: "参数定义应为数组" }];
95
+ const t = /* @__PURE__ */ new Set(), n = e.flatMap((r, i) => {
96
+ const s = r && typeof r.field == "string" ? r.field : "";
97
+ return M(r, t).map((a) => ({ code: "definition", field: s, path: `$.paramDefs.${i}`, message: a }));
98
+ });
99
+ return n.length ? n : v(e).map(({ index: r, message: i }) => ({ code: "definition", field: e[r].field, path: `$.paramDefs.${r}`, message: i }));
100
+ }
101
+ function S(e) {
102
+ return Array.isArray(e) && e.every((t) => !!t && typeof t == "object" && typeof t.value == "string" && typeof t.label == "string");
103
+ }
104
+ function w(e) {
105
+ const t = [];
106
+ return e.type !== void 0 && !["text", "number", "date", "month", "year", "dateRange", "select"].includes(e.type) && t.push("未知参数类型"), e.label !== void 0 && typeof e.label != "string" && t.push("参数标签应为字符串"), e.placeholder !== void 0 && typeof e.placeholder != "string" && t.push("提示文字应为字符串"), e.required !== void 0 && typeof e.required != "boolean" && t.push("required 应为布尔值"), e.defaultValue !== void 0 && typeof e.defaultValue != "string" && t.push("默认值应为字符串"), e.options !== void 0 && !S(e.options) && t.push("选项应为包含字符串 label/value 的数组"), [...t, ...$(e)];
107
+ }
108
+ function M(e, t) {
109
+ if (!e || typeof e != "object" || Array.isArray(e)) return ["参数定义项应为对象"];
110
+ const n = w(e);
111
+ return typeof e.field != "string" || !e.field.trim() || t.has(e.field) ? n.push("参数名应为非空且不重复的字符串") : t.add(e.field), n.length || (n.push(...O(e)), n.length) || (e.options && new Set(e.options.map((r) => r.value)).size !== e.options.length && n.push("选项值不能重复"), e.defaultValue !== void 0 && (e.required && !e.defaultValue.trim() ? n.push("必填参数的默认值不能为空") : e.defaultValue.trim() && n.push(...b(e, e.defaultValue).map(([, r]) => `默认值${r}`)))), n;
112
+ }
113
+ function V(e, t, n) {
114
+ for (const [r, i] of Object.entries(e))
115
+ (typeof i == "string" || typeof i == "number" && Number.isFinite(i)) && (Object.defineProperty(t, r, { value: String(i), writable: !0, enumerable: !0, configurable: !0 }), Object.defineProperty(n, r, { value: i, writable: !0, enumerable: !0, configurable: !0 }));
116
+ }
117
+ function l(e) {
118
+ return e == null || typeof e == "string" && !e.trim();
119
+ }
120
+ function j(e, t = {}) {
121
+ const n = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ Object.create(null), i = x(e);
122
+ if ((!t || typeof t != "object" || Array.isArray(t)) && i.push({ code: "type", field: "", path: "$.params", message: "参数应为对象" }), i.length) return { ok: !1, values: n, typedValues: r, issues: i };
123
+ V(t, n, r);
124
+ for (const s of e) {
125
+ const o = Object.prototype.hasOwnProperty.call(t, s.field) && t[s.field] !== void 0 ? t[s.field] : s.defaultValue, a = (m, c) => i.push({ code: m, path: `$.params.${s.field}`, field: s.field, message: c });
126
+ if (l(o)) {
127
+ s.required && a("required", "此参数为必填项"), typeof o == "string" && (n[s.field] = o), delete r[s.field];
128
+ continue;
129
+ }
130
+ if (typeof o != "string" && !(typeof o == "number" && Number.isFinite(o))) {
131
+ a("type", "参数应为字符串或有限数字");
132
+ continue;
133
+ }
134
+ const u = String(o);
135
+ n[s.field] = u, b(s, u).forEach(([m, c]) => a(m, c)), r[s.field] = s.type === "number" && d(u) ? Number(u) : u;
136
+ }
137
+ return i.push(...I(e, n)), { ok: i.length === 0, values: n, typedValues: r, issues: i };
138
+ }
139
+ function I(e, t) {
140
+ return e.flatMap((n) => !l(t[n.field]) && n.dependsOn?.some((r) => l(t[r])) ? [{ code: "dependency", path: `$.params.${n.field}`, field: n.field, message: "请先填写联动依赖的上级参数" }] : []);
141
+ }
142
+ function k(e, t = {}) {
143
+ const n = j(e, t);
144
+ if (!n.ok) throw new y(n.issues);
145
+ return n.values;
146
+ }
147
+ function N(e) {
148
+ const t = {}, n = "(?![\\s\\S])";
149
+ return e.type === "date" && (t.format = "date"), e.type === "month" && (t.pattern = `^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])${n}`), e.type === "year" && (t.pattern = `^(?!0000)[0-9]{4}${n}`), e.type === "dateRange" && (t.pattern = `^[0-9]{4}-[0-9]{2}-[0-9]{2}/[0-9]{4}-[0-9]{2}-[0-9]{2}${n}`), e.type === "dateRange" && (t["x-report-date-range"] = { separator: "/", ordered: !0, calendarDates: !0 }), t;
150
+ }
151
+ function P(e) {
152
+ const t = { type: e.type === "number" ? "number" : "string", title: e.label ?? e.field, ...N(e) };
153
+ return e.required && e.type !== "number" && !t.pattern && (t.pattern = "\\S"), e.type === "select" && e.options && (t.enum = e.options.map((n) => n.value)), Object.assign(t, A(e)), e.defaultValue !== void 0 && (e.type !== "number" || e.defaultValue.trim()) && (t.default = e.type === "number" ? Number(e.defaultValue) : e.defaultValue), e.minLength !== void 0 && (t.minLength = e.minLength), e.maxLength !== void 0 && (t.maxLength = e.maxLength), typeof e.min == "number" && (t.minimum = e.min), typeof e.max == "number" && (t.maximum = e.max), typeof e.min == "string" && (t["x-report-minimum"] = e.min), typeof e.max == "string" && (t["x-report-maximum"] = e.max), t;
154
+ }
155
+ function A(e) {
156
+ return { ...e.optionsSource ? { "x-report-options-source": e.optionsSource } : {}, ...e.dependsOn?.length ? { "x-report-depends-on": [...e.dependsOn] } : {} };
157
+ }
158
+ function F(e) {
159
+ const t = x(e);
160
+ if (t.length) throw new y(t);
161
+ return {
162
+ $schema: "https://json-schema.org/draft/2020-12/schema",
163
+ type: "object",
164
+ properties: Object.fromEntries(e.map((n) => [n.field, P(n)])),
165
+ required: e.filter((n) => n.required).map((n) => n.field),
166
+ additionalProperties: !0
167
+ };
168
+ }
169
+ export {
170
+ y as R,
171
+ k as a,
172
+ f as b,
173
+ h as c,
174
+ j as d,
175
+ Y as e,
176
+ E as f,
177
+ p as i,
178
+ g as p,
179
+ F as r,
180
+ x as v
181
+ };