@silurus/ooxml 0.81.0 → 0.82.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.
- package/README.md +4 -8
- package/dist/assets/render-worker-Cy-QsDge.js +10 -0
- package/dist/assets/{render-worker-DtU8oQZ7.js → render-worker-Dw_wQRIh.js} +1 -1
- package/dist/assets/{render-worker-C2ACcLes.js → render-worker-aHayzR7v.js} +4 -4
- package/dist/{canvas-viewer-mechanics-CqxKRGCp.js → canvas-viewer-mechanics-CS_qbr6T.js} +1 -1
- package/dist/chart-ex.mjs +4 -4
- package/dist/comment-occurrence-C34fWs_F.js +6 -0
- package/dist/comment-ui-runtime-C1RV_3iu.js +112 -0
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/comment-ui-runtime-DgCZpPR0.js +171 -0
- package/dist/comments-Cf9W7r3M.js +241 -0
- package/dist/{document-pull-client-Ux4a_ax8.js → document-pull-client-B1WOjA0z.js} +2206 -2193
- package/dist/{docx-SEyQ4gS-.js → docx-HoZXZUPA.js} +674 -249
- package/dist/docx.mjs +6 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-C8F6HO5x.js +119 -0
- package/dist/highlight-rect-MaCt0om0.js +13 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-BBGvvwLt.js → line-distribute-iXsUCIH-.js} +2 -2
- package/dist/{line-metrics-Baz31mML.js → line-metrics-B3syvDn2.js} +52 -52
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +10 -10
- package/dist/{plot-area-frame-Dg1VIpUU.js → plot-area-frame-DHV02PJU.js} +591 -590
- package/dist/{pptx-5lQrMvMR.js → pptx-DEUP4Yq5.js} +537 -243
- package/dist/pptx.mjs +6 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/read-only-comment-decoration-DcFevX_Q.js +96 -0
- package/dist/read-only-comment-margin-DrUX-YrP.js +189 -0
- package/dist/region-map.mjs +2 -2
- package/dist/{render-DEHjijQD.js → render-BC8p7vZQ.js} +1 -1
- package/dist/{render-worker-host-B1nbV_k7.js → render-worker-host-BNnXCtAu.js} +1 -1
- package/dist/{render-worker-host-Bze5M6k5.js → render-worker-host-CmPBviYJ.js} +1 -1
- package/dist/{render-worker-host-Dg_74V64.js → render-worker-host-DhnkTyjj.js} +1 -1
- package/dist/{renderer-DuopJE1K.js → renderer-CYr9YTXM.js} +436 -435
- package/dist/{resource-measurement-DRLp4nFt.js → resource-measurement-CsW4_eYt.js} +2 -2
- package/dist/{session-CNVc3VJ4.js → session-Da7LEQUB.js} +3 -3
- package/dist/{slide-pull-client-CzutXnGc.js → slide-pull-client-Bg9DusLX.js} +413 -300
- package/dist/source-key-BklvnEyQ.js +42 -0
- package/dist/{three-d-BYiWCNlz.js → three-d-7MaVzQuZ.js} +48 -47
- package/dist/three-d.mjs +324 -323
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +183 -19
- package/dist/types/index.d.ts +343 -26
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +428 -348
- package/dist/types/pptx.d.ts +132 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +78 -10
- package/dist/units-BzZ0gAxs.js +4 -0
- package/dist/{worksheet-pull-client-Cxj3Ej0s.js → worksheet-pull-client-CYtwXP5D.js} +3 -3
- package/dist/{xlsx-Bl3TIEVu.js → xlsx-DMWeXT-c.js} +429 -218
- package/dist/xlsx.mjs +6 -6
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +2 -1
- package/dist/assets/render-worker-Cx5uR77k.js +0 -10
- package/dist/highlight-rect-BqcZMHUE.js +0 -48
- /package/dist/{mathjax-DJa-Q93p.js → mathjax-DwIrafQ6.js} +0 -0
- /package/dist/{renderer-module-contract-0bO_5SC0.js → renderer-module-contract-DLbb7zY0.js} +0 -0
- /package/dist/{transfer-D0U6Uhn4.js → transfer-R6NjgBKD.js} +0 -0
- /package/dist/{visible-index-DbDuGMCE.js → visible-index-BFE3PWiY.js} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { A as e, At as t, Bt as n, C as r, D as i, Dt as a, Ft as o, Gt as s, Ht as c, It as l, K as u, Lt as d, M as f, Mt as p, N as m, O as h, Ot as g, Pt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, _ as T, _t as E, c as D, ct as O, d as k, f as A, g as j, gt as M, h as N, ht as P, i as F, j as I, m as L, mt as R, n as z, p as B, pt as V, qt as H, r as U, s as
|
|
2
|
-
import { a as ae, c as oe, d as se, i as ce, l as le, n as ue, o as de, r as fe, s as pe, t as me, u as he } from "./line-distribute-
|
|
3
|
-
import { S as ge, _ as _e,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { A as e, At as t, Bt as n, C as r, D as i, Dt as a, Ft as o, Gt as s, Ht as c, It as l, K as u, Lt as d, M as f, Mt as p, N as m, O as h, Ot as g, Pt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, _ as T, _t as E, c as D, ct as O, d as k, f as A, g as j, gt as M, h as N, ht as P, i as F, j as I, m as L, mt as R, n as z, p as B, pt as V, qt as H, r as U, s as ee, u as W, vt as te, w as G, wt as K, xt as q, y as ne, yt as re, zt as ie } from "./line-metrics-B3syvDn2.js";
|
|
2
|
+
import { a as ae, c as oe, d as se, i as ce, l as le, n as ue, o as de, r as fe, s as pe, t as me, u as he } from "./line-distribute-iXsUCIH-.js";
|
|
3
|
+
import { S as ge, _ as _e, an as ve, h as ye, in as be, k as xe, ln as Se, nn as Ce, un as we, v as Te, w as Ee } from "./plot-area-frame-DHV02PJU.js";
|
|
4
|
+
import { r as J } from "./units-BzZ0gAxs.js";
|
|
5
|
+
import { A as De, F as Oe, I as ke, L as Ae, M as je, N as Me, P as Ne, j as Pe } from "./three-d-7MaVzQuZ.js";
|
|
6
|
+
import { k as Fe } from "./renderer-CYr9YTXM.js";
|
|
7
|
+
import { i as Ie } from "./resource-measurement-CsW4_eYt.js";
|
|
7
8
|
//#region packages/pptx/src/types.ts
|
|
8
9
|
function Le(e) {
|
|
9
10
|
return e;
|
|
@@ -3241,7 +3242,7 @@ function Xt(e, t, n, r, i) {
|
|
|
3241
3242
|
let o = me(e, a, {
|
|
3242
3243
|
firstContentSi: 0,
|
|
3243
3244
|
lastDrawnSi: e.length,
|
|
3244
|
-
isGapChar:
|
|
3245
|
+
isGapChar: G,
|
|
3245
3246
|
isWhitespace: Yt,
|
|
3246
3247
|
seaClusterGaps: r === "thaiDist"
|
|
3247
3248
|
});
|
|
@@ -3295,7 +3296,7 @@ function $t(e, t) {
|
|
|
3295
3296
|
//#endregion
|
|
3296
3297
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3297
3298
|
function en(e) {
|
|
3298
|
-
let t =
|
|
3299
|
+
let t = q(e.length === 8 ? e.slice(0, 6) : e);
|
|
3299
3300
|
if (!t) return null;
|
|
3300
3301
|
let n = b(t[0], t[1], t[2]);
|
|
3301
3302
|
if (e.length !== 8) return n;
|
|
@@ -3378,7 +3379,7 @@ function cn(e, t) {
|
|
|
3378
3379
|
function ln(e, t, n, r, i, a, o = "fill", s = on) {
|
|
3379
3380
|
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - sn(e, t, i), f = 0;
|
|
3380
3381
|
for (let o of t) {
|
|
3381
|
-
let t = o.codePointAt(0) ?? 0, l = A(t), p = e.measureText(o).width + a, m = l === "Tr" ?
|
|
3382
|
+
let t = o.codePointAt(0) ?? 0, l = A(t), p = e.measureText(o).width + a, m = l === "Tr" ? W(t) : null, h = l === "Tr" && m === null && L(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3382
3383
|
if (B(t) && s(t)) {
|
|
3383
3384
|
let t = n + f + p / 2;
|
|
3384
3385
|
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", D(e, () => u(o, 0, 0)), e.restore();
|
|
@@ -3394,7 +3395,7 @@ function ln(e, t, n, r, i, a, o = "fill", s = on) {
|
|
|
3394
3395
|
e.textAlign = c, e.textBaseline = l;
|
|
3395
3396
|
}
|
|
3396
3397
|
function un(e, t, n, r, i, a, o = "fill") {
|
|
3397
|
-
ln(e, t, n, r, i, a, o, (t) =>
|
|
3398
|
+
ln(e, t, n, r, i, a, o, (t) => ee(e, t));
|
|
3398
3399
|
}
|
|
3399
3400
|
//#endregion
|
|
3400
3401
|
//#region packages/pptx/src/renderer.ts
|
|
@@ -3432,7 +3433,7 @@ async function gn(e, t) {
|
|
|
3432
3433
|
if (n.length !== 0) {
|
|
3433
3434
|
await t.loadMathJax();
|
|
3434
3435
|
for (let e of n) if (!pn.has(e.nodes)) try {
|
|
3435
|
-
let n = await t.mathMLToSvg(
|
|
3436
|
+
let n = await t.mathMLToSvg(te(e.nodes, e.display)), r = await M(n, "#000000");
|
|
3436
3437
|
pn.set(e.nodes, {
|
|
3437
3438
|
raster: r,
|
|
3438
3439
|
widthEm: n.widthEm,
|
|
@@ -3493,12 +3494,12 @@ function En(e) {
|
|
|
3493
3494
|
return /\b(thin|hairline)\b/.test(t) ? 100 : /\b(extra[- ]?light|ultra[- ]?light)\b/.test(t) ? 200 : /\blight\b/.test(t) ? 300 : /\b(black|heavy)\b/.test(t) ? 900 : /\b(extra[- ]?bold|ultra[- ]?bold)\b/.test(t) ? 800 : /\b(semi[- ]?bold|demi[- ]?bold)\b/.test(t) ? 600 : /\bbold\b/.test(t) ? 700 : /\bmedium\b/.test(t) ? 600 : null;
|
|
3494
3495
|
}
|
|
3495
3496
|
function Dn(e, t, n, r, i, a, o, s) {
|
|
3496
|
-
let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g =
|
|
3497
|
+
let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = we(m, h), _ = g?.getContext("2d");
|
|
3497
3498
|
if (!g || !_) return;
|
|
3498
3499
|
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
|
|
3499
3500
|
let v = n.y - d, y = v + n.h, b = g, x = _;
|
|
3500
3501
|
if (c > 0) {
|
|
3501
|
-
let e =
|
|
3502
|
+
let e = we(m, h), t = e?.getContext("2d");
|
|
3502
3503
|
e && t && (b = e, x = t);
|
|
3503
3504
|
}
|
|
3504
3505
|
b !== g && Vt(x, g, {
|
|
@@ -3538,35 +3539,38 @@ function On(e) {
|
|
|
3538
3539
|
function kn(e, t) {
|
|
3539
3540
|
return e ? 0 : Math.max(0, t);
|
|
3540
3541
|
}
|
|
3541
|
-
function An(e, t
|
|
3542
|
+
function An(e, t) {
|
|
3543
|
+
return t != null && t !== 0 ? e * .65 : e;
|
|
3544
|
+
}
|
|
3545
|
+
function jn(e, t, n, r, i, a, o) {
|
|
3542
3546
|
let s = (t.defaultFontSize ?? 18) * J * a;
|
|
3543
3547
|
for (let c of t.paragraphs) {
|
|
3544
3548
|
let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f = kn(On(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3545
3549
|
for (let n of c.runs) {
|
|
3546
3550
|
if (n.type !== "text") continue;
|
|
3547
3551
|
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * J * a : n.fontSize * J * a, i = _n(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3548
|
-
e.font = Z(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, r, i, o);
|
|
3552
|
+
e.font = Z(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, An(r, n.baseline ?? void 0), i, o);
|
|
3549
3553
|
let l = (n.letterSpacing ?? 0) * J * a;
|
|
3550
3554
|
if (m += Q(e, n.text, l), m > p) return !0;
|
|
3551
3555
|
}
|
|
3552
3556
|
}
|
|
3553
3557
|
return !1;
|
|
3554
3558
|
}
|
|
3555
|
-
function
|
|
3556
|
-
for (let t of e) if (
|
|
3559
|
+
function Mn(e) {
|
|
3560
|
+
for (let t of e) if (G(t.codePointAt(0) ?? 0)) return !0;
|
|
3557
3561
|
return !1;
|
|
3558
3562
|
}
|
|
3559
|
-
function
|
|
3563
|
+
function Nn(e) {
|
|
3560
3564
|
let t = 0;
|
|
3561
3565
|
for (let n of e) t++;
|
|
3562
3566
|
return t;
|
|
3563
3567
|
}
|
|
3564
|
-
var
|
|
3565
|
-
function
|
|
3566
|
-
let t =
|
|
3568
|
+
var Pn = /* @__PURE__ */ new WeakMap();
|
|
3569
|
+
function Fn(e) {
|
|
3570
|
+
let t = Pn.get(e);
|
|
3567
3571
|
if (t != null) return t;
|
|
3568
3572
|
let n = e, r = n.letterSpacing;
|
|
3569
|
-
if (typeof r != "string") return
|
|
3573
|
+
if (typeof r != "string") return Pn.set(e, !1), !1;
|
|
3570
3574
|
let i = !1;
|
|
3571
3575
|
try {
|
|
3572
3576
|
n.letterSpacing = "0px";
|
|
@@ -3581,11 +3585,11 @@ function Pn(e) {
|
|
|
3581
3585
|
n.letterSpacing = r;
|
|
3582
3586
|
} catch {}
|
|
3583
3587
|
}
|
|
3584
|
-
return
|
|
3588
|
+
return Pn.set(e, i), i;
|
|
3585
3589
|
}
|
|
3586
3590
|
function Q(e, t, n) {
|
|
3587
3591
|
let r = e, i = r.letterSpacing;
|
|
3588
|
-
if (n !== 0 &&
|
|
3592
|
+
if (n !== 0 && Fn(e)) try {
|
|
3589
3593
|
r.letterSpacing = `${n}px`;
|
|
3590
3594
|
let i = e.measureText(t).width;
|
|
3591
3595
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3594,10 +3598,10 @@ function Q(e, t, n) {
|
|
|
3594
3598
|
r.letterSpacing = i;
|
|
3595
3599
|
} catch {}
|
|
3596
3600
|
}
|
|
3597
|
-
let a = Math.max(0,
|
|
3601
|
+
let a = Math.max(0, Nn(t) - 1);
|
|
3598
3602
|
return e.measureText(t).width + n * a;
|
|
3599
3603
|
}
|
|
3600
|
-
function
|
|
3604
|
+
function In(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3601
3605
|
themeMajorFont: null,
|
|
3602
3606
|
themeMinorFont: null,
|
|
3603
3607
|
dpr: 1
|
|
@@ -3643,18 +3647,19 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3643
3647
|
}, z = (t, n, r, i, a, o, s, c) => {
|
|
3644
3648
|
if (!t) return;
|
|
3645
3649
|
e.font = n;
|
|
3646
|
-
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, y = c?.hyperlink, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && Tn(e.hyperlink) === Tn(y) && (l === 0 || e.sourceRunId === u),
|
|
3647
|
-
if (
|
|
3650
|
+
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, y = c?.hyperlink, S = c?.drawSizePx ?? r, C = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && (e.drawSizePx ?? e.sizePx) === S && Tn(e.hyperlink) === Tn(y) && (l === 0 || e.sourceRunId === u), w = b.segments.at(-1), T = Q(e, t, l);
|
|
3651
|
+
if (w && C(w) ? T = Q(e, w.text + t, l) - Q(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l), x += T, k.push({
|
|
3648
3652
|
isTab: !1,
|
|
3649
|
-
width:
|
|
3650
|
-
}),
|
|
3653
|
+
width: T
|
|
3654
|
+
}), w && C(w)) w.text += t;
|
|
3651
3655
|
else {
|
|
3652
|
-
let e =
|
|
3656
|
+
let e = w && !w.isTab && !w.math && u != null && w.sourceRunId === u ? l : 0;
|
|
3653
3657
|
b.segments.push({
|
|
3654
3658
|
text: t,
|
|
3655
3659
|
font: n,
|
|
3656
3660
|
fontFamily: v,
|
|
3657
3661
|
sizePx: r,
|
|
3662
|
+
drawSizePx: S,
|
|
3658
3663
|
color: i,
|
|
3659
3664
|
underline: a,
|
|
3660
3665
|
underlineStyle: f,
|
|
@@ -3689,7 +3694,8 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3689
3694
|
outline: e.outline,
|
|
3690
3695
|
highlight: e.highlight,
|
|
3691
3696
|
fontFamily: e.fontFamily,
|
|
3692
|
-
sourceRunId: e.sourceRunId
|
|
3697
|
+
sourceRunId: e.sourceRunId,
|
|
3698
|
+
drawSizePx: e.drawSizePx
|
|
3693
3699
|
}), !0;
|
|
3694
3700
|
};
|
|
3695
3701
|
for (let [n, s] of t.runs.entries()) {
|
|
@@ -3719,36 +3725,37 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3719
3725
|
}), x += n, s.display && L();
|
|
3720
3726
|
continue;
|
|
3721
3727
|
}
|
|
3722
|
-
let p = s.fontSize == null ? i : s.fontSize * J * o * u, m = _n(s.fontFamily ?? t.defFontFamily ?? null, f),
|
|
3723
|
-
|
|
3724
|
-
let
|
|
3725
|
-
e.font =
|
|
3726
|
-
let
|
|
3727
|
-
(
|
|
3728
|
-
let
|
|
3729
|
-
strikeDouble:
|
|
3730
|
-
letterSpacingPx:
|
|
3728
|
+
let p = s.fontSize == null ? i : s.fontSize * J * o * u, m = An(p, s.baseline ?? void 0), _ = _n(s.fontFamily ?? t.defFontFamily ?? null, f), C = s.fontFamilyEa ? _n(s.fontFamilyEa, f) : null, w = s.fontFamilySym ? _n(s.fontFamilySym, f) : null, E;
|
|
3729
|
+
E = s.color ? X(s.color) : s.hyperlink && f.themeHlinkColor ? X(f.themeHlinkColor) : a;
|
|
3730
|
+
let D = s.bold ?? t.defBold ?? c, M = s.italic ?? t.defItalic ?? l, P = Z(D, M, m, _, f), V = C ? Z(D, M, m, C, f) : P;
|
|
3731
|
+
e.font = P;
|
|
3732
|
+
let H = s.caps, U = g.get(s) ?? s.text;
|
|
3733
|
+
(H === "all" || H === "small") && (U = U.toUpperCase());
|
|
3734
|
+
let ee = s.fieldType === "slidenum" && d !== void 0 ? String(d) : U, W = s.underline || s.hyperlink !== void 0, te = s.strikeDouble === !0, K = s.letterSpacing == null ? 0 : s.letterSpacing * J * o, q = {
|
|
3735
|
+
strikeDouble: te,
|
|
3736
|
+
letterSpacingPx: K,
|
|
3731
3737
|
underlineStyle: s.underlineStyle,
|
|
3732
3738
|
underlineColor: s.underlineColor ? X(s.underlineColor) : void 0,
|
|
3733
3739
|
shadow: s.shadow,
|
|
3734
3740
|
reflection: s.reflection,
|
|
3735
3741
|
outline: s.outline,
|
|
3736
|
-
fontFamily:
|
|
3742
|
+
fontFamily: _,
|
|
3737
3743
|
highlight: s.highlight ? X(s.highlight) : void 0,
|
|
3738
3744
|
hyperlink: Ht(s.hyperlink),
|
|
3739
|
-
sourceRunId: n
|
|
3740
|
-
|
|
3741
|
-
|
|
3745
|
+
sourceRunId: n,
|
|
3746
|
+
drawSizePx: m
|
|
3747
|
+
}, re = ee.split(/(\s+)/);
|
|
3748
|
+
for (let i of re) {
|
|
3742
3749
|
if (!i) continue;
|
|
3743
3750
|
if (/^\t+$/.test(i)) {
|
|
3744
|
-
O || (e.font =
|
|
3751
|
+
O || (e.font = P, A = e.measureText(" ").width);
|
|
3745
3752
|
for (let e of i) b.segments.push({
|
|
3746
3753
|
text: "",
|
|
3747
3754
|
isTab: !0,
|
|
3748
|
-
font:
|
|
3749
|
-
fontFamily:
|
|
3755
|
+
font: P,
|
|
3756
|
+
fontFamily: _,
|
|
3750
3757
|
sizePx: p,
|
|
3751
|
-
color:
|
|
3758
|
+
color: E,
|
|
3752
3759
|
underline: !1,
|
|
3753
3760
|
strikethrough: !1
|
|
3754
3761
|
}), k.push({
|
|
@@ -3758,24 +3765,24 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3758
3765
|
O = !0;
|
|
3759
3766
|
continue;
|
|
3760
3767
|
}
|
|
3761
|
-
e.font =
|
|
3762
|
-
let a = R(i,
|
|
3763
|
-
if (c.test(i) && (
|
|
3764
|
-
let t =
|
|
3768
|
+
e.font = P;
|
|
3769
|
+
let a = R(i, P, K, n), o = /^\s+$/.test(i), c = /[-]/;
|
|
3770
|
+
if (c.test(i) && (w != null || he(_))) {
|
|
3771
|
+
let t = w ?? _;
|
|
3765
3772
|
for (let r of i) {
|
|
3766
|
-
let i = r, a =
|
|
3773
|
+
let i = r, a = P;
|
|
3767
3774
|
if (c.test(r)) {
|
|
3768
3775
|
let e = se(r, t);
|
|
3769
|
-
e === r ? a = Z(
|
|
3776
|
+
e === r ? a = Z(D, M, m, t, f) : (i = e, a = Z(D, M, m, "sans-serif", f));
|
|
3770
3777
|
}
|
|
3771
|
-
e.font = a, !F(R(i, a,
|
|
3778
|
+
e.font = a, !F(R(i, a, K, n)) && x > 0 && L(), z(i, a, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3772
3779
|
}
|
|
3773
3780
|
continue;
|
|
3774
3781
|
}
|
|
3775
|
-
if (
|
|
3782
|
+
if (Mn(i) && (!N(i) || t.eaLnBrk === !1)) {
|
|
3776
3783
|
let r = [];
|
|
3777
3784
|
for (let t of i) {
|
|
3778
|
-
let n =
|
|
3785
|
+
let n = G(t.codePointAt(0) ?? 0) && C != null, i = n ? V : P, a = n ? C : _;
|
|
3779
3786
|
e.font = i, r.push({
|
|
3780
3787
|
ch: t,
|
|
3781
3788
|
w: Q(e, t, 0),
|
|
@@ -3784,9 +3791,9 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3784
3791
|
});
|
|
3785
3792
|
}
|
|
3786
3793
|
if (t.eaLnBrk === !1) {
|
|
3787
|
-
let e = b.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, i = r.reduce((e, t) => e + t.w, 0) + Math.max(0, r.length - 1) *
|
|
3794
|
+
let e = b.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, i = r.reduce((e, t) => e + t.w, 0) + Math.max(0, r.length - 1) * K + (t && r.length > 0 ? K : 0);
|
|
3788
3795
|
x > 0 && !F(i) && L();
|
|
3789
|
-
for (let e of r) z(e.ch, e.font, p,
|
|
3796
|
+
for (let e of r) z(e.ch, e.font, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3790
3797
|
...q,
|
|
3791
3798
|
fontFamily: e.family
|
|
3792
3799
|
});
|
|
@@ -3794,7 +3801,7 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3794
3801
|
}
|
|
3795
3802
|
let a = r;
|
|
3796
3803
|
for (; a.length > 0;) {
|
|
3797
|
-
let e = Number.isFinite(v()) ? v() - I() : x, t = b.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = Jt(a, e, v(), h,
|
|
3804
|
+
let e = Number.isFinite(v()) ? v() - I() : x, t = b.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = Jt(a, e, v(), h, K, r);
|
|
3798
3805
|
if (i === 0) {
|
|
3799
3806
|
if (x > 0) {
|
|
3800
3807
|
L();
|
|
@@ -3804,7 +3811,7 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3804
3811
|
}
|
|
3805
3812
|
for (let e = 0; e < i; e++) {
|
|
3806
3813
|
let t = a[e];
|
|
3807
|
-
z(t.ch, t.font, p,
|
|
3814
|
+
z(t.ch, t.font, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3808
3815
|
...q,
|
|
3809
3816
|
fontFamily: t.family
|
|
3810
3817
|
});
|
|
@@ -3817,9 +3824,9 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3817
3824
|
let t = y(i, {
|
|
3818
3825
|
cjk: !0,
|
|
3819
3826
|
kinsoku: h
|
|
3820
|
-
}), r =
|
|
3827
|
+
}), r = C != null && V !== P, a = (e) => r && G(e.codePointAt(0) ?? 0), o = (t) => {
|
|
3821
3828
|
let r = 0, i = b.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
3822
|
-
s !== "" && (e.font = c ?
|
|
3829
|
+
s !== "" && (e.font = c ? V : P, r += Q(e, s, K), o && (r += K), o = !0, s = "");
|
|
3823
3830
|
};
|
|
3824
3831
|
for (let e of t) {
|
|
3825
3832
|
let t = a(e);
|
|
@@ -3829,8 +3836,8 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3829
3836
|
}, c = (e) => {
|
|
3830
3837
|
let t = "", n = null, r = () => {
|
|
3831
3838
|
if (t === "") return;
|
|
3832
|
-
let e = n ?
|
|
3833
|
-
z(t, e, p,
|
|
3839
|
+
let e = n ? V : P, r = n ? C : _;
|
|
3840
|
+
z(t, e, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3834
3841
|
...q,
|
|
3835
3842
|
fontFamily: r
|
|
3836
3843
|
}), t = "";
|
|
@@ -3855,21 +3862,21 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3855
3862
|
}
|
|
3856
3863
|
continue;
|
|
3857
3864
|
}
|
|
3858
|
-
if (F(a)) z(i,
|
|
3865
|
+
if (F(a)) z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q), o && (S = !0);
|
|
3859
3866
|
else if (o) x > 0 && L();
|
|
3860
3867
|
else if (a > v()) {
|
|
3861
3868
|
x > 0 && L();
|
|
3862
|
-
for (let t of i) e.font =
|
|
3863
|
-
} else if (!S) z(i,
|
|
3869
|
+
for (let t of i) e.font = P, !F(R(t, P, K, n)) && x > 0 && L(), z(t, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3870
|
+
} else if (!S) z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3864
3871
|
else {
|
|
3865
3872
|
let e = b.segments.at(-1)?.text ?? "", t = i.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(i) && n !== 8203 && t !== 8203, o = t !== void 0 && h.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !N(e) && !N(i) && r(n, t);
|
|
3866
|
-
(o || c) && B() || L(), z(i,
|
|
3873
|
+
(o || c) && B() || L(), z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3867
3874
|
}
|
|
3868
3875
|
}
|
|
3869
3876
|
}
|
|
3870
3877
|
return m.push(b), m;
|
|
3871
3878
|
}
|
|
3872
|
-
async function
|
|
3879
|
+
async function Ln(e, t, n, r, i, a, o) {
|
|
3873
3880
|
if (t && t.fillType === "image") {
|
|
3874
3881
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
|
|
3875
3882
|
try {
|
|
@@ -3878,7 +3885,7 @@ async function In(e, t, n, r, i, a, o) {
|
|
|
3878
3885
|
heightPt: r / i / J
|
|
3879
3886
|
});
|
|
3880
3887
|
if (a() || !s) return;
|
|
3881
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
3888
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) Bn(e, s, t.tile, n, r, i);
|
|
3882
3889
|
else {
|
|
3883
3890
|
let i = t.fillRect ?? {}, a = i.l ?? 0, o = i.t ?? 0, c = i.r ?? 0, l = i.b ?? 0, u = a * n, d = o * r, f = n * (1 - a - c), p = r * (1 - o - l);
|
|
3884
3891
|
e.drawImage(s, u, d, f, p);
|
|
@@ -3891,8 +3898,8 @@ async function In(e, t, n, r, i, a, o) {
|
|
|
3891
3898
|
}
|
|
3892
3899
|
e.fillStyle = fn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
3893
3900
|
}
|
|
3894
|
-
var
|
|
3895
|
-
function
|
|
3901
|
+
var Rn = 9525;
|
|
3902
|
+
function zn(e, t, n, r, i) {
|
|
3896
3903
|
let a;
|
|
3897
3904
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
3898
3905
|
let o;
|
|
@@ -3901,10 +3908,10 @@ function Rn(e, t, n, r, i) {
|
|
|
3901
3908
|
ay: o
|
|
3902
3909
|
};
|
|
3903
3910
|
}
|
|
3904
|
-
function
|
|
3905
|
-
let o = t.width *
|
|
3911
|
+
function Bn(e, t, n, r, i, a) {
|
|
3912
|
+
let o = t.width * Rn * (n.sx ?? 1) * a, s = t.height * Rn * (n.sy ?? 1) * a;
|
|
3906
3913
|
if (!(o > 0) || !(s > 0)) return;
|
|
3907
|
-
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u =
|
|
3914
|
+
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = we(o * (c ? 2 : 1), s * (l ? 2 : 1));
|
|
3908
3915
|
if (!u) return;
|
|
3909
3916
|
let d = u.getContext("2d");
|
|
3910
3917
|
if (!d) return;
|
|
@@ -3914,33 +3921,33 @@ function zn(e, t, n, r, i, a) {
|
|
|
3914
3921
|
f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
|
|
3915
3922
|
let p = e.createPattern(u, "repeat");
|
|
3916
3923
|
if (!p) return;
|
|
3917
|
-
let { ax: m, ay: h } =
|
|
3924
|
+
let { ax: m, ay: h } = zn(n.algn ?? "tl", r, i, o, s), g = m + Y(n.tx ?? 0, a), _ = h + Y(n.ty ?? 0, a);
|
|
3918
3925
|
typeof p.setTransform == "function" && typeof DOMMatrix < "u" ? (p.setTransform(new DOMMatrix().translateSelf(g, _)), e.fillStyle = p, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(g, _), e.fillStyle = p, e.fillRect(-g, -_, r, i), e.restore());
|
|
3919
3926
|
}
|
|
3920
|
-
function
|
|
3927
|
+
function Vn(e, t, n) {
|
|
3921
3928
|
if (!t) return;
|
|
3922
3929
|
let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
|
|
3923
3930
|
e.shadowColor = X(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
3924
3931
|
}
|
|
3925
|
-
function
|
|
3932
|
+
function Hn(e, t, n) {
|
|
3926
3933
|
t && (e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
3927
3934
|
}
|
|
3928
|
-
function
|
|
3935
|
+
function Un(e) {
|
|
3929
3936
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
3930
3937
|
}
|
|
3931
|
-
var
|
|
3932
|
-
function
|
|
3938
|
+
var Wn = 8, Gn = 1, Kn = 1, qn = 256;
|
|
3939
|
+
function Jn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
3933
3940
|
if (r <= 0) return;
|
|
3934
|
-
let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(
|
|
3935
|
-
for (; w >
|
|
3936
|
-
let e = Math.min(
|
|
3941
|
+
let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(qn, Math.max(1, Math.round(b / Wn))), S = (e) => Zn(e, a, r, o, s, c, u, d), C = S(x), w = $n(C, a, o, s, c, u, d, l, i, -g, _);
|
|
3942
|
+
for (; w > Kn && x < qn;) {
|
|
3943
|
+
let e = Math.min(qn, x * 2), t = S(e), n = $n(t, a, o, s, c, u, d, l, i, -g, _);
|
|
3937
3944
|
if (n >= w * .75) {
|
|
3938
3945
|
C = t;
|
|
3939
3946
|
break;
|
|
3940
3947
|
}
|
|
3941
3948
|
x = e, C = t, w = n;
|
|
3942
3949
|
}
|
|
3943
|
-
let T = 1e4, E =
|
|
3950
|
+
let T = 1e4, E = Gn / (l * i), D = C.length - 1, O = (e, t, n) => e === 0 ? -T : t - n - E, k = (e, t, n) => e === D ? T : t - n + E, A = (e, r) => {
|
|
3944
3951
|
e.fillStyle = r;
|
|
3945
3952
|
for (let r = 0; r <= D; r++) {
|
|
3946
3953
|
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
@@ -3948,7 +3955,7 @@ function qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
3948
3955
|
let c = O(r, i, s), u = k(r, a, s);
|
|
3949
3956
|
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
3950
3957
|
}
|
|
3951
|
-
}, j =
|
|
3958
|
+
}, j = Yn(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
3952
3959
|
if (j >= 1 && M >= 1) {
|
|
3953
3960
|
A(e, m);
|
|
3954
3961
|
return;
|
|
@@ -3968,29 +3975,29 @@ function qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
3968
3975
|
[s, _],
|
|
3969
3976
|
[c, _]
|
|
3970
3977
|
]) {
|
|
3971
|
-
let n =
|
|
3978
|
+
let n = Qn(i, l, e, t), r = f + n.x, a = p + n.y, o = N.a * r + N.c * a + N.e, s = N.b * r + N.d * a + N.f;
|
|
3972
3979
|
o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
|
|
3973
3980
|
}
|
|
3974
3981
|
}
|
|
3975
3982
|
if (!(I > P && L > F)) return;
|
|
3976
|
-
let R = Math.floor(P - 2), z = Math.floor(F - 2), B =
|
|
3983
|
+
let R = Math.floor(P - 2), z = Math.floor(F - 2), B = we(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
|
|
3977
3984
|
if (!B || !V) {
|
|
3978
3985
|
A(e, m);
|
|
3979
3986
|
return;
|
|
3980
3987
|
}
|
|
3981
|
-
V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V,
|
|
3988
|
+
V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V, Xn(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
|
|
3982
3989
|
}
|
|
3983
|
-
function
|
|
3990
|
+
function Yn(e) {
|
|
3984
3991
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
3985
3992
|
if (!t) return 1;
|
|
3986
3993
|
let n = parseFloat(t[1]);
|
|
3987
3994
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
3988
3995
|
}
|
|
3989
|
-
function
|
|
3996
|
+
function Xn(e) {
|
|
3990
3997
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
3991
3998
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
3992
3999
|
}
|
|
3993
|
-
function
|
|
4000
|
+
function Zn(e, t, n, r, i, a, o, s) {
|
|
3994
4001
|
let c = Array(e);
|
|
3995
4002
|
for (let l = 0; l < e; l++) {
|
|
3996
4003
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
@@ -4002,33 +4009,33 @@ function Xn(e, t, n, r, i, a, o, s) {
|
|
|
4002
4009
|
}
|
|
4003
4010
|
return c;
|
|
4004
4011
|
}
|
|
4005
|
-
function
|
|
4012
|
+
function Qn(e, t, n, r) {
|
|
4006
4013
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4007
4014
|
return {
|
|
4008
4015
|
x: e.x + s * o - c * a,
|
|
4009
4016
|
y: e.y + c * o + s * a
|
|
4010
4017
|
};
|
|
4011
4018
|
}
|
|
4012
|
-
function
|
|
4019
|
+
function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4013
4020
|
let d = 0;
|
|
4014
4021
|
for (let f of e) {
|
|
4015
4022
|
let e = (f.s0 + f.s1) / 2;
|
|
4016
4023
|
for (let p of [f.s0, f.s1]) {
|
|
4017
4024
|
let m = Ze(t, (n + p) / r * i, a, o);
|
|
4018
4025
|
for (let t of [l, u]) {
|
|
4019
|
-
let n =
|
|
4026
|
+
let n = Qn(m, s, 0, t), r = Qn(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4020
4027
|
i > d && (d = i);
|
|
4021
4028
|
}
|
|
4022
4029
|
}
|
|
4023
4030
|
}
|
|
4024
4031
|
return d;
|
|
4025
4032
|
}
|
|
4026
|
-
function
|
|
4033
|
+
function er(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4027
4034
|
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = qe(n, r, p, m);
|
|
4028
4035
|
if (!h) return;
|
|
4029
4036
|
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * J * c, y = [];
|
|
4030
4037
|
for (let n of t.paragraphs) {
|
|
4031
|
-
let t =
|
|
4038
|
+
let t = In(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * J * c, n.defColor ? X(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4032
4039
|
for (let e of t) y.push(e);
|
|
4033
4040
|
}
|
|
4034
4041
|
if (y.length === 0) return;
|
|
@@ -4047,7 +4054,7 @@ function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4047
4054
|
}
|
|
4048
4055
|
e.font = t.font;
|
|
4049
4056
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4050
|
-
a += r.width + n *
|
|
4057
|
+
a += r.width + n * Nn(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
|
|
4051
4058
|
}
|
|
4052
4059
|
if (a <= 0) continue;
|
|
4053
4060
|
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = Xe(h, a), b = 0;
|
|
@@ -4061,7 +4068,7 @@ function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4061
4068
|
for (let s of o) {
|
|
4062
4069
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4063
4070
|
if (!h.singleEdge && o > 0) {
|
|
4064
|
-
|
|
4071
|
+
Jn(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4065
4072
|
continue;
|
|
4066
4073
|
}
|
|
4067
4074
|
let l = Ze(h, (b + o / 2) / a * v, _, c);
|
|
@@ -4071,7 +4078,7 @@ function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4071
4078
|
}
|
|
4072
4079
|
e.restore();
|
|
4073
4080
|
}
|
|
4074
|
-
function
|
|
4081
|
+
function tr(e, t, n, r, i, a, o) {
|
|
4075
4082
|
let s = Math.min(r, i);
|
|
4076
4083
|
switch (e) {
|
|
4077
4084
|
case "rightarrow":
|
|
@@ -4101,17 +4108,17 @@ function er(e, t, n, r, i, a, o) {
|
|
|
4101
4108
|
default: return null;
|
|
4102
4109
|
}
|
|
4103
4110
|
}
|
|
4104
|
-
function
|
|
4111
|
+
function nr(e, t) {
|
|
4105
4112
|
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null && nn(e) ? t.smartArtFallbackTextColor : null;
|
|
4106
4113
|
}
|
|
4107
|
-
function
|
|
4114
|
+
function rr(e, t, n) {
|
|
4108
4115
|
return {
|
|
4109
4116
|
outerRotation: e,
|
|
4110
4117
|
localFlipH: t,
|
|
4111
4118
|
localFlipV: n
|
|
4112
4119
|
};
|
|
4113
4120
|
}
|
|
4114
|
-
function
|
|
4121
|
+
function ir(e, t, n, r, i) {
|
|
4115
4122
|
let a = [
|
|
4116
4123
|
{
|
|
4117
4124
|
x: t,
|
|
@@ -4140,7 +4147,7 @@ function rr(e, t, n, r, i) {
|
|
|
4140
4147
|
h: l - s
|
|
4141
4148
|
};
|
|
4142
4149
|
}
|
|
4143
|
-
var
|
|
4150
|
+
var ar = {
|
|
4144
4151
|
tl: [0, 0],
|
|
4145
4152
|
t: [.5, 0],
|
|
4146
4153
|
tr: [1, 0],
|
|
@@ -4151,15 +4158,15 @@ var ir = {
|
|
|
4151
4158
|
b: [.5, 1],
|
|
4152
4159
|
br: [1, 1]
|
|
4153
4160
|
};
|
|
4154
|
-
function
|
|
4161
|
+
function or(e, t, n) {
|
|
4155
4162
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4156
4163
|
}
|
|
4157
|
-
function
|
|
4158
|
-
let [o, s] =
|
|
4159
|
-
return
|
|
4164
|
+
function sr(e, t, n, r, i, a) {
|
|
4165
|
+
let [o, s] = ar[a ?? "b"];
|
|
4166
|
+
return or(e, t + o * r, n + s * i);
|
|
4160
4167
|
}
|
|
4161
|
-
function
|
|
4162
|
-
let c = st(e, i, a).corners, l = (o > 0 ? Pe(c, o / i, o / a) ?? c : c).map((e) =>
|
|
4168
|
+
function cr(e, t, n, r, i, a, o, s) {
|
|
4169
|
+
let c = st(e, i, a).corners, l = (o > 0 ? Pe(c, o / i, o / a) ?? c : c).map((e) => or(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = ar[s ?? "b"], v = je(c, g, _);
|
|
4163
4170
|
return {
|
|
4164
4171
|
bbox: {
|
|
4165
4172
|
x: f,
|
|
@@ -4167,15 +4174,15 @@ function sr(e, t, n, r, i, a, o, s) {
|
|
|
4167
4174
|
w: m - f,
|
|
4168
4175
|
h: h - p
|
|
4169
4176
|
},
|
|
4170
|
-
anchor: v ?
|
|
4177
|
+
anchor: v ? or(t, n + v.x, r + v.y) : sr(t, n, r, i, a, s)
|
|
4171
4178
|
};
|
|
4172
4179
|
}
|
|
4173
|
-
function
|
|
4180
|
+
function lr(e, t, n, r) {
|
|
4174
4181
|
let i = Math.floor(n.x) - 1, a = Math.floor(n.y) - 1, o = Math.max(1, Math.ceil(n.x + n.w) - i + 1), s = Math.max(1, Math.ceil(n.y + n.h) - a + 1);
|
|
4175
4182
|
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || Ae(o, s).clamped) return e;
|
|
4176
4183
|
let c = null;
|
|
4177
4184
|
try {
|
|
4178
|
-
c =
|
|
4185
|
+
c = we(o, s);
|
|
4179
4186
|
} catch {
|
|
4180
4187
|
return e;
|
|
4181
4188
|
}
|
|
@@ -4194,7 +4201,7 @@ function cr(e, t, n, r) {
|
|
|
4194
4201
|
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4195
4202
|
};
|
|
4196
4203
|
}
|
|
4197
|
-
function
|
|
4204
|
+
function ur(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4198
4205
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4199
4206
|
a: 1,
|
|
4200
4207
|
b: 0,
|
|
@@ -4209,9 +4216,9 @@ function lr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4209
4216
|
}, v = (e) => {
|
|
4210
4217
|
h(e), u(e);
|
|
4211
4218
|
}, y = !1;
|
|
4212
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ne(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Oe(e, g, i, t.reflection, s, d, f), e.restore()), y ?
|
|
4219
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ne(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Oe(e, g, i, t.reflection, s, d, f), e.restore()), y ? Vn(e, t.shadow ?? null, o) : t.glow && Hn(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), ke(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && Un(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Me(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4213
4220
|
}
|
|
4214
|
-
function
|
|
4221
|
+
function dr(e, t, n, r = "#000000", i, a = {
|
|
4215
4222
|
themeMajorFont: null,
|
|
4216
4223
|
themeMinorFont: null,
|
|
4217
4224
|
dpr: 1
|
|
@@ -4221,20 +4228,20 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4221
4228
|
shapeId: t.id
|
|
4222
4229
|
}) : s;
|
|
4223
4230
|
if (m === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4224
|
-
if (t.stroke && (e.save(),
|
|
4231
|
+
if (t.stroke && (e.save(), Or(e, t.stroke, n, {
|
|
4225
4232
|
x: u,
|
|
4226
4233
|
y: f,
|
|
4227
4234
|
w: p,
|
|
4228
4235
|
h: 1
|
|
4229
4236
|
}, t.rotation), e.beginPath(), e.moveTo(u, f), e.lineTo(u + p, f), e.stroke(), e.restore()), t.textBody) {
|
|
4230
|
-
let o =
|
|
4231
|
-
|
|
4237
|
+
let o = nr(t, a);
|
|
4238
|
+
_r(e, t.textBody, u, f, p, m, n, o, t.rotation, t.flipH, t.flipV, r, i, a, h, !1, c);
|
|
4232
4239
|
}
|
|
4233
4240
|
return;
|
|
4234
4241
|
}
|
|
4235
4242
|
let g = t.scene3d && ct(t.scene3d.camera) ? t.scene3d : null;
|
|
4236
4243
|
if (g && p > 0 && m > 0) {
|
|
4237
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), c = s > 0 ? Math.sqrt(s) : 1, l =
|
|
4244
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), c = s > 0 ? Math.sqrt(s) : 1, l = vr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, c), d = yr(t.sp3d, g.camera, p, m, n, c), h = rr(t.rotation, t.flipH, t.flipV);
|
|
4238
4245
|
e.save(), h.outerRotation !== 0 && (e.translate(u + p / 2, f + m / 2), e.rotate(h.outerRotation * Math.PI / 180), e.translate(-(u + p / 2), -(f + m / 2)));
|
|
4239
4246
|
let _ = {
|
|
4240
4247
|
...t,
|
|
@@ -4257,21 +4264,21 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4257
4264
|
..._,
|
|
4258
4265
|
fill: null,
|
|
4259
4266
|
stroke: null
|
|
4260
|
-
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (d ? Math.hypot(d.offsetX, d.offsetY) / c : 0) + 2, x = (e, t, o) =>
|
|
4261
|
-
|
|
4267
|
+
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (d ? Math.hypot(d.offsetX, d.offsetY) / c : 0) + 2, x = (e, t, o) => br(e, g.camera, u, f, p, m, (e) => {
|
|
4268
|
+
dr(e, t, n, r, i, a, void 0);
|
|
4262
4269
|
}, o ? {
|
|
4263
4270
|
bevels: l,
|
|
4264
4271
|
extrusion: d ?? void 0,
|
|
4265
4272
|
edgePadCss: b
|
|
4266
4273
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4267
4274
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4268
|
-
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4275
|
+
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o = cr(g.camera, r, u, f, p, m, b, t.shadow?.algn), s = !1, c = lr((e) => {
|
|
4269
4276
|
s = S(e) || s;
|
|
4270
4277
|
}, r, o.bbox, {
|
|
4271
4278
|
w: e.canvas.width || 0,
|
|
4272
4279
|
h: e.canvas.height || 0
|
|
4273
4280
|
});
|
|
4274
|
-
if (
|
|
4281
|
+
if (ur(e, t, c, c, o.bbox, o.anchor, n, n * a, r, !!t.fill), s) {
|
|
4275
4282
|
C(e), e.restore();
|
|
4276
4283
|
return;
|
|
4277
4284
|
}
|
|
@@ -4283,7 +4290,7 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4283
4290
|
}
|
|
4284
4291
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(u + p / 2, f + m / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(u + p / 2), -(f + m / 2)));
|
|
4285
4292
|
let v = t.geometry.toLowerCase(), y = fn(t.fill, e, u, f, p, m, t.rotation);
|
|
4286
|
-
t.shadow ||
|
|
4293
|
+
t.shadow || Hn(e, t.glow ?? null, n);
|
|
4287
4294
|
let b = new Set([
|
|
4288
4295
|
"line",
|
|
4289
4296
|
"straightconnector1",
|
|
@@ -4315,13 +4322,13 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4315
4322
|
h: m
|
|
4316
4323
|
}) => {
|
|
4317
4324
|
let { x: o, y: s, w: c, h: l } = a, h = i ?? (r === e && o === u && s === f && c === p && l === m ? y : fn(t.fill, r, o, s, c, l, t.rotation)), g = i ? null : t.stroke ? () => {
|
|
4318
|
-
|
|
4325
|
+
Or(r, t.stroke, n, {
|
|
4319
4326
|
x: o,
|
|
4320
4327
|
y: s,
|
|
4321
4328
|
w: c,
|
|
4322
4329
|
h: l
|
|
4323
4330
|
}, t.rotation), r.stroke();
|
|
4324
|
-
} : null, _ = () =>
|
|
4331
|
+
} : null, _ = () => Un(r);
|
|
4325
4332
|
if (C && !i) {
|
|
4326
4333
|
d(r, v, o, s, c, l, [
|
|
4327
4334
|
t.adj,
|
|
@@ -4335,7 +4342,7 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4335
4342
|
], h, g, _, S(v) ? { skipTrailingStroke: !0 } : void 0);
|
|
4336
4343
|
return;
|
|
4337
4344
|
}
|
|
4338
|
-
r.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4345
|
+
r.beginPath(), t.custGeom && t.custGeom.length > 0 ? fr(r, t.custGeom, o, s, c, l) : de(r, v, o, s, c, l, t.adj, t.adj2, t.adj3, t.adj4), h && v !== "arc" && (r.fillStyle = h, v === "donut" || v === "smileyface" || v === "frame" ? r.fill("evenodd") : r.fill(), i || _()), g && g();
|
|
4339
4346
|
}, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? C ? o(v, u, f, p, m, [
|
|
4340
4347
|
t.adj,
|
|
4341
4348
|
t.adj2,
|
|
@@ -4355,7 +4362,7 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4355
4362
|
y: O.y - M,
|
|
4356
4363
|
w: O.w + M * 2,
|
|
4357
4364
|
h: O.h + M * 2
|
|
4358
|
-
} : O, P =
|
|
4365
|
+
} : O, P = ir(T, N.x, N.y, N.w, N.h), F = n * D, I = g ? [] : vr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, D), L = (t.stroke ? t.stroke.width * n / 2 : 0) + 2, R = (e) => {
|
|
4359
4366
|
let r = t.stroke?.fill ? fn(t.stroke.fill, e, u, f, p, m, t.rotation) ?? void 0 : void 0;
|
|
4360
4367
|
if (t.stroke && (b.has(v) || x.has(v))) {
|
|
4361
4368
|
let i = _(v, u, f, p, m, [
|
|
@@ -4383,7 +4390,7 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4383
4390
|
let e = ce(t.stroke.headEnd, t.stroke, n);
|
|
4384
4391
|
r[0] = ae(r[0], r[1], e);
|
|
4385
4392
|
}
|
|
4386
|
-
|
|
4393
|
+
Or(e, t.stroke, n, {
|
|
4387
4394
|
x: u,
|
|
4388
4395
|
y: f,
|
|
4389
4396
|
w: p,
|
|
@@ -4392,26 +4399,26 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4392
4399
|
for (let t = 1; t < r.length; t++) e.lineTo(r[t].x, r[t].y);
|
|
4393
4400
|
e.stroke();
|
|
4394
4401
|
}
|
|
4395
|
-
a && o &&
|
|
4402
|
+
a && o && Dr(e, i.start, i.end, t.stroke, a, n, t.rotation), t.stroke.tailEnd && ue(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, n, r), t.stroke.headEnd && ue(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, n, r);
|
|
4396
4403
|
return;
|
|
4397
4404
|
}
|
|
4398
4405
|
if (!t.stroke || !t.custGeom || t.custGeom.length === 0 || (!t.stroke.headEnd || t.stroke.headEnd.type === "none") && (!t.stroke.tailEnd || t.stroke.tailEnd.type === "none")) return;
|
|
4399
4406
|
let { start: i, end: a } = pe(t.custGeom);
|
|
4400
4407
|
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ue(e, u + i.x * p, f + i.y * m, Math.atan2(i.dy * m, i.dx * p), t.stroke.headEnd, t.stroke, n, r), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ue(e, u + a.x * p, f + a.y * m, Math.atan2(a.dy * m, a.dx * p), t.stroke.tailEnd, t.stroke, n, r);
|
|
4401
4408
|
}, z = (e) => {
|
|
4402
|
-
if (I.length > 0 &&
|
|
4409
|
+
if (I.length > 0 && xr(e, u, f, p, m, I, (e, t, n, r, i) => w(e, void 0, {
|
|
4403
4410
|
x: t,
|
|
4404
4411
|
y: n,
|
|
4405
4412
|
w: r,
|
|
4406
4413
|
h: i
|
|
4407
4414
|
}), void 0, L)) {
|
|
4408
|
-
R(e),
|
|
4415
|
+
R(e), Un(e);
|
|
4409
4416
|
return;
|
|
4410
4417
|
}
|
|
4411
4418
|
w(e), R(e);
|
|
4412
4419
|
};
|
|
4413
|
-
if (
|
|
4414
|
-
let o =
|
|
4420
|
+
if (ur(e, t, z, z, P, sr(T, u, f, p, m, t.shadow?.algn), n, F, T, !!y, (e) => w(e, "#000")), t.textBody) {
|
|
4421
|
+
let o = nr(t, a);
|
|
4415
4422
|
if (e.save(), t.flipH || t.flipV) {
|
|
4416
4423
|
let n = u + p / 2, r = f + m / 2;
|
|
4417
4424
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
@@ -4422,16 +4429,16 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4422
4429
|
let e = p * (1 - 1 / Math.SQRT2) / 2, t = m * (1 - 1 / Math.SQRT2) / 2;
|
|
4423
4430
|
s = u + e, l = f + t, d = p / Math.SQRT2, g = m / Math.SQRT2;
|
|
4424
4431
|
} else {
|
|
4425
|
-
let e =
|
|
4432
|
+
let e = tr(v, u, f, p, m, t.adj, t.adj2);
|
|
4426
4433
|
e && (s = e.tx, l = e.ty, d = e.tw, g = e.th);
|
|
4427
4434
|
}
|
|
4428
|
-
|
|
4435
|
+
_r(e, t.textBody, s, l, d, g, n, o, t.rotation, !1, !1, r, i, a, h, !1, c), e.restore();
|
|
4429
4436
|
}
|
|
4430
4437
|
e.restore();
|
|
4431
4438
|
}
|
|
4432
|
-
var
|
|
4433
|
-
function
|
|
4434
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4439
|
+
var fr = oe;
|
|
4440
|
+
function pr(e, t) {
|
|
4441
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = mr(e).toLowerCase(), o = mr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4435
4442
|
switch (t) {
|
|
4436
4443
|
case "arabicPlain": return n;
|
|
4437
4444
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4458,7 +4465,7 @@ function fr(e, t) {
|
|
|
4458
4465
|
default: return `${n}.`;
|
|
4459
4466
|
}
|
|
4460
4467
|
}
|
|
4461
|
-
function
|
|
4468
|
+
function mr(e) {
|
|
4462
4469
|
let t = [
|
|
4463
4470
|
1e3,
|
|
4464
4471
|
900,
|
|
@@ -4491,21 +4498,21 @@ function pr(e) {
|
|
|
4491
4498
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4492
4499
|
return r;
|
|
4493
4500
|
}
|
|
4494
|
-
function
|
|
4501
|
+
function hr(e) {
|
|
4495
4502
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4496
4503
|
return !1;
|
|
4497
4504
|
}
|
|
4498
|
-
function
|
|
4499
|
-
let n =
|
|
4505
|
+
function gr(e, t) {
|
|
4506
|
+
let n = hr(e);
|
|
4500
4507
|
if (e.bullet.type === "char") return t.clear(), n ? se(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4501
4508
|
if (e.bullet.type === "autoNum") {
|
|
4502
4509
|
if (!n) return "";
|
|
4503
4510
|
let r = e.lvl;
|
|
4504
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4511
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), pr(t.get(r), e.bullet.numType);
|
|
4505
4512
|
}
|
|
4506
4513
|
return t.clear(), "";
|
|
4507
4514
|
}
|
|
4508
|
-
function
|
|
4515
|
+
function _r(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
4509
4516
|
themeMajorFont: null,
|
|
4510
4517
|
themeMinorFont: null,
|
|
4511
4518
|
dpr: 1
|
|
@@ -4524,7 +4531,7 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4524
4531
|
textBodyRotation: d
|
|
4525
4532
|
}) : void 0;
|
|
4526
4533
|
if (g) return a;
|
|
4527
|
-
e.save(), e.translate(t, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4534
|
+
e.save(), e.translate(t, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), _r(e, {
|
|
4528
4535
|
...n,
|
|
4529
4536
|
vert: "horz"
|
|
4530
4537
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, v, !1, _, n.vert === "eaVert"), e.restore();
|
|
@@ -4532,10 +4539,10 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4532
4539
|
}
|
|
4533
4540
|
let S = n.textWarp;
|
|
4534
4541
|
if (!g && S && He(S.preset)) {
|
|
4535
|
-
|
|
4542
|
+
er(e, n, S.preset, S.adj ?? [], r, i, a, o, s, c ?? f, m);
|
|
4536
4543
|
return;
|
|
4537
4544
|
}
|
|
4538
|
-
let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp" ? D &&
|
|
4545
|
+
let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp" ? D && jn(e, n, a, C, w, s, m) : D, k = Math.max(1, n.numCol ?? 1), A = Y(n.spcCol ?? 0, s), j = n.defaultBold ?? !1, M = n.defaultItalic ?? !1, N = c ?? f, P = (t) => {
|
|
4539
4546
|
let i = (n.defaultFontSize ?? 18) * J * s * t, o = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4540
4547
|
for (let u = 0; u < n.paragraphs.length; u++) {
|
|
4541
4548
|
let d = n.paragraphs[u], f = Y(d.marL, s), h = Y(d.marR, s), _ = Y(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * J * s * t, b = d.defColor ? X(d.defColor) : N, x = On(d), S = (() => {
|
|
@@ -4548,7 +4555,7 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4548
4555
|
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4549
4556
|
return d.defFontFamily ?? null;
|
|
4550
4557
|
})(), F = "", I = Z(!1, !1, T, "sans-serif", m), L = D, R = null;
|
|
4551
|
-
F =
|
|
4558
|
+
F = gr(d, l);
|
|
4552
4559
|
let B = Le(d.bullet);
|
|
4553
4560
|
if (B.type === "char") {
|
|
4554
4561
|
let e = B;
|
|
@@ -4564,9 +4571,9 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4564
4571
|
sizePx: n
|
|
4565
4572
|
};
|
|
4566
4573
|
}
|
|
4567
|
-
let V = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, H = r + C + f, U = r + C + f + _,
|
|
4568
|
-
for (let t = 0; t <
|
|
4569
|
-
let r =
|
|
4574
|
+
let V = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, H = r + C + f, U = r + C + f + _, ee = V - f - h, W = In(e, d, O ? ee : Infinity, v, b, s, f, j, M, t, p, m, kn(x, _)), te = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * J * s * t, G = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * J * s * t;
|
|
4575
|
+
for (let t = 0; t < W.length; t++) {
|
|
4576
|
+
let r = W[t], i = t === 0, a = t === W.length - 1, l = 0, f = 0;
|
|
4570
4577
|
for (let e of r.segments) {
|
|
4571
4578
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4572
4579
|
if (t > l && (l = t), !e.math) {
|
|
@@ -4582,7 +4589,7 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4582
4589
|
i && R && R.sizePx > l && (l = R.sizePx);
|
|
4583
4590
|
let p = l * 1.2, m = Math.max(p, f), h;
|
|
4584
4591
|
h = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : p) * (d.spaceLine.val / 1e5) : d.spaceLine.val * J * s : g ? y ? p : l : m, n.autoFit === "norm" && n.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - n.lnSpcReduction);
|
|
4585
|
-
let b = h + (a ?
|
|
4592
|
+
let b = h + (a ? G : 0), S = i && u > 0 ? te : 0, C = i ? kn(x, _) : 0, w = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), T = i && w ? R : null;
|
|
4586
4593
|
o.push({
|
|
4587
4594
|
line: r,
|
|
4588
4595
|
linePx: b,
|
|
@@ -4595,7 +4602,7 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4595
4602
|
bulletX: U,
|
|
4596
4603
|
bulletImage: T,
|
|
4597
4604
|
textX: H,
|
|
4598
|
-
textMaxW:
|
|
4605
|
+
textMaxW: ee,
|
|
4599
4606
|
alignment: d.alignment,
|
|
4600
4607
|
isLastLine: a,
|
|
4601
4608
|
para: d
|
|
@@ -4624,11 +4631,11 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4624
4631
|
o === 0 && L === "b" ? (B = T + I + E, R = i - B) : B = n.autoFit === "sp" ? Math.max(o, T + I + E) : o;
|
|
4625
4632
|
let H, U = Math.max(0, B - T - E);
|
|
4626
4633
|
H = L === "ctr" ? R + T + (U - I) / 2 : L === "b" ? R + B - E - I : R + T, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4627
|
-
let
|
|
4634
|
+
let ee = H, W = k > 1 ? (a - C - w - (k - 1) * A) / k + A : 0, te = Math.max(0, B - T - E), G = F[F.length - 1], K = G ? Math.max(0, G.linePx - G.lineHeight) : 0, q = I - K, ne = o === 0 || q <= te + .5, re = k > 1 && !ne ? Math.ceil(F.length / k) : F.length, ie = 0, ae = 0;
|
|
4628
4635
|
for (let c of F) {
|
|
4629
4636
|
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = c;
|
|
4630
|
-
k > 1 && ie < k - 1 && ae >= re && (ie++, ae = 0, H =
|
|
4631
|
-
let T = (n.rtlCol ? k - 1 - ie : ie) *
|
|
4637
|
+
k > 1 && ie < k - 1 && ae >= re && (ie++, ae = 0, H = ee), H += p, ae++;
|
|
4638
|
+
let T = (n.rtlCol ? k - 1 - ie : ie) * W, E = c.textX + T, D = c.bulletX + T, O = c.textMaxW, A = c.para.rtl === !0, j = A || Kt(u.segments), M = u.segments.some((e) => e.isTab);
|
|
4632
4639
|
if (M) {
|
|
4633
4640
|
let t = Y(c.para.marL, s), n = Y(c.para.marR, s), r = A ? n : t + g, i = O + t + n;
|
|
4634
4641
|
e.font = u.segments.find((e) => e.isTab).font;
|
|
@@ -4688,16 +4695,16 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4688
4695
|
}
|
|
4689
4696
|
let z = E + g, B;
|
|
4690
4697
|
B = M ? A ? E + O - L - N : z : C === "ctr" ? z + (O - g - N) / 2 : C === "r" ? E + O - L - N : z;
|
|
4691
|
-
let U = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null,
|
|
4698
|
+
let U = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, te = w || (u.endsWithBreak ?? !1), G = (U && !j && !M ? Xt(u.segments, O - g, N, U, te) : null) ?? u.segments, K = j ? qt(u.segments, A) : null, q = (e, t) => {
|
|
4692
4699
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4693
4700
|
let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
|
|
4694
4701
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
4695
|
-
}, ne =
|
|
4702
|
+
}, ne = G.length;
|
|
4696
4703
|
for (let t = 0; t < ne; t++) {
|
|
4697
|
-
let n =
|
|
4704
|
+
let n = K ? K.order[t] : t, c = G[n], u = K ? K.rtl[n] : !1;
|
|
4698
4705
|
if (j && (e.direction = u ? "rtl" : "ltr"), t > 0) {
|
|
4699
|
-
let e =
|
|
4700
|
-
B +=
|
|
4706
|
+
let e = K ? K.order[t - 1] : t - 1;
|
|
4707
|
+
B += q(e, n);
|
|
4701
4708
|
}
|
|
4702
4709
|
if (c.isTab) {
|
|
4703
4710
|
B += c.tabWidthPx ?? 0;
|
|
@@ -4714,17 +4721,17 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4714
4721
|
continue;
|
|
4715
4722
|
}
|
|
4716
4723
|
e.font = c.font, e.fillStyle = c.color;
|
|
4717
|
-
let y = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0),
|
|
4724
|
+
let y = c.drawSizePx ?? c.sizePx, b = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0), x = c.letterSpacingPx ?? 0;
|
|
4718
4725
|
if (c.highlight && c.text) {
|
|
4719
|
-
let t = Q(e, c.text,
|
|
4720
|
-
dn(e, B,
|
|
4726
|
+
let t = Q(e, c.text, x) + _ + d;
|
|
4727
|
+
dn(e, B, b, t, y, c.highlight, c.color);
|
|
4721
4728
|
}
|
|
4722
|
-
let
|
|
4729
|
+
let S = c.shadow, C = (e, t, n, r) => {
|
|
4723
4730
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4724
|
-
if (
|
|
4731
|
+
if (x !== 0 && Nn(t) > 1) {
|
|
4725
4732
|
let r = e, a = r.letterSpacing;
|
|
4726
|
-
if (
|
|
4727
|
-
r.letterSpacing = `${
|
|
4733
|
+
if (Fn(e)) {
|
|
4734
|
+
r.letterSpacing = `${x}px`, i(t, n, b);
|
|
4728
4735
|
try {
|
|
4729
4736
|
r.letterSpacing = a;
|
|
4730
4737
|
} catch {}
|
|
@@ -4732,64 +4739,64 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4732
4739
|
let r = n, a = [...t];
|
|
4733
4740
|
for (let t = 0; t < a.length; t++) {
|
|
4734
4741
|
let n = a[t];
|
|
4735
|
-
i(n, r,
|
|
4742
|
+
i(n, r, b), t < a.length - 1 && (r += e.measureText(n).width + x);
|
|
4736
4743
|
}
|
|
4737
4744
|
}
|
|
4738
|
-
} else i(t, n,
|
|
4739
|
-
},
|
|
4745
|
+
} else i(t, n, b);
|
|
4746
|
+
}, w = (t) => Q(e, t, x), T = p && p.length > 0 ? Rt([...c.text], p, g, w) : null, E = [...c.text], D = !!p && p.length === E.length - 1 && E.length > 1, O = (e, t) => {
|
|
4740
4747
|
if (v) {
|
|
4741
|
-
let n =
|
|
4742
|
-
un(e, c.text, B,
|
|
4748
|
+
let n = D ? x + g : x;
|
|
4749
|
+
un(e, c.text, B, b, y, n, t);
|
|
4743
4750
|
return;
|
|
4744
4751
|
}
|
|
4745
|
-
if (
|
|
4746
|
-
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r =
|
|
4747
|
-
if (
|
|
4752
|
+
if (D) {
|
|
4753
|
+
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = x + g;
|
|
4754
|
+
if (Fn(e)) {
|
|
4748
4755
|
let t = e, i = t.letterSpacing;
|
|
4749
|
-
t.letterSpacing = `${r}px`, n(c.text, B,
|
|
4756
|
+
t.letterSpacing = `${r}px`, n(c.text, B, b);
|
|
4750
4757
|
try {
|
|
4751
4758
|
t.letterSpacing = i;
|
|
4752
4759
|
} catch {}
|
|
4753
4760
|
} else {
|
|
4754
4761
|
let t = B;
|
|
4755
|
-
for (let i = 0; i <
|
|
4756
|
-
let a =
|
|
4757
|
-
n(a, t,
|
|
4762
|
+
for (let i = 0; i < E.length; i++) {
|
|
4763
|
+
let a = E[i];
|
|
4764
|
+
n(a, t, b), i < E.length - 1 && (t += e.measureText(a).width + r);
|
|
4758
4765
|
}
|
|
4759
4766
|
}
|
|
4760
|
-
} else if (
|
|
4761
|
-
else
|
|
4762
|
-
},
|
|
4763
|
-
if (
|
|
4767
|
+
} else if (T) for (let { text: n, dx: r } of T) C(e, n, B + r, t);
|
|
4768
|
+
else C(e, c.text, B, t);
|
|
4769
|
+
}, k = c.reflection;
|
|
4770
|
+
if (k && c.text) {
|
|
4764
4771
|
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
4765
4772
|
if (t > 0 && n > 0) {
|
|
4766
4773
|
e.font = c.font;
|
|
4767
|
-
let r = e.measureText(c.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent :
|
|
4774
|
+
let r = e.measureText(c.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : y * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : y * .2, o = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, l = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4768
4775
|
Dn(e, (e) => {
|
|
4769
|
-
e.font = c.font, e.fillStyle = c.color,
|
|
4776
|
+
e.font = c.font, e.fillStyle = c.color, O(e, "fill");
|
|
4770
4777
|
}, {
|
|
4771
4778
|
x: (B - o) * f,
|
|
4772
|
-
y: (
|
|
4779
|
+
y: (b - i) * f,
|
|
4773
4780
|
w: Math.max(1, o + l) * f,
|
|
4774
4781
|
h: Math.max(1, i + a) * f
|
|
4775
|
-
},
|
|
4782
|
+
}, k, s * f, u, t, n), e.font = c.font, e.fillStyle = c.color;
|
|
4776
4783
|
}
|
|
4777
4784
|
}
|
|
4778
|
-
if (
|
|
4779
|
-
let t =
|
|
4780
|
-
e.save(), e.shadowColor = X(
|
|
4785
|
+
if (S) {
|
|
4786
|
+
let t = S.dir * Math.PI / 180, n = Y(S.dist, s);
|
|
4787
|
+
e.save(), e.shadowColor = X(S.color, S.alpha), e.shadowBlur = Y(S.blur, s), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4781
4788
|
}
|
|
4782
|
-
|
|
4783
|
-
let
|
|
4784
|
-
|
|
4785
|
-
let
|
|
4789
|
+
O(e, "fill"), S && e.restore();
|
|
4790
|
+
let A = c.outline;
|
|
4791
|
+
A && A.width > 0 && (e.save(), e.lineWidth = Math.max(.5, Y(A.width, s)), e.strokeStyle = A.color ? `#${A.color}` : c.color, e.lineJoin = "round", O(e, "stroke"), e.restore()), e.font = c.font;
|
|
4792
|
+
let M = Q(e, c.text, x) + _;
|
|
4786
4793
|
if (h && c.text && h({
|
|
4787
4794
|
text: c.text,
|
|
4788
4795
|
inShapeX: B - r,
|
|
4789
4796
|
inShapeY: H - i,
|
|
4790
|
-
w:
|
|
4797
|
+
w: M + d,
|
|
4791
4798
|
h: f,
|
|
4792
|
-
fontSize:
|
|
4799
|
+
fontSize: y,
|
|
4793
4800
|
font: c.font,
|
|
4794
4801
|
shapeX: r,
|
|
4795
4802
|
shapeY: i,
|
|
@@ -4797,25 +4804,25 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4797
4804
|
shapeH: o,
|
|
4798
4805
|
rotation: l,
|
|
4799
4806
|
hyperlink: c.hyperlink
|
|
4800
|
-
}), c.underline && It(e, B,
|
|
4801
|
-
let t = Math.max(1,
|
|
4807
|
+
}), c.underline && It(e, B, b, M + d, y, c.underlineColor ?? c.color, c.underlineStyle, m.dpr), c.strikethrough) {
|
|
4808
|
+
let t = Math.max(1, y * .05);
|
|
4802
4809
|
e.strokeStyle = c.color, e.lineWidth = t, e.setLineDash([]);
|
|
4803
|
-
let n =
|
|
4810
|
+
let n = b - y * .32;
|
|
4804
4811
|
if (c.strikeDouble) {
|
|
4805
4812
|
let r = t * .9, i = n - r, a = n + r;
|
|
4806
|
-
e.beginPath(), e.moveTo(B, i + V(i, t, m.dpr)), e.lineTo(B +
|
|
4813
|
+
e.beginPath(), e.moveTo(B, i + V(i, t, m.dpr)), e.lineTo(B + M + d, i + V(i, t, m.dpr)), e.moveTo(B, a + V(a, t, m.dpr)), e.lineTo(B + M + d, a + V(a, t, m.dpr)), e.stroke();
|
|
4807
4814
|
} else {
|
|
4808
4815
|
let r = n + V(n, t, m.dpr);
|
|
4809
|
-
e.beginPath(), e.moveTo(B, r), e.lineTo(B +
|
|
4816
|
+
e.beginPath(), e.moveTo(B, r), e.lineTo(B + M + d, r), e.stroke();
|
|
4810
4817
|
}
|
|
4811
4818
|
}
|
|
4812
|
-
B +=
|
|
4819
|
+
B += M, B += d;
|
|
4813
4820
|
}
|
|
4814
4821
|
j && (e.direction = "ltr"), H += d;
|
|
4815
4822
|
}
|
|
4816
4823
|
e.restore();
|
|
4817
4824
|
}
|
|
4818
|
-
function
|
|
4825
|
+
function vr(e, t, n, r, i) {
|
|
4819
4826
|
if (!e) return [];
|
|
4820
4827
|
let a = wt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = At(n), s = r * i, c = [];
|
|
4821
4828
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
@@ -4833,7 +4840,7 @@ function _r(e, t, n, r, i) {
|
|
|
4833
4840
|
bottom: !0
|
|
4834
4841
|
}), c;
|
|
4835
4842
|
}
|
|
4836
|
-
function
|
|
4843
|
+
function yr(e, t, n, r, i, a) {
|
|
4837
4844
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4838
4845
|
let o = e.extrusionH * i * a, s = lt(t, n * a, r * a, o);
|
|
4839
4846
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
@@ -4856,14 +4863,14 @@ function vr(e, t, n, r, i, a) {
|
|
|
4856
4863
|
rgb: c
|
|
4857
4864
|
};
|
|
4858
4865
|
}
|
|
4859
|
-
function
|
|
4866
|
+
function br(e, t, n, r, i, a, o, s = {}) {
|
|
4860
4867
|
if (i <= 0 || a <= 0) return !1;
|
|
4861
4868
|
let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = st(t, i, a), p = f.corners;
|
|
4862
4869
|
if (d > 0) {
|
|
4863
4870
|
let e = d / u, t = Pe(f.corners, e / i, e / a);
|
|
4864
4871
|
t ? p = t : d = 0;
|
|
4865
4872
|
}
|
|
4866
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
4873
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = we(h, g);
|
|
4867
4874
|
if (!_) return !1;
|
|
4868
4875
|
let v = _.getContext("2d");
|
|
4869
4876
|
if (!v) return !1;
|
|
@@ -4884,9 +4891,9 @@ function yr(e, t, n, r, i, a, o, s = {}) {
|
|
|
4884
4891
|
y: r + e.y
|
|
4885
4892
|
}))), !0;
|
|
4886
4893
|
}
|
|
4887
|
-
function
|
|
4894
|
+
function xr(e, t, n, r, i, a, o, s, c = 0) {
|
|
4888
4895
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
4889
|
-
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g =
|
|
4896
|
+
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = we(m, h);
|
|
4890
4897
|
if (!g) return !1;
|
|
4891
4898
|
let _ = g.getContext("2d");
|
|
4892
4899
|
if (!_) return !1;
|
|
@@ -4903,19 +4910,19 @@ function br(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4903
4910
|
}
|
|
4904
4911
|
return s && (_.save(), _.scale(d, d), _.translate(p, p), s(_, 0, 0, r, i), _.restore()), e.drawImage(g, t - p, n - p, m / d, h / d), !0;
|
|
4905
4912
|
}
|
|
4906
|
-
var
|
|
4907
|
-
function
|
|
4908
|
-
let t =
|
|
4913
|
+
var Sr = /* @__PURE__ */ new WeakMap();
|
|
4914
|
+
function Cr(e) {
|
|
4915
|
+
let t = Sr.get(e);
|
|
4909
4916
|
return t || (t = async (t, n) => {
|
|
4910
4917
|
let r = await e(t);
|
|
4911
4918
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
4912
|
-
},
|
|
4919
|
+
}, Sr.set(e, t)), t;
|
|
4913
4920
|
}
|
|
4914
|
-
function
|
|
4921
|
+
function wr(e, t, n = Cr(t)) {
|
|
4915
4922
|
return g("base", e.posterPath, n, async () => {
|
|
4916
4923
|
let n = await t(e.posterPath), r = e.posterMimeType || n.type || "application/octet-stream";
|
|
4917
4924
|
return {
|
|
4918
|
-
bitmap: await
|
|
4925
|
+
bitmap: await ve(n.type === r ? n : new Blob([n], { type: r })),
|
|
4919
4926
|
owned: !0
|
|
4920
4927
|
};
|
|
4921
4928
|
}).then((e) => {
|
|
@@ -4923,20 +4930,20 @@ function Cr(e, t, n = Sr(t)) {
|
|
|
4923
4930
|
return e;
|
|
4924
4931
|
});
|
|
4925
4932
|
}
|
|
4926
|
-
async function
|
|
4933
|
+
async function Tr(e, t, n, r, i) {
|
|
4927
4934
|
if (i) try {
|
|
4928
|
-
let a = t.mimeType === "image/svg+xml", s =
|
|
4935
|
+
let a = t.mimeType === "image/svg+xml", s = be(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
4929
4936
|
if (!s) return;
|
|
4930
4937
|
let { widthPt: c, heightPt: u } = s, d;
|
|
4931
4938
|
if (re(t)) try {
|
|
4932
|
-
d = await
|
|
4939
|
+
d = await K(t.svgImagePath, i);
|
|
4933
4940
|
} catch {
|
|
4934
|
-
d = a ? await
|
|
4941
|
+
d = a ? await K(t.imagePath, i) : await Ie(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4935
4942
|
widthPt: c,
|
|
4936
4943
|
heightPt: u
|
|
4937
4944
|
});
|
|
4938
4945
|
}
|
|
4939
|
-
else d = a ? await
|
|
4946
|
+
else d = a ? await K(t.imagePath, i) : await Ie(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4940
4947
|
widthPt: c,
|
|
4941
4948
|
heightPt: u
|
|
4942
4949
|
});
|
|
@@ -4945,13 +4952,13 @@ async function wr(e, t, n, r, i) {
|
|
|
4945
4952
|
let f = Y(t.x, n), m = Y(t.y, n), h = Y(t.width, n), g = Y(t.height, n);
|
|
4946
4953
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(f + h / 2, m + g / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(f + h / 2), -(m + g / 2)));
|
|
4947
4954
|
let _ = (e, n, r, i, a) => {
|
|
4948
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
4955
|
+
t.custGeom && t.custGeom.length > 0 ? fr(e, t.custGeom, n, r, i, a) : t.prstGeom && p(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
4949
4956
|
}, v = (e, t, n, r, i) => {
|
|
4950
4957
|
e.beginPath(), _(e, t, n, r, i);
|
|
4951
4958
|
}, y = (e, n, r, i, a) => {
|
|
4952
4959
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (v(e, n, r, i, a), e.clip());
|
|
4953
4960
|
}, b = (e, r, i, a, o) => {
|
|
4954
|
-
t.stroke && (e.save(),
|
|
4961
|
+
t.stroke && (e.save(), Or(e, t.stroke, n, {
|
|
4955
4962
|
x: r,
|
|
4956
4963
|
y: i,
|
|
4957
4964
|
w: a,
|
|
@@ -4971,50 +4978,50 @@ async function wr(e, t, n, r, i) {
|
|
|
4971
4978
|
C(e, t, n, r, i), b(e, t, n, r, i), x(e, t, n, r, i);
|
|
4972
4979
|
}, T = (e, t, n, r, i) => {
|
|
4973
4980
|
C(e, t, n, r, i), b(e, t, n, r, i);
|
|
4974
|
-
}, E = e.getTransform(), D = Math.abs(E.a * E.d - E.b * E.c), O = D > 0 ? Math.sqrt(D) : 1, k =
|
|
4981
|
+
}, E = e.getTransform(), D = Math.abs(E.a * E.d - E.b * E.c), O = D > 0 ? Math.sqrt(D) : 1, k = vr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, O), A = S ? yr(t.sp3d, S.camera, h, g, n, O) : null, j = t.stroke ? t.stroke.width * n / 2 : 0, M = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, N = A ? Math.hypot(A.offsetX, A.offsetY) / O : 0, P = j + M + N + 2, F = (e) => {
|
|
4975
4982
|
if (S) {
|
|
4976
|
-
if (
|
|
4983
|
+
if (br(e, S.camera, f, m, h, g, T, {
|
|
4977
4984
|
bevels: k,
|
|
4978
4985
|
extrusion: A ?? void 0,
|
|
4979
4986
|
paintEdges: x,
|
|
4980
4987
|
edgePadCss: P
|
|
4981
4988
|
})) return;
|
|
4982
|
-
} else if (k.length > 0 &&
|
|
4989
|
+
} else if (k.length > 0 && xr(e, f, m, h, g, k, T, x, P)) return;
|
|
4983
4990
|
w(e, f, m, h, g);
|
|
4984
4991
|
}, I = (e, t, n, r, i, a) => {
|
|
4985
4992
|
e.save(), y(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
4986
4993
|
}, L = (e, t) => {
|
|
4987
|
-
S &&
|
|
4994
|
+
S && br(e, S.camera, f, m, h, g, (e, n, r, i, a) => I(e, t, n, r, i, a)) || I(e, t, f, m, h, g);
|
|
4988
4995
|
}, R = e.getTransform(), z = Math.abs(R.a * R.d - R.b * R.c), B = z > 0 ? Math.sqrt(z) : 1, V = j + M, H = (t.custGeom && t.custGeom.length > 0 ? le(t.custGeom, f, m, h, g) : t.prstGeom && l(t.prstGeom.toLowerCase()) ? o(t.prstGeom.toLowerCase(), f, m, h, g, t.prstAdjust ?? []) : null) ?? {
|
|
4989
4996
|
x: f,
|
|
4990
4997
|
y: m,
|
|
4991
4998
|
w: h,
|
|
4992
4999
|
h: g
|
|
4993
|
-
}, U = S ?
|
|
4994
|
-
bbox:
|
|
4995
|
-
anchor:
|
|
4996
|
-
},
|
|
4997
|
-
|
|
5000
|
+
}, U = S ? cr(S.camera, R, f, m, h, g, P, t.shadow?.algn) : {
|
|
5001
|
+
bbox: ir(R, H.x - V, H.y - V, H.w + V * 2, H.h + V * 2),
|
|
5002
|
+
anchor: sr(R, f, m, h, g, t.shadow?.algn)
|
|
5003
|
+
}, ee = n * B, W = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), te = (e) => L(e, "#000");
|
|
5004
|
+
ur(e, t, S && W ? lr(F, R, U.bbox, {
|
|
4998
5005
|
w: e.canvas.width || 0,
|
|
4999
5006
|
h: e.canvas.height || 0
|
|
5000
|
-
}) : F, S &&
|
|
5007
|
+
}) : F, S && W ? lr(te, R, U.bbox, {
|
|
5001
5008
|
w: e.canvas.width || 0,
|
|
5002
5009
|
h: e.canvas.height || 0
|
|
5003
|
-
}) :
|
|
5010
|
+
}) : te, U.bbox, U.anchor, n, ee, R), e.restore();
|
|
5004
5011
|
} catch (e) {
|
|
5005
5012
|
if (Se(e)) throw e;
|
|
5006
5013
|
}
|
|
5007
5014
|
}
|
|
5008
|
-
async function
|
|
5015
|
+
async function Er(e, t, n, r, i, a, o) {
|
|
5009
5016
|
let s = Y(t.x, n), c = Y(t.y, n), l = Y(t.width, n), u = Y(t.height, n), d;
|
|
5010
5017
|
if (t.posterPath && i) try {
|
|
5011
|
-
d = await
|
|
5018
|
+
d = await wr(t, i, o);
|
|
5012
5019
|
} catch (e) {
|
|
5013
5020
|
if (Se(e)) throw e;
|
|
5014
5021
|
}
|
|
5015
|
-
r() || (e.save(),
|
|
5022
|
+
r() || (e.save(), kr(e, t, n), d ? e.drawImage(d, s, c, l, u) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(s, c, l, u)), a || Ut(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
|
|
5016
5023
|
}
|
|
5017
|
-
function
|
|
5024
|
+
function Dr(e, t, n, r, i, a, o) {
|
|
5018
5025
|
let s = Math.max(.5, Y(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5019
5026
|
if (u === 0) return;
|
|
5020
5027
|
let d = -l / u, f = c / u, p;
|
|
@@ -5071,23 +5078,23 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
5071
5078
|
}
|
|
5072
5079
|
e.restore();
|
|
5073
5080
|
}
|
|
5074
|
-
function
|
|
5075
|
-
if (
|
|
5081
|
+
function Or(e, t, n, r, i = 0) {
|
|
5082
|
+
if (ye(e, t, n), t?.fill && r) {
|
|
5076
5083
|
let n = fn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5077
5084
|
n && (e.strokeStyle = n);
|
|
5078
5085
|
}
|
|
5079
5086
|
}
|
|
5080
|
-
function
|
|
5087
|
+
function kr(e, t, n) {
|
|
5081
5088
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5082
5089
|
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5083
5090
|
e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(r + a / 2), -(i + o / 2));
|
|
5084
5091
|
}
|
|
5085
|
-
function
|
|
5092
|
+
function Ar(e, t, n, r, i = {
|
|
5086
5093
|
themeMajorFont: null,
|
|
5087
5094
|
themeMinorFont: null,
|
|
5088
5095
|
dpr: 1
|
|
5089
5096
|
}) {
|
|
5090
|
-
e.save(),
|
|
5097
|
+
e.save(), kr(e, t, n);
|
|
5091
5098
|
let a = Y(t.x, n), o = Y(t.y, n), s = t.cols.map((e) => Y(e, n)), c = s.length, l = (e, t) => {
|
|
5092
5099
|
let n = 0;
|
|
5093
5100
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
@@ -5098,7 +5105,7 @@ function kr(e, t, n, r, i = {
|
|
|
5098
5105
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5099
5106
|
let s = o.cells[t];
|
|
5100
5107
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5101
|
-
let c = l(t, s.gridSpan || 1), d =
|
|
5108
|
+
let c = l(t, s.gridSpan || 1), d = _r(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5102
5109
|
d > u[a] && (u[a] = d);
|
|
5103
5110
|
}
|
|
5104
5111
|
}
|
|
@@ -5109,7 +5116,7 @@ function kr(e, t, n, r, i = {
|
|
|
5109
5116
|
if (c.hMerge || c.vMerge) continue;
|
|
5110
5117
|
let d = c.rowSpan || 1;
|
|
5111
5118
|
if (d <= 1 || !c.textBody) continue;
|
|
5112
|
-
let f = l(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + d)).some((e) => e.height === 0), m =
|
|
5119
|
+
let f = l(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + d)).some((e) => e.height === 0), m = _r(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, p) || 0, h = 0;
|
|
5113
5120
|
for (let e = 0; e < d && a + e < u.length; e++) h += u[a + e];
|
|
5114
5121
|
if (m > h) {
|
|
5115
5122
|
let e = (m - h) / d;
|
|
@@ -5157,7 +5164,7 @@ function kr(e, t, n, r, i = {
|
|
|
5157
5164
|
let u = fn(a.fill, e, o, s, c, l, t.rotation);
|
|
5158
5165
|
if (u && (e.fillStyle = u, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5159
5166
|
let t = a.textColor ? X(a.textColor) : null;
|
|
5160
|
-
|
|
5167
|
+
_r(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
|
|
5161
5168
|
}
|
|
5162
5169
|
}
|
|
5163
5170
|
let _ = i.dpr, v = (e, t) => {
|
|
@@ -5165,7 +5172,7 @@ function kr(e, t, n, r, i = {
|
|
|
5165
5172
|
let n = g[e][t];
|
|
5166
5173
|
return n < 0 ? null : h[n];
|
|
5167
5174
|
}, y = (r, i, a, o, s) => {
|
|
5168
|
-
|
|
5175
|
+
Or(e, r, n, {
|
|
5169
5176
|
x: Math.min(i, o),
|
|
5170
5177
|
y: Math.min(a, s),
|
|
5171
5178
|
w: Math.max(1, Math.abs(o - i)),
|
|
@@ -5206,12 +5213,12 @@ function kr(e, t, n, r, i = {
|
|
|
5206
5213
|
o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
|
|
5207
5214
|
}
|
|
5208
5215
|
}
|
|
5209
|
-
i.diagonalTL && (
|
|
5216
|
+
i.diagonalTL && (Or(e, i.diagonalTL, n, {
|
|
5210
5217
|
x: a,
|
|
5211
5218
|
y: o,
|
|
5212
5219
|
w: s,
|
|
5213
5220
|
h: d
|
|
5214
|
-
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (
|
|
5221
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Or(e, i.diagonalTR, n, {
|
|
5215
5222
|
x: a,
|
|
5216
5223
|
y: o,
|
|
5217
5224
|
w: s,
|
|
@@ -5220,14 +5227,14 @@ function kr(e, t, n, r, i = {
|
|
|
5220
5227
|
}
|
|
5221
5228
|
e.restore();
|
|
5222
5229
|
}
|
|
5223
|
-
function
|
|
5230
|
+
function jr(e, t, n, r) {
|
|
5224
5231
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5225
5232
|
}
|
|
5226
|
-
var
|
|
5227
|
-
function
|
|
5228
|
-
|
|
5233
|
+
var Mr = /* @__PURE__ */ new WeakMap();
|
|
5234
|
+
function Nr(e) {
|
|
5235
|
+
Mr.set(e, (Mr.get(e) ?? 0) + 1);
|
|
5229
5236
|
}
|
|
5230
|
-
function
|
|
5237
|
+
function Pr(e, t, n, r, i) {
|
|
5231
5238
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5232
5239
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5233
5240
|
e.strokeStyle = "#c8ccd2", e.lineWidth = Math.max(1, Math.min(t, n) * .004), e.setLineDash([e.lineWidth * 6, e.lineWidth * 5]), e.strokeRect(a, a, t - a * 2, n - a * 2), e.setLineDash([]);
|
|
@@ -5247,22 +5254,22 @@ function Nr(e, t, n, r, i) {
|
|
|
5247
5254
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5248
5255
|
e.restore();
|
|
5249
5256
|
}
|
|
5250
|
-
async function
|
|
5251
|
-
let o = i.fetchImage ?? (i.fetchMedia ?
|
|
5257
|
+
async function Fr(e, t, n, r, i = {}, a) {
|
|
5258
|
+
let o = i.fetchImage ?? (i.fetchMedia ? Cr(i.fetchMedia) : void 0), s = o ? x(o) : void 0;
|
|
5252
5259
|
try {
|
|
5253
|
-
return await
|
|
5260
|
+
return await Ir(e, t, n, r, i, a, o);
|
|
5254
5261
|
} finally {
|
|
5255
5262
|
s?.();
|
|
5256
5263
|
}
|
|
5257
5264
|
}
|
|
5258
|
-
async function
|
|
5259
|
-
let c = (
|
|
5260
|
-
|
|
5261
|
-
let l = () =>
|
|
5265
|
+
async function Ir(e, t, n, r, i = {}, o, s) {
|
|
5266
|
+
let c = (Mr.get(e) ?? 0) + 1;
|
|
5267
|
+
Mr.set(e, c);
|
|
5268
|
+
let l = () => Mr.get(e) !== c, u = i.width ?? ((P(e) ? e.offsetWidth : 0) || 960), d = u / n, f = Math.round(u), p = Math.round(r * d), m = i.dpr ?? R(), h = Ae(f * m, p * m), g = h.clamped ? m * h.scale : m;
|
|
5262
5269
|
e.width = h.width, e.height = h.height, P(e) && (e.style.width = `${f}px`, e.style.display || (e.style.display = "block"));
|
|
5263
5270
|
let _ = e.getContext("2d");
|
|
5264
5271
|
if (!_) throw Error("Could not get 2D context");
|
|
5265
|
-
if (_.scale(g, g), t.parseError) return
|
|
5272
|
+
if (_.scale(g, g), t.parseError) return Pr(_, f, p, t.slideNumber, t.parseError), e;
|
|
5266
5273
|
let v = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", y = {
|
|
5267
5274
|
themeMajorFont: i.majorFont ?? null,
|
|
5268
5275
|
themeMinorFont: i.minorFont ?? null,
|
|
@@ -5270,14 +5277,14 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5270
5277
|
dpr: g,
|
|
5271
5278
|
smartArtFallbackTextColor: rn(t.background, v)
|
|
5272
5279
|
};
|
|
5273
|
-
if (await
|
|
5280
|
+
if (await Ln(_, t.background, f, p, d, l, i.fetchImage), l() || (i.math && await gn(t, i.math), l())) return e;
|
|
5274
5281
|
let b = t.slideNumber;
|
|
5275
5282
|
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5276
5283
|
let t = e, n = t.mimeType === "image/svg+xml";
|
|
5277
|
-
if (re(t))
|
|
5278
|
-
else if (n)
|
|
5284
|
+
if (re(t)) K(t.svgImagePath, i.fetchImage).catch(() => void 0);
|
|
5285
|
+
else if (n) K(t.imagePath, i.fetchImage).catch(() => void 0);
|
|
5279
5286
|
else {
|
|
5280
|
-
let e =
|
|
5287
|
+
let e = be(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
5281
5288
|
if (!e) continue;
|
|
5282
5289
|
Ie(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5283
5290
|
widthPt: e.widthPt,
|
|
@@ -5286,12 +5293,12 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5286
5293
|
}
|
|
5287
5294
|
} else if (e.type === "media") {
|
|
5288
5295
|
let t = e;
|
|
5289
|
-
t.posterPath && i.fetchMedia &&
|
|
5296
|
+
t.posterPath && i.fetchMedia && wr(t, i.fetchMedia, s).catch(() => void 0);
|
|
5290
5297
|
}
|
|
5291
5298
|
let x = /* @__PURE__ */ new Map();
|
|
5292
5299
|
if (i.fetchImage) {
|
|
5293
5300
|
let n = i.fetchImage, r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
5294
|
-
for (let e of
|
|
5301
|
+
for (let e of xe(t.elements.filter((e) => e.type === "chart").map((e) => e.chart))) {
|
|
5295
5302
|
let t = Ee(e);
|
|
5296
5303
|
o.has(t) || o.set(t, e);
|
|
5297
5304
|
}
|
|
@@ -5307,18 +5314,18 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5307
5314
|
});
|
|
5308
5315
|
}), i = [...o].map(async ([e, t]) => {
|
|
5309
5316
|
try {
|
|
5310
|
-
let r =
|
|
5317
|
+
let r = be(t.mimeType, t.srcRect, 72, 72);
|
|
5311
5318
|
if (!r) {
|
|
5312
5319
|
x.set(e, null);
|
|
5313
5320
|
return;
|
|
5314
5321
|
}
|
|
5315
|
-
let i = () => t.mimeType === "image/svg+xml" ? t.duotone ? Promise.resolve(null) :
|
|
5322
|
+
let i = () => t.mimeType === "image/svg+xml" ? t.duotone ? Promise.resolve(null) : K(t.imagePath, n) : Ie(t.imagePath, t.mimeType, t.duotone, n, {
|
|
5316
5323
|
widthPt: r.widthPt,
|
|
5317
5324
|
heightPt: r.heightPt,
|
|
5318
5325
|
failClosedOnDuotoneFailure: !0
|
|
5319
5326
|
}), a;
|
|
5320
5327
|
if (!t.duotone && re(t)) try {
|
|
5321
|
-
a = await
|
|
5328
|
+
a = await K(t.svgImagePath, n);
|
|
5322
5329
|
} catch {
|
|
5323
5330
|
a = await i();
|
|
5324
5331
|
}
|
|
@@ -5334,17 +5341,17 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5334
5341
|
}
|
|
5335
5342
|
for (let [n, r] of t.elements.entries()) {
|
|
5336
5343
|
if (l()) return e;
|
|
5337
|
-
if (r.type === "shape")
|
|
5344
|
+
if (r.type === "shape") dr(_, r, d, v, b, y, o ? (e) => o({
|
|
5338
5345
|
...e,
|
|
5339
5346
|
elementIndex: n,
|
|
5340
5347
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5341
5348
|
}) : void 0, i.fetchImage);
|
|
5342
|
-
else if (r.type === "picture") await
|
|
5343
|
-
else if (r.type === "table")
|
|
5344
|
-
else if (r.type === "media") await
|
|
5349
|
+
else if (r.type === "picture") await Tr(_, r, d, l, i.fetchImage);
|
|
5350
|
+
else if (r.type === "table") Ar(_, r, d, b, y);
|
|
5351
|
+
else if (r.type === "media") await Er(_, r, d, l, i.fetchMedia, i.skipMediaControls, i.fetchImage);
|
|
5345
5352
|
else if (r.type === "chart") {
|
|
5346
5353
|
let e = J * d;
|
|
5347
|
-
_.save(),
|
|
5354
|
+
_.save(), kr(_, r, d), Fe(_, r.chart, {
|
|
5348
5355
|
x: Y(r.x, d),
|
|
5349
5356
|
y: Y(r.y, d),
|
|
5350
5357
|
w: Y(r.width, d),
|
|
@@ -5352,11 +5359,11 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5352
5359
|
}, e, r.rotation, i.threeD, i.regionMap, (e) => x.get(Ee(e)), i.chartEx), _.restore();
|
|
5353
5360
|
}
|
|
5354
5361
|
}
|
|
5355
|
-
return l() || i.dim &&
|
|
5362
|
+
return l() || i.dim && jr(_, i.dim, f, p), e;
|
|
5356
5363
|
}
|
|
5357
5364
|
//#endregion
|
|
5358
5365
|
//#region packages/pptx/src/google-fonts.ts
|
|
5359
|
-
var
|
|
5366
|
+
var Lr = {
|
|
5360
5367
|
...H,
|
|
5361
5368
|
...c
|
|
5362
5369
|
};
|
|
@@ -5369,7 +5376,7 @@ Object.freeze({
|
|
|
5369
5376
|
function $(e, t) {
|
|
5370
5377
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5371
5378
|
}
|
|
5372
|
-
function
|
|
5379
|
+
function Rr(e, t) {
|
|
5373
5380
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5374
5381
|
let n = e;
|
|
5375
5382
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5379,7 +5386,7 @@ function Lr(e, t) {
|
|
|
5379
5386
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5380
5387
|
});
|
|
5381
5388
|
}
|
|
5382
|
-
function
|
|
5389
|
+
function zr(e) {
|
|
5383
5390
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5384
5391
|
let t = e;
|
|
5385
5392
|
if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
|
|
@@ -5392,10 +5399,10 @@ function Rr(e) {
|
|
|
5392
5399
|
minorFont: t.minorFont,
|
|
5393
5400
|
hlinkColor: t.hlinkColor,
|
|
5394
5401
|
folHlinkColor: t.folHlinkColor,
|
|
5395
|
-
slides: Object.freeze(t.slides.map(
|
|
5402
|
+
slides: Object.freeze(t.slides.map(Rr))
|
|
5396
5403
|
});
|
|
5397
5404
|
}
|
|
5398
|
-
function
|
|
5405
|
+
function Br(e) {
|
|
5399
5406
|
return Object.freeze({
|
|
5400
5407
|
type: "media",
|
|
5401
5408
|
x: e.x,
|
|
@@ -5412,7 +5419,112 @@ function zr(e) {
|
|
|
5412
5419
|
mimeType: e.mimeType
|
|
5413
5420
|
});
|
|
5414
5421
|
}
|
|
5415
|
-
function
|
|
5422
|
+
function Vr(e) {
|
|
5423
|
+
return Object.freeze({
|
|
5424
|
+
...e.id === void 0 ? {} : { id: e.id },
|
|
5425
|
+
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
5426
|
+
...e.author === void 0 ? {} : { author: e.author },
|
|
5427
|
+
...e.date === void 0 ? {} : { date: e.date },
|
|
5428
|
+
...e.status === void 0 ? {} : { status: e.status },
|
|
5429
|
+
text: e.text
|
|
5430
|
+
});
|
|
5431
|
+
}
|
|
5432
|
+
function Hr(e) {
|
|
5433
|
+
return Object.freeze({ ...e });
|
|
5434
|
+
}
|
|
5435
|
+
function Ur(e) {
|
|
5436
|
+
return Object.freeze({
|
|
5437
|
+
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
5438
|
+
...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
|
|
5439
|
+
...e.id === void 0 ? {} : { id: e.id },
|
|
5440
|
+
...e.index === void 0 ? {} : { index: e.index },
|
|
5441
|
+
...e.author === void 0 ? {} : { author: e.author },
|
|
5442
|
+
...e.date === void 0 ? {} : { date: e.date },
|
|
5443
|
+
...e.x === void 0 ? {} : { x: e.x },
|
|
5444
|
+
...e.y === void 0 ? {} : { y: e.y },
|
|
5445
|
+
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Hr)) } : {},
|
|
5446
|
+
...e.status === void 0 ? {} : { status: e.status },
|
|
5447
|
+
text: e.text,
|
|
5448
|
+
...e.replies?.length ? { replies: Object.freeze(e.replies.map(Vr)) } : {}
|
|
5449
|
+
});
|
|
5450
|
+
}
|
|
5451
|
+
function Wr(e, t, n) {
|
|
5452
|
+
if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
|
|
5453
|
+
}
|
|
5454
|
+
function Gr(e, t) {
|
|
5455
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
|
|
5456
|
+
let n = e;
|
|
5457
|
+
for (let e of [
|
|
5458
|
+
"id",
|
|
5459
|
+
"authorId",
|
|
5460
|
+
"author",
|
|
5461
|
+
"date",
|
|
5462
|
+
"status"
|
|
5463
|
+
]) Wr(n[e], e, t);
|
|
5464
|
+
if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
|
|
5465
|
+
if (n.status !== void 0 && ![
|
|
5466
|
+
"active",
|
|
5467
|
+
"resolved",
|
|
5468
|
+
"closed"
|
|
5469
|
+
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
|
|
5470
|
+
return Vr(n);
|
|
5471
|
+
}
|
|
5472
|
+
function Kr(e, t) {
|
|
5473
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
|
|
5474
|
+
let n = e;
|
|
5475
|
+
for (let e of [
|
|
5476
|
+
"modernAuthorId",
|
|
5477
|
+
"id",
|
|
5478
|
+
"author",
|
|
5479
|
+
"date",
|
|
5480
|
+
"status"
|
|
5481
|
+
]) Wr(n[e], e, t);
|
|
5482
|
+
for (let e of [
|
|
5483
|
+
"authorId",
|
|
5484
|
+
"index",
|
|
5485
|
+
"x",
|
|
5486
|
+
"y"
|
|
5487
|
+
]) {
|
|
5488
|
+
let r = n[e];
|
|
5489
|
+
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment ${e} at slide ${t}`);
|
|
5490
|
+
}
|
|
5491
|
+
if (typeof n.text != "string" || n.replies !== void 0 && !Array.isArray(n.replies) || n.anchors !== void 0 && !Array.isArray(n.anchors)) throw Error(`invalid PPTX presentation preflight comment fields at slide ${t}`);
|
|
5492
|
+
if (n.status !== void 0 && ![
|
|
5493
|
+
"active",
|
|
5494
|
+
"resolved",
|
|
5495
|
+
"closed"
|
|
5496
|
+
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
|
|
5497
|
+
return Ur({
|
|
5498
|
+
...n,
|
|
5499
|
+
...n.anchors?.length ? { anchors: n.anchors.map((e) => qr(e, t)) } : {},
|
|
5500
|
+
...n.replies?.length ? { replies: n.replies.map((e) => Gr(e, t)) } : {}
|
|
5501
|
+
});
|
|
5502
|
+
}
|
|
5503
|
+
function qr(e, t) {
|
|
5504
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
|
|
5505
|
+
let n = e;
|
|
5506
|
+
if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
|
|
5507
|
+
if (n.type === "drawingElement") return Wr(n.elementId, "anchor.elementId", t), Wr(n.creationId, "anchor.creationId", t), Object.freeze({
|
|
5508
|
+
type: "drawingElement",
|
|
5509
|
+
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
5510
|
+
...n.creationId === void 0 ? {} : { creationId: n.creationId }
|
|
5511
|
+
});
|
|
5512
|
+
if (n.type === "textRange") {
|
|
5513
|
+
Wr(n.elementId, "anchor.elementId", t);
|
|
5514
|
+
for (let e of ["start", "length"]) {
|
|
5515
|
+
let r = n[e];
|
|
5516
|
+
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
|
|
5517
|
+
}
|
|
5518
|
+
return Object.freeze({
|
|
5519
|
+
type: "textRange",
|
|
5520
|
+
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
5521
|
+
...n.start === void 0 ? {} : { start: n.start },
|
|
5522
|
+
...n.length === void 0 ? {} : { length: n.length }
|
|
5523
|
+
});
|
|
5524
|
+
}
|
|
5525
|
+
throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
|
|
5526
|
+
}
|
|
5527
|
+
function Jr(e, t) {
|
|
5416
5528
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5417
5529
|
let n = e;
|
|
5418
5530
|
for (let e of [
|
|
@@ -5423,9 +5535,9 @@ function Br(e, t) {
|
|
|
5423
5535
|
"rotation"
|
|
5424
5536
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5425
5537
|
if (n.type !== "media" || typeof n.flipH != "boolean" || typeof n.flipV != "boolean" || n.mediaKind !== "audio" && n.mediaKind !== "video" || typeof n.posterPath != "string" || typeof n.posterMimeType != "string" || typeof n.mediaPath != "string" || typeof n.mimeType != "string") throw Error(`invalid PPTX presentation preflight media fields at slide ${t}`);
|
|
5426
|
-
return
|
|
5538
|
+
return Br(n);
|
|
5427
5539
|
}
|
|
5428
|
-
function
|
|
5540
|
+
function Yr(e) {
|
|
5429
5541
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5430
5542
|
let t = e;
|
|
5431
5543
|
if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.slides) || t.slides.length !== t.slideCount || !Array.isArray(t.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
|
|
@@ -5433,13 +5545,14 @@ function Vr(e) {
|
|
|
5433
5545
|
let n = t.slides.map((e, t) => {
|
|
5434
5546
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
|
|
5435
5547
|
let n = e;
|
|
5436
|
-
if (n.index !== t || n.partName !== void 0 && typeof n.partName != "string" || n.notes !== null && typeof n.notes != "string" || typeof n.hidden != "boolean" || !Array.isArray(n.mediaElements)) throw Error(`invalid PPTX presentation preflight slide fields at ${t}`);
|
|
5548
|
+
if (n.index !== t || n.partName !== void 0 && typeof n.partName != "string" || n.notes !== null && typeof n.notes != "string" || typeof n.hidden != "boolean" || !Array.isArray(n.mediaElements) || n.comments !== void 0 && !Array.isArray(n.comments)) throw Error(`invalid PPTX presentation preflight slide fields at ${t}`);
|
|
5437
5549
|
return Object.freeze({
|
|
5438
5550
|
index: t,
|
|
5439
5551
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5440
5552
|
notes: n.notes,
|
|
5441
5553
|
hidden: n.hidden,
|
|
5442
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5554
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => Jr(e, t))),
|
|
5555
|
+
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Kr(e, t))) } : {}
|
|
5443
5556
|
});
|
|
5444
5557
|
}), r = t.fontPreloadNames.map((e, t) => {
|
|
5445
5558
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5458,7 +5571,7 @@ function Vr(e) {
|
|
|
5458
5571
|
fontPreloadNames: Object.freeze(r)
|
|
5459
5572
|
});
|
|
5460
5573
|
}
|
|
5461
|
-
function
|
|
5574
|
+
function Xr(e, t) {
|
|
5462
5575
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5463
5576
|
if (e.mediaPath === t) return e.mimeType;
|
|
5464
5577
|
if (e.posterPath === t) return e.posterMimeType;
|
|
@@ -5467,7 +5580,7 @@ function Hr(e, t) {
|
|
|
5467
5580
|
}
|
|
5468
5581
|
//#endregion
|
|
5469
5582
|
//#region packages/pptx/src/slide-pull-client.ts
|
|
5470
|
-
var
|
|
5583
|
+
var Zr = 1024 * 1024, Qr = class {
|
|
5471
5584
|
active = /* @__PURE__ */ new Set();
|
|
5472
5585
|
nextSessionId = 1;
|
|
5473
5586
|
constructor(e) {
|
|
@@ -5488,7 +5601,7 @@ var Ur = 1024 * 1024, Wr = class {
|
|
|
5488
5601
|
this.active.add(a);
|
|
5489
5602
|
try {
|
|
5490
5603
|
await this.options.open(e, i, n);
|
|
5491
|
-
let r = await
|
|
5604
|
+
let r = await ei(a);
|
|
5492
5605
|
try {
|
|
5493
5606
|
let e = r.usage ?? a.usageCheckpoint;
|
|
5494
5607
|
e && this.options.onUsage?.(e);
|
|
@@ -5511,20 +5624,20 @@ var Ur = 1024 * 1024, Wr = class {
|
|
|
5511
5624
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
5512
5625
|
}
|
|
5513
5626
|
};
|
|
5514
|
-
function
|
|
5627
|
+
function $r(e) {
|
|
5515
5628
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
5516
5629
|
}
|
|
5517
|
-
async function
|
|
5630
|
+
async function ei(e) {
|
|
5518
5631
|
try {
|
|
5519
|
-
return await e.pull(
|
|
5632
|
+
return await e.pull(Zr);
|
|
5520
5633
|
} catch (t) {
|
|
5521
|
-
let n =
|
|
5634
|
+
let n = ti(t);
|
|
5522
5635
|
if (n === void 0) throw t;
|
|
5523
5636
|
return e.pull(n);
|
|
5524
5637
|
}
|
|
5525
5638
|
}
|
|
5526
|
-
function
|
|
5527
|
-
return O(e,
|
|
5639
|
+
function ti(e) {
|
|
5640
|
+
return O(e, Zr, u);
|
|
5528
5641
|
}
|
|
5529
5642
|
//#endregion
|
|
5530
|
-
export {
|
|
5643
|
+
export { Yr as a, Fr as c, zr as i, Ut as l, $r as n, Lr as o, Xr as r, Nr as s, Qr as t };
|