@silurus/ooxml 0.89.0 → 0.89.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -1
  2. package/dist/assets/render-worker-Bye3wDV9.js +35 -0
  3. package/dist/assets/render-worker-CyUrUidp.js +16 -0
  4. package/dist/assets/render-worker-D_SMt5nl.js +15 -0
  5. package/dist/bounded-raw-part-cache-C3daknU-.js +33925 -0
  6. package/dist/{canvas-viewer-mechanics-DfQqRKkD.js → canvas-viewer-mechanics-SZWSnn6j.js} +2 -2
  7. package/dist/{cfb-guard-9QTRTg7f.js → cfb-guard-dNeUiANF.js} +1 -1
  8. package/dist/chart-ex.mjs +477 -477
  9. package/dist/{comment-overlay-controller-B5_zGgG5.js → comment-overlay-controller-CHDxT0e7.js} +16 -16
  10. package/dist/{comment-ui-runtime-Jy-3goA9.js → comment-ui-runtime-BcwaRnMR.js} +3 -3
  11. package/dist/{comment-ui-runtime-D_sb2K6s.js → comment-ui-runtime-Dk2qrPy_.js} +3 -3
  12. package/dist/{document-model-source-BKNrXjAL.js → document-model-source-BD2VSd2L.js} +44 -44
  13. package/dist/{document-pull-client-CxONDGbk.js → document-pull-client-DhSGspvi.js} +6102 -7994
  14. package/dist/{document-pull-worker-AMyXYpPq.js → document-pull-worker-D-E0Iz3P.js} +18 -18
  15. package/dist/{docx-DhDnKEI6.js → docx-CCZBO1WQ.js} +556 -556
  16. package/dist/{docx-D91ER1_S.js → docx-CXfILbzI.js} +24 -24
  17. package/dist/{docx-model-source-CdrSt3hF.js → docx-model-source-Ci6xb487.js} +12 -12
  18. package/dist/docx.mjs +4 -4
  19. package/dist/docx_parser_bg.wasm +0 -0
  20. package/dist/{drawingml-shape-ChcGZNd8.js → drawingml-shape-Bp0yEZHC.js} +55 -55
  21. package/dist/{duotone-ekYik4ix.js → duotone-DN8P4aXe.js} +1 -1
  22. package/dist/{emf-UT6I8rVi.js → emf-CGFQIz6c.js} +60 -60
  23. package/dist/{font-preload-demand-CdJZUMCT.js → font-preload-demand-CGOB-MoE.js} +2 -2
  24. package/dist/{grid-geometry-uQOgViJU.js → grid-geometry-C3IG20ut.js} +1 -1
  25. package/dist/{host-layout-measure-CCEgaC_v.js → host-layout-measure-BAysJILu.js} +1 -1
  26. package/dist/index.mjs +3 -3
  27. package/dist/internal-companion.mjs +2 -2
  28. package/dist/{line-distribute-CPOV6csk.js → line-distribute-DhQqysA2.js} +153 -70
  29. package/dist/{model-source-DJGzDtGb.js → model-source-BkmyX_r-.js} +4 -4
  30. package/dist/{model-source-session-Bu9CHFHc.js → model-source-session-CF4iXav8.js} +18 -18
  31. package/dist/{model-source-session-sKpNiIJI.js → model-source-session-CJmkItIK.js} +10 -10
  32. package/dist/{model-source-session-CDuijwv1.js → model-source-session-CnPCTRDD.js} +2 -2
  33. package/dist/node.mjs +5 -5
  34. package/dist/{bounded-raw-part-cache-B7JoC1CD.js → plot-area-frame-Bs_j4uu7.js} +15189 -37964
  35. package/dist/{pptx-C_uxLVKB.js → pptx-BhmLP_Ed.js} +9 -9
  36. package/dist/{pptx-CDP9dZHe.js → pptx-Bo9hCGQU.js} +58 -58
  37. package/dist/{pptx-model-source-O7LhpOjz.js → pptx-model-source-J0SrVkO6.js} +5 -5
  38. package/dist/pptx.mjs +5 -5
  39. package/dist/pptx_parser_bg.wasm +0 -0
  40. package/dist/{presentation-model-source-tmROzteR.js → presentation-model-source-CebYmrOD.js} +5 -5
  41. package/dist/region-map.mjs +53 -53
  42. package/dist/{render-CJVglUHl.js → render-hT2OVZUi.js} +2 -2
  43. package/dist/{render-worker-host-CyxPU4JU.js → render-worker-host-BmAQ-sWT.js} +1 -1
  44. package/dist/{render-worker-host-aF6aWkC0.js → render-worker-host-Cz224I38.js} +1 -1
  45. package/dist/{render-worker-host-BseIaVvm.js → render-worker-host-Desevuoc.js} +1 -1
  46. package/dist/renderer-BFWqhLEt.js +5833 -0
  47. package/dist/{renderer-CkGLj0CC.js → renderer-CvZ4JmoL.js} +696 -696
  48. package/dist/{resource-measurement-mXw-WjMF.js → resource-measurement-DBiUwblM.js} +162 -161
  49. package/dist/{session-Csv9maad.js → session-CWDKFWCh.js} +176 -176
  50. package/dist/{slide-pull-client-DRZYwBTu.js → slide-pull-client-BuBvXMyc.js} +1454 -1484
  51. package/dist/{three-d-BK5siJgJ.js → three-d-BKwNPAP4.js} +107 -107
  52. package/dist/three-d.mjs +625 -625
  53. package/dist/{wasm-runtime-generation-DX4y0Ecl.js → wasm-runtime-generation-BWGfM44b.js} +4 -4
  54. package/dist/{workbook-model-source-BTC4ISTS.js → workbook-model-source-Che8Zbjw.js} +6 -6
  55. package/dist/worker-source-DrwhR9fw.js +22 -0
  56. package/dist/{worksheet-pull-client-CkHgbtyM.js → worksheet-pull-client-Cxzj6uuB.js} +74 -74
  57. package/dist/{xlsx-D5569TPf.js → xlsx-C5BSwMUd.js} +24 -24
  58. package/dist/{xlsx-CpSDPAEU.js → xlsx-CUVUep5I.js} +433 -421
  59. package/dist/{xlsx-model-source-DPSkjFic.js → xlsx-model-source-C3_PiPBo.js} +55 -55
  60. package/dist/xlsx.mjs +5 -5
  61. package/dist/xlsx_parser_bg.wasm +0 -0
  62. package/package.json +2 -2
  63. package/dist/assets/render-worker-CUOU6mL2.js +0 -16
  64. package/dist/assets/render-worker-DOqrFhSU.js +0 -15
  65. package/dist/assets/render-worker-DvWUdZUN.js +0 -35
  66. package/dist/plot-area-frame-CaJFvZ7p.js +0 -8502
  67. package/dist/renderer-Czw1cCC7.js +0 -5823
  68. package/dist/worker-source-I1cIYBel.js +0 -22
