@agile-team/mach-report 2.25.1 → 2.25.2
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.
- package/README.md +4 -2
- package/dist/ReportPreview-D1ZC5kzz.js +7317 -0
- package/dist/ReportPreview-DAU-V3Ov.cjs +6 -0
- package/dist/artifact-integrity.json +35 -35
- package/dist/{auto-mPK9W0y5.cjs → auto-DjmvmcX-.cjs} +1 -1
- package/dist/{auto-D7x7QsWD.js → auto-j7mr8Kvc.js} +82 -82
- package/dist/{encoding-Amq3XrtU.js → encoding-BWEMdzFG.js} +2 -2
- package/dist/{encoding-DRVXs5xm.cjs → encoding-DVea2qIR.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{json-snapshot-CBVWZvyC.js → json-snapshot-DdzALe8q.js} +811 -774
- package/dist/json-snapshot-L_gJ7KRS.cjs +2 -0
- package/dist/{plugin-DHe8y5pD.cjs → plugin-D5BRHlne.cjs} +1 -1
- package/dist/{plugin-BdCplNe1.js → plugin-FWhTnjr0.js} +1 -1
- package/dist/{prefill-Cw4ZYGXZ.cjs → prefill-DZymomY6.cjs} +1 -1
- package/dist/{prefill-Buy4NJ15.js → prefill-m01IM1hl.js} +1 -1
- package/dist/{prepared-BlNeOjoO.cjs → prepared-BHu8bIdj.cjs} +1 -1
- package/dist/{prepared-CBJ7BkK0.js → prepared-DO5pe6Ed.js} +1 -1
- package/dist/{protocol-CB19KXGr.js → protocol-CZddmu2n.js} +2 -2
- package/dist/{protocol-BU_4sXP0.cjs → protocol-CymmHWmL.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{runtime-B5d_lQNQ.js → runtime-D8AlfJ6S.js} +82 -75
- package/dist/runtime-ywf3oLBR.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1978 -1935
- package/dist/server.cjs +1 -1
- package/dist/server.js +5 -5
- package/dist/{template-catalog-CM6U_RlD.js → template-catalog-DLu814zA.js} +1 -1
- package/dist/{template-catalog-Cj66M84u.cjs → template-catalog-Lil5Ryt-.cjs} +1 -1
- package/dist/vue/index.d.cts +2 -1
- package/dist/vue/index.d.ts +2 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +127 -126
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/package.json +1 -1
- package/dist/ReportPreview-CnxaDTCO.js +0 -7170
- package/dist/ReportPreview-DqFBcsJQ.cjs +0 -6
- package/dist/json-snapshot-DCFEtfFw.cjs +0 -2
- package/dist/runtime-BRx8Agqr.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.25.
|
|
2
|
+
"version": "2.25.2",
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"files": {
|
|
5
5
|
"ExcelBindingWizard-bs3F4dD8.js": "9d8b989fd73b26dfe8d995834ddbf83dd7bd2dc69389f4b205e4c9486f238665",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"ReportLabelStudio-CZwqyO3t.js": "08c6d99396753863f63368448ef13b0ed15f0b1c41d63f0ca517d38f467465e9",
|
|
13
13
|
"ReportParamPanel-B27IGJjk.cjs": "5267b07a6cd23d2af0460b99c599a7fed251340cc94006fc5b4f97ede6c36aa3",
|
|
14
14
|
"ReportParamPanel-DGXzBzl2.js": "b782800c4b96f50d57534ffa3f5ae50f7b99f58be9b9136dcb9ddf8ade8bd772",
|
|
15
|
-
"ReportPreview-
|
|
16
|
-
"ReportPreview-
|
|
15
|
+
"ReportPreview-D1ZC5kzz.js": "33562e99f93945e2b40952fef008d962a33e0ea66412f3c438bfef3de84eda8e",
|
|
16
|
+
"ReportPreview-DAU-V3Ov.cjs": "0b6a4b0502c3c875c6a75b9d756edfaf2e979c811d9d8c8e6669f48603e61fb0",
|
|
17
17
|
"ReportTemplateLibrary-C7sB0Jay.js": "12ae0bf024cb7ab1e7413d719898709b22b8da276267cb5aa4f1e460adefc345",
|
|
18
18
|
"ReportTemplateLibrary-ClwxhnC0.cjs": "e6b491648d753bf5fafb683dddc6c15d6d41d5fc3dea2a3a17615ed795e78e8c",
|
|
19
19
|
"RuleEditor-CsDGFaWz.js": "3693297bea61d03854b064f0fb8dd11837a15b3efd53cabeb025d4407ef605ef",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"analytics.js": "70206bd6f15f8c068e24eb0ed50c5a8384e07944dc5cdbfb6ada376ef9de354c",
|
|
33
33
|
"assets-BYdpkTIt.cjs": "822d0d8efb1f593ed72c23edf9f0e6ecfa5cd5357892aabbf20835e15556728d",
|
|
34
34
|
"assets-C4MIvzQ4.js": "dffabd637edb53486cb8203b9ec59fe5f56eaa3b735edb9907e44cdd601f8111",
|
|
35
|
-
"auto-
|
|
36
|
-
"auto-
|
|
35
|
+
"auto-DjmvmcX-.cjs": "c92d3a320979380ca438b6353dc6fd361755f20f6d6a651bc5dfd30c57a10f06",
|
|
36
|
+
"auto-j7mr8Kvc.js": "8b319accf3e6ba4ad103c647e44ae5acae06cc667145e65cdb6ce4c0554469cd",
|
|
37
37
|
"batch-DGCt44XM.js": "8b4e701e19c6342025eea92f969437c0e288a88e53383d82ec1a895c72a1dd90",
|
|
38
38
|
"batch-DYcokH4v.cjs": "29a6bb725bd57b508ef61fa450993d87447aa0a0b74f56953f0f35651a148d51",
|
|
39
39
|
"capabilities-CN_kSVjO.js": "4ad650dcf294de9aedabc7cdc40b0f450be6fd4dd7664954797807d1d8af5f59",
|
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
"dom-DxdCMLzs.js": "d2fbdde736cc38133f95f97cec13e223074e343e27ef0d63def85ad9d94c65b1",
|
|
63
63
|
"dom-cell-address-DLD1mkTB.cjs": "6338fd0aff421f07e6d18dd013e951bf3ebb3f24eb62fb6b857465f0be9cfaa9",
|
|
64
64
|
"dom-cell-address-Fn-8nk7D.js": "ba69ee95af411e0c1ef51949009595099e14d75e43feb6628d9a9302e59abe25",
|
|
65
|
-
"encoding-
|
|
66
|
-
"encoding-
|
|
65
|
+
"encoding-BWEMdzFG.js": "dd65e6bb3d4c7da87e86de042dbe937c64533d17f9634e4ab93561d540d8f178",
|
|
66
|
+
"encoding-DVea2qIR.cjs": "894c01fa10995c20d73626ee0ca17e61abb6c15a2f8c8744b05e35484e40c756",
|
|
67
67
|
"font-loader-D4NLIKJL.js": "f3f60d11e18e60b2b9775eefc30cd7660f44c5535223e948cb2adda49a71cdeb",
|
|
68
68
|
"font-loader-p_SyTvqt.cjs": "96566e9c0cad823aaaaf311a46950872962f915f40b6db812162821619e2441d",
|
|
69
69
|
"grid-strokes-DkZEZvcI.js": "040f054f829d40b09c3f25336607318a6a732cfabd3dc6ec5241ed70f64c59aa",
|
|
70
70
|
"grid-strokes-RFMR91jn.cjs": "377f06d573629370c668f03897793f8164883cf7adfe8022aa6633eaae12a16d",
|
|
71
71
|
"index-CPh6tqge.js": "7c296b48cef38d5964457d24709d00ccc27f5129fe704680d05a07995296331a",
|
|
72
72
|
"index-CUNw7dL9.cjs": "3903d4cbd382319dcfbe79bc936898a53b9d3ea0eddf02c969f4834b51e3dd3d",
|
|
73
|
-
"index.cjs": "
|
|
74
|
-
"index.js": "
|
|
73
|
+
"index.cjs": "050229cfe21b3892af7ee7a3738a2ce457d867dd830a489d09d4222de976391c",
|
|
74
|
+
"index.js": "ac7206ddb37256e80b95dc9a249c2e3d81516dd830eb390e64502d8b29c36db4",
|
|
75
75
|
"injection-keys-Db_DyLkm.cjs": "0d656460efa0c48f6153aae745dd61a7907128938d98b358b5b6d413db5ec4ed",
|
|
76
76
|
"injection-keys-e85udZCp.js": "101e96fc627b33003ba295d281e7f7bfb2c077300556b2bf039cb1938e36f582",
|
|
77
|
-
"json-snapshot-
|
|
78
|
-
"json-snapshot-
|
|
77
|
+
"json-snapshot-DdzALe8q.js": "4d4667b2645e3c6d17628b429d16728ea3b5cabf39b743fc17cdb5bf3bbeb302",
|
|
78
|
+
"json-snapshot-L_gJ7KRS.cjs": "aea5ebae6d1229a3eefc0a1b0883dc1210522dec1896effe294cfd4f17601ec5",
|
|
79
79
|
"matrix-DUYPRL7t.cjs": "b6ade35a1434edae22e5d4397bf5e2d99bceefd97c7b55893c7ddc7266a5081f",
|
|
80
80
|
"matrix-b6T291xo.js": "60db0b59b70fc969225a522e208eb3bf9c423c652474b55cef20d013b8ecac21",
|
|
81
81
|
"media-B7vnpD8k.cjs": "c667063f9745af571f35561ec272496f0e3d7b7d4ee003a823003337155497d9",
|
|
@@ -88,37 +88,37 @@
|
|
|
88
88
|
"pdf-DU8HelKd.js": "e021137796332d80dda4fa3a950e805c190ea9ea4d284a8488f4f5e1ba28a59a",
|
|
89
89
|
"pdf.cjs": "cc0b03c6019b2de7455f2a6af999bfe1eebc21c58a6ec9279eaf921d560bdc9b",
|
|
90
90
|
"pdf.js": "c4761033b9172142ae6bc02238143b3810f8c21bc48540d786ded3c7b541dc26",
|
|
91
|
-
"plugin-
|
|
92
|
-
"plugin-
|
|
93
|
-
"prefill-
|
|
94
|
-
"prefill-
|
|
95
|
-
"prepared-
|
|
96
|
-
"prepared-
|
|
97
|
-
"protocol-
|
|
98
|
-
"protocol-
|
|
91
|
+
"plugin-D5BRHlne.cjs": "4b2eb2fb81ef8b43a68759833ad76fe146a44ce28801991bf958afe5b467fd83",
|
|
92
|
+
"plugin-FWhTnjr0.js": "7d6be6f87806e9823ecab1cfc26199437eccad788eb045ff5bba4578597d9c5e",
|
|
93
|
+
"prefill-DZymomY6.cjs": "5b9e554684842f894c55ed8547e74e0a82c14131b75e3c9c8950dd32fece035b",
|
|
94
|
+
"prefill-m01IM1hl.js": "5e04eaca94037d8dac5b8b726c36aa093fedbf43a3a0694a71a5df4fead32279",
|
|
95
|
+
"prepared-BHu8bIdj.cjs": "fef4dc17941033145d05216bb849b4e045af3c49c0ed2acd2a75cead1a001301",
|
|
96
|
+
"prepared-DO5pe6Ed.js": "5606e2ed7d534e5937d1c09c90bd1d2d29d8e5606269e813f577787bd1178211",
|
|
97
|
+
"protocol-CZddmu2n.js": "6d173b528808586eac2acbb4611cbeb1ab30b50f79243b7258aef51de07219ba",
|
|
98
|
+
"protocol-CymmHWmL.cjs": "8ff1ce01a6f3c62dd05199f5957c742ab8f12d3ca2231330a8dbe56b8bcf6850",
|
|
99
99
|
"record-bindings-B7djSjNs.cjs": "6f3c51877058a68edbba8c5013fecf1dff25f474188e71608364b8d94df86afe",
|
|
100
100
|
"record-bindings-Cv7lFiof.js": "a323cc829e45a8cf985ac13f5668bacce075e4ecd4242a100aaca5ac711de01c",
|
|
101
101
|
"region-binding-workflow-EYxvUYJ-.js": "c523329361e7f9a2055e8aca0ec678457b47dd14a04c6fcf43e2b1dadc38685c",
|
|
102
102
|
"region-binding-workflow-NdkMSFCh.cjs": "f768138bbfb2eccd8443c0f6d7f21377a109e039a99b36c05b38876bb8081a68",
|
|
103
|
-
"report-encoding-worker.cjs": "
|
|
104
|
-
"report-encoding-worker.js": "
|
|
103
|
+
"report-encoding-worker.cjs": "7eda4ff37689b48970a7dc02ef1c152531c59d333f2a2a5e1024f2c2c55a0fd9",
|
|
104
|
+
"report-encoding-worker.js": "1f94a503ebd2c33f10b345d205720f36ce024eb98864bdeda149e153756b67c8",
|
|
105
105
|
"report-params-D9tBuM9B.js": "ece9133b39e06ff8769c039d94d6734ac46e5aef8c9a795c0255b217b8f4e560",
|
|
106
106
|
"report-params-VTg8MoCp.cjs": "06600716e1621dd96088355786c67db6ce12860030118777450b1eb0a3ba655b",
|
|
107
107
|
"rich-text-layout-Ch_N0Ubu.js": "de41c53024792dd5fdeaded2a587a50c1757a6c82150375cf6fe53df0b6d5310",
|
|
108
108
|
"rich-text-layout-yJGuThtC.cjs": "701392fa5e4ea4a96f49ee71a21ad3fca914f5e4bcc9bdbbb00d2d969bb784c2",
|
|
109
|
-
"runtime-
|
|
110
|
-
"runtime-
|
|
111
|
-
"server-node.cjs": "
|
|
112
|
-
"server-node.js": "
|
|
113
|
-
"server.cjs": "
|
|
114
|
-
"server.js": "
|
|
109
|
+
"runtime-D8AlfJ6S.js": "c22ad1beec0d26330c0375c5f16c3755cd4118202bb697fbd527cf93fb6a62c4",
|
|
110
|
+
"runtime-ywf3oLBR.cjs": "cedcbb81aee84cfb0a5a2dae372648c2ae9f761f615db8d0fc08ac7b5beb1859",
|
|
111
|
+
"server-node.cjs": "c1c92db9a3934538fea840ca006779c35616c48f378f0dd3bc0643db7a2a5fd3",
|
|
112
|
+
"server-node.js": "87b8c4cc05a8708fa1dfa6d9bf7b4d653b2440e9c77cd2fd83092ecbf1cb58ac",
|
|
113
|
+
"server.cjs": "00e458d384256b9d5064fd1d0b9800e3d6ae9036be995ece35a89f00852661ea",
|
|
114
|
+
"server.js": "2f6fae192765ab62fbf3d16f419db7f99e95f60dfe5ae7a0c14ab883df7c8168",
|
|
115
115
|
"sha256-BDQ1Qk7A.js": "b0add3fe6ab451f8fe0563a7d9ba4f062bd489dffaf77df39e0a462dc8e9ee82",
|
|
116
116
|
"sha256-DgZAKXqI.cjs": "9dba2652fc0de8c96f33258fa7defcae98f5a1e3655c5065f99f721fbd0899fb",
|
|
117
117
|
"sql.cjs": "3f6410be368c6f8e3677e5c8a10fa76943685c49da1ab725262def05b13872ff",
|
|
118
118
|
"sql.js": "8c44d864340e02ec5ee4512e31b787da5dd1d3e7be750ab8280cfe2d1d733c06",
|
|
119
119
|
"style.css": "9a95a9e3e6b0f06b1a7512822cd13a9934daba8ef2b36f5abe596e4fcd43f636",
|
|
120
|
-
"template-catalog-
|
|
121
|
-
"template-catalog-
|
|
120
|
+
"template-catalog-DLu814zA.js": "02a505da157de70ec8aff0d9e933dc7e33e894a93c0b67fee364fb8199c7a4e9",
|
|
121
|
+
"template-catalog-Lil5Ryt-.cjs": "b02a8bdc6f5c036b9cf285aed50bf506bc5394eccb5e04adbc91ef0c0fa1bbf1",
|
|
122
122
|
"template-fragments-BDxdCuMD.js": "bfa8a879bd73a1a4066df8b1359e460846bdc8da7482672dbd6873e3e1ab4572",
|
|
123
123
|
"template-fragments-DbKdxI1z.cjs": "f780d8744d7f9fc99955a0d1666bece44e56822ca9345357d101f5b8dc63d743",
|
|
124
124
|
"template-registry-B-AK1oam.cjs": "a18ff090eb9c3130d9873eb116b6f8fe623e54ce1fc1ceea239c0ac87eeb1789",
|
|
@@ -129,16 +129,16 @@
|
|
|
129
129
|
"textwrap-LhJkHWb1.cjs": "d3e9bf695cdb36373c416b8d85246fb8be10085cb8cf55b1df0db129d5feab73",
|
|
130
130
|
"useLocalDraft-BnhcxXk_.js": "4329b21ab9806f229ec5039c48d140184f1a8b17713972548016e36d8c5ad2a5",
|
|
131
131
|
"useLocalDraft-CioIfDb6.cjs": "4aecc84e63a2bef15f690937d5cea415a6e5c529b1d7a2575d738215c1ff908f",
|
|
132
|
-
"vue-async.cjs": "
|
|
133
|
-
"vue-async.js": "
|
|
134
|
-
"vue.cjs": "
|
|
135
|
-
"vue.js": "
|
|
132
|
+
"vue-async.cjs": "53c979f9eac2f76e204ed2070959269e992cc5e417427e1e73631931f362cda6",
|
|
133
|
+
"vue-async.js": "ba6ad8594d14deaf1a64b555d7b93ef708231a1b606892f70a572e63b44f102f",
|
|
134
|
+
"vue.cjs": "bcf1ff8794bba9892814eb4e025d625f315b4eeaf3407c940303f3cd286f72ab",
|
|
135
|
+
"vue.js": "47793f4e093c338f3d97549184f15b1017fda1213f1ebc1c96660f2cbd9d9f4d",
|
|
136
136
|
"workbook-session-B6hRjTyX.js": "8e4a23316bfa8b0bf045d586066f30b5f56cc27db44af75aa7608eec1e869f9b",
|
|
137
137
|
"workbook-session-BclW7KKH.cjs": "e164aa956301a63d136ee22d080752a83337d0db2b2044b24751c8ac7a6c1d57",
|
|
138
138
|
"workbook-sheets-CaPAulQ6.cjs": "7a9c89b6d94d3036bf13a5562cb799dcae6ae4c1824f0fa9a50e7938848bd2c4",
|
|
139
139
|
"workbook-sheets-D4M7XXBh.js": "650a92b5db22c6ff07e8c8a40e87febf3757f5abe7e3f07d67313ca3db7c9bc5",
|
|
140
|
-
"worker.cjs": "
|
|
141
|
-
"worker.js": "
|
|
140
|
+
"worker.cjs": "1e8334fd618e4e259c06e2cb0ecfb7a4ecc9549c11c80074ed7cb9048cde25dd",
|
|
141
|
+
"worker.js": "124edfa8f6aa70195aa4bfb7e578011e95299b430ed25be0c5cf7820ef96fc3f",
|
|
142
142
|
"xlsx-node.cjs": "76095f4e35c10e76c243d572ceeddba19374824de7eee0f59256d29e4f43b148",
|
|
143
143
|
"xlsx-node.js": "b056a5bf33dfd9fdb5ce4eb962a41eb2294622da048b12fa3cc5ea946113cb27",
|
|
144
144
|
"xlsx.cjs": "d288aa5fcac6016a0cc841fda9c203ce0f47bd9df237acfda3b4951c0b3fd892",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const O=require("./prepared-
|
|
1
|
+
"use strict";const O=require("./prepared-BHu8bIdj.cjs"),C=require("./json-snapshot-L_gJ7KRS.cjs"),P=require("./protocol-CymmHWmL.cjs"),I=require("./diagnostic-collector-wASg6Fzs.cjs"),W=require("./runtime-ywf3oLBR.cjs"),u=require("./sha256-DgZAKXqI.cjs");class M extends Error{constructor(r){super("报表 Worker 无法启动"),this.cause=r,this.name="ReportWorkerStartError"}}let j=0;function F(e){const r=new Error("报表 Worker 任务已取消");return r.name="AbortError",Object.defineProperty(r,"cause",{value:e}),r}function U(e,r){if(!e||typeof e!="object")return;const t=e;return t.protocol===P.REPORT_WORKER_PROTOCOL&&t.id===r?t:void 0}function z(e,r={}){const t=r.timeoutMs??12e4;if(!Number.isFinite(t)||t<=0||t>2147483647)throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");const n=(o,s,a,d)=>a?.aborted?Promise.reject(F(a.reason)):new Promise((y,i)=>{let b;try{b=e()}catch(f){i(new M(f));return}const h=`mach-report-${Date.now()}-${++j}`;let g=!1,p=()=>{},k;const l=(f,c)=>{if(g)return;g=!0,k&&clearTimeout(k);let w;try{p()}catch(R){w=R}a?.removeEventListener("abort",v),f??=w,Promise.resolve().then(()=>b.terminate()).then(()=>f===void 0?y(c):i(f),R=>i(f??R))},v=()=>l(F(a?.reason)),m=f=>{const c=U(f,h);if(!(!c||g)){if("type"in c&&c.type==="event"){const w="event"in c?c.event:void 0;P.validReportWorkerEvent(w,s)?C.notifyReportTaskEvent(d,w,a):l(new Error("报表 Worker 返回无效阶段事件"));return}c.error&&typeof c.error.name=="string"&&typeof c.error.message=="string"?l(new P.ReportWorkerError(c.error)):P.validReportWorkerResult(c.result,o)&&(o==="prepare"||"format"in c.result&&"format"in s&&c.result.format===s.format)?l(void 0,c.result):l(new Error("报表 Worker 返回无效响应"))}};try{if(p=b.subscribe(m,f=>l(f??new Error("报表 Worker 执行失败"))),g){p();return}if(a?.addEventListener("abort",v,{once:!0}),k=setTimeout(()=>l(new P.ReportWorkerError({name:"ReportRuntimeError",code:"timeout",message:`报表 Worker 执行超过 ${t}ms`})),t),a?.aborted)v();else{const{onEvent:f,signal:c,...w}=s,R=N(w);b.postMessage({protocol:P.REPORT_WORKER_PROTOCOL,id:h,operation:o,input:w,...r.budget?{budget:r.budget}:{}},R)}}catch(f){l(f)}});return{exportPrepared:(o,s,a)=>n("exportPrepared",o,s,a),prepare:(o,s,a)=>n("prepare",o,s,a),export:(o,s,a)=>n("export",o,s,a)}}function N(e){return e.pdf?(e.pdf=O.snapshotPdfFonts(e.pdf),(e.pdf?.customFontFaces?Object.values(e.pdf.customFontFaces):[e.pdf?.customFontBytes]).filter(t=>t instanceof Uint8Array).map(t=>t.buffer)):[]}function _(e,r={}){return z(()=>{const t=e();return{postMessage:(n,o)=>t.postMessage(n,o),terminate:()=>t.terminate(),subscribe:(n,o)=>{const s=d=>n(d.data),a=d=>o(d instanceof ErrorEvent?new Error(d.message):new Error("报表 Worker 消息无法解码"));return t.addEventListener("message",s),t.addEventListener("error",a),t.addEventListener("messageerror",a),()=>{t.removeEventListener("message",s),t.removeEventListener("error",a),t.removeEventListener("messageerror",a)}}}},r)}const $={cells:2e4,pages:20,bytes:2e6};function T(e){return e.cells>=e.limits.cells||e.pages>=e.limits.pages||e.bytes>=e.limits.bytes||e.capped}function x(e){return++e.visits>=1e5&&(e.capped=!0),!T(e)}function E(e){return typeof e=="string"?e.length*2:0}function L(e,r){for(const t of e??[]){if(!x(r))return;for(const n of t.segments){if(!x(r))return;r.bytes+=E(n.text)}}}function S(e,r,t){if(t>32){r.capped=!0;return}if(x(r)){r.bytes+=E(e.text)+E(e.rawText)+E(e.imageData),L(e.richParagraphs,r);for(const n of e.lines??[]){if(!x(r))return;r.bytes+=E(n)}for(const n of e.grid?.cells??[]){if(!x(r))return;for(const o of n){if(!x(r))return;if(o){r.cells++,r.bytes+=E(o.text)+E(o.rawText)+E(o.value),L(o.richParagraphs,r);for(const s of o.children??[]){if(T(r))return;S(s,r,t+1)}}}}}}function H(e,r){if(e.format==="xlsx")for(const t of e.xlsx?.additionalSheets??[]){if(!x(r))return;r.bytes+=E(t?.name);for(const n of t?.rows??[]){if(!x(r))return;for(const o of n??[]){if(!x(r))return;r.cells++,r.bytes+=E(o)}}}}function G(e){const r={...$,...e.thresholds};for(const t of Object.values(r))if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("导出隔离阈值应为正安全整数");return r}function K(e,r){const t=G(r),n=e.pdf?.customFontFaces?Object.values(e.pdf.customFontFaces):[e.pdf?.customFontBytes],o={pages:e.prepared.plan.pages.length,cells:0,bytes:n.reduce((d,y)=>d+(y?.byteLength??0),0),visits:0,capped:!1,limits:t};for(const d of e.prepared.plan.pages){if(T(o))break;for(const y of d.components){if(T(o))break;S(y,o,0)}}H(e,o);let s=T(o)?"worker":"local",a=o.capped?"scan-limit":s==="worker"?"threshold":"small-task";return r.mode==="local"&&(s="local",a="explicit-local"),r.mode==="worker"&&(s="worker",a="explicit-worker"),Object.values(e.xlsx??{}).some(d=>typeof d=="function")&&(s="local",a="nonserializable-options"),{mode:s,reason:a,estimate:{pages:o.pages,cells:o.cells,bytes:o.bytes},hardCancellation:s==="worker"}}function X(e){if(e.mode!==void 0&&!["auto","local","worker"].includes(e.mode))throw new TypeError("无效的导出执行模式");if(e.fallback!==void 0&&!["local","error"].includes(e.fallback))throw new TypeError("无效的导出回退策略");u.validateBudget({...e.budget,maxDurationMs:e.timeoutMs??e.budget?.maxDurationMs??12e4})}function A(e,r){I.observeOutput(()=>e.onDecision?.({...r,estimate:{...r.estimate}}))}function B(e,r){return{...e,mode:"local",reason:r,hardCancellation:!1}}function D(e,r,t){u.assertBudget(t,"maxRows",e.stats.rows),u.assertBudget(t,"maxPages",e.stats.pages),u.assertBudget(t,"maxCells",e.stats.cells),u.assertBudget(t,"maxOutputBytes",e.bytes.byteLength),O.assertPreparedOutputBudget({...r,prepared:{...r.prepared,stats:e.stats}},t)}function J(e,r){const t={...u.DEFAULT_REPORT_RUNTIME_BUDGET,...r.budget},n=O.capturePreparedHandoff(e.prepared,t.maxPreparedBytes,e.signal),o={...e,prepared:n.prepared,pdf:O.snapshotPdfFonts(e.pdf),xlsx:O.snapshotXlsxOptions(e.xlsx)};return{request:o,forward:()=>({...o,prepared:n.forward()})}}function Q(e,r){X(e);const t={...e,thresholds:{...e.thresholds},budget:{...u.DEFAULT_REPORT_RUNTIME_BUDGET,...e.budget}},n=t.timeoutMs??t.budget.maxDurationMs??12e4,o=W.createReportRuntime({reports:{},budget:{...t.budget,maxDurationMs:n}}),s=new Set;let a=!1;const d=t.mode!=="worker"&&t.fallback!=="error";async function y(i,b){const h=Date.now(),g=()=>{const m=n-(Date.now()-h);if(m<=0)throw new u.ReportRuntimeError("timeout",`报表执行超过 ${n}ms`);return m};let p=K(i,t);if(p.reason==="nonserializable-options"&&t.mode==="worker")throw new TypeError("Worker 模式不接受函数选项;请使用本地模式或可序列化配置");if(p.mode==="worker"&&!r){if(!d)throw new M(new Error("未配置 workerFactory"));p=B(p,"worker-unavailable")}const k=J(i,t),l=k.request;if(A(t,p),u.throwIfAborted(i.signal),p.mode==="worker")try{const m=r(g());if(!m.exportPrepared)throw new TypeError("隔离执行器缺少 exportPrepared");const{signal:f,onEvent:c,...w}=l,R=await m.exportPrepared(w,f,c);return u.throwIfAborted(f),D(R,l,t.budget),{...R,execution:p}}catch(m){if(!(m instanceof M)||!d)throw m;u.throwIfAborted(i.signal),p=B(p,"worker-start-failed"),A(t,p)}b&&(l.prepared=W.enforcePrepared(l.prepared,t.budget),O.assertPreparedOutputBudget(l,t.budget));const v=b?await u.controlled(i.signal,g(),m=>b({...l,signal:m})):await u.controlled(i.signal,g(),m=>o.exportPrepared({...k.forward(),signal:m}));return u.throwIfAborted(i.signal),b&&W.assertReportExportResult(v,l.format),D(v,l,t.budget),{...v,execution:p}}return{async exportPrepared(i,b){if(a)throw new u.ReportRuntimeError("closed","导出执行器已释放");if(u.throwIfAborted(i.signal),s.size>=2)throw new u.ReportRuntimeError("queue-full","同时导出的任务已达 2 个,请等待完成后重试");const h=new AbortController;s.add(h);const g=()=>h.abort(i.signal?.reason);i.signal?.addEventListener("abort",g,{once:!0});try{return await y({...i,signal:h.signal},b)}finally{i.signal?.removeEventListener("abort",g),s.delete(h)}},cancel(){for(const i of s)i.abort()},dispose(){a=!0;for(const i of s)i.abort()}}}function q(e={}){const r=e.workerFactory,t={timeoutMs:e.timeoutMs??e.budget?.maxDurationMs,budget:{...e.budget}};return Q(e,r?n=>_(r,{...t,timeoutMs:n}):void 0)}const V=Object.freeze(Object.defineProperty({__proto__:null,createAutoReportExporter:q},Symbol.toStringTag,{value:"Module"}));exports.ReportWorkerStartError=M;exports.auto=V;exports.createAutoReportExporter=q;exports.createBrowserReportExecutor=_;
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { s as S, d as j, c as U, a as H } from "./prepared-
|
|
2
|
-
import { H as I } from "./json-snapshot-
|
|
3
|
-
import { b as W, R as z, v as $, c as N } from "./protocol-
|
|
1
|
+
import { s as S, d as j, c as U, a as H } from "./prepared-DO5pe6Ed.js";
|
|
2
|
+
import { H as I } from "./json-snapshot-DdzALe8q.js";
|
|
3
|
+
import { b as W, R as z, v as $, c as N } from "./protocol-CZddmu2n.js";
|
|
4
4
|
import { z as G } from "./diagnostic-collector-gB07PHy2.js";
|
|
5
|
-
import { c as K, e as X } from "./runtime-
|
|
6
|
-
import { D as C, R as O, t as R, v as
|
|
5
|
+
import { c as K, e as X, a as J } from "./runtime-D8AlfJ6S.js";
|
|
6
|
+
import { D as C, R as O, t as R, v as Q, c as D, b as M } from "./sha256-BDQ1Qk7A.js";
|
|
7
7
|
class T extends Error {
|
|
8
8
|
constructor(r) {
|
|
9
9
|
super("报表 Worker 无法启动"), this.cause = r, this.name = "ReportWorkerStartError";
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
let
|
|
12
|
+
let V = 0;
|
|
13
13
|
function F(e) {
|
|
14
14
|
const r = new Error("报表 Worker 任务已取消");
|
|
15
15
|
return r.name = "AbortError", Object.defineProperty(r, "cause", { value: e }), r;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Y(e, r) {
|
|
18
18
|
if (!e || typeof e != "object") return;
|
|
19
19
|
const t = e;
|
|
20
20
|
return t.protocol === z && t.id === r ? t : void 0;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Z(e, r = {}) {
|
|
23
23
|
const t = r.timeoutMs ?? 12e4;
|
|
24
24
|
if (!Number.isFinite(t) || t <= 0 || t > 2147483647) throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");
|
|
25
|
-
const
|
|
26
|
-
let
|
|
25
|
+
const a = (o, s, n, u) => n?.aborted ? Promise.reject(F(n.reason)) : new Promise((v, i) => {
|
|
26
|
+
let p;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
p = e();
|
|
29
29
|
} catch (f) {
|
|
30
30
|
i(new T(f));
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
const E = `mach-report-${Date.now()}-${++
|
|
34
|
-
let
|
|
35
|
-
},
|
|
33
|
+
const E = `mach-report-${Date.now()}-${++V}`;
|
|
34
|
+
let b = !1, d = () => {
|
|
35
|
+
}, k;
|
|
36
36
|
const l = (f, c) => {
|
|
37
|
-
if (
|
|
38
|
-
|
|
37
|
+
if (b) return;
|
|
38
|
+
b = !0, k && clearTimeout(k);
|
|
39
39
|
let g;
|
|
40
40
|
try {
|
|
41
41
|
d();
|
|
42
42
|
} catch (x) {
|
|
43
43
|
g = x;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
n?.removeEventListener("abort", y), f ??= g, Promise.resolve().then(() => p.terminate()).then(
|
|
46
46
|
() => f === void 0 ? v(c) : i(f),
|
|
47
47
|
(x) => i(f ?? x)
|
|
48
48
|
);
|
|
49
|
-
},
|
|
50
|
-
const c =
|
|
51
|
-
if (!(!c ||
|
|
49
|
+
}, y = () => l(F(n?.reason)), m = (f) => {
|
|
50
|
+
const c = Y(f, E);
|
|
51
|
+
if (!(!c || b)) {
|
|
52
52
|
if ("type" in c && c.type === "event") {
|
|
53
53
|
const g = "event" in c ? c.event : void 0;
|
|
54
|
-
$(g, s) ? I(u, g,
|
|
54
|
+
$(g, s) ? I(u, g, n) : l(new Error("报表 Worker 返回无效阶段事件"));
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
c.error && typeof c.error.name == "string" && typeof c.error.message == "string" ? l(new W(c.error)) : N(c.result, o) && (o === "prepare" || "format" in c.result && "format" in s && c.result.format === s.format) ? l(void 0, c.result) : l(new Error("报表 Worker 返回无效响应"));
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
try {
|
|
61
|
-
if (d =
|
|
61
|
+
if (d = p.subscribe(m, (f) => l(f ?? new Error("报表 Worker 执行失败"))), b) {
|
|
62
62
|
d();
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (n?.addEventListener("abort", y, { once: !0 }), k = setTimeout(() => l(new W({ name: "ReportRuntimeError", code: "timeout", message: `报表 Worker 执行超过 ${t}ms` })), t), n?.aborted) y();
|
|
66
66
|
else {
|
|
67
|
-
const { onEvent: f, signal: c, ...g } = s, x =
|
|
68
|
-
|
|
67
|
+
const { onEvent: f, signal: c, ...g } = s, x = ee(g);
|
|
68
|
+
p.postMessage({ protocol: z, id: E, operation: o, input: g, ...r.budget ? { budget: r.budget } : {} }, x);
|
|
69
69
|
}
|
|
70
70
|
} catch (f) {
|
|
71
71
|
l(f);
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
-
return { exportPrepared: (o, s,
|
|
74
|
+
return { exportPrepared: (o, s, n) => a("exportPrepared", o, s, n), prepare: (o, s, n) => a("prepare", o, s, n), export: (o, s, n) => a("export", o, s, n) };
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ee(e) {
|
|
77
77
|
return e.pdf ? (e.pdf = S(e.pdf), (e.pdf?.customFontFaces ? Object.values(e.pdf.customFontFaces) : [e.pdf?.customFontBytes]).filter((t) => t instanceof Uint8Array).map((t) => t.buffer)) : [];
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
79
|
+
function re(e, r = {}) {
|
|
80
|
+
return Z(() => {
|
|
81
81
|
const t = e();
|
|
82
82
|
return {
|
|
83
|
-
postMessage: (
|
|
83
|
+
postMessage: (a, o) => t.postMessage(a, o),
|
|
84
84
|
terminate: () => t.terminate(),
|
|
85
|
-
subscribe: (
|
|
86
|
-
const s = (u) =>
|
|
87
|
-
return t.addEventListener("message", s), t.addEventListener("error",
|
|
88
|
-
t.removeEventListener("message", s), t.removeEventListener("error",
|
|
85
|
+
subscribe: (a, o) => {
|
|
86
|
+
const s = (u) => a(u.data), n = (u) => o(u instanceof ErrorEvent ? new Error(u.message) : new Error("报表 Worker 消息无法解码"));
|
|
87
|
+
return t.addEventListener("message", s), t.addEventListener("error", n), t.addEventListener("messageerror", n), () => {
|
|
88
|
+
t.removeEventListener("message", s), t.removeEventListener("error", n), t.removeEventListener("messageerror", n);
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
}, r);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const te = { cells: 2e4, pages: 20, bytes: 2e6 };
|
|
95
95
|
function P(e) {
|
|
96
96
|
return e.cells >= e.limits.cells || e.pages >= e.limits.pages || e.bytes >= e.limits.bytes || e.capped;
|
|
97
97
|
}
|
|
@@ -104,9 +104,9 @@ function w(e) {
|
|
|
104
104
|
function L(e, r) {
|
|
105
105
|
for (const t of e ?? []) {
|
|
106
106
|
if (!h(r)) return;
|
|
107
|
-
for (const
|
|
107
|
+
for (const a of t.segments) {
|
|
108
108
|
if (!h(r)) return;
|
|
109
|
-
r.bytes += w(
|
|
109
|
+
r.bytes += w(a.text);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -117,13 +117,13 @@ function q(e, r, t) {
|
|
|
117
117
|
}
|
|
118
118
|
if (h(r)) {
|
|
119
119
|
r.bytes += w(e.text) + w(e.rawText) + w(e.imageData), L(e.richParagraphs, r);
|
|
120
|
-
for (const
|
|
120
|
+
for (const a of e.lines ?? []) {
|
|
121
121
|
if (!h(r)) return;
|
|
122
|
-
r.bytes += w(
|
|
122
|
+
r.bytes += w(a);
|
|
123
123
|
}
|
|
124
|
-
for (const
|
|
124
|
+
for (const a of e.grid?.cells ?? []) {
|
|
125
125
|
if (!h(r)) return;
|
|
126
|
-
for (const o of
|
|
126
|
+
for (const o of a) {
|
|
127
127
|
if (!h(r)) return;
|
|
128
128
|
if (o) {
|
|
129
129
|
r.cells++, r.bytes += w(o.text) + w(o.rawText) + w(o.value), L(o.richParagraphs, r);
|
|
@@ -136,27 +136,27 @@ function q(e, r, t) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function oe(e, r) {
|
|
140
140
|
if (e.format === "xlsx")
|
|
141
141
|
for (const t of e.xlsx?.additionalSheets ?? []) {
|
|
142
142
|
if (!h(r)) return;
|
|
143
143
|
r.bytes += w(t?.name);
|
|
144
|
-
for (const
|
|
144
|
+
for (const a of t?.rows ?? []) {
|
|
145
145
|
if (!h(r)) return;
|
|
146
|
-
for (const o of
|
|
146
|
+
for (const o of a ?? []) {
|
|
147
147
|
if (!h(r)) return;
|
|
148
148
|
r.cells++, r.bytes += w(o);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const r = { ...
|
|
153
|
+
function se(e) {
|
|
154
|
+
const r = { ...te, ...e.thresholds };
|
|
155
155
|
for (const t of Object.values(r)) if (!Number.isSafeInteger(t) || t <= 0) throw new RangeError("导出隔离阈值应为正安全整数");
|
|
156
156
|
return r;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
const t =
|
|
158
|
+
function ae(e, r) {
|
|
159
|
+
const t = se(r), a = e.pdf?.customFontFaces ? Object.values(e.pdf.customFontFaces) : [e.pdf?.customFontBytes], o = { pages: e.prepared.plan.pages.length, cells: 0, bytes: a.reduce((u, v) => u + (v?.byteLength ?? 0), 0), visits: 0, capped: !1, limits: t };
|
|
160
160
|
for (const u of e.prepared.plan.pages) {
|
|
161
161
|
if (P(o)) break;
|
|
162
162
|
for (const v of u.components) {
|
|
@@ -164,14 +164,14 @@ function se(e, r) {
|
|
|
164
164
|
q(v, o, 0);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
let s = P(o) ? "worker" : "local",
|
|
169
|
-
return r.mode === "local" && (s = "local",
|
|
167
|
+
oe(e, o);
|
|
168
|
+
let s = P(o) ? "worker" : "local", n = o.capped ? "scan-limit" : s === "worker" ? "threshold" : "small-task";
|
|
169
|
+
return r.mode === "local" && (s = "local", n = "explicit-local"), r.mode === "worker" && (s = "worker", n = "explicit-worker"), Object.values(e.xlsx ?? {}).some((u) => typeof u == "function") && (s = "local", n = "nonserializable-options"), { mode: s, reason: n, estimate: { pages: o.pages, cells: o.cells, bytes: o.bytes }, hardCancellation: s === "worker" };
|
|
170
170
|
}
|
|
171
171
|
function ne(e) {
|
|
172
172
|
if (e.mode !== void 0 && !["auto", "local", "worker"].includes(e.mode)) throw new TypeError("无效的导出执行模式");
|
|
173
173
|
if (e.fallback !== void 0 && !["local", "error"].includes(e.fallback)) throw new TypeError("无效的导出回退策略");
|
|
174
|
-
|
|
174
|
+
Q({ ...e.budget, maxDurationMs: e.timeoutMs ?? e.budget?.maxDurationMs ?? 12e4 });
|
|
175
175
|
}
|
|
176
176
|
function _(e, r) {
|
|
177
177
|
G(() => e.onDecision?.({ ...r, estimate: { ...r.estimate } }));
|
|
@@ -182,31 +182,31 @@ function A(e, r) {
|
|
|
182
182
|
function B(e, r, t) {
|
|
183
183
|
M(t, "maxRows", e.stats.rows), M(t, "maxPages", e.stats.pages), M(t, "maxCells", e.stats.cells), M(t, "maxOutputBytes", e.bytes.byteLength), j({ ...r, prepared: { ...r.prepared, stats: e.stats } }, t);
|
|
184
184
|
}
|
|
185
|
-
function ae(e, r) {
|
|
186
|
-
const t = { ...C, ...r.budget }, n = U(e.prepared, t.maxPreparedBytes, e.signal), o = { ...e, prepared: n.prepared, pdf: S(e.pdf), xlsx: H(e.xlsx) };
|
|
187
|
-
return { request: o, forward: () => ({ ...o, prepared: n.forward() }) };
|
|
188
|
-
}
|
|
189
185
|
function ie(e, r) {
|
|
186
|
+
const t = { ...C, ...r.budget }, a = U(e.prepared, t.maxPreparedBytes, e.signal), o = { ...e, prepared: a.prepared, pdf: S(e.pdf), xlsx: H(e.xlsx) };
|
|
187
|
+
return { request: o, forward: () => ({ ...o, prepared: a.forward() }) };
|
|
188
|
+
}
|
|
189
|
+
function ce(e, r) {
|
|
190
190
|
ne(e);
|
|
191
|
-
const t = { ...e, thresholds: { ...e.thresholds }, budget: { ...C, ...e.budget } },
|
|
192
|
-
let
|
|
191
|
+
const t = { ...e, thresholds: { ...e.thresholds }, budget: { ...C, ...e.budget } }, a = t.timeoutMs ?? t.budget.maxDurationMs ?? 12e4, o = K({ reports: {}, budget: { ...t.budget, maxDurationMs: a } }), s = /* @__PURE__ */ new Set();
|
|
192
|
+
let n = !1;
|
|
193
193
|
const u = t.mode !== "worker" && t.fallback !== "error";
|
|
194
|
-
async function v(i,
|
|
195
|
-
const E = Date.now(),
|
|
196
|
-
const m =
|
|
197
|
-
if (m <= 0) throw new O("timeout", `报表执行超过 ${
|
|
194
|
+
async function v(i, p) {
|
|
195
|
+
const E = Date.now(), b = () => {
|
|
196
|
+
const m = a - (Date.now() - E);
|
|
197
|
+
if (m <= 0) throw new O("timeout", `报表执行超过 ${a}ms`);
|
|
198
198
|
return m;
|
|
199
199
|
};
|
|
200
|
-
let d =
|
|
200
|
+
let d = ae(i, t);
|
|
201
201
|
if (d.reason === "nonserializable-options" && t.mode === "worker") throw new TypeError("Worker 模式不接受函数选项;请使用本地模式或可序列化配置");
|
|
202
202
|
if (d.mode === "worker" && !r) {
|
|
203
203
|
if (!u) throw new T(new Error("未配置 workerFactory"));
|
|
204
204
|
d = A(d, "worker-unavailable");
|
|
205
205
|
}
|
|
206
|
-
const
|
|
206
|
+
const k = ie(i, t), l = k.request;
|
|
207
207
|
if (_(t, d), R(i.signal), d.mode === "worker")
|
|
208
208
|
try {
|
|
209
|
-
const m = r(
|
|
209
|
+
const m = r(b());
|
|
210
210
|
if (!m.exportPrepared) throw new TypeError("隔离执行器缺少 exportPrepared");
|
|
211
211
|
const { signal: f, onEvent: c, ...g } = l, x = await m.exportPrepared(g, f, c);
|
|
212
212
|
return R(f), B(x, l, t.budget), { ...x, execution: d };
|
|
@@ -214,44 +214,44 @@ function ie(e, r) {
|
|
|
214
214
|
if (!(m instanceof T) || !u) throw m;
|
|
215
215
|
R(i.signal), d = A(d, "worker-start-failed"), _(t, d);
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
return R(i.signal), B(
|
|
217
|
+
p && (l.prepared = X(l.prepared, t.budget), j(l, t.budget));
|
|
218
|
+
const y = p ? await D(i.signal, b(), (m) => p({ ...l, signal: m })) : await D(i.signal, b(), (m) => o.exportPrepared({ ...k.forward(), signal: m }));
|
|
219
|
+
return R(i.signal), p && J(y, l.format), B(y, l, t.budget), { ...y, execution: d };
|
|
220
220
|
}
|
|
221
221
|
return {
|
|
222
|
-
async exportPrepared(i,
|
|
223
|
-
if (
|
|
222
|
+
async exportPrepared(i, p) {
|
|
223
|
+
if (n) throw new O("closed", "导出执行器已释放");
|
|
224
224
|
if (R(i.signal), s.size >= 2) throw new O("queue-full", "同时导出的任务已达 2 个,请等待完成后重试");
|
|
225
225
|
const E = new AbortController();
|
|
226
226
|
s.add(E);
|
|
227
|
-
const
|
|
228
|
-
i.signal?.addEventListener("abort",
|
|
227
|
+
const b = () => E.abort(i.signal?.reason);
|
|
228
|
+
i.signal?.addEventListener("abort", b, { once: !0 });
|
|
229
229
|
try {
|
|
230
|
-
return await v({ ...i, signal: E.signal },
|
|
230
|
+
return await v({ ...i, signal: E.signal }, p);
|
|
231
231
|
} finally {
|
|
232
|
-
i.signal?.removeEventListener("abort",
|
|
232
|
+
i.signal?.removeEventListener("abort", b), s.delete(E);
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
cancel() {
|
|
236
236
|
for (const i of s) i.abort();
|
|
237
237
|
},
|
|
238
238
|
dispose() {
|
|
239
|
-
|
|
239
|
+
n = !0;
|
|
240
240
|
for (const i of s) i.abort();
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function le(e = {}) {
|
|
245
245
|
const r = e.workerFactory, t = { timeoutMs: e.timeoutMs ?? e.budget?.maxDurationMs, budget: { ...e.budget } };
|
|
246
|
-
return
|
|
246
|
+
return ce(e, r ? (a) => re(r, { ...t, timeoutMs: a }) : void 0);
|
|
247
247
|
}
|
|
248
|
-
const
|
|
248
|
+
const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
249
249
|
__proto__: null,
|
|
250
|
-
createAutoReportExporter:
|
|
250
|
+
createAutoReportExporter: le
|
|
251
251
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
252
252
|
export {
|
|
253
253
|
T as R,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
re as a,
|
|
255
|
+
ge as b,
|
|
256
|
+
le as c
|
|
257
257
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as n } from "./runtime-
|
|
2
|
-
import { i, a as p, r as d, R as a, s as R } from "./protocol-
|
|
1
|
+
import { c as n } from "./runtime-D8AlfJ6S.js";
|
|
2
|
+
import { i, a as p, r as d, R as a, s as R } from "./protocol-CZddmu2n.js";
|
|
3
3
|
async function u(r, e) {
|
|
4
4
|
try {
|
|
5
5
|
if (r.operation !== "exportPrepared") throw new TypeError("内置编码 Worker 仅接受 exportPrepared");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./runtime-
|
|
1
|
+
"use strict";const s=require("./runtime-ywf3oLBR.cjs"),e=require("./protocol-CymmHWmL.cjs");async function a(r,t){try{if(r.operation!=="exportPrepared")throw new TypeError("内置编码 Worker 仅接受 exportPrepared");return await e.runReportWorkerRequest(s.createReportRuntime({reports:{},budget:r.budget}),r,t)}catch(o){return{protocol:e.REPORT_WORKER_PROTOCOL,id:r.id,error:e.serializeError(o)}}}function R(r=globalThis){const t=o=>{if(!e.isReportWorkerRequest(o.data))return;const i=o.data;a(i,n=>r.postMessage({protocol:e.REPORT_WORKER_PROTOCOL,id:i.id,type:"event",event:n})).then(n=>r.postMessage(n,e.reportWorkerTransferList(n)))};return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}exports.serveReportEncodingWorker=R;
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./diagnostic-collector-wASg6Fzs.cjs"),U=require("./record-bindings-B7djSjNs.cjs"),v=require("./template-registry-B-AK1oam.cjs"),ye=require("./dataset-IrlXbUvh.cjs"),j=require("./textwrap-LhJkHWb1.cjs"),w=require("./json-snapshot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./diagnostic-collector-wASg6Fzs.cjs"),U=require("./record-bindings-B7djSjNs.cjs"),v=require("./template-registry-B-AK1oam.cjs"),ye=require("./dataset-IrlXbUvh.cjs"),j=require("./textwrap-LhJkHWb1.cjs"),w=require("./json-snapshot-L_gJ7KRS.cjs"),J=require("./dom-CXWMmwh-.cjs"),ot=require("./data-bar-DzceAVeR.cjs"),it=require("./rich-text-layout-yJGuThtC.cjs"),_=require("./capabilities-D4nfhcvB.cjs"),ee=require("./assets-BYdpkTIt.cjs"),at=require("./grid-strokes-RFMR91jn.cjs"),B=require("./prefill-DZymomY6.cjs"),A=require("./param-validation-C-8sRJLq.cjs"),te=require("./computed-DK6BruFz.cjs"),ne=require("./template-catalog-Lil5Ryt-.cjs"),me=require("./template-fragments-DbKdxI1z.cjs"),be=require("./template-serialization-CqQY4zDg.cjs");function ve(e,t,n,r,o,i,c,s="top"){e.font=`${t.italic?"italic ":""}${t.bold?"bold ":""}${t.fontSizePx}px ${c}`,"letterSpacing"in e&&(e.letterSpacing="0px"),e.fillStyle=t.color,e.textBaseline="alphabetic";const a=t.fontSizePx*t.lineHeight,l=t.text===""?[""]:t.text.split(`
|
|
2
2
|
`),m=l.length*a;let p=r;s==="middle"?p=r+(i-m)/2:s==="bottom"&&(p=r+i-m),l.forEach((d,u)=>{const f=p+u*a+t.fontSizePx*.8;st(e,d,t,n,f,o),t.underline&&d&<(e,d,t,n,f,o)}),e.textAlign="left"}function st(e,t,n,r,o,i){const c=Array.from(t),s=n.letterSpacingPx??0;if(!s){e.textAlign=n.align==="center"?"center":n.align==="right"?"right":"left";const p=n.align==="center"?r+i/2:n.align==="right"?r+i:r;e.fillText(t,p,o);return}const a=e.measureText(t).width+Math.max(0,c.length-1)*s,l=n.align==="center"?r+(i-a)/2:n.align==="right"?r+i-a:r;e.textAlign="left";let m="";c.forEach((p,d)=>{e.fillText(p,l+e.measureText(m).width+d*s,o),m+=p})}function lt(e,t,n,r,o,i){const c=e.measureText(t).width+Math.max(0,Array.from(t).length-1)*(n.letterSpacingPx??0),s=n.align==="center"?r+(i-c)/2:n.align==="right"?r+i-c:r;e.strokeStyle=n.color,e.lineWidth=Math.max(.5,n.fontSizePx/20),e.beginPath(),e.moveTo(s,o+1),e.lineTo(s+c,o+1),e.stroke()}function _e(e,t,n,r,o){const i=r/72,c=s=>{e.font=`${s.italic?"italic ":""}${s.bold?"bold ":""}${g.resolveFontSize(s,r).fontSizePx}px ${s.fontFamily??o}`,"letterSpacing"in e&&(e.letterSpacing="0px")};it.drawRichText(t,{x:n.x/i,yTop:-n.y/i,width:n.width/i,height:n.height/i},{measure(s,a){return c(a),e.measureText(s).width/i+(a.letterSpacing??0)},draw(s,a,l,m,p){const d=g.resolveFontSize(a,r).fontSizePx,u=-m*i-d*.8;a.backgroundColor&&(e.fillStyle=a.backgroundColor,e.fillRect(l*i,u,p*i,d*g.resolveLineHeight(a))),ve(e,{text:s,fontSizePx:d,bold:!!a.bold,italic:a.italic,underline:a.underline,color:g.resolveTextColor(a),align:"left",lineHeight:g.resolveLineHeight(a),letterSpacingPx:(a.letterSpacing??0)*i},l*i,u,p*i,d,a.fontFamily??o)}})}function L(e){if(e?.aborted)throw e.reason??new DOMException("The operation was aborted.","AbortError")}const ct=(e,t)=>(L(t),/^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e)?new Promise((n,r)=>{const o=new Image,i=()=>{o.onload=null,o.onerror=null,t?.removeEventListener("abort",c)},c=()=>{i(),o.src="",r(t?.reason??new DOMException("The operation was aborted.","AbortError"))};o.onload=()=>{i(),n(o)},o.onerror=()=>{i(),r(new Error("Image could not be decoded for Canvas output."))},t?.addEventListener("abort",c,{once:!0}),o.src=e}):Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));function mt(e,t,n){return L(n),n?new Promise((r,o)=>{const i=()=>o(n.reason??new DOMException("The operation was aborted.","AbortError"));n.addEventListener("abort",i,{once:!0}),Promise.resolve().then(()=>e(t,n)).then(r,o).finally(()=>n.removeEventListener("abort",i))}):e(t)}function*Me(e){function*t(n,r,o,i){if(i.has(n))throw new TypeError("Cyclic grid children cannot be rendered.");g.isImageBackedComponent(n)&&(yield{component:n,componentIndex:r,componentPath:o});const c=new Set(i).add(n);for(const[s,a]of(n.grid?.cells??[]).entries())for(const[l,m]of a.entries())for(const[p,d]of(m?.children??[]).entries())yield*t(d,r,[...o,s,l,p],c)}for(const[n,r]of e.components.entries())yield*t(r,n,[],new Set)}async function dt(e,t,n){const r=new Map;for(const{component:o}of Me(e))!g.isImageBackedComponent(o)||r.has(o.imageData)||r.set(o.imageData,await mt(t,o.imageData,n));return L(n),r}function pt(e,t,n,r,o,i){const c=t,s=c.naturalWidth??c.width??o,a=c.naturalHeight??c.height??i;if(s<=0||a<=0)throw new RangeError("Decoded Canvas image dimensions must be positive.");const l=Math.min(o/s,i/a),m=s*l,p=a*l;e.drawImage(t,n+(o-m)/2,r+(i-p)/2,m,p)}function je(e){return B.createPageWindowIndex(e.pageHeightsPx,e.gapPx).window(e.viewportHeightPx,e.scrollTopPx,e.overscan)}const Re=96/25.4;function de(e,t=96){const n=t/96*Re;return{widthPx:Math.max(1,Math.round(e.pageWidthMm*n)),heightPx:Math.max(1,Math.round(e.pageHeightMm*n))}}function Be(e,t,n,r=64e6){if(!Number.isFinite(t)||t<=0||!Number.isFinite(n)||n<=0)throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");if(!Number.isFinite(r)||r<=0)throw new RangeError("maxCanvasPixels must be positive and finite.");const o=de(e,n),i=Math.round(o.widthPx*t),c=Math.round(o.heightPx*t);if(!Number.isSafeInteger(i)||!Number.isSafeInteger(c)||i*c>r)throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");return{width:i,height:c}}function ze(e,t,n,r){const o=document.createElement("canvas"),{widthPx:i,heightPx:c}=de(e,n),s=Be(e,t,n,r);o.width=s.width,o.height=s.height,o.style.width=`${i}px`,o.style.height=`${c}px`;const a=o.getContext("2d");if(!a)throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");return a.scale(t,t),a.fillStyle="#ffffff",a.fillRect(0,0,i,c),{canvas:o,ctx:a}}function gt(e,t=96){return g.resolveFontSize(e,t).fontSizePx}function ut(e,t,n,r,o,i,c){for(const s of at.resolveGridStrokes(t,n))e.strokeStyle=s.color,e.lineWidth=g.ptToPx(s.widthPt,c),e.beginPath(),s.kind==="v"?(e.moveTo(r+s.pos*i,o+s.from*i),e.lineTo(r+s.pos*i,o+s.to*i)):(e.moveTo(r+s.from*i,o+s.pos*i),e.lineTo(r+s.to*i,o+s.pos*i)),e.stroke()}function ft(e,t,n,r,o,i){e.beginPath(),t.top&&(e.moveTo(n,r),e.lineTo(n+o,r)),t.right&&(e.moveTo(n+o,r),e.lineTo(n+o,r+i)),t.bottom&&(e.moveTo(n+o,r+i),e.lineTo(n,r+i)),t.left&&(e.moveTo(n,r+i),e.lineTo(n,r)),e.stroke()}function ht(e,t,n,r,o,i,c,s,a,l,m,p){const d=g.resolveGridLayout(t,i/s,c/s);for(const u of d.cells){const f=u.cell.style?.backgroundColor??n.style?.backgroundColor;f&&(e.fillStyle=f,e.fillRect(r+u.xMm*s,o+u.yMm*s,u.widthMm*s,u.heightMm*s))}ut(e,d,n,r,o,s,a);for(const u of d.cells)wt(e,u,n,r,o,s,a,l,m,p)}function wt(e,t,n,r,o,i,c,s,a,l){const m=n.grid?.paddingMm??.5,p=t.cell.text??"",d=g.resolveGridCellStyle(n.style,t.cell),u=g.resolveFontSize(d,c),f=t.cell.indentMm??0,x=Math.max(0,t.widthMm-2*m-f),C=j.wrapText(p,x,{fontSizePt:u.fontSizePt,bold:d.bold,italic:d.italic,fontFamily:d.fontFamily??s,letterSpacingPt:d.letterSpacing},a).join(`
|
|
3
3
|
`),M={x:r+(t.xMm+m+f)*i,y:o+(t.yMm+m)*i,width:x*i,height:Math.max(0,t.heightMm-2*m)*i};e.save(),e.beginPath(),e.rect(M.x,M.y,M.width,M.height),e.clip(),t.cell.richParagraphs?.length?_e(e,{...n,richParagraphs:t.cell.richParagraphs,style:{verticalAlign:"middle",...d}},M,c,s):ve(e,{text:C,fontSizePx:u.fontSizePx,bold:d.bold??!1,italic:d.italic,underline:d.underline,color:g.resolveTextColor(d,g.DEFAULT_TEXT_COLOR),align:d.align??"left",lineHeight:g.resolveLineHeight(d),letterSpacingPx:g.ptToPx(d.letterSpacing??0,c)},r+(t.xMm+m+f)*i,o+(t.yMm+m)*i,x*i,Math.max(0,t.heightMm-2*m)*i,d.fontFamily??s,d.verticalAlign??"middle");for(const P of t.cell.children??[])pe(e,{...P,leftMm:P.leftMm+M.x/i,topMm:P.topMm+M.y/i},i,c,s,a,l);e.restore();const E=ot.dataBarBox(t.cell.dataBar,t.widthMm,t.heightMm,m);E&&(e.save(),e.globalAlpha*=.35,e.fillStyle=E.color,e.fillRect(r+(t.xMm+E.x)*i,o+(t.yMm+E.y)*i,E.width*i,E.height*i),e.restore())}function yt(e,t,n,r,o,i,c,s,a){const l=t.style??{},m=g.resolveFontSize(l,c);if(g.isRichText(t)){_e(e,t,{x:n,y:r,width:o,height:i},c,s);return}const p=t.lines?.length?t.lines.join(`
|
|
4
4
|
`):j.wrapText(t.text??"",t.widthMm,{fontSizePt:m.fontSizePt,bold:l.bold,italic:l.italic,fontFamily:l.fontFamily??s,letterSpacingPt:l.letterSpacing},a).join(`
|
package/dist/index.d.cts
CHANGED
|
@@ -1978,7 +1978,7 @@ export declare type ReportPrefillReason = "unchanged" | "readonly" | "occupied"
|
|
|
1978
1978
|
export declare type ReportPrefillStatus = "matched" | "changed" | "skipped" | "conflict";
|
|
1979
1979
|
|
|
1980
1980
|
export declare interface ReportPreparedEdit {
|
|
1981
|
-
/** Calculated preview;
|
|
1981
|
+
/** Calculated preview; mutations are rejected before validation/commit. */
|
|
1982
1982
|
readonly plan: RenderPlan;
|
|
1983
1983
|
readonly validationIssues: readonly ReportValidationIssue[];
|
|
1984
1984
|
/** Validate complete candidate source rows and derived fields before invoking persistence. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1978,7 +1978,7 @@ export declare type ReportPrefillReason = "unchanged" | "readonly" | "occupied"
|
|
|
1978
1978
|
export declare type ReportPrefillStatus = "matched" | "changed" | "skipped" | "conflict";
|
|
1979
1979
|
|
|
1980
1980
|
export declare interface ReportPreparedEdit {
|
|
1981
|
-
/** Calculated preview;
|
|
1981
|
+
/** Calculated preview; mutations are rejected before validation/commit. */
|
|
1982
1982
|
readonly plan: RenderPlan;
|
|
1983
1983
|
readonly validationIssues: readonly ReportValidationIssue[];
|
|
1984
1984
|
/** Validate complete candidate source rows and derived fields before invoking persistence. */
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { v as lt } from "./dataset-DL83majE.js";
|
|
|
7
7
|
import { d as Wr } from "./dataset-DL83majE.js";
|
|
8
8
|
import { h as ue, w as ze } from "./textwrap-BywMBMXM.js";
|
|
9
9
|
import { c as qr, a as Vr, b as Jr, m as Gr } from "./textwrap-BywMBMXM.js";
|
|
10
|
-
import { R as pe, d as mt, s as He, a as dt, p as ft } from "./json-snapshot-
|
|
11
|
-
import { D as Yr, b as Xr, c as Zr, e as Qr, f as ei, g as ti, h as ni, i as ri, j as ii, k as oi, l as ai, m as si, n as ci, o as li, q as mi, r as di, t as fi, u as hi, v as gi, w as ui, x as pi, y as wi, z as bi, A as yi, B as Mi, C as vi, E as xi, F as Ei, G as Si } from "./json-snapshot-
|
|
10
|
+
import { R as pe, d as mt, s as He, a as dt, p as ft } from "./json-snapshot-DdzALe8q.js";
|
|
11
|
+
import { D as Yr, b as Xr, c as Zr, e as Qr, f as ei, g as ti, h as ni, i as ri, j as ii, k as oi, l as ai, m as si, n as ci, o as li, q as mi, r as di, t as fi, u as hi, v as gi, w as ui, x as pi, y as wi, z as bi, A as yi, B as Mi, C as vi, E as xi, F as Ei, G as Si } from "./json-snapshot-DdzALe8q.js";
|
|
12
12
|
import { c as Ci, a as Ti, b as Pi, i as $i, r as Oi, d as Ai, e as Ii, t as Di } from "./dom-DxdCMLzs.js";
|
|
13
13
|
import { d as ht } from "./data-bar-Bfh54sT4.js";
|
|
14
14
|
import { d as gt } from "./rich-text-layout-Ch_N0Ubu.js";
|
|
@@ -17,11 +17,11 @@ import { i as Ni, a as ki } from "./capabilities-CN_kSVjO.js";
|
|
|
17
17
|
import { r as we } from "./assets-C4MIvzQ4.js";
|
|
18
18
|
import { O as ji } from "./assets-C4MIvzQ4.js";
|
|
19
19
|
import { r as pt } from "./grid-strokes-DkZEZvcI.js";
|
|
20
|
-
import { c as wt } from "./prefill-
|
|
21
|
-
import { R as Hi, a as Bi, b as _i, d as Wi, e as Ui, m as qi, r as Vi, f as Ji, g as Gi, v as Ki } from "./prefill-
|
|
20
|
+
import { c as wt } from "./prefill-m01IM1hl.js";
|
|
21
|
+
import { R as Hi, a as Bi, b as _i, d as Wi, e as Ui, m as qi, r as Vi, f as Ji, g as Gi, v as Ki } from "./prefill-m01IM1hl.js";
|
|
22
22
|
import { R as Xi, a as Zi, f as Qi, b as eo, c as to, d as no, i as ro, e as io, g as oo, p as ao, h as so, j as co, k as lo, r as mo, v as fo, l as ho } from "./param-validation-CnDEd2l-.js";
|
|
23
23
|
import { n as uo, f as po, o as wo, r as bo, l as yo } from "./computed-f3pOqWLX.js";
|
|
24
|
-
import { c as vo, a as xo, d as Eo, r as So, b as Ro } from "./template-catalog-
|
|
24
|
+
import { c as vo, a as xo, d as Eo, r as So, b as Ro } from "./template-catalog-DLu814zA.js";
|
|
25
25
|
import { a as To, c as Po, i as $o, b as Oo } from "./template-fragments-BDxdCuMD.js";
|
|
26
26
|
import { T as Io, c as Do, a as Lo } from "./template-serialization-CWmHq7lX.js";
|
|
27
27
|
function be(e, t, n, r, i, o, l, s = "top") {
|