@agile-team/mach-report 2.23.1 → 2.24.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.
- package/README.md +8 -2
- package/dist/{ExcelBindingWizard-BrTmdo7f.cjs → ExcelBindingWizard-BV12hGiK.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CcDMLO8Q.js → ExcelBindingWizard-Cy_lPjWV.js} +3 -3
- package/dist/ParamEditor-DenKjvKu.cjs +1 -0
- package/dist/ParamEditor-PyOqHzzw.js +750 -0
- package/dist/{ReportBatchPanel-CJB67WNd.js → ReportBatchPanel-8EFtMrKk.js} +2 -2
- package/dist/{ReportBatchPanel-CHxBtG9R.cjs → ReportBatchPanel-pQ6d0yqJ.cjs} +1 -1
- package/dist/ReportLabelStudio-B_KF3Zc_.cjs +1 -0
- package/dist/{ReportLabelStudio-Tplc1TLJ.js → ReportLabelStudio-HUeo2TsU.js} +68 -68
- package/dist/ReportParamPanel-8xR85nz-.cjs +1 -0
- package/dist/{ReportParamPanel-GI43aGa0.js → ReportParamPanel-DA-YpkvC.js} +328 -298
- package/dist/ReportPreview-CyUXJSVX.cjs +6 -0
- package/dist/ReportPreview-_wTJnsG1.js +7120 -0
- package/dist/{ReportTemplateLibrary-BFQIX0sg.cjs → ReportTemplateLibrary-CjArKxRG.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-KqX4E2sN.js → ReportTemplateLibrary-DH8jl9IF.js} +28 -28
- package/dist/RuleEditor-Bmj98oC4.cjs +1 -0
- package/dist/{RuleEditor-OPX1awrH.js → RuleEditor-GDydlEHz.js} +846 -834
- package/dist/{TemplateOutlinePanel-CVYKVLv_.cjs → TemplateOutlinePanel-B554_qk1.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DQS-eOs6.js → TemplateOutlinePanel-DjPqzU9h.js} +10 -10
- package/dist/{TemplateReusePanel-CY6O93Zk.cjs → TemplateReusePanel-D0628OYc.cjs} +1 -1
- package/dist/{TemplateReusePanel-DKXiFTyB.js → TemplateReusePanel-DtYbCN7U.js} +2 -2
- package/dist/TemplateReviewPanel-CSwvCz3f.cjs +1 -0
- package/dist/TemplateReviewPanel-D_FR4ISq.js +602 -0
- package/dist/artifact-integrity.json +94 -94
- package/dist/assets-B4AJIOTB.cjs +1 -0
- package/dist/assets-D0FbszhB.js +137 -0
- package/dist/{auto-BB99S802.js → auto-BksreoKc.js} +5 -5
- package/dist/auto-C3mGqzJ8.cjs +1 -0
- package/dist/capabilities-CTwlcl8q.cjs +1 -0
- package/dist/capabilities-lqDEZSq5.js +121 -0
- package/dist/data-bar-2NLRzOCQ.cjs +1 -0
- package/dist/{data-bar-IkI6VvMQ.js → data-bar-BnGtnJ82.js} +1 -1
- package/dist/designer-BNf7NWd6.js +7589 -0
- package/dist/designer-DWnZZ_ej.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +137 -4
- package/dist/designer.d.ts +137 -4
- package/dist/designer.js +5 -5
- package/dist/diagnostic-collector-1sqd7DQP.js +355 -0
- package/dist/diagnostic-collector-D3rlvxm3.cjs +1 -0
- package/dist/{dom-JWrchIre.js → dom-C90cTM6Y.js} +4 -4
- package/dist/dom-CxOkm_Sy.cjs +1 -0
- package/dist/{encoding-7lquyj0w.cjs → encoding-CkziAnZI.cjs} +1 -1
- package/dist/{encoding-CEd-dq9A.js → encoding-DSc9zv2F.js} +2 -2
- package/dist/{font-loader-D8pI87fL.cjs → font-loader-D-znWNWS.cjs} +1 -1
- package/dist/{font-loader-CNWXomuV.js → font-loader-i7lZbqH_.js} +1 -1
- package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-BPiV1WHe.js} +1 -1
- package/dist/grid-strokes-DYf-6DMl.cjs +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +46 -7
- package/dist/index.d.ts +46 -7
- package/dist/index.js +69 -68
- package/dist/{json-snapshot-BRnzKudk.js → json-snapshot-BJWZNryO.js} +919 -791
- package/dist/json-snapshot-C7QZrRBf.cjs +2 -0
- package/dist/{pdf-CJToa81Z.js → pdf-0_5XiTCx.js} +2499 -2492
- package/dist/{pdf-DpMkW72B.cjs → pdf-DWuq6uxx.cjs} +31 -31
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +18 -0
- package/dist/pdf.d.ts +18 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-_BkUVc2z.js → plugin-B1ydqEmS.js} +1 -1
- package/dist/{plugin-BWTp-X7b.cjs → plugin-BQBz2vLG.cjs} +1 -1
- package/dist/prefill-2p9wrpn9.cjs +1 -0
- package/dist/{prefill-CWGdnqQd.js → prefill-Cuzh1wxf.js} +13 -13
- package/dist/prepared-CVbgO9KR.js +128 -0
- package/dist/prepared-DAwe8Il2.cjs +1 -0
- package/dist/protocol-BOri9qJL.js +105 -0
- package/dist/protocol-DD5dHSz-.cjs +1 -0
- package/dist/record-bindings-CAyM5tGg.cjs +1 -0
- package/dist/{record-bindings-DatJZv_e.js → record-bindings-fhav-NLG.js} +1 -1
- package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-Cm4mqhih.js} +2 -2
- package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-DWCUgjZl.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-X9YOz1JD.cjs +3 -0
- package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-YJHtCWQI.js} +1 -1
- package/dist/runtime-BpSAgOw1.js +201 -0
- package/dist/runtime-Cd2UTnwe.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +55 -7
- package/dist/server/node.d.ts +55 -7
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +2721 -2430
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +47 -12
- package/dist/server.d.ts +47 -12
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog-DtrtT1FY.cjs → template-catalog--yBX169M.cjs} +1 -1
- package/dist/{template-catalog-CRuZL3pi.js → template-catalog-Bu7s7ReF.js} +3 -3
- package/dist/template-fragments-5EzVn7bm.cjs +1 -0
- package/dist/{template-fragments-CPpGpQoz.js → template-fragments-Di2vDFnx.js} +2 -2
- package/dist/{template-registry-O0hNIOfB.js → template-registry-BCBF2b8j.js} +10 -10
- package/dist/template-registry-Bnh5aEYf.cjs +1 -0
- package/dist/textwrap-BPFxhpOw.cjs +4 -0
- package/dist/{textwrap-D4ZksyMK.js → textwrap-CmVkhMhx.js} +1 -1
- package/dist/vue/async.d.cts +97 -18
- package/dist/vue/async.d.ts +97 -18
- package/dist/vue/index.d.cts +127 -28
- package/dist/vue/index.d.ts +127 -28
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +192 -162
- package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-B6P_-5a4.js} +2 -2
- package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-BnPK3T58.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +55 -7
- package/dist/worker.d.ts +55 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +18 -1
- package/dist/xlsx.d.ts +18 -1
- package/dist/xlsx.js +279 -272
- package/package.json +1 -1
- package/dist/ParamEditor-BGjovFUe.js +0 -737
- package/dist/ParamEditor-CeNp4_zQ.cjs +0 -1
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +0 -1
- package/dist/ReportParamPanel-C7fZTllk.cjs +0 -1
- package/dist/ReportPreview-BoGBGyRr.cjs +0 -6
- package/dist/ReportPreview-QLONCyci.js +0 -6257
- package/dist/RuleEditor-BZUP9yvL.cjs +0 -1
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +0 -1
- package/dist/TemplateReviewPanel-Dijwm9YE.js +0 -593
- package/dist/assets-D2gHc4Mz.cjs +0 -1
- package/dist/assets-T_gDeFaz.js +0 -132
- package/dist/auto-BrPWo7Xm.cjs +0 -1
- package/dist/capabilities-DiBj4Qgl.cjs +0 -1
- package/dist/capabilities-pg7j7VLT.js +0 -106
- package/dist/data-bar-CeZuFmYl.cjs +0 -1
- package/dist/designer-BZoVWTgl.js +0 -7172
- package/dist/designer-zS2uKJmY.cjs +0 -2
- package/dist/dom-ChE5D-L-.cjs +0 -1
- package/dist/grid-strokes-Be24LGuV.cjs +0 -1
- package/dist/json-snapshot-DNiIbpOr.cjs +0 -2
- package/dist/prefill-PaAy6wLk.cjs +0 -1
- package/dist/prepared-CJy_qk7d.js +0 -94
- package/dist/prepared-D0yCSxSO.cjs +0 -1
- package/dist/progress-ByiOxUD3.js +0 -250
- package/dist/progress-WomPRP3B.cjs +0 -1
- package/dist/protocol-BG16rz6D.js +0 -90
- package/dist/protocol-wzhl1Fim.cjs +0 -1
- package/dist/record-bindings-MBxbeBsi.cjs +0 -1
- package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
- package/dist/runtime-DYMOS_gz.cjs +0 -1
- package/dist/runtime-PiCax9zQ.js +0 -171
- package/dist/template-fragments-GVjpew_q.cjs +0 -1
- package/dist/template-registry-DI59PXVK.cjs +0 -1
- package/dist/textwrap-DEHqAjKZ.cjs +0 -4
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
const tt = 1.35, et = 10.5, nt = '"Microsoft YaHei", sans-serif', ot = 0.75, B = "#333333", U = "#000000", G = "1.0.0-mach", rt = 25.4, st = 96;
|
|
2
|
+
function R(t = 96) {
|
|
3
|
+
return t / 25.4;
|
|
4
|
+
}
|
|
5
|
+
function it(t, e = 96) {
|
|
6
|
+
return (t || 0) * R(e);
|
|
7
|
+
}
|
|
8
|
+
function at(t, e = 96) {
|
|
9
|
+
return t / R(e);
|
|
10
|
+
}
|
|
11
|
+
function K(t, e = 96) {
|
|
12
|
+
return t * e / 72;
|
|
13
|
+
}
|
|
14
|
+
function ct(t, e) {
|
|
15
|
+
const n = 10 ** e;
|
|
16
|
+
return Math.round(t * n) / n;
|
|
17
|
+
}
|
|
18
|
+
const ut = {
|
|
19
|
+
a3: { widthMm: 297, heightMm: 420 },
|
|
20
|
+
a4: { widthMm: 210, heightMm: 297 },
|
|
21
|
+
a5: { widthMm: 148, heightMm: 210 },
|
|
22
|
+
b4: { widthMm: 250, heightMm: 353 },
|
|
23
|
+
b5: { widthMm: 176, heightMm: 250 }
|
|
24
|
+
};
|
|
25
|
+
function ft(t, e = 96, n = 10.5) {
|
|
26
|
+
if (t?.fontSizePx != null)
|
|
27
|
+
return { fontSizePt: t.fontSizePx * 72 / e, fontSizePx: t.fontSizePx };
|
|
28
|
+
const o = t?.fontSize ?? n;
|
|
29
|
+
return { fontSizePt: o, fontSizePx: K(o, e) };
|
|
30
|
+
}
|
|
31
|
+
function lt(t, e = B) {
|
|
32
|
+
return {
|
|
33
|
+
color: t?.borderColor ?? t?.lineColor ?? e,
|
|
34
|
+
widthPt: t?.lineWidthPt ?? 0.75
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function dt(t, e = U) {
|
|
38
|
+
return t?.color ?? e;
|
|
39
|
+
}
|
|
40
|
+
function ht(t) {
|
|
41
|
+
return t?.lineHeight ?? 1.35;
|
|
42
|
+
}
|
|
43
|
+
function pt(t) {
|
|
44
|
+
const e = t?.borderTop !== !1, n = t?.borderRight !== !1, o = t?.borderBottom !== !1, r = t?.borderLeft !== !1;
|
|
45
|
+
return { top: e, right: n, bottom: o, left: r, inner: e || n || o || r };
|
|
46
|
+
}
|
|
47
|
+
function mt(t, e) {
|
|
48
|
+
const n = { ...t, ...e };
|
|
49
|
+
return e?.fontSize != null && e.fontSizePx == null && delete n.fontSizePx, e?.fontSizePx != null && e.fontSize == null && delete n.fontSize, n;
|
|
50
|
+
}
|
|
51
|
+
function V(t, e) {
|
|
52
|
+
const n = t.length;
|
|
53
|
+
if (n === 0) return [];
|
|
54
|
+
const o = t.reduce((f, l) => f + l, 0), r = o > 0 && e > 0 ? e / o : 1, i = [];
|
|
55
|
+
let u = 0;
|
|
56
|
+
for (let f = 0; f < n; f++) {
|
|
57
|
+
const l = Math.max(0, t[f] * r);
|
|
58
|
+
i.push({ pos: u, size: l }), u += l;
|
|
59
|
+
}
|
|
60
|
+
return i;
|
|
61
|
+
}
|
|
62
|
+
function L(t, e, n) {
|
|
63
|
+
return t?.length ? V(t, e) : Array.from({ length: n }, (o, r) => ({
|
|
64
|
+
pos: e * r / n,
|
|
65
|
+
size: e / n
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function gt(t, e, n) {
|
|
69
|
+
const o = t.cells ?? [], r = Math.max(o.length, 1), i = t.colWidthsMm?.length ?? o.reduce((s, a) => Math.max(s, Array.isArray(a) ? a.length : 0), 1), u = L(t.colWidthsMm, e, i), f = (s) => s <= 0 ? 0 : s >= i ? u[u.length - 1].pos + u[u.length - 1].size : u[s].pos, l = L(t.rowHeightsMm, n, r), m = (s) => s <= 0 ? 0 : s >= r ? l[l.length - 1].pos + l[l.length - 1].size : l[s].pos, x = /* @__PURE__ */ new Set(), y = (s, a) => `${s}:${a}`, P = [], _ = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), h = (s, a) => `v${s}:${a}`, p = (s, a) => `h${s}:${a}`;
|
|
70
|
+
o.forEach((s, a) => {
|
|
71
|
+
if (!Array.isArray(s)) return;
|
|
72
|
+
let c = 0;
|
|
73
|
+
for (const E of s) {
|
|
74
|
+
for (; c < i && x.has(y(a, c)); ) c++;
|
|
75
|
+
if (c >= i) break;
|
|
76
|
+
const F = Math.max(1, Math.min(E?.colSpan ?? 1, i - c)), H = Math.max(1, E?.rowSpan ?? 1), T = Math.min(r, a + H), A = Math.min(i, c + F);
|
|
77
|
+
for (let b = a; b < T; b++)
|
|
78
|
+
for (let S = c; S < A; S++)
|
|
79
|
+
x.add(y(b, S));
|
|
80
|
+
for (let b = c + 1; b < A; b++)
|
|
81
|
+
for (let S = a; S < T; S++) _.add(h(b, S));
|
|
82
|
+
for (let b = a + 1; b < T; b++)
|
|
83
|
+
for (let S = c; S < A; S++) d.add(p(b, S));
|
|
84
|
+
const I = f(c), C = m(a);
|
|
85
|
+
P.push({
|
|
86
|
+
ri: a,
|
|
87
|
+
ci: c,
|
|
88
|
+
cell: E ?? {},
|
|
89
|
+
xMm: I,
|
|
90
|
+
yMm: C,
|
|
91
|
+
widthMm: f(A) - I,
|
|
92
|
+
heightMm: m(T) - C
|
|
93
|
+
}), c = A;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const g = [];
|
|
97
|
+
for (let s = 1; s < i; s++) {
|
|
98
|
+
let a = -1;
|
|
99
|
+
for (let c = 0; c <= r; c++) {
|
|
100
|
+
const E = c < r && !_.has(h(s, c));
|
|
101
|
+
E && a < 0 && (a = c), !E && a >= 0 && (g.push({ kind: "v", pos: f(s), from: m(a), to: m(c) }), a = -1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (let s = 1; s < r; s++) {
|
|
105
|
+
let a = -1;
|
|
106
|
+
for (let c = 0; c <= i; c++) {
|
|
107
|
+
const E = c < i && !d.has(p(s, c));
|
|
108
|
+
E && a < 0 && (a = c), !E && a >= 0 && (g.push({ kind: "h", pos: m(s), from: f(a), to: f(c) }), a = -1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { columns: u, rows: l, cells: P, edges: g };
|
|
112
|
+
}
|
|
113
|
+
function bt(t) {
|
|
114
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
115
|
+
const { start: e, end: n, color: o } = t;
|
|
116
|
+
return typeof e == "number" && typeof n == "number" && Number.isFinite(e) && Number.isFinite(n) && e >= 0 && n <= 1 && e <= n && typeof o == "string" && /^#[0-9a-f]{6}$/i.test(o);
|
|
117
|
+
}
|
|
118
|
+
const St = G;
|
|
119
|
+
function Et(t) {
|
|
120
|
+
return (t.kind === "image" || t.kind === "barcode" || t.kind === "qrcode" || t.kind === "chart") && !!t.imageData;
|
|
121
|
+
}
|
|
122
|
+
function xt(t) {
|
|
123
|
+
return t.kind === "text" && Array.isArray(t.richParagraphs) && t.richParagraphs.length > 0;
|
|
124
|
+
}
|
|
125
|
+
function M(t) {
|
|
126
|
+
return !!t && typeof t == "object";
|
|
127
|
+
}
|
|
128
|
+
function v(t, e, n, o, r) {
|
|
129
|
+
if (++r.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
130
|
+
if (M(t)) {
|
|
131
|
+
if (n > 64) return { path: e, message: "组件嵌套超过64层预算" };
|
|
132
|
+
if (o.has(t)) return { path: e, message: "组件树包含循环引用" };
|
|
133
|
+
if (!(!M(t.grid) || !Array.isArray(t.grid.cells))) {
|
|
134
|
+
o.add(t);
|
|
135
|
+
try {
|
|
136
|
+
for (const [i, u] of t.grid.cells.entries())
|
|
137
|
+
if (Array.isArray(u))
|
|
138
|
+
for (const [f, l] of u.entries()) {
|
|
139
|
+
if (++r.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
140
|
+
if (!(!M(l) || !Array.isArray(l.children)))
|
|
141
|
+
for (const [m, x] of l.children.entries()) {
|
|
142
|
+
const y = v(x, `${e}.grid.cells.${i}.${f}.children.${m}`, n + 1, o, r);
|
|
143
|
+
if (y) return y;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} finally {
|
|
147
|
+
o.delete(t);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function q(t, e = "$.components", n = { nodes: 0 }) {
|
|
153
|
+
for (const [o, r] of t.entries()) {
|
|
154
|
+
const i = v(r, `${e}.${o}`, 0, /* @__PURE__ */ new Set(), n);
|
|
155
|
+
if (i) return i;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function W(t) {
|
|
159
|
+
const e = { nodes: 0 };
|
|
160
|
+
for (const [n, o] of t.entries()) {
|
|
161
|
+
if (!M(o) || !Array.isArray(o.components)) continue;
|
|
162
|
+
const r = q(o.components, `$.pages.${n}.components`, e);
|
|
163
|
+
if (r) return r;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function yt(t) {
|
|
167
|
+
const e = W(t.pages);
|
|
168
|
+
if (e) throw new TypeError(`${e.path}: ${e.message}`);
|
|
169
|
+
}
|
|
170
|
+
function w(t) {
|
|
171
|
+
if (t?.aborted) throw t.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
172
|
+
}
|
|
173
|
+
function X(t) {
|
|
174
|
+
try {
|
|
175
|
+
Promise.resolve(t()).catch(() => {
|
|
176
|
+
});
|
|
177
|
+
} catch {
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function Y(t, e, n) {
|
|
181
|
+
w(t.signal), X(() => t.onProgress?.(e, n)), w(t.signal);
|
|
182
|
+
}
|
|
183
|
+
function At(t, e) {
|
|
184
|
+
const n = Promise.resolve(t);
|
|
185
|
+
return e?.aborted ? (n.catch(() => {
|
|
186
|
+
}), Promise.reject(e.reason ?? new DOMException("The operation was aborted.", "AbortError"))) : e ? new Promise((o, r) => {
|
|
187
|
+
const i = () => e.removeEventListener("abort", u), u = () => {
|
|
188
|
+
i(), r(e.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
189
|
+
};
|
|
190
|
+
e.addEventListener("abort", u, { once: !0 }), n.then((f) => {
|
|
191
|
+
i(), o(f);
|
|
192
|
+
}, (f) => {
|
|
193
|
+
i(), r(f);
|
|
194
|
+
}), e.aborted && u();
|
|
195
|
+
}) : n;
|
|
196
|
+
}
|
|
197
|
+
function wt(t, e) {
|
|
198
|
+
const n = () => e.abort(t?.reason);
|
|
199
|
+
return t?.addEventListener("abort", n, { once: !0 }), t?.aborted && n(), () => t?.removeEventListener("abort", n);
|
|
200
|
+
}
|
|
201
|
+
async function Pt(t, e, n) {
|
|
202
|
+
Y(t, e, n), (t.signal || t.onProgress) && await new Promise((o) => setTimeout(o, 0)), w(t.signal);
|
|
203
|
+
}
|
|
204
|
+
function _t(t) {
|
|
205
|
+
let e = 0, n = Date.now();
|
|
206
|
+
return (o = 1) => {
|
|
207
|
+
if (w(t.signal), e += o, !(e < 4096 && Date.now() - n < 8))
|
|
208
|
+
return e = 0, new Promise((r) => setTimeout(r, 0)).then(() => {
|
|
209
|
+
n = Date.now(), w(t.signal);
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const Tt = 200, $ = 1e3, k = 128, O = "other", N = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), Z = {
|
|
214
|
+
"invalid-image-data": !0,
|
|
215
|
+
"image-budget-exceeded": !0,
|
|
216
|
+
"component-render-failed": !0,
|
|
217
|
+
"unsupported-text": !0,
|
|
218
|
+
"output-degraded": !0,
|
|
219
|
+
"missing-image": !0,
|
|
220
|
+
"unsupported-component": !0,
|
|
221
|
+
"unsupported-image-format": !0,
|
|
222
|
+
"unsupported-style": !0,
|
|
223
|
+
"rich-text-flattened": !0,
|
|
224
|
+
"nested-components-omitted": !0,
|
|
225
|
+
"async-image-required": !0,
|
|
226
|
+
"image-decode-failed": !0,
|
|
227
|
+
"asset-render-failed": !0,
|
|
228
|
+
"asset-budget-exceeded": !0
|
|
229
|
+
}, j = /* @__PURE__ */ new Set([...Object.keys(Z), "pdf-page", "pdf-font", "pdf-fidelity", "xlsx-fidelity", "xlsx-snapshot", "prepared-layout-preserved", "prepared-font-metrics", "layout"]);
|
|
230
|
+
function z(t) {
|
|
231
|
+
if (t === void 0) return 1 / 0;
|
|
232
|
+
if (!Number.isInteger(t) || t < 0 || t > $) throw new RangeError("diagnosticLimit must be an integer between 0 and 1000");
|
|
233
|
+
return t;
|
|
234
|
+
}
|
|
235
|
+
function Mt(t) {
|
|
236
|
+
const e = z(t), n = [], o = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ Object.create(null);
|
|
237
|
+
let u = 0, f = 0, l = 0;
|
|
238
|
+
function m(d, h) {
|
|
239
|
+
const p = d.length <= 128 && !N.has(d) && (o[d] !== void 0 || l < k || j.has(d)) ? d : O;
|
|
240
|
+
return o[p] === void 0 && l++, o[p] = (o[p] ?? 0) + h, p;
|
|
241
|
+
}
|
|
242
|
+
function x(d, h) {
|
|
243
|
+
const p = `${D(d) ? "e" : "o"}:${h}`;
|
|
244
|
+
if (n.length < e) {
|
|
245
|
+
n.push(d), r.set(p, (r.get(p) ?? 0) + 1);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (!(!e || r.has(p)))
|
|
249
|
+
for (let g = n.length - 1; g >= 0; g--) {
|
|
250
|
+
const s = n[g], a = `${D(s) ? "e" : "o"}:${o[s.code] === void 0 ? O : s.code}`, c = r.get(a) ?? 0;
|
|
251
|
+
if (!(c <= 1)) {
|
|
252
|
+
n[g] = d, r.set(a, c - 1), r.set(p, 1);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function y(d) {
|
|
258
|
+
f++;
|
|
259
|
+
const h = m(d.code, 1);
|
|
260
|
+
D(d) && (u++, i[h] = (i[h] ?? 0) + 1), x(d, h);
|
|
261
|
+
}
|
|
262
|
+
function P(d) {
|
|
263
|
+
f += d.total;
|
|
264
|
+
for (const [h, p] of Object.entries(d.counts)) {
|
|
265
|
+
const g = m(h, p), s = d.explanations?.counts[h] ?? 0;
|
|
266
|
+
s && (u += s, i[g] = (i[g] ?? 0) + s);
|
|
267
|
+
}
|
|
268
|
+
for (const h of d.entries) x(h, o[h.code] === void 0 ? O : h.code);
|
|
269
|
+
}
|
|
270
|
+
function _() {
|
|
271
|
+
return { total: f, counts: { ...o }, entries: n.slice(), omitted: f - n.length, ...u ? { explanations: { total: u, counts: { ...i } } } : {} };
|
|
272
|
+
}
|
|
273
|
+
return { entries: n, push: y, merge: P, snapshot: _, get total() {
|
|
274
|
+
return f;
|
|
275
|
+
} };
|
|
276
|
+
}
|
|
277
|
+
function Ot(t) {
|
|
278
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
279
|
+
const e = t;
|
|
280
|
+
if (!Number.isSafeInteger(e.total) || e.total < 0 || !Number.isSafeInteger(e.omitted) || e.omitted < 0 || !Array.isArray(e.entries) || e.entries.length > $ || e.total !== e.entries.length + e.omitted || !e.counts || typeof e.counts != "object" || Array.isArray(e.counts) || Object.keys(e.counts).some((o) => o.length > 128 || N.has(o))) return !1;
|
|
281
|
+
const n = Object.values(e.counts);
|
|
282
|
+
return n.length > k + j.size + 1 || n.some((o) => !Number.isSafeInteger(o) || o <= 0) || n.reduce((o, r) => o + r, 0) !== e.total ? !1 : Q(e) && J(e);
|
|
283
|
+
}
|
|
284
|
+
function J(t) {
|
|
285
|
+
const e = /* @__PURE__ */ new Map();
|
|
286
|
+
for (const n of t.entries) {
|
|
287
|
+
const o = n && typeof n == "object" && typeof n.code == "string" ? n.code : "unknown", r = Object.prototype.hasOwnProperty.call(t.counts, o) ? o : O, i = !!n && typeof n == "object" && D(n), u = `${i ? "e" : "o"}:${r}`, f = (e.get(u) ?? 0) + 1, l = t.explanations?.counts[r] ?? 0;
|
|
288
|
+
if ((i ? l : (t.counts[r] ?? 0) - l) < f) return !1;
|
|
289
|
+
e.set(u, f);
|
|
290
|
+
}
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
293
|
+
function D(t) {
|
|
294
|
+
return t.valueState !== void 0;
|
|
295
|
+
}
|
|
296
|
+
function Q(t) {
|
|
297
|
+
if (t.explanations === void 0) return !0;
|
|
298
|
+
const e = t.explanations;
|
|
299
|
+
if (!e || typeof e != "object" || Array.isArray(e) || !Number.isSafeInteger(e.total) || e.total < 0 || e.total > t.total || !e.counts || typeof e.counts != "object" || Array.isArray(e.counts)) return !1;
|
|
300
|
+
const n = Object.entries(e.counts);
|
|
301
|
+
return n.every(([o, r]) => Number.isSafeInteger(r) && r > 0 && r <= (t.counts[o] ?? 0)) && n.reduce((o, [, r]) => o + r, 0) === e.total;
|
|
302
|
+
}
|
|
303
|
+
function Dt(t, e) {
|
|
304
|
+
const n = z(t), o = [];
|
|
305
|
+
let r = 0;
|
|
306
|
+
return { entries: o, get total() {
|
|
307
|
+
return r;
|
|
308
|
+
}, push(...i) {
|
|
309
|
+
for (const u of i)
|
|
310
|
+
r++, o.length < n && o.push(u), e?.(u);
|
|
311
|
+
return r;
|
|
312
|
+
} };
|
|
313
|
+
}
|
|
314
|
+
export {
|
|
315
|
+
bt as A,
|
|
316
|
+
wt as B,
|
|
317
|
+
st as C,
|
|
318
|
+
nt as D,
|
|
319
|
+
Tt as E,
|
|
320
|
+
Ot as F,
|
|
321
|
+
q as G,
|
|
322
|
+
W as H,
|
|
323
|
+
yt as I,
|
|
324
|
+
tt as L,
|
|
325
|
+
rt as M,
|
|
326
|
+
ut as P,
|
|
327
|
+
St as R,
|
|
328
|
+
G as S,
|
|
329
|
+
ft as a,
|
|
330
|
+
ht as b,
|
|
331
|
+
dt as c,
|
|
332
|
+
lt as d,
|
|
333
|
+
pt as e,
|
|
334
|
+
xt as f,
|
|
335
|
+
U as g,
|
|
336
|
+
ot as h,
|
|
337
|
+
Et as i,
|
|
338
|
+
et as j,
|
|
339
|
+
B as k,
|
|
340
|
+
it as l,
|
|
341
|
+
mt as m,
|
|
342
|
+
R as n,
|
|
343
|
+
Pt as o,
|
|
344
|
+
K as p,
|
|
345
|
+
at as q,
|
|
346
|
+
gt as r,
|
|
347
|
+
ct as s,
|
|
348
|
+
Dt as t,
|
|
349
|
+
Mt as u,
|
|
350
|
+
_t as v,
|
|
351
|
+
At as w,
|
|
352
|
+
X as x,
|
|
353
|
+
w as y,
|
|
354
|
+
Y as z
|
|
355
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const q='"Microsoft YaHei", sans-serif';const v="#333333",N="#000000",F="1.0.0-mach";function w(t=96){return t/25.4}function Z(t,e=96){return(t||0)*w(e)}function J(t,e=96){return t/w(e)}function k(t,e=96){return t*e/72}function Q(t,e){const n=10**e;return Math.round(t*n)/n}const tt={a3:{widthMm:297,heightMm:420},a4:{widthMm:210,heightMm:297},a5:{widthMm:148,heightMm:210},b4:{widthMm:250,heightMm:353},b5:{widthMm:176,heightMm:250}};function et(t,e=96,n=10.5){if(t?.fontSizePx!=null)return{fontSizePt:t.fontSizePx*72/e,fontSizePx:t.fontSizePx};const o=t?.fontSize??n;return{fontSizePt:o,fontSizePx:k(o,e)}}function nt(t,e=v){return{color:t?.borderColor??t?.lineColor??e,widthPt:t?.lineWidthPt??.75}}function ot(t,e=N){return t?.color??e}function rt(t){return t?.lineHeight??1.35}function st(t){const e=t?.borderTop!==!1,n=t?.borderRight!==!1,o=t?.borderBottom!==!1,r=t?.borderLeft!==!1;return{top:e,right:n,bottom:o,left:r,inner:e||n||o||r}}function it(t,e){const n={...t,...e};return e?.fontSize!=null&&e.fontSizePx==null&&delete n.fontSizePx,e?.fontSizePx!=null&&e.fontSize==null&&delete n.fontSize,n}function ct(t,e){const n=t.length;if(n===0)return[];const o=t.reduce((f,l)=>f+l,0),r=o>0&&e>0?e/o:1,i=[];let u=0;for(let f=0;f<n;f++){const l=Math.max(0,t[f]*r);i.push({pos:u,size:l}),u+=l}return i}function R(t,e,n){return t?.length?ct(t,e):Array.from({length:n},(o,r)=>({pos:e*r/n,size:e/n}))}function at(t,e,n){const o=t.cells??[],r=Math.max(o.length,1),i=t.colWidthsMm?.length??o.reduce((s,c)=>Math.max(s,Array.isArray(c)?c.length:0),1),u=R(t.colWidthsMm,e,i),f=s=>s<=0?0:s>=i?u[u.length-1].pos+u[u.length-1].size:u[s].pos,l=R(t.rowHeightsMm,n,r),m=s=>s<=0?0:s>=r?l[l.length-1].pos+l[l.length-1].size:l[s].pos,_=new Set,b=(s,c)=>`${s}:${c}`,x=[],O=new Set,d=new Set,h=(s,c)=>`v${s}:${c}`,p=(s,c)=>`h${s}:${c}`;o.forEach((s,c)=>{if(!Array.isArray(s))return;let a=0;for(const T of s){for(;a<i&&_.has(b(c,a));)a++;if(a>=i)break;const W=Math.max(1,Math.min(T?.colSpan??1,i-a)),Y=Math.max(1,T?.rowSpan??1),y=Math.min(r,c+Y),P=Math.min(i,a+W);for(let E=c;E<y;E++)for(let S=a;S<P;S++)_.add(b(E,S));for(let E=a+1;E<P;E++)for(let S=c;S<y;S++)O.add(h(E,S));for(let E=c+1;E<y;E++)for(let S=a;S<P;S++)d.add(p(E,S));const C=f(a),L=m(c);x.push({ri:c,ci:a,cell:T??{},xMm:C,yMm:L,widthMm:f(P)-C,heightMm:m(y)-L}),a=P}});const g=[];for(let s=1;s<i;s++){let c=-1;for(let a=0;a<=r;a++){const T=a<r&&!O.has(h(s,a));T&&c<0&&(c=a),!T&&c>=0&&(g.push({kind:"v",pos:f(s),from:m(c),to:m(a)}),c=-1)}}for(let s=1;s<r;s++){let c=-1;for(let a=0;a<=i;a++){const T=a<i&&!d.has(p(s,a));T&&c<0&&(c=a),!T&&c>=0&&(g.push({kind:"h",pos:m(s),from:f(c),to:f(a)}),c=-1)}}return{columns:u,rows:l,cells:x,edges:g}}function ut(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{start:e,end:n,color:o}=t;return typeof e=="number"&&typeof n=="number"&&Number.isFinite(e)&&Number.isFinite(n)&&e>=0&&n<=1&&e<=n&&typeof o=="string"&&/^#[0-9a-f]{6}$/i.test(o)}const ft=F;function lt(t){return(t.kind==="image"||t.kind==="barcode"||t.kind==="qrcode"||t.kind==="chart")&&!!t.imageData}function dt(t){return t.kind==="text"&&Array.isArray(t.richParagraphs)&&t.richParagraphs.length>0}function D(t){return!!t&&typeof t=="object"}function H(t,e,n,o,r){if(++r.nodes>1e6)return{path:e,message:"组件树超过100万个结构节点预算"};if(D(t)){if(n>64)return{path:e,message:"组件嵌套超过64层预算"};if(o.has(t))return{path:e,message:"组件树包含循环引用"};if(!(!D(t.grid)||!Array.isArray(t.grid.cells))){o.add(t);try{for(const[i,u]of t.grid.cells.entries())if(Array.isArray(u))for(const[f,l]of u.entries()){if(++r.nodes>1e6)return{path:e,message:"组件树超过100万个结构节点预算"};if(!(!D(l)||!Array.isArray(l.children)))for(const[m,_]of l.children.entries()){const b=H(_,`${e}.grid.cells.${i}.${f}.children.${m}`,n+1,o,r);if(b)return b}}}finally{o.delete(t)}}}}function $(t,e="$.components",n={nodes:0}){for(const[o,r]of t.entries()){const i=H(r,`${e}.${o}`,0,new Set,n);if(i)return i}}function U(t){const e={nodes:0};for(const[n,o]of t.entries()){if(!D(o)||!Array.isArray(o.components))continue;const r=$(o.components,`$.pages.${n}.components`,e);if(r)return r}}function ht(t){const e=U(t.pages);if(e)throw new TypeError(`${e.path}: ${e.message}`)}function A(t){if(t?.aborted)throw t.reason??new DOMException("The operation was aborted.","AbortError")}function z(t){try{Promise.resolve(t()).catch(()=>{})}catch{}}function B(t,e,n){A(t.signal),z(()=>t.onProgress?.(e,n)),A(t.signal)}function pt(t,e){const n=Promise.resolve(t);return e?.aborted?(n.catch(()=>{}),Promise.reject(e.reason??new DOMException("The operation was aborted.","AbortError"))):e?new Promise((o,r)=>{const i=()=>e.removeEventListener("abort",u),u=()=>{i(),r(e.reason??new DOMException("The operation was aborted.","AbortError"))};e.addEventListener("abort",u,{once:!0}),n.then(f=>{i(),o(f)},f=>{i(),r(f)}),e.aborted&&u()}):n}function mt(t,e){const n=()=>e.abort(t?.reason);return t?.addEventListener("abort",n,{once:!0}),t?.aborted&&n(),()=>t?.removeEventListener("abort",n)}async function gt(t,e,n){B(t,e,n),(t.signal||t.onProgress)&&await new Promise(o=>setTimeout(o,0)),A(t.signal)}function Et(t){let e=0,n=Date.now();return(o=1)=>{if(A(t.signal),e+=o,!(e<4096&&Date.now()-n<8))return e=0,new Promise(r=>setTimeout(r,0)).then(()=>{n=Date.now(),A(t.signal)})}}const St=200,j=1e3,G=128,I="other",V=new Set(["__proto__","prototype","constructor"]),Tt={"invalid-image-data":!0,"image-budget-exceeded":!0,"component-render-failed":!0,"unsupported-text":!0,"output-degraded":!0,"missing-image":!0,"unsupported-component":!0,"unsupported-image-format":!0,"unsupported-style":!0,"rich-text-flattened":!0,"nested-components-omitted":!0,"async-image-required":!0,"image-decode-failed":!0,"asset-render-failed":!0,"asset-budget-exceeded":!0},K=new Set([...Object.keys(Tt),"pdf-page","pdf-font","pdf-fidelity","xlsx-fidelity","xlsx-snapshot","prepared-layout-preserved","prepared-font-metrics","layout"]);function X(t){if(t===void 0)return 1/0;if(!Number.isInteger(t)||t<0||t>j)throw new RangeError("diagnosticLimit must be an integer between 0 and 1000");return t}function _t(t){const e=X(t),n=[],o=Object.create(null),r=new Map,i=Object.create(null);let u=0,f=0,l=0;function m(d,h){const p=d.length<=128&&!V.has(d)&&(o[d]!==void 0||l<G||K.has(d))?d:I;return o[p]===void 0&&l++,o[p]=(o[p]??0)+h,p}function _(d,h){const p=`${M(d)?"e":"o"}:${h}`;if(n.length<e){n.push(d),r.set(p,(r.get(p)??0)+1);return}if(!(!e||r.has(p)))for(let g=n.length-1;g>=0;g--){const s=n[g],c=`${M(s)?"e":"o"}:${o[s.code]===void 0?I:s.code}`,a=r.get(c)??0;if(!(a<=1)){n[g]=d,r.set(c,a-1),r.set(p,1);return}}}function b(d){f++;const h=m(d.code,1);M(d)&&(u++,i[h]=(i[h]??0)+1),_(d,h)}function x(d){f+=d.total;for(const[h,p]of Object.entries(d.counts)){const g=m(h,p),s=d.explanations?.counts[h]??0;s&&(u+=s,i[g]=(i[g]??0)+s)}for(const h of d.entries)_(h,o[h.code]===void 0?I:h.code)}function O(){return{total:f,counts:{...o},entries:n.slice(),omitted:f-n.length,...u?{explanations:{total:u,counts:{...i}}}:{}}}return{entries:n,push:b,merge:x,snapshot:O,get total(){return f}}}function bt(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;if(!Number.isSafeInteger(e.total)||e.total<0||!Number.isSafeInteger(e.omitted)||e.omitted<0||!Array.isArray(e.entries)||e.entries.length>j||e.total!==e.entries.length+e.omitted||!e.counts||typeof e.counts!="object"||Array.isArray(e.counts)||Object.keys(e.counts).some(o=>o.length>128||V.has(o)))return!1;const n=Object.values(e.counts);return n.length>G+K.size+1||n.some(o=>!Number.isSafeInteger(o)||o<=0)||n.reduce((o,r)=>o+r,0)!==e.total?!1:Pt(e)&&At(e)}function At(t){const e=new Map;for(const n of t.entries){const o=n&&typeof n=="object"&&typeof n.code=="string"?n.code:"unknown",r=Object.prototype.hasOwnProperty.call(t.counts,o)?o:I,i=!!n&&typeof n=="object"&&M(n),u=`${i?"e":"o"}:${r}`,f=(e.get(u)??0)+1,l=t.explanations?.counts[r]??0;if((i?l:(t.counts[r]??0)-l)<f)return!1;e.set(u,f)}return!0}function M(t){return t.valueState!==void 0}function Pt(t){if(t.explanations===void 0)return!0;const e=t.explanations;if(!e||typeof e!="object"||Array.isArray(e)||!Number.isSafeInteger(e.total)||e.total<0||e.total>t.total||!e.counts||typeof e.counts!="object"||Array.isArray(e.counts))return!1;const n=Object.entries(e.counts);return n.every(([o,r])=>Number.isSafeInteger(r)&&r>0&&r<=(t.counts[o]??0))&&n.reduce((o,[,r])=>o+r,0)===e.total}function xt(t,e){const n=X(t),o=[];let r=0;return{entries:o,get total(){return r},push(...i){for(const u of i)r++,o.length<n&&o.push(u),e?.(u);return r}}}exports.CSS_DPI=96;exports.DEFAULT_BORDER_PT=.75;exports.DEFAULT_DIAGNOSTIC_LIMIT=St;exports.DEFAULT_FONT_FAMILY=q;exports.DEFAULT_FONT_PT=10.5;exports.DEFAULT_STROKE_COLOR=v;exports.DEFAULT_TEXT_COLOR=N;exports.LINE_HEIGHT=1.35;exports.MM_PER_INCH=25.4;exports.PAPER_SIZES=tt;exports.RENDER_PLAN_SCHEMA_VERSION=ft;exports.SCHEMA_VERSION_MACH=F;exports.assertBoundedRenderTree=ht;exports.assertOutputActive=A;exports.componentTreeIssue=$;exports.createDiagnosticCollector=_t;exports.createDiagnosticMessages=xt;exports.createOutputScheduler=Et;exports.forwardOutputAbort=mt;exports.isImageBackedComponent=lt;exports.isRichText=dt;exports.mergeComponentStyles=it;exports.mmToPx=Z;exports.mmToPxFactor=w;exports.notifyOutputProgress=B;exports.observeOutput=z;exports.outputCheckpoint=gt;exports.ptToPx=k;exports.pxToMm=J;exports.renderTreeIssue=U;exports.resolveBoxBorders=st;exports.resolveFontSize=et;exports.resolveGridLayout=at;exports.resolveLineHeight=rt;exports.resolveStroke=nt;exports.resolveTextColor=ot;exports.round=Q;exports.validDataBar=ut;exports.validDiagnosticSummary=bt;exports.waitForOutput=pt;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as P } from "./template-serialization-CWmHq7lX.js";
|
|
2
|
-
import { d as U } from "./data-bar-
|
|
2
|
+
import { d as U } from "./data-bar-BnGtnJ82.js";
|
|
3
3
|
import { s as B } from "./dom-cell-address-Fn-8nk7D.js";
|
|
4
|
-
import { r as D, i as _, d as F, e as W, l as y, s as b, b as G, a as k, f as X, m as Y, D as J, g as q } from "./
|
|
5
|
-
import { r as H } from "./grid-strokes-
|
|
6
|
-
import { r as Q } from "./capabilities-
|
|
4
|
+
import { r as D, i as _, d as F, e as W, l as y, s as b, b as G, a as k, f as X, m as Y, D as J, g as q } from "./diagnostic-collector-1sqd7DQP.js";
|
|
5
|
+
import { r as H } from "./grid-strokes-BPiV1WHe.js";
|
|
6
|
+
import { r as Q } from "./capabilities-lqDEZSq5.js";
|
|
7
7
|
function Z(e) {
|
|
8
8
|
const t = /\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);
|
|
9
9
|
return t ? {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const z=require("./template-serialization-CqQY4zDg.cjs"),V=require("./data-bar-2NLRzOCQ.cjs"),B=require("./dom-cell-address-DLD1mkTB.cjs"),f=require("./diagnostic-collector-D3rlvxm3.cjs"),D=require("./grid-strokes-DYf-6DMl.cjs"),R=require("./capabilities-CTwlcl8q.cjs");function F(e){const t=/\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);return t?{pageIndex:Number(t[1]),...t[2]===void 0?{}:{componentIndex:Number(t[2])}}:{}}function q(e,t,r){return z.collectTemplateDatasetBindings(e).filter(n=>n.dataset===t).flatMap(n=>n.fields.filter(o=>o.field===r).map(o=>({...o,...F(o.path),dataset:t,kind:/\.computed\[/.test(o.path)?"calculation":/\.columns\[\d+\]\.field$/.test(o.path)?"display":"binding"})))}function j(e,t){const r=e.kind==="list"?e.title||e.dataset:e.binding?.field||e.text||e.nid;return`${e.kind} · ${(r||String(t+1)).replace(/\s+/g," ").slice(0,80)}`}function K(e){const t=z.collectTemplateDatasetBindings(e),r=new Map;for(const o of t)for(const l of o.fields){const a=/^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(l.path)?.[0];if(!a)continue;const s=r.get(a)??[];s.push({...l,dataset:o.dataset}),r.set(a,s)}const n=[];return e.pages.forEach((o,l)=>{const a=`$.template.pages[${l}]`;n.push({path:a,pageIndex:l,kind:"page",depth:0,title:typeof o.meta?.title=="string"?o.meta.title:`${l+1} · ${o.widthMm} × ${o.heightMm} mm`}),o.components.forEach((s,i)=>{const d=`${a}.components[${i}]`,h={pageIndex:l,componentIndex:i};n.push({path:d,...h,depth:1,kind:"component",title:j(s,i)}),s.kind==="list"&&(s.columns.forEach((m,p)=>n.push({path:`${d}.columns[${p}].field`,...h,depth:2,kind:"field",title:`${m.header} · ${m.field}`,field:m.field,dataset:s.dataset})),s.computed?.forEach((m,p)=>n.push({path:`${d}.computed[${p}]`,...h,depth:2,kind:"calculation",title:m.field,field:m.field,dataset:s.dataset})));const c=new Set;for(const m of r.get(d)??[])/\.columns\[\d+\]\.field$/.test(m.path)||c.has(m.path)||(c.add(m.path),n.push({...m,...h,depth:2,kind:"binding",title:m.field}))})}),n}function M(e,t,r){let n=0,o=e.length;for(;n<o;){const l=n+o>>>1;r(e[l])<t?n=l+1:o=l}return n}function L(e){if(![e.leftMm,e.topMm,e.widthMm,e.heightMm].every(Number.isFinite)||e.widthMm<0||e.heightMm<0)throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");return e}function U(e){const t=e.rows.map(()=>[]);for(const r of e.cells){const n=Math.min(t.length,r.ri+(r.cell.rowSpan??1));for(let o=r.ri;o<n;o++)t[o].push(r)}for(const r of t)r.sort((n,o)=>n.xMm-o.xMm);return{cells(r){L(r);const n=new Set,o=r.topMm+r.heightMm,l=r.leftMm+r.widthMm;let a=M(e.rows,r.topMm,s=>s.pos+s.size);for(;a<t.length&&e.rows[a].pos<=o;){const s=t[a++];let i=M(s,r.leftMm,d=>d.xMm+d.widthMm);for(;i<s.length&&s[i].xMm<=l;)n.add(s[i++])}return[...n].sort((s,i)=>s.ri-i.ri||s.ci-i.ci)}}}function _(e){const t=["h","v"].map(r=>e.filter(n=>n.kind===r).sort((n,o)=>n.pos-o.pos));return r=>{const n=[];return t.forEach((o,l)=>{const a=l===0?r.topMm:r.leftMm,s=a+(l===0?r.heightMm:r.widthMm),i=l===0?r.leftMm:r.topMm,d=i+(l===0?r.widthMm:r.heightMm);let h=M(o,a,c=>c.pos);for(;h<o.length&&o[h].pos<=s;){const c=o[h++];c.to>=i&&c.from<=d&&n.push(c)}}),n}}function W(){const e=[];return{mount(t){e.push(ee(t))},update(t,r,n,o){L(t);let l=!1;for(const a of e)l=a.update(t,a.component===r?n:void 0,o)||l;return l}}}function X(e,t){const r=Math.max(8,e.widthMm/4),n=Math.max(8,e.heightMm/4);return{leftMm:e.leftMm-t.leftMm-r,topMm:e.topMm-t.topMm-n,widthMm:e.widthMm+2*r,heightMm:e.heightMm+2*n}}function Y(e,t,r){let n=t.get(r);return n||(n=e.table.ownerDocument.createElement("tr"),n.className=e.rowClass,n.setAttribute("role","row"),n.setAttribute("aria-rowindex",String(r+1)),n.style.cssText="all:unset;display:contents;box-sizing:border-box",t.set(r,n)),n}function J(e,t,r,n){const o=new Set(t),l=new Set(t.map(i=>i.ri)),a=new Map;for(const[i,d]of r)if(!o.has(i)){d.remove(),r.delete(i);const h=e.reuseKey?.(i);if(h!==void 0){const c=a.get(h)??[];c.push(d),a.set(h,c)}}for(const[i,d]of n)l.has(i)||(d.remove(),n.delete(i));for(const i of t){let d=r.get(i);if(!d){const c=e.reuseKey?.(i),m=c===void 0?void 0:a.get(c)?.pop();d=m&&e.reuseCell?.(m,i)?m:e.drawCell(i),d.setAttribute("aria-colindex",String(i.ci+1)),r.set(i,d)}const h=Y(e,n,i.ri);d.parentElement!==h&&h.appendChild(d)}const s=new Map;for(const i of t){const d=s.get(i.ri)??[];d.push(r.get(i)),s.set(i.ri,d)}for(const[i,d]of s)A(n.get(i),d);A(e.body,[...l].sort((i,d)=>i-d).map(i=>n.get(i)))}function A(e,t){let r=e.firstElementChild;for(const n of t)n===r?r=r.nextElementSibling:e.insertBefore(n,r)}function Q(e,t){return e.table?.role==="header"?e.heightMm:t.rows[0]?.size??0}function Z(e,t,r,n){const o=[e],l=n.freezeHeaders&&(r.table?.role==="header"||!r.table),a=Q(r,t);l&&o.push({...e,topMm:0,heightMm:Math.max(0,a-1e-4)});const s=Math.max(0,Math.min(20,Math.floor(n.frozenColumns??0)))||0;if(!s||!t.columns.length)return o;const i=t.columns[Math.min(s,t.columns.length)-1],d={...e,leftMm:0,widthMm:Math.max(0,i.pos+i.size-1e-4)};return o.push(d),l&&o.push({...d,topMm:0,heightMm:Math.max(0,a-1e-4)}),o}function ee(e){const t=f.resolveGridLayout(e.grid,e.component.widthMm,e.component.heightMm),r=new Map(t.cells.map(h=>[`${h.ri}:${h.ci}`,h])),n=U(t),o=new Map,l=new Map,a=_(D.resolveGridStrokes(t,e.component));e.table.setAttribute("aria-rowcount",String(t.rows.length)),e.table.setAttribute("aria-colcount",String(t.columns.length));let s="",i="";function d(h,c){const m=new Set;for(const p of Z(h,t,e.component,c??{}))for(const w of n.cells(p))m.add(w);return[...m]}return{component:e.component,update(h,c,m){const p=X(h,e.component),w=d(p,m),y=c&&r.get(`${c.rowIndex}:${c.columnIndex}`);y&&!w.includes(y)&&w.push(y),w.sort((b,$)=>b.ri-$.ri||b.ci-$.ci);const C=w.map(b=>`${b.ri}:${b.ci}`).join(";"),S=a(p),v=S.map(b=>`${b.kind}:${b.pos}:${b.from}:${b.to}`).join(";"),E=C!==s,T=v!==i;return E&&(s=C,J(e,w,o,l)),T&&(i=v,e.edgeHost.replaceChildren(...e.drawEdges(S))),E||T}}}const G=new WeakMap,te={root:"mr-root",page:"mr-page",comp:"mr-comp",text:"mr-text",lines:"mr-lines",line:"mr-line",rich:"mr-rich",paragraph:"mr-paragraph",segment:"mr-segment",image:"mr-image",shape:"mr-shape",grid:"mr-grid",row:"mr-row",cell:"mr-cell",unknown:"mr-unknown"};function g(e,t){return t?.classNames?.[e]??te[e]}class ne{constructor(){this.props=[]}add(t,r){return r==null||r===!1||r===""?this:(this.props.push([t,String(r)]),this)}mm(t,r,n,o=2){return this.add(t,`${f.round(f.mmToPx(r,n),o)}px`)}toString(){let t="";for(const[r,n]of this.props)t+=`${r}:${n};`;return t}applyTo(t){const r=this.toString();r&&(t.style.cssText=r)}}function u(e,t="unset"){return new ne().add("all",t).add("display",e).add("box-sizing","border-box")}function H(e,t,r){e.add("color",t.color).add("font-family",t.fontFamily).add("font-weight",t.bold!=null?t.bold?"700":"400":void 0).add("font-style",t.italic!=null?t.italic?"italic":"normal":void 0).add("text-decoration",t.underline!=null?t.underline?"underline":"none":void 0).add("letter-spacing",t.letterSpacing!=null?`${t.letterSpacing}pt`:void 0).add("line-height",String(f.resolveLineHeight(t))).add("text-align",t.align);const n=f.resolveFontSize(t,r);e.add("font-size",`${f.round(n.fontSizePx,2)}px`)}function re(e,t,r){const n=t.style??{};H(e,n,r);const o=!t.grid&&(t.kind==="ellipse"||t.kind==="line");e.add("background-color",o?void 0:n.backgroundColor).add("opacity",n.opacity!=null?String(n.opacity):void 0).add("transform",n.rotateDeg?`rotate(${n.rotateDeg}deg)`:void 0)}function P(e,t,r,n,o,l){const a=e.cell,s=l.createElement("td");s.className=g("cell",o),B.setDomCellAddress(s,e.ri,e.ci),s.setAttribute("role",t.table?.role==="header"?"columnheader":"cell"),a.colSpan&&(s.colSpan=a.colSpan),a.rowSpan&&(s.rowSpan=a.rowSpan);const i=f.mergeComponentStyles(t.style,a.style),d=u("block").add("position","absolute").mm("left",e.xMm,n).mm("top",e.yMm,n).mm("width",e.widthMm,n).mm("height",e.heightMm,n).add("background-color",i.backgroundColor).add("vertical-align",i.verticalAlign??"middle");H(d,i,n),d.applyTo(s);const h=V.dataBarBox(a.dataBar,e.widthMm,e.heightMm,r);if(h){const m=l.createElement("div");m.className="mr-cell-data-bar",m.setAttribute("aria-hidden","true"),u("block").add("position","absolute").mm("left",h.x,n).mm("top",h.y,n).mm("width",h.width,n).mm("height",h.height,n).add("background-color",h.color).add("opacity","0.35").add("pointer-events","none").applyTo(m),s.appendChild(m)}const c=l.createElement("div");c.className="mr-cell-content",u("flex").add("position","absolute").mm("left",r+(a.indentMm??0),n).mm("right",r,n).mm("top",r,n).mm("bottom",r,n).add("flex-direction","column").add("justify-content",i.verticalAlign==="top"?"flex-start":i.verticalAlign==="bottom"?"flex-end":"center").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(c),a.richParagraphs?.length?c.appendChild(I({...t,kind:"text",richParagraphs:a.richParagraphs},n,o,l)):a.text!=null&&c.append(a.text);for(const m of a.children??[])c.appendChild(x(m,n,o,l));return s.insertBefore(c,s.firstChild),s}function oe(e,t,r,n){return O(D.resolveGridStrokes(e,t),r,n)}function ie(e){const t=e.cell;if(!(t.children?.length||t.richParagraphs?.length||t.dataBar||(t.colSpan??1)!==1||(t.rowSpan??1)!==1))return JSON.stringify([t.style,t.indentMm])}function le(e,t,r){if(e.style.position!=="absolute"||e.style.zIndex||e.style.transform||e.children.length!==1)return!1;const n=e.firstElementChild;return!(n instanceof HTMLElement)||n.className!=="mr-cell-content"?!1:(B.setDomCellAddress(e,t.ri,t.ci),e.style.left=`${f.round(f.mmToPx(t.xMm,r),2)}px`,e.style.top=`${f.round(f.mmToPx(t.yMm,r),2)}px`,e.style.width=`${f.round(f.mmToPx(t.widthMm,r),2)}px`,e.style.height=`${f.round(f.mmToPx(t.heightMm,r),2)}px`,n.textContent=t.cell.text??"",!0)}function O(e,t,r){return e.map(n=>{const o=`${f.round(n.widthPt*t/72,2)}px solid ${n.color}`,l=r.createElement("div");l.className="mr-grid-edge",l.setAttribute("aria-hidden","true");const a=n.kind==="h";return u("block").add("position","absolute").add("pointer-events","none").mm("left",a?n.from:n.pos,t).mm("top",a?n.pos:n.from,t).mm("width",a?n.to-n.from:0,t).mm("height",a?0:n.to-n.from,t).add(a?"border-top":"border-left",o).applyTo(l),l})}function ae(e,t,r,n,o){const l=o.createElement("table");l.className=g("grid",n),l.setAttribute("role","table"),u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(l);const a=o.createElement("tbody");u("contents").applyTo(a),l.appendChild(a);const s=t.style?.rotateDeg?void 0:G.get(n);if(s){const c=o.createElement("div");u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(c);const m=o.createElement("div");return u("contents").applyTo(m),m.setAttribute("aria-hidden","true"),s.mount({grid:e,component:t,table:l,rowClass:g("row",n),body:a,edgeHost:m,drawCell:p=>P(p,t,e.paddingMm??.5,r,{...n},o),reuseKey:ie,reuseCell:(p,w)=>le(p,w,r),drawEdges:p=>O(p,r,o)}),c.append(l,m),c}const i=f.resolveGridLayout(e,t.widthMm,t.heightMm),d=e.cells.map(()=>{const c=o.createElement("tr");return c.className=g("row",n),c.setAttribute("role","row"),u("contents").applyTo(c),a.appendChild(c),c});for(const c of i.cells)d[c.ri].appendChild(P(c,t,e.paddingMm??.5,r,n,o));const h=o.createElement("div");return u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(h),h.append(l,...oe(i,t,r,o)),h}function se(e,t,r,n){const o=n.createElement("div");o.className=g("paragraph",r),u("block").add("text-align",e.align).add("line-height",e.lineHeight!=null?String(e.lineHeight):void 0).mm("margin-top",e.spaceBeforeMm??0,t).mm("margin-bottom",e.spaceAfterMm??0,t).mm("text-indent",e.indentMm??0,t).applyTo(o);for(const l of e.segments||[]){const a=n.createElement("span");a.className=g("segment",r),a.textContent=l.kind==="field"?l.field??"":l.text??"";const s=u("inline");if(l.style){const i=l.style;s.add("color",i.color).add("background-color",i.backgroundColor).add("font-family",i.fontFamily).add("line-height",i.lineHeight).add("letter-spacing",i.letterSpacing==null?void 0:`${i.letterSpacing*t/72}px`).add("font-weight",i.bold!=null?i.bold?"700":"400":void 0).add("font-style",i.italic!=null?i.italic?"italic":"normal":void 0).add("text-decoration",i.underline!=null?i.underline?"underline":"none":void 0),(i.fontSize!=null||i.fontSizePx!=null)&&s.add("font-size",`${f.round(f.resolveFontSize(i,t).fontSizePx,2)}px`)}s.applyTo(a),o.appendChild(a)}return o}function I(e,t,r,n){if(f.isRichText(e)){const o=n.createElement("div");o.className=g("rich",r),u("block").applyTo(o);for(const l of e.richParagraphs)o.appendChild(se(l,t,r,n));return o}if(Array.isArray(e.lines)&&e.lines.length>0){const o=n.createElement("div");o.className=g("lines",r),u("block").applyTo(o);for(const l of e.lines){const a=n.createElement("div");a.className=g("line",r),a.textContent=l,u("block").add("white-space","pre").add("min-height","1lh").applyTo(a),o.appendChild(a)}return o}return e.text??""}function de(e,t,r,n){const o=n.createElement("div");o.className=g("text",r);const l=e.style||{};return u("flex").add("width","100%").add("height","100%").add("flex-direction","column").add("justify-content",l.verticalAlign==="middle"?"center":l.verticalAlign==="bottom"?"flex-end":"flex-start").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(o),o.append(I(e,t,r,n)),o}function ce(e,t,r){const n=r.createElement("img");return n.className=g("image",t),n.src=e.imageData,u("block").add("width","100%").add("height","100%").add("object-fit","contain").applyTo(n),n.alt=e.kind,n}function N(e,t,r,n){const o=n.createElement("div");o.className=g("shape",r);const l=e.style||{},a=f.resolveStroke(l),s=f.resolveBoxBorders(l),i=`${f.round(a.widthPt*t/72,2)}px solid ${a.color}`,d=u("block");return e.grid?d.add("position","relative"):e.kind==="rect"?(s.top&&d.add("border-top",i),s.right&&d.add("border-right",i),s.bottom&&d.add("border-bottom",i),s.left&&d.add("border-left",i)):e.kind==="ellipse"?(d.add("border-radius","50%"),s.inner&&d.add("border",i),l.backgroundColor&&d.add("background-color",l.backgroundColor)):e.kind==="line"&&d.add("height","0").add("border-top",i),d.add("box-sizing","border-box").add("width","100%").add("height","100%"),d.applyTo(o),o}function he(e,t,r){const n=r.createElementNS("http://www.w3.org/2000/svg","svg"),o=f.mmToPx(e.widthMm,t),l=f.mmToPx(e.heightMm,t);n.setAttribute("width",String(Math.max(1,o))),n.setAttribute("height",String(Math.max(1,l))),n.setAttribute("aria-hidden","true"),n.style.overflow="visible",n.style.display="block";const a=r.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1","0"),a.setAttribute("x2",String(o)),a.setAttribute("y1",e.lineDirection==="up"?String(l):"0"),a.setAttribute("y2",e.lineDirection==="up"?"0":String(l));const s=f.resolveStroke({...e.style,borderColor:e.style?.lineColor??e.style?.borderColor});return a.setAttribute("stroke",s.color),a.setAttribute("stroke-width",String(s.widthPt*t/72)),n.appendChild(a),n}function x(e,t,r,n){const o=n.createElement("div");o.className=`${g("comp",r)} mr-kind-${e.kind}`;const l=u("block").add("position","absolute").mm("left",e.leftMm,t).mm("top",e.topMm,t).mm("width",e.widthMm,t).mm("height",e.heightMm,t).add("box-sizing","border-box");if(re(l,e,t),l.applyTo(o),f.isImageBackedComponent(e))return o.appendChild(ce(e,r,n)),o;if(e.kind==="text")return o.appendChild(de(e,t,r,n)),o;if(e.grid){const s=N(e,t,r,n);return s.appendChild(ae(e.grid,e,t,r,n)),o.appendChild(s),o}if(e.kind==="line"&&e.lineDirection)return o.appendChild(he(e,t,n)),o;if(e.kind==="line"||e.kind==="rect"||e.kind==="ellipse")return o.appendChild(N(e,t,r,n)),o;const a=n.createElement("div");return a.className=g("unknown",r),u("block").applyTo(a),a.textContent=e.fallbackText??`[${e.kind}]`,a.dataset.mrUnsupported=e.kind,a.setAttribute("role","note"),o.appendChild(a),o}function k(e,t,r,n){const o=n.createElement("div");return o.className=g("page",r),u("block","initial").add("position","relative").add("font-family",f.DEFAULT_FONT_FAMILY).add("font-size",`${f.round(f.resolveFontSize(void 0,t).fontSizePx,2)}px`).add("line-height",String(f.resolveLineHeight(void 0))).add("white-space","pre-wrap").add("direction","ltr").mm("width",e.pageWidthMm,t).mm("height",e.pageHeightMm,t).add("background-color","#fff").add("color",f.DEFAULT_TEXT_COLOR).add("overflow","hidden").add("box-sizing","border-box").applyTo(o),e.components.forEach((l,a)=>{const s=x(l,t,r,n);s.dataset.mrComponentIndex=String(a),o.appendChild(s)}),o}function me(e,t,r={}){const n=r.dpi??96;R.reportOutputDiagnostics(e,"dom",r);const o=t.createElement("div");return o.className=g("root",r),u("block").applyTo(o),o.dataset.schemaVersion=e.schemaVersion,e.pages.forEach(l=>{o.appendChild(k(l,n,r,t))}),o}function fe(e,t,r,n){const o={...r},l=W();return G.set(o,l),{element:k(e,t,o,n),update(s,i,d){return l.update(s,i&&e.components[i.componentIndex],i,d)}}}exports.classOf=g;exports.collectTemplateOutline=K;exports.createPageViewportRenderer=fe;exports.inspectTemplateFieldUsage=q;exports.renderComponent=x;exports.renderPage=k;exports.renderPlan=me;exports.templatePathLocation=F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./runtime-
|
|
1
|
+
"use strict";const s=require("./runtime-Cd2UTnwe.cjs"),e=require("./protocol-DD5dHSz-.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;
|
|
@@ -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-BpSAgOw1.js";
|
|
2
|
+
import { i, a as p, r as d, R as a, s as R } from "./protocol-BOri9qJL.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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=new Map;let b=0,d={maxFonts:8,maxBytes:64*1024*1024,maxFontBytes:24*1024*1024};function O(){for(;f.size>d.maxFonts||b>d.maxBytes;){const t=f.keys().next().value;b-=f.get(t).byteLength,f.delete(t)}}function W(t){const e={...d,...t};if(!Object.values(e).every(n=>Number.isSafeInteger(n)&&n>0))throw new Error("字体缓存预算应为正整数字节/数量");d=e;for(const[n,a]of f)a.byteLength>d.maxFontBytes&&B(n);O()}function p(){return{fonts:f.size,bytes:b,...d}}function j(t){const e=f.get(t);return e&&(f.delete(t),f.set(t,e)),e}function B(t){const e=f.get(t);e&&(b-=e.byteLength),f.delete(t)}function q(){f.clear(),b=0}function H(t,e){B(t),!(e.byteLength>d.maxBytes||e.byteLength>d.maxFontBytes)&&(f.set(t,e),b+=e.byteLength,O())}const V="mach-report-fonts",u="fonts";function $(){return new Promise((t,e)=>{const n=indexedDB.open(V,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(u)||n.result.createObjectStore(u)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error)})}function M(t){if(t instanceof Uint8Array)return{bytes:t,accessedAt:0};const e=t;return e?.bytes instanceof Uint8Array&&Number.isFinite(e.accessedAt)?e:void 0}async function C(t,e){if(typeof indexedDB>"u")return t;let n;try{return n=await $(),await e(n)}catch{return t}finally{n?.close()}}function G(t){return C(null,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u),i=o.get(t);let c=null;i.onsuccess=()=>{const s=M(i.result);s&&s.bytes.byteLength<=p().maxFontBytes?(c=s.bytes,o.put({bytes:s.bytes,accessedAt:Date.now()},t)):i.result!==void 0&&o.delete(t)},r.oncomplete=()=>n(c),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}function J(t,e,n,a){const r=p(),o=e.filter(s=>s.key!==n);t.delete(n),a.byteLength<=Math.min(r.maxFontBytes,r.maxBytes)&&o.unshift({key:n,bytes:a.byteLength,accessedAt:Date.now()}),o.sort((s,h)=>h.accessedAt-s.accessedAt);let i=0,c=0;for(const s of o){if(c>=r.maxFonts||i+s.bytes>r.maxBytes||s.bytes>r.maxFontBytes){t.delete(s.key);continue}i+=s.bytes,c++,s.key===n&&t.put({bytes:a,accessedAt:s.accessedAt},n)}}function _(t,e){return C(void 0,n=>new Promise((a,r)=>{const o=n.transaction(u,"readwrite"),i=o.objectStore(u),c=i.openCursor(),s=[];c.onsuccess=()=>{const h=c.result;if(!h){J(i,s,t,e);return}const x=M(h.value);x?s.push({key:h.key,bytes:x.bytes.byteLength,accessedAt:x.accessedAt}):h.delete(),h.continue()},o.oncomplete=()=>a(),o.onerror=()=>r(o.error),o.onabort=()=>r(o.error)}))}function D(t){return C(void 0,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u);t===void 0?o.clear():o.delete(t),r.oncomplete=()=>n(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}let L=0,S=0,v=Promise.resolve();const g=new Map;async function N(t){l.set(t,(l.get(t)??0)+1),B(t),w.delete(t);const e=g.get(t),n=(async()=>{await v,await e,await y.get(t),await D(t)})();g.set(t,n);try{await n}finally{g.get(t)===n&&g.delete(t)}}async function I(){L++,q(),w.clear(),l.clear();const t=v,e=(async()=>{await t,await Promise.all(y.values()),await D()})();v=e.catch(()=>{}),await e}const l=new Map,y=new Map,w=new Map,E=new Set;function k(){!S&&!E.size&&l.clear()}const T=new WeakMap;function K(t){const e=new TextDecoder().decode(t.subarray(0,256));return/^\s*(?:\uFEFF)?\s*<(?:!doctype\s+html|html|head|body)(?:\s|>)/i.test(e)}function R(t){if(t.byteLength===0)throw new Error("字体文件为空");if(K(t))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件")}function Q(t){const e=T.get(t);if(e)return e;const n=(async()=>{const a=String.fromCharCode(...t.subarray(0,4));if(!["\0\0\0","true","OTTO","wOFF","wOF2","ttcf"].includes(a))throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");const{default:r}=await Promise.resolve().then(()=>require("./pdf-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=new Map;let b=0,d={maxFonts:8,maxBytes:64*1024*1024,maxFontBytes:24*1024*1024};function O(){for(;f.size>d.maxFonts||b>d.maxBytes;){const t=f.keys().next().value;b-=f.get(t).byteLength,f.delete(t)}}function W(t){const e={...d,...t};if(!Object.values(e).every(n=>Number.isSafeInteger(n)&&n>0))throw new Error("字体缓存预算应为正整数字节/数量");d=e;for(const[n,a]of f)a.byteLength>d.maxFontBytes&&B(n);O()}function p(){return{fonts:f.size,bytes:b,...d}}function j(t){const e=f.get(t);return e&&(f.delete(t),f.set(t,e)),e}function B(t){const e=f.get(t);e&&(b-=e.byteLength),f.delete(t)}function q(){f.clear(),b=0}function H(t,e){B(t),!(e.byteLength>d.maxBytes||e.byteLength>d.maxFontBytes)&&(f.set(t,e),b+=e.byteLength,O())}const V="mach-report-fonts",u="fonts";function $(){return new Promise((t,e)=>{const n=indexedDB.open(V,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(u)||n.result.createObjectStore(u)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error)})}function M(t){if(t instanceof Uint8Array)return{bytes:t,accessedAt:0};const e=t;return e?.bytes instanceof Uint8Array&&Number.isFinite(e.accessedAt)?e:void 0}async function C(t,e){if(typeof indexedDB>"u")return t;let n;try{return n=await $(),await e(n)}catch{return t}finally{n?.close()}}function G(t){return C(null,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u),i=o.get(t);let c=null;i.onsuccess=()=>{const s=M(i.result);s&&s.bytes.byteLength<=p().maxFontBytes?(c=s.bytes,o.put({bytes:s.bytes,accessedAt:Date.now()},t)):i.result!==void 0&&o.delete(t)},r.oncomplete=()=>n(c),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}function J(t,e,n,a){const r=p(),o=e.filter(s=>s.key!==n);t.delete(n),a.byteLength<=Math.min(r.maxFontBytes,r.maxBytes)&&o.unshift({key:n,bytes:a.byteLength,accessedAt:Date.now()}),o.sort((s,h)=>h.accessedAt-s.accessedAt);let i=0,c=0;for(const s of o){if(c>=r.maxFonts||i+s.bytes>r.maxBytes||s.bytes>r.maxFontBytes){t.delete(s.key);continue}i+=s.bytes,c++,s.key===n&&t.put({bytes:a,accessedAt:s.accessedAt},n)}}function _(t,e){return C(void 0,n=>new Promise((a,r)=>{const o=n.transaction(u,"readwrite"),i=o.objectStore(u),c=i.openCursor(),s=[];c.onsuccess=()=>{const h=c.result;if(!h){J(i,s,t,e);return}const x=M(h.value);x?s.push({key:h.key,bytes:x.bytes.byteLength,accessedAt:x.accessedAt}):h.delete(),h.continue()},o.oncomplete=()=>a(),o.onerror=()=>r(o.error),o.onabort=()=>r(o.error)}))}function D(t){return C(void 0,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u);t===void 0?o.clear():o.delete(t),r.oncomplete=()=>n(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}let L=0,S=0,v=Promise.resolve();const g=new Map;async function N(t){l.set(t,(l.get(t)??0)+1),B(t),w.delete(t);const e=g.get(t),n=(async()=>{await v,await e,await y.get(t),await D(t)})();g.set(t,n);try{await n}finally{g.get(t)===n&&g.delete(t)}}async function I(){L++,q(),w.clear(),l.clear();const t=v,e=(async()=>{await t,await Promise.all(y.values()),await D()})();v=e.catch(()=>{}),await e}const l=new Map,y=new Map,w=new Map,E=new Set;function k(){!S&&!E.size&&l.clear()}const T=new WeakMap;function K(t){const e=new TextDecoder().decode(t.subarray(0,256));return/^\s*(?:\uFEFF)?\s*<(?:!doctype\s+html|html|head|body)(?:\s|>)/i.test(e)}function R(t){if(t.byteLength===0)throw new Error("字体文件为空");if(K(t))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件")}function Q(t){const e=T.get(t);if(e)return e;const n=(async()=>{const a=String.fromCharCode(...t.subarray(0,4));if(!["\0\0\0","true","OTTO","wOFF","wOF2","ttcf"].includes(a))throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");const{default:r}=await Promise.resolve().then(()=>require("./pdf-DWuq6uxx.cjs")).then(i=>i.fontkit_es),o=r.create(t);if(!Number.isFinite(o.unitsPerEm)||o.unitsPerEm<=0||!o.characterSet?.length||!o.numGlyphs)throw new Error("字体结构无效或不含可嵌入的单字体;请提供有效的 TTF/OTF/WOFF 文件")})();return T.set(t,n),n}function A(t,e,n=!1){const a=n?"字体加载超时,请检查网络或字体服务":e instanceof Error?e.message:String(e);return Object.assign(new Error(`PDF 字体 ${JSON.stringify(t)} 加载失败:${a}`),{cause:e})}function P(t,e){if(t>e)throw new Error(`字体文件超过单字体下载预算(${e}字节)`)}async function X(t,e,n){const a=Number(t.headers?.get("content-length"));try{Number.isFinite(a)&&P(a,e)}catch(r){throw t.body?.cancel(r).catch(()=>{}),r}if(!t.body){const r=new Uint8Array(await F(t.arrayBuffer(),n));return P(r.byteLength,e),r}return U(t.body,e,n)}async function U(t,e,n){const a=t.getReader(),r=[];let o=0;try{for(;;){const s=await F(a.read(),n);if(s.done)break;o+=s.value.byteLength,P(o,e),r.push(s.value)}const i=new Uint8Array(o);let c=0;for(const s of r)i.set(s,c),c+=s.byteLength;return i}catch(i){throw a.cancel(i).catch(()=>{}),i}finally{a.releaseLock()}}async function Y(t,e,n){if(t[0]!==31||t[1]!==139)return t;if(typeof DecompressionStream>"u")throw new Error("当前环境不支持 gzip 字体解压,请使用未压缩的字体 URL 或支持 DecompressionStream 的浏览器 / Node 环境");const r=new ReadableStream({start(o){o.enqueue(t),o.close()}}).pipeThrough(new DecompressionStream("gzip"));return U(r,e,n)}async function Z(t){const e=new AbortController;let n=!1;const a=setTimeout(()=>{n=!0,e.abort()},15e3);try{const r=await fetch(t,{signal:e.signal});if(!r.ok)throw new Error(`字体请求返回 HTTP ${r.status}`);if(/text\/html|application\/xhtml\+xml/i.test(r.headers?.get("content-type")??""))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件");const o=p().maxFontBytes,i=await X(r,o,e.signal),c=await Y(i,o,e.signal);return R(c),{bytes:c,fromCache:!1}}catch(r){throw e.abort(),A(t,r,n)}finally{clearTimeout(a)}}async function tt(t){await v,await g.get(t);const e=await G(t);if(e)try{return R(e),{bytes:e,fromCache:!0}}catch{}return Z(t)}function et(t){const e=w.get(t);if(e)return e;const n=tt(t);w.set(t,n),E.add(n);const a=()=>{w.get(t)===n&&w.delete(t),E.delete(n),k()};return n.then(a,a),n}async function nt(t,e,n,a){if((l.get(t)??0)!==n||L!==a)return;H(t,e);const r=y.get(t);if(r){await r;return}const o=_(t,e);y.set(t,o),await o,y.get(t)===o&&y.delete(t)}function m(t){return t.reason??new DOMException("字体加载已取消","AbortError")}function F(t,e){return e?e.aborted?Promise.reject(m(e)):new Promise((n,a)=>{const r=()=>{e.removeEventListener("abort",r),a(m(e))};e.addEventListener("abort",r,{once:!0}),t.then(o=>{e.removeEventListener("abort",r),n(o)},o=>{e.removeEventListener("abort",r),a(o)})}):t}async function rt(t,e,n,a,r){try{return await F(Q(e.bytes),n.signal),e.bytes}catch(o){if(n.signal?.aborted)throw m(n.signal);if((l.get(t)??0)!==a||L!==r)throw A(t,o);if(await N(t),e.fromCache)return await z(t,n);throw A(t,o)}}async function z(t,e={}){if(e.signal?.aborted)throw m(e.signal);const n=l.get(t)??0,a=L,r=j(t);if(r&&!e.strict)return r;const o=r?void 0:et(t);S++;try{const i=r?{bytes:r,fromCache:!0}:await F(o,e.signal),c=e.strict?await rt(t,i,e,n,a):i.bytes;if(e.signal?.aborted)throw m(e.signal);return r||await F(nt(t,c,n,a),e.signal),c}catch(i){if(e.signal?.aborted)throw m(e.signal);if(e.strict)throw i;return null}finally{S--,k()}}exports.clearFontCache=I;exports.configureFontCache=W;exports.getFontCacheStats=p;exports.invalidateFontCache=N;exports.loadFontWithCache=z;
|
|
@@ -139,7 +139,7 @@ function I(t) {
|
|
|
139
139
|
const a = String.fromCharCode(...t.subarray(0, 4));
|
|
140
140
|
if (!["\0\0\0", "true", "OTTO", "wOFF", "wOF2", "ttcf"].includes(a))
|
|
141
141
|
throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");
|
|
142
|
-
const { default: r } = await import("./pdf-
|
|
142
|
+
const { default: r } = await import("./pdf-0_5XiTCx.js").then((i) => i.f), o = r.create(t);
|
|
143
143
|
if (!Number.isFinite(o.unitsPerEm) || o.unitsPerEm <= 0 || !o.characterSet?.length || !o.numGlyphs)
|
|
144
144
|
throw new Error("字体结构无效或不含可嵌入的单字体;请提供有效的 TTF/OTF/WOFF 文件");
|
|
145
145
|
})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as p, d as g, m as k } from "./
|
|
1
|
+
import { e as p, d as g, m as k } from "./diagnostic-collector-1sqd7DQP.js";
|
|
2
2
|
const S = ["borderTop", "borderRight", "borderBottom", "borderLeft", "borderColor", "lineColor", "lineWidthPt"];
|
|
3
3
|
function v(r, o) {
|
|
4
4
|
const s = p(o.style), t = s.inner ? [...r.edges] : [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("./diagnostic-collector-D3rlvxm3.cjs"),w=["borderTop","borderRight","borderBottom","borderLeft","borderColor","lineColor","lineWidthPt"];function k(r,o){const s=h.resolveBoxBorders(o.style),e=s.inner?[...r.edges]:[];s.top&&e.push({kind:"h",pos:0,from:0,to:o.widthMm}),s.bottom&&e.push({kind:"h",pos:o.heightMm,from:0,to:o.widthMm}),s.left&&e.push({kind:"v",pos:0,from:0,to:o.heightMm}),s.right&&e.push({kind:"v",pos:o.widthMm,from:0,to:o.heightMm});const t=h.resolveStroke(o.style);return e.map(n=>({...n,...t}))}function g(r,o,s){const e=r.get(o);(!e||s.widthPt>e.widthPt)&&r.set(o,s)}function d(r,o,s,e,t,n){const l=s<o.rows.length?o.rows[s].pos:o.rows[o.rows.length-1].pos+o.rows[o.rows.length-1].size;for(let i=e;i<t;i++){const c=o.columns[i];g(r,`h:${s}:${i}`,{kind:"h",pos:l,from:c.pos,to:c.pos+c.size,...n})}}function m(r,o,s,e,t,n){const l=s<o.columns.length?o.columns[s].pos:o.columns[o.columns.length-1].pos+o.columns[o.columns.length-1].size;for(let i=e;i<t;i++){const c=o.rows[i];g(r,`v:${s}:${i}`,{kind:"v",pos:l,from:c.pos,to:c.pos+c.size,...n})}}function p(r,o,s,e){const t=Math.min(o.columns.length,s.ci+(s.cell.colSpan??1)),n=Math.min(o.rows.length,s.ri+(s.cell.rowSpan??1)),l=h.mergeComponentStyles(e,s.cell.style),i=h.resolveBoxBorders(l),c=h.resolveStroke(l);i.top&&d(r,o,s.ri,s.ci,t,c),i.bottom&&d(r,o,n,s.ci,t,c),i.left&&m(r,o,s.ci,s.ri,n,c),i.right&&m(r,o,t,s.ri,n,c)}function v(r){const o=[...r.values()].sort((e,t)=>e.kind.localeCompare(t.kind)||e.pos-t.pos||e.from-t.from),s=[];for(const e of o){const t=s[s.length-1];t&&t.kind===e.kind&&t.pos===e.pos&&Math.abs(t.to-e.from)<1e-6&&t.color===e.color&&t.widthPt===e.widthPt?t.to=e.to:s.push({...e})}return s}function S(r,o){if(!r.cells.some(({cell:n})=>w.some(l=>n.style?.[l]!==void 0)))return k(r,o);const s=new Map,e=new Set,t=r.columns.length;for(const n of r.cells){p(s,r,n,o.style);const l=Math.min(r.rows.length,n.ri+(n.cell.rowSpan??1)),i=Math.min(t,n.ci+(n.cell.colSpan??1));for(let c=n.ri;c<l;c++)for(let f=n.ci;f<i;f++)e.add(c*t+f)}for(let n=0;n<r.rows.length;n++)for(let l=0;l<t;l++)e.has(n*t+l)||p(s,r,{ri:n,ci:l,cell:{}},o.style);return v(s)}exports.resolveGridStrokes=S;
|