@@ -1,4 +1,4 @@
1
- import { $t as e, Dr as t, Er as n, Gr as r, Hr as i, Jr as a, Kr as o, Tr as s, Ur as c, Yi as l, Yr as u, an as d, en as f, f as p, g as m, nn as h, p as g, qn as _, rn as v, tn as y, vt as b, wr as x } from "./plot-area-frame-CaJFvZ7p.js";
1
+ import { $t as e, Qr as t, Sr as n, Zr as r, an as i, br as a, ei as o, en as s, f as c, g as l, ia as u, ii as d, nn as f, p, qn as m, ri as h, rn as g, ti as _, tn as v, vt as y, xr as b, yr as x } from "./plot-area-frame-Bs_j4uu7.js";
2
2
  //#region packages/core/src/chart/rich-data-label.ts
3
3
  var S = 4096, C = 4, w = S;
4
4
  function T(e, t, n, r) {
@@ -8,9 +8,9 @@ function T(e, t, n, r) {
8
8
  return /^[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$/.test(t) ? `#${t}` : null;
9
9
  };
10
10
  outer: for (let c = 0; c < t.runs.length && c < w; c++) {
11
- let u = t.runs[c];
12
- u.text !== "\n" && a[i.length - 1] == null && (a[i.length - 1] = u.paragraphAlign ?? null);
13
- let d = l(u.fontSizeHpt, t.ptToPx) ?? n, f = u.fontFace?.trim().replaceAll("\"", ""), p = f && !f.startsWith("+") ? f : null, m = f && t.fontFamilyForFace ? t.fontFamilyForFace(f) : p ? b(p) : t.fontFamily, h = `${u.italic ?? t.fallbackItalic ?? !1 ? "italic " : ""}${u.bold ?? t.fallbackBold ? "bold " : ""}${d}px ${m}`, g = (u.baseline ?? t.fallbackBaseline ?? 0) * d, _ = u.colorPaintAuthored === !0 || u.color != null || u.colorHidden === !0 ? u.colorHidden === !0 ? null : s(u.color) : t.fallbackColorHidden === !0 ? null : r, v = "", y = () => {
11
+ let l = t.runs[c];
12
+ l.text !== "\n" && a[i.length - 1] == null && (a[i.length - 1] = l.paragraphAlign ?? null);
13
+ let d = u(l.fontSizeHpt, t.ptToPx) ?? n, f = l.fontFace?.trim().replaceAll("\"", ""), p = f && !f.startsWith("+") ? f : null, m = f && t.fontFamilyForFace ? t.fontFamilyForFace(f) : p ? y(p) : t.fontFamily, h = `${l.italic ?? t.fallbackItalic ?? !1 ? "italic " : ""}${l.bold ?? t.fallbackBold ? "bold " : ""}${d}px ${m}`, g = (l.baseline ?? t.fallbackBaseline ?? 0) * d, _ = l.colorPaintAuthored === !0 || l.color != null || l.colorHidden === !0 ? l.colorHidden === !0 ? null : s(l.color) : t.fallbackColorHidden === !0 ? null : r, v = "", b = () => {
14
14
  v &&= (e.font = h, i[i.length - 1].push({
15
15
  text: v,
16
16
  font: h,
@@ -20,7 +20,7 @@ function T(e, t, n, r) {
20
20
  baselineShiftPx: g
21
21
  }), "");
22
22
  }, x = !1;
23
- for (let e of u.text) {
23
+ for (let e of l.text) {
24
24
  if (x && e === "\n") {
25
25
  x = !1;
26
26
  continue;
@@ -28,24 +28,24 @@ function T(e, t, n, r) {
28
28
  x = !1;
29
29
  let t = e === "\r" ? "\n" : e;
30
30
  if (e === "\r" && (x = !0), o >= S) {
31
- y();
31
+ b();
32
32
  break outer;
33
33
  }
34
34
  if (o++, t === "\n") {
35
- if (y(), i.length >= C) break outer;
36
- i.push([]), a.push(u.paragraphAlign ?? null);
35
+ if (b(), i.length >= C) break outer;
36
+ i.push([]), a.push(l.paragraphAlign ?? null);
37
37
  } else v += t;
38
38
  }
39
- y();
39
+ b();
40
40
  }
41
41
  if (!i.some((e) => e.length > 0)) return null;
42
- let c = i.map((e) => Math.max(n * 1.15, ...e.map((e) => e.fontSizePx * 1.15 + Math.abs(e.baselineShiftPx)))), u = i.map((e) => e.reduce((e, t) => e + t.width, 0));
42
+ let c = i.map((e) => Math.max(n * 1.15, ...e.map((e) => e.fontSizePx * 1.15 + Math.abs(e.baselineShiftPx)))), l = i.map((e) => e.reduce((e, t) => e + t.width, 0));
43
43
  return {
44
44
  lines: i,
45
45
  lineAligns: a,
46
46
  lineHeights: c,
47
- lineWidths: u,
48
- width: Math.max(0, ...u),
47
+ lineWidths: l,
48
+ width: Math.max(0, ...l),
49
49
  height: c.reduce((e, t) => e + t, 0)
50
50
  };
51
51
  }
@@ -187,7 +187,7 @@ function R() {
187
187
  L || (L = !0, typeof console < "u" && typeof console.warn == "function" && console.warn("[ooxml] scene3d: no offscreen canvas available — using the direct warp fallback (per-cell bleed only, no supersample). Textured-source seams may be faintly visible; the silhouette and geometry are unaffected."));
188
188
  }
189
189
  var z = 2;
190
- function B(e, t, n, r, a, o, s, c, l, u, d) {
190
+ function B(e, t, n, i, a, o, s, c, l, u, d) {
191
191
  let f = a.map((e) => ({
192
192
  x: o[0] * e.x + o[2] * e.y + o[4],
193
193
  y: o[1] * e.x + o[3] * e.y + o[5]
@@ -196,7 +196,7 @@ function B(e, t, n, r, a, o, s, c, l, u, d) {
196
196
  p = Math.floor(p) - 1, m = Math.floor(m) - 1, h = Math.ceil(h) + 1, g = Math.ceil(g) + 1;
197
197
  let _ = h - p, v = g - m;
198
198
  if (_ <= 0 || v <= 0) return !1;
199
- let y = Math.max(1, Math.ceil(_ * z)), b = Math.max(1, Math.ceil(v * z)), x = i(y, b);
199
+ let y = Math.max(1, Math.ceil(_ * z)), b = Math.max(1, Math.ceil(v * z)), x = r(y, b);
200
200
  if (!x || x.width !== y || x.height !== b) return !1;
201
201
  let S = x.getContext("2d") ?? null;
202
202
  if (!S) return !1;
@@ -208,7 +208,7 @@ function B(e, t, n, r, a, o, s, c, l, u, d) {
208
208
  (o[4] - p) * C,
209
209
  (o[5] - m) * C
210
210
  ];
211
- S.save(), S.setTransform(w[0], w[1], w[2], w[3], w[4], w[5]), S.beginPath(), S.moveTo(a[0].x, a[0].y), S.lineTo(a[1].x, a[1].y), S.lineTo(a[2].x, a[2].y), S.lineTo(a[3].x, a[3].y), S.closePath(), S.clip(), M(S, e, n, r, w, s, c, l, 0, 0, 1, 1, u * C, d), S.restore(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0);
211
+ S.save(), S.setTransform(w[0], w[1], w[2], w[3], w[4], w[5]), S.beginPath(), S.moveTo(a[0].x, a[0].y), S.lineTo(a[1].x, a[1].y), S.lineTo(a[2].x, a[2].y), S.lineTo(a[3].x, a[3].y), S.closePath(), S.clip(), M(S, e, n, i, w, s, c, l, 0, 0, 1, 1, u * C, d), S.restore(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0);
212
212
  let T = t.imageSmoothingEnabled, E = t.imageSmoothingQuality;
213
213
  return t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high", t.drawImage(x, 0, 0, _ * C, v * C, p, m, _, v), t.imageSmoothingEnabled = T, t.imageSmoothingQuality = E, t.restore(), !0;
214
214
  }
@@ -227,7 +227,7 @@ function V(e, t) {
227
227
  I(e, i, a),
228
228
  I(e, n, a)
229
229
  ];
230
- return o.every((e) => e != null) ? o : u();
230
+ return o.every((e) => e != null) ? o : d();
231
231
  }
232
232
  function H(e, t) {
233
233
  if (e.length !== 4) return null;
@@ -236,7 +236,7 @@ function H(e, t) {
236
236
  projected: t(e),
237
237
  index: n
238
238
  })).sort((e, t) => e.projected.y - t.projected.y || e.projected.x - t.projected.x);
239
- n.some(({ projected: e }) => ![e.x, e.y].every(Number.isFinite)) && u();
239
+ n.some(({ projected: e }) => ![e.x, e.y].every(Number.isFinite)) && d();
240
240
  let r = n.slice(0, 2).sort((e, t) => e.projected.x - t.projected.x), i = n.slice(2).sort((e, t) => e.projected.x - t.projected.x);
241
241
  return new Set([...r, ...i].map((e) => e.index)).size === 4 ? [
242
242
  r[0].scenePoint,
@@ -276,51 +276,51 @@ function K(e, t) {
276
276
  heightPt: r
277
277
  } : null;
278
278
  }
279
- function q(i, l, b, S, C, w, T, E, D, O, k = 1) {
280
- let A = e(l, S, C, D), j = (e, t = 0, n = 1) => {
281
- if (!O) return b;
279
+ function q(r, u, y, S, C, w, T, E, D, O, k = 1) {
280
+ let A = e(u, S, C, D), j = (e, t = 0, n = 1) => {
281
+ if (!O) return y;
282
282
  let r = G(e[3], e[2], w.modelDepth) / k, i = G(e[3], e[0], w.modelDepth) * (n - t) / k;
283
283
  return [r, i].every((e) => Number.isFinite(e) && e > 0) ? O(r, i) : null;
284
284
  };
285
285
  if (!A) return !1;
286
- w.inner.length !== 4 && u();
286
+ w.inner.length !== 4 && d();
287
287
  let M;
288
288
  try {
289
- M = x(l.srcRect);
289
+ M = x(u.srcRect);
290
290
  } catch {
291
- u();
291
+ d();
292
292
  }
293
293
  let P = (e) => {
294
- let n = r(e), i = t(e), a = n ? {
295
- w: n.width,
296
- h: n.height
297
- } : i;
298
- [a.w, a.h].every((e) => Number.isFinite(e) && e > 0) || u();
299
- let o = s(n ? {
300
- width: n.width,
301
- height: n.height
302
- } : e, l.srcRect, M), c = n?.x ?? 0, d = n?.y ?? 0;
294
+ let t = o(e), r = n(e), i = t ? {
295
+ w: t.width,
296
+ h: t.height
297
+ } : r;
298
+ [i.w, i.h].every((e) => Number.isFinite(e) && e > 0) || d();
299
+ let s = a(t ? {
300
+ width: t.width,
301
+ height: t.height
302
+ } : e, u.srcRect, M), c = t?.x ?? 0, l = t?.y ?? 0;
303
303
  return {
304
- grid: i,
305
- natural: a,
306
- crop: o,
307
- sourceRect: o ? {
308
- x0: c + o.sx,
309
- y0: d + o.sy,
310
- x1: c + o.sx + o.sw,
311
- y1: d + o.sy + o.sh
312
- } : n ? {
304
+ grid: r,
305
+ natural: i,
306
+ crop: s,
307
+ sourceRect: s ? {
308
+ x0: c + s.sx,
309
+ y0: l + s.sy,
310
+ x1: c + s.sx + s.sw,
311
+ y1: l + s.sy + s.sh
312
+ } : t ? {
313
313
  x0: c,
314
- y0: d,
315
- x1: c + a.w,
316
- y1: d + a.h
314
+ y0: l,
315
+ x1: c + i.w,
316
+ y1: l + i.h
317
317
  } : void 0
318
318
  };
319
- }, { natural: F } = P(b);
320
- if (A.mode === "stack" && m(b)) return !1;
319
+ }, { natural: F } = P(y);
320
+ if (A.mode === "stack" && l(y)) return !1;
321
321
  let I = (e, t) => {
322
322
  let n = P(e);
323
- N(e, i, n.grid.w, n.grid.h, t, .5, n.sourceRect);
323
+ N(e, r, n.grid.w, n.grid.h, t, .5, n.sourceRect);
324
324
  }, L = [
325
325
  E(w.inner[3]),
326
326
  E(w.inner[2]),
@@ -335,120 +335,120 @@ function q(i, l, b, S, C, w, T, E, D, O, k = 1) {
335
335
  E(R(e[2], e[1], n)),
336
336
  E(R(e[2], e[1], t)),
337
337
  E(R(e[3], e[0], t))
338
- ], B = A.mode === "stack" ? W(w.pictureStackAspect, F.w, F.h) : null, H = A.mode === "tile" ? p(l, b) : null, K = [];
338
+ ], B = A.mode === "stack" ? W(w.pictureStackAspect, F.w, F.h) : null, H = A.mode === "tile" ? c(u, y) : null, K = [];
339
339
  try {
340
340
  if (A.mode === "stack") {
341
- B ?? u();
341
+ B ?? d();
342
342
  let e = 0, t = !1;
343
343
  for (let n of T) {
344
- if (!f(A, n) || !U(w, C, n, E)) continue;
345
- let r = h(A, n) ? Math.ceil(1 / B) : 1;
346
- r < 1 && u(), a(r, d), e += r, a(e, d), t = !0;
344
+ if (!s(A, n) || !U(w, C, n, E)) continue;
345
+ let r = f(A, n) ? Math.ceil(1 / B) : 1;
346
+ r < 1 && d(), h(r, i), e += r, h(e, i), t = !0;
347
347
  }
348
348
  if (!t) return !1;
349
349
  }
350
350
  if (A.mode === "tile") {
351
- H || u();
352
- let e = 0, t = 0, n = !1;
353
- for (let r of T) {
354
- if (!f(A, r)) continue;
355
- let s = U(w, C, r, E);
356
- if (!s) continue;
357
- let p = G(s[0], s[1], w.modelDepth), m = G(s[0], s[3], w.modelDepth);
358
- if ([p, m].every(Number.isFinite) || u(), !(p > 0) || !(m > 0)) continue;
359
- let h = g(H, p, m), v = o(b, l.srcRect != null), y = Math.floor(-h.x / H.tileW) - v.x, x = Math.floor(-h.y / H.tileH) - v.y, S = Math.ceil((p - h.x) / H.tileW) + v.x, T = Math.ceil((m - h.y) / H.tileH) + v.y;
351
+ H || d();
352
+ let e = 0, n = 0, a = !1;
353
+ for (let o of T) {
354
+ if (!s(A, o)) continue;
355
+ let c = U(w, C, o, E);
356
+ if (!c) continue;
357
+ let l = G(c[0], c[1], w.modelDepth), f = G(c[0], c[3], w.modelDepth);
358
+ if ([l, f].every(Number.isFinite) || d(), !(l > 0) || !(f > 0)) continue;
359
+ let g = p(H, l, f), v = _(y, u.srcRect != null), b = Math.floor(-g.x / H.tileW) - v.x, x = Math.floor(-g.y / H.tileH) - v.y, S = Math.ceil((l - g.x) / H.tileW) + v.x, T = Math.ceil((f - g.y) / H.tileH) + v.y;
360
360
  [
361
- y,
361
+ b,
362
362
  x,
363
363
  S,
364
364
  T
365
- ].every(Number.isSafeInteger) || a(2 ** 53 - 1, d);
366
- let D = Math.max(0, S - y), O = Math.max(0, T - x);
367
- (D === 0 || O === 0) && u();
365
+ ].every(Number.isSafeInteger) || h(2 ** 53 - 1, i);
366
+ let D = Math.max(0, S - b), O = Math.max(0, T - x);
367
+ (D === 0 || O === 0) && d();
368
368
  let k = D * O;
369
- a(k, d), e += k, a(e, d);
370
- let j = Math.ceil(p), M = Math.ceil(m);
371
- (!(j > 0 && j <= 32767) || !(M > 0 && M <= 32767) || j > Math.floor((16777216 - t) / M)) && a(2 ** 53 - 1, _), t += j * M;
372
- let N = c(i, j, M), P = N?.getContext("2d");
373
- (!N || !P) && (N && (N.width = 0), u()), K.push({
374
- faceIndex: r,
375
- width: p,
376
- height: m,
377
- origin: h,
378
- firstColumn: y,
369
+ h(k, i), e += k, h(e, i);
370
+ let j = Math.ceil(l), M = Math.ceil(f);
371
+ (!(j > 0 && j <= 32767) || !(M > 0 && M <= 32767) || j > Math.floor((16777216 - n) / M)) && h(2 ** 53 - 1, m), n += j * M;
372
+ let N = t(r, j, M), P = N?.getContext("2d");
373
+ (!N || !P) && (N && (N.width = 0), d()), K.push({
374
+ faceIndex: o,
375
+ width: l,
376
+ height: f,
377
+ origin: g,
378
+ firstColumn: b,
379
379
  firstRow: x,
380
380
  lastColumn: S,
381
381
  lastRow: T,
382
382
  canvas: N,
383
383
  context: P
384
- }), n = !0;
384
+ }), a = !0;
385
385
  }
386
- if (!n) return !1;
386
+ if (!a) return !1;
387
387
  }
388
- if (i.save(), l.alpha != null && (i.globalAlpha *= l.alpha), A.mode === "stretch") for (let e of T) {
389
- if (!f(A, e)) continue;
388
+ if (r.save(), u.alpha != null && (r.globalAlpha *= u.alpha), A.mode === "stretch") for (let e of T) {
389
+ if (!s(A, e)) continue;
390
390
  let t = U(w, C, e, E), n = w.thickness === 0 && e === 0 ? L : t?.map(E);
391
391
  if (!n) continue;
392
- let r = t ? j(t) : null;
393
- if (!r) continue;
394
- let { grid: a, crop: o, sourceRect: s } = P(r), c = V(n, l.fillRect);
395
- if (!c) continue;
396
- let u = o ? V(c, {
392
+ let i = t ? j(t) : null;
393
+ if (!i) continue;
394
+ let { grid: a, crop: o, sourceRect: c } = P(i), l = V(n, u.fillRect);
395
+ if (!l) continue;
396
+ let d = o ? V(l, {
397
397
  l: o.dxFraction,
398
398
  t: o.dyFraction,
399
399
  r: 1 - o.dxFraction - o.dwFraction,
400
400
  b: 1 - o.dyFraction - o.dhFraction
401
- }) : c;
402
- if (u) {
403
- i.save(), i.beginPath(), i.moveTo(n[0].x, n[0].y);
404
- for (let e = 1; e < n.length; e++) i.lineTo(n[e].x, n[e].y);
405
- i.closePath(), i.clip(), N(r, i, a.w, a.h, u, .5, s), i.restore();
401
+ }) : l;
402
+ if (d) {
403
+ r.save(), r.beginPath(), r.moveTo(n[0].x, n[0].y);
404
+ for (let e = 1; e < n.length; e++) r.lineTo(n[e].x, n[e].y);
405
+ r.closePath(), r.clip(), N(i, r, a.w, a.h, d, .5, c), r.restore();
406
406
  }
407
407
  }
408
408
  else for (let e of T) {
409
- if (!f(A, e)) continue;
409
+ if (!s(A, e)) continue;
410
410
  let t = U(w, C, e, E);
411
411
  if (!t) continue;
412
- let r = t.map(E);
413
- i.save(), i.beginPath(), i.moveTo(r[0].x, r[0].y);
414
- for (let e = 1; e < r.length; e++) i.lineTo(r[e].x, r[e].y);
415
- i.closePath(), i.clip();
416
- let a = y(A, e);
412
+ let n = t.map(E);
413
+ r.save(), r.beginPath(), r.moveTo(n[0].x, n[0].y);
414
+ for (let e = 1; e < n.length; e++) r.lineTo(n[e].x, n[e].y);
415
+ r.closePath(), r.clip();
416
+ let i = v(A, e);
417
417
  if (A.mode === "tile") {
418
418
  if (!H) continue;
419
419
  let t = K.find((t) => t.faceIndex === e);
420
420
  if (!t) continue;
421
- let a = t.canvas.width / t.width, o = t.canvas.height / t.height;
422
- t.context.save(), t.context.scale(a, o);
421
+ let i = t.canvas.width / t.width, a = t.canvas.height / t.height;
422
+ t.context.save(), t.context.scale(i, a);
423
423
  for (let e = 0; e < t.lastRow - t.firstRow; e++) {
424
- let r = t.firstRow + e;
424
+ let n = t.firstRow + e;
425
425
  for (let e = 0; e < t.lastColumn - t.firstColumn; e++) {
426
- let i = t.firstColumn + e, a = t.origin.x + i * H.tileW, o = t.origin.y + r * H.tileH, s = H.flipX && Math.abs(i) % 2 == 1, c = H.flipY && Math.abs(r) % 2 == 1;
427
- t.context.save(), t.context.translate(a + (s ? H.tileW : 0), o + (c ? H.tileH : 0)), t.context.scale(s ? -1 : 1, c ? -1 : 1), n(t.context, b, l.srcRect, 0, 0, H.tileW, H.tileH), t.context.restore();
426
+ let r = t.firstColumn + e, i = t.origin.x + r * H.tileW, a = t.origin.y + n * H.tileH, o = H.flipX && Math.abs(r) % 2 == 1, s = H.flipY && Math.abs(n) % 2 == 1;
427
+ t.context.save(), t.context.translate(i + (o ? H.tileW : 0), a + (s ? H.tileH : 0)), t.context.scale(o ? -1 : 1, s ? -1 : 1), b(t.context, y, u.srcRect, 0, 0, H.tileW, H.tileH), t.context.restore();
428
428
  }
429
429
  }
430
- t.context.restore(), N(t.canvas, i, t.canvas.width, t.canvas.height, r, .5);
430
+ t.context.restore(), N(t.canvas, r, t.canvas.width, t.canvas.height, n, .5);
431
431
  } else if (A.mode === "stack") {
432
432
  if (B == null) continue;
433
- if (h(A, e)) for (let e = 0; e < Math.ceil(1 / B); e++) {
433
+ if (f(A, e)) for (let e = 0; e < Math.ceil(1 / B); e++) {
434
434
  let n = j(t, e * B, (e + 1) * B);
435
435
  n && I(n, z(t, e * B, (e + 1) * B));
436
436
  }
437
437
  else {
438
438
  let e = j(t);
439
- e && I(e, r);
439
+ e && I(e, n);
440
440
  }
441
- } else if (A.stackUnit != null && v(A, e)) for (let e = 0; e < a; e++) {
441
+ } else if (A.stackUnit != null && g(A, e)) for (let e = 0; e < i; e++) {
442
442
  let n = e * A.stackUnit / D, r = (e + 1) * A.stackUnit / D, i = j(t, n, r);
443
443
  i && I(i, z(t, n, r));
444
444
  }
445
445
  else if (A.stackUnit != null) {
446
446
  let e = j(t);
447
- e && I(e, r);
447
+ e && I(e, n);
448
448
  }
449
- i.restore();
449
+ r.restore();
450
450
  }
451
- return i.restore(), !0;
451
+ return r.restore(), !0;
452
452
  } finally {
453
453
  for (let e of K) e.canvas.width = 0;
454
454
  }