@agile-team/mach-report 2.23.1 → 2.25.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 +10 -4
- package/dist/{ExcelBindingWizard-BrTmdo7f.cjs → ExcelBindingWizard-BgJG-T6k.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CcDMLO8Q.js → ExcelBindingWizard-NQ_v396s.js} +3 -3
- package/dist/ParamEditor-DEP38mBp.cjs +1 -0
- package/dist/ParamEditor-Z-3yodp5.js +750 -0
- package/dist/{ReportBatchPanel-CHxBtG9R.cjs → ReportBatchPanel-D33LjMrA.cjs} +1 -1
- package/dist/{ReportBatchPanel-CJB67WNd.js → ReportBatchPanel-DG8FV-5X.js} +2 -2
- package/dist/{ReportLabelStudio-Tplc1TLJ.js → ReportLabelStudio-BZp23_hA.js} +68 -68
- package/dist/ReportLabelStudio-Bz-xAayk.cjs +1 -0
- package/dist/ReportParamPanel-B27IGJjk.cjs +1 -0
- package/dist/{ReportParamPanel-GI43aGa0.js → ReportParamPanel-DGXzBzl2.js} +328 -298
- package/dist/ReportPreview-CilFAS9U.js +7170 -0
- package/dist/ReportPreview-dOOzPts2.cjs +6 -0
- package/dist/{ReportTemplateLibrary-KqX4E2sN.js → ReportTemplateLibrary-DpSGgvFa.js} +28 -28
- package/dist/{ReportTemplateLibrary-BFQIX0sg.cjs → ReportTemplateLibrary-uG1gENaW.cjs} +1 -1
- package/dist/{RuleEditor-OPX1awrH.js → RuleEditor-BONALh1Q.js} +846 -835
- package/dist/RuleEditor-bLXiRcxL.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CVYKVLv_.cjs → TemplateOutlinePanel-C3nfHuaR.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DQS-eOs6.js → TemplateOutlinePanel-JGBKeF3e.js} +10 -10
- package/dist/{TemplateReusePanel-CY6O93Zk.cjs → TemplateReusePanel-BKhgp6kg.cjs} +1 -1
- package/dist/{TemplateReusePanel-DKXiFTyB.js → TemplateReusePanel-DXQUO6nQ.js} +2 -2
- package/dist/TemplateReviewPanel-5RWFUUEf.cjs +1 -0
- package/dist/TemplateReviewPanel-DhL7Hapy.js +602 -0
- package/dist/analytics.d.cts +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/artifact-integrity.json +98 -98
- package/dist/assets-BYdpkTIt.cjs +1 -0
- package/dist/assets-C4MIvzQ4.js +137 -0
- package/dist/auto-D-eDZa_V.cjs +1 -0
- package/dist/{auto-BB99S802.js → auto-umW_ozwr.js} +10 -10
- package/dist/capabilities-CN_kSVjO.js +121 -0
- package/dist/capabilities-D4nfhcvB.cjs +1 -0
- package/dist/cell-style-B6Qffrx8.js +37 -0
- package/dist/cell-style-y_uh1pZp.cjs +1 -0
- package/dist/{data-bar-IkI6VvMQ.js → data-bar-Bfh54sT4.js} +1 -1
- package/dist/data-bar-DzceAVeR.cjs +1 -0
- package/dist/designer-CCyj5WYS.js +7595 -0
- package/dist/designer-Cj7fn4Hh.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +143 -10
- package/dist/designer.d.ts +143 -10
- package/dist/designer.js +5 -5
- package/dist/diagnostic-collector-gB07PHy2.js +392 -0
- package/dist/diagnostic-collector-wASg6Fzs.cjs +1 -0
- package/dist/dom-CXWMmwh-.cjs +1 -0
- package/dist/{dom-JWrchIre.js → dom-DxdCMLzs.js} +185 -185
- package/dist/{encoding-CEd-dq9A.js → encoding-CEkBtlUP.js} +2 -2
- package/dist/{encoding-7lquyj0w.cjs → encoding-Cipno7dq.cjs} +1 -1
- package/dist/{font-loader-CNWXomuV.js → font-loader-D4NLIKJL.js} +1 -1
- package/dist/{font-loader-D8pI87fL.cjs → font-loader-p_SyTvqt.cjs} +1 -1
- package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-DkZEZvcI.js} +1 -1
- package/dist/grid-strokes-RFMR91jn.cjs +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +48 -9
- package/dist/index.d.ts +48 -9
- package/dist/index.js +137 -136
- package/dist/json-snapshot-DQdkA_At.cjs +2 -0
- package/dist/{json-snapshot-BRnzKudk.js → json-snapshot-x0JpllWL.js} +919 -791
- package/dist/{pdf-DpMkW72B.cjs → pdf-C060D5UY.cjs} +31 -31
- package/dist/{pdf-CJToa81Z.js → pdf-DU8HelKd.js} +2499 -2492
- 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-BWTp-X7b.cjs → plugin-B_k23hut.cjs} +1 -1
- package/dist/{plugin-_BkUVc2z.js → plugin-CttO46hc.js} +1 -1
- package/dist/{prefill-CWGdnqQd.js → prefill-BkF9Fw_p.js} +13 -13
- package/dist/prefill-BvkuwooY.cjs +1 -0
- package/dist/prepared-CSywIEAZ.cjs +1 -0
- package/dist/prepared-Cyuh61fJ.js +128 -0
- package/dist/protocol-BwbJNVZl.cjs +1 -0
- package/dist/protocol-DwtxjXzO.js +96 -0
- package/dist/record-bindings-B7djSjNs.cjs +1 -0
- package/dist/{record-bindings-DatJZv_e.js → record-bindings-Cv7lFiof.js} +47 -47
- package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-COD8nISZ.cjs} +1 -1
- package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-D8I4QWRh.js} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-Ch_N0Ubu.js} +1 -1
- package/dist/rich-text-layout-yJGuThtC.cjs +3 -0
- package/dist/runtime-BE30icyB.js +227 -0
- package/dist/runtime-DRSuy_SQ.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 +2742 -2417
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +51 -16
- package/dist/server.d.ts +51 -16
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog-DtrtT1FY.cjs → template-catalog-C0riwrx7.cjs} +1 -1
- package/dist/{template-catalog-CRuZL3pi.js → template-catalog-D_gl93va.js} +3 -3
- package/dist/template-fragments-CgzPdFKB.cjs +1 -0
- package/dist/{template-fragments-CPpGpQoz.js → template-fragments-D94ZZmPc.js} +2 -2
- package/dist/template-registry-BMScUmM4.cjs +1 -0
- package/dist/{template-registry-O0hNIOfB.js → template-registry-DZOtRY7t.js} +19 -19
- package/dist/{textwrap-D4ZksyMK.js → textwrap-BywMBMXM.js} +1 -1
- package/dist/textwrap-LhJkHWb1.cjs +4 -0
- package/dist/vue/async.d.cts +101 -22
- package/dist/vue/async.d.ts +101 -22
- package/dist/vue/index.d.cts +133 -34
- package/dist/vue/index.d.ts +133 -34
- 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-C6-SrnCT.cjs → workbook-session-DR2j6Hxm.cjs} +3 -3
- package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-SzfILBJJ.js} +106 -107
- 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/node.d.cts +30 -1
- package/dist/xlsx/node.d.ts +30 -1
- package/dist/xlsx-node.cjs +42 -42
- package/dist/xlsx-node.js +3908 -3889
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +20 -3
- package/dist/xlsx.d.ts +20 -3
- package/dist/xlsx.js +302 -295
- 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-BXzlVbIp.js +0 -29
- package/dist/progress-ByiOxUD3.js +0 -250
- package/dist/progress-DJBd9Rb9.cjs +0 -1
- 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
|
@@ -1,593 +0,0 @@
|
|
|
1
|
-
import { shallowRef as J, ref as C, computed as $, watch as G, onBeforeUnmount as ne, toRaw as oe, defineComponent as le, openBlock as r, createElementBlock as n, toDisplayString as t, createCommentVNode as p, Fragment as R, createElementVNode as l, createVNode as Y, unref as s, normalizeStyle as ue, createTextVNode as T, withDirectives as B, isRef as W, vModelSelect as ie, renderList as I, vModelText as Z, vModelCheckbox as ee, normalizeClass as Q, createBlock as ce } from "vue";
|
|
2
|
-
import { reviewReportTemplateAsync as de, paginateTemplate as me } from "@agile-team/mach-report";
|
|
3
|
-
import { T as X, u as ve } from "./designer-BZoVWTgl.js";
|
|
4
|
-
import { ReportPreview as te } from "@agile-team/mach-report/vue";
|
|
5
|
-
import { b as pe } from "./template-serialization-CWmHq7lX.js";
|
|
6
|
-
import { _ as ae } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
7
|
-
function fe(o, m = () => o.fixtures) {
|
|
8
|
-
const c = J(), u = J([]), i = C("20"), e = C(!1), h = C(!1), v = C(!1), k = C(""), b = J(), d = C(!1), O = J(), D = $(
|
|
9
|
-
() => new Set(
|
|
10
|
-
o.document.template.pages.flatMap((f) => f.components).flatMap(
|
|
11
|
-
(f) => f.kind === "list" && f.tree ? [f.dataset] : []
|
|
12
|
-
)
|
|
13
|
-
)
|
|
14
|
-
), y = $(() => D.value.size > 0);
|
|
15
|
-
let x = 0, _;
|
|
16
|
-
function g() {
|
|
17
|
-
x++, _?.abort(), _ = void 0, h.value = !1, d.value = !1, b.value = void 0, v.value = !!c.value, k.value = "";
|
|
18
|
-
}
|
|
19
|
-
for (const f of [() => o.document, () => o.previous])
|
|
20
|
-
G(
|
|
21
|
-
f,
|
|
22
|
-
() => {
|
|
23
|
-
e.value = !1, g();
|
|
24
|
-
},
|
|
25
|
-
{ deep: !0, flush: "sync" }
|
|
26
|
-
);
|
|
27
|
-
for (const f of [
|
|
28
|
-
() => o.datasets,
|
|
29
|
-
() => o.dataSchemas,
|
|
30
|
-
() => o.formats,
|
|
31
|
-
m
|
|
32
|
-
])
|
|
33
|
-
G(f, g, { deep: !0, flush: "sync" });
|
|
34
|
-
G([i, e], g, { flush: "sync" }), ne(() => {
|
|
35
|
-
x++, _?.abort();
|
|
36
|
-
});
|
|
37
|
-
const N = $(
|
|
38
|
-
() => c.value?.issues.filter((f) => f.severity === "error").length ?? 0
|
|
39
|
-
);
|
|
40
|
-
function q() {
|
|
41
|
-
_?.abort(), _ = new AbortController();
|
|
42
|
-
const f = ++x, M = _;
|
|
43
|
-
h.value = !0, k.value = "", d.value = !1, b.value = void 0, F(f, M);
|
|
44
|
-
}
|
|
45
|
-
async function F(f, M) {
|
|
46
|
-
try {
|
|
47
|
-
const S = Number(i.value), L = Object.fromEntries(
|
|
48
|
-
Object.entries(o.datasets ?? {}).map(([E, U]) => [
|
|
49
|
-
E,
|
|
50
|
-
S < 0 || D.value.has(E) ? U : U.slice(0, S)
|
|
51
|
-
])
|
|
52
|
-
), z = m(), V = z?.length ? [...z] : S === 0 ? [] : [{ name: i.value, datasets: L }], P = await de(o.document, {
|
|
53
|
-
previous: o.previous,
|
|
54
|
-
dataSchemas: o.dataSchemas,
|
|
55
|
-
formats: o.formats,
|
|
56
|
-
allowBreakingChanges: e.value,
|
|
57
|
-
...!z?.length && y.value && S > 0 ? { maxSampleRows: S } : {},
|
|
58
|
-
fixtures: V,
|
|
59
|
-
signal: M.signal,
|
|
60
|
-
onProgress: (E) => {
|
|
61
|
-
f === x && (b.value = E);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
if (f !== x) return;
|
|
65
|
-
c.value = P, v.value = !1, u.value = V, O.value = {
|
|
66
|
-
requested: i.value,
|
|
67
|
-
rows: P.samples.reduce((E, U) => E + U.rows, 0),
|
|
68
|
-
datasets: new Set(
|
|
69
|
-
V.flatMap((E) => Object.keys(E.datasets))
|
|
70
|
-
).size,
|
|
71
|
-
formats: [...o.formats ?? []]
|
|
72
|
-
};
|
|
73
|
-
} catch (S) {
|
|
74
|
-
f === x && !M.signal.aborted && (k.value = S instanceof Error ? S.message : String(S));
|
|
75
|
-
} finally {
|
|
76
|
-
f === x && (h.value = !1, _ = void 0);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function K() {
|
|
80
|
-
x++, _?.abort(), _ = void 0, h.value = !1, d.value = !0, b.value = void 0;
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
report: c,
|
|
84
|
-
sampleSize: i,
|
|
85
|
-
acknowledged: e,
|
|
86
|
-
running: h,
|
|
87
|
-
stale: v,
|
|
88
|
-
failure: k,
|
|
89
|
-
checkedScope: O,
|
|
90
|
-
checkedFixtures: u,
|
|
91
|
-
hasTree: y,
|
|
92
|
-
errors: N,
|
|
93
|
-
run: q,
|
|
94
|
-
cancel: K,
|
|
95
|
-
progress: b,
|
|
96
|
-
cancelled: d
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function he(o) {
|
|
100
|
-
const m = Object.getPrototypeOf(o);
|
|
101
|
-
if (m !== Object.prototype && m !== Array.prototype && m !== null)
|
|
102
|
-
throw new Error("Sample data must contain plain JSON objects");
|
|
103
|
-
if (Object.getOwnPropertySymbols(o).length)
|
|
104
|
-
throw new Error("Sample data must not contain symbols");
|
|
105
|
-
if (Array.isArray(o) && Object.keys(o).length !== o.length)
|
|
106
|
-
throw new Error("Sample arrays must not contain holes or extra properties");
|
|
107
|
-
}
|
|
108
|
-
function we(o) {
|
|
109
|
-
let m = 0, c = 0;
|
|
110
|
-
const u = /* @__PURE__ */ new Set();
|
|
111
|
-
function i(e, h) {
|
|
112
|
-
if (++m > 1e5 || h > 32)
|
|
113
|
-
throw new RangeError("Sample data exceeds the capture budget");
|
|
114
|
-
if (typeof e == "string") {
|
|
115
|
-
if (c += e.length, c > 2e6)
|
|
116
|
-
throw new RangeError("Sample text exceeds the capture budget");
|
|
117
|
-
return e;
|
|
118
|
-
}
|
|
119
|
-
if (e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
120
|
-
if (!e || typeof e != "object")
|
|
121
|
-
throw new Error("Sample data must contain plain JSON values");
|
|
122
|
-
const v = oe(e);
|
|
123
|
-
if (u.has(v))
|
|
124
|
-
throw new Error("Sample data must not contain cycles");
|
|
125
|
-
he(v), u.add(v);
|
|
126
|
-
const k = Array.isArray(v) ? [] : /* @__PURE__ */ Object.create(null);
|
|
127
|
-
for (const b of Object.keys(v)) {
|
|
128
|
-
const d = Object.getOwnPropertyDescriptor(v, b);
|
|
129
|
-
if (d.get || d.set || ["__proto__", "constructor", "prototype"].includes(b))
|
|
130
|
-
throw new Error("Sample data must not contain getters or unsafe keys");
|
|
131
|
-
k[b] = i(
|
|
132
|
-
d.value,
|
|
133
|
-
h + 1
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
return u.delete(v), k;
|
|
137
|
-
}
|
|
138
|
-
return i(o, 0);
|
|
139
|
-
}
|
|
140
|
-
function ge(o, m = () => X) {
|
|
141
|
-
const c = C([]), u = C(""), i = C(!1), e = C(""), h = C({}), v = $(() => [...o.fixtures ?? [], ...c.value]);
|
|
142
|
-
function k() {
|
|
143
|
-
e.value = "";
|
|
144
|
-
try {
|
|
145
|
-
if (!i.value) throw new Error(m().sampleConsentMissing);
|
|
146
|
-
if (!u.value.trim()) throw new Error(m().sampleNameMissing);
|
|
147
|
-
if (v.value.length >= 20) throw new Error(m().sampleLimit);
|
|
148
|
-
if (v.value.some((O) => O.name === u.value.trim()))
|
|
149
|
-
throw new Error(m().sampleNameDuplicate);
|
|
150
|
-
const d = we(o.datasets ?? {});
|
|
151
|
-
if (Object.values(d).reduce((O, D) => O + D.length, 0) > 1e3)
|
|
152
|
-
throw new Error(m().sampleRowsLimit);
|
|
153
|
-
c.value.push({
|
|
154
|
-
name: u.value.trim(),
|
|
155
|
-
datasets: d,
|
|
156
|
-
...Object.keys(h.value).length ? { params: { ...h.value } } : {}
|
|
157
|
-
}), u.value = "", i.value = !1;
|
|
158
|
-
} catch (d) {
|
|
159
|
-
e.value = d instanceof Error ? d.message : String(d);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function b(d) {
|
|
163
|
-
c.value.splice(d, 1);
|
|
164
|
-
}
|
|
165
|
-
return { fixtures: c, name: u, consent: i, failure: e, params: h, suite: v, capture: k, remove: b };
|
|
166
|
-
}
|
|
167
|
-
function se(o, m) {
|
|
168
|
-
const c = me(o.template, m.datasets, {
|
|
169
|
-
maxPages: 100,
|
|
170
|
-
maxCells: 25e4
|
|
171
|
-
}), u = [
|
|
172
|
-
...new Set(
|
|
173
|
-
pe(o.template).flatMap(
|
|
174
|
-
(i) => i.fields.map((e) => `${i.dataset}.${e.field}`)
|
|
175
|
-
)
|
|
176
|
-
)
|
|
177
|
-
];
|
|
178
|
-
return {
|
|
179
|
-
pages: c.plan.pages.length,
|
|
180
|
-
dimensions: [
|
|
181
|
-
...new Set(
|
|
182
|
-
c.plan.pages.map(
|
|
183
|
-
(i) => `${i.pageWidthMm} × ${i.pageHeightMm} mm`
|
|
184
|
-
)
|
|
185
|
-
)
|
|
186
|
-
],
|
|
187
|
-
fields: u,
|
|
188
|
-
fetcher: async () => c.plan
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function ye(o, m, c) {
|
|
192
|
-
const u = se(o, m), i = c ? se(c, m) : void 0, e = new Set(i?.fields), h = new Set(u.fields);
|
|
193
|
-
return {
|
|
194
|
-
current: u,
|
|
195
|
-
previous: i,
|
|
196
|
-
addedFields: u.fields.filter((v) => !e.has(v)),
|
|
197
|
-
removedFields: i?.fields.filter((v) => !h.has(v)) ?? []
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
const be = ["aria-label"], _e = {
|
|
201
|
-
key: 0,
|
|
202
|
-
role: "alert"
|
|
203
|
-
}, ke = { class: "mr-fixture-previews" }, xe = { key: 0 }, Se = /* @__PURE__ */ le({
|
|
204
|
-
__name: "TemplateFixtureComparison",
|
|
205
|
-
props: {
|
|
206
|
-
document: {},
|
|
207
|
-
previous: {},
|
|
208
|
-
fixture: {},
|
|
209
|
-
messages: {}
|
|
210
|
-
},
|
|
211
|
-
setup(o) {
|
|
212
|
-
const m = o, c = $(() => ({ ...X, ...m.messages })), u = $(() => {
|
|
213
|
-
try {
|
|
214
|
-
return {
|
|
215
|
-
result: ye(
|
|
216
|
-
m.document,
|
|
217
|
-
m.fixture,
|
|
218
|
-
m.previous
|
|
219
|
-
)
|
|
220
|
-
};
|
|
221
|
-
} catch (i) {
|
|
222
|
-
return { error: i instanceof Error ? i.message : String(i) };
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
return (i, e) => (r(), n("section", {
|
|
226
|
-
class: "mr-fixture-comparison",
|
|
227
|
-
"aria-label": c.value.compare
|
|
228
|
-
}, [
|
|
229
|
-
u.value.error ? (r(), n("p", _e, t(u.value.error), 1)) : p("", !0),
|
|
230
|
-
u.value.result ? (r(), n(R, { key: 1 }, [
|
|
231
|
-
l("dl", null, [
|
|
232
|
-
l("dt", null, t(c.value.pages), 1),
|
|
233
|
-
l("dd", null, t(u.value.result.previous?.pages ?? "—") + " → " + t(u.value.result.current.pages), 1),
|
|
234
|
-
l("dt", null, t(c.value.dimensions), 1),
|
|
235
|
-
l("dd", null, t(u.value.result.previous?.dimensions.join(" / ") ?? "—") + " → " + t(u.value.result.current.dimensions.join(" / ")), 1),
|
|
236
|
-
l("dt", null, t(c.value.fieldsAdded), 1),
|
|
237
|
-
l("dd", null, t(u.value.result.addedFields.join("、") || "—"), 1),
|
|
238
|
-
l("dt", null, t(c.value.fieldsRemoved), 1),
|
|
239
|
-
l("dd", null, t(u.value.result.removedFields.join("、") || "—"), 1)
|
|
240
|
-
]),
|
|
241
|
-
l("div", ke, [
|
|
242
|
-
u.value.result.previous ? (r(), n("article", xe, [
|
|
243
|
-
l("h4", null, t(c.value.baselinePreview), 1),
|
|
244
|
-
Y(s(te), {
|
|
245
|
-
"report-id": "baseline",
|
|
246
|
-
fetcher: u.value.result.previous.fetcher,
|
|
247
|
-
"show-params": !1,
|
|
248
|
-
"show-export": !1,
|
|
249
|
-
"show-print": !1,
|
|
250
|
-
"show-pdf-window": !1,
|
|
251
|
-
editable: !1,
|
|
252
|
-
"excel-import": !1,
|
|
253
|
-
height: "400px"
|
|
254
|
-
}, null, 8, ["fetcher"])
|
|
255
|
-
])) : p("", !0),
|
|
256
|
-
l("article", null, [
|
|
257
|
-
l("h4", null, t(c.value.draftPreview), 1),
|
|
258
|
-
Y(s(te), {
|
|
259
|
-
"report-id": "draft",
|
|
260
|
-
fetcher: u.value.result.current.fetcher,
|
|
261
|
-
"show-params": !1,
|
|
262
|
-
"show-export": !1,
|
|
263
|
-
"show-print": !1,
|
|
264
|
-
"show-pdf-window": !1,
|
|
265
|
-
editable: !1,
|
|
266
|
-
"excel-import": !1,
|
|
267
|
-
height: "400px"
|
|
268
|
-
}, null, 8, ["fetcher"])
|
|
269
|
-
])
|
|
270
|
-
])
|
|
271
|
-
], 64)) : p("", !0)
|
|
272
|
-
], 8, be));
|
|
273
|
-
}
|
|
274
|
-
}), Ce = /* @__PURE__ */ ae(Se, [["__scopeId", "data-v-6409d556"]]), Ee = ["aria-label", "aria-busy"], je = {
|
|
275
|
-
key: 0,
|
|
276
|
-
role: "status"
|
|
277
|
-
}, Fe = ["disabled"], Oe = {
|
|
278
|
-
key: 0,
|
|
279
|
-
class: "mr-review-stale",
|
|
280
|
-
role: "status"
|
|
281
|
-
}, Te = { class: "mr-review-controls" }, Re = ["aria-label", "disabled"], Ne = { value: "0" }, Me = { value: "20" }, Pe = { value: "100" }, $e = { value: "-1" }, Ve = {
|
|
282
|
-
key: 0,
|
|
283
|
-
class: "mr-review-note"
|
|
284
|
-
}, Ae = { class: "mr-review-fixtures" }, De = { class: "mr-review-note" }, Ue = { key: 0 }, ze = ["disabled", "onClick"], Be = { class: "mr-review-fixture-form" }, Ie = ["placeholder", "disabled"], qe = { key: 0 }, Le = ["onUpdate:modelValue", "placeholder", "disabled"], He = { class: "mr-review-consent" }, Je = ["disabled"], We = ["disabled"], Ge = {
|
|
285
|
-
key: 1,
|
|
286
|
-
role: "alert",
|
|
287
|
-
class: "is-error"
|
|
288
|
-
}, Ke = {
|
|
289
|
-
key: 1,
|
|
290
|
-
class: "mr-review-note"
|
|
291
|
-
}, Qe = {
|
|
292
|
-
key: 2,
|
|
293
|
-
class: "is-error",
|
|
294
|
-
role: "alert"
|
|
295
|
-
}, Xe = {
|
|
296
|
-
key: 3,
|
|
297
|
-
class: "mr-review-stale",
|
|
298
|
-
role: "status"
|
|
299
|
-
}, Ye = {
|
|
300
|
-
key: 4,
|
|
301
|
-
class: "mr-review-note"
|
|
302
|
-
}, Ze = {
|
|
303
|
-
key: 0,
|
|
304
|
-
class: "mr-review-summary",
|
|
305
|
-
role: "status"
|
|
306
|
-
}, et = {
|
|
307
|
-
key: 0,
|
|
308
|
-
class: "mr-review-note"
|
|
309
|
-
}, tt = {
|
|
310
|
-
key: 1,
|
|
311
|
-
class: "mr-review-note"
|
|
312
|
-
}, st = {
|
|
313
|
-
key: 2,
|
|
314
|
-
class: "mr-review-list"
|
|
315
|
-
}, lt = { key: 0 }, at = ["onClick"], rt = {
|
|
316
|
-
key: 3,
|
|
317
|
-
class: "mr-review-note"
|
|
318
|
-
}, nt = {
|
|
319
|
-
key: 4,
|
|
320
|
-
class: "mr-review-ack"
|
|
321
|
-
}, ot = {
|
|
322
|
-
key: 0,
|
|
323
|
-
class: "mr-review-note"
|
|
324
|
-
}, ut = {
|
|
325
|
-
key: 1,
|
|
326
|
-
class: "mr-review-list"
|
|
327
|
-
}, it = ["onClick"], ct = {
|
|
328
|
-
key: 0,
|
|
329
|
-
class: "mr-review-scope"
|
|
330
|
-
}, dt = { key: 0 }, mt = ["disabled", "onClick"], vt = { class: "mr-review-note" }, pt = /* @__PURE__ */ le({
|
|
331
|
-
__name: "TemplateReviewPanel",
|
|
332
|
-
props: {
|
|
333
|
-
document: {},
|
|
334
|
-
previous: {},
|
|
335
|
-
datasets: {},
|
|
336
|
-
dataSchemas: {},
|
|
337
|
-
formats: {},
|
|
338
|
-
fixtures: {},
|
|
339
|
-
messages: {}
|
|
340
|
-
},
|
|
341
|
-
emits: ["locate"],
|
|
342
|
-
setup(o, { emit: m }) {
|
|
343
|
-
const c = ve(), u = o, i = m, e = $(() => ({ ...X, ...u.messages })), {
|
|
344
|
-
name: h,
|
|
345
|
-
consent: v,
|
|
346
|
-
failure: k,
|
|
347
|
-
params: b,
|
|
348
|
-
suite: d,
|
|
349
|
-
capture: O,
|
|
350
|
-
remove: D
|
|
351
|
-
} = ge(u, () => e.value), {
|
|
352
|
-
report: y,
|
|
353
|
-
sampleSize: x,
|
|
354
|
-
acknowledged: _,
|
|
355
|
-
running: g,
|
|
356
|
-
stale: N,
|
|
357
|
-
failure: q,
|
|
358
|
-
checkedScope: F,
|
|
359
|
-
checkedFixtures: K,
|
|
360
|
-
hasTree: f,
|
|
361
|
-
errors: M,
|
|
362
|
-
run: S,
|
|
363
|
-
cancel: L,
|
|
364
|
-
cancelled: z,
|
|
365
|
-
progress: V
|
|
366
|
-
} = fe(u, () => d.value), P = C(), E = $(
|
|
367
|
-
() => K.value.find((A) => A.name === P.value)
|
|
368
|
-
);
|
|
369
|
-
G(N, (A) => {
|
|
370
|
-
A && (P.value = void 0);
|
|
371
|
-
});
|
|
372
|
-
function U(A) {
|
|
373
|
-
const w = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(A);
|
|
374
|
-
i("locate", {
|
|
375
|
-
path: A,
|
|
376
|
-
...w ? { pageIndex: Number(w[1]), componentIndex: Number(w[2]) } : {}
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
return (A, w) => (r(), n("section", {
|
|
380
|
-
class: "mr-template-review",
|
|
381
|
-
style: ue(s(c)),
|
|
382
|
-
"aria-label": e.value.title,
|
|
383
|
-
"aria-busy": s(g)
|
|
384
|
-
}, [
|
|
385
|
-
l("header", null, [
|
|
386
|
-
l("strong", null, t(e.value.title), 1),
|
|
387
|
-
s(g) && s(V) ? (r(), n("span", je, t(s(V).completed) + " / " + t(s(V).total) + " " + t(e.value.progress), 1)) : p("", !0),
|
|
388
|
-
s(g) ? (r(), n("button", {
|
|
389
|
-
key: 1,
|
|
390
|
-
type: "button",
|
|
391
|
-
onClick: w[0] || (w[0] = //@ts-ignore
|
|
392
|
-
(...a) => s(L) && s(L)(...a))
|
|
393
|
-
}, t(e.value.cancel), 1)) : p("", !0),
|
|
394
|
-
l("button", {
|
|
395
|
-
type: "button",
|
|
396
|
-
disabled: s(g),
|
|
397
|
-
onClick: w[1] || (w[1] = //@ts-ignore
|
|
398
|
-
(...a) => s(S) && s(S)(...a))
|
|
399
|
-
}, t(s(g) ? e.value.running : e.value.run), 9, Fe)
|
|
400
|
-
]),
|
|
401
|
-
s(z) ? (r(), n("p", Oe, t(e.value.cancelled), 1)) : p("", !0),
|
|
402
|
-
l("div", Te, [
|
|
403
|
-
l("label", null, [
|
|
404
|
-
T(t(e.value.samples), 1),
|
|
405
|
-
B(l("select", {
|
|
406
|
-
"onUpdate:modelValue": w[2] || (w[2] = (a) => W(x) ? x.value = a : null),
|
|
407
|
-
"aria-label": e.value.samples,
|
|
408
|
-
disabled: s(g) || !!s(d).length
|
|
409
|
-
}, [
|
|
410
|
-
l("option", Ne, t(e.value.none), 1),
|
|
411
|
-
l("option", Me, t(e.value.first20), 1),
|
|
412
|
-
l("option", Pe, t(e.value.first100), 1),
|
|
413
|
-
l("option", $e, t(e.value.all), 1)
|
|
414
|
-
], 8, Re), [
|
|
415
|
-
[ie, s(x)]
|
|
416
|
-
])
|
|
417
|
-
]),
|
|
418
|
-
s(d).length ? (r(), n("span", Ve, t(e.value.namedFixtures) + " · " + t(s(d).length), 1)) : p("", !0)
|
|
419
|
-
]),
|
|
420
|
-
l("details", Ae, [
|
|
421
|
-
l("summary", null, [
|
|
422
|
-
T(t(e.value.namedFixtures) + " ", 1),
|
|
423
|
-
l("small", null, t(s(d).length) + " / 20", 1)
|
|
424
|
-
]),
|
|
425
|
-
l("p", De, t(e.value.fixtureHint), 1),
|
|
426
|
-
s(d).length ? (r(), n("ul", Ue, [
|
|
427
|
-
(r(!0), n(R, null, I(s(d), (a, j) => (r(), n("li", {
|
|
428
|
-
key: a.name
|
|
429
|
-
}, [
|
|
430
|
-
l("strong", null, t(a.name), 1),
|
|
431
|
-
l("span", null, t(Object.values(a.datasets).reduce(
|
|
432
|
-
(H, re) => H + re.length,
|
|
433
|
-
0
|
|
434
|
-
)) + " " + t(e.value.rows), 1),
|
|
435
|
-
j >= (o.fixtures?.length ?? 0) ? (r(), n("button", {
|
|
436
|
-
key: 0,
|
|
437
|
-
type: "button",
|
|
438
|
-
disabled: s(g),
|
|
439
|
-
onClick: (H) => s(D)(j - (o.fixtures?.length ?? 0))
|
|
440
|
-
}, t(e.value.remove), 9, ze)) : p("", !0)
|
|
441
|
-
]))), 128))
|
|
442
|
-
])) : p("", !0),
|
|
443
|
-
l("div", Be, [
|
|
444
|
-
l("label", null, [
|
|
445
|
-
T(t(e.value.fixtureName), 1),
|
|
446
|
-
B(l("input", {
|
|
447
|
-
"onUpdate:modelValue": w[3] || (w[3] = (a) => W(h) ? h.value = a : null),
|
|
448
|
-
placeholder: e.value.fixturePlaceholder,
|
|
449
|
-
disabled: s(g)
|
|
450
|
-
}, null, 8, Ie), [
|
|
451
|
-
[Z, s(h)]
|
|
452
|
-
])
|
|
453
|
-
]),
|
|
454
|
-
o.document.template.params?.length ? (r(), n("details", qe, [
|
|
455
|
-
l("summary", null, t(e.value.parameters), 1),
|
|
456
|
-
(r(!0), n(R, null, I(o.document.template.params, (a) => (r(), n("label", {
|
|
457
|
-
key: a.field
|
|
458
|
-
}, [
|
|
459
|
-
T(t(a.label ?? a.field), 1),
|
|
460
|
-
B(l("input", {
|
|
461
|
-
"onUpdate:modelValue": (j) => s(b)[a.field] = j,
|
|
462
|
-
placeholder: a.defaultValue,
|
|
463
|
-
disabled: s(g)
|
|
464
|
-
}, null, 8, Le), [
|
|
465
|
-
[Z, s(b)[a.field]]
|
|
466
|
-
])
|
|
467
|
-
]))), 128))
|
|
468
|
-
])) : p("", !0),
|
|
469
|
-
l("label", He, [
|
|
470
|
-
B(l("input", {
|
|
471
|
-
"onUpdate:modelValue": w[4] || (w[4] = (a) => W(v) ? v.value = a : null),
|
|
472
|
-
type: "checkbox",
|
|
473
|
-
disabled: s(g)
|
|
474
|
-
}, null, 8, Je), [
|
|
475
|
-
[ee, s(v)]
|
|
476
|
-
]),
|
|
477
|
-
T(t(e.value.deidentified), 1)
|
|
478
|
-
]),
|
|
479
|
-
l("button", {
|
|
480
|
-
type: "button",
|
|
481
|
-
disabled: s(g) || !s(v) || !s(h).trim() || s(d).length >= 20,
|
|
482
|
-
onClick: w[5] || (w[5] = //@ts-ignore
|
|
483
|
-
(...a) => s(O) && s(O)(...a))
|
|
484
|
-
}, t(e.value.capture), 9, We),
|
|
485
|
-
s(k) ? (r(), n("p", Ge, t(s(k)), 1)) : p("", !0)
|
|
486
|
-
])
|
|
487
|
-
]),
|
|
488
|
-
s(f) ? (r(), n("p", Ke, t(e.value.treeHint), 1)) : p("", !0),
|
|
489
|
-
s(q) ? (r(), n("p", Qe, t(s(q)), 1)) : p("", !0),
|
|
490
|
-
s(N) ? (r(), n("p", Xe, t(e.value.stale), 1)) : p("", !0),
|
|
491
|
-
s(y) ? (r(), n(R, { key: 5 }, [
|
|
492
|
-
s(N) ? p("", !0) : (r(), n("div", Ze, [
|
|
493
|
-
l("span", {
|
|
494
|
-
class: Q({ "is-error": s(M) })
|
|
495
|
-
}, t(s(M)) + " " + t(e.value.errors), 3),
|
|
496
|
-
l("span", null, t(s(y).issues.length - s(M)) + " " + t(e.value.warnings), 1)
|
|
497
|
-
])),
|
|
498
|
-
l("section", null, [
|
|
499
|
-
l("h3", null, [
|
|
500
|
-
T(t(e.value.changes) + " ", 1),
|
|
501
|
-
l("small", null, t(s(y).changes?.totalChanges ?? 0), 1)
|
|
502
|
-
]),
|
|
503
|
-
o.previous ? s(y).changes?.totalChanges ? (r(), n("ol", st, [
|
|
504
|
-
(r(!0), n(R, null, I(s(y).changes?.changes, (a, j) => (r(), n("li", { key: j }, [
|
|
505
|
-
l("div", null, [
|
|
506
|
-
l("span", null, t(e.value.categories[a.category]) + " · " + t(e.value.kinds[a.kind]), 1),
|
|
507
|
-
a.breaking ? (r(), n("b", lt, t(e.value.breaking), 1)) : p("", !0),
|
|
508
|
-
l("button", {
|
|
509
|
-
type: "button",
|
|
510
|
-
onClick: (H) => U(a.path)
|
|
511
|
-
}, t(e.value.locate), 9, at)
|
|
512
|
-
]),
|
|
513
|
-
l("code", null, t(a.path), 1),
|
|
514
|
-
l("dl", null, [
|
|
515
|
-
a.before !== void 0 ? (r(), n(R, { key: 0 }, [
|
|
516
|
-
l("dt", null, t(e.value.before), 1),
|
|
517
|
-
l("dd", null, t(a.before), 1)
|
|
518
|
-
], 64)) : p("", !0),
|
|
519
|
-
a.after !== void 0 ? (r(), n(R, { key: 1 }, [
|
|
520
|
-
l("dt", null, t(e.value.after), 1),
|
|
521
|
-
l("dd", null, t(a.after), 1)
|
|
522
|
-
], 64)) : p("", !0)
|
|
523
|
-
])
|
|
524
|
-
]))), 128))
|
|
525
|
-
])) : (r(), n("p", tt, t(e.value.noChanges), 1)) : (r(), n("p", et, t(e.value.baseline), 1)),
|
|
526
|
-
s(y).changes?.truncated ? (r(), n("p", rt, t(e.value.truncated), 1)) : p("", !0),
|
|
527
|
-
s(y).changes?.breakingChanges ? (r(), n("label", nt, [
|
|
528
|
-
B(l("input", {
|
|
529
|
-
"onUpdate:modelValue": w[6] || (w[6] = (a) => W(_) ? _.value = a : null),
|
|
530
|
-
type: "checkbox"
|
|
531
|
-
}, null, 512), [
|
|
532
|
-
[ee, s(_)]
|
|
533
|
-
]),
|
|
534
|
-
T(t(e.value.acknowledge), 1)
|
|
535
|
-
])) : p("", !0)
|
|
536
|
-
]),
|
|
537
|
-
l("section", null, [
|
|
538
|
-
l("h3", null, t(e.value.issues), 1),
|
|
539
|
-
s(y).issues.length ? (r(), n("ol", ut, [
|
|
540
|
-
(r(!0), n(R, null, I(s(y).issues, (a, j) => (r(), n("li", { key: j }, [
|
|
541
|
-
l("div", null, [
|
|
542
|
-
l("span", {
|
|
543
|
-
class: Q({ "is-error": a.severity === "error" })
|
|
544
|
-
}, t(a.severity === "error" ? e.value.errors : e.value.warnings), 3),
|
|
545
|
-
l("button", {
|
|
546
|
-
type: "button",
|
|
547
|
-
onClick: (H) => i("locate", a)
|
|
548
|
-
}, t(e.value.locate), 9, it)
|
|
549
|
-
]),
|
|
550
|
-
l("p", null, t(a.message), 1),
|
|
551
|
-
l("code", null, t(a.path), 1)
|
|
552
|
-
]))), 128))
|
|
553
|
-
])) : (r(), n("p", ot, t(e.value.noIssues), 1))
|
|
554
|
-
]),
|
|
555
|
-
s(y).samples.length ? (r(), n("section", {
|
|
556
|
-
key: 1,
|
|
557
|
-
class: Q({ "is-stale": s(N) })
|
|
558
|
-
}, [
|
|
559
|
-
l("h3", null, t(e.value.results), 1),
|
|
560
|
-
s(F) ? (r(), n("p", ct, [
|
|
561
|
-
T(t(e.value.scope) + " · " + t(s(d).length ? e.value.namedFixtures : s(F).requested === "-1" ? e.value.all : s(F).requested === "0" ? e.value.none : s(F).requested + " " + e.value.rows) + " · " + t(s(F).datasets) + " " + t(e.value.datasets) + " · " + t(s(F).rows) + " " + t(e.value.rows), 1),
|
|
562
|
-
s(F).formats.length ? (r(), n("span", dt, " · " + t(s(F).formats.join(" / ")), 1)) : p("", !0)
|
|
563
|
-
])) : p("", !0),
|
|
564
|
-
(r(!0), n(R, null, I(s(y).samples, (a) => (r(), n("div", {
|
|
565
|
-
key: a.name,
|
|
566
|
-
class: "mr-review-sample"
|
|
567
|
-
}, [
|
|
568
|
-
l("p", null, [
|
|
569
|
-
l("strong", null, t(a.name), 1),
|
|
570
|
-
T(" · " + t(a.rows) + " " + t(e.value.rows) + " · " + t(a.pages) + " " + t(e.value.pages) + " · " + t(s(y).issues.filter((j) => j.fixture === a.name).length) + " " + t(e.value.issues), 1)
|
|
571
|
-
]),
|
|
572
|
-
l("button", {
|
|
573
|
-
type: "button",
|
|
574
|
-
disabled: s(N) || s(g),
|
|
575
|
-
onClick: (j) => P.value = P.value === a.name ? void 0 : a.name
|
|
576
|
-
}, t(P.value === a.name ? e.value.closeCompare : e.value.compare), 9, mt)
|
|
577
|
-
]))), 128))
|
|
578
|
-
], 2)) : p("", !0),
|
|
579
|
-
E.value && !s(N) ? (r(), ce(Ce, {
|
|
580
|
-
key: 2,
|
|
581
|
-
document: o.document,
|
|
582
|
-
previous: o.previous,
|
|
583
|
-
fixture: E.value,
|
|
584
|
-
messages: o.messages
|
|
585
|
-
}, null, 8, ["document", "previous", "fixture", "messages"])) : p("", !0),
|
|
586
|
-
l("p", vt, t(e.value.checked), 1)
|
|
587
|
-
], 64)) : (r(), n("p", Ye, t(e.value.empty), 1))
|
|
588
|
-
], 12, Ee));
|
|
589
|
-
}
|
|
590
|
-
}), _t = /* @__PURE__ */ ae(pt, [["__scopeId", "data-v-87b76c26"]]);
|
|
591
|
-
export {
|
|
592
|
-
_t as default
|
|
593
|
-
};
|
package/dist/assets-D2gHc4Mz.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./progress-WomPRP3B.cjs"),w=require("./capabilities-DiBj4Qgl.cjs"),y=require("./media-B7vnpD8k.cjs");class b extends Error{constructor(t,r){super(t.message),this.name="OutputAssetError",this.diagnostic=t,this.cause=r}}function p(e){if(e.aborted)throw e.reason??new DOMException("The operation was aborted.","AbortError")}function I(e){const t={maxAssets:1e3,maxImageBytes:33554432,maxTotalImageBytes:134217728,maxDurationMs:3e4,...e.assetBudget};for(const[r,a]of Object.entries(t))if(!Number.isSafeInteger(a)||a<=0||a>2147483647)throw new RangeError(`${r} must be a positive safe integer at most 2147483647.`);return t}function v(e){const t=/^data:image\/[a-z0-9.+-]+(;base64)?,(.*)$/is.exec(e);if(!t)throw new TypeError("Asset renderers must return an image data URL.");return t[1]?Math.ceil(t[2].length*3/4):new TextEncoder().encode(decodeURIComponent(t[2])).byteLength}function l(e,t,r,a,i){const n={code:r,message:a,severity:"warning",format:e.options.format??"dom",pageIndex:t.pageIndex,componentIndex:t.componentIndex,componentPath:t.componentPath,kind:t.component.kind,nid:t.component.nid};if(e.diagnostics.push(n),w.notifyOutputDiagnostic(n,{...e.options,signal:e.signal}),e.options.assetFailure!=="placeholder")throw new b(n,i)}async function E(e,t,r){const a=e.options.assetRegistry?.rendererFor(t)??e.options.assetRenderers?.[t.kind];if(t.imageData||!a)return t.imageData;if(++e.rendered>e.budget.maxAssets)return l(e,r,"asset-budget-exceeded","Output exceeded the asset count budget.");let i;try{if(e.active=r,i=await h.waitForOutput(a({...r,signal:e.signal}),e.signal),p(e.signal),i.length>e.budget.maxImageBytes*4+1024)return l(e,r,"asset-budget-exceeded","Output exceeded the image payload byte budget.");const n=v(i);if(n>e.budget.maxImageBytes||e.bytes+n>e.budget.maxTotalImageBytes)return l(e,r,"asset-budget-exceeded","Output exceeded the encoded image byte budget.");/^data:image\/(png|jpe?g);base64,/i.test(i)&&e.inspectImage(i),e.bytes+=n}catch(n){if(e.signal.aborted||n instanceof b||n instanceof y.ImageMediaError&&n.code==="image-budget-exceeded")throw n;return l(e,r,"asset-render-failed",`Asset renderer failed for ${t.kind}; output was not silently omitted.`,n)}return i}function A(e,t){const r=e.active;if(!r){t.abort(new Error("Asset rendering exceeded maxDurationMs."));return}const a={code:"asset-budget-exceeded",message:"Asset rendering exceeded maxDurationMs.",severity:"warning",format:e.options.format??"dom",pageIndex:r.pageIndex,componentIndex:r.componentIndex,componentPath:r.componentPath,kind:r.component.kind,nid:r.component.nid};e.diagnostics.push(a);try{w.notifyOutputDiagnostic(a,{...e.options,signal:e.signal})}catch(i){t.abort(i);return}t.abort(new b(a))}async function O(e,t,r,a,i){if(!t?.children?.length)return t;const n=[];for(const[s,c]of t.children.entries())n.push(await x(e,c,{...r,component:c,componentPath:[...a,s]},i));return n.some((s,c)=>s!==t.children[c])?{...t,children:n}:t}async function x(e,t,r,a){if(p(e.signal),a.has(t))throw new TypeError("Cyclic grid children cannot be rendered.");let i=e.cache.get(t);i||(i=E(e,t,r),e.cache.set(t,i));const n=await i;p(e.signal);let s=t.grid;if(s){const c=new Set(a).add(t),d=[];for(const[u,o]of s.cells.entries()){if(!o.some(m=>m?.children?.length)){d.push(o);continue}const f=[];for(const[m,g]of o.entries())f.push(g?.children?.length?await O(e,g,r,[...r.componentPath,u,m],c):g);d.push(f.some((m,g)=>m!==o[g])?f:o)}d.some((u,o)=>u!==s.cells[o])&&(s={...s,cells:d})}return n!==t.imageData||s!==t.grid?{...t,imageData:n,grid:s}:t}function D(e,t,r){const a=new Set,i=n=>{if(h.assertOutputActive(r),!a.has(n)){if(a.add(n),n.imageData&&/^data:image\/(png|jpe?g);base64,/i.test(n.imageData))try{t(n.imageData)}catch(s){if(!(s instanceof y.ImageMediaError)||s.code==="image-budget-exceeded")throw s}for(const s of n.grid?.cells??[])for(const c of s)for(const d of c?.children??[])i(d)}};for(const n of e.pages)for(const s of n.components)i(s)}function M(e){if(e.options.fidelity==="strict"&&e.diagnostics.length)throw new w.OutputFidelityError(e.diagnostics)}async function T(e,t={}){h.assertOutputActive(t.signal),h.assertBoundedRenderTree(e);const r=I(t),a=y.createImageMediaInspector(t);if(D(e,a,t.signal),t.signal?.aborted)throw t.signal.reason??new DOMException("The operation was aborted.","AbortError");const i=new AbortController,n=()=>i.abort(t.signal?.reason);if(t.signal?.addEventListener("abort",n,{once:!0}),!t.assetRegistry&&(!t.assetRenderers||!Object.keys(t.assetRenderers).length))return t.signal?.removeEventListener("abort",n),{plan:e,diagnostics:[]};const s={options:t,signal:i.signal,diagnostics:[],rendered:0,bytes:0,budget:r,cache:new WeakMap,inspectImage:a},c=setTimeout(()=>A(s,i),r.maxDurationMs);try{const d=[];for(const[u,o]of e.pages.entries()){if(u<(t.start??0)||u>(t.end??e.pages.length-1)){d.push(o);continue}const f=[];for(const[m,g]of o.components.entries())f.push(await x(s,g,{component:g,pageIndex:u,componentIndex:m,componentPath:[]},new Set));d.push(f.some((m,g)=>m!==o.components[g])?{...o,components:f}:o)}return p(s.signal),M(s),{plan:d.some((u,o)=>u!==e.pages[o])?{...e,pages:d}:e,diagnostics:s.diagnostics}}finally{clearTimeout(c),t.signal?.removeEventListener("abort",n)}}exports.OutputAssetError=b;exports.resolvePlanAssets=T;
|