@agile-team/mach-report 2.4.0 → 2.4.1

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.
@@ -1,15 +1,15 @@
1
- import { computed as F, unref as E, ref as A, onScopeDispose as Re, getCurrentScope as en, watch as _, shallowRef as ye, defineComponent as ct, nextTick as tn, openBlock as k, createElementBlock as M, createElementVNode as S, toDisplayString as R, Fragment as Fe, createCommentVNode as j, normalizeClass as de, renderList as ze, createTextVNode as st, withKeys as Ct, inject as He, provide as It, useCssVars as nn, watchEffect as kt, onMounted as rn, onUnmounted as an, normalizeStyle as ce, createBlock as on, createVNode as ln, renderSlot as sn } from "vue";
2
- import { renderPlanToImages as un, renderPage as St, getReportCellContext as Mt, createReportCellEdit as cn, applyReportCellEdit as dn, ReportCellEditError as Dt, paginateTemplate as fn, validateRenderPlan as Ft, ReportSourceError as pn, renderPlanToCanvas as mn } from "@agile-team/mach-report";
3
- import { c as Ot } from "./page-window-index-CIuT4BAv.js";
4
- import { i as vn, b as gn } from "./render-plan-CXBWRog4.js";
5
- import { b as it, c as hn, d as bn, a as wn } from "./plugin-DRnvIbdP.js";
6
- function Bt(e) {
1
+ import { computed as F, unref as E, ref as A, onScopeDispose as Te, getCurrentScope as tn, watch as _, shallowRef as xe, defineComponent as dt, nextTick as nn, openBlock as C, createElementBlock as M, createElementVNode as S, toDisplayString as R, Fragment as Re, createCommentVNode as j, normalizeClass as de, renderList as Ne, createTextVNode as it, withKeys as Ct, inject as He, provide as St, useCssVars as rn, watchEffect as Mt, onMounted as an, onUnmounted as on, normalizeStyle as ce, createBlock as ln, createVNode as sn, renderSlot as un } from "vue";
2
+ import { renderPlanToImages as cn, renderPage as Ot, getReportCellContext as Ft, createReportCellEdit as dn, applyReportCellEdit as fn, ReportCellEditError as Dt, paginateTemplate as pn, validateRenderPlan as Rt, ReportSourceError as mn, renderPlanToCanvas as vn } from "@agile-team/mach-report";
3
+ import { c as Bt } from "./page-window-index-CIuT4BAv.js";
4
+ import { i as gn, b as hn } from "./render-plan-CXBWRog4.js";
5
+ import { b as ut, c as bn, d as wn, a as yn } from "./plugin-CKnSVuVe.js";
6
+ function Wt(e) {
7
7
  return e == null ? [] : Array.isArray(e) ? e.map(String).filter((t) => t !== "") : String(e).split(",").map((t) => t.trim()).filter((t) => t !== "");
8
8
  }
9
9
  function Yr(e) {
10
- return Bt(e).join(",");
10
+ return Wt(e).join(",");
11
11
  }
12
- class at extends Error {
12
+ class ot extends Error {
13
13
  constructor(t) {
14
14
  super(t), this.name = "PlanLoadError";
15
15
  }
@@ -19,12 +19,12 @@ function Zr(e = {}) {
19
19
  return async ({ url: l, method: c, params: m, signal: b }) => {
20
20
  let f = `${a}${l}`;
21
21
  if (m && Object.keys(m).length > 0) {
22
- const w = f.indexOf("#"), I = w >= 0 ? f.slice(w) : "", P = w >= 0 ? f.slice(0, w) : f, O = P.indexOf("?"), C = O >= 0 ? P.slice(0, O) : P, D = new URLSearchParams(O >= 0 ? P.slice(O + 1) : "");
23
- for (const [H, K] of Object.entries(m)) D.set(H, K);
24
- f = `${C}?${D}${I}`;
22
+ const w = f.indexOf("#"), I = w >= 0 ? f.slice(w) : "", P = w >= 0 ? f.slice(0, w) : f, D = P.indexOf("?"), k = D >= 0 ? P.slice(0, D) : P, O = new URLSearchParams(D >= 0 ? P.slice(D + 1) : "");
23
+ for (const [N, K] of Object.entries(m)) O.set(N, K);
24
+ f = `${k}?${O}${I}`;
25
25
  }
26
26
  const p = (w, I) => {
27
- const P = new at(w);
27
+ const P = new ot(w);
28
28
  return Object.defineProperty(P, "cause", { value: I, configurable: !0, writable: !0 }), P;
29
29
  };
30
30
  if (b?.aborted)
@@ -46,19 +46,19 @@ function Zr(e = {}) {
46
46
  signal: h.signal
47
47
  });
48
48
  if (!w.ok)
49
- throw new at(`HTTP ${w.status} ${l}`);
49
+ throw new ot(`HTTP ${w.status} ${l}`);
50
50
  return await w.json();
51
51
  } catch (w) {
52
- throw i === "timeout" ? p(`请求超时(${n}ms): ${l}`, w) : i === "external" ? p(`请求已取消: ${l}`, w) : w instanceof at ? w : p(`请求失败(${l}): ${w instanceof Error ? w.message : String(w)}`, w);
52
+ throw i === "timeout" ? p(`请求超时(${n}ms): ${l}`, w) : i === "external" ? p(`请求已取消: ${l}`, w) : w instanceof ot ? w : p(`请求失败(${l}): ${w instanceof Error ? w.message : String(w)}`, w);
53
53
  } finally {
54
54
  clearTimeout($), b?.removeEventListener("abort", x);
55
55
  }
56
56
  };
57
57
  }
58
- function yn(e, t, o = {}) {
58
+ function xn(e, t, o = {}) {
59
59
  const r = o.pxPerMm ?? 3.7795275590551185, n = F(() => Math.max(0, E(o.gapPx) ?? 18)), a = A(0), l = A(800), c = F(() => {
60
60
  const w = e.value?.pages ?? [];
61
- return Ot(w.map((I) => I.pageHeightMm * r), n.value);
61
+ return Bt(w.map((I) => I.pageHeightMm * r), n.value);
62
62
  }), m = F(() => {
63
63
  let w = 0;
64
64
  for (const I of e.value?.pages ?? []) w = Math.max(w, I.pageWidthMm * r);
@@ -71,7 +71,7 @@ function yn(e, t, o = {}) {
71
71
  const w = e.value;
72
72
  if (!w) return [];
73
73
  const { start: I, end: P } = b.value;
74
- return w.pages.slice(I, P + 1).map((O, C) => ({ page: O, index: I + C }));
74
+ return w.pages.slice(I, P + 1).map((D, k) => ({ page: D, index: I + k }));
75
75
  });
76
76
  let p = 0, h = !1;
77
77
  function i(w) {
@@ -81,15 +81,15 @@ function yn(e, t, o = {}) {
81
81
  return (P) => {
82
82
  p || h || (p = requestAnimationFrame(() => {
83
83
  if (p = 0, h || (i(P), I.value <= 0)) return;
84
- const O = Math.max(0, P.scrollTop + 32) / t.value;
85
- w.value = Math.min(I.value, c.value.pageAt(O) + 1);
84
+ const D = Math.max(0, P.scrollTop + 32) / t.value;
85
+ w.value = Math.min(I.value, c.value.pageAt(D) + 1);
86
86
  }));
87
87
  };
88
88
  }
89
89
  function $() {
90
90
  h = !0, p && cancelAnimationFrame(p), p = 0;
91
91
  }
92
- return Re($), {
92
+ return Te($), {
93
93
  contentSize: m,
94
94
  windowRange: b,
95
95
  visiblePages: f,
@@ -99,7 +99,7 @@ function yn(e, t, o = {}) {
99
99
  destroy: $
100
100
  };
101
101
  }
102
- function xn(e) {
102
+ function Pn(e) {
103
103
  const t = A(1), o = A("fit");
104
104
  let r = 0;
105
105
  function n() {
@@ -120,64 +120,64 @@ function xn(e) {
120
120
  n(), o.value = "raw", t.value = Math.min(3, Math.max(0.3, c / 100));
121
121
  }
122
122
  }
123
- return en() && Re(n), { zoom: t, zoomMode: o, applyFitZoom: a, setZoom: l };
123
+ return tn() && Te(n), { zoom: t, zoomMode: o, applyFitZoom: a, setZoom: l };
124
124
  }
125
- const Ne = 8;
126
- function je() {
125
+ const je = 8;
126
+ function qe() {
127
127
  return new Promise((e) => setTimeout(e, 0));
128
128
  }
129
- function Ae(e) {
129
+ function Le(e) {
130
130
  return `p${e.pageWidthMm}x${e.pageHeightMm}`.replace(/[.+]/g, "_");
131
131
  }
132
- function dt(e) {
132
+ function ft(e) {
133
133
  const t = /* @__PURE__ */ new Map();
134
134
  return e.pages.forEach((n) => {
135
- t.has(Ae(n)) || t.set(Ae(n), n);
135
+ t.has(Le(n)) || t.set(Le(n), n);
136
136
  }), `<!doctype html><html><head><meta charset="utf-8"><style>${`.mr-page{margin:0 auto;page-break-after:always;}
137
137
  .mr-page tr{break-inside:avoid;page-break-inside:avoid;}
138
138
  .mr-comp{break-inside:avoid;page-break-inside:avoid;}
139
139
  ${[...t.values()].map(
140
- (n) => `@page ${Ae(n)}{size:${n.pageWidthMm}mm ${n.pageHeightMm}mm;margin:0;}`
140
+ (n) => `@page ${Le(n)}{size:${n.pageWidthMm}mm ${n.pageHeightMm}mm;margin:0;}`
141
141
  ).join(`
142
142
  `)}
143
143
  body{margin:0;background:#fff;}`}</style></head><body>`;
144
144
  }
145
- function ft(e) {
146
- const t = St(e, 96, {}, document);
147
- return t.style.page = Ae(e), t.outerHTML;
145
+ function pt(e) {
146
+ const t = Ot(e, 96, {}, document);
147
+ return t.style.page = Le(e), t.outerHTML;
148
148
  }
149
- function Wt(e) {
150
- return { head: dt(e), pageChunks: e.pages.map(ft) };
149
+ function At(e) {
150
+ return { head: ft(e), pageChunks: e.pages.map(pt) };
151
151
  }
152
- async function Jr(e, t = {}) {
152
+ async function Gr(e, t = {}) {
153
153
  const o = {
154
154
  schemaVersion: "mach-report-batch-print",
155
155
  pages: e.flatMap((l) => l.pages)
156
156
  };
157
157
  if (o.pages.length === 0) return;
158
- const r = dt(o), n = document.createElement("iframe");
158
+ const r = ft(o), n = document.createElement("iframe");
159
159
  n.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;", document.body.appendChild(n);
160
160
  let a = !1;
161
161
  try {
162
162
  const l = n.contentDocument;
163
163
  l.open(), l.write(r);
164
164
  for (let c = 0; c < o.pages.length; c++)
165
- l.write(ft(o.pages[c])), c % Ne === Ne - 1 && (t.onProgress?.(c + 1, o.pages.length), await je());
166
- l.write("</body></html>"), l.close(), await je(), t.onProgress?.(o.pages.length, o.pages.length), a = !0, n.contentWindow?.focus(), n.contentWindow?.print();
165
+ l.write(pt(o.pages[c])), c % je === je - 1 && (t.onProgress?.(c + 1, o.pages.length), await qe());
166
+ l.write("</body></html>"), l.close(), await qe(), t.onProgress?.(o.pages.length, o.pages.length), a = !0, n.contentWindow?.focus(), n.contentWindow?.print();
167
167
  } catch (l) {
168
168
  t.onError?.(l instanceof Error ? `批量打印失败: ${l.message}` : "批量打印失败");
169
169
  } finally {
170
170
  a ? setTimeout(() => n.remove(), 6e4) : n.remove();
171
171
  }
172
172
  }
173
- function Pn(e) {
174
- const { head: t, pageChunks: o } = Wt(e);
173
+ function En(e) {
174
+ const { head: t, pageChunks: o } = At(e);
175
175
  return {
176
176
  html: `${`<!doctype html><html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="utf-8"><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:Zoom>100</w:Zoom></w:WordDocument></xml><![endif]-->${t.replace(/^<!doctype html><html><head>/, "")}`}${o.join("")}</body></html>`,
177
177
  filename: "mach-report.doc"
178
178
  };
179
179
  }
180
- function En(e, t) {
180
+ function $n(e, t) {
181
181
  let o = null, r = !1, n = !1, a = 0;
182
182
  const l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
183
183
  let m = null, b = null, f = null, p = null, h = null;
@@ -201,16 +201,16 @@ function En(e, t) {
201
201
  i(d.plan, d.epoch) || (u.close(), c.delete(u));
202
202
  }
203
203
  function P() {
204
- a++, C(), x(), I();
204
+ a++, k(), x(), I();
205
205
  }
206
- const O = _(e, P, { flush: "sync" });
207
- function C() {
206
+ const D = _(e, P, { flush: "sync" });
207
+ function k() {
208
208
  o?.remove(), o = null;
209
209
  }
210
- function D() {
211
- n = !0, a++, O(), C(), I(), l.clear(), t.onPrinting?.(!1);
210
+ function O() {
211
+ n = !0, a++, D(), k(), I(), l.clear(), t.onPrinting?.(!1);
212
212
  }
213
- function H(u, d) {
213
+ function N(u, d) {
214
214
  const y = URL.createObjectURL(u);
215
215
  setTimeout(() => URL.revokeObjectURL(y), 1e4);
216
216
  const T = document.createElement("a");
@@ -221,19 +221,19 @@ function En(e, t) {
221
221
  const u = e.value;
222
222
  if (n || !u || u.pages.length === 0) return;
223
223
  const d = a;
224
- r = !0, t.onPrinting?.(!0), C();
225
- const y = dt(u);
224
+ r = !0, t.onPrinting?.(!0), k();
225
+ const y = ft(u);
226
226
  o = document.createElement("iframe"), o.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;", document.body.appendChild(o);
227
227
  const T = o;
228
228
  try {
229
229
  const B = T.contentDocument;
230
230
  B.open(), B.write(y);
231
231
  for (let V = 0; V < u.pages.length; V++)
232
- if (B.write(ft(u.pages[V])), V % Ne === Ne - 1 && await je(), T !== o) return;
233
- if (B.write("</body></html>"), B.close(), await je(), !i(u, d) || T !== o) return;
232
+ if (B.write(pt(u.pages[V])), V % je === je - 1 && await qe(), T !== o) return;
233
+ if (B.write("</body></html>"), B.close(), await qe(), !i(u, d) || T !== o) return;
234
234
  T.contentWindow?.focus(), T.contentWindow?.print();
235
235
  } catch {
236
- T === o && C(), i(u, d) && t.onError("调用打印失败,请改用导出 PDF", "print");
236
+ T === o && k(), i(u, d) && t.onError("调用打印失败,请改用导出 PDF", "print");
237
237
  } finally {
238
238
  r = !1, n || t.onPrinting?.(!1);
239
239
  }
@@ -259,7 +259,7 @@ function En(e, t) {
259
259
  try {
260
260
  const B = await X(u, d);
261
261
  if (!i(u, d)) return;
262
- H(new Blob([B], { type: "application/pdf" }), "mach-report.pdf");
262
+ N(new Blob([B], { type: "application/pdf" }), "mach-report.pdf");
263
263
  } catch (B) {
264
264
  i(u, d) && t.onError(B instanceof Error ? `PDF 导出失败: ${B.message}` : "PDF 导出失败", "pdf");
265
265
  } finally {
@@ -268,7 +268,7 @@ function En(e, t) {
268
268
  })();
269
269
  return f = { plan: u, epoch: d, promise: T, token: y }, T;
270
270
  }
271
- async function Y() {
271
+ async function J() {
272
272
  const u = e.value;
273
273
  if (n || !u || u.pages.length === 0) return;
274
274
  const d = a;
@@ -279,7 +279,7 @@ function En(e, t) {
279
279
  if (!i(u, d)) return;
280
280
  const { buffer: ee, warnings: oe } = await V(u, y);
281
281
  if (!i(u, d) || (oe.length > 0 && t.onWarning?.(`Excel 导出有 ${oe.length} 条提示:${oe.slice(0, 2).join(";")}`), !i(u, d))) return;
282
- H(new Blob([ee], {
282
+ N(new Blob([ee], {
283
283
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
284
284
  }), "mach-report.xlsx");
285
285
  } catch (V) {
@@ -297,12 +297,12 @@ function En(e, t) {
297
297
  if (h?.plan === u && h.epoch === d) return h.promise;
298
298
  const y = $(u, d, "图片"), T = (async () => {
299
299
  try {
300
- const { blobs: B } = await un(u, {
300
+ const { blobs: B } = await cn(u, {
301
301
  dpr: Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1)
302
302
  });
303
303
  if (!i(u, d)) return;
304
304
  B.forEach((V, ee) => {
305
- H(V, B.length > 1 ? `mach-report-page-${ee + 1}.png` : "mach-report.png");
305
+ N(V, B.length > 1 ? `mach-report-page-${ee + 1}.png` : "mach-report.png");
306
306
  });
307
307
  } catch (B) {
308
308
  i(u, d) && t.onError(
@@ -319,8 +319,8 @@ function En(e, t) {
319
319
  const u = e.value;
320
320
  if (!(n || !u || u.pages.length === 0))
321
321
  try {
322
- const { html: d, filename: y } = Pn(u);
323
- H(new Blob([d], { type: "application/msword;charset=utf-8" }), y);
322
+ const { html: d, filename: y } = En(u);
323
+ N(new Blob([d], { type: "application/msword;charset=utf-8" }), y);
324
324
  } catch (d) {
325
325
  t.onError(
326
326
  d instanceof Error ? `Word 导出失败: ${d.message}` : "Word 导出失败",
@@ -336,7 +336,7 @@ function En(e, t) {
336
336
  return;
337
337
  }
338
338
  if (u === "xlsx" || u === "excel") {
339
- await Y();
339
+ await J();
340
340
  return;
341
341
  }
342
342
  if (u === "png" || u === "image") {
@@ -352,14 +352,14 @@ function En(e, t) {
352
352
  return;
353
353
  }
354
354
  try {
355
- const { head: y, pageChunks: T } = Wt(d), B = `${y}${T.join("")}</body></html>`;
356
- H(new Blob([B], { type: "text/html;charset=utf-8" }), "mach-report.html");
355
+ const { head: y, pageChunks: T } = At(d), B = `${y}${T.join("")}</body></html>`;
356
+ N(new Blob([B], { type: "text/html;charset=utf-8" }), "mach-report.html");
357
357
  } catch (y) {
358
358
  t.onError(y instanceof Error ? `HTML 导出失败: ${y.message}` : "HTML 导出失败", "export");
359
359
  }
360
360
  }
361
361
  }
362
- function J() {
362
+ function Z() {
363
363
  const u = e.value;
364
364
  if (n || !u || u.pages.length === 0) return;
365
365
  const d = a, y = window.open("", "_blank");
@@ -389,15 +389,15 @@ function En(e, t) {
389
389
  exportAs: me,
390
390
  exportImages: se,
391
391
  exportWord: U,
392
- openPdfWindow: J,
392
+ openPdfWindow: Z,
393
393
  invalidatePending: P,
394
- releasePrintFrame: C,
395
- dispose: D
394
+ releasePrintFrame: k,
395
+ dispose: O
396
396
  };
397
397
  }
398
- const At = "mrp-hit";
399
- function $n(e) {
400
- e.querySelectorAll(`mark.${At}`).forEach((o) => {
398
+ const Lt = "mrp-hit";
399
+ function kn(e) {
400
+ e.querySelectorAll(`mark.${Lt}`).forEach((o) => {
401
401
  const r = o.parentNode;
402
402
  if (r) {
403
403
  for (; o.firstChild; ) r.insertBefore(o.firstChild, o);
@@ -424,26 +424,26 @@ function Cn(e, t) {
424
424
  for (; i >= 0; ) {
425
425
  i > h && p.appendChild(document.createTextNode(m.slice(h, i)));
426
426
  const x = document.createElement("mark");
427
- x.className = At, x.textContent = m.slice(i, i + o.length), p.appendChild(x), l++, h = i + o.length, i = b.indexOf(r, h);
427
+ x.className = Lt, x.textContent = m.slice(i, i + o.length), p.appendChild(x), l++, h = i + o.length, i = b.indexOf(r, h);
428
428
  }
429
429
  h < m.length && p.appendChild(document.createTextNode(m.slice(h))), f.replaceChild(p, c);
430
430
  }
431
431
  return l;
432
432
  }
433
- const kn = /* @__PURE__ */ new Set(["line", "rect", "ellipse", "chart"]);
434
- function* Mn(e) {
433
+ const Mn = /* @__PURE__ */ new Set(["line", "rect", "ellipse", "chart"]);
434
+ function* Fn(e) {
435
435
  for (const t of e.cells ?? [])
436
436
  for (const o of t ?? [])
437
437
  yield o?.text ?? "", yield* o?.children ?? [];
438
438
  }
439
- function* Fn(e) {
440
- if (gn(e))
439
+ function* Rn(e) {
440
+ if (hn(e))
441
441
  for (const t of e.richParagraphs)
442
442
  for (const o of t.segments ?? [])
443
443
  yield (o.kind === "field" ? o.field : o.text) ?? "";
444
444
  else e.lines?.length ? yield* e.lines : yield e.text ?? "";
445
445
  }
446
- function* Rn(e) {
446
+ function* Tn(e) {
447
447
  const t = [e.values()];
448
448
  for (; t.length > 0; ) {
449
449
  const o = t[t.length - 1].next();
@@ -456,61 +456,61 @@ function* Rn(e) {
456
456
  yield r;
457
457
  continue;
458
458
  }
459
- yield "", !vn(r) && (r.kind === "text" ? t.push(Fn(r)) : r.grid ? t.push(Mn(r.grid)) : kn.has(r.kind) || (yield r.fallbackText ?? ""));
459
+ yield "", !gn(r) && (r.kind === "text" ? t.push(Rn(r)) : r.grid ? t.push(Fn(r.grid)) : Mn.has(r.kind) || (yield r.fallbackText ?? ""));
460
460
  }
461
461
  }
462
- function* Tn(e) {
462
+ function* In(e) {
463
463
  for (let t = 0; t < e.pages.length; t++) {
464
- for (const o of Rn(e.pages[t].components)) yield { text: o, pageIndex: t };
464
+ for (const o of Tn(e.pages[t].components)) yield { text: o, pageIndex: t };
465
465
  yield { text: "", pageIndex: t };
466
466
  }
467
467
  }
468
- function In(e, t) {
468
+ function Sn(e, t) {
469
469
  const o = e.toLowerCase();
470
470
  let r = 0;
471
471
  for (let n = o.indexOf(t); n >= 0; n = o.indexOf(t, n + t.length)) r++;
472
472
  return r;
473
473
  }
474
- function Sn(e) {
474
+ function On(e) {
475
475
  const { plan: t, gotoPage: o, highlight: r, clearHighlights: n } = e, a = A(!1), l = A(""), c = A(0), m = A(0), b = A(!1);
476
476
  let f = [];
477
477
  const p = F(() => {
478
478
  if (m.value === 0) return null;
479
- const C = c.value;
480
- let D = 0, H = f.length - 1;
481
- for (; D < H; ) {
482
- const X = D + H >>> 1;
483
- f[X].cumulative <= C ? D = X + 1 : H = X;
479
+ const k = c.value;
480
+ let O = 0, N = f.length - 1;
481
+ for (; O < N; ) {
482
+ const X = O + N >>> 1;
483
+ f[X].cumulative <= k ? O = X + 1 : N = X;
484
484
  }
485
- const K = f[D];
486
- return K ? { pageIndex: K.pageIndex, occurrence: C - (f[D - 1]?.cumulative ?? 0) } : null;
485
+ const K = f[O];
486
+ return K ? { pageIndex: K.pageIndex, occurrence: k - (f[O - 1]?.cumulative ?? 0) } : null;
487
487
  });
488
488
  let h = null, i = null, x = 0;
489
489
  function $() {
490
490
  x++, h && clearTimeout(h), i && clearTimeout(i), h = i = null, b.value = !1;
491
491
  }
492
- function w(C) {
493
- l.value = C, c.value = 0, m.value = 0, f = [], b.value = !1;
494
- const D = C.trim().toLowerCase(), H = t.value;
495
- if (!D || !H) return;
492
+ function w(k) {
493
+ l.value = k, c.value = 0, m.value = 0, f = [], b.value = !1;
494
+ const O = k.trim().toLowerCase(), N = t.value;
495
+ if (!O || !N) return;
496
496
  b.value = !0;
497
- const K = x, X = Tn(H), Q = [];
498
- let Y = 0;
497
+ const K = x, X = In(N), Q = [];
498
+ let J = 0;
499
499
  function se() {
500
- if (i = null, K !== x || H !== t.value) return;
500
+ if (i = null, K !== x || N !== t.value) return;
501
501
  const U = performance.now();
502
502
  let me = 0;
503
503
  for (; me < 5e3 && performance.now() - U < 4; ) {
504
- const J = X.next();
505
- if (J.done) {
506
- f = Q, m.value = Y, b.value = !1, f[0] && o(f[0].pageIndex + 1);
504
+ const Z = X.next();
505
+ if (Z.done) {
506
+ f = Q, m.value = J, b.value = !1, f[0] && o(f[0].pageIndex + 1);
507
507
  return;
508
508
  }
509
- const u = In(J.value.text, D);
509
+ const u = Sn(Z.value.text, O);
510
510
  if (u > 0) {
511
- Y += u;
511
+ J += u;
512
512
  const d = Q[Q.length - 1];
513
- d?.pageIndex === J.value.pageIndex ? d.cumulative = Y : Q.push({ pageIndex: J.value.pageIndex, cumulative: Y });
513
+ d?.pageIndex === Z.value.pageIndex ? d.cumulative = J : Q.push({ pageIndex: Z.value.pageIndex, cumulative: J });
514
514
  }
515
515
  me++;
516
516
  }
@@ -518,26 +518,26 @@ function Sn(e) {
518
518
  }
519
519
  se();
520
520
  }
521
- function I(C) {
522
- if ($(), l.value = C, c.value = m.value = 0, f = [], !C.trim()) {
521
+ function I(k) {
522
+ if ($(), l.value = k, c.value = m.value = 0, f = [], !k.trim()) {
523
523
  w("");
524
524
  return;
525
525
  }
526
526
  b.value = !0, h = setTimeout(() => {
527
- h = null, w(C);
527
+ h = null, w(k);
528
528
  }, Math.max(0, E(e.debounceMs) ?? 200));
529
529
  }
530
- function P(C) {
531
- const D = m.value;
532
- if (D === 0 || b.value) return;
533
- c.value = (c.value + C + D) % D;
534
- const H = p.value;
535
- H && o(H.pageIndex + 1);
530
+ function P(k) {
531
+ const O = m.value;
532
+ if (O === 0 || b.value) return;
533
+ c.value = (c.value + k + O) % O;
534
+ const N = p.value;
535
+ N && o(N.pageIndex + 1);
536
536
  }
537
- function O() {
537
+ function D() {
538
538
  $(), l.value = "", c.value = m.value = 0, f = [];
539
539
  }
540
- return _(t, O, { flush: "sync" }), Re(O), {
540
+ return _(t, D, { flush: "sync" }), Te(D), {
541
541
  visible: a,
542
542
  query: l,
543
543
  matchIndex: c,
@@ -549,13 +549,13 @@ function Sn(e) {
549
549
  },
550
550
  onInput: I,
551
551
  onNav: P,
552
- apply: (C) => {
553
- l.value.trim() && r(C, l.value.trim());
552
+ apply: (k) => {
553
+ l.value.trim() && r(k, l.value.trim());
554
554
  },
555
- clear: (C) => {
556
- n(C);
555
+ clear: (k) => {
556
+ n(k);
557
557
  },
558
- reset: O
558
+ reset: D
559
559
  };
560
560
  }
561
561
  function Dn(e, t) {
@@ -576,13 +576,13 @@ function Dn(e, t) {
576
576
  });
577
577
  return { enabled: o, debugStats: n };
578
578
  }
579
- function On(e, t) {
579
+ function Bn(e, t) {
580
580
  const { thumbsRoot: o, visible: r, renderThumbCanvas: n } = t, a = A(0), l = A(800), c = F(() => (e.value?.pages ?? []).map(
581
581
  (P) => Math.round(P.pageHeightMm / P.pageWidthMm * 116)
582
- )), m = F(() => Ot(c.value.map((P) => P + 20), 8)), b = F(() => m.value.window(l.value, a.value, 1)), f = F(() => {
582
+ )), m = F(() => Bt(c.value.map((P) => P + 20), 8)), b = F(() => m.value.window(l.value, a.value, 1)), f = F(() => {
583
583
  if (!r.value) return [];
584
- const { start: P, end: O } = b.value;
585
- return c.value.slice(P, O + 1).map((C, D) => ({ index: P + D, height: C }));
584
+ const { start: P, end: D } = b.value;
585
+ return c.value.slice(P, D + 1).map((k, O) => ({ index: P + O, height: k }));
586
586
  });
587
587
  let p = 0, h = 0, i = !1;
588
588
  function x() {
@@ -597,28 +597,28 @@ function On(e, t) {
597
597
  function w() {
598
598
  if (f.value, p && cancelAnimationFrame(p), p = 0, i || !r.value || !e.value || !o.value) return;
599
599
  x();
600
- const P = f.value, O = e.value, C = o.value;
601
- let D = 0;
602
- function H() {
603
- if (p = 0, !(i || !r.value || e.value !== O || o.value !== C)) {
604
- for (let K = 0; D < P.length && K < 2; K++, D++) {
605
- const X = P[D].index, Q = C.querySelector(`[data-thumb="${X + 1}"]`);
600
+ const P = f.value, D = e.value, k = o.value;
601
+ let O = 0;
602
+ function N() {
603
+ if (p = 0, !(i || !r.value || e.value !== D || o.value !== k)) {
604
+ for (let K = 0; O < P.length && K < 2; K++, O++) {
605
+ const X = P[O].index, Q = k.querySelector(`[data-thumb="${X + 1}"]`);
606
606
  if (!Q || Q.childElementCount > 0) continue;
607
- const Y = n(X);
608
- Y && (Y.style.width = "100%", Y.style.height = "100%", Y.style.display = "block", Q.appendChild(Y));
607
+ const J = n(X);
608
+ J && (J.style.width = "100%", J.style.height = "100%", J.style.display = "block", Q.appendChild(J));
609
609
  }
610
- D < P.length && (p = requestAnimationFrame(H));
610
+ O < P.length && (p = requestAnimationFrame(N));
611
611
  }
612
612
  }
613
- p = requestAnimationFrame(H);
613
+ p = requestAnimationFrame(N);
614
614
  }
615
615
  function I() {
616
616
  i = !0, p && cancelAnimationFrame(p), h && cancelAnimationFrame(h), p = h = 0;
617
617
  }
618
- return Re(I), { schedule: w, destroy: I, onScroll: $, windowRange: b, visibleThumbs: f };
618
+ return Te(I), { schedule: w, destroy: I, onScroll: $, windowRange: b, visibleThumbs: f };
619
619
  }
620
- function Bn() {
621
- const e = ye(0);
620
+ function Wn() {
621
+ const e = xe(0);
622
622
  return {
623
623
  loadMs: e,
624
624
  start() {
@@ -629,14 +629,14 @@ function Bn() {
629
629
  }
630
630
  };
631
631
  }
632
- const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disabled"], zn = { class: "mrp-pageinfo" }, Hn = ["disabled"], Nn = ["disabled"], jn = {
632
+ const An = { class: "mrp-toolbar" }, Ln = { class: "mrp-title" }, zn = ["disabled"], Nn = { class: "mrp-pageinfo" }, Hn = ["disabled"], jn = ["disabled"], qn = {
633
633
  key: 2,
634
634
  class: "mrp-search"
635
- }, qn = ["placeholder", "value"], Un = {
635
+ }, Un = ["placeholder", "value"], Vn = {
636
636
  key: 0,
637
637
  class: "mrp-search-count",
638
638
  role: "status"
639
- }, Vn = ["disabled"], Kn = ["disabled"], Yn = ["disabled"], Zn = ["disabled"], Jn = ["disabled"], Gn = ["disabled"], Xn = ["disabled"], Qn = ["disabled"], _n = ["disabled"], er = /* @__PURE__ */ ct({
639
+ }, Kn = ["disabled"], Jn = ["disabled"], Yn = ["disabled"], Zn = ["disabled"], Gn = ["disabled"], Xn = ["disabled"], Qn = ["disabled"], _n = ["disabled"], er = ["disabled"], tr = /* @__PURE__ */ dt({
640
640
  __name: "ReportToolbar",
641
641
  props: {
642
642
  pageCount: {},
@@ -658,22 +658,22 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
658
658
  _(
659
659
  () => t.search.visible,
660
660
  (n) => {
661
- n && tn(() => o.value?.focus());
661
+ n && nn(() => o.value?.focus());
662
662
  }
663
663
  );
664
664
  function r(n, a, l) {
665
665
  return n.replace("{cur}", String(a)).replace("{total}", String(l));
666
666
  }
667
- return (n, a) => (k(), M("div", Wn, [
668
- S("span", An, R(e.messages.title), 1),
669
- e.pageCount > 0 ? (k(), M(Fe, { key: 0 }, [
667
+ return (n, a) => (C(), M("div", An, [
668
+ S("span", Ln, R(e.messages.title), 1),
669
+ e.pageCount > 0 ? (C(), M(Re, { key: 0 }, [
670
670
  S("button", {
671
671
  class: "mrp-nav",
672
672
  type: "button",
673
673
  disabled: e.currentPage <= 1,
674
674
  onClick: a[0] || (a[0] = (l) => n.$emit("goto", e.currentPage - 1))
675
- }, R(e.messages.prevPage), 9, Ln),
676
- S("span", zn, R(r(e.messages.pageInfo, e.currentPage, e.pageCount)), 1),
675
+ }, R(e.messages.prevPage), 9, zn),
676
+ S("span", Nn, R(r(e.messages.pageInfo, e.currentPage, e.pageCount)), 1),
677
677
  S("button", {
678
678
  class: "mrp-nav",
679
679
  type: "button",
@@ -682,14 +682,14 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
682
682
  }, R(e.messages.nextPage), 9, Hn)
683
683
  ], 64)) : j("", !0),
684
684
  a[18] || (a[18] = S("span", { class: "mrp-spacer" }, null, -1)),
685
- e.showImport ? (k(), M("button", {
685
+ e.showImport ? (C(), M("button", {
686
686
  key: 1,
687
687
  class: "mrp-nav mrp-import-excel",
688
688
  type: "button",
689
689
  disabled: e.busy,
690
690
  onClick: a[2] || (a[2] = (l) => n.$emit("import-excel"))
691
- }, R(e.messages.importExcel ?? "导入 Excel 模板"), 9, Nn)) : j("", !0),
692
- e.search.visible ? (k(), M("div", jn, [
691
+ }, R(e.messages.importExcel ?? "导入 Excel 模板"), 9, jn)) : j("", !0),
692
+ e.search.visible ? (C(), M("div", qn, [
693
693
  S("input", {
694
694
  ref_key: "searchInputRef",
695
695
  ref: o,
@@ -698,20 +698,20 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
698
698
  placeholder: e.messages.searchPlaceholder,
699
699
  value: e.search.query,
700
700
  onInput: a[3] || (a[3] = (l) => n.$emit("search-input", l.target.value))
701
- }, null, 40, qn),
702
- e.search.query ? (k(), M("span", Un, R(e.search.searching ? e.messages.searching ?? "搜索中…" : r(e.messages.matchInfo, e.search.matchCount > 0 ? e.search.matchIndex + 1 : 0, e.search.matchCount)), 1)) : j("", !0),
701
+ }, null, 40, Un),
702
+ e.search.query ? (C(), M("span", Vn, R(e.search.searching ? e.messages.searching ?? "搜索中…" : r(e.messages.matchInfo, e.search.matchCount > 0 ? e.search.matchIndex + 1 : 0, e.search.matchCount)), 1)) : j("", !0),
703
703
  S("button", {
704
704
  class: "mrp-nav",
705
705
  type: "button",
706
706
  disabled: e.search.matchCount === 0,
707
707
  onClick: a[4] || (a[4] = (l) => n.$emit("search-nav", -1))
708
- }, R(e.messages.prevMatch), 9, Vn),
708
+ }, R(e.messages.prevMatch), 9, Kn),
709
709
  S("button", {
710
710
  class: "mrp-nav",
711
711
  type: "button",
712
712
  disabled: e.search.matchCount === 0,
713
713
  onClick: a[5] || (a[5] = (l) => n.$emit("search-nav", 1))
714
- }, R(e.messages.nextMatch), 9, Kn)
714
+ }, R(e.messages.nextMatch), 9, Jn)
715
715
  ])) : j("", !0),
716
716
  S("button", {
717
717
  class: de(["mrp-nav", { "mrp-active": e.search.visible }]),
@@ -739,70 +739,70 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
739
739
  type: "button",
740
740
  onClick: a[10] || (a[10] = (l) => n.$emit("zoom", 150))
741
741
  }, " 150% ", 2),
742
- e.showExport ? (k(), M("button", {
742
+ e.showExport ? (C(), M("button", {
743
743
  key: 3,
744
744
  class: "mrp-nav",
745
745
  type: "button",
746
746
  disabled: e.busy,
747
747
  onClick: a[11] || (a[11] = (l) => n.$emit("export", "html"))
748
748
  }, R(e.messages.exportHtml), 9, Yn)) : j("", !0),
749
- e.showExport ? (k(), M("button", {
749
+ e.showExport ? (C(), M("button", {
750
750
  key: 4,
751
751
  class: "mrp-nav",
752
752
  type: "button",
753
753
  disabled: e.busy,
754
754
  onClick: a[12] || (a[12] = (l) => n.$emit("export", "pdf"))
755
755
  }, R(e.messages.exportPdf), 9, Zn)) : j("", !0),
756
- e.showExport ? (k(), M("button", {
756
+ e.showExport ? (C(), M("button", {
757
757
  key: 5,
758
758
  class: "mrp-nav",
759
759
  type: "button",
760
760
  disabled: e.busy,
761
761
  onClick: a[13] || (a[13] = (l) => n.$emit("export", "xlsx"))
762
- }, R(e.messages.exportExcel), 9, Jn)) : j("", !0),
763
- e.showExport ? (k(), M("button", {
762
+ }, R(e.messages.exportExcel), 9, Gn)) : j("", !0),
763
+ e.showExport ? (C(), M("button", {
764
764
  key: 6,
765
765
  class: "mrp-nav",
766
766
  type: "button",
767
767
  disabled: e.busy,
768
768
  onClick: a[14] || (a[14] = (l) => n.$emit("export", "png"))
769
- }, R(e.messages.exportImage), 9, Gn)) : j("", !0),
770
- e.showExport ? (k(), M("button", {
769
+ }, R(e.messages.exportImage), 9, Xn)) : j("", !0),
770
+ e.showExport ? (C(), M("button", {
771
771
  key: 7,
772
772
  class: "mrp-nav",
773
773
  type: "button",
774
774
  disabled: e.busy,
775
775
  onClick: a[15] || (a[15] = (l) => n.$emit("export", "word"))
776
- }, R(e.messages.exportWord), 9, Xn)) : j("", !0),
777
- e.showPrint ? (k(), M("button", {
776
+ }, R(e.messages.exportWord), 9, Qn)) : j("", !0),
777
+ e.showPrint ? (C(), M("button", {
778
778
  key: 8,
779
779
  class: "mrp-nav",
780
780
  type: "button",
781
781
  disabled: e.busy,
782
782
  onClick: a[16] || (a[16] = (l) => n.$emit("print"))
783
- }, R(e.messages.print), 9, Qn)) : j("", !0),
784
- e.showPdfWindow ? (k(), M("button", {
783
+ }, R(e.messages.print), 9, _n)) : j("", !0),
784
+ e.showPdfWindow ? (C(), M("button", {
785
785
  key: 9,
786
786
  class: "mrp-nav",
787
787
  type: "button",
788
788
  disabled: e.busy,
789
789
  onClick: a[17] || (a[17] = (l) => n.$emit("pdf-window"))
790
- }, R(e.messages.pdfWindow), 9, _n)) : j("", !0)
790
+ }, R(e.messages.pdfWindow), 9, er)) : j("", !0)
791
791
  ]));
792
792
  }
793
- }), pt = (e, t) => {
793
+ }), mt = (e, t) => {
794
794
  const o = e.__vccOpts || e;
795
795
  for (const [r, n] of t)
796
796
  o[r] = n;
797
797
  return o;
798
- }, tr = /* @__PURE__ */ pt(er, [["__scopeId", "data-v-1c2568a7"]]), nr = { class: "mrp-params" }, rr = { class: "mrp-params-title" }, ar = { class: "mrp-params-grid" }, or = { class: "mrp-param-label" }, lr = {
798
+ }, nr = /* @__PURE__ */ mt(tr, [["__scopeId", "data-v-1c2568a7"]]), rr = { class: "mrp-params" }, ar = { class: "mrp-params-title" }, or = { class: "mrp-params-grid" }, lr = { class: "mrp-param-label" }, sr = {
799
799
  key: 0,
800
800
  class: "mrp-param-star"
801
- }, sr = ["value", "onChange"], ir = {
801
+ }, ir = ["value", "onChange"], ur = {
802
802
  value: "",
803
803
  disabled: "",
804
804
  hidden: ""
805
- }, ur = ["value"], cr = ["type", "placeholder", "value", "onInput"], dr = { class: "mrp-params-actions" }, fr = /* @__PURE__ */ ct({
805
+ }, cr = ["value"], dr = ["type", "placeholder", "value", "onInput"], fr = { class: "mrp-params-actions" }, pr = /* @__PURE__ */ dt({
806
806
  __name: "ReportParamPanel",
807
807
  props: {
808
808
  defs: {},
@@ -833,30 +833,30 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
833
833
  const b = o.defs.find((f) => f.field === m);
834
834
  return o.attempted && b?.required === !0 && !(n.value[m] ?? "").trim();
835
835
  }
836
- return (m, b) => (k(), M("div", nr, [
837
- S("span", rr, R(e.messages.paramsTitle), 1),
838
- S("div", ar, [
839
- (k(!0), M(Fe, null, ze(a.value, (f) => (k(), M("label", {
836
+ return (m, b) => (C(), M("div", rr, [
837
+ S("span", ar, R(e.messages.paramsTitle), 1),
838
+ S("div", or, [
839
+ (C(!0), M(Re, null, Ne(a.value, (f) => (C(), M("label", {
840
840
  key: f.def.field,
841
841
  class: de(["mrp-param", { "mrp-param-missing": c(f.def.field) }])
842
842
  }, [
843
- S("span", or, [
844
- st(R(f.label), 1),
845
- f.def.required ? (k(), M("i", lr, "*")) : j("", !0)
843
+ S("span", lr, [
844
+ it(R(f.label), 1),
845
+ f.def.required ? (C(), M("i", sr, "*")) : j("", !0)
846
846
  ]),
847
- (f.def.type ?? "text") === "select" ? (k(), M("select", {
847
+ (f.def.type ?? "text") === "select" ? (C(), M("select", {
848
848
  key: 0,
849
849
  class: "mrp-param-input",
850
850
  value: f.value,
851
851
  onChange: (p) => l(f.def.field, p.target.value),
852
852
  onKeydown: b[0] || (b[0] = Ct((p) => m.$emit("query"), ["enter"]))
853
853
  }, [
854
- S("option", ir, R(f.def.placeholder ?? `请选择${f.label}`), 1),
855
- (k(!0), M(Fe, null, ze(f.def.options ?? [], (p) => (k(), M("option", {
854
+ S("option", ur, R(f.def.placeholder ?? `请选择${f.label}`), 1),
855
+ (C(!0), M(Re, null, Ne(f.def.options ?? [], (p) => (C(), M("option", {
856
856
  key: p.value,
857
857
  value: p.value
858
- }, R(p.label), 9, ur))), 128))
859
- ], 40, sr)) : (k(), M("input", {
858
+ }, R(p.label), 9, cr))), 128))
859
+ ], 40, ir)) : (C(), M("input", {
860
860
  key: 1,
861
861
  class: "mrp-param-input",
862
862
  type: f.def.type === "number" ? "number" : f.def.type === "date" ? "date" : "text",
@@ -864,10 +864,10 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
864
864
  value: f.value,
865
865
  onInput: (p) => l(f.def.field, p.target.value),
866
866
  onKeydown: b[1] || (b[1] = Ct((p) => m.$emit("query"), ["enter"]))
867
- }, null, 40, cr))
867
+ }, null, 40, dr))
868
868
  ], 2))), 128))
869
869
  ]),
870
- S("div", dr, [
870
+ S("div", fr, [
871
871
  S("button", {
872
872
  class: "mrp-nav mrp-param-query",
873
873
  type: "button",
@@ -881,7 +881,7 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
881
881
  ])
882
882
  ]));
883
883
  }
884
- }), pr = /* @__PURE__ */ pt(fr, [["__scopeId", "data-v-aafce92d"]]), mr = {
884
+ }), mr = /* @__PURE__ */ mt(pr, [["__scopeId", "data-v-aafce92d"]]), vr = {
885
885
  title: "报表预览",
886
886
  prevPage: "‹ 上一页",
887
887
  nextPage: "下一页 ›",
@@ -918,7 +918,7 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
918
918
  editInvalidNumber: "请输入有效数字;清空表示无值",
919
919
  editInvalidBoolean: "请输入 true / false、是 / 否或 1 / 0",
920
920
  editConflict: "该单元格已变化,请重新打开编辑"
921
- }, vr = {
921
+ }, gr = {
922
922
  shellBg: "#525659",
923
923
  shellFg: "#e8e8e8",
924
924
  toolbarBg: "#323639",
@@ -930,10 +930,10 @@ const Wn = { class: "mrp-toolbar" }, An = { class: "mrp-title" }, Ln = ["disable
930
930
  btnHoverFg: "#ffffff",
931
931
  btnActiveBg: "#2d5fb8"
932
932
  };
933
- function gr(e = {}) {
933
+ function hr(e = {}) {
934
934
  return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
935
935
  }
936
- function Gr(e) {
936
+ function Xr(e) {
937
937
  return e;
938
938
  }
939
939
  const he = {
@@ -944,10 +944,10 @@ const he = {
944
944
  gapPx: 18,
945
945
  pdfFontUrl: "/simhei.ttf",
946
946
  logger: console
947
- }, Xr = { warn: () => {
947
+ }, Qr = { warn: () => {
948
948
  }, info: () => {
949
949
  } };
950
- function Le(e, t) {
950
+ function ze(e, t) {
951
951
  return {
952
952
  ...e,
953
953
  ...t,
@@ -957,8 +957,8 @@ function Le(e, t) {
957
957
  xlsx: { ...e?.xlsx, ...t?.xlsx }
958
958
  };
959
959
  }
960
- function hr(e, t) {
961
- const o = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, r = Le(e?.defaults, o);
960
+ function br(e, t) {
961
+ const o = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, r = ze(e?.defaults, o);
962
962
  return {
963
963
  showExport: r.showExport ?? he.showExport,
964
964
  showPrint: r.showPrint ?? he.showPrint,
@@ -966,68 +966,68 @@ function hr(e, t) {
966
966
  showParams: r.showParams ?? he.showParams,
967
967
  gapPx: r.gapPx ?? he.gapPx,
968
968
  pdfFontUrl: r.pdfFontUrl ?? he.pdfFontUrl,
969
- theme: { ...vr, ...r.theme },
970
- messages: { ...mr, ...r.messages },
969
+ theme: { ...gr, ...r.theme },
970
+ messages: { ...vr, ...r.messages },
971
971
  logger: r.logger ?? he.logger,
972
972
  preview: {
973
- overscanPages: Rt(r.preview?.overscanPages, 1, 10, !0),
974
- searchDebounceMs: Rt(r.preview?.searchDebounceMs, 200, 2e3)
973
+ overscanPages: Tt(r.preview?.overscanPages, 1, 10, !0),
974
+ searchDebounceMs: Tt(r.preview?.searchDebounceMs, 200, 2e3)
975
975
  },
976
976
  xlsx: { ...r.xlsx },
977
977
  editable: r.editable ?? !1,
978
978
  excelImport: r.excelImport ?? !1
979
979
  };
980
980
  }
981
- function Rt(e, t, o, r = !1) {
981
+ function Tt(e, t, o, r = !1) {
982
982
  if (e == null || !Number.isFinite(e)) return t;
983
983
  const n = Math.max(0, Math.min(o, e));
984
984
  return r ? Math.floor(n) : n;
985
985
  }
986
- function br(e) {
986
+ function wr(e) {
987
987
  const t = {};
988
988
  return e.shellBg != null && (t["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (t["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (t["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (t["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (t["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (t["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (t["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (t["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (t["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (t["--mrp-btn-active-bg"] = e.btnActiveBg), t;
989
989
  }
990
- function Qr(e) {
991
- const t = He(it, null), o = F(() => {
992
- const r = t?.value ?? null, n = "defaults" in e || "presets" in e || "defaultPreset" in e ? gr(e) : { defaults: e, presets: {} };
990
+ function _r(e) {
991
+ const t = He(ut, null), o = F(() => {
992
+ const r = t?.value ?? null, n = "defaults" in e || "presets" in e || "defaultPreset" in e ? hr(e) : { defaults: e, presets: {} };
993
993
  if (!r) return n;
994
994
  const a = { ...r.presets, ...n.presets };
995
995
  for (const l of Object.keys(a))
996
- a[l] = Le(
997
- Le(r.presets[l], n.defaults),
996
+ a[l] = ze(
997
+ ze(r.presets[l], n.defaults),
998
998
  n.presets[l]
999
999
  );
1000
1000
  return {
1001
- defaults: Le(r.defaults, n.defaults),
1001
+ defaults: ze(r.defaults, n.defaults),
1002
1002
  presets: a,
1003
1003
  defaultPreset: n.defaultPreset ?? r.defaultPreset
1004
1004
  };
1005
1005
  });
1006
- It(it, o);
1006
+ St(ut, o);
1007
1007
  }
1008
- function wr() {
1009
- return He(it, F(() => null));
1008
+ function yr() {
1009
+ return He(ut, F(() => null));
1010
1010
  }
1011
- const Tt = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map(), yr = 15e3;
1012
- function ut(e, t) {
1011
+ const It = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map(), xr = 15e3;
1012
+ function ct(e, t) {
1013
1013
  return Object.assign(new Error(e), { cause: t });
1014
1014
  }
1015
- function Me(e, t) {
1015
+ function Fe(e, t) {
1016
1016
  return `PDF 字体 ${JSON.stringify(e)}:${t}。请部署支持报表文字的字体文件,并将 pdfFontUrl 配置为可访问的字体 URL;西文报表可设为空串`;
1017
1017
  }
1018
- function qe(e) {
1018
+ function Ue(e) {
1019
1019
  if (e?.reason instanceof Error && e.reason.name === "AbortError") return e.reason;
1020
- const t = ut("PDF 字体检查已取消", e?.reason);
1020
+ const t = ct("PDF 字体检查已取消", e?.reason);
1021
1021
  return t.name = "AbortError", t;
1022
1022
  }
1023
- async function xr(e, t) {
1023
+ async function Pr(e, t) {
1024
1024
  let o = !1;
1025
1025
  const r = setTimeout(() => {
1026
1026
  o = !0, t.abort();
1027
- }, yr);
1027
+ }, xr);
1028
1028
  try {
1029
1029
  const n = await fetch(e, { method: "HEAD", signal: t.signal });
1030
- if (t.signal.aborted) throw qe(t.signal);
1030
+ if (t.signal.aborted) throw Ue(t.signal);
1031
1031
  if (n.status === 405 || n.status === 501 || n.type === "opaque")
1032
1032
  return {
1033
1033
  status: "unverified",
@@ -1036,16 +1036,16 @@ async function xr(e, t) {
1036
1036
  };
1037
1037
  if (!n.ok) {
1038
1038
  const l = new Error(`字体请求返回 HTTP ${n.status}`);
1039
- return { status: "error", fontUrl: e, message: Me(e, l.message), cause: l };
1039
+ return { status: "error", fontUrl: e, message: Fe(e, l.message), cause: l };
1040
1040
  }
1041
1041
  const a = n.headers.get("content-type") ?? "";
1042
1042
  if (/text\/html|application\/xhtml\+xml/i.test(a)) {
1043
1043
  const l = new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件");
1044
- return { status: "error", fontUrl: e, message: Me(e, l.message), cause: l };
1044
+ return { status: "error", fontUrl: e, message: Fe(e, l.message), cause: l };
1045
1045
  }
1046
1046
  if (/^text\//i.test(a) || /(?:\/|\+)json(?:\s*;|$)/i.test(a)) {
1047
1047
  const l = new Error(`字体 URL 返回 ${a} 文本响应,不是字体文件`);
1048
- return { status: "error", fontUrl: e, message: Me(e, l.message), cause: l };
1048
+ return { status: "error", fontUrl: e, message: Fe(e, l.message), cause: l };
1049
1049
  }
1050
1050
  return {
1051
1051
  status: "available",
@@ -1053,29 +1053,29 @@ async function xr(e, t) {
1053
1053
  message: "PDF 字体资源可达;文字覆盖范围将在实际导出时校验"
1054
1054
  };
1055
1055
  } catch (n) {
1056
- if (t.signal.aborted && !o) throw qe(t.signal);
1056
+ if (t.signal.aborted && !o) throw Ue(t.signal);
1057
1057
  return {
1058
1058
  status: "error",
1059
1059
  fontUrl: e,
1060
- message: Me(e, o ? "字体检查超时,请检查网络或字体服务" : "字体检查失败,请检查网络、字体服务或跨域访问配置"),
1060
+ message: Fe(e, o ? "字体检查超时,请检查网络或字体服务" : "字体检查失败,请检查网络、字体服务或跨域访问配置"),
1061
1061
  cause: n
1062
1062
  };
1063
1063
  } finally {
1064
1064
  clearTimeout(r);
1065
1065
  }
1066
1066
  }
1067
- function Pr(e, t) {
1068
- if (t?.aborted) return Promise.reject(qe(t));
1067
+ function Er(e, t) {
1068
+ if (t?.aborted) return Promise.reject(Ue(t));
1069
1069
  if (!e)
1070
1070
  return Promise.resolve({ status: "disabled", fontUrl: e, message: "已停用自定义 PDF 字体;内置字体用于西文,其他文字会在导出时校验" });
1071
- const o = Tt.get(e);
1071
+ const o = It.get(e);
1072
1072
  if (o) return Promise.resolve(o);
1073
1073
  let r = we.get(e);
1074
1074
  if (!r) {
1075
1075
  const a = new AbortController();
1076
- r = { controller: a, promise: xr(e, a), subscribers: 0 };
1076
+ r = { controller: a, promise: Pr(e, a), subscribers: 0 };
1077
1077
  const l = r;
1078
- we.set(e, l), l.promise = l.promise.then((c) => (!a.signal.aborted && c.status === "available" && Tt.set(e, c), c)).finally(() => {
1078
+ we.set(e, l), l.promise = l.promise.then((c) => (!a.signal.aborted && c.status === "available" && It.set(e, c), c)).finally(() => {
1079
1079
  we.get(e) === l && we.delete(e);
1080
1080
  });
1081
1081
  }
@@ -1083,7 +1083,7 @@ function Pr(e, t) {
1083
1083
  return n.subscribers++, new Promise((a, l) => {
1084
1084
  let c = !1;
1085
1085
  const m = () => c ? !1 : (c = !0, n.subscribers--, t?.removeEventListener("abort", b), !0), b = () => {
1086
- m() && (n.subscribers === 0 && (we.get(e) === n && we.delete(e), n.controller.abort()), l(qe(t)));
1086
+ m() && (n.subscribers === 0 && (we.get(e) === n && we.delete(e), n.controller.abort()), l(Ue(t)));
1087
1087
  };
1088
1088
  t?.addEventListener("abort", b, { once: !0 }), n.promise.then(
1089
1089
  (f) => {
@@ -1095,7 +1095,7 @@ function Pr(e, t) {
1095
1095
  ), t?.aborted && b();
1096
1096
  });
1097
1097
  }
1098
- function Er(e = { fontUrl: "/simhei.ttf" }) {
1098
+ function $r(e = { fontUrl: "/simhei.ttf" }) {
1099
1099
  let t = null;
1100
1100
  const o = async (r, n) => {
1101
1101
  t || (t = await import("@agile-team/mach-report/pdf"));
@@ -1105,7 +1105,7 @@ function Er(e = { fontUrl: "/simhei.ttf" }) {
1105
1105
  if (a = await t.loadFontWithCache(e.fontUrl, { strict: !0 }), !a?.byteLength) throw new Error("字体文件为空或加载失败");
1106
1106
  } catch (p) {
1107
1107
  const h = p instanceof Error ? p.message : String(p);
1108
- throw ut(Me(e.fontUrl, h), p);
1108
+ throw ct(Fe(e.fontUrl, h), p);
1109
1109
  }
1110
1110
  let l;
1111
1111
  try {
@@ -1113,7 +1113,7 @@ function Er(e = { fontUrl: "/simhei.ttf" }) {
1113
1113
  } catch (p) {
1114
1114
  if (!a) throw p;
1115
1115
  const h = p instanceof Error ? p.message : String(p);
1116
- throw ut(`PDF 生成失败:${h}。当前字体 URL 为 ${JSON.stringify(e.fontUrl)};请确认该文件是有效字体,或重新配置 pdfFontUrl`, p);
1116
+ throw ct(`PDF 生成失败:${h}。当前字体 URL 为 ${JSON.stringify(e.fontUrl)};请确认该文件是有效字体,或重新配置 pdfFontUrl`, p);
1117
1117
  }
1118
1118
  const { bytes: c, unsupportedTextCount: m, pageErrors: b, fidelityWarnings: f } = l;
1119
1119
  if (m > 0)
@@ -1122,16 +1122,19 @@ function Er(e = { fontUrl: "/simhei.ttf" }) {
1122
1122
  throw new Error(`PDF 有 ${b.length} 页渲染失败:${b[0]}`);
1123
1123
  return f.length > 0 && n?.(`PDF 有 ${f.length} 处版式降级:${f.slice(0, 2).join(";")}`), c;
1124
1124
  };
1125
- return o.checkFont = (r) => Pr(e.fontUrl, r), o;
1125
+ return o.checkFont = (r) => Er(e.fontUrl, r), o;
1126
1126
  }
1127
1127
  class pe extends Error {
1128
1128
  constructor(t, o, r) {
1129
1129
  super(o), this.name = "MachReportError", this.code = t, this.cause = r;
1130
1130
  }
1131
1131
  }
1132
- function $r(e) {
1132
+ function kr(e) {
1133
1133
  return e instanceof pe ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
1134
1134
  }
1135
+ function ye(e) {
1136
+ return JSON.parse(JSON.stringify(e));
1137
+ }
1135
1138
  function Cr(e) {
1136
1139
  const t = e.closest(".mrp-page-holder"), o = e.closest("[data-mr-component-index]");
1137
1140
  if (!t || !o) return null;
@@ -1143,12 +1146,12 @@ function Cr(e) {
1143
1146
  };
1144
1147
  return Object.values(r).every((n) => Number.isInteger(n) && n >= 0) ? r : null;
1145
1148
  }
1146
- function kr(e, t, o) {
1149
+ function Mr(e, t, o) {
1147
1150
  const r = e.ownerDocument.createElement("textarea");
1148
1151
  return r.className = "mrp-cell-editor", r.setAttribute("aria-label", t), r.value = o == null ? "" : String(o), r.style.cssText = "position:absolute;inset:0;width:100%;height:100%;min-height:20px;box-sizing:border-box;z-index:10;resize:none;margin:0;padding:2px 4px;border:2px solid #2563eb;outline:none;background:#fff;color:#111;font:inherit;line-height:1.25;white-space:pre-wrap;", e.appendChild(r), r;
1149
1152
  }
1150
- function Mr(e) {
1151
- const t = ye(null), o = A(!1), r = ye([]);
1153
+ function Fr(e) {
1154
+ const t = xe(null), o = A(!1), r = xe([]);
1152
1155
  let n = null;
1153
1156
  function a() {
1154
1157
  const i = t.value;
@@ -1161,23 +1164,23 @@ function Mr(e) {
1161
1164
  return t.value === i && !i.controller.signal.aborted && e.plan.value === i.plan;
1162
1165
  }
1163
1166
  function m(i) {
1164
- const x = e.options.value, $ = Mt(i.plan, i.address);
1167
+ const x = e.options.value, $ = Ft(i.plan, i.address);
1165
1168
  if (!(typeof x == "object" ? x === i.options : x === !0) || !$?.editable || i.options.canEdit?.($) === !1)
1166
1169
  throw new Dt("readonly");
1167
1170
  }
1168
1171
  async function b(i) {
1169
1172
  try {
1170
1173
  m(i);
1171
- const x = cn(i.plan, i.address, i.input.value);
1174
+ const x = dn(i.plan, i.address, i.input.value);
1172
1175
  if (Object.is(x.value, x.previousValue))
1173
1176
  return a(), !0;
1174
- const $ = { signal: i.controller.signal }, w = await i.options.validate?.(structuredClone(x), $);
1177
+ const $ = { signal: i.controller.signal }, w = await i.options.validate?.(ye(x), $);
1175
1178
  if (!c(i)) return !1;
1176
1179
  if (w) throw new Error(w);
1177
- if (m(i), await i.options.save?.(structuredClone(x), $), !c(i)) return !1;
1180
+ if (m(i), await i.options.save?.(ye(x), $), !c(i)) return !1;
1178
1181
  m(i);
1179
- const I = dn(i.plan, x);
1180
- return a(), r.value = [...r.value, x], e.plan.value = I, e.onChange(structuredClone(x)), !0;
1182
+ const I = fn(i.plan, x);
1183
+ return a(), r.value = [...r.value, x], e.plan.value = I, e.onChange(ye(x)), !0;
1181
1184
  } catch (x) {
1182
1185
  return c(i) && (e.onError(e.errorMessage?.(x) ?? (x instanceof Error ? x.message : "单元格保存失败"), x), i.input.disabled = !1, i.input.setAttribute("aria-invalid", "true"), i.input.focus()), !1;
1183
1186
  } finally {
@@ -1209,21 +1212,21 @@ function Mr(e) {
1209
1212
  if (!w || !I || !e.options.value || e.blocked()) return;
1210
1213
  const P = typeof e.options.value == "object" ? e.options.value : {};
1211
1214
  try {
1212
- const O = Mt(w, I);
1213
- if (!O?.editable || P.canEdit?.(O) === !1) return;
1214
- const C = kr($, e.label(), O.value);
1215
- t.value = { plan: w, address: I, input: C, controller: new AbortController(), options: P }, C.addEventListener("keydown", p), C.addEventListener("blur", () => {
1215
+ const D = Ft(w, I);
1216
+ if (!D?.editable || P.canEdit?.(D) === !1) return;
1217
+ const k = Mr($, e.label(), D.value);
1218
+ t.value = { plan: w, address: I, input: k, controller: new AbortController(), options: P }, k.addEventListener("keydown", p), k.addEventListener("blur", () => {
1216
1219
  o.value || f();
1217
- }), C.focus(), C.select();
1218
- } catch (O) {
1219
- e.onError(O instanceof Error ? O.message : "无法编辑单元格", O);
1220
+ }), k.focus(), k.select();
1221
+ } catch (D) {
1222
+ e.onError(D instanceof Error ? D.message : "无法编辑单元格", D);
1220
1223
  }
1221
1224
  }
1222
1225
  return _(e.options, (i, x) => {
1223
1226
  (!i || i !== x) && a();
1224
1227
  }, { flush: "sync" }), _(e.plan, () => {
1225
1228
  t.value && e.plan.value !== t.value.plan && a();
1226
- }, { flush: "sync" }), Re(l), {
1229
+ }, { flush: "sync" }), Te(l), {
1227
1230
  active: t,
1228
1231
  saving: o,
1229
1232
  changes: r,
@@ -1231,31 +1234,31 @@ function Mr(e) {
1231
1234
  reset: l,
1232
1235
  commit: f,
1233
1236
  onDoubleClick: h,
1234
- getChanges: () => structuredClone(r.value)
1237
+ getChanges: () => ye(r.value)
1235
1238
  };
1236
1239
  }
1237
- const Fr = {
1240
+ const Rr = {
1238
1241
  key: 2,
1239
1242
  class: "mrp-edit-hint",
1240
1243
  role: "status"
1241
- }, Rr = {
1244
+ }, Tr = {
1242
1245
  key: 4,
1243
1246
  class: "mrp-export-notice mrp-export-warning",
1244
1247
  role: "status"
1245
- }, Tr = { class: "mrp-main" }, Ir = {
1248
+ }, Ir = { class: "mrp-main" }, Sr = {
1246
1249
  key: 0,
1247
1250
  class: "mrp-state"
1248
- }, Sr = {
1251
+ }, Or = {
1249
1252
  key: 1,
1250
1253
  class: "mrp-state mrp-error"
1251
1254
  }, Dr = {
1252
1255
  key: 2,
1253
1256
  class: "mrp-state"
1254
- }, Or = ["data-page"], Br = ["onClick"], Wr = ["data-thumb"], Ar = { class: "mrp-thumb-no" }, Lr = { class: "mrp-overlay" }, zr = {
1257
+ }, Br = ["data-page"], Wr = ["onClick"], Ar = ["data-thumb"], Lr = { class: "mrp-thumb-no" }, zr = { class: "mrp-overlay" }, Nr = {
1255
1258
  key: 5,
1256
1259
  class: "mrp-debug",
1257
1260
  "aria-hidden": "true"
1258
- }, We = 96 / 25.4, ot = "mach-report:ui", lt = "mach-report:ui:wide", Hr = /* @__PURE__ */ ct({
1261
+ }, Ae = 96 / 25.4, lt = "mach-report:ui", st = "mach-report:ui:wide", Hr = /* @__PURE__ */ dt({
1259
1262
  __name: "ReportPreview",
1260
1263
  props: {
1261
1264
  reportId: {
@@ -1296,12 +1299,12 @@ const Fr = {
1296
1299
  },
1297
1300
  emits: ["loaded", "error", "warning", "cell-edit", "template-import"],
1298
1301
  setup(e, { expose: t, emit: o }) {
1299
- nn((s) => ({
1300
- v587d5a34: H.value + "px"
1302
+ rn((s) => ({
1303
+ a2d6c888: N.value + "px"
1301
1304
  }));
1302
- const r = e, n = o, a = ye(null), l = A(!1), c = A(""), m = ye(null), b = A(null), f = A(!1), p = ye(Object.freeze({ status: "unchecked", fontUrl: "" })), h = A(null), i = A(1), x = A(null), $ = A(null), w = A(null), I = A(!1), P = A(!1), O = A(null), C = Bn(), D = F(() => !!a.value?.pages.length && a.value.pages.every((s) => s.layout === "wide")), H = F(() => Math.max(0, ee.value));
1303
- let K = ot;
1304
- const X = He(hn, null), Q = He(bn, null), Y = F(() => Bt(r.reportId)), se = F(() => r.fetcher ?? X), U = F(() => a.value?.pages.length ?? 0), me = F(() => Object.freeze({
1305
+ const r = e, n = o, a = xe(null), l = A(!1), c = A(""), m = xe(null), b = A(null), f = A(!1), p = xe(Object.freeze({ status: "unchecked", fontUrl: "" })), h = A(null), i = A(1), x = A(null), $ = A(null), w = A(null), I = A(!1), P = A(!1), D = A(null), k = Wn(), O = F(() => !!a.value?.pages.length && a.value.pages.every((s) => s.layout === "wide")), N = F(() => Math.max(0, ee.value));
1306
+ let K = lt;
1307
+ const X = He(bn, null), Q = He(wn, null), J = F(() => Wt(r.reportId)), se = F(() => r.fetcher ?? X), U = F(() => a.value?.pages.length ?? 0), me = F(() => Object.freeze({
1305
1308
  loading: l.value,
1306
1309
  hasPlan: U.value > 0,
1307
1310
  pageCount: U.value,
@@ -1317,53 +1320,53 @@ const Fr = {
1317
1320
  importing: P.value,
1318
1321
  dirty: q.changes.value.length > 0
1319
1322
  }));
1320
- function J(s, v, g) {
1323
+ function Z(s, v, g) {
1321
1324
  m.value = Object.freeze({ message: s, code: v, cause: g }), n("error", s, { code: v, cause: g });
1322
1325
  }
1323
- const u = wr(), d = F(() => hr(u.value, r.preset)), y = F(() => ({
1326
+ const u = yr(), d = F(() => br(u.value, r.preset)), y = F(() => ({
1324
1327
  ...d.value.messages,
1325
1328
  ...r.messages
1326
- })), T = F(() => r.showExport ?? d.value.showExport), B = F(() => r.showPrint ?? d.value.showPrint), V = F(() => r.showPdfWindow ?? d.value.showPdfWindow), ee = F(() => r.gapPx ?? (D.value ? 0 : d.value.gapPx)), oe = F(() => r.showParams ?? d.value.showParams), mt = F(() => r.editable ?? d.value.editable), Te = F(() => r.excelImport ?? d.value.excelImport);
1327
- function Lt(s) {
1329
+ })), T = F(() => r.showExport ?? d.value.showExport), B = F(() => r.showPrint ?? d.value.showPrint), V = F(() => r.showPdfWindow ?? d.value.showPdfWindow), ee = F(() => r.gapPx ?? (O.value ? 0 : d.value.gapPx)), oe = F(() => r.showParams ?? d.value.showParams), vt = F(() => r.editable ?? d.value.editable), Ie = F(() => r.excelImport ?? d.value.excelImport);
1330
+ function zt(s) {
1328
1331
  return s instanceof Dt ? {
1329
1332
  number: y.value.editInvalidNumber,
1330
1333
  boolean: y.value.editInvalidBoolean,
1331
1334
  conflict: y.value.editConflict
1332
1335
  }[s.code] ?? s.message : s instanceof Error ? s.message : "单元格保存失败";
1333
1336
  }
1334
- const q = Mr({
1337
+ const q = Fr({
1335
1338
  plan: a,
1336
- options: mt,
1339
+ options: vt,
1337
1340
  blocked: () => l.value || P.value || b.value !== null || f.value,
1338
1341
  label: () => y.value.editCell ?? "编辑单元格",
1339
- errorMessage: Lt,
1342
+ errorMessage: zt,
1340
1343
  onChange: (s) => {
1341
1344
  m.value = null, h.value = null, n("cell-edit", s);
1342
1345
  },
1343
1346
  onError: (s, v) => {
1344
- h.value = { kind: "error", message: s }, J(s, "edit", v);
1347
+ h.value = { kind: "error", message: s }, Z(s, "edit", v);
1345
1348
  }
1346
1349
  });
1347
- let vt = null, Ue = null;
1348
- function gt() {
1350
+ let gt = null, Ve = null;
1351
+ function ht() {
1349
1352
  if (Q) return Q;
1350
1353
  const s = d.value.pdfFontUrl;
1351
- return (!Ue || vt !== s) && (vt = s, Ue = Er({ fontUrl: s })), Ue;
1354
+ return (!Ve || gt !== s) && (gt = s, Ve = $r({ fontUrl: s })), Ve;
1352
1355
  }
1353
- let Ie = 0, xe = null, Se = null, ie = !1;
1354
- function Ve() {
1355
- Ie++, xe?.abort(), xe = null;
1356
+ let Se = 0, Pe = null, Oe = null, ie = !1;
1357
+ function Ke() {
1358
+ Se++, Pe?.abort(), Pe = null;
1356
1359
  }
1357
1360
  async function De() {
1358
1361
  if (ie) throw new pe("config", "报表预览已卸载");
1359
- Ve();
1360
- const s = Ie, v = new AbortController();
1361
- xe = v;
1362
+ Ke();
1363
+ const s = Se, v = new AbortController();
1364
+ Pe = v;
1362
1365
  const g = d.value.pdfFontUrl;
1363
1366
  p.value = Object.freeze({ status: "checking", fontUrl: g });
1364
1367
  try {
1365
- const z = gt(), L = z.checkFont ? await z.checkFont(v.signal) : { status: "unverified", fontUrl: "", message: "自定义 PDF 导出器未提供字体预检查;字体由宿主确认" };
1366
- return !ie && s === Ie && !v.signal.aborted && (p.value = Object.freeze({ ...L })), L;
1368
+ const z = ht(), L = z.checkFont ? await z.checkFont(v.signal) : { status: "unverified", fontUrl: "", message: "自定义 PDF 导出器未提供字体预检查;字体由宿主确认" };
1369
+ return !ie && s === Se && !v.signal.aborted && (p.value = Object.freeze({ ...L })), L;
1367
1370
  } catch (z) {
1368
1371
  if (v.signal.aborted) throw z;
1369
1372
  const L = {
@@ -1372,12 +1375,12 @@ const Fr = {
1372
1375
  message: z instanceof Error ? z.message : "PDF 字体检查失败",
1373
1376
  cause: z
1374
1377
  };
1375
- return !ie && s === Ie && (p.value = Object.freeze(L)), L;
1378
+ return !ie && s === Se && (p.value = Object.freeze(L)), L;
1376
1379
  } finally {
1377
- xe === v && (xe = null);
1380
+ Pe === v && (Pe = null);
1378
1381
  }
1379
1382
  }
1380
- function zt() {
1383
+ function Nt() {
1381
1384
  De().catch(() => {
1382
1385
  });
1383
1386
  }
@@ -1385,115 +1388,115 @@ const Fr = {
1385
1388
  [a, () => d.value.pdfFontUrl, T, V],
1386
1389
  () => {
1387
1390
  const s = p.value.fontUrl === d.value.pdfFontUrl;
1388
- s && p.value.status === "available" || (Ve(), (!s || p.value.status === "checking") && (p.value = Object.freeze({ status: "unchecked", fontUrl: d.value.pdfFontUrl })), !ie && U.value > 0 && (T.value || V.value) && De().catch(() => {
1391
+ s && p.value.status === "available" || (Ke(), (!s || p.value.status === "checking") && (p.value = Object.freeze({ status: "unchecked", fontUrl: d.value.pdfFontUrl })), !ie && U.value > 0 && (T.value || V.value) && De().catch(() => {
1389
1392
  }));
1390
1393
  },
1391
1394
  { immediate: !0 }
1392
1395
  );
1393
1396
  const fe = F(
1394
- () => r.paramDefs ?? se.value?.getParamDefs?.(Y.value) ?? []
1395
- ), ve = A({}), Ke = A(!1);
1396
- function Pe(s) {
1397
+ () => r.paramDefs ?? se.value?.getParamDefs?.(J.value) ?? []
1398
+ ), ve = A({}), Je = A(!1);
1399
+ function Ee(s) {
1397
1400
  const v = {};
1398
1401
  for (const g of s)
1399
1402
  v[g.field] = r.params[g.field] ?? g.defaultValue ?? "";
1400
- ve.value = v, Ke.value = !1;
1403
+ ve.value = v, Je.value = !1;
1401
1404
  }
1402
- Pe(fe.value), _(fe, (s) => Pe(s)), _(Y, () => Pe(fe.value)), _(() => JSON.stringify(r.params), () => Pe(fe.value));
1405
+ Ee(fe.value), _(fe, (s) => Ee(s)), _(J, () => Ee(fe.value)), _(() => JSON.stringify(r.params), () => Ee(fe.value));
1403
1406
  const Ht = F(() => {
1404
1407
  const s = { ...r.params };
1405
1408
  for (const [v, g] of Object.entries(ve.value))
1406
1409
  g === "" ? delete s[v] : s[v] = g;
1407
1410
  return s;
1408
1411
  });
1409
- function Nt() {
1412
+ function jt() {
1410
1413
  return fe.value.filter(
1411
1414
  (s) => s.required === !0 && !(ve.value[s.field] ?? "").trim()
1412
1415
  );
1413
1416
  }
1414
- function jt() {
1415
- Ke.value = !0;
1416
- const s = Nt();
1417
+ function qt() {
1418
+ Je.value = !0;
1419
+ const s = jt();
1417
1420
  if (s.length > 0) {
1418
1421
  const v = s[0].label ?? s[0].field, g = y.value.paramRequired.replace("{label}", v);
1419
- c.value = g, J(g, "param");
1422
+ c.value = g, Z(g, "param");
1420
1423
  return;
1421
1424
  }
1422
1425
  ge();
1423
1426
  }
1424
- function qt() {
1425
- Pe(fe.value);
1427
+ function Ut() {
1428
+ Ee(fe.value);
1426
1429
  }
1427
- const Ut = F(() => ({
1430
+ const Vt = F(() => ({
1428
1431
  height: r.height,
1429
- ...br(d.value.theme)
1430
- })), { zoom: te, zoomMode: Ee, applyFitZoom: ht, setZoom: $e } = xn(() => ({
1432
+ ...wr(d.value.theme)
1433
+ })), { zoom: te, zoomMode: $e, applyFitZoom: bt, setZoom: ke } = Pn(() => ({
1431
1434
  viewport: $.value,
1432
- pageWidthPx: Ye.contentSize.value.w || 210 * We
1433
- })), Ye = yn(a, te, {
1434
- pxPerMm: We,
1435
+ pageWidthPx: Ye.contentSize.value.w || 210 * Ae
1436
+ })), Ye = xn(a, te, {
1437
+ pxPerMm: Ae,
1435
1438
  gapPx: ee,
1436
1439
  overscan: F(() => d.value.preview.overscanPages)
1437
- }), { contentSize: Ze, windowRange: Ce, visiblePages: bt, makeScrollHandler: Vt, refreshViewport: Je } = Ye, Kt = Vt(i, U);
1438
- function Ge(s) {
1439
- $e(s * 100);
1440
+ }), { contentSize: Ze, windowRange: Ce, visiblePages: wt, makeScrollHandler: Kt, refreshViewport: Ge } = Ye, Jt = Kt(i, U);
1441
+ function Xe(s) {
1442
+ ke(s * 100);
1440
1443
  }
1441
- function Oe() {
1442
- P.value = !1, q.reset(), wt(), a.value = null, i.value = 1, N.reset();
1444
+ function Be() {
1445
+ P.value = !1, q.reset(), yt(), a.value = null, i.value = 1, H.reset();
1443
1446
  }
1444
- let Z = 0, re = null;
1447
+ let Y = 0, re = null;
1445
1448
  async function ge() {
1446
1449
  if (ie) return;
1447
- const s = ++Z;
1450
+ const s = ++Y;
1448
1451
  P.value = !1, re?.abort(), re = null;
1449
1452
  const v = se.value;
1450
- if (l.value = !1, m.value = null, Y.value.length === 0) {
1451
- c.value = "缺少报表 ID", Oe(), J(c.value, "param");
1453
+ if (l.value = !1, m.value = null, J.value.length === 0) {
1454
+ c.value = "缺少报表 ID", Be(), Z(c.value, "param");
1452
1455
  return;
1453
1456
  }
1454
1457
  if (!v) {
1455
- c.value = "未提供渲染数据源 fetcher", Oe(), J(c.value, "config");
1458
+ c.value = "未提供渲染数据源 fetcher", Be(), Z(c.value, "config");
1456
1459
  return;
1457
1460
  }
1458
- l.value = !0, c.value = "", h.value = null, Oe();
1459
- const g = C.start(), z = new AbortController();
1461
+ l.value = !0, c.value = "", h.value = null, Be();
1462
+ const g = k.start(), z = new AbortController();
1460
1463
  re = z;
1461
1464
  const L = /* @__PURE__ */ new Set();
1462
1465
  function ae(W) {
1463
- s !== Z || z.signal.aborted || L.has(W) || (L.add(W), d.value.logger.warn("[mach-report] 报表告警:", W), n("warning", W));
1466
+ s !== Y || z.signal.aborted || L.has(W) || (L.add(W), d.value.logger.warn("[mach-report] 报表告警:", W), n("warning", W));
1464
1467
  }
1465
1468
  try {
1466
1469
  const W = await v({
1467
- reportIds: Y.value,
1470
+ reportIds: J.value,
1468
1471
  params: { ...Ht.value },
1469
1472
  signal: z.signal,
1470
1473
  onWarning: ae
1471
1474
  });
1472
- if (s !== Z) return;
1473
- const G = Ft(W);
1475
+ if (s !== Y) return;
1476
+ const G = Rt(W);
1474
1477
  if (!G.ok) {
1475
- const Be = G.errors.slice(0, 3).map(($t) => `${$t.path}: ${$t.message}`).join("; ");
1478
+ const We = G.errors.slice(0, 3).map((kt) => `${kt.path}: ${kt.message}`).join("; ");
1476
1479
  throw new pe(
1477
1480
  "validate",
1478
- `渲染计划校验失败(${G.errors.length} 处): ${Be}`
1481
+ `渲染计划校验失败(${G.errors.length} 处): ${We}`
1479
1482
  );
1480
1483
  }
1481
- if (G.warnings.forEach((Be) => ae(`${Be.path}: ${Be.message}`)), s !== Z || z.signal.aborted) return;
1482
- a.value = W, i.value = 1, C.end(g), $.value && ($.value.scrollTop = 0, $.value.scrollLeft = 0);
1483
- const ne = D.value ? lt : ot;
1484
- ne !== K && (K = ne, rt()), Ee.value === "fit" && ht(), n("loaded", W.pages.length);
1484
+ if (G.warnings.forEach((We) => ae(`${We.path}: ${We.message}`)), s !== Y || z.signal.aborted) return;
1485
+ a.value = W, i.value = 1, k.end(g), $.value && ($.value.scrollTop = 0, $.value.scrollLeft = 0);
1486
+ const ne = O.value ? st : lt;
1487
+ ne !== K && (K = ne, at()), $e.value === "fit" && bt(), n("loaded", W.pages.length);
1485
1488
  } catch (W) {
1486
- if (s !== Z) return;
1487
- const G = W instanceof pe ? W : W instanceof pn ? new pe(W.code, W.message, W.cause) : new pe(
1489
+ if (s !== Y) return;
1490
+ const G = W instanceof pe ? W : W instanceof mn ? new pe(W.code, W.message, W.cause) : new pe(
1488
1491
  "fetch",
1489
1492
  W instanceof Error ? W.message : "预览加载失败",
1490
1493
  W
1491
1494
  );
1492
1495
  c.value = G.message;
1493
- const ne = $r(G);
1494
- J(G.message, ne.code, ne.cause);
1496
+ const ne = kr(G);
1497
+ Z(G.message, ne.code, ne.cause);
1495
1498
  } finally {
1496
- s === Z && (l.value = !1), re === z && (re = null);
1499
+ s === Y && (l.value = !1), re === z && (re = null);
1497
1500
  }
1498
1501
  }
1499
1502
  function ue(s) {
@@ -1501,13 +1504,13 @@ const Fr = {
1501
1504
  const v = Math.max(1, Math.min(U.value, s));
1502
1505
  i.value = v;
1503
1506
  const g = $.value;
1504
- g && (g.scrollTop = Ye.pageOffsetPx(v - 1) * te.value, Je(g));
1507
+ g && (g.scrollTop = Ye.pageOffsetPx(v - 1) * te.value, Ge(g));
1505
1508
  }
1506
- const ke = En(a, {
1507
- getPdfExporter: gt,
1509
+ const Me = $n(a, {
1510
+ getPdfExporter: ht,
1508
1511
  getXlsxOptions: () => d.value.xlsx,
1509
1512
  onError: (s, v) => {
1510
- h.value = { kind: "error", message: s }, J(s, v ?? "print");
1513
+ h.value = { kind: "error", message: s }, Z(s, v ?? "print");
1511
1514
  },
1512
1515
  onWarning: (s) => {
1513
1516
  h.value = { kind: "warning", message: s }, n("warning", s);
@@ -1521,85 +1524,85 @@ const Fr = {
1521
1524
  onPrinting: (s) => {
1522
1525
  f.value = s;
1523
1526
  }
1524
- }), { releasePrintFrame: wt, dispose: Yt } = ke;
1525
- async function Xe() {
1526
- l.value || P.value || q.active.value && !await q.commit() || (m.value = null, await ke.print());
1527
+ }), { releasePrintFrame: yt, dispose: Yt } = Me;
1528
+ async function Qe() {
1529
+ l.value || P.value || q.active.value && !await q.commit() || (m.value = null, await Me.print());
1527
1530
  }
1528
- async function Qe(s) {
1529
- l.value || P.value || q.active.value && !await q.commit() || (m.value = null, await ke.exportAs(s));
1531
+ async function _e(s) {
1532
+ l.value || P.value || q.active.value && !await q.commit() || (m.value = null, await Me.exportAs(s));
1530
1533
  }
1531
- function _e() {
1534
+ function et() {
1532
1535
  if (l.value || P.value || q.active.value) {
1533
1536
  h.value = { kind: "warning", message: y.value.editingHint ?? "请先确认单元格修改" };
1534
1537
  return;
1535
1538
  }
1536
- m.value = null, ke.openPdfWindow();
1539
+ m.value = null, Me.openPdfWindow();
1537
1540
  }
1538
- async function yt(s, v = {}) {
1541
+ async function xt(s, v = {}) {
1539
1542
  ie || (ve.value = { ...ve.value, ...s }, v.reload !== !1 && await ge());
1540
1543
  }
1541
1544
  const Zt = {
1542
1545
  reload: ge,
1543
- print: Xe,
1544
- exportAs: Qe,
1545
- openPdfWindow: _e,
1546
+ print: Qe,
1547
+ exportAs: _e,
1548
+ openPdfWindow: et,
1546
1549
  gotoPage: ue,
1547
- setParams: yt,
1550
+ setParams: xt,
1548
1551
  checkPdfFont: De,
1549
- importExcel: et,
1550
- getPlan: xt,
1552
+ importExcel: tt,
1553
+ getPlan: Pt,
1551
1554
  getChanges: q.getChanges,
1552
1555
  get state() {
1553
1556
  return me.value;
1554
1557
  }
1555
1558
  };
1556
- It(wn, Zt);
1557
- function xt() {
1558
- return a.value ? structuredClone(a.value) : null;
1559
+ St(yn, Zt);
1560
+ function Pt() {
1561
+ return a.value ? ye(a.value) : null;
1559
1562
  }
1560
- async function et(s, v) {
1563
+ async function tt(s, v) {
1561
1564
  if (ie) throw new pe("config", "报表预览已卸载");
1562
- const g = ++Z;
1563
- re?.abort(), re = null, l.value = !1, q.cancel(), ke.invalidatePending(), P.value = !0, m.value = null, h.value = { kind: "progress", message: y.value.importing ?? "正在导入 Excel…" };
1565
+ const g = ++Y;
1566
+ re?.abort(), re = null, l.value = !1, q.cancel(), Me.invalidatePending(), P.value = !0, m.value = null, h.value = { kind: "progress", message: y.value.importing ?? "正在导入 Excel…" };
1564
1567
  try {
1565
1568
  const { importExcelTemplate: z } = await import("@agile-team/mach-report/xlsx");
1566
- if (g !== Z) return null;
1567
- const L = typeof Te.value == "object" ? Te.value : {}, ae = await z(s, { ...L, ...v, limits: { ...L.limits, ...v?.limits } });
1568
- if (g !== Z) return null;
1569
- const W = fn(structuredClone(ae.template), {}).plan, G = Ft(W);
1569
+ if (g !== Y) return null;
1570
+ const L = typeof Ie.value == "object" ? Ie.value : {}, ae = await z(s, { ...L, ...v, limits: { ...L.limits, ...v?.limits } });
1571
+ if (g !== Y) return null;
1572
+ const W = pn(ye(ae.template), {}).plan, G = Rt(W);
1570
1573
  if (!G.ok) throw new Error(G.errors.map((ne) => ne.message).slice(0, 3).join("; "));
1571
1574
  for (const ne of ae.warnings) {
1572
- if (g !== Z) return null;
1575
+ if (g !== Y) return null;
1573
1576
  n("warning", ne);
1574
1577
  }
1575
- return g !== Z ? null : (q.reset(), wt(), N.reset(), a.value = W, i.value = 1, c.value = "", h.value = ae.warnings.length ? { kind: "warning", message: ae.warnings.join(";") } : null, $.value && ($.value.scrollTop = 0, $.value.scrollLeft = 0), K = D.value ? lt : ot, rt(), n("template-import", ae), g === Z && n("loaded", W.pages.length), ae);
1578
+ return g !== Y ? null : (q.reset(), yt(), H.reset(), a.value = W, i.value = 1, c.value = "", h.value = ae.warnings.length ? { kind: "warning", message: ae.warnings.join(";") } : null, $.value && ($.value.scrollTop = 0, $.value.scrollLeft = 0), K = O.value ? st : lt, at(), n("template-import", ae), g === Y && n("loaded", W.pages.length), ae);
1576
1579
  } catch (z) {
1577
- if (g !== Z) return null;
1580
+ if (g !== Y) return null;
1578
1581
  const L = new pe("import", z instanceof Error ? z.message : "Excel 模板导入失败", z);
1579
- throw h.value = { kind: "error", message: L.message }, J(L.message, "import", z), L;
1582
+ throw h.value = { kind: "error", message: L.message }, Z(L.message, "import", z), L;
1580
1583
  } finally {
1581
- g === Z && (P.value = !1);
1584
+ g === Y && (P.value = !1);
1582
1585
  }
1583
1586
  }
1584
- function Jt(s) {
1587
+ function Gt(s) {
1585
1588
  const v = s.target, g = v.files?.[0];
1586
- v.value = "", g && et(g).catch(() => {
1589
+ v.value = "", g && tt(g).catch(() => {
1587
1590
  });
1588
1591
  }
1589
- const N = Sn({
1592
+ const H = On({
1590
1593
  plan: a,
1591
1594
  gotoPage: ue,
1592
1595
  debounceMs: F(() => d.value.preview.searchDebounceMs),
1593
1596
  highlight: Cn,
1594
- clearHighlights: $n
1597
+ clearHighlights: kn
1595
1598
  });
1596
- function Gt(s) {
1597
- s.ctrlKey && (s.preventDefault(), Ge(te.value * (s.deltaY < 0 ? 1.1 : 1 / 1.1)));
1598
- }
1599
1599
  function Xt(s) {
1600
+ s.ctrlKey && (s.preventDefault(), Xe(te.value * (s.deltaY < 0 ? 1.1 : 1 / 1.1)));
1601
+ }
1602
+ function Qt(s) {
1600
1603
  if (!(s.target instanceof Element && s.target.closest("input,textarea,select,[contenteditable='true']"))) {
1601
1604
  if ((s.ctrlKey || s.metaKey) && s.key.toLowerCase() === "f") {
1602
- s.preventDefault(), N.visible.value || N.toggle();
1605
+ s.preventDefault(), H.visible.value || H.toggle();
1603
1606
  return;
1604
1607
  }
1605
1608
  switch (s.key) {
@@ -1617,186 +1620,186 @@ const Fr = {
1617
1620
  break;
1618
1621
  case "+":
1619
1622
  case "=":
1620
- s.preventDefault(), Ge(te.value * 1.1);
1623
+ s.preventDefault(), Xe(te.value * 1.1);
1621
1624
  break;
1622
1625
  case "-":
1623
- s.preventDefault(), Ge(te.value / 1.1);
1626
+ s.preventDefault(), Xe(te.value / 1.1);
1624
1627
  break;
1625
1628
  }
1626
1629
  }
1627
1630
  }
1628
- function Qt() {
1631
+ function _t() {
1629
1632
  try {
1630
1633
  localStorage.setItem(
1631
1634
  K,
1632
- JSON.stringify({ zoomMode: Ee.value === "fit" ? "fit" : Math.round(te.value * 100) })
1635
+ JSON.stringify({ zoomMode: $e.value === "fit" ? "fit" : Math.round(te.value * 100) })
1633
1636
  );
1634
1637
  } catch {
1635
1638
  }
1636
1639
  }
1637
- _([Ee, te], Qt);
1638
- let tt = "";
1639
- const Pt = /* @__PURE__ */ new WeakMap();
1640
- function Et(s = !1) {
1641
- const v = N.activeMatch.value;
1642
- if (!D.value || !v) return;
1643
- const g = `${N.query.value}:${N.matchIndex.value}:${v.pageIndex}`;
1644
- if (!s && g === tt) return;
1640
+ _([$e, te], _t);
1641
+ let nt = "";
1642
+ const Et = /* @__PURE__ */ new WeakMap();
1643
+ function $t(s = !1) {
1644
+ const v = H.activeMatch.value;
1645
+ if (!O.value || !v) return;
1646
+ const g = `${H.query.value}:${H.matchIndex.value}:${v.pageIndex}`;
1647
+ if (!s && g === nt) return;
1645
1648
  const L = x.value?.querySelector(`[data-page="${v.pageIndex + 1}"]`)?.querySelectorAll("mark.mrp-hit")[v.occurrence];
1646
- L && (L.scrollIntoView?.({ block: "nearest", inline: "nearest" }), tt = g);
1649
+ L && (L.scrollIntoView?.({ block: "nearest", inline: "nearest" }), nt = g);
1647
1650
  }
1648
- kt(() => {
1651
+ Mt(() => {
1649
1652
  const s = a.value;
1650
1653
  if (!s) return;
1651
- const v = N.activeMatch.value;
1652
- N.matchIndex.value, v || (tt = ""), bt.value;
1654
+ const v = H.activeMatch.value;
1655
+ H.matchIndex.value, v || (nt = ""), wt.value;
1653
1656
  const g = x.value;
1654
1657
  if (!g) return;
1655
1658
  g.querySelectorAll(".mrp-page-holder").forEach((L) => {
1656
1659
  const ae = Number(L.dataset.page ?? 0) - 1, W = s.pages[ae];
1657
- if (!W || L.childElementCount > 0 && Pt.get(L) === W) {
1660
+ if (!W || L.childElementCount > 0 && Et.get(L) === W) {
1658
1661
  if (L.firstElementChild) {
1659
1662
  const ne = L.firstElementChild;
1660
- N.clear(ne), N.apply(ne);
1663
+ H.clear(ne), H.apply(ne);
1661
1664
  }
1662
1665
  return;
1663
1666
  }
1664
- L.style.width = `${W.pageWidthMm * We}px`;
1665
- const G = St(W, 96, {}, document);
1666
- N.apply(G), L.replaceChildren(G), Pt.set(L, W);
1667
- }), Et();
1668
- }, { flush: "post" }), _(() => N.query.value, (s) => {
1667
+ L.style.width = `${W.pageWidthMm * Ae}px`;
1668
+ const G = Ot(W, 96, {}, document);
1669
+ H.apply(G), L.replaceChildren(G), Et.set(L, W);
1670
+ }), $t();
1671
+ }, { flush: "post" }), _(() => H.query.value, (s) => {
1669
1672
  s || x.value?.querySelectorAll(".mrp-page-holder").forEach((v) => {
1670
- N.clear(v);
1673
+ H.clear(v);
1671
1674
  });
1672
1675
  });
1673
- const le = On(a, {
1676
+ const le = Bn(a, {
1674
1677
  thumbsRoot: w,
1675
1678
  visible: I,
1676
1679
  renderThumbCanvas: (s) => {
1677
1680
  try {
1678
- const v = a.value.pages[s], g = Math.min(0.2, 116 / Math.max(1, v.pageWidthMm * We)), { canvases: z } = mn(a.value, { start: s, end: s, dpr: g });
1681
+ const v = a.value.pages[s], g = Math.min(0.2, 116 / Math.max(1, v.pageWidthMm * Ae)), { canvases: z } = vn(a.value, { start: s, end: s, dpr: g });
1679
1682
  return z[0] ?? null;
1680
1683
  } catch {
1681
1684
  return null;
1682
1685
  }
1683
1686
  }
1684
1687
  });
1685
- kt(() => {
1688
+ Mt(() => {
1686
1689
  le.schedule();
1687
1690
  }, { flush: "post" });
1688
- const _t = F(() => r.debug), { debugStats: be } = Dn(_t, {
1691
+ const en = F(() => r.debug), { debugStats: be } = Dn(en, {
1689
1692
  plan: a,
1690
1693
  pageCount: U,
1691
1694
  windowRange: Ce,
1692
1695
  zoom: te,
1693
- loadMs: C.loadMs
1696
+ loadMs: k.loadMs
1694
1697
  });
1695
- function nt() {
1696
- Je($.value), le.schedule(), Ee.value === "fit" && ht(), Et(!0);
1697
- }
1698
1698
  function rt() {
1699
- $e(K === lt ? 100 : "fit");
1699
+ Ge($.value), le.schedule(), $e.value === "fit" && bt(), $t(!0);
1700
+ }
1701
+ function at() {
1702
+ ke(K === st ? 100 : "fit");
1700
1703
  try {
1701
1704
  const s = JSON.parse(localStorage.getItem(K) ?? "{}");
1702
- s.zoomMode === "fit" ? $e("fit") : typeof s.zoomMode == "number" && $e(s.zoomMode);
1705
+ s.zoomMode === "fit" ? ke("fit") : typeof s.zoomMode == "number" && ke(s.zoomMode);
1703
1706
  } catch {
1704
1707
  }
1705
1708
  }
1706
- return rn(() => {
1707
- window.addEventListener("resize", nt), typeof ResizeObserver < "u" && $.value && (Se = new ResizeObserver(nt), Se.observe($.value)), Je($.value), rt(), r.autoLoad && ge();
1708
- }), an(() => {
1709
- ie = !0, q.reset(), P.value = !1, Ve(), Z++, re?.abort(), re = null, window.removeEventListener("resize", nt), Se?.disconnect(), Se = null, le.destroy(), N.reset(), Yt();
1709
+ return an(() => {
1710
+ window.addEventListener("resize", rt), typeof ResizeObserver < "u" && $.value && (Oe = new ResizeObserver(rt), Oe.observe($.value)), Ge($.value), at(), r.autoLoad && ge();
1711
+ }), on(() => {
1712
+ ie = !0, q.reset(), P.value = !1, Ke(), Y++, re?.abort(), re = null, window.removeEventListener("resize", rt), Oe?.disconnect(), Oe = null, le.destroy(), H.reset(), Yt();
1710
1713
  }), _(
1711
- () => [JSON.stringify(Y.value), JSON.stringify(r.params), se.value],
1714
+ () => [JSON.stringify(J.value), JSON.stringify(r.params), se.value],
1712
1715
  () => {
1713
1716
  if (r.autoLoad) {
1714
1717
  ge();
1715
1718
  return;
1716
1719
  }
1717
- Z++, re?.abort(), re = null, l.value = !1, c.value = "", m.value = null, h.value = null, Oe();
1720
+ Y++, re?.abort(), re = null, l.value = !1, c.value = "", m.value = null, h.value = null, Be();
1718
1721
  }
1719
- ), t({ reload: ge, print: Xe, exportAs: Qe, openPdfWindow: _e, gotoPage: ue, setParams: yt, checkPdfFont: De, importExcel: et, getPlan: xt, getChanges: q.getChanges, state: me }), (s, v) => (k(), M("div", {
1720
- class: de(["mach-report-preview", { "mrp-wide-report": D.value }]),
1721
- style: ce(Ut.value)
1722
+ ), t({ reload: ge, print: Qe, exportAs: _e, openPdfWindow: et, gotoPage: ue, setParams: xt, checkPdfFont: De, importExcel: tt, getPlan: Pt, getChanges: q.getChanges, state: me }), (s, v) => (C(), M("div", {
1723
+ class: de(["mach-report-preview", { "mrp-wide-report": O.value }]),
1724
+ style: ce(Vt.value)
1722
1725
  }, [
1723
- oe.value && fe.value.length > 0 ? (k(), on(pr, {
1726
+ oe.value && fe.value.length > 0 ? (C(), ln(mr, {
1724
1727
  key: 0,
1725
1728
  defs: fe.value,
1726
1729
  modelValue: ve.value,
1727
1730
  "onUpdate:modelValue": v[0] || (v[0] = (g) => ve.value = g),
1728
1731
  messages: y.value,
1729
- attempted: Ke.value,
1730
- onQuery: jt,
1731
- onReset: qt
1732
+ attempted: Je.value,
1733
+ onQuery: qt,
1734
+ onReset: Ut
1732
1735
  }, null, 8, ["defs", "modelValue", "messages", "attempted"])) : j("", !0),
1733
- ln(tr, {
1736
+ sn(nr, {
1734
1737
  "page-count": U.value,
1735
1738
  "current-page": i.value,
1736
- "zoom-mode": E(Ee),
1739
+ "zoom-mode": E($e),
1737
1740
  zoom: E(te),
1738
1741
  "show-export": T.value,
1739
1742
  "show-print": B.value,
1740
1743
  "show-pdf-window": V.value,
1741
1744
  messages: y.value,
1742
- search: { visible: E(N).visible.value, query: E(N).query.value, matchIndex: E(N).matchIndex.value, matchCount: E(N).matchCount.value, searching: E(N).searching.value },
1745
+ search: { visible: E(H).visible.value, query: E(H).query.value, matchIndex: E(H).matchIndex.value, matchCount: E(H).matchCount.value, searching: E(H).searching.value },
1743
1746
  "thumbs-visible": I.value,
1744
- "show-import": !!Te.value,
1747
+ "show-import": !!Ie.value,
1745
1748
  busy: l.value || P.value || E(q).saving.value,
1746
1749
  onGoto: ue,
1747
- onZoom: E($e),
1748
- onExport: v[1] || (v[1] = (g) => Qe(g)),
1749
- onPrint: Xe,
1750
- onPdfWindow: _e,
1751
- onSearchInput: E(N).onInput,
1752
- onSearchNav: E(N).onNav,
1753
- onSearchToggle: E(N).toggle,
1750
+ onZoom: E(ke),
1751
+ onExport: v[1] || (v[1] = (g) => _e(g)),
1752
+ onPrint: Qe,
1753
+ onPdfWindow: et,
1754
+ onSearchInput: E(H).onInput,
1755
+ onSearchNav: E(H).onNav,
1756
+ onSearchToggle: E(H).toggle,
1754
1757
  onThumbsToggle: v[2] || (v[2] = (g) => I.value = !I.value),
1755
- onImportExcel: v[3] || (v[3] = (g) => O.value?.click())
1758
+ onImportExcel: v[3] || (v[3] = (g) => D.value?.click())
1756
1759
  }, null, 8, ["page-count", "current-page", "zoom-mode", "zoom", "show-export", "show-print", "show-pdf-window", "messages", "search", "thumbs-visible", "show-import", "busy", "onZoom", "onSearchInput", "onSearchNav", "onSearchToggle"]),
1757
- Te.value ? (k(), M("input", {
1760
+ Ie.value ? (C(), M("input", {
1758
1761
  key: 1,
1759
1762
  ref_key: "importInputRef",
1760
- ref: O,
1763
+ ref: D,
1761
1764
  class: "mrp-import-input",
1762
1765
  type: "file",
1763
1766
  accept: ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1764
1767
  hidden: "",
1765
- onChange: Jt
1768
+ onChange: Gt
1766
1769
  }, null, 544)) : j("", !0),
1767
- mt.value && U.value > 0 ? (k(), M("div", Fr, R(E(q).saving.value ? y.value.saving : y.value.editingHint), 1)) : j("", !0),
1768
- h.value ? (k(), M("div", {
1770
+ vt.value && U.value > 0 ? (C(), M("div", Rr, R(E(q).saving.value ? y.value.saving : y.value.editingHint), 1)) : j("", !0),
1771
+ h.value ? (C(), M("div", {
1769
1772
  key: 3,
1770
1773
  class: de(["mrp-export-notice", `mrp-export-${h.value.kind}`]),
1771
1774
  role: "alert"
1772
1775
  }, R(h.value.message), 3)) : j("", !0),
1773
- p.value.status === "error" && (T.value || V.value) ? (k(), M("div", Rr, [
1774
- st(R(y.value.pdfFontUnavailable) + " ", 1),
1776
+ p.value.status === "error" && (T.value || V.value) ? (C(), M("div", Tr, [
1777
+ it(R(y.value.pdfFontUnavailable) + " ", 1),
1775
1778
  S("button", {
1776
1779
  type: "button",
1777
- onClick: zt
1780
+ onClick: Nt
1778
1781
  }, R(y.value.retry), 1)
1779
1782
  ])) : j("", !0),
1780
- S("div", Tr, [
1783
+ S("div", Ir, [
1781
1784
  S("div", {
1782
1785
  ref_key: "viewportRef",
1783
1786
  ref: $,
1784
1787
  class: "mrp-body",
1785
1788
  tabindex: "0",
1786
- onWheel: Gt,
1787
- onKeydown: Xt,
1789
+ onWheel: Xt,
1790
+ onKeydown: Qt,
1788
1791
  onDblclick: v[4] || (v[4] = //@ts-ignore
1789
1792
  (...g) => E(q).onDoubleClick && E(q).onDoubleClick(...g)),
1790
- onScrollPassive: v[5] || (v[5] = (g) => E(Kt)(g.target))
1793
+ onScrollPassive: v[5] || (v[5] = (g) => E(Jt)(g.target))
1791
1794
  }, [
1792
- l.value ? (k(), M("div", Ir, R(y.value.loading), 1)) : c.value ? (k(), M("div", Sr, [
1793
- st(R(c.value) + " ", 1),
1795
+ l.value ? (C(), M("div", Sr, R(y.value.loading), 1)) : c.value ? (C(), M("div", Or, [
1796
+ it(R(c.value) + " ", 1),
1794
1797
  S("button", {
1795
1798
  class: "mrp-retry",
1796
1799
  type: "button",
1797
1800
  onClick: ge
1798
1801
  }, R(y.value.retry), 1)
1799
- ])) : !a.value || U.value === 0 ? (k(), M("div", Dr, R(y.value.empty), 1)) : (k(), M("div", {
1802
+ ])) : !a.value || U.value === 0 ? (C(), M("div", Dr, R(y.value.empty), 1)) : (C(), M("div", {
1800
1803
  key: 3,
1801
1804
  class: "mrp-scale",
1802
1805
  style: ce({ width: `${E(Ze).w * E(te)}px`, height: `${E(Ze).h * E(te)}px` })
@@ -1807,18 +1810,18 @@ const Fr = {
1807
1810
  class: "mrp-scale-inner",
1808
1811
  style: ce({ transform: `scale(${E(te)})`, transformOrigin: "top left", width: `${E(Ze).w}px` })
1809
1812
  }, [
1810
- E(Ce).padTopPx > 0 ? (k(), M("div", {
1813
+ E(Ce).padTopPx > 0 ? (C(), M("div", {
1811
1814
  key: 0,
1812
1815
  class: "mrp-spacer-top",
1813
1816
  style: ce({ height: `${E(Ce).padTopPx}px` }),
1814
1817
  "aria-hidden": "true"
1815
1818
  }, null, 4)) : j("", !0),
1816
- (k(!0), M(Fe, null, ze(E(bt), (g) => (k(), M("div", {
1819
+ (C(!0), M(Re, null, Ne(E(wt), (g) => (C(), M("div", {
1817
1820
  key: g.index,
1818
1821
  class: "mrp-page-holder",
1819
1822
  "data-page": g.index + 1
1820
- }, null, 8, Or))), 128)),
1821
- E(Ce).padBottomPx > 0 ? (k(), M("div", {
1823
+ }, null, 8, Br))), 128)),
1824
+ E(Ce).padBottomPx > 0 ? (C(), M("div", {
1822
1825
  key: 1,
1823
1826
  class: "mrp-spacer-bottom",
1824
1827
  style: ce({ height: `${E(Ce).padBottomPx}px` }),
@@ -1827,7 +1830,7 @@ const Fr = {
1827
1830
  ], 4)
1828
1831
  ], 4))
1829
1832
  ], 544),
1830
- I.value && U.value > 0 ? (k(), M("aside", {
1833
+ I.value && U.value > 0 ? (C(), M("aside", {
1831
1834
  key: 0,
1832
1835
  ref_key: "thumbsRef",
1833
1836
  ref: w,
@@ -1835,13 +1838,13 @@ const Fr = {
1835
1838
  onScrollPassive: v[6] || (v[6] = //@ts-ignore
1836
1839
  (...g) => E(le).onScroll && E(le).onScroll(...g))
1837
1840
  }, [
1838
- E(le).windowRange.value.padTopPx > 0 ? (k(), M("div", {
1841
+ E(le).windowRange.value.padTopPx > 0 ? (C(), M("div", {
1839
1842
  key: 0,
1840
1843
  class: "mrp-thumb-spacer",
1841
1844
  style: ce({ height: `${E(le).windowRange.value.padTopPx}px` }),
1842
1845
  "aria-hidden": "true"
1843
1846
  }, null, 4)) : j("", !0),
1844
- (k(!0), M(Fe, null, ze(E(le).visibleThumbs.value, (g) => (k(), M("div", {
1847
+ (C(!0), M(Re, null, Ne(E(le).visibleThumbs.value, (g) => (C(), M("div", {
1845
1848
  key: g.index,
1846
1849
  class: de(["mrp-thumb", { "mrp-thumb-active": g.index + 1 === i.value }]),
1847
1850
  style: ce({ height: `${g.height + 20}px` }),
@@ -1851,10 +1854,10 @@ const Fr = {
1851
1854
  class: "mrp-thumb-box",
1852
1855
  "data-thumb": g.index + 1,
1853
1856
  style: ce({ height: `${g.height}px` })
1854
- }, null, 12, Wr),
1855
- S("span", Ar, R(g.index + 1), 1)
1856
- ], 14, Br))), 128)),
1857
- E(le).windowRange.value.padBottomPx > 0 ? (k(), M("div", {
1857
+ }, null, 12, Ar),
1858
+ S("span", Lr, R(g.index + 1), 1)
1859
+ ], 14, Wr))), 128)),
1860
+ E(le).windowRange.value.padBottomPx > 0 ? (C(), M("div", {
1858
1861
  key: 1,
1859
1862
  class: "mrp-thumb-spacer",
1860
1863
  style: ce({ height: `${E(le).windowRange.value.padBottomPx}px` }),
@@ -1862,10 +1865,10 @@ const Fr = {
1862
1865
  }, null, 4)) : j("", !0)
1863
1866
  ], 544)) : j("", !0)
1864
1867
  ]),
1865
- S("div", Lr, [
1866
- sn(s.$slots, "default", {}, void 0, !0)
1868
+ S("div", zr, [
1869
+ un(s.$slots, "default", {}, void 0, !0)
1867
1870
  ]),
1868
- E(be) ? (k(), M("div", zr, [
1871
+ E(be) ? (C(), M("div", Nr, [
1869
1872
  v[7] || (v[7] = S("div", null, "mach-report debug", -1)),
1870
1873
  S("div", null, "pages: " + R(E(be).pages) + " | window: [" + R(E(be).window) + "]", 1),
1871
1874
  S("div", null, "zoom: " + R(E(be).zoom) + " | load: " + R(E(be).loadMs), 1),
@@ -1873,35 +1876,35 @@ const Fr = {
1873
1876
  ])) : j("", !0)
1874
1877
  ], 6));
1875
1878
  }
1876
- }), Nr = /* @__PURE__ */ pt(Hr, [["__scopeId", "data-v-8dab9187"]]), _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1879
+ }), jr = /* @__PURE__ */ mt(Hr, [["__scopeId", "data-v-fa6fd3bb"]]), ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1877
1880
  __proto__: null,
1878
- default: Nr
1881
+ default: jr
1879
1882
  }, Symbol.toStringTag, { value: "Module" }));
1880
1883
  export {
1881
- mr as D,
1884
+ vr as D,
1882
1885
  pe as M,
1883
- at as P,
1884
- pr as R,
1885
- Xr as S,
1886
- vr as a,
1887
- Nr as b,
1888
- tr as c,
1889
- Wt as d,
1890
- Pn as e,
1891
- Er as f,
1886
+ ot as P,
1887
+ mr as R,
1888
+ Qr as S,
1889
+ gr as a,
1890
+ jr as b,
1891
+ nr as c,
1892
+ At as d,
1893
+ En as e,
1894
+ $r as f,
1892
1895
  Zr as g,
1893
- gr as h,
1894
- Gr as i,
1896
+ hr as h,
1897
+ Xr as i,
1895
1898
  Yr as j,
1896
- Qr as k,
1897
- $r as l,
1898
- yn as m,
1899
- Bt as n,
1900
- En as o,
1901
- Jr as p,
1902
- xn as q,
1903
- hr as r,
1904
- _r as s,
1905
- br as t,
1906
- wr as u
1899
+ _r as k,
1900
+ kr as l,
1901
+ xn as m,
1902
+ Wt as n,
1903
+ $n as o,
1904
+ Gr as p,
1905
+ Pn as q,
1906
+ br as r,
1907
+ ea as s,
1908
+ wr as t,
1909
+ yr as u
1907
1910
  };