@silurus/ooxml 0.86.0 → 0.86.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/dist/assets/render-worker-D21h5TGR.js +10 -0
- package/dist/assets/render-worker-Dsfekaht.js +11 -0
- package/dist/assets/{render-worker-CB4DxjXg.js → render-worker-DxU7IrKo.js} +18 -18
- package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
- package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
- package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-lXwVOgjW.js} +1 -1
- package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-uopDjRde.js} +4501 -4456
- package/dist/{docx-DzDiGvqe.js → docx-wPzeF76A.js} +492 -307
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
- package/dist/{hyperlink-enyPbflR.js → hyperlink-BR1NCO7S.js} +934 -885
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-IsUGfHXm.js +1023 -0
- package/dist/node.mjs +272 -272
- package/dist/{pptx-D_U62nl-.js → pptx-BxJ_RBSY.js} +169 -161
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DSn0d35X.js → render-DEiun_AH.js} +1 -1
- package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-BEfLZvSL.js} +1 -1
- package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-Ba6Fchqr.js} +1 -1
- package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-C3xwtHnv.js} +1 -1
- package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CclArDRs.js} +9 -9
- package/dist/{session-C1GYhr6n.js → session-BuJL_xcp.js} +87 -87
- package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-Ck8wfRT_.js} +977 -903
- package/dist/types/docx.d.ts +1 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-CAvuf22q.js} +78 -78
- package/dist/{xlsx-CMHmYTHP.js → xlsx-Bblm5r1h.js} +574 -574
- package/dist/xlsx.mjs +5 -5
- package/package.json +1 -1
- package/dist/assets/render-worker-BCGnuBLj.js +0 -10
- package/dist/assets/render-worker-CHW0F0n6.js +0 -11
- package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
- package/dist/line-distribute-BFB575d6.js +0 -1023
- /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-CqejEuts.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, Bt as r,
|
|
2
|
-
import { a as
|
|
3
|
-
import { A as
|
|
4
|
-
import { l as
|
|
1
|
+
import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, E as c, Ft as l, Ht as u, It as d, Lt as f, M as p, Mt as m, Nt as h, Pt as g, Q as _, Rt as v, S as y, St as b, Tt as x, Vt as S, Wt as C, Xt as w, Yt as T, _ as E, a as D, b as O, bt as k, c as A, cn as j, ct as M, d as N, et as P, f as F, gt as I, h as L, ht as R, it as z, j as B, jt as V, k as H, kt as U, l as W, m as ee, n as G, nt as te, o as K, p as q, pt as J, q as ne, rt as re, st as ie, t as ae, tt as oe, u as se, ut as ce, wt as le, x as ue, xt as de, yt as fe, zt as pe } from "./hyperlink-BR1NCO7S.js";
|
|
2
|
+
import { a as me, c as he, d as ge, f as _e, i as ve, l as ye, o as be, p as xe, r as Se, s as Ce, t as we, u as Te } from "./line-distribute-IsUGfHXm.js";
|
|
3
|
+
import { A as Ee, D as De, S as Oe, _ as ke, h as Ae, hn as je, in as Me, j as Ne, on as Pe, sn as Fe, v as Ie, w as Le } from "./plot-area-frame-D5hEOgkJ.js";
|
|
4
|
+
import { l as Re } from "./pixel-budget-Dgjw269h.js";
|
|
5
5
|
import { r as Y } from "./units-EJdC96r6.js";
|
|
6
|
-
import { A as
|
|
7
|
-
import { k as
|
|
8
|
-
import { s as
|
|
9
|
-
import { a as
|
|
6
|
+
import { A as ze, F as Be, I as Ve, L as He, M as Ue, N as We, P as Ge, j as Ke } from "./three-d-YYghQndN.js";
|
|
7
|
+
import { k as qe } from "./renderer-XFSCOT6m.js";
|
|
8
|
+
import { s as Je } from "./raster-target-ojDdQizC.js";
|
|
9
|
+
import { a as Ye, i as Xe, n as Ze, t as Qe } from "./resource-measurement-CclArDRs.js";
|
|
10
10
|
//#region packages/pptx/src/types.ts
|
|
11
|
-
function
|
|
11
|
+
function $e(e) {
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var et = {
|
|
15
15
|
textarchdown: {
|
|
16
16
|
adj: [["adj", "val 0"]],
|
|
17
17
|
gd: [
|
|
@@ -2393,22 +2393,22 @@ var $e = {
|
|
|
2393
2393
|
]
|
|
2394
2394
|
}]
|
|
2395
2395
|
}
|
|
2396
|
-
},
|
|
2397
|
-
function rt(e) {
|
|
2398
|
-
return e.toLowerCase() in tt;
|
|
2399
|
-
}
|
|
2396
|
+
}, tt = Math.PI * 2 / 216e5, nt = et, rt = /* @__PURE__ */ new Map();
|
|
2400
2397
|
function it(e) {
|
|
2401
|
-
|
|
2398
|
+
return e.toLowerCase() in nt;
|
|
2399
|
+
}
|
|
2400
|
+
function at(e) {
|
|
2401
|
+
let t = rt.get(e);
|
|
2402
2402
|
if (t) return t;
|
|
2403
|
-
let n =
|
|
2403
|
+
let n = nt[e];
|
|
2404
2404
|
return n ? (t = {
|
|
2405
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2406
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2405
|
+
adj: n.adj.map(([e, t]) => [e, h(t)]),
|
|
2406
|
+
gd: n.gd.map(([e, t]) => [e, h(t)]),
|
|
2407
2407
|
paths: n.paths
|
|
2408
|
-
},
|
|
2408
|
+
}, rt.set(e, t), t) : null;
|
|
2409
2409
|
}
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2410
|
+
var ot = 48;
|
|
2411
|
+
function st(e, t, n, r) {
|
|
2412
2412
|
let i = e.w == null ? 1 : n / e.w, a = e.h == null ? 1 : r / e.h, o = (e) => e * i, s = (e) => e * a, c = [], l = 0, u = 0;
|
|
2413
2413
|
for (let n of e.cmds) switch (n[0]) {
|
|
2414
2414
|
case "m":
|
|
@@ -2425,8 +2425,8 @@ function ot(e, t, n, r) {
|
|
|
2425
2425
|
break;
|
|
2426
2426
|
case "C": {
|
|
2427
2427
|
let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4])), d = o(t.resolve(n[5])), f = s(t.resolve(n[6]));
|
|
2428
|
-
for (let t = 1; t <=
|
|
2429
|
-
let n = t /
|
|
2428
|
+
for (let t = 1; t <= ot; t++) {
|
|
2429
|
+
let n = t / ot, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
|
|
2430
2430
|
c.push({
|
|
2431
2431
|
x: s,
|
|
2432
2432
|
y: p
|
|
@@ -2437,8 +2437,8 @@ function ot(e, t, n, r) {
|
|
|
2437
2437
|
}
|
|
2438
2438
|
case "Q": {
|
|
2439
2439
|
let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4]));
|
|
2440
|
-
for (let t = 1; t <=
|
|
2441
|
-
let n = t /
|
|
2440
|
+
for (let t = 1; t <= ot; t++) {
|
|
2441
|
+
let n = t / ot, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
|
|
2442
2442
|
c.push({
|
|
2443
2443
|
x: s,
|
|
2444
2444
|
y: d
|
|
@@ -2448,9 +2448,9 @@ function ot(e, t, n, r) {
|
|
|
2448
2448
|
break;
|
|
2449
2449
|
}
|
|
2450
2450
|
case "a": {
|
|
2451
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2451
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * tt, f = t.resolve(n[4]) * tt, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
|
|
2452
2452
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2453
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2453
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(ot, Math.ceil(Math.abs(y) / m * 96));
|
|
2454
2454
|
for (let e = 1; e <= S; e++) {
|
|
2455
2455
|
let t = h + y * e / S;
|
|
2456
2456
|
c.push({
|
|
@@ -2465,7 +2465,7 @@ function ot(e, t, n, r) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return c;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function ct(e) {
|
|
2469
2469
|
let t = [0];
|
|
2470
2470
|
for (let n = 1; n < e.length; n++) {
|
|
2471
2471
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2473,23 +2473,23 @@ function st(e) {
|
|
|
2473
2473
|
}
|
|
2474
2474
|
return t;
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2477
|
-
let i =
|
|
2476
|
+
function lt(e, t, n, r) {
|
|
2477
|
+
let i = at(e.toLowerCase());
|
|
2478
2478
|
if (!i || i.paths.length === 0) return null;
|
|
2479
|
-
let a =
|
|
2479
|
+
let a = g({
|
|
2480
2480
|
w: n,
|
|
2481
2481
|
h: r,
|
|
2482
2482
|
adj: t
|
|
2483
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s =
|
|
2483
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = st(i.paths[0], a, n, r), c = o ? s : st(i.paths[i.paths.length - 1], a, n, r);
|
|
2484
2484
|
return {
|
|
2485
2485
|
top: s,
|
|
2486
2486
|
bottom: c,
|
|
2487
|
-
topLen:
|
|
2488
|
-
bottomLen:
|
|
2487
|
+
topLen: ct(s),
|
|
2488
|
+
bottomLen: ct(c),
|
|
2489
2489
|
singleEdge: o
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2492
|
+
function ut(e, t, n) {
|
|
2493
2493
|
let r = t[t.length - 1];
|
|
2494
2494
|
if (e.length === 1 || r === 0) return {
|
|
2495
2495
|
x: e[0].x,
|
|
@@ -2510,17 +2510,17 @@ function lt(e, t, n) {
|
|
|
2510
2510
|
ty: f / p
|
|
2511
2511
|
};
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2513
|
+
function dt(e) {
|
|
2514
2514
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function ft(e, t) {
|
|
2517
2517
|
if (!e.singleEdge) return 1;
|
|
2518
|
-
let n =
|
|
2518
|
+
let n = dt(e);
|
|
2519
2519
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function pt(e, t, n, r) {
|
|
2522
2522
|
if (e.singleEdge) {
|
|
2523
|
-
let i =
|
|
2523
|
+
let i = ut(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2524
2524
|
return {
|
|
2525
2525
|
x: i.x - o * c,
|
|
2526
2526
|
y: i.y - s * c,
|
|
@@ -2529,7 +2529,7 @@ function ft(e, t, n, r) {
|
|
|
2529
2529
|
shear: 0
|
|
2530
2530
|
};
|
|
2531
2531
|
}
|
|
2532
|
-
let i =
|
|
2532
|
+
let i = ut(e.top, e.topLen, t), a = ut(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
|
|
2533
2533
|
return {
|
|
2534
2534
|
x: c,
|
|
2535
2535
|
y: l,
|
|
@@ -2540,7 +2540,7 @@ function ft(e, t, n, r) {
|
|
|
2540
2540
|
}
|
|
2541
2541
|
//#endregion
|
|
2542
2542
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2543
|
-
var
|
|
2543
|
+
var mt = 26, ht = {
|
|
2544
2544
|
orthographicFront: {
|
|
2545
2545
|
kind: "orthographic",
|
|
2546
2546
|
baseLat: 0,
|
|
@@ -2553,52 +2553,52 @@ var pt = 26, mt = {
|
|
|
2553
2553
|
baseLat: 0,
|
|
2554
2554
|
baseLon: 0,
|
|
2555
2555
|
baseRev: 0,
|
|
2556
|
-
fovDeg:
|
|
2556
|
+
fovDeg: mt
|
|
2557
2557
|
},
|
|
2558
2558
|
perspectiveRelaxed: {
|
|
2559
2559
|
kind: "perspective",
|
|
2560
2560
|
baseLat: 0,
|
|
2561
2561
|
baseLon: 0,
|
|
2562
2562
|
baseRev: 0,
|
|
2563
|
-
fovDeg:
|
|
2563
|
+
fovDeg: mt
|
|
2564
2564
|
},
|
|
2565
2565
|
perspectiveRelaxedModerately: {
|
|
2566
2566
|
kind: "perspective",
|
|
2567
2567
|
baseLat: 0,
|
|
2568
2568
|
baseLon: 0,
|
|
2569
2569
|
baseRev: 0,
|
|
2570
|
-
fovDeg:
|
|
2570
|
+
fovDeg: mt
|
|
2571
2571
|
},
|
|
2572
2572
|
perspectiveAbove: {
|
|
2573
2573
|
kind: "perspective",
|
|
2574
2574
|
baseLat: -20,
|
|
2575
2575
|
baseLon: 0,
|
|
2576
2576
|
baseRev: 0,
|
|
2577
|
-
fovDeg:
|
|
2577
|
+
fovDeg: mt
|
|
2578
2578
|
},
|
|
2579
2579
|
perspectiveBelow: {
|
|
2580
2580
|
kind: "perspective",
|
|
2581
2581
|
baseLat: 20,
|
|
2582
2582
|
baseLon: 0,
|
|
2583
2583
|
baseRev: 0,
|
|
2584
|
-
fovDeg:
|
|
2584
|
+
fovDeg: mt
|
|
2585
2585
|
},
|
|
2586
2586
|
perspectiveLeft: {
|
|
2587
2587
|
kind: "perspective",
|
|
2588
2588
|
baseLat: 0,
|
|
2589
2589
|
baseLon: -20,
|
|
2590
2590
|
baseRev: 0,
|
|
2591
|
-
fovDeg:
|
|
2591
|
+
fovDeg: mt
|
|
2592
2592
|
},
|
|
2593
2593
|
perspectiveRight: {
|
|
2594
2594
|
kind: "perspective",
|
|
2595
2595
|
baseLat: 0,
|
|
2596
2596
|
baseLon: 20,
|
|
2597
2597
|
baseRev: 0,
|
|
2598
|
-
fovDeg:
|
|
2598
|
+
fovDeg: mt
|
|
2599
2599
|
}
|
|
2600
2600
|
};
|
|
2601
|
-
function
|
|
2601
|
+
function gt(e, t) {
|
|
2602
2602
|
let n = Array(9).fill(0);
|
|
2603
2603
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2604
2604
|
let a = 0;
|
|
@@ -2607,7 +2607,7 @@ function ht(e, t) {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
return n;
|
|
2609
2609
|
}
|
|
2610
|
-
function
|
|
2610
|
+
function _t(e) {
|
|
2611
2611
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2612
2612
|
return [
|
|
2613
2613
|
1,
|
|
@@ -2621,7 +2621,7 @@ function gt(e) {
|
|
|
2621
2621
|
n
|
|
2622
2622
|
];
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2624
|
+
function vt(e) {
|
|
2625
2625
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2626
2626
|
return [
|
|
2627
2627
|
n,
|
|
@@ -2635,7 +2635,7 @@ function _t(e) {
|
|
|
2635
2635
|
n
|
|
2636
2636
|
];
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function yt(e) {
|
|
2639
2639
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2640
2640
|
return [
|
|
2641
2641
|
n,
|
|
@@ -2649,22 +2649,22 @@ function vt(e) {
|
|
|
2649
2649
|
1
|
|
2650
2650
|
];
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2652
|
+
function bt(e, t, n, r) {
|
|
2653
2653
|
return [
|
|
2654
2654
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2655
2655
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2656
2656
|
e[6] * t + e[7] * n + e[8] * r
|
|
2657
2657
|
];
|
|
2658
2658
|
}
|
|
2659
|
-
function
|
|
2659
|
+
function xt(e, t) {
|
|
2660
2660
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2661
|
-
return
|
|
2661
|
+
return gt(yt(-(t ? t.rev : e.baseRev)), gt(_t(-n), vt(-r)));
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2663
|
+
function St(e) {
|
|
2664
|
+
return ht[e] || (e.startsWith("perspective") ? ht.perspectiveFront : ht.orthographicFront);
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2667
|
-
let r =
|
|
2666
|
+
function Ct(e, t, n) {
|
|
2667
|
+
let r = St(e.prst), i = xt(r, e.rot);
|
|
2668
2668
|
if (t <= 0 || n <= 0) return {
|
|
2669
2669
|
corners: [
|
|
2670
2670
|
{
|
|
@@ -2696,11 +2696,11 @@ function St(e, t, n) {
|
|
|
2696
2696
|
if (r.kind === "perspective") {
|
|
2697
2697
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2698
2698
|
u = s.map(([e, t]) => {
|
|
2699
|
-
let [n, r, o] =
|
|
2699
|
+
let [n, r, o] = bt(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
|
|
2700
2700
|
return [n * c, r * c];
|
|
2701
2701
|
});
|
|
2702
2702
|
} else u = s.map(([e, t]) => {
|
|
2703
|
-
let [n, r] =
|
|
2703
|
+
let [n, r] = bt(i, e, t, 0);
|
|
2704
2704
|
return [n, r];
|
|
2705
2705
|
});
|
|
2706
2706
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -2723,18 +2723,18 @@ function St(e, t, n) {
|
|
|
2723
2723
|
isIdentity: _
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
let { isIdentity: t } =
|
|
2726
|
+
function wt(e) {
|
|
2727
|
+
let { isIdentity: t } = Ct(e, 1e3, 1e3);
|
|
2728
2728
|
return !t;
|
|
2729
2729
|
}
|
|
2730
|
-
function
|
|
2731
|
-
let i =
|
|
2730
|
+
function Tt(e, t, n, r) {
|
|
2731
|
+
let i = St(e.prst), a = xt(i, e.rot);
|
|
2732
2732
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
2733
2733
|
x: 0,
|
|
2734
2734
|
y: 0
|
|
2735
2735
|
};
|
|
2736
2736
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
2737
|
-
let [n, r, o] =
|
|
2737
|
+
let [n, r, o] = bt(a, 0, 0, t);
|
|
2738
2738
|
if (i.kind === "perspective") {
|
|
2739
2739
|
let t = e.fov ?? i.fovDeg, a = Math.max(1, Math.min(179, t)) * Math.PI / 180, s = c / Math.tan(a / 2), u = s - o, d = s / (Math.abs(u) < 1e-6 ? 1e-6 * Math.sign(u || 1) : u);
|
|
2740
2740
|
return [n * d * l, r * d * l];
|
|
@@ -2748,12 +2748,12 @@ function wt(e, t, n, r) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
//#endregion
|
|
2750
2750
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2751
|
-
function
|
|
2751
|
+
function Et(e, t) {
|
|
2752
2752
|
if (t <= 0) return () => 1;
|
|
2753
2753
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
2754
2754
|
switch (e) {
|
|
2755
2755
|
case "hardEdge": {
|
|
2756
|
-
let e =
|
|
2756
|
+
let e = Pt;
|
|
2757
2757
|
return (t) => {
|
|
2758
2758
|
let r = Math.min(1, n(t) / e);
|
|
2759
2759
|
return r * r * (3 - 2 * r);
|
|
@@ -2773,7 +2773,7 @@ function Tt(e, t) {
|
|
|
2773
2773
|
};
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function Dt(e) {
|
|
2777
2777
|
let t = e.length, n = new Float64Array(t);
|
|
2778
2778
|
if (t === 0) return n;
|
|
2779
2779
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -2791,7 +2791,7 @@ function Et(e) {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
return n;
|
|
2793
2793
|
}
|
|
2794
|
-
function
|
|
2794
|
+
function Ot(e, t = 3) {
|
|
2795
2795
|
if (e <= 0) return Array(t).fill(1);
|
|
2796
2796
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
2797
2797
|
r % 2 == 0 && r--;
|
|
@@ -2799,7 +2799,7 @@ function Dt(e, t = 3) {
|
|
|
2799
2799
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
2800
2800
|
return s;
|
|
2801
2801
|
}
|
|
2802
|
-
function
|
|
2802
|
+
function kt(e, t, n, r, i, a) {
|
|
2803
2803
|
let o = 1 / (2 * i + 1);
|
|
2804
2804
|
if (a) for (let a = 0; a < r; a++) {
|
|
2805
2805
|
let r = a * n, s = 0;
|
|
@@ -2820,29 +2820,29 @@ function Ot(e, t, n, r, i, a) {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2823
|
+
function At(e, t, n, r) {
|
|
2824
2824
|
let i = Float64Array.from(e);
|
|
2825
2825
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
2826
2826
|
let a = new Float64Array(t * n);
|
|
2827
|
-
for (let e of
|
|
2827
|
+
for (let e of Ot(r, 3)) {
|
|
2828
2828
|
let r = Math.max(1, (e - 1) / 2);
|
|
2829
|
-
|
|
2829
|
+
kt(i, a, t, n, r, !0), kt(a, i, t, n, r, !1);
|
|
2830
2830
|
}
|
|
2831
2831
|
return i;
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2833
|
+
function jt(e, t, n, r = 128) {
|
|
2834
2834
|
let i = new Float64Array(t * n);
|
|
2835
2835
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
2836
2836
|
let a = new Float64Array(n);
|
|
2837
2837
|
for (let e = 0; e < t; e++) {
|
|
2838
2838
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
2839
|
-
let r =
|
|
2839
|
+
let r = Dt(a);
|
|
2840
2840
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
2841
2841
|
}
|
|
2842
2842
|
let o = new Float64Array(t);
|
|
2843
2843
|
for (let e = 0; e < n; e++) {
|
|
2844
2844
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
2845
|
-
let n =
|
|
2845
|
+
let n = Dt(o);
|
|
2846
2846
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
2847
2847
|
}
|
|
2848
2848
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -2854,15 +2854,15 @@ function At(e, t, n, r = 128) {
|
|
|
2854
2854
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
2855
2855
|
return i;
|
|
2856
2856
|
}
|
|
2857
|
-
var
|
|
2858
|
-
function
|
|
2857
|
+
var Mt = .25, Nt = .35, Pt = .5;
|
|
2858
|
+
function Ft(e, t, n, r, i, a) {
|
|
2859
2859
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
2860
2860
|
if (t <= 0 || n <= 0) return {
|
|
2861
2861
|
normals: o,
|
|
2862
2862
|
bandMask: s,
|
|
2863
2863
|
bandWeight: c
|
|
2864
2864
|
};
|
|
2865
|
-
let l =
|
|
2865
|
+
let l = jt(e, t, n), u = Et(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = At(l, t, n, Math.max(1, r * Mt)), m = (e) => {
|
|
2866
2866
|
let t = u(Math.max(0, e - .5));
|
|
2867
2867
|
return u(e + .5) - t;
|
|
2868
2868
|
};
|
|
@@ -2877,9 +2877,9 @@ function Pt(e, t, n, r, i, a) {
|
|
|
2877
2877
|
o[a * 3 + 2] = 1;
|
|
2878
2878
|
continue;
|
|
2879
2879
|
}
|
|
2880
|
-
let g = u / r, _ = 1 -
|
|
2880
|
+
let g = u / r, _ = 1 - Nt, v = 1;
|
|
2881
2881
|
if (g > _) {
|
|
2882
|
-
let e = Math.min(1, (g - _) /
|
|
2882
|
+
let e = Math.min(1, (g - _) / Nt);
|
|
2883
2883
|
v = 1 - e * e * (3 - 2 * e);
|
|
2884
2884
|
}
|
|
2885
2885
|
c[a] = v;
|
|
@@ -2894,7 +2894,7 @@ function Pt(e, t, n, r, i, a) {
|
|
|
2894
2894
|
bandWeight: c
|
|
2895
2895
|
};
|
|
2896
2896
|
}
|
|
2897
|
-
var
|
|
2897
|
+
var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
|
|
2898
2898
|
t: {
|
|
2899
2899
|
x: 0,
|
|
2900
2900
|
y: -1
|
|
@@ -2928,22 +2928,22 @@ var Ft = 35 * Math.PI / 180, It = 12 * Math.PI / 180, Lt = {
|
|
|
2928
2928
|
y: 1
|
|
2929
2929
|
}
|
|
2930
2930
|
};
|
|
2931
|
-
function
|
|
2931
|
+
function zt(e, t, n) {
|
|
2932
2932
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
2933
2933
|
return {
|
|
2934
2934
|
x: e * i - t * a,
|
|
2935
2935
|
y: e * a + t * i
|
|
2936
2936
|
};
|
|
2937
2937
|
}
|
|
2938
|
-
function
|
|
2939
|
-
let r =
|
|
2940
|
-
return n && n.rev && (r =
|
|
2938
|
+
function Bt(e, t, n) {
|
|
2939
|
+
let r = Rt[t] ?? Rt.t;
|
|
2940
|
+
return n && n.rev && (r = zt(r.x, r.y, n.rev)), Ht(r.x, r.y, It);
|
|
2941
2941
|
}
|
|
2942
|
-
function
|
|
2942
|
+
function Vt(e) {
|
|
2943
2943
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
2944
|
-
return
|
|
2944
|
+
return Ht(-e.x / t, -e.y / t, Lt);
|
|
2945
2945
|
}
|
|
2946
|
-
function
|
|
2946
|
+
function Ht(e, t, n) {
|
|
2947
2947
|
let r = Math.hypot(e, t) || 1, i = Math.cos(n), a = Math.sin(n), o = e / r * i, s = t / r * i, c = a, l = Math.hypot(o, s, c) || 1;
|
|
2948
2948
|
return {
|
|
2949
2949
|
x: o / l,
|
|
@@ -2951,7 +2951,7 @@ function Vt(e, t, n) {
|
|
|
2951
2951
|
z: c / l
|
|
2952
2952
|
};
|
|
2953
2953
|
}
|
|
2954
|
-
var
|
|
2954
|
+
var Ut = 2, Wt = {
|
|
2955
2955
|
matte: {
|
|
2956
2956
|
ambient: .62,
|
|
2957
2957
|
diffuse: .45,
|
|
@@ -2964,8 +2964,8 @@ var Ht = 2, Ut = {
|
|
|
2964
2964
|
specular: .35,
|
|
2965
2965
|
shininess: 22
|
|
2966
2966
|
}
|
|
2967
|
-
},
|
|
2968
|
-
function
|
|
2967
|
+
}, Gt = .8;
|
|
2968
|
+
function Kt(e) {
|
|
2969
2969
|
switch (e) {
|
|
2970
2970
|
case "plastic":
|
|
2971
2971
|
case "metal":
|
|
@@ -2976,8 +2976,8 @@ function Gt(e) {
|
|
|
2976
2976
|
default: return "matte";
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2980
|
-
let r =
|
|
2979
|
+
function qt(e, t, n = !0) {
|
|
2980
|
+
let r = Wt[e], i = {
|
|
2981
2981
|
light: t,
|
|
2982
2982
|
material: e,
|
|
2983
2983
|
ambient: r.ambient,
|
|
@@ -2985,9 +2985,9 @@ function Kt(e, t, n = !0) {
|
|
|
2985
2985
|
specular: r.specular,
|
|
2986
2986
|
shininess: r.shininess
|
|
2987
2987
|
};
|
|
2988
|
-
return n && (i.fillLight =
|
|
2988
|
+
return n && (i.fillLight = Vt(t), i.fillDiffuse = i.diffuse * Gt), i;
|
|
2989
2989
|
}
|
|
2990
|
-
function
|
|
2990
|
+
function Jt(e, t) {
|
|
2991
2991
|
let n = e.x * t.light.x + e.y * t.light.y + e.z * t.light.z, r = t.diffuse * Math.max(0, n), i = 0;
|
|
2992
2992
|
if (t.fillLight && t.fillDiffuse) {
|
|
2993
2993
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -3000,7 +3000,7 @@ function qt(e, t) {
|
|
|
3000
3000
|
}
|
|
3001
3001
|
return Math.max(0, t.ambient + r + i + a);
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3003
|
+
function Yt(e, t, n) {
|
|
3004
3004
|
if (!e) return {
|
|
3005
3005
|
x: 0,
|
|
3006
3006
|
y: 0,
|
|
@@ -3015,16 +3015,16 @@ function Jt(e, t, n) {
|
|
|
3015
3015
|
h: Math.max(0, o - i)
|
|
3016
3016
|
};
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3018
|
+
function Xt(e, t, n) {
|
|
3019
3019
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3020
3020
|
if (r <= 0 || i <= 0) return;
|
|
3021
3021
|
let a = t.widthPx;
|
|
3022
3022
|
if (a < .75) return;
|
|
3023
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3023
|
+
let { x: o, y: s, w: c, h: l } = Yt(n, r, i);
|
|
3024
3024
|
if (c <= 0 || l <= 0) return;
|
|
3025
3025
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3026
3026
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3027
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3027
|
+
let { bandMask: p, bandWeight: m, normals: h } = Ft(f, c, l, a, t.prst, t.heightPx), g = qt(t.material, t.light), _ = Jt({
|
|
3028
3028
|
x: 0,
|
|
3029
3029
|
y: 0,
|
|
3030
3030
|
z: 1
|
|
@@ -3035,13 +3035,13 @@ function Yt(e, t, n) {
|
|
|
3035
3035
|
if (n <= 0) continue;
|
|
3036
3036
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3037
3037
|
t.bottom && (r = -r, i = -i);
|
|
3038
|
-
let o = 1 + (
|
|
3038
|
+
let o = 1 + (Jt({
|
|
3039
3039
|
x: r,
|
|
3040
3040
|
y: i,
|
|
3041
3041
|
z: a
|
|
3042
3042
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3043
3043
|
if (o >= 1) {
|
|
3044
|
-
let e = Math.min(1, (o - 1) *
|
|
3044
|
+
let e = Math.min(1, (o - 1) * Ut);
|
|
3045
3045
|
for (let t = 0; t < 3; t++) {
|
|
3046
3046
|
let n = Math.min(255, d[s + t] * o);
|
|
3047
3047
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3050,12 +3050,12 @@ function Yt(e, t, n) {
|
|
|
3050
3050
|
}
|
|
3051
3051
|
e.putImageData(u, o, s);
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3053
|
+
function Zt(e, t, n) {
|
|
3054
3054
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3055
3055
|
if (r <= 0 || i <= 0) return;
|
|
3056
3056
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3057
3057
|
if (s < .75) return;
|
|
3058
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3058
|
+
let { x: c, y: l, w: u, h: d } = Yt(n, r, i);
|
|
3059
3059
|
if (u <= 0 || d <= 0) return;
|
|
3060
3060
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3061
3061
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3079,8 +3079,8 @@ function Xt(e, t, n) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
//#endregion
|
|
3081
3081
|
//#region packages/core/src/text/underline.ts
|
|
3082
|
-
function
|
|
3083
|
-
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d =
|
|
3082
|
+
function Qt(e, t, n, r, i, a, o, s = 1) {
|
|
3083
|
+
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = _(u, l, s);
|
|
3084
3084
|
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3085
3085
|
let n = l, i = l * 6;
|
|
3086
3086
|
e.beginPath(), e.moveTo(t, u);
|
|
@@ -3101,14 +3101,14 @@ function Zt(e, t, n, r, i, a, o, s = 1) {
|
|
|
3101
3101
|
}
|
|
3102
3102
|
if (o === "dbl") {
|
|
3103
3103
|
let n = l * 1.4, i = u - n / 2, a = u + n / 2;
|
|
3104
|
-
e.beginPath(), e.moveTo(t, i +
|
|
3104
|
+
e.beginPath(), e.moveTo(t, i + _(i, l, s)), e.lineTo(t + r, i + _(i, l, s)), e.moveTo(t, a + _(a, l, s)), e.lineTo(t + r, a + _(a, l, s)), e.stroke();
|
|
3105
3105
|
return;
|
|
3106
3106
|
}
|
|
3107
|
-
e.setLineDash(
|
|
3107
|
+
e.setLineDash(Oe(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
|
|
3108
3108
|
}
|
|
3109
3109
|
//#endregion
|
|
3110
3110
|
//#region packages/core/src/text/highlight-box.ts
|
|
3111
|
-
function
|
|
3111
|
+
function $t(e, t) {
|
|
3112
3112
|
return {
|
|
3113
3113
|
top: e - t * .85,
|
|
3114
3114
|
height: t * 1.1
|
|
@@ -3116,7 +3116,7 @@ function Qt(e, t) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
//#endregion
|
|
3118
3118
|
//#region packages/core/src/text/justify-positions.ts
|
|
3119
|
-
function
|
|
3119
|
+
function en(e, t, n, r, i = 0) {
|
|
3120
3120
|
let a = [], o = 0, s = 0;
|
|
3121
3121
|
for (let c of t) a.push({
|
|
3122
3122
|
text: e.slice(o, c).join(""),
|
|
@@ -3129,14 +3129,14 @@ function $t(e, t, n, r, i = 0) {
|
|
|
3129
3129
|
}
|
|
3130
3130
|
//#endregion
|
|
3131
3131
|
//#region packages/pptx/src/reflection-blur.ts
|
|
3132
|
-
var
|
|
3133
|
-
function
|
|
3132
|
+
var tn = .5;
|
|
3133
|
+
function nn(e, t) {
|
|
3134
3134
|
if (!(t > 0) || !(e.h > 0)) return [{
|
|
3135
3135
|
y: e.y,
|
|
3136
3136
|
h: Math.max(0, e.h),
|
|
3137
3137
|
radius: 0
|
|
3138
3138
|
}];
|
|
3139
|
-
let n = Math.max(4, Math.min(24, Math.ceil(t /
|
|
3139
|
+
let n = Math.max(4, Math.min(24, Math.ceil(t / tn) + 1)), r = e.y + e.h, i = [];
|
|
3140
3140
|
for (let a = 0; a < n; a++) {
|
|
3141
3141
|
let o = Math.sqrt(a / (n - 1)), s = a === 0 ? 0 : Math.sqrt((a - 1) / (n - 1)), c = a === n - 1 ? 1 : Math.sqrt((a + 1) / (n - 1)), l = a === 0 ? 0 : (s + o) / 2, u = a === n - 1 ? 1 : (o + c) / 2, d = r - u * e.h;
|
|
3142
3142
|
i.push({
|
|
@@ -3147,20 +3147,20 @@ function tn(e, t) {
|
|
|
3147
3147
|
}
|
|
3148
3148
|
return i;
|
|
3149
3149
|
}
|
|
3150
|
-
function
|
|
3151
|
-
for (let a of
|
|
3150
|
+
function rn(e, t, n, r, i) {
|
|
3151
|
+
for (let a of nn(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
|
|
3152
3152
|
}
|
|
3153
3153
|
//#endregion
|
|
3154
3154
|
//#region packages/pptx/src/hyperlink.ts
|
|
3155
|
-
function
|
|
3155
|
+
function an(e, t) {
|
|
3156
3156
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3157
3157
|
if (n === void 0 && r === void 0) return;
|
|
3158
3158
|
if (r !== void 0) return {
|
|
3159
3159
|
kind: "internal",
|
|
3160
3160
|
ref: n ?? r
|
|
3161
3161
|
};
|
|
3162
|
-
let i = n, a =
|
|
3163
|
-
return a !== null &&
|
|
3162
|
+
let i = n, a = G(i);
|
|
3163
|
+
return a !== null && ae.includes(a) ? {
|
|
3164
3164
|
kind: "external",
|
|
3165
3165
|
url: i
|
|
3166
3166
|
} : {
|
|
@@ -3170,7 +3170,7 @@ function rn(e, t) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
//#endregion
|
|
3172
3172
|
//#region packages/pptx/src/media-chrome.ts
|
|
3173
|
-
function
|
|
3173
|
+
function on(e, t, n, r, i, a) {
|
|
3174
3174
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3175
3175
|
if (e.save(), e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = o * .35, e.fillStyle = "rgba(20, 20, 20, 0.7)", e.beginPath(), e.arc(t, n, o, 0, Math.PI * 2), e.fill(), e.shadowColor = "transparent", e.shadowBlur = 0, e.fillStyle = "#fff", a === "paused") {
|
|
3176
3176
|
e.beginPath();
|
|
@@ -3184,89 +3184,89 @@ function an(e, t, n, r, i, a) {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
//#endregion
|
|
3186
3186
|
//#region packages/pptx/src/bidi-line.ts
|
|
3187
|
-
var
|
|
3187
|
+
var sn = (e) => {
|
|
3188
3188
|
let t = e.text;
|
|
3189
3189
|
return typeof t == "string" ? t : void 0;
|
|
3190
|
-
},
|
|
3191
|
-
function
|
|
3192
|
-
for (let
|
|
3193
|
-
let e =
|
|
3194
|
-
if (e !== void 0 &&
|
|
3190
|
+
}, cn = (e) => "isTab" in e;
|
|
3191
|
+
function ln(e) {
|
|
3192
|
+
for (let n of e) {
|
|
3193
|
+
let e = sn(n);
|
|
3194
|
+
if (e !== void 0 && t(e)) return !0;
|
|
3195
3195
|
}
|
|
3196
3196
|
return !1;
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3199
|
-
let
|
|
3200
|
-
if (
|
|
3198
|
+
function un(e, t) {
|
|
3199
|
+
let n = e.length;
|
|
3200
|
+
if (n === 0) return {
|
|
3201
3201
|
order: [],
|
|
3202
3202
|
rtl: []
|
|
3203
3203
|
};
|
|
3204
|
-
let
|
|
3205
|
-
for (let t = 0; t <
|
|
3206
|
-
|
|
3207
|
-
let n =
|
|
3208
|
-
if (
|
|
3209
|
-
for (
|
|
3210
|
-
|
|
3204
|
+
let r = "", i = Array(n), a;
|
|
3205
|
+
for (let t = 0; t < n; t++) {
|
|
3206
|
+
i[t] = r.length;
|
|
3207
|
+
let n = sn(e[t]) ?? "";
|
|
3208
|
+
if (r += n.length > 0 ? n : "", cn(e[t])) {
|
|
3209
|
+
for (a ??= []; a.length < r.length;) a.push(null);
|
|
3210
|
+
a[i[t]] = "S";
|
|
3211
3211
|
}
|
|
3212
3212
|
}
|
|
3213
|
-
if (
|
|
3214
|
-
let { levels:
|
|
3215
|
-
for (let e = 0; e <
|
|
3213
|
+
if (a) for (; a.length < r.length;) a.push(null);
|
|
3214
|
+
let { levels: o, paragraphLevel: s } = B().computeLevels(r, t ? "rtl" : "ltr", a), { order: c, segLevels: l } = H(o, s, i), u = Array(n);
|
|
3215
|
+
for (let e = 0; e < n; e++) u[e] = (l[e] & 1) == 1;
|
|
3216
3216
|
return {
|
|
3217
|
-
order:
|
|
3218
|
-
rtl:
|
|
3217
|
+
order: c,
|
|
3218
|
+
rtl: u
|
|
3219
3219
|
};
|
|
3220
3220
|
}
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3223
|
-
function
|
|
3223
|
+
function dn(e, t, n, r, i = 0, a = !1) {
|
|
3224
3224
|
if (e.length === 0) return 0;
|
|
3225
|
-
let o = t === 0, s = 0,
|
|
3225
|
+
let o = t === 0, s = 0, l = t;
|
|
3226
3226
|
for (let t of e) {
|
|
3227
3227
|
let e = s > 0 || a ? i : 0;
|
|
3228
|
-
if (
|
|
3228
|
+
if (l + e + t.w > n) {
|
|
3229
3229
|
if (s > 0 || !o) break;
|
|
3230
|
-
|
|
3230
|
+
l += e + t.w, s++;
|
|
3231
3231
|
break;
|
|
3232
3232
|
}
|
|
3233
|
-
|
|
3233
|
+
l += e + t.w, s++;
|
|
3234
3234
|
}
|
|
3235
|
-
return s === 0 ? 0 : s >= e.length ? e.length :
|
|
3235
|
+
return s === 0 ? 0 : s >= e.length ? e.length : c(e.map((e) => e.ch), s, r, +!!o);
|
|
3236
3236
|
}
|
|
3237
3237
|
//#endregion
|
|
3238
3238
|
//#region packages/pptx/src/text-justify.ts
|
|
3239
|
-
var
|
|
3240
|
-
function
|
|
3241
|
-
if (r === "just" &&
|
|
3242
|
-
let
|
|
3243
|
-
if (
|
|
3244
|
-
let
|
|
3239
|
+
var fn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3240
|
+
function pn(e, t, n, r, a) {
|
|
3241
|
+
if (r === "just" && a) return null;
|
|
3242
|
+
let o = t - n;
|
|
3243
|
+
if (o <= .5) return null;
|
|
3244
|
+
let s = we(e, o, {
|
|
3245
3245
|
firstContentSi: 0,
|
|
3246
3246
|
lastDrawnSi: e.length,
|
|
3247
|
-
isGapChar:
|
|
3248
|
-
isWhitespace:
|
|
3247
|
+
isGapChar: i,
|
|
3248
|
+
isWhitespace: fn,
|
|
3249
3249
|
seaClusterGaps: r === "thaiDist"
|
|
3250
3250
|
});
|
|
3251
|
-
if (!
|
|
3252
|
-
let { perGap:
|
|
3251
|
+
if (!s) return null;
|
|
3252
|
+
let { perGap: c, perSeg: l } = s, u = [];
|
|
3253
3253
|
for (let t = 0; t < e.length; t++) {
|
|
3254
|
-
let n = e[t], r =
|
|
3255
|
-
a && a.length > 0 ?
|
|
3254
|
+
let n = e[t], r = l.get(t), i = r?.trailingGap ? c : 0, a = r?.splitBefore;
|
|
3255
|
+
a && a.length > 0 ? u.push({
|
|
3256
3256
|
...n,
|
|
3257
3257
|
jext: i,
|
|
3258
3258
|
splitBefore: [...a],
|
|
3259
|
-
perGap:
|
|
3260
|
-
}) :
|
|
3259
|
+
perGap: c
|
|
3260
|
+
}) : u.push({
|
|
3261
3261
|
...n,
|
|
3262
3262
|
jext: i
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
|
-
return
|
|
3265
|
+
return u;
|
|
3266
3266
|
}
|
|
3267
3267
|
//#endregion
|
|
3268
3268
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3269
|
-
function
|
|
3269
|
+
function mn(e) {
|
|
3270
3270
|
if (!e) return {
|
|
3271
3271
|
r: 0,
|
|
3272
3272
|
g: 0,
|
|
@@ -3283,37 +3283,37 @@ function pn(e) {
|
|
|
3283
3283
|
b: parseInt(t.slice(4, 6), 16)
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
|
-
function
|
|
3287
|
-
let t =
|
|
3286
|
+
function hn(e) {
|
|
3287
|
+
let t = mn(e);
|
|
3288
3288
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3289
3289
|
}
|
|
3290
|
-
function
|
|
3290
|
+
function gn(e, t) {
|
|
3291
3291
|
if (!e && !t) return null;
|
|
3292
3292
|
if (!e) return t;
|
|
3293
3293
|
if (!t) return e;
|
|
3294
3294
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3295
|
-
let n =
|
|
3295
|
+
let n = hn(e.color), r = hn(t.color);
|
|
3296
3296
|
return n === r || n < r ? e : t;
|
|
3297
3297
|
}
|
|
3298
3298
|
//#endregion
|
|
3299
3299
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3300
|
-
function
|
|
3301
|
-
let t =
|
|
3300
|
+
function _n(e) {
|
|
3301
|
+
let t = ie(e.length === 8 ? e.slice(0, 6) : e);
|
|
3302
3302
|
if (!t) return null;
|
|
3303
|
-
let n =
|
|
3303
|
+
let n = M(t[0], t[1], t[2]);
|
|
3304
3304
|
if (e.length !== 8) return n;
|
|
3305
3305
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3306
3306
|
if (Number.isNaN(r)) return null;
|
|
3307
3307
|
let i = r / 255;
|
|
3308
3308
|
return i * n + (1 - i);
|
|
3309
3309
|
}
|
|
3310
|
-
function
|
|
3310
|
+
function vn(e) {
|
|
3311
3311
|
if (!e) return null;
|
|
3312
|
-
if (e.fillType === "solid") return
|
|
3312
|
+
if (e.fillType === "solid") return _n(e.color);
|
|
3313
3313
|
if (e.fillType === "gradient") {
|
|
3314
3314
|
let t = e.stops.map((e) => ({
|
|
3315
3315
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3316
|
-
l:
|
|
3316
|
+
l: _n(e.color)
|
|
3317
3317
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3318
3318
|
if (t.length === 0) return null;
|
|
3319
3319
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3322,18 +3322,18 @@ function _n(e) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return null;
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function yn(e) {
|
|
3326
3326
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let n =
|
|
3328
|
+
function bn(e, t) {
|
|
3329
|
+
let n = vn(e);
|
|
3330
3330
|
if (n === null || n >= .5) return null;
|
|
3331
|
-
let r =
|
|
3331
|
+
let r = _n(t.replace(/^#/, ""));
|
|
3332
3332
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3333
3333
|
}
|
|
3334
3334
|
//#endregion
|
|
3335
3335
|
//#region packages/pptx/src/tab-layout.ts
|
|
3336
|
-
function
|
|
3336
|
+
function xn(e, t, n, r, i, a = 0) {
|
|
3337
3337
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3338
3338
|
let n = 0;
|
|
3339
3339
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3361,8 +3361,8 @@ function bn(e, t, n, r, i, a = 0) {
|
|
|
3361
3361
|
}
|
|
3362
3362
|
//#endregion
|
|
3363
3363
|
//#region packages/pptx/src/vertical-text.ts
|
|
3364
|
-
var
|
|
3365
|
-
function
|
|
3364
|
+
var Sn = () => !1;
|
|
3365
|
+
function Cn(e, t, n) {
|
|
3366
3366
|
let r = e.textBaseline;
|
|
3367
3367
|
e.textBaseline = "alphabetic";
|
|
3368
3368
|
let i = e.measureText(t);
|
|
@@ -3370,7 +3370,7 @@ function Sn(e, t, n) {
|
|
|
3370
3370
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3371
3371
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3372
3372
|
}
|
|
3373
|
-
function
|
|
3373
|
+
function wn(e, t) {
|
|
3374
3374
|
let n = e.textAlign, r = e.textBaseline;
|
|
3375
3375
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3376
3376
|
let i = e.measureText(t);
|
|
@@ -3378,15 +3378,15 @@ function Cn(e, t) {
|
|
|
3378
3378
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3379
3379
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3380
3380
|
}
|
|
3381
|
-
function
|
|
3382
|
-
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r -
|
|
3381
|
+
function Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
|
|
3382
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Cn(e, t, i), f = 0;
|
|
3383
3383
|
for (let o of t) {
|
|
3384
|
-
let t = o.codePointAt(0) ?? 0, l =
|
|
3385
|
-
if (
|
|
3384
|
+
let t = o.codePointAt(0) ?? 0, l = se(t), p = e.measureText(o).width + a, m = l === "Tr" ? A(t) : null, h = l === "Tr" && m === null && F(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3385
|
+
if (N(t) && s(t)) {
|
|
3386
3386
|
let t = n + f + p / 2;
|
|
3387
|
-
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
3387
|
+
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", K(e, () => u(o, 0, 0)), e.restore();
|
|
3388
3388
|
} else if (g) {
|
|
3389
|
-
let r = m === null && l === "Tu" ?
|
|
3389
|
+
let r = m === null && l === "Tu" ? W(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? wn(e, s) / i : 0;
|
|
3390
3390
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
3391
3391
|
} else if (l === "Tr") {
|
|
3392
3392
|
let t = n + f + p / 2;
|
|
@@ -3396,25 +3396,25 @@ function wn(e, t, n, r, i, a, o = "fill", s = xn) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
e.textAlign = c, e.textBaseline = l;
|
|
3398
3398
|
}
|
|
3399
|
-
function
|
|
3400
|
-
|
|
3399
|
+
function En(e, t, n, r, i, a, o = "fill") {
|
|
3400
|
+
Tn(e, t, n, r, i, a, o, (t) => D(e, t));
|
|
3401
3401
|
}
|
|
3402
3402
|
//#endregion
|
|
3403
3403
|
//#region packages/pptx/src/renderer.ts
|
|
3404
3404
|
function X(e, t) {
|
|
3405
3405
|
return e * t;
|
|
3406
3406
|
}
|
|
3407
|
-
function
|
|
3408
|
-
let i =
|
|
3407
|
+
function Dn(e, t, n, r) {
|
|
3408
|
+
let i = Fe(Math.abs(e * n), Math.abs(t * n), r);
|
|
3409
3409
|
return i ? {
|
|
3410
3410
|
targetWidthPx: i.width,
|
|
3411
3411
|
targetHeightPx: i.height
|
|
3412
3412
|
} : void 0;
|
|
3413
3413
|
}
|
|
3414
3414
|
function Z(e, t) {
|
|
3415
|
-
return
|
|
3415
|
+
return Xe(e, t);
|
|
3416
3416
|
}
|
|
3417
|
-
function
|
|
3417
|
+
function On(e, t) {
|
|
3418
3418
|
let n = e.targets.get(t);
|
|
3419
3419
|
return n ? {
|
|
3420
3420
|
targetWidthPx: n.width,
|
|
@@ -3422,11 +3422,11 @@ function Dn(e, t) {
|
|
|
3422
3422
|
maxRetainedPixels: n.maxRetainedPixels
|
|
3423
3423
|
} : void 0;
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3426
|
-
return
|
|
3425
|
+
function kn(e) {
|
|
3426
|
+
return z(e) ? e.svgImagePath : e.imagePath;
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3429
|
-
let i =
|
|
3428
|
+
function An(e, t, n, r) {
|
|
3429
|
+
let i = $e(t.bullet);
|
|
3430
3430
|
if (i.type !== "blip") return;
|
|
3431
3431
|
let a;
|
|
3432
3432
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
|
|
@@ -3436,84 +3436,84 @@ function kn(e, t, n, r) {
|
|
|
3436
3436
|
let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
|
|
3437
3437
|
return Math.max(1, s * Y * n * r);
|
|
3438
3438
|
}
|
|
3439
|
-
async function
|
|
3440
|
-
let
|
|
3441
|
-
if (!(!t || !
|
|
3442
|
-
if (
|
|
3443
|
-
|
|
3439
|
+
async function jn(e, t, n, r, i, a, o, s, c, l) {
|
|
3440
|
+
let u = k(a), d = [], f = [], p = (e, t, n, r, i, a = 1, o = i) => {
|
|
3441
|
+
if (!(!t || !i)) {
|
|
3442
|
+
if (le(r) && (u.resolution === "display" || u.strategy === "adaptive")) {
|
|
3443
|
+
d.push({
|
|
3444
3444
|
key: e,
|
|
3445
3445
|
...t,
|
|
3446
|
-
retainedSurfaceCount:
|
|
3446
|
+
retainedSurfaceCount: a
|
|
3447
3447
|
});
|
|
3448
3448
|
return;
|
|
3449
3449
|
}
|
|
3450
|
-
|
|
3450
|
+
f.push(R(n, r, i, o).then((n) => n.dimensions && x(n.format, l !== void 0) ? {
|
|
3451
3451
|
key: e,
|
|
3452
3452
|
...t,
|
|
3453
3453
|
sourceWidthPx: n.dimensions.width,
|
|
3454
3454
|
sourceHeightPx: n.dimensions.height,
|
|
3455
|
-
retainedSurfaceCount:
|
|
3455
|
+
retainedSurfaceCount: a
|
|
3456
3456
|
} : null).catch(() => null));
|
|
3457
3457
|
}
|
|
3458
|
-
},
|
|
3459
|
-
if (
|
|
3460
|
-
let e =
|
|
3461
|
-
|
|
3458
|
+
}, m = e.background;
|
|
3459
|
+
if (m?.fillType === "image" && m.imagePath && !m.tile && !m.duotone) {
|
|
3460
|
+
let e = m.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), a = n * (1 - (e.t ?? 0) - (e.b ?? 0));
|
|
3461
|
+
p(Z(m.imagePath, m.duotone), Dn(r, a, i, m.srcRect), m.imagePath, m.mimeType, o, 1);
|
|
3462
3462
|
}
|
|
3463
|
-
for (let t of e.elements) if (t.type === "picture") !(
|
|
3463
|
+
for (let t of e.elements) if (t.type === "picture") !(z(t) || t.mimeType === "image/svg+xml") && !t.duotone && p(Z(t.imagePath, t.duotone), Dn(X(t.width, r), X(t.height, r), i, t.srcRect), t.imagePath, t.mimeType, o, 1);
|
|
3464
3464
|
else if (t.type === "media" && t.posterPath) {
|
|
3465
|
-
let e =
|
|
3466
|
-
|
|
3465
|
+
let e = s ? ti(s) : void 0;
|
|
3466
|
+
p(Z(t.posterPath), Dn(X(t.width, r), X(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, c ?? e);
|
|
3467
3467
|
} else if (t.type === "chart") {
|
|
3468
3468
|
let e = {
|
|
3469
3469
|
widthPt: t.width / Y,
|
|
3470
3470
|
heightPt: t.height / Y,
|
|
3471
|
-
targetWidthPx: X(t.width, r) *
|
|
3472
|
-
targetHeightPx: X(t.height, r) *
|
|
3471
|
+
targetWidthPx: X(t.width, r) * i,
|
|
3472
|
+
targetHeightPx: X(t.height, r) * i
|
|
3473
3473
|
};
|
|
3474
|
-
for (let n of
|
|
3475
|
-
let t = n.fill, r =
|
|
3476
|
-
!(t.mimeType === "image/svg+xml" ||
|
|
3474
|
+
for (let n of Ee(t.chart)) {
|
|
3475
|
+
let t = n.fill, r = De(n, e);
|
|
3476
|
+
!(t.mimeType === "image/svg+xml" || z({
|
|
3477
3477
|
svgImagePath: t.svgImagePath,
|
|
3478
3478
|
srcRect: n.hasSourceCrop ? !0 : null
|
|
3479
|
-
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx &&
|
|
3479
|
+
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && p(Z(t.imagePath, t.duotone), {
|
|
3480
3480
|
targetWidthPx: r.targetWidthPx,
|
|
3481
3481
|
targetHeightPx: r.targetHeightPx
|
|
3482
|
-
}, t.imagePath, t.mimeType,
|
|
3482
|
+
}, t.imagePath, t.mimeType, o, 1);
|
|
3483
3483
|
}
|
|
3484
3484
|
} else if (t.type === "shape" && t.textBody) for (let e of t.textBody.paragraphs) {
|
|
3485
|
-
let n =
|
|
3485
|
+
let n = $e(e.bullet);
|
|
3486
3486
|
if (n.type !== "blip") continue;
|
|
3487
|
-
let
|
|
3488
|
-
!
|
|
3487
|
+
let a = An(t.textBody, e, r, i);
|
|
3488
|
+
!a || !o || f.push(R(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && x(e.format, l !== void 0) ? {
|
|
3489
3489
|
key: Z(n.imagePath),
|
|
3490
|
-
targetWidthPx:
|
|
3491
|
-
targetHeightPx:
|
|
3490
|
+
targetWidthPx: a * e.dimensions.width / e.dimensions.height,
|
|
3491
|
+
targetHeightPx: a,
|
|
3492
3492
|
sourceWidthPx: e.dimensions.width,
|
|
3493
3493
|
sourceHeightPx: e.dimensions.height
|
|
3494
3494
|
} : null).catch(() => null));
|
|
3495
3495
|
}
|
|
3496
|
-
return
|
|
3496
|
+
return d.push(...(await Promise.all(f)).filter((e) => e !== null)), de(d, u);
|
|
3497
3497
|
}
|
|
3498
|
-
function
|
|
3499
|
-
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ?
|
|
3498
|
+
function Mn(e) {
|
|
3499
|
+
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Ee(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => $e(e.bullet).type === "blip"));
|
|
3500
3500
|
}
|
|
3501
|
-
var Q =
|
|
3502
|
-
function
|
|
3503
|
-
let { top: s, height: c } =
|
|
3501
|
+
var Q = ke;
|
|
3502
|
+
function Nn(e, t, n, r, i, a, o) {
|
|
3503
|
+
let { top: s, height: c } = $t(n, i);
|
|
3504
3504
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3505
3505
|
}
|
|
3506
|
-
function
|
|
3507
|
-
return
|
|
3506
|
+
function Pn(e, t, n, r, i, a, o = 0) {
|
|
3507
|
+
return Ie(e, t, n, r, i, a, o);
|
|
3508
3508
|
}
|
|
3509
|
-
var
|
|
3510
|
-
function
|
|
3509
|
+
var Fn = /* @__PURE__ */ new WeakMap();
|
|
3510
|
+
function In(e, t) {
|
|
3511
3511
|
let n = e.tinted.get(t);
|
|
3512
3512
|
if (n) return n;
|
|
3513
|
-
let r =
|
|
3513
|
+
let r = te(e.raster, t);
|
|
3514
3514
|
return e.tinted.set(t, r), r;
|
|
3515
3515
|
}
|
|
3516
|
-
function
|
|
3516
|
+
function Ln(e) {
|
|
3517
3517
|
let t = [], n = (e) => {
|
|
3518
3518
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3519
3519
|
nodes: e.nodes,
|
|
@@ -3524,13 +3524,13 @@ function In(e) {
|
|
|
3524
3524
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3525
3525
|
return t;
|
|
3526
3526
|
}
|
|
3527
|
-
async function
|
|
3528
|
-
let n =
|
|
3527
|
+
async function Rn(e, t) {
|
|
3528
|
+
let n = Ln(e);
|
|
3529
3529
|
if (n.length !== 0) {
|
|
3530
3530
|
await t.loadMathJax();
|
|
3531
|
-
for (let e of n) if (!
|
|
3532
|
-
let n = await t.mathMLToSvg(
|
|
3533
|
-
|
|
3531
|
+
for (let e of n) if (!Fn.has(e.nodes)) try {
|
|
3532
|
+
let n = await t.mathMLToSvg(re(e.nodes, e.display)), r = await oe(n, "#000000");
|
|
3533
|
+
Fn.set(e.nodes, {
|
|
3534
3534
|
raster: r,
|
|
3535
3535
|
widthEm: n.widthEm,
|
|
3536
3536
|
ascentEm: n.ascentEm,
|
|
@@ -3540,14 +3540,14 @@ async function Ln(e, t) {
|
|
|
3540
3540
|
} catch {}
|
|
3541
3541
|
}
|
|
3542
3542
|
}
|
|
3543
|
-
function
|
|
3543
|
+
function zn(e, t) {
|
|
3544
3544
|
let n = (e) => t.embeddedFontAliases?.get(e.trim().toLowerCase()) ?? e;
|
|
3545
3545
|
if (!e) return n(t.themeMinorFont ?? "sans-serif");
|
|
3546
3546
|
if (e.startsWith("+")) return n(e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif");
|
|
3547
3547
|
let r = e.split(",")[0].trim();
|
|
3548
3548
|
return r ? n(r) : t.themeMinorFont ?? "sans-serif";
|
|
3549
3549
|
}
|
|
3550
|
-
var
|
|
3550
|
+
var Bn = new Set([
|
|
3551
3551
|
"serif",
|
|
3552
3552
|
"sans-serif",
|
|
3553
3553
|
"monospace",
|
|
@@ -3555,11 +3555,11 @@ var zn = new Set([
|
|
|
3555
3555
|
"fantasy",
|
|
3556
3556
|
"system-ui"
|
|
3557
3557
|
]);
|
|
3558
|
-
function
|
|
3559
|
-
let t =
|
|
3558
|
+
function Vn(e) {
|
|
3559
|
+
let t = S(e);
|
|
3560
3560
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3561
3561
|
}
|
|
3562
|
-
var
|
|
3562
|
+
var Hn = {
|
|
3563
3563
|
calibri: "Carlito",
|
|
3564
3564
|
"calibri light": "Carlito",
|
|
3565
3565
|
cambria: "Caladea",
|
|
@@ -3571,38 +3571,38 @@ var Vn = {
|
|
|
3571
3571
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3572
3572
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3573
3573
|
"univers next arabic": "Noto Sans Arabic"
|
|
3574
|
-
},
|
|
3575
|
-
function
|
|
3576
|
-
if (
|
|
3574
|
+
}, Un = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3575
|
+
function Wn(e) {
|
|
3576
|
+
if (Hn[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3577
3577
|
let t = e.toLowerCase();
|
|
3578
3578
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3579
3579
|
}
|
|
3580
|
-
function
|
|
3580
|
+
function Gn(e) {
|
|
3581
3581
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3582
3582
|
}
|
|
3583
|
-
function
|
|
3584
|
-
let n =
|
|
3585
|
-
if (
|
|
3586
|
-
let c = n === "serif" ? "serif" : "sans",
|
|
3587
|
-
return `"${e}", ${
|
|
3583
|
+
function Kn(e, t = e) {
|
|
3584
|
+
let n = Vn(t), i = Hn[t.toLowerCase()], a = i ? `"${i}", ` : "", o = u(t), s = o ? `"${o}", ` : "";
|
|
3585
|
+
if (Wn(t)) return `"${e}", ${a}${Un}, ${n}`;
|
|
3586
|
+
let c = n === "serif" ? "serif" : "sans", f = r(t), p = f ? pe(f, c).filter((e) => e !== o) : [];
|
|
3587
|
+
return `"${e}", ${a}${s}${p.length > 0 ? `${Gn(p)}, ` : ""}${`${Gn(c === "serif" ? d : l)}, `}${n}`;
|
|
3588
3588
|
}
|
|
3589
|
-
function
|
|
3589
|
+
function qn(e) {
|
|
3590
3590
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3592
|
+
function Jn(e) {
|
|
3593
3593
|
let t = e.toLowerCase();
|
|
3594
3594
|
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;
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3597
|
-
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 =
|
|
3596
|
+
function Yn(e, t, n, r, i, a, o, s) {
|
|
3597
|
+
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 = je(m, h), _ = g?.getContext("2d");
|
|
3598
3598
|
if (!g || !_) return;
|
|
3599
3599
|
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
|
|
3600
3600
|
let v = n.y - d, y = v + n.h, b = g, x = _;
|
|
3601
3601
|
if (c > 0) {
|
|
3602
|
-
let e =
|
|
3602
|
+
let e = je(m, h), t = e?.getContext("2d");
|
|
3603
3603
|
e && t && (b = e, x = t);
|
|
3604
3604
|
}
|
|
3605
|
-
b !== g &&
|
|
3605
|
+
b !== g && rn(x, g, {
|
|
3606
3606
|
x: n.x - u,
|
|
3607
3607
|
y: v,
|
|
3608
3608
|
w: n.w,
|
|
@@ -3629,14 +3629,14 @@ function Jn(e, t, n, r, i, a, o, s) {
|
|
|
3629
3629
|
let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
|
|
3630
3630
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.translate(n.x + Math.cos(E) * T, D + Math.sin(E) * T), e.scale(r.sx, r.sy), e.translate(-n.x, -D), e.drawImage(b, u, d), e.restore();
|
|
3631
3631
|
}
|
|
3632
|
-
function
|
|
3633
|
-
let a = t ? "italic " : "", o =
|
|
3634
|
-
return
|
|
3632
|
+
function Xn(e, t, n, r, i) {
|
|
3633
|
+
let a = t ? "italic " : "", o = zn(r, i), s = i.embeddedFontAuthoredFamilies?.get(o) ?? o, c = Jn(s), l = e ? "bold " : c ? `${c} ` : "";
|
|
3634
|
+
return Bn.has(o) ? `${a}${l}${n}px ${o}` : `${a}${l}${n}px ${Kn(o, s)}`;
|
|
3635
3635
|
}
|
|
3636
|
-
function
|
|
3637
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3636
|
+
function Zn(e) {
|
|
3637
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || $e(e.bullet).type === "blip";
|
|
3638
3638
|
}
|
|
3639
|
-
function
|
|
3639
|
+
function Qn(e, t, n) {
|
|
3640
3640
|
let r = null;
|
|
3641
3641
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
|
|
3642
3642
|
r = e.fontSize;
|
|
@@ -3645,41 +3645,77 @@ function Zn(e, t, n) {
|
|
|
3645
3645
|
let i = r ?? t.defFontSize ?? e.defaultFontSize ?? 18;
|
|
3646
3646
|
return n.sizePts == null ? i * ((n.sizePct ?? 100) / 100) : n.sizePts;
|
|
3647
3647
|
}
|
|
3648
|
-
function
|
|
3648
|
+
function $n(e, t) {
|
|
3649
3649
|
return e ? 0 : Math.max(0, t);
|
|
3650
3650
|
}
|
|
3651
|
-
|
|
3651
|
+
var er = /^\p{Script_Extensions=Latin}$/u, tr = /^\p{L}$/u, nr = /^[\u0000-\u007f]*$/u;
|
|
3652
|
+
function rr(e, t, n) {
|
|
3653
|
+
let r = t.codePointAt(0);
|
|
3654
|
+
if (r <= 127 && r !== 45 || tr.test(t)) return !1;
|
|
3655
|
+
let i = y(r);
|
|
3656
|
+
return i !== "HY" && i !== "HH" ? !1 : er.test(e) && er.test(n);
|
|
3657
|
+
}
|
|
3658
|
+
function ir(e) {
|
|
3659
|
+
if (!e.includes("-") && nr.test(e)) return [{
|
|
3660
|
+
text: e,
|
|
3661
|
+
breakBefore: !1
|
|
3662
|
+
}];
|
|
3663
|
+
let t = [...e], n = [], r = 0;
|
|
3664
|
+
for (let e = 1; e + 1 < t.length; e++) {
|
|
3665
|
+
if (!rr(t[e - 1], t[e], t[e + 1])) continue;
|
|
3666
|
+
let i = e + 1;
|
|
3667
|
+
n.push({
|
|
3668
|
+
text: t.slice(r, i).join(""),
|
|
3669
|
+
breakBefore: n.length > 0
|
|
3670
|
+
}), r = i;
|
|
3671
|
+
}
|
|
3672
|
+
return n.push({
|
|
3673
|
+
text: t.slice(r).join(""),
|
|
3674
|
+
breakBefore: n.length > 0
|
|
3675
|
+
}), n;
|
|
3676
|
+
}
|
|
3677
|
+
function ar(e) {
|
|
3678
|
+
let t = [];
|
|
3679
|
+
for (let n = e.segments.length - 1; n >= 0 && t.length < 2; n--) {
|
|
3680
|
+
let r = e.segments[n];
|
|
3681
|
+
if (r.isTab || r.math) continue;
|
|
3682
|
+
let i = [...r.text];
|
|
3683
|
+
for (let e = i.length - 1; e >= 0 && t.length < 2; e--) t.unshift(i[e]);
|
|
3684
|
+
}
|
|
3685
|
+
return t;
|
|
3686
|
+
}
|
|
3687
|
+
function or(e, t) {
|
|
3652
3688
|
return t != null && t !== 0 ? e * .65 : e;
|
|
3653
3689
|
}
|
|
3654
|
-
function
|
|
3690
|
+
function sr(e, t, n, r, i, a, o) {
|
|
3655
3691
|
let s = (t.defaultFontSize ?? 18) * Y * a;
|
|
3656
3692
|
for (let c of t.paragraphs) {
|
|
3657
|
-
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f =
|
|
3693
|
+
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = $n(Zn(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3658
3694
|
for (let n of c.runs) {
|
|
3659
3695
|
if (n.type !== "text") continue;
|
|
3660
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i =
|
|
3661
|
-
e.font =
|
|
3696
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = zn(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3697
|
+
e.font = Xn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, or(r, n.baseline ?? void 0), i, o);
|
|
3662
3698
|
let l = (n.letterSpacing ?? 0) * Y * a;
|
|
3663
3699
|
if (m += $(e, n.text, l), m > p) return !0;
|
|
3664
3700
|
}
|
|
3665
3701
|
}
|
|
3666
3702
|
return !1;
|
|
3667
3703
|
}
|
|
3668
|
-
function
|
|
3669
|
-
for (let t of e) if (
|
|
3704
|
+
function cr(e) {
|
|
3705
|
+
for (let t of e) if (i(t.codePointAt(0) ?? 0)) return !0;
|
|
3670
3706
|
return !1;
|
|
3671
3707
|
}
|
|
3672
|
-
function
|
|
3708
|
+
function lr(e) {
|
|
3673
3709
|
let t = 0;
|
|
3674
3710
|
for (let n of e) t++;
|
|
3675
3711
|
return t;
|
|
3676
3712
|
}
|
|
3677
|
-
var
|
|
3678
|
-
function
|
|
3679
|
-
let t =
|
|
3713
|
+
var ur = /* @__PURE__ */ new WeakMap();
|
|
3714
|
+
function dr(e) {
|
|
3715
|
+
let t = ur.get(e);
|
|
3680
3716
|
if (t != null) return t;
|
|
3681
3717
|
let n = e, r = n.letterSpacing;
|
|
3682
|
-
if (typeof r != "string") return
|
|
3718
|
+
if (typeof r != "string") return ur.set(e, !1), !1;
|
|
3683
3719
|
let i = !1;
|
|
3684
3720
|
try {
|
|
3685
3721
|
n.letterSpacing = "0px";
|
|
@@ -3694,11 +3730,11 @@ function ir(e) {
|
|
|
3694
3730
|
n.letterSpacing = r;
|
|
3695
3731
|
} catch {}
|
|
3696
3732
|
}
|
|
3697
|
-
return
|
|
3733
|
+
return ur.set(e, i), i;
|
|
3698
3734
|
}
|
|
3699
3735
|
function $(e, t, n) {
|
|
3700
3736
|
let r = e, i = r.letterSpacing;
|
|
3701
|
-
if (n !== 0 &&
|
|
3737
|
+
if (n !== 0 && dr(e)) try {
|
|
3702
3738
|
r.letterSpacing = `${n}px`;
|
|
3703
3739
|
let i = e.measureText(t).width;
|
|
3704
3740
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3707,37 +3743,37 @@ function $(e, t, n) {
|
|
|
3707
3743
|
r.letterSpacing = i;
|
|
3708
3744
|
} catch {}
|
|
3709
3745
|
}
|
|
3710
|
-
let a = Math.max(0,
|
|
3746
|
+
let a = Math.max(0, lr(t) - 1);
|
|
3711
3747
|
return e.measureText(t).width + n * a;
|
|
3712
3748
|
}
|
|
3713
|
-
function
|
|
3749
|
+
function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
|
|
3714
3750
|
themeMajorFont: null,
|
|
3715
3751
|
themeMinorFont: null,
|
|
3716
3752
|
dpr: 1
|
|
3717
|
-
},
|
|
3718
|
-
let
|
|
3719
|
-
for (let e = t.runs.length - 1; e >= 0 &&
|
|
3753
|
+
}, m = 0) {
|
|
3754
|
+
let h = [], g = /* @__PURE__ */ new Map(), _ = !0;
|
|
3755
|
+
for (let e = t.runs.length - 1; e >= 0 && _; e--) {
|
|
3720
3756
|
let n = t.runs[e];
|
|
3721
3757
|
if (n.type === "break") continue;
|
|
3722
3758
|
if (n.type === "math") break;
|
|
3723
3759
|
let r = n.text.replace(/ +$/u, "");
|
|
3724
|
-
r !== n.text &&
|
|
3760
|
+
r !== n.text && g.set(n, r), (r.length > 0 || n.fieldType != null) && (_ = !1);
|
|
3725
3761
|
}
|
|
3726
|
-
let
|
|
3727
|
-
pos: X(e.pos,
|
|
3762
|
+
let v = () => n - (h.length === 0 ? m : 0), y = { segments: [] }, b = 0, x = !1, S = t.rtl === !0, C = X(t.marR, s), w = (t.tabStops ?? []).map((e) => ({
|
|
3763
|
+
pos: X(e.pos, s),
|
|
3728
3764
|
algn: e.algn
|
|
3729
|
-
})), T = X(t.defTabSz ?? 914400,
|
|
3730
|
-
let t =
|
|
3765
|
+
})), T = X(t.defTabSz ?? 914400, s), D = !1, k = [], A = 0, j = () => S ? C : c + (h.length === 0 ? m : 0), M = (e = 0) => {
|
|
3766
|
+
let t = xn(e > 0 ? [...k, {
|
|
3731
3767
|
isTab: !1,
|
|
3732
3768
|
width: e
|
|
3733
3769
|
}] : k, w, j(), Infinity, A, T), n = 0;
|
|
3734
3770
|
for (let e of t) n += e;
|
|
3735
3771
|
return n;
|
|
3736
3772
|
}, N = (e) => {
|
|
3737
|
-
let t =
|
|
3773
|
+
let t = v();
|
|
3738
3774
|
return Number.isFinite(t) ? D ? M(e) <= t : b + e <= t : !0;
|
|
3739
3775
|
}, P = () => {
|
|
3740
|
-
let e =
|
|
3776
|
+
let e = v();
|
|
3741
3777
|
if (!D) return e - b;
|
|
3742
3778
|
if (!Number.isFinite(e)) return Infinity;
|
|
3743
3779
|
if (M(0) >= e) return 0;
|
|
@@ -3747,23 +3783,23 @@ function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3747
3783
|
M(r) <= e ? t = r : n = r;
|
|
3748
3784
|
}
|
|
3749
3785
|
return t;
|
|
3750
|
-
},
|
|
3751
|
-
e && (
|
|
3752
|
-
},
|
|
3786
|
+
}, F = (e = !1) => {
|
|
3787
|
+
e && (y.endsWithBreak = !0), h.push(y), y = { segments: [] }, b = 0, D = !1, k = [], x = !1;
|
|
3788
|
+
}, I = (t, n, r, i) => {
|
|
3753
3789
|
e.font = n;
|
|
3754
|
-
let a = $(e, t, r), o =
|
|
3790
|
+
let a = $(e, t, r), o = y.segments.at(-1);
|
|
3755
3791
|
return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? $(e, o.text + t, r) - $(e, o.text, r) : a + r;
|
|
3756
3792
|
}, R = (t, n, r, i, a, o, s, c) => {
|
|
3757
3793
|
if (!t) return;
|
|
3758
3794
|
e.font = n;
|
|
3759
|
-
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,
|
|
3795
|
+
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?.hyperlink, x = c?.drawSizePx ?? r, 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.drawSizePx ?? e.sizePx) === x && qn(e.hyperlink) === qn(v) && (l === 0 || e.sourceRunId === u), C = y.segments.at(-1), w = $(e, t, l);
|
|
3760
3796
|
if (C && S(C) ? w = $(e, C.text + t, l) - $(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l), b += w, k.push({
|
|
3761
3797
|
isTab: !1,
|
|
3762
3798
|
width: w
|
|
3763
3799
|
}), C && S(C)) C.text += t;
|
|
3764
3800
|
else {
|
|
3765
3801
|
let e = C && !C.isTab && !C.math && u != null && C.sourceRunId === u ? l : 0;
|
|
3766
|
-
|
|
3802
|
+
y.segments.push({
|
|
3767
3803
|
text: t,
|
|
3768
3804
|
font: n,
|
|
3769
3805
|
sizePx: r,
|
|
@@ -3782,17 +3818,17 @@ function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3782
3818
|
reflection: h,
|
|
3783
3819
|
outline: g,
|
|
3784
3820
|
highlight: _,
|
|
3785
|
-
hyperlink:
|
|
3821
|
+
hyperlink: v
|
|
3786
3822
|
});
|
|
3787
3823
|
}
|
|
3788
3824
|
}, z = () => {
|
|
3789
|
-
let e =
|
|
3825
|
+
let e = y.segments.at(-1);
|
|
3790
3826
|
if (!e || e.math) return !1;
|
|
3791
3827
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3792
3828
|
if (t) e.text = t[1], n = t[2];
|
|
3793
|
-
else if (
|
|
3829
|
+
else if (y.segments.length > 1) y.segments.pop(), n = e.text;
|
|
3794
3830
|
else return !1;
|
|
3795
|
-
return
|
|
3831
|
+
return F(), R(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3796
3832
|
strikeDouble: e.strikeDouble,
|
|
3797
3833
|
letterSpacingPx: e.letterSpacingPx,
|
|
3798
3834
|
underlineStyle: e.underlineStyle,
|
|
@@ -3805,62 +3841,69 @@ function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3805
3841
|
drawSizePx: e.drawSizePx
|
|
3806
3842
|
}), !0;
|
|
3807
3843
|
};
|
|
3808
|
-
for (let [
|
|
3809
|
-
if (
|
|
3810
|
-
|
|
3844
|
+
for (let [c, m] of t.runs.entries()) {
|
|
3845
|
+
if (m.type === "break") {
|
|
3846
|
+
F(!0);
|
|
3811
3847
|
continue;
|
|
3812
3848
|
}
|
|
3813
|
-
if (
|
|
3814
|
-
let e =
|
|
3815
|
-
(
|
|
3849
|
+
if (m.type === "math") {
|
|
3850
|
+
let e = Fn.get(m.nodes), t = m.fontSize == null ? r : m.fontSize * Y * s * d, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, o = e ? e.descentEm * t : 0;
|
|
3851
|
+
(m.display && b > 0 || !N(n) && b > 0) && F(), k.push({
|
|
3816
3852
|
isTab: !1,
|
|
3817
3853
|
width: n
|
|
3818
|
-
}),
|
|
3854
|
+
}), y.segments.push({
|
|
3819
3855
|
text: "",
|
|
3820
3856
|
font: `${t}px sans-serif`,
|
|
3821
3857
|
sizePx: t,
|
|
3822
|
-
color:
|
|
3858
|
+
color: m.color ? Q(m.color) : a,
|
|
3823
3859
|
underline: !1,
|
|
3824
3860
|
strikethrough: !1,
|
|
3825
3861
|
math: {
|
|
3826
|
-
nodes:
|
|
3827
|
-
display:
|
|
3862
|
+
nodes: m.nodes,
|
|
3863
|
+
display: m.display,
|
|
3828
3864
|
width: n,
|
|
3829
|
-
ascent:
|
|
3830
|
-
descent:
|
|
3865
|
+
ascent: i,
|
|
3866
|
+
descent: o
|
|
3831
3867
|
}
|
|
3832
|
-
}), b += n,
|
|
3868
|
+
}), b += n, m.display && F();
|
|
3833
3869
|
continue;
|
|
3834
3870
|
}
|
|
3835
|
-
let
|
|
3836
|
-
|
|
3837
|
-
let
|
|
3838
|
-
e.font =
|
|
3839
|
-
let
|
|
3840
|
-
(
|
|
3841
|
-
let
|
|
3871
|
+
let h = m.fontSize == null ? r : m.fontSize * Y * s * d, _ = or(h, m.baseline ?? void 0), S = zn(m.fontFamily ?? t.defFontFamily ?? null, p), C = m.fontFamilyEa ? zn(m.fontFamilyEa, p) : null, w = m.fontFamilySym ? zn(m.fontFamilySym, p) : null, T;
|
|
3872
|
+
T = m.color ? Q(m.color) : m.hyperlink && p.themeHlinkColor ? Q(p.themeHlinkColor) : a;
|
|
3873
|
+
let j = m.bold ?? t.defBold ?? l, M = m.italic ?? t.defItalic ?? u, B = Xn(j, M, _, S, p), V = C ? Xn(j, M, _, C, p) : B;
|
|
3874
|
+
e.font = B;
|
|
3875
|
+
let H = m.caps, U = g.get(m) ?? m.text;
|
|
3876
|
+
(H === "all" || H === "small") && (U = U.toUpperCase());
|
|
3877
|
+
let W = m.fieldType === "slidenum" && f !== void 0 ? String(f) : U, G = m.underline || m.hyperlink !== void 0, te = m.strikeDouble === !0, K = m.letterSpacing == null ? 0 : m.letterSpacing * Y * s, J = {
|
|
3842
3878
|
strikeDouble: te,
|
|
3843
|
-
letterSpacingPx:
|
|
3844
|
-
underlineStyle:
|
|
3845
|
-
underlineColor:
|
|
3846
|
-
shadow:
|
|
3847
|
-
reflection:
|
|
3848
|
-
outline:
|
|
3849
|
-
highlight:
|
|
3850
|
-
hyperlink:
|
|
3851
|
-
sourceRunId:
|
|
3852
|
-
drawSizePx:
|
|
3853
|
-
},
|
|
3854
|
-
|
|
3879
|
+
letterSpacingPx: K,
|
|
3880
|
+
underlineStyle: m.underlineStyle,
|
|
3881
|
+
underlineColor: m.underlineColor ? Q(m.underlineColor) : void 0,
|
|
3882
|
+
shadow: m.shadow,
|
|
3883
|
+
reflection: m.reflection,
|
|
3884
|
+
outline: m.outline,
|
|
3885
|
+
highlight: m.highlight ? Q(m.highlight) : void 0,
|
|
3886
|
+
hyperlink: an(m.hyperlink),
|
|
3887
|
+
sourceRunId: c,
|
|
3888
|
+
drawSizePx: _
|
|
3889
|
+
}, ne = W.split(/(\s+)/).flatMap((e) => e ? /^\s+$/u.test(e) ? [{
|
|
3890
|
+
text: e,
|
|
3891
|
+
breakBefore: !1
|
|
3892
|
+
}] : Number.isFinite(n) ? ir(e) : [{
|
|
3893
|
+
text: e,
|
|
3894
|
+
breakBefore: !1
|
|
3895
|
+
}] : []);
|
|
3896
|
+
for (let n of ne) {
|
|
3897
|
+
let r = n.text;
|
|
3855
3898
|
if (!r) continue;
|
|
3856
3899
|
if (/^\t+$/.test(r)) {
|
|
3857
|
-
D || (e.font =
|
|
3858
|
-
for (let e of r)
|
|
3900
|
+
D || (e.font = B, A = e.measureText(" ").width);
|
|
3901
|
+
for (let e of r) y.segments.push({
|
|
3859
3902
|
text: "",
|
|
3860
3903
|
isTab: !0,
|
|
3861
|
-
font:
|
|
3862
|
-
sizePx:
|
|
3863
|
-
color:
|
|
3904
|
+
font: B,
|
|
3905
|
+
sizePx: h,
|
|
3906
|
+
color: T,
|
|
3864
3907
|
underline: !1,
|
|
3865
3908
|
strikethrough: !1
|
|
3866
3909
|
}), k.push({
|
|
@@ -3870,134 +3913,142 @@ function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3870
3913
|
D = !0;
|
|
3871
3914
|
continue;
|
|
3872
3915
|
}
|
|
3873
|
-
e.font =
|
|
3874
|
-
let
|
|
3875
|
-
if (
|
|
3876
|
-
let t =
|
|
3877
|
-
for (let
|
|
3878
|
-
let r =
|
|
3879
|
-
if (
|
|
3880
|
-
let e =
|
|
3881
|
-
e ===
|
|
3916
|
+
e.font = B;
|
|
3917
|
+
let a = I(r, B, K, c), s = /^\s+$/.test(r), l = /[-]/;
|
|
3918
|
+
if (l.test(r) && (w != null || _e(S))) {
|
|
3919
|
+
let t = w ?? S;
|
|
3920
|
+
for (let n of r) {
|
|
3921
|
+
let r = n, i = B;
|
|
3922
|
+
if (l.test(n)) {
|
|
3923
|
+
let e = xe(n, t);
|
|
3924
|
+
e === n ? i = Xn(j, M, _, t, p) : (r = e, i = Xn(j, M, _, "sans-serif", p));
|
|
3882
3925
|
}
|
|
3883
|
-
e.font =
|
|
3926
|
+
e.font = i, !N(I(r, i, K, c)) && b > 0 && F(), R(r, i, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3884
3927
|
}
|
|
3885
3928
|
continue;
|
|
3886
3929
|
}
|
|
3887
|
-
if (
|
|
3888
|
-
let
|
|
3889
|
-
|
|
3890
|
-
ch:
|
|
3891
|
-
w: $(e,
|
|
3892
|
-
font:
|
|
3893
|
-
}),
|
|
3930
|
+
if (cr(r) && (!q(r) || t.eaLnBrk === !1)) {
|
|
3931
|
+
let n = [], a = "", s = () => {
|
|
3932
|
+
a !== "" && (e.font = B, n.push({
|
|
3933
|
+
ch: a,
|
|
3934
|
+
w: $(e, a, K),
|
|
3935
|
+
font: B
|
|
3936
|
+
}), a = "");
|
|
3894
3937
|
};
|
|
3895
3938
|
for (let t of r) {
|
|
3896
|
-
if (!
|
|
3897
|
-
|
|
3939
|
+
if (!i(t.codePointAt(0) ?? 0)) {
|
|
3940
|
+
a += t;
|
|
3898
3941
|
continue;
|
|
3899
3942
|
}
|
|
3900
|
-
|
|
3901
|
-
let
|
|
3902
|
-
e.font =
|
|
3943
|
+
s();
|
|
3944
|
+
let r = C == null ? B : V;
|
|
3945
|
+
e.font = r, n.push({
|
|
3903
3946
|
ch: t,
|
|
3904
3947
|
w: $(e, t, 0),
|
|
3905
|
-
font:
|
|
3948
|
+
font: r
|
|
3906
3949
|
});
|
|
3907
3950
|
}
|
|
3908
|
-
if (
|
|
3909
|
-
let e =
|
|
3910
|
-
b > 0 && !N(r) &&
|
|
3911
|
-
for (let e of
|
|
3951
|
+
if (s(), t.eaLnBrk === !1) {
|
|
3952
|
+
let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === c, r = n.reduce((e, t) => e + t.w, 0) + Math.max(0, n.length - 1) * K + (t && n.length > 0 ? K : 0);
|
|
3953
|
+
b > 0 && !N(r) && F();
|
|
3954
|
+
for (let e of n) R(e.ch, e.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3912
3955
|
continue;
|
|
3913
3956
|
}
|
|
3914
|
-
let l =
|
|
3957
|
+
let l = n;
|
|
3915
3958
|
for (; l.length > 0;) {
|
|
3916
|
-
let e = Number.isFinite(
|
|
3917
|
-
if (
|
|
3959
|
+
let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), n = !!t && !t.isTab && !t.math && t.sourceRunId === c, r = dn(l, e, v(), o, K, n);
|
|
3960
|
+
if (r === 0) {
|
|
3918
3961
|
if (b > 0) {
|
|
3919
|
-
|
|
3962
|
+
F();
|
|
3920
3963
|
continue;
|
|
3921
3964
|
}
|
|
3922
|
-
|
|
3965
|
+
r = 1;
|
|
3923
3966
|
}
|
|
3924
|
-
for (let e = 0; e <
|
|
3967
|
+
for (let e = 0; e < r; e++) {
|
|
3925
3968
|
let t = l[e];
|
|
3926
|
-
R(t.ch, t.font,
|
|
3969
|
+
R(t.ch, t.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3927
3970
|
}
|
|
3928
|
-
l = l.slice(
|
|
3971
|
+
l = l.slice(r), l.length > 0 && F();
|
|
3929
3972
|
}
|
|
3930
3973
|
continue;
|
|
3931
3974
|
}
|
|
3932
3975
|
if (q(r)) {
|
|
3933
3976
|
let t = O(r, {
|
|
3934
3977
|
cjk: !0,
|
|
3935
|
-
kinsoku:
|
|
3936
|
-
}),
|
|
3937
|
-
let
|
|
3938
|
-
|
|
3978
|
+
kinsoku: o
|
|
3979
|
+
}), n = C != null && V !== B, a = (e) => n && i(e.codePointAt(0) ?? 0), s = (t) => {
|
|
3980
|
+
let n = 0, r = y.segments.at(-1), i = !!r && !r.isTab && !r.math && r.sourceRunId === c, o = "", s = null, l = () => {
|
|
3981
|
+
o !== "" && (e.font = s ? V : B, n += $(e, o, K), i && (n += K), i = !0, o = "");
|
|
3939
3982
|
};
|
|
3940
3983
|
for (let e of t) {
|
|
3941
|
-
let t =
|
|
3942
|
-
|
|
3984
|
+
let t = a(e);
|
|
3985
|
+
s === null || t === s ? (o += e, s = t) : (l(), o = e, s = t);
|
|
3943
3986
|
}
|
|
3944
|
-
return l(),
|
|
3987
|
+
return l(), n;
|
|
3945
3988
|
}, l = (e) => {
|
|
3946
3989
|
let t = "", n = null, r = () => {
|
|
3947
|
-
t !== "" && (R(t, n ?
|
|
3990
|
+
t !== "" && (R(t, n ? V : B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), t = "");
|
|
3948
3991
|
};
|
|
3949
3992
|
for (let i of e) {
|
|
3950
|
-
let e =
|
|
3993
|
+
let e = a(i);
|
|
3951
3994
|
n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
|
|
3952
3995
|
}
|
|
3953
3996
|
r();
|
|
3954
3997
|
}, u = E(r), d = r.length, f = 0;
|
|
3955
3998
|
for (; f < d;) {
|
|
3956
|
-
let e = P(), n = ee(r, t, f, e,
|
|
3999
|
+
let e = P(), n = ee(r, t, f, e, s, u);
|
|
3957
4000
|
if (n <= f) {
|
|
3958
4001
|
if (b > 0) {
|
|
3959
|
-
|
|
4002
|
+
F();
|
|
3960
4003
|
continue;
|
|
3961
4004
|
}
|
|
3962
|
-
let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o =
|
|
3963
|
-
|
|
4005
|
+
let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o = L(a), c = ee(a, o, 0, e, s, u);
|
|
4006
|
+
c <= 0 && (c = o.length > 0 ? o[0] : a.length), n = f + c;
|
|
3964
4007
|
}
|
|
3965
|
-
l(r.slice(f, n)), f = n, f < d &&
|
|
4008
|
+
l(r.slice(f, n)), f = n, f < d && F();
|
|
3966
4009
|
}
|
|
3967
4010
|
continue;
|
|
3968
4011
|
}
|
|
3969
|
-
if (N(
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
4012
|
+
if (!N(a) && (b > 0 || D)) {
|
|
4013
|
+
let e = n.breakBefore;
|
|
4014
|
+
if (!e) {
|
|
4015
|
+
let t = ar(y), n = [...r][0];
|
|
4016
|
+
e = t.length === 2 && n !== void 0 && rr(t[0], t[1], n);
|
|
4017
|
+
}
|
|
4018
|
+
e && (F(), a = I(r, B, K, c));
|
|
4019
|
+
}
|
|
4020
|
+
if (N(a)) R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), s && (x = !0);
|
|
4021
|
+
else if (s) b > 0 && F();
|
|
4022
|
+
else if (a > v()) {
|
|
4023
|
+
b > 0 && F();
|
|
4024
|
+
for (let t of r) e.font = B, !N(I(t, B, K, c)) && b > 0 && F(), R(t, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3974
4025
|
} else if (x) {
|
|
3975
|
-
let e =
|
|
3976
|
-
(
|
|
4026
|
+
let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), i = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, a = t !== void 0 && o.lineStartForbidden.has(t) && i, s = n !== void 0 && t !== void 0 && i && !q(e) && !q(r) && ue(n, t);
|
|
4027
|
+
(a || s) && z() || F(), R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3977
4028
|
} else {
|
|
3978
|
-
let e = [...
|
|
3979
|
-
e !== void 0 && t !== void 0 &&
|
|
4029
|
+
let e = [...y.segments.at(-1)?.text ?? ""].at(-1)?.codePointAt(0), t = r.codePointAt(0);
|
|
4030
|
+
e !== void 0 && t !== void 0 && i(e) !== i(t) && !ue(e, t) && b > 0 && F(), R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
|
|
3980
4031
|
}
|
|
3981
4032
|
}
|
|
3982
4033
|
}
|
|
3983
|
-
return
|
|
4034
|
+
return h.push(y), h;
|
|
3984
4035
|
}
|
|
3985
|
-
async function
|
|
4036
|
+
async function pr(e, t, n, r, i, o, s, c, l, u) {
|
|
3986
4037
|
if (t && t.fillType === "image") {
|
|
3987
|
-
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !
|
|
4038
|
+
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !s) return;
|
|
3988
4039
|
try {
|
|
3989
|
-
let
|
|
4040
|
+
let a = t.fillRect ?? {}, d = a.l ?? 0, f = a.t ?? 0, p = a.r ?? 0, m = a.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = u && !t.duotone ? On(u, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await R(t.imagePath, t.mimeType, s) : void 0, x = await Ye(t.imagePath, t.mimeType, t.duotone, s, {
|
|
3990
4041
|
widthPt: n / i / Y,
|
|
3991
4042
|
heightPt: r / i / Y,
|
|
3992
4043
|
...y ?? {},
|
|
3993
|
-
tiff:
|
|
3994
|
-
svgDecoder:
|
|
4044
|
+
tiff: c,
|
|
4045
|
+
svgDecoder: l
|
|
3995
4046
|
});
|
|
3996
|
-
if (
|
|
3997
|
-
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ?
|
|
4047
|
+
if (o() || !x) return;
|
|
4048
|
+
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? _r(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : Me(e, x, t.srcRect, h, g, _, v), e.restore();
|
|
3998
4049
|
} catch (t) {
|
|
3999
|
-
if (
|
|
4000
|
-
|
|
4050
|
+
if (b(t, "tiff")) {
|
|
4051
|
+
a(e, "tiff", {
|
|
4001
4052
|
x: 0,
|
|
4002
4053
|
y: 0,
|
|
4003
4054
|
width: n,
|
|
@@ -4005,14 +4056,14 @@ async function or(e, t, n, r, i, a, o, s, c, l) {
|
|
|
4005
4056
|
});
|
|
4006
4057
|
return;
|
|
4007
4058
|
}
|
|
4008
|
-
if (
|
|
4059
|
+
if (Re(t) || Je(t)) throw t;
|
|
4009
4060
|
}
|
|
4010
4061
|
return;
|
|
4011
4062
|
}
|
|
4012
|
-
e.fillStyle =
|
|
4063
|
+
e.fillStyle = Pn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4013
4064
|
}
|
|
4014
|
-
var
|
|
4015
|
-
function
|
|
4065
|
+
var mr = 9525;
|
|
4066
|
+
function hr(e, t, n, r, i) {
|
|
4016
4067
|
let a;
|
|
4017
4068
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4018
4069
|
let o;
|
|
@@ -4021,52 +4072,52 @@ function cr(e, t, n, r, i) {
|
|
|
4021
4072
|
ay: o
|
|
4022
4073
|
};
|
|
4023
4074
|
}
|
|
4024
|
-
function
|
|
4075
|
+
function gr(e, t, n) {
|
|
4025
4076
|
return {
|
|
4026
4077
|
width: e * (n ? 1 - n.l - n.r : 1),
|
|
4027
4078
|
height: t * (n ? 1 - n.t - n.b : 1)
|
|
4028
4079
|
};
|
|
4029
4080
|
}
|
|
4030
|
-
function
|
|
4031
|
-
let c =
|
|
4081
|
+
function _r(e, t, n, r, i, a, o, s) {
|
|
4082
|
+
let c = gr(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * mr * (n.sx ?? 1) * a, u = c.height * mr * (n.sy ?? 1) * a;
|
|
4032
4083
|
if (!(l > 0) || !(u > 0)) return;
|
|
4033
|
-
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p =
|
|
4084
|
+
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p = je(l * (d ? 2 : 1), u * (f ? 2 : 1));
|
|
4034
4085
|
if (!p) return;
|
|
4035
4086
|
let m = p.getContext("2d");
|
|
4036
4087
|
if (!m) return;
|
|
4037
4088
|
let h = (e, n, r, i) => {
|
|
4038
|
-
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1),
|
|
4089
|
+
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), Me(m, t, o, 0, 0, l, u), m.restore();
|
|
4039
4090
|
};
|
|
4040
4091
|
h(0, 0, !1, !1), d && h(l, 0, !0, !1), f && h(0, u, !1, !0), d && f && h(l, u, !0, !0);
|
|
4041
4092
|
let g = e.createPattern(p, "repeat");
|
|
4042
4093
|
if (!g) return;
|
|
4043
|
-
let { ax: _, ay: v } =
|
|
4094
|
+
let { ax: _, ay: v } = hr(n.algn ?? "tl", r, i, l, u), y = _ + X(n.tx ?? 0, a), b = v + X(n.ty ?? 0, a);
|
|
4044
4095
|
typeof g.setTransform == "function" && typeof DOMMatrix < "u" ? (g.setTransform(new DOMMatrix().translateSelf(y, b)), e.fillStyle = g, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(y, b), e.fillStyle = g, e.fillRect(-y, -b, r, i), e.restore());
|
|
4045
4096
|
}
|
|
4046
|
-
function
|
|
4097
|
+
function vr(e, t, n) {
|
|
4047
4098
|
if (!t) return;
|
|
4048
4099
|
let r = t.dir * Math.PI / 180, i = X(t.dist, n);
|
|
4049
4100
|
e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4050
4101
|
}
|
|
4051
|
-
function
|
|
4102
|
+
function yr(e, t, n) {
|
|
4052
4103
|
t && (e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4053
4104
|
}
|
|
4054
|
-
function
|
|
4105
|
+
function br(e) {
|
|
4055
4106
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4056
4107
|
}
|
|
4057
|
-
var
|
|
4058
|
-
function
|
|
4108
|
+
var xr = 8, Sr = 1, Cr = 1, wr = 256;
|
|
4109
|
+
function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
4059
4110
|
if (r <= 0) return;
|
|
4060
|
-
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(
|
|
4061
|
-
for (; w >
|
|
4062
|
-
let e = Math.min(
|
|
4111
|
+
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(wr, Math.max(1, Math.round(b / xr))), S = (e) => Or(e, a, r, o, s, c, u, d), C = S(x), w = Ar(C, a, o, s, c, u, d, l, i, -g, _);
|
|
4112
|
+
for (; w > Cr && x < wr;) {
|
|
4113
|
+
let e = Math.min(wr, x * 2), t = S(e), n = Ar(t, a, o, s, c, u, d, l, i, -g, _);
|
|
4063
4114
|
if (n >= w * .75) {
|
|
4064
4115
|
C = t;
|
|
4065
4116
|
break;
|
|
4066
4117
|
}
|
|
4067
4118
|
x = e, C = t, w = n;
|
|
4068
4119
|
}
|
|
4069
|
-
let T = 1e4, E =
|
|
4120
|
+
let T = 1e4, E = Sr / (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) => {
|
|
4070
4121
|
e.fillStyle = r;
|
|
4071
4122
|
for (let r = 0; r <= D; r++) {
|
|
4072
4123
|
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
@@ -4074,7 +4125,7 @@ function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4074
4125
|
let c = O(r, i, s), u = k(r, a, s);
|
|
4075
4126
|
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4076
4127
|
}
|
|
4077
|
-
}, j =
|
|
4128
|
+
}, j = Er(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4078
4129
|
if (j >= 1 && M >= 1) {
|
|
4079
4130
|
A(e, m);
|
|
4080
4131
|
return;
|
|
@@ -4094,110 +4145,119 @@ function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4094
4145
|
[s, _],
|
|
4095
4146
|
[c, _]
|
|
4096
4147
|
]) {
|
|
4097
|
-
let n =
|
|
4148
|
+
let n = kr(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;
|
|
4098
4149
|
o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
|
|
4099
4150
|
}
|
|
4100
4151
|
}
|
|
4101
4152
|
if (!(I > P && L > F)) return;
|
|
4102
|
-
let R = Math.floor(P - 2), z = Math.floor(F - 2), B =
|
|
4153
|
+
let R = Math.floor(P - 2), z = Math.floor(F - 2), B = je(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
|
|
4103
4154
|
if (!B || !V) {
|
|
4104
4155
|
A(e, m);
|
|
4105
4156
|
return;
|
|
4106
4157
|
}
|
|
4107
|
-
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,
|
|
4158
|
+
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, Dr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
|
|
4108
4159
|
}
|
|
4109
|
-
function
|
|
4160
|
+
function Er(e) {
|
|
4110
4161
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4111
4162
|
if (!t) return 1;
|
|
4112
4163
|
let n = parseFloat(t[1]);
|
|
4113
4164
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4114
4165
|
}
|
|
4115
|
-
function
|
|
4166
|
+
function Dr(e) {
|
|
4116
4167
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4117
4168
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4118
4169
|
}
|
|
4119
|
-
function
|
|
4170
|
+
function Or(e, t, n, r, i, a, o, s) {
|
|
4120
4171
|
let c = Array(e);
|
|
4121
4172
|
for (let l = 0; l < e; l++) {
|
|
4122
4173
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4123
4174
|
c[l] = {
|
|
4124
4175
|
s0: u,
|
|
4125
4176
|
s1: d,
|
|
4126
|
-
g:
|
|
4177
|
+
g: pt(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4127
4178
|
};
|
|
4128
4179
|
}
|
|
4129
4180
|
return c;
|
|
4130
4181
|
}
|
|
4131
|
-
function
|
|
4182
|
+
function kr(e, t, n, r) {
|
|
4132
4183
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4133
4184
|
return {
|
|
4134
4185
|
x: e.x + s * o - c * a,
|
|
4135
4186
|
y: e.y + c * o + s * a
|
|
4136
4187
|
};
|
|
4137
4188
|
}
|
|
4138
|
-
function
|
|
4189
|
+
function Ar(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4139
4190
|
let d = 0;
|
|
4140
4191
|
for (let f of e) {
|
|
4141
4192
|
let e = (f.s0 + f.s1) / 2;
|
|
4142
4193
|
for (let p of [f.s0, f.s1]) {
|
|
4143
|
-
let m =
|
|
4194
|
+
let m = pt(t, (n + p) / r * i, a, o);
|
|
4144
4195
|
for (let t of [l, u]) {
|
|
4145
|
-
let n =
|
|
4196
|
+
let n = kr(m, s, 0, t), r = kr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4146
4197
|
i > d && (d = i);
|
|
4147
4198
|
}
|
|
4148
4199
|
}
|
|
4149
4200
|
}
|
|
4150
4201
|
return d;
|
|
4151
4202
|
}
|
|
4152
|
-
function
|
|
4153
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4203
|
+
function jr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4204
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = lt(n, r, p, m);
|
|
4154
4205
|
if (!h) return;
|
|
4155
|
-
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [];
|
|
4206
|
+
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [], b = 0;
|
|
4156
4207
|
for (let n of t.paragraphs) {
|
|
4157
|
-
let t =
|
|
4158
|
-
|
|
4208
|
+
let t = n.defFontSize == null ? v : n.defFontSize * Y * c, r = fr(e, n, Infinity, t, n.defColor ? Q(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4209
|
+
y.length > 0 && (b += (n.spaceBefore ?? 0) / 100 * Y * c);
|
|
4210
|
+
for (let e of r) {
|
|
4211
|
+
let r = e.segments.reduce((e, t) => Math.max(e, t.sizePx), 0) || t, i = n.spaceLine?.type === "pts" ? n.spaceLine.val * Y * c : r * 1.2 * (n.spaceLine ? n.spaceLine.val / 1e5 : 1);
|
|
4212
|
+
y.push({
|
|
4213
|
+
line: e,
|
|
4214
|
+
alignment: n.alignment,
|
|
4215
|
+
baseline: b + i * .8
|
|
4216
|
+
}), b += i;
|
|
4217
|
+
}
|
|
4218
|
+
b += (n.spaceAfter ?? 0) / 100 * Y * c;
|
|
4159
4219
|
}
|
|
4160
4220
|
if (y.length === 0) return;
|
|
4161
4221
|
e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4162
|
-
let
|
|
4163
|
-
if (
|
|
4222
|
+
let x = -1, S = () => {
|
|
4223
|
+
if (x >= 0) return x;
|
|
4164
4224
|
let t = typeof e.getTransform == "function" ? e.getTransform() : null, n = t ? Math.abs(t.a * t.d - t.b * t.c) : 1;
|
|
4165
|
-
return
|
|
4166
|
-
},
|
|
4167
|
-
for (let t = 0; t <
|
|
4168
|
-
let
|
|
4169
|
-
for (let t of
|
|
4225
|
+
return x = n > 0 ? Math.sqrt(n) : 1, x;
|
|
4226
|
+
}, C = y.length, w = h.top[0], T = h.top[1], E = w && T ? (w.x - p / 2) * (T.y - m / 2) - (w.y - m / 2) * (T.x - p / 2) > 0 : !0, D = y[E ? C - 1 : 0].baseline;
|
|
4227
|
+
for (let t = 0; t < C; t++) {
|
|
4228
|
+
let { line: i, alignment: a } = y[t], o = t / C, s = (t + 1) / C, c = 0, l = 0, u = 0, g = 0;
|
|
4229
|
+
for (let t of i.segments) {
|
|
4170
4230
|
if (t.math) {
|
|
4171
|
-
|
|
4231
|
+
c += t.math.width, l = Math.max(l, t.sizePx), u = Math.max(u, t.math.ascent), g = Math.max(g, t.math.descent);
|
|
4172
4232
|
continue;
|
|
4173
4233
|
}
|
|
4174
4234
|
e.font = t.font;
|
|
4175
4235
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4176
|
-
|
|
4236
|
+
c += r.width + n * lr(t.text), l = Math.max(l, t.sizePx), r.actualBoundingBoxAscent > 0 && (u = Math.max(u, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (g = Math.max(g, r.actualBoundingBoxDescent));
|
|
4177
4237
|
}
|
|
4178
|
-
if (
|
|
4179
|
-
let
|
|
4180
|
-
for (let t of
|
|
4238
|
+
if (c <= 0) continue;
|
|
4239
|
+
let _ = h.singleEdge ? Math.max(0, E ? D - y[t].baseline : y[t].baseline - D) : 0, v = _ > 0 ? lt(n, r, p + 2 * _, m + 2 * _) ?? h : h, b = u + g > 0 ? u + g : l, x = h.singleEdge ? .8 : b > 0 ? u / b : .8, w = h.singleEdge ? 1 : p / c, T = h.singleEdge ? b : b / (s - o), O = ft(v, c), k = h.singleEdge ? (1 - O) * (a === "r" ? 1 : a === "ctr" ? .5 : 0) : 0, A = 0;
|
|
4240
|
+
for (let t of i.segments) {
|
|
4181
4241
|
if (t.math) {
|
|
4182
|
-
|
|
4242
|
+
A += t.math.width;
|
|
4183
4243
|
continue;
|
|
4184
4244
|
}
|
|
4185
4245
|
e.font = t.font, e.fillStyle = t.color;
|
|
4186
|
-
let n = t.letterSpacingPx ?? 0,
|
|
4187
|
-
for (let
|
|
4188
|
-
let
|
|
4189
|
-
if (!h.singleEdge &&
|
|
4190
|
-
|
|
4246
|
+
let n = t.letterSpacingPx ?? 0, r = [...t.text];
|
|
4247
|
+
for (let i of r) {
|
|
4248
|
+
let r = e.measureText(i).width + n, a = h.singleEdge ? x : o + x * (s - o);
|
|
4249
|
+
if (!h.singleEdge && r > 0) {
|
|
4250
|
+
Tr(e, i, n, r, S(), h, A, c, O, w, T, a, d, f, t.color), A += r;
|
|
4191
4251
|
continue;
|
|
4192
4252
|
}
|
|
4193
|
-
let l =
|
|
4194
|
-
e.save(), e.translate(d + l.x, f + l.y), e.rotate(l.angle), l.shear !== 0 && e.transform(1, 0, l.shear, 1, 0, 0), (
|
|
4253
|
+
let l = pt(v, k + (A + r / 2) / c * O, T, a);
|
|
4254
|
+
l.x -= _, l.y -= _, e.save(), e.translate(d + l.x, f + l.y), e.rotate(l.angle), l.shear !== 0 && e.transform(1, 0, l.shear, 1, 0, 0), (w !== 1 || l.vScale !== 1) && e.scale(w, l.vScale), e.fillText(i, -r / 2 + n / 2, 0), e.restore(), A += r;
|
|
4195
4255
|
}
|
|
4196
4256
|
}
|
|
4197
4257
|
}
|
|
4198
4258
|
e.restore();
|
|
4199
4259
|
}
|
|
4200
|
-
function
|
|
4260
|
+
function Mr(e, t, n, r, i, a, o) {
|
|
4201
4261
|
let s = Math.min(r, i);
|
|
4202
4262
|
switch (e) {
|
|
4203
4263
|
case "rightarrow":
|
|
@@ -4227,17 +4287,17 @@ function Tr(e, t, n, r, i, a, o) {
|
|
|
4227
4287
|
default: return null;
|
|
4228
4288
|
}
|
|
4229
4289
|
}
|
|
4230
|
-
function
|
|
4231
|
-
return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null &&
|
|
4290
|
+
function Nr(e, t) {
|
|
4291
|
+
return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null && yn(e) ? t.smartArtFallbackTextColor : null;
|
|
4232
4292
|
}
|
|
4233
|
-
function
|
|
4293
|
+
function Pr(e, t, n) {
|
|
4234
4294
|
return {
|
|
4235
4295
|
outerRotation: e,
|
|
4236
4296
|
localFlipH: t,
|
|
4237
4297
|
localFlipV: n
|
|
4238
4298
|
};
|
|
4239
4299
|
}
|
|
4240
|
-
function
|
|
4300
|
+
function Fr(e, t, n, r, i) {
|
|
4241
4301
|
let a = [
|
|
4242
4302
|
{
|
|
4243
4303
|
x: t,
|
|
@@ -4266,7 +4326,7 @@ function Or(e, t, n, r, i) {
|
|
|
4266
4326
|
h: l - s
|
|
4267
4327
|
};
|
|
4268
4328
|
}
|
|
4269
|
-
var
|
|
4329
|
+
var Ir = {
|
|
4270
4330
|
tl: [0, 0],
|
|
4271
4331
|
t: [.5, 0],
|
|
4272
4332
|
tr: [1, 0],
|
|
@@ -4277,15 +4337,15 @@ var kr = {
|
|
|
4277
4337
|
b: [.5, 1],
|
|
4278
4338
|
br: [1, 1]
|
|
4279
4339
|
};
|
|
4280
|
-
function
|
|
4340
|
+
function Lr(e, t, n) {
|
|
4281
4341
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4282
4342
|
}
|
|
4283
|
-
function
|
|
4284
|
-
let [o, s] =
|
|
4285
|
-
return
|
|
4343
|
+
function Rr(e, t, n, r, i, a) {
|
|
4344
|
+
let [o, s] = Ir[a ?? "b"];
|
|
4345
|
+
return Lr(e, t + o * r, n + s * i);
|
|
4286
4346
|
}
|
|
4287
|
-
function
|
|
4288
|
-
let c =
|
|
4347
|
+
function zr(e, t, n, r, i, a, o, s) {
|
|
4348
|
+
let c = Ct(e, i, a).corners, l = (o > 0 ? Ke(c, o / i, o / a) ?? c : c).map((e) => Lr(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, _] = Ir[s ?? "b"], v = Ue(c, g, _);
|
|
4289
4349
|
return {
|
|
4290
4350
|
bbox: {
|
|
4291
4351
|
x: f,
|
|
@@ -4293,15 +4353,15 @@ function Mr(e, t, n, r, i, a, o, s) {
|
|
|
4293
4353
|
w: m - f,
|
|
4294
4354
|
h: h - p
|
|
4295
4355
|
},
|
|
4296
|
-
anchor: v ?
|
|
4356
|
+
anchor: v ? Lr(t, n + v.x, r + v.y) : Rr(t, n, r, i, a, s)
|
|
4297
4357
|
};
|
|
4298
4358
|
}
|
|
4299
|
-
function
|
|
4359
|
+
function Br(e, t, n, r) {
|
|
4300
4360
|
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);
|
|
4301
|
-
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) ||
|
|
4361
|
+
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || He(o, s).clamped) return e;
|
|
4302
4362
|
let c = null;
|
|
4303
4363
|
try {
|
|
4304
|
-
c =
|
|
4364
|
+
c = je(o, s);
|
|
4305
4365
|
} catch {
|
|
4306
4366
|
return e;
|
|
4307
4367
|
}
|
|
@@ -4320,7 +4380,7 @@ function Nr(e, t, n, r) {
|
|
|
4320
4380
|
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4321
4381
|
};
|
|
4322
4382
|
}
|
|
4323
|
-
function
|
|
4383
|
+
function Vr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4324
4384
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4325
4385
|
a: 1,
|
|
4326
4386
|
b: 0,
|
|
@@ -4335,9 +4395,14 @@ function Pr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4335
4395
|
}, v = (e) => {
|
|
4336
4396
|
h(e), u(e);
|
|
4337
4397
|
}, y = !1;
|
|
4338
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !
|
|
4398
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ge(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), Be(e, g, i, t.reflection, s, d, f), e.restore()), y ? vr(e, t.shadow ?? null, o) : t.glow && yr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Ve(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && br(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), We(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4339
4399
|
}
|
|
4340
|
-
function
|
|
4400
|
+
function Hr(e, t, n) {
|
|
4401
|
+
if (t === n || !Number.isFinite(e)) return e;
|
|
4402
|
+
let r = ((e + 180) % 360 + 360) % 360 - 180;
|
|
4403
|
+
return r > 90 ? r -= 180 : r < -90 && (r += 180), Object.is(r, -0) ? 0 : r;
|
|
4404
|
+
}
|
|
4405
|
+
function Ur(e, t, r, i = "#000000", a, o = {
|
|
4341
4406
|
themeMajorFont: null,
|
|
4342
4407
|
themeMinorFont: null,
|
|
4343
4408
|
dpr: 1
|
|
@@ -4347,20 +4412,20 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4347
4412
|
shapeId: t.id
|
|
4348
4413
|
}) : s;
|
|
4349
4414
|
if (f === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4350
|
-
if (t.stroke && (e.save(),
|
|
4415
|
+
if (t.stroke && (e.save(), si(e, t.stroke, r, {
|
|
4351
4416
|
x: l,
|
|
4352
4417
|
y: u,
|
|
4353
4418
|
w: d,
|
|
4354
4419
|
h: 1
|
|
4355
4420
|
}, t.rotation), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
|
|
4356
|
-
let n =
|
|
4357
|
-
|
|
4421
|
+
let n = Nr(t, o);
|
|
4422
|
+
Yr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
|
|
4358
4423
|
}
|
|
4359
4424
|
return;
|
|
4360
4425
|
}
|
|
4361
|
-
let
|
|
4362
|
-
if (
|
|
4363
|
-
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p =
|
|
4426
|
+
let h = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null;
|
|
4427
|
+
if (h && d > 0 && f > 0) {
|
|
4428
|
+
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Zr(t.sp3d, h.camera, d, f, r, c), g = Pr(t.rotation, t.flipH, t.flipV);
|
|
4364
4429
|
e.save(), g.outerRotation !== 0 && (e.translate(l + d / 2, u + f / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
4365
4430
|
let _ = {
|
|
4366
4431
|
...t,
|
|
@@ -4383,21 +4448,21 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4383
4448
|
..._,
|
|
4384
4449
|
fill: null,
|
|
4385
4450
|
stroke: null
|
|
4386
|
-
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (
|
|
4387
|
-
|
|
4451
|
+
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, n) => Qr(e, h.camera, l, u, d, f, (e) => {
|
|
4452
|
+
Ur(e, t, r, i, a, o, void 0);
|
|
4388
4453
|
}, n ? {
|
|
4389
4454
|
bevels: p,
|
|
4390
|
-
extrusion:
|
|
4455
|
+
extrusion: m ?? void 0,
|
|
4391
4456
|
edgePadCss: b
|
|
4392
4457
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4393
4458
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4394
|
-
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4459
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = zr(h.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Br((e) => {
|
|
4395
4460
|
s = S(e) || s;
|
|
4396
4461
|
}, n, o.bbox, {
|
|
4397
4462
|
w: e.canvas.width || 0,
|
|
4398
4463
|
h: e.canvas.height || 0
|
|
4399
4464
|
});
|
|
4400
|
-
if (
|
|
4465
|
+
if (Vr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
|
|
4401
4466
|
C(e), e.restore();
|
|
4402
4467
|
return;
|
|
4403
4468
|
}
|
|
@@ -4408,8 +4473,8 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4408
4473
|
e.restore();
|
|
4409
4474
|
}
|
|
4410
4475
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(l + d / 2, u + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
4411
|
-
let g = t.geometry.toLowerCase(), _ =
|
|
4412
|
-
t.shadow ||
|
|
4476
|
+
let g = t.geometry.toLowerCase(), _ = Pn(t.fill, e, l, u, d, f, t.rotation);
|
|
4477
|
+
t.shadow || yr(e, t.glow ?? null, r);
|
|
4413
4478
|
let v = new Set([
|
|
4414
4479
|
"line",
|
|
4415
4480
|
"straightconnector1",
|
|
@@ -4434,22 +4499,22 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4434
4499
|
"accentbordercallout1",
|
|
4435
4500
|
"accentbordercallout2",
|
|
4436
4501
|
"accentbordercallout3"
|
|
4437
|
-
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom &&
|
|
4502
|
+
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && V(g), S = (n, i, a = {
|
|
4438
4503
|
x: l,
|
|
4439
4504
|
y: u,
|
|
4440
4505
|
w: d,
|
|
4441
4506
|
h: f
|
|
4442
4507
|
}) => {
|
|
4443
|
-
let { x: o, y: s, w: c, h: p } = a,
|
|
4444
|
-
|
|
4508
|
+
let { x: o, y: s, w: c, h: p } = a, h = i ?? (n === e && o === l && s === u && c === d && p === f ? _ : Pn(t.fill, n, o, s, c, p, t.rotation)), v = i ? null : t.stroke ? () => {
|
|
4509
|
+
si(n, t.stroke, r, {
|
|
4445
4510
|
x: o,
|
|
4446
4511
|
y: s,
|
|
4447
4512
|
w: c,
|
|
4448
4513
|
h: p
|
|
4449
4514
|
}, t.rotation), n.stroke();
|
|
4450
|
-
} : null,
|
|
4515
|
+
} : null, y = () => br(n);
|
|
4451
4516
|
if (x && !i) {
|
|
4452
|
-
|
|
4517
|
+
m(n, g, o, s, c, p, [
|
|
4453
4518
|
t.adj,
|
|
4454
4519
|
t.adj2,
|
|
4455
4520
|
t.adj3,
|
|
@@ -4458,11 +4523,11 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4458
4523
|
t.adj6,
|
|
4459
4524
|
t.adj7,
|
|
4460
4525
|
t.adj8
|
|
4461
|
-
],
|
|
4526
|
+
], h, v, y, b(g) ? { skipTrailingStroke: !0 } : void 0);
|
|
4462
4527
|
return;
|
|
4463
4528
|
}
|
|
4464
|
-
n.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4465
|
-
}, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ?
|
|
4529
|
+
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Wr(n, t.custGeom, o, s, c, p) : he(n, g, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), h && g !== "arc" && (n.fillStyle = h, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || y()), v && v();
|
|
4530
|
+
}, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? n(g, l, u, d, f, [
|
|
4466
4531
|
t.adj,
|
|
4467
4532
|
t.adj2,
|
|
4468
4533
|
t.adj3,
|
|
@@ -4471,20 +4536,20 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4471
4536
|
t.adj6,
|
|
4472
4537
|
t.adj7,
|
|
4473
4538
|
t.adj8
|
|
4474
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4539
|
+
]) : t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, l, u, d, f) : null : null) ?? {
|
|
4475
4540
|
x: l,
|
|
4476
4541
|
y: u,
|
|
4477
4542
|
w: d,
|
|
4478
4543
|
h: f
|
|
4479
|
-
}, D = t.stroke ? t.stroke.width * r / 2 : 0, O = t.stroke ? Math.max(t.stroke.headEnd ?
|
|
4544
|
+
}, D = t.stroke ? t.stroke.width * r / 2 : 0, O = t.stroke ? Math.max(t.stroke.headEnd ? me(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? me(t.stroke.tailEnd, t.stroke, r) : 0) : 0, k = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, A = Math.max(D, O, k), j = A > 0 ? {
|
|
4480
4545
|
x: E.x - A,
|
|
4481
4546
|
y: E.y - A,
|
|
4482
4547
|
w: E.w + A * 2,
|
|
4483
4548
|
h: E.h + A * 2
|
|
4484
|
-
} : E, M =
|
|
4485
|
-
let n = t.stroke?.fill ?
|
|
4549
|
+
} : E, M = Fr(C, j.x, j.y, j.w, j.h), N = r * T, P = h ? [] : Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, T), F = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, I = (e) => {
|
|
4550
|
+
let n = t.stroke?.fill ? Pn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
|
|
4486
4551
|
if (t.stroke && (v.has(g) || y.has(g))) {
|
|
4487
|
-
let i =
|
|
4552
|
+
let i = U(g, l, u, d, f, [
|
|
4488
4553
|
t.adj,
|
|
4489
4554
|
t.adj2,
|
|
4490
4555
|
t.adj3,
|
|
@@ -4502,14 +4567,14 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4502
4567
|
y: e.y
|
|
4503
4568
|
}));
|
|
4504
4569
|
if (t.stroke.tailEnd) {
|
|
4505
|
-
let e =
|
|
4506
|
-
n[n.length - 1] =
|
|
4570
|
+
let e = be(t.stroke.tailEnd, t.stroke, r);
|
|
4571
|
+
n[n.length - 1] = Ce(n[n.length - 1], n[n.length - 2], e);
|
|
4507
4572
|
}
|
|
4508
4573
|
if (t.stroke.headEnd) {
|
|
4509
|
-
let e =
|
|
4510
|
-
n[0] =
|
|
4574
|
+
let e = be(t.stroke.headEnd, t.stroke, r);
|
|
4575
|
+
n[0] = Ce(n[0], n[1], e);
|
|
4511
4576
|
}
|
|
4512
|
-
|
|
4577
|
+
si(e, t.stroke, r, {
|
|
4513
4578
|
x: l,
|
|
4514
4579
|
y: u,
|
|
4515
4580
|
w: d,
|
|
@@ -4518,46 +4583,51 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4518
4583
|
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
4519
4584
|
e.stroke();
|
|
4520
4585
|
}
|
|
4521
|
-
a && o &&
|
|
4586
|
+
a && o && oi(e, i.start, i.end, t.stroke, a, r, t.rotation), t.stroke.tailEnd && ve(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, r, n), t.stroke.headEnd && ve(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, r, n);
|
|
4522
4587
|
return;
|
|
4523
4588
|
}
|
|
4524
4589
|
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;
|
|
4525
|
-
let { start: i, end: a } =
|
|
4526
|
-
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4590
|
+
let { start: i, end: a } = ye(t.custGeom);
|
|
4591
|
+
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ve(e, l + i.x * d, u + i.y * f, Math.atan2(i.dy * f, i.dx * d), t.stroke.headEnd, t.stroke, r, n), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ve(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.tailEnd, t.stroke, r, n);
|
|
4527
4592
|
}, L = (e) => {
|
|
4528
|
-
if (P.length > 0 &&
|
|
4593
|
+
if (P.length > 0 && $r(e, l, u, d, f, P, (e, t, n, r, i) => S(e, void 0, {
|
|
4529
4594
|
x: t,
|
|
4530
4595
|
y: n,
|
|
4531
4596
|
w: r,
|
|
4532
4597
|
h: i
|
|
4533
4598
|
}), void 0, F)) {
|
|
4534
|
-
I(e),
|
|
4599
|
+
I(e), br(e);
|
|
4535
4600
|
return;
|
|
4536
4601
|
}
|
|
4537
4602
|
S(e), I(e);
|
|
4538
4603
|
};
|
|
4539
|
-
if (
|
|
4540
|
-
let n =
|
|
4604
|
+
if (Vr(e, t, L, L, M, Rr(C, l, u, d, f, t.shadow?.algn), r, N, C, !!_, (e) => S(e, "#000")), t.textBody) {
|
|
4605
|
+
let n = Nr(t, o), s = Hr(t.rotation, t.flipH, t.flipV);
|
|
4541
4606
|
if (e.save(), t.flipH || t.flipV) {
|
|
4542
4607
|
let n = l + d / 2, r = u + f / 2;
|
|
4543
4608
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4544
4609
|
}
|
|
4545
|
-
let
|
|
4546
|
-
if (
|
|
4610
|
+
let m = (s - t.rotation) % 360;
|
|
4611
|
+
if (m !== 0) {
|
|
4612
|
+
let t = l + d / 2, n = u + f / 2;
|
|
4613
|
+
e.translate(t, n), e.rotate(m * Math.PI / 180), e.translate(-t, -n);
|
|
4614
|
+
}
|
|
4615
|
+
let h = l, _ = u, v = d, y = f;
|
|
4616
|
+
if (t.textRect) h = X(t.textRect.x, r), _ = X(t.textRect.y, r), v = X(t.textRect.width, r), y = X(t.textRect.height, r);
|
|
4547
4617
|
else if (g === "ellipse") {
|
|
4548
4618
|
let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
|
|
4549
|
-
|
|
4619
|
+
h = l + e, _ = u + t, v = d / Math.SQRT2, y = f / Math.SQRT2;
|
|
4550
4620
|
} else {
|
|
4551
|
-
let e =
|
|
4552
|
-
e && (
|
|
4621
|
+
let e = Mr(g, l, u, d, f, t.adj, t.adj2);
|
|
4622
|
+
e && (h = e.tx, _ = e.ty, v = e.tw, y = e.th);
|
|
4553
4623
|
}
|
|
4554
|
-
|
|
4624
|
+
Yr(e, t.textBody, h, _, v, y, r, n, s, !1, !1, i, a, o, p, !1, c), e.restore();
|
|
4555
4625
|
}
|
|
4556
4626
|
e.restore();
|
|
4557
4627
|
}
|
|
4558
|
-
var
|
|
4559
|
-
function
|
|
4560
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4628
|
+
var Wr = Te;
|
|
4629
|
+
function Gr(e, t) {
|
|
4630
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Kr(e).toLowerCase(), o = Kr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4561
4631
|
switch (t) {
|
|
4562
4632
|
case "arabicPlain": return n;
|
|
4563
4633
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4584,7 +4654,7 @@ function Lr(e, t) {
|
|
|
4584
4654
|
default: return `${n}.`;
|
|
4585
4655
|
}
|
|
4586
4656
|
}
|
|
4587
|
-
function
|
|
4657
|
+
function Kr(e) {
|
|
4588
4658
|
let t = [
|
|
4589
4659
|
1e3,
|
|
4590
4660
|
900,
|
|
@@ -4617,28 +4687,28 @@ function Rr(e) {
|
|
|
4617
4687
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4618
4688
|
return r;
|
|
4619
4689
|
}
|
|
4620
|
-
function
|
|
4690
|
+
function qr(e) {
|
|
4621
4691
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4622
4692
|
return !1;
|
|
4623
4693
|
}
|
|
4624
|
-
function
|
|
4625
|
-
let n =
|
|
4626
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4694
|
+
function Jr(e, t) {
|
|
4695
|
+
let n = qr(e);
|
|
4696
|
+
if (e.bullet.type === "char") return t.clear(), n ? xe(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4627
4697
|
if (e.bullet.type === "autoNum") {
|
|
4628
4698
|
if (!n) return "";
|
|
4629
4699
|
let r = e.lvl;
|
|
4630
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4700
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Gr(t.get(r), e.bullet.numType);
|
|
4631
4701
|
}
|
|
4632
4702
|
return t.clear(), "";
|
|
4633
4703
|
}
|
|
4634
|
-
function
|
|
4704
|
+
function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
4635
4705
|
themeMajorFont: null,
|
|
4636
4706
|
themeMinorFont: null,
|
|
4637
4707
|
dpr: 1
|
|
4638
|
-
}, m, h = !1, g,
|
|
4639
|
-
let
|
|
4640
|
-
if (
|
|
4641
|
-
let l = n + i / 2, u = r + a / 2, _ =
|
|
4708
|
+
}, m, h = !1, g, v = !1, y = h) {
|
|
4709
|
+
let b = t.vert === "vert" || t.vert === "eaVert", x = t.vert === "vert270";
|
|
4710
|
+
if (b || x) {
|
|
4711
|
+
let l = n + i / 2, u = r + a / 2, _ = b ? 90 : -90, v = m ? (e) => m({
|
|
4642
4712
|
...e,
|
|
4643
4713
|
inShapeX: e.inShapeX - a / 2 + i / 2,
|
|
4644
4714
|
inShapeY: e.inShapeY - i / 2 + a / 2,
|
|
@@ -4650,21 +4720,21 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4650
4720
|
textBodyRotation: _
|
|
4651
4721
|
}) : void 0;
|
|
4652
4722
|
if (h) return i;
|
|
4653
|
-
e.save(), e.translate(l, u), e.rotate(
|
|
4723
|
+
e.save(), e.translate(l, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), Yr(e, {
|
|
4654
4724
|
...t,
|
|
4655
4725
|
vert: "horz"
|
|
4656
4726
|
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, g, t.vert === "eaVert"), e.restore();
|
|
4657
4727
|
return;
|
|
4658
4728
|
}
|
|
4659
|
-
let
|
|
4660
|
-
if (!h &&
|
|
4661
|
-
|
|
4729
|
+
let S = t.textWarp;
|
|
4730
|
+
if (!h && S && it(S.preset)) {
|
|
4731
|
+
jr(e, t, S.preset, S.adj ?? [], n, r, i, a, o, s ?? d, p);
|
|
4662
4732
|
return;
|
|
4663
4733
|
}
|
|
4664
|
-
let
|
|
4734
|
+
let C = X(t.lIns, o), w = X(t.rIns, o), T = X(t.tIns, o), E = X(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && sr(e, t, i, C, w, o, p) : D, A = Math.max(1, t.numCol ?? 1), j = X(t.spcCol ?? 0, o), M = t.defaultBold ?? !1, N = t.defaultItalic ?? !1, P = s ?? d, F = (r) => {
|
|
4665
4735
|
let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = 0, u = /* @__PURE__ */ new Map();
|
|
4666
4736
|
for (let d = 0; d < t.paragraphs.length; d++) {
|
|
4667
|
-
let m = t.paragraphs[d], g = X(m.marL, o), _ = X(m.marR, o),
|
|
4737
|
+
let m = t.paragraphs[d], g = X(m.marL, o), _ = X(m.marR, o), v = X(m.indent, o), b = m.defFontSize == null ? a : m.defFontSize * Y * o * r, x = m.defColor ? Q(m.defColor) : P, S = Zn(m), T = (() => {
|
|
4668
4738
|
for (let e of m.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4669
4739
|
return m.defFontSize ?? t.defaultFontSize ?? 18;
|
|
4670
4740
|
})() * Y * o * r, E = (() => {
|
|
@@ -4673,26 +4743,26 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4673
4743
|
})(), D = E ? Q(E) : x, F = (() => {
|
|
4674
4744
|
for (let e of m.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4675
4745
|
return m.defFontFamily ?? null;
|
|
4676
|
-
})(), I = "", L =
|
|
4677
|
-
I =
|
|
4678
|
-
let B =
|
|
4746
|
+
})(), I = "", L = Xn(!1, !1, T, "sans-serif", p), R = D, z = null;
|
|
4747
|
+
I = Jr(m, u);
|
|
4748
|
+
let B = $e(m.bullet);
|
|
4679
4749
|
if (B.type === "char") {
|
|
4680
4750
|
let e = B;
|
|
4681
|
-
L =
|
|
4751
|
+
L = Xn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, I === e.char ? zn(e.fontFamily ?? null, p) : "sans-serif", p), R = e.color ? Q(e.color) : D;
|
|
4682
4752
|
} else if (B.type === "autoNum") {
|
|
4683
4753
|
let e = B;
|
|
4684
|
-
L =
|
|
4754
|
+
L = Xn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, zn(e.fontFamily ?? F, p), p), R = B.color ? Q(B.color) : D;
|
|
4685
4755
|
} else if (B.type === "blip") {
|
|
4686
|
-
let e = B, n =
|
|
4756
|
+
let e = B, n = Qn(t, m, e) * Y * o * r;
|
|
4687
4757
|
z = {
|
|
4688
4758
|
imagePath: e.imagePath,
|
|
4689
4759
|
mimeType: e.mimeType,
|
|
4690
4760
|
sizePx: n
|
|
4691
4761
|
};
|
|
4692
4762
|
}
|
|
4693
|
-
let V = A > 1 ? (i -
|
|
4694
|
-
for (let n = 0; n <
|
|
4695
|
-
let r =
|
|
4763
|
+
let V = A > 1 ? (i - C - w - (A - 1) * j) / A : i - C - w, H = n + C + g, U = n + C + g + v, W = V - g - _, ee = fr(e, m, k ? W : Infinity, b, x, o, g, M, N, r, f, p, $n(S, v)), G = m.spaceBefore == null ? 0 : m.spaceBefore / 100 * Y * o * r, te = m.spaceAfter == null ? 0 : m.spaceAfter / 100 * Y * o * r;
|
|
4764
|
+
for (let n = 0; n < ee.length; n++) {
|
|
4765
|
+
let r = ee[n], i = n === 0, a = n === ee.length - 1, u = 0, f = 0;
|
|
4696
4766
|
for (let t of r.segments) {
|
|
4697
4767
|
let n = t.math ? Math.max(t.sizePx, (t.math.ascent + t.math.descent) / 1.2) : t.sizePx;
|
|
4698
4768
|
if (n > u && (u = n), !t.math && O) {
|
|
@@ -4707,32 +4777,34 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4707
4777
|
n > u && (u = n);
|
|
4708
4778
|
}
|
|
4709
4779
|
i && z && z.sizePx > u && (u = z.sizePx);
|
|
4710
|
-
let p = u * 1.2, g = O && f > p, _ = p, x;
|
|
4711
|
-
|
|
4712
|
-
let
|
|
4713
|
-
|
|
4714
|
-
let
|
|
4780
|
+
let p = u * 1.2, g = O && f > p, _ = p, x = d === t.paragraphs.length - 1 && a, C = t.paragraphs.length === 1 && ee.length === 1, w;
|
|
4781
|
+
w = m.spaceLine ? m.spaceLine.type === "pct" ? p * (m.spaceLine.val / 1e5) : m.spaceLine.val * Y * o : _;
|
|
4782
|
+
let T = w;
|
|
4783
|
+
h && !O && !y && (m.spaceLine ? m.spaceLine.type === "pct" && x && C && (T = u * (m.spaceLine.val / 1e5)) : T = u);
|
|
4784
|
+
let E = m.spaceLine?.type === "pct" ? u * (m.spaceLine.val / 1e5) : T;
|
|
4785
|
+
t.autoFit === "norm" && t.lnSpcReduction != null && m.spaceLine?.type !== "pts" && (T *= 1 - t.lnSpcReduction);
|
|
4786
|
+
let D = T + (a ? te : 0), k = i && d > 0 ? G : 0, A = i ? $n(S, v) : 0, j = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), M = i && j ? z : null;
|
|
4715
4787
|
s.push({
|
|
4716
4788
|
line: r,
|
|
4717
|
-
linePx:
|
|
4718
|
-
lineHeight:
|
|
4719
|
-
baselineLineHeight:
|
|
4720
|
-
topGapPx:
|
|
4721
|
-
textXOffset:
|
|
4789
|
+
linePx: D,
|
|
4790
|
+
lineHeight: T,
|
|
4791
|
+
baselineLineHeight: E,
|
|
4792
|
+
topGapPx: k,
|
|
4793
|
+
textXOffset: A,
|
|
4722
4794
|
bulletLabel: i ? I : "",
|
|
4723
4795
|
bulletFont: L,
|
|
4724
4796
|
bulletColor: R,
|
|
4725
|
-
bulletX:
|
|
4726
|
-
bulletImage:
|
|
4797
|
+
bulletX: U,
|
|
4798
|
+
bulletImage: M,
|
|
4727
4799
|
textX: H,
|
|
4728
|
-
textMaxW:
|
|
4800
|
+
textMaxW: W,
|
|
4729
4801
|
alignment: m.alignment,
|
|
4730
4802
|
isLastLine: a,
|
|
4731
4803
|
para: m,
|
|
4732
4804
|
useResolvedFontMetrics: g
|
|
4733
4805
|
});
|
|
4734
|
-
let
|
|
4735
|
-
c +=
|
|
4806
|
+
let N = c + k;
|
|
4807
|
+
c += D + k, l = Math.max(l, c, N + (g ? Math.max(T, f) : T) + (a ? te : 0));
|
|
4736
4808
|
}
|
|
4737
4809
|
}
|
|
4738
4810
|
return {
|
|
@@ -4743,7 +4815,7 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4743
4815
|
}, { allLines: L, totalHeight: R, requiredHeight: z } = F(1);
|
|
4744
4816
|
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: L, totalHeight: R, requiredHeight: z} = F(t.fontScale));
|
|
4745
4817
|
else {
|
|
4746
|
-
let e = a -
|
|
4818
|
+
let e = a - T - E;
|
|
4747
4819
|
if (z > e && e > 0) {
|
|
4748
4820
|
let t = .1, n = 1;
|
|
4749
4821
|
for (let r = 0; r < 6; r++) {
|
|
@@ -4753,20 +4825,20 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4753
4825
|
({allLines: L, totalHeight: R, requiredHeight: z} = F(t));
|
|
4754
4826
|
}
|
|
4755
4827
|
}
|
|
4756
|
-
if (h) return
|
|
4828
|
+
if (h) return T + z + E;
|
|
4757
4829
|
let B = t.verticalAnchor ?? "t", V = r, H;
|
|
4758
|
-
a === 0 && B === "b" ? (H =
|
|
4759
|
-
let
|
|
4760
|
-
|
|
4761
|
-
let
|
|
4830
|
+
a === 0 && B === "b" ? (H = T + z + E, V = r - H) : H = t.autoFit === "sp" ? Math.max(a, T + z + E) : a;
|
|
4831
|
+
let U, W = Math.max(0, H - T - E);
|
|
4832
|
+
U = B === "ctr" ? V + T + (W - z) / 2 : B === "b" ? V + H - E - z : V + T, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4833
|
+
let ee = U, G = A > 1 ? (i - C - w - (A - 1) * j) / A + j : 0, te = Math.max(0, H - T - E), K = L[L.length - 1], q = K ? Math.max(0, K.linePx - K.lineHeight) : 0, J = z - q, ne = a === 0 || J <= te + .5, re = A > 1 && !ne ? Math.ceil(L.length / A) : L.length, ie = 0, ae = 0;
|
|
4762
4834
|
for (let s of L) {
|
|
4763
|
-
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel:
|
|
4764
|
-
A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0,
|
|
4765
|
-
let E = (t.rtlCol ? A - 1 - ie : ie) *
|
|
4835
|
+
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w, useResolvedFontMetrics: T } = s;
|
|
4836
|
+
A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, U = ee), U += f, ae++;
|
|
4837
|
+
let E = (t.rtlCol ? A - 1 - ie : ie) * G, D = s.textX + E, O = s.bulletX + E, k = s.textMaxW, j = s.para.rtl === !0, M = j || ln(l.segments), N = l.segments.some((e) => e.isTab);
|
|
4766
4838
|
if (N) {
|
|
4767
4839
|
let t = X(s.para.marL, o), n = X(s.para.marR, o), r = j ? n : t + h, i = k + t + n;
|
|
4768
4840
|
e.font = l.segments.find((e) => e.isTab).font;
|
|
4769
|
-
let a = e.measureText(" ").width, c =
|
|
4841
|
+
let a = e.measureText(" ").width, c = xn(l.segments.map((t) => {
|
|
4770
4842
|
if (t.isTab) return {
|
|
4771
4843
|
isTab: !0,
|
|
4772
4844
|
width: 0
|
|
@@ -4799,30 +4871,30 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4799
4871
|
}
|
|
4800
4872
|
e.font = t.font;
|
|
4801
4873
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4802
|
-
if (P += t.leadingLetterSpacingPx ?? 0, P += t.text ? $(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent)),
|
|
4874
|
+
if (P += t.leadingLetterSpacingPx ?? 0, P += t.text ? $(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent)), T) {
|
|
4803
4875
|
let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
|
|
4804
4876
|
t > R && (R = t, L = e);
|
|
4805
4877
|
}
|
|
4806
4878
|
}
|
|
4807
|
-
let z =
|
|
4879
|
+
let z = T && R > 0 ? B === "t" && F > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(F, L + (s.baselineLineHeight - R) / 2) : F : Math.max(F, L + Math.max(0, d - R) / 2) : Math.max(d * .8, F), V = U + z, H = D + k, W = S && g ? p.pictureBulletImages?.has(S.imagePath) ? p.pictureBulletImages.get(S.imagePath) : I(S.imagePath, g) : void 0, te = 0;
|
|
4808
4880
|
if (M && j) {
|
|
4809
|
-
if (
|
|
4810
|
-
else if (
|
|
4811
|
-
let e =
|
|
4812
|
-
|
|
4881
|
+
if (y) e.font = b, te = e.measureText(y).width;
|
|
4882
|
+
else if (S && W) {
|
|
4883
|
+
let e = S.sizePx;
|
|
4884
|
+
te = W.height > 0 ? e * (W.width / W.height) : e;
|
|
4813
4885
|
}
|
|
4814
4886
|
}
|
|
4815
|
-
if (
|
|
4887
|
+
if (y) if (e.font = b, e.fillStyle = x, M && j) {
|
|
4816
4888
|
let t = e.direction;
|
|
4817
|
-
e.direction = "rtl", e.fillText(
|
|
4818
|
-
} else e.fillText(
|
|
4819
|
-
if (
|
|
4820
|
-
let t =
|
|
4821
|
-
M && j ? e.drawImage(
|
|
4889
|
+
e.direction = "rtl", e.fillText(y, H - te, V), e.direction = t;
|
|
4890
|
+
} else e.fillText(y, O, V);
|
|
4891
|
+
if (S && g && W) {
|
|
4892
|
+
let t = S.sizePx, n = W.height > 0 ? t * (W.width / W.height) : t, r = V - t;
|
|
4893
|
+
M && j ? e.drawImage(W, H - n, r, n, t) : e.drawImage(W, O, r, n, t);
|
|
4822
4894
|
}
|
|
4823
4895
|
let K = D + h, q;
|
|
4824
|
-
q = N ? j ? D + k -
|
|
4825
|
-
let J =
|
|
4896
|
+
q = N ? j ? D + k - te - P : K : C === "ctr" ? K + (k - h - P) / 2 : C === "r" ? D + k - te - P : K;
|
|
4897
|
+
let J = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ne = w || (l.endsWithBreak ?? !1), oe = (J && !M && !N ? pn(l.segments, k - h, P, J, ne) : null) ?? l.segments, se = M ? un(l.segments, j) : null, ce = (e, t) => {
|
|
4826
4898
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4827
4899
|
let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
|
|
4828
4900
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
@@ -4837,28 +4909,28 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4837
4909
|
q += l.tabWidthPx ?? 0;
|
|
4838
4910
|
continue;
|
|
4839
4911
|
}
|
|
4840
|
-
let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0,
|
|
4912
|
+
let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, y = h && h.length > 0 ? h.length * g : 0;
|
|
4841
4913
|
if (l.math) {
|
|
4842
|
-
let t =
|
|
4914
|
+
let t = Fn.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
|
|
4843
4915
|
if (t && n > 0 && r > 0) {
|
|
4844
|
-
let i = V - l.math.ascent, a =
|
|
4916
|
+
let i = V - l.math.ascent, a = In(t, l.color);
|
|
4845
4917
|
e.drawImage(a, q, i, n, r);
|
|
4846
4918
|
}
|
|
4847
4919
|
q += n, q += f;
|
|
4848
4920
|
continue;
|
|
4849
4921
|
}
|
|
4850
4922
|
e.font = l.font, e.fillStyle = l.color;
|
|
4851
|
-
let
|
|
4923
|
+
let b = l.drawSizePx ?? l.sizePx, x = V + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), S = l.letterSpacingPx ?? 0;
|
|
4852
4924
|
if (l.highlight && l.text) {
|
|
4853
|
-
let t = $(e, l.text,
|
|
4854
|
-
|
|
4925
|
+
let t = $(e, l.text, S) + y + f;
|
|
4926
|
+
Nn(e, q, x, t, b, l.highlight, l.color);
|
|
4855
4927
|
}
|
|
4856
|
-
let
|
|
4928
|
+
let C = l.shadow, w = (e, t, n, r) => {
|
|
4857
4929
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4858
|
-
if (
|
|
4930
|
+
if (S !== 0 && lr(t) > 1) {
|
|
4859
4931
|
let r = e, a = r.letterSpacing;
|
|
4860
|
-
if (
|
|
4861
|
-
r.letterSpacing = `${
|
|
4932
|
+
if (dr(e)) {
|
|
4933
|
+
r.letterSpacing = `${S}px`, i(t, n, x);
|
|
4862
4934
|
try {
|
|
4863
4935
|
r.letterSpacing = a;
|
|
4864
4936
|
} catch {}
|
|
@@ -4866,21 +4938,21 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4866
4938
|
let r = n, a = [...t];
|
|
4867
4939
|
for (let t = 0; t < a.length; t++) {
|
|
4868
4940
|
let n = a[t];
|
|
4869
|
-
i(n, r,
|
|
4941
|
+
i(n, r, x), t < a.length - 1 && (r += e.measureText(n).width + S);
|
|
4870
4942
|
}
|
|
4871
4943
|
}
|
|
4872
|
-
} else i(t, n,
|
|
4873
|
-
},
|
|
4874
|
-
if (
|
|
4875
|
-
let n = O ?
|
|
4876
|
-
|
|
4944
|
+
} else i(t, n, x);
|
|
4945
|
+
}, T = (t) => $(e, t, S), E = h && h.length > 0 ? en([...l.text], h, g, T) : null, D = [...l.text], O = !!h && h.length === D.length - 1 && D.length > 1, k = (e, t) => {
|
|
4946
|
+
if (v) {
|
|
4947
|
+
let n = O ? S + g : S;
|
|
4948
|
+
En(e, l.text, q, x, b, n, t);
|
|
4877
4949
|
return;
|
|
4878
4950
|
}
|
|
4879
4951
|
if (O) {
|
|
4880
|
-
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r =
|
|
4881
|
-
if (
|
|
4952
|
+
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = S + g;
|
|
4953
|
+
if (dr(e)) {
|
|
4882
4954
|
let t = e, i = t.letterSpacing;
|
|
4883
|
-
t.letterSpacing = `${r}px`, n(l.text, q,
|
|
4955
|
+
t.letterSpacing = `${r}px`, n(l.text, q, x);
|
|
4884
4956
|
try {
|
|
4885
4957
|
t.letterSpacing = i;
|
|
4886
4958
|
} catch {}
|
|
@@ -4888,42 +4960,42 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4888
4960
|
let t = q;
|
|
4889
4961
|
for (let i = 0; i < D.length; i++) {
|
|
4890
4962
|
let a = D[i];
|
|
4891
|
-
n(a, t,
|
|
4963
|
+
n(a, t, x), i < D.length - 1 && (t += e.measureText(a).width + r);
|
|
4892
4964
|
}
|
|
4893
4965
|
}
|
|
4894
|
-
} else if (E) for (let { text: n, dx: r } of E)
|
|
4895
|
-
else
|
|
4966
|
+
} else if (E) for (let { text: n, dx: r } of E) w(e, n, q + r, t);
|
|
4967
|
+
else w(e, l.text, q, t);
|
|
4896
4968
|
}, A = l.reflection;
|
|
4897
4969
|
if (A && l.text) {
|
|
4898
4970
|
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
4899
4971
|
if (t > 0 && n > 0) {
|
|
4900
4972
|
e.font = l.font;
|
|
4901
|
-
let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent :
|
|
4902
|
-
|
|
4973
|
+
let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : b * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : b * .2, s = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = 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;
|
|
4974
|
+
Yn(e, (e) => {
|
|
4903
4975
|
e.font = l.font, e.fillStyle = l.color, k(e, "fill");
|
|
4904
4976
|
}, {
|
|
4905
4977
|
x: (q - s) * f,
|
|
4906
|
-
y: (
|
|
4978
|
+
y: (x - i) * f,
|
|
4907
4979
|
w: Math.max(1, s + c) * f,
|
|
4908
4980
|
h: Math.max(1, i + a) * f
|
|
4909
4981
|
}, A, o * f, u, t, n), e.font = l.font, e.fillStyle = l.color;
|
|
4910
4982
|
}
|
|
4911
4983
|
}
|
|
4912
|
-
if (
|
|
4913
|
-
let t =
|
|
4914
|
-
e.save(), e.shadowColor = Q(
|
|
4984
|
+
if (C) {
|
|
4985
|
+
let t = C.dir * Math.PI / 180, n = X(C.dist, o);
|
|
4986
|
+
e.save(), e.shadowColor = Q(C.color, C.alpha), e.shadowBlur = X(C.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4915
4987
|
}
|
|
4916
|
-
k(e, "fill"),
|
|
4988
|
+
k(e, "fill"), C && e.restore();
|
|
4917
4989
|
let j = l.outline;
|
|
4918
4990
|
j && j.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(j.width, o)), e.strokeStyle = j.color ? `#${j.color}` : l.color, e.lineJoin = "round", k(e, "stroke"), e.restore()), e.font = l.font;
|
|
4919
|
-
let N = $(e, l.text,
|
|
4991
|
+
let N = $(e, l.text, S) + y;
|
|
4920
4992
|
if (m && l.text && m({
|
|
4921
4993
|
text: l.text,
|
|
4922
4994
|
inShapeX: q - n,
|
|
4923
|
-
inShapeY:
|
|
4995
|
+
inShapeY: U - r,
|
|
4924
4996
|
w: N + f,
|
|
4925
4997
|
h: d,
|
|
4926
|
-
fontSize:
|
|
4998
|
+
fontSize: b,
|
|
4927
4999
|
font: l.font,
|
|
4928
5000
|
shapeX: n,
|
|
4929
5001
|
shapeY: r,
|
|
@@ -4931,27 +5003,27 @@ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4931
5003
|
shapeH: a,
|
|
4932
5004
|
rotation: c,
|
|
4933
5005
|
hyperlink: l.hyperlink
|
|
4934
|
-
}), l.underline &&
|
|
4935
|
-
let t = Math.max(1,
|
|
5006
|
+
}), l.underline && Qt(e, q, x, N + f, b, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
|
|
5007
|
+
let t = Math.max(1, b * .05);
|
|
4936
5008
|
e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
|
|
4937
|
-
let n =
|
|
5009
|
+
let n = x - b * .32;
|
|
4938
5010
|
if (l.strikeDouble) {
|
|
4939
5011
|
let r = t * .9, i = n - r, a = n + r;
|
|
4940
|
-
e.beginPath(), e.moveTo(q, i +
|
|
5012
|
+
e.beginPath(), e.moveTo(q, i + _(i, t, p.dpr)), e.lineTo(q + N + f, i + _(i, t, p.dpr)), e.moveTo(q, a + _(a, t, p.dpr)), e.lineTo(q + N + f, a + _(a, t, p.dpr)), e.stroke();
|
|
4941
5013
|
} else {
|
|
4942
|
-
let r = n +
|
|
5014
|
+
let r = n + _(n, t, p.dpr);
|
|
4943
5015
|
e.beginPath(), e.moveTo(q, r), e.lineTo(q + N + f, r), e.stroke();
|
|
4944
5016
|
}
|
|
4945
5017
|
}
|
|
4946
5018
|
q += N, q += f;
|
|
4947
5019
|
}
|
|
4948
|
-
M && (e.direction = "ltr"),
|
|
5020
|
+
M && (e.direction = "ltr"), U += u;
|
|
4949
5021
|
}
|
|
4950
5022
|
e.restore();
|
|
4951
5023
|
}
|
|
4952
|
-
function
|
|
5024
|
+
function Xr(e, t, n, r, i) {
|
|
4953
5025
|
if (!e) return [];
|
|
4954
|
-
let a =
|
|
5026
|
+
let a = Bt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Kt(n), s = r * i, c = [];
|
|
4955
5027
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4956
5028
|
widthPx: e.bevelT.w * s,
|
|
4957
5029
|
heightPx: e.bevelT.h * s,
|
|
@@ -4967,9 +5039,9 @@ function Hr(e, t, n, r, i) {
|
|
|
4967
5039
|
bottom: !0
|
|
4968
5040
|
}), c;
|
|
4969
5041
|
}
|
|
4970
|
-
function
|
|
5042
|
+
function Zr(e, t, n, r, i, a) {
|
|
4971
5043
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4972
|
-
let o = e.extrusionH * i * a, s =
|
|
5044
|
+
let o = e.extrusionH * i * a, s = Tt(t, n * a, r * a, o);
|
|
4973
5045
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4974
5046
|
let c = [
|
|
4975
5047
|
64,
|
|
@@ -4990,14 +5062,14 @@ function Ur(e, t, n, r, i, a) {
|
|
|
4990
5062
|
rgb: c
|
|
4991
5063
|
};
|
|
4992
5064
|
}
|
|
4993
|
-
function
|
|
5065
|
+
function Qr(e, t, n, r, i, a, o, s = {}) {
|
|
4994
5066
|
if (i <= 0 || a <= 0) return !1;
|
|
4995
|
-
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 =
|
|
5067
|
+
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 = Ct(t, i, a), p = f.corners;
|
|
4996
5068
|
if (d > 0) {
|
|
4997
|
-
let e = d / u, t =
|
|
5069
|
+
let e = d / u, t = Ke(f.corners, e / i, e / a);
|
|
4998
5070
|
t ? p = t : d = 0;
|
|
4999
5071
|
}
|
|
5000
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
5072
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = je(h, g);
|
|
5001
5073
|
if (!_) return !1;
|
|
5002
5074
|
let v = _.getContext("2d");
|
|
5003
5075
|
if (!v) return !1;
|
|
@@ -5010,17 +5082,17 @@ function Wr(e, t, n, r, i, a, o, s = {}) {
|
|
|
5010
5082
|
});
|
|
5011
5083
|
if (s.extrusion) {
|
|
5012
5084
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
5013
|
-
|
|
5085
|
+
Zt(v, s.extrusion, x(e));
|
|
5014
5086
|
}
|
|
5015
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
5016
|
-
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()),
|
|
5087
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Xt(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
5088
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), ze(_, e, h, g, p.map((e) => ({
|
|
5017
5089
|
x: n + e.x,
|
|
5018
5090
|
y: r + e.y
|
|
5019
5091
|
}))), !0;
|
|
5020
5092
|
}
|
|
5021
|
-
function
|
|
5093
|
+
function $r(e, t, n, r, i, a, o, s, c = 0) {
|
|
5022
5094
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5023
|
-
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 =
|
|
5095
|
+
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 = je(m, h);
|
|
5024
5096
|
if (!g) return !1;
|
|
5025
5097
|
let _ = g.getContext("2d");
|
|
5026
5098
|
if (!_) return !1;
|
|
@@ -5028,7 +5100,7 @@ function Gr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5028
5100
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
5029
5101
|
for (let e of a) {
|
|
5030
5102
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5031
|
-
|
|
5103
|
+
Xt(_, e, {
|
|
5032
5104
|
x: f - t,
|
|
5033
5105
|
y: f - t,
|
|
5034
5106
|
w: v + 2 * t,
|
|
@@ -5037,17 +5109,17 @@ function Gr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5037
5109
|
}
|
|
5038
5110
|
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;
|
|
5039
5111
|
}
|
|
5040
|
-
var
|
|
5041
|
-
function
|
|
5042
|
-
let t =
|
|
5112
|
+
var ei = /* @__PURE__ */ new WeakMap();
|
|
5113
|
+
function ti(e) {
|
|
5114
|
+
let t = ei.get(e);
|
|
5043
5115
|
return t || (t = async (t, n) => {
|
|
5044
5116
|
let r = await e(t);
|
|
5045
5117
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
5046
|
-
},
|
|
5118
|
+
}, ei.set(e, t)), t;
|
|
5047
5119
|
}
|
|
5048
|
-
function
|
|
5049
|
-
let o =
|
|
5050
|
-
return
|
|
5120
|
+
function ni(e, t, n = ti(t), r, i, a) {
|
|
5121
|
+
let o = ti(t);
|
|
5122
|
+
return J(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
|
|
5051
5123
|
tiff: r,
|
|
5052
5124
|
svgDecoder: a,
|
|
5053
5125
|
...i ?? {}
|
|
@@ -5056,25 +5128,25 @@ function Jr(e, t, n = qr(t), r, i, a) {
|
|
|
5056
5128
|
return e;
|
|
5057
5129
|
});
|
|
5058
5130
|
}
|
|
5059
|
-
function
|
|
5060
|
-
let r = X(t.x, n), i = X(t.y, n),
|
|
5131
|
+
function ri(e, t, n) {
|
|
5132
|
+
let r = X(t.x, n), i = X(t.y, n), o = X(t.width, n), s = X(t.height, n);
|
|
5061
5133
|
e.save();
|
|
5062
5134
|
try {
|
|
5063
|
-
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r +
|
|
5135
|
+
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + o / 2, i + s / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + o / 2), -(i + s / 2))), a(e, "tiff", {
|
|
5064
5136
|
x: r,
|
|
5065
5137
|
y: i,
|
|
5066
|
-
width:
|
|
5067
|
-
height:
|
|
5138
|
+
width: o,
|
|
5139
|
+
height: s
|
|
5068
5140
|
});
|
|
5069
5141
|
} finally {
|
|
5070
5142
|
e.restore();
|
|
5071
5143
|
}
|
|
5072
5144
|
}
|
|
5073
|
-
async function
|
|
5145
|
+
async function ii(e, t, r, i, a, o, c = 1, l, u) {
|
|
5074
5146
|
if (a) try {
|
|
5075
|
-
let d = t.mimeType === "image/svg+xml", f =
|
|
5147
|
+
let d = t.mimeType === "image/svg+xml", f = Pe(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5076
5148
|
if (!f) return;
|
|
5077
|
-
let { widthPt: p, heightPt: m } = f, h =
|
|
5149
|
+
let { widthPt: p, heightPt: m } = f, h = Dn(X(t.width, r), X(t.height, r), c, t.srcRect), g = z(t) || d, _ = g ? h : u && !t.duotone ? On(u, Z(kn(t), g ? void 0 : t.duotone)) : void 0, v = _ && "maxRetainedPixels" in _ ? _.maxRetainedPixels : void 0, y = {
|
|
5078
5150
|
..._ ? {
|
|
5079
5151
|
targetWidthPx: _.targetWidthPx,
|
|
5080
5152
|
targetHeightPx: _.targetHeightPx,
|
|
@@ -5082,34 +5154,34 @@ async function Xr(e, t, r, i, a, s, c = 1, l, u) {
|
|
|
5082
5154
|
} : {},
|
|
5083
5155
|
workerDecoder: l
|
|
5084
5156
|
}, b;
|
|
5085
|
-
if (
|
|
5086
|
-
b = await
|
|
5157
|
+
if (z(t)) try {
|
|
5158
|
+
b = await ce(t.svgImagePath, a, y);
|
|
5087
5159
|
} catch {
|
|
5088
|
-
b = d ? await
|
|
5160
|
+
b = d ? await ce(t.imagePath, a, y) : await Ye(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5089
5161
|
widthPt: p,
|
|
5090
5162
|
heightPt: m,
|
|
5091
5163
|
..._ ?? {},
|
|
5092
|
-
tiff:
|
|
5164
|
+
tiff: o
|
|
5093
5165
|
});
|
|
5094
5166
|
}
|
|
5095
|
-
else b = d ? await
|
|
5167
|
+
else b = d ? await ce(t.imagePath, a, y) : await Ye(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5096
5168
|
widthPt: p,
|
|
5097
5169
|
heightPt: m,
|
|
5098
5170
|
..._ ?? {},
|
|
5099
|
-
tiff:
|
|
5171
|
+
tiff: o
|
|
5100
5172
|
});
|
|
5101
5173
|
if (!b || i()) return;
|
|
5102
5174
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5103
5175
|
let x = X(t.x, r), S = X(t.y, r), C = X(t.width, r), w = X(t.height, r);
|
|
5104
5176
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(x + C / 2, S + w / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(x + C / 2), -(S + w / 2)));
|
|
5105
5177
|
let T = (e, n, r, i, a) => {
|
|
5106
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
5178
|
+
t.custGeom && t.custGeom.length > 0 ? Wr(e, t.custGeom, n, r, i, a) : t.prstGeom && s(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5107
5179
|
}, E = (e, t, n, r, i) => {
|
|
5108
5180
|
e.beginPath(), T(e, t, n, r, i);
|
|
5109
5181
|
}, D = (e, n, r, i, a) => {
|
|
5110
5182
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
|
|
5111
5183
|
}, O = (e, n, i, a, o) => {
|
|
5112
|
-
t.stroke && (e.save(),
|
|
5184
|
+
t.stroke && (e.save(), si(e, t.stroke, r, {
|
|
5113
5185
|
x: n,
|
|
5114
5186
|
y: i,
|
|
5115
5187
|
w: a,
|
|
@@ -5123,66 +5195,66 @@ async function Xr(e, t, r, i, a, s, c = 1, l, u) {
|
|
|
5123
5195
|
let c = t * 2 + Math.max(a, o);
|
|
5124
5196
|
e.rect(n - c, i - c, a + 2 * c, o + 2 * c), T(e, n, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, n, i, a, o), e.strokeStyle = Q(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5125
5197
|
}
|
|
5126
|
-
}, A = t.scene3d &&
|
|
5127
|
-
e.save(), D(e, n, r, i, a),
|
|
5198
|
+
}, A = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null, j = (e, n, r, i, a) => {
|
|
5199
|
+
e.save(), D(e, n, r, i, a), Me(e, b, t.srcRect, n, r, i, a), e.restore();
|
|
5128
5200
|
}, M = (e, t, n, r, i) => {
|
|
5129
5201
|
j(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
|
|
5130
5202
|
}, N = (e, t, n, r, i) => {
|
|
5131
5203
|
j(e, t, n, r, i), O(e, t, n, r, i);
|
|
5132
|
-
}, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L =
|
|
5204
|
+
}, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L = Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, I), R = A ? Zr(t.sp3d, A.camera, C, w, r, I) : null, B = t.stroke ? t.stroke.width * r / 2 : 0, H = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, U = R ? Math.hypot(R.offsetX, R.offsetY) / I : 0, W = B + H + U + 2, ee = (e) => {
|
|
5133
5205
|
if (A) {
|
|
5134
|
-
if (
|
|
5206
|
+
if (Qr(e, A.camera, x, S, C, w, N, {
|
|
5135
5207
|
bevels: L,
|
|
5136
5208
|
extrusion: R ?? void 0,
|
|
5137
5209
|
paintEdges: k,
|
|
5138
|
-
edgePadCss:
|
|
5210
|
+
edgePadCss: W
|
|
5139
5211
|
})) return;
|
|
5140
|
-
} else if (L.length > 0 &&
|
|
5212
|
+
} else if (L.length > 0 && $r(e, x, S, C, w, L, N, k, W)) return;
|
|
5141
5213
|
M(e, x, S, C, w);
|
|
5142
|
-
},
|
|
5214
|
+
}, G = (e, t, n, r, i, a) => {
|
|
5143
5215
|
e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5144
|
-
},
|
|
5145
|
-
A &&
|
|
5146
|
-
}, K = e.getTransform(), q = Math.abs(K.a * K.d - K.b * K.c),
|
|
5216
|
+
}, te = (e, t) => {
|
|
5217
|
+
A && Qr(e, A.camera, x, S, C, w, (e, n, r, i, a) => G(e, t, n, r, i, a)) || G(e, t, x, S, C, w);
|
|
5218
|
+
}, K = e.getTransform(), q = Math.abs(K.a * K.d - K.b * K.c), J = q > 0 ? Math.sqrt(q) : 1, ne = B + H, re = (t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, x, S, C, w) : t.prstGeom && V(t.prstGeom.toLowerCase()) ? n(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
|
|
5147
5219
|
x,
|
|
5148
5220
|
y: S,
|
|
5149
5221
|
w: C,
|
|
5150
5222
|
h: w
|
|
5151
|
-
},
|
|
5152
|
-
bbox:
|
|
5153
|
-
anchor:
|
|
5154
|
-
},
|
|
5155
|
-
|
|
5223
|
+
}, ie = A ? zr(A.camera, K, x, S, C, w, W, t.shadow?.algn) : {
|
|
5224
|
+
bbox: Fr(K, re.x - ne, re.y - ne, re.w + ne * 2, re.h + ne * 2),
|
|
5225
|
+
anchor: Rr(K, x, S, C, w, t.shadow?.algn)
|
|
5226
|
+
}, ae = r * J, oe = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), se = (e) => te(e, "#000");
|
|
5227
|
+
Vr(e, t, A && oe ? Br(ee, K, ie.bbox, {
|
|
5156
5228
|
w: e.canvas.width || 0,
|
|
5157
5229
|
h: e.canvas.height || 0
|
|
5158
|
-
}) :
|
|
5230
|
+
}) : ee, A && oe ? Br(se, K, ie.bbox, {
|
|
5159
5231
|
w: e.canvas.width || 0,
|
|
5160
5232
|
h: e.canvas.height || 0
|
|
5161
|
-
}) :
|
|
5233
|
+
}) : se, ie.bbox, ie.anchor, r, ae, K), e.restore();
|
|
5162
5234
|
} catch (n) {
|
|
5163
|
-
if (
|
|
5164
|
-
i() ||
|
|
5235
|
+
if (b(n, "tiff")) {
|
|
5236
|
+
i() || ri(e, t, r);
|
|
5165
5237
|
return;
|
|
5166
5238
|
}
|
|
5167
|
-
if (
|
|
5239
|
+
if (Re(n) || Je(n)) throw n;
|
|
5168
5240
|
}
|
|
5169
5241
|
}
|
|
5170
|
-
async function
|
|
5171
|
-
let
|
|
5242
|
+
async function ai(e, t, n, r, i, o, s, c, l = 1, u, d) {
|
|
5243
|
+
let f = X(t.x, n), p = X(t.y, n), m = X(t.width, n), h = X(t.height, n), g, _ = !1;
|
|
5172
5244
|
if (t.posterPath && i) try {
|
|
5173
|
-
|
|
5245
|
+
g = await ni(t, i, s, c, t.posterMimeType === "image/svg+xml" ? Dn(m, h, l) : d ? On(d, Z(t.posterPath)) : void 0, u);
|
|
5174
5246
|
} catch (e) {
|
|
5175
|
-
if (
|
|
5176
|
-
else if (
|
|
5247
|
+
if (b(e, "tiff")) _ = !0;
|
|
5248
|
+
else if (Re(e) || Je(e)) throw e;
|
|
5177
5249
|
}
|
|
5178
|
-
r() || (e.save(),
|
|
5179
|
-
x:
|
|
5180
|
-
y:
|
|
5181
|
-
width:
|
|
5182
|
-
height:
|
|
5183
|
-
})),
|
|
5184
|
-
}
|
|
5185
|
-
function
|
|
5250
|
+
r() || (e.save(), ci(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && a(e, "tiff", {
|
|
5251
|
+
x: f,
|
|
5252
|
+
y: p,
|
|
5253
|
+
width: m,
|
|
5254
|
+
height: h
|
|
5255
|
+
})), o || on(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
|
|
5256
|
+
}
|
|
5257
|
+
function oi(e, t, n, r, i, a, o) {
|
|
5186
5258
|
let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5187
5259
|
if (u === 0) return;
|
|
5188
5260
|
let d = -l / u, f = c / u, p;
|
|
@@ -5232,41 +5304,41 @@ function Qr(e, t, n, r, i, a, o) {
|
|
|
5232
5304
|
break;
|
|
5233
5305
|
default: return;
|
|
5234
5306
|
}
|
|
5235
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ?
|
|
5307
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? Pn(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o) : null) ?? Q(r.color);
|
|
5236
5308
|
for (let r of p) {
|
|
5237
5309
|
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5238
5310
|
e.lineWidth = Math.max(.5, s * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
|
|
5239
5311
|
}
|
|
5240
5312
|
e.restore();
|
|
5241
5313
|
}
|
|
5242
|
-
function
|
|
5243
|
-
if (
|
|
5244
|
-
let n =
|
|
5314
|
+
function si(e, t, n, r, i = 0) {
|
|
5315
|
+
if (Ae(e, t, n), t?.fill && r) {
|
|
5316
|
+
let n = Pn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5245
5317
|
n && (e.strokeStyle = n);
|
|
5246
5318
|
}
|
|
5247
5319
|
}
|
|
5248
|
-
function
|
|
5320
|
+
function ci(e, t, n) {
|
|
5249
5321
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5250
5322
|
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5251
5323
|
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));
|
|
5252
5324
|
}
|
|
5253
|
-
function
|
|
5325
|
+
function li(e, t, n, r, i = {
|
|
5254
5326
|
themeMajorFont: null,
|
|
5255
5327
|
themeMinorFont: null,
|
|
5256
5328
|
dpr: 1
|
|
5257
5329
|
}, a) {
|
|
5258
|
-
e.save(),
|
|
5330
|
+
e.save(), ci(e, t, n);
|
|
5259
5331
|
let o = X(t.x, n), s = X(t.y, n), c = t.cols.map((e) => X(e, n)), l = c.length, u = (e, t) => {
|
|
5260
5332
|
let n = 0;
|
|
5261
5333
|
for (let r = 0; r < t; r++) n += c[e + r] ?? 0;
|
|
5262
5334
|
return n;
|
|
5263
|
-
}, d = t.rows.map((e) => X(e.height, n));
|
|
5335
|
+
}, d = [...t.rows.map((e) => X(e.height, n))], f = t.rows.reduce((e, t) => e + t.height, 0), p = t.height > f;
|
|
5264
5336
|
for (let a = 0; a < t.rows.length; a++) {
|
|
5265
5337
|
let o = t.rows[a];
|
|
5266
5338
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5267
5339
|
let s = o.cells[t];
|
|
5268
|
-
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5269
|
-
let c = u(t, s.gridSpan || 1), l =
|
|
5340
|
+
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody || o.height > 0 && !p) continue;
|
|
5341
|
+
let c = u(t, s.gridSpan || 1), l = Yr(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;
|
|
5270
5342
|
l > d[a] && (d[a] = l);
|
|
5271
5343
|
}
|
|
5272
5344
|
}
|
|
@@ -5277,34 +5349,36 @@ function ti(e, t, n, r, i = {
|
|
|
5277
5349
|
if (c.hMerge || c.vMerge) continue;
|
|
5278
5350
|
let l = c.rowSpan || 1;
|
|
5279
5351
|
if (l <= 1 || !c.textBody) continue;
|
|
5280
|
-
let f = u(s, c.gridSpan || 1),
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5352
|
+
let f = u(s, c.gridSpan || 1), m = t.rows.slice(a, Math.min(t.rows.length, a + l)).some((e) => e.height === 0);
|
|
5353
|
+
if (!m && !p) continue;
|
|
5354
|
+
let h = Yr(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, m) || 0, g = 0;
|
|
5355
|
+
for (let e = 0; e < l && a + e < d.length; e++) g += d[a + e];
|
|
5356
|
+
if (h > g) {
|
|
5357
|
+
let e = (h - g) / l;
|
|
5284
5358
|
for (let t = 0; t < l && a + t < d.length; t++) d[a + t] += e;
|
|
5285
5359
|
}
|
|
5286
5360
|
}
|
|
5287
5361
|
}
|
|
5288
|
-
let
|
|
5362
|
+
let m = c.reduce((e, t) => e + t, 0), h = Array(l);
|
|
5289
5363
|
if (t.rtl) {
|
|
5290
|
-
let e = o +
|
|
5291
|
-
for (let t = 0; t < l; t++) e -= c[t],
|
|
5364
|
+
let e = o + m;
|
|
5365
|
+
for (let t = 0; t < l; t++) e -= c[t], h[t] = e;
|
|
5292
5366
|
} else {
|
|
5293
5367
|
let e = o;
|
|
5294
|
-
for (let t = 0; t < l; t++)
|
|
5368
|
+
for (let t = 0; t < l; t++) h[t] = e, e += c[t];
|
|
5295
5369
|
}
|
|
5296
|
-
let
|
|
5370
|
+
let g = (e, n) => t.rtl ? h[e + n - 1] : h[e], v = Array(t.rows.length);
|
|
5297
5371
|
{
|
|
5298
5372
|
let e = s;
|
|
5299
|
-
for (let n = 0; n < t.rows.length; n++)
|
|
5373
|
+
for (let n = 0; n < t.rows.length; n++) v[n] = e, e += d[n];
|
|
5300
5374
|
}
|
|
5301
|
-
let
|
|
5375
|
+
let y, b = {
|
|
5302
5376
|
row: 0,
|
|
5303
5377
|
column: 0
|
|
5304
5378
|
};
|
|
5305
5379
|
if (a) {
|
|
5306
5380
|
let e = X(t.width, n), r = X(t.height, n), i = o + e / 2, c = s + r / 2, l = t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l);
|
|
5307
|
-
|
|
5381
|
+
y = (e) => {
|
|
5308
5382
|
let n = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - c;
|
|
5309
5383
|
t.flipH && (n = -n), t.flipV && (r = -r);
|
|
5310
5384
|
let o = i + u * n - d * r, s = c + d * n + u * r;
|
|
@@ -5316,20 +5390,20 @@ function ti(e, t, n, r, i = {
|
|
|
5316
5390
|
rotation: t.rotation,
|
|
5317
5391
|
...t.flipH ? { shapeFlipH: !0 } : {},
|
|
5318
5392
|
...t.flipV ? { shapeFlipV: !0 } : {},
|
|
5319
|
-
tableCell:
|
|
5393
|
+
tableCell: b
|
|
5320
5394
|
});
|
|
5321
5395
|
};
|
|
5322
5396
|
}
|
|
5323
|
-
let
|
|
5397
|
+
let x = [], S = t.rows.map(() => Array(l).fill(-1));
|
|
5324
5398
|
for (let e = 0; e < t.rows.length; e++) {
|
|
5325
|
-
let n = t.rows[e], r =
|
|
5399
|
+
let n = t.rows[e], r = v[e];
|
|
5326
5400
|
for (let i = 0; i < n.cells.length; i++) {
|
|
5327
5401
|
let a = n.cells[i];
|
|
5328
5402
|
if (a.hMerge || a.vMerge) continue;
|
|
5329
5403
|
let o = a.gridSpan || 1, s = a.rowSpan || 1, c = u(i, o), f = 0;
|
|
5330
5404
|
for (let t = 0; t < s; t++) f += d[e + t] ?? 0;
|
|
5331
|
-
let p =
|
|
5332
|
-
|
|
5405
|
+
let p = g(i, o), m = Math.min(e + s - 1, t.rows.length - 1), h = x.length;
|
|
5406
|
+
x.push({
|
|
5333
5407
|
cell: a,
|
|
5334
5408
|
colX: p,
|
|
5335
5409
|
rowY: r,
|
|
@@ -5338,77 +5412,77 @@ function ti(e, t, n, r, i = {
|
|
|
5338
5412
|
ci: i,
|
|
5339
5413
|
ri: e,
|
|
5340
5414
|
span: o,
|
|
5341
|
-
lastRi:
|
|
5415
|
+
lastRi: m
|
|
5342
5416
|
});
|
|
5343
|
-
for (let t = e; t <=
|
|
5417
|
+
for (let t = e; t <= m; t++) for (let e = i; e < i + o && e < l; e++) S[t][e] = h;
|
|
5344
5418
|
}
|
|
5345
5419
|
}
|
|
5346
|
-
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of
|
|
5347
|
-
let f =
|
|
5420
|
+
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of x) {
|
|
5421
|
+
let f = Pn(a.fill, e, o, s, c, l, t.rotation);
|
|
5348
5422
|
if (f && (e.fillStyle = f, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5349
|
-
|
|
5423
|
+
y && (b = {
|
|
5350
5424
|
row: d,
|
|
5351
5425
|
column: u
|
|
5352
5426
|
});
|
|
5353
5427
|
let t = a.textColor ? Q(a.textColor) : null;
|
|
5354
|
-
|
|
5428
|
+
Yr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i, y);
|
|
5355
5429
|
}
|
|
5356
5430
|
}
|
|
5357
|
-
let
|
|
5358
|
-
if (e < 0 || e >=
|
|
5359
|
-
let n =
|
|
5360
|
-
return n < 0 ? null :
|
|
5361
|
-
},
|
|
5362
|
-
if (
|
|
5431
|
+
let C = i.dpr, w = (e, t) => {
|
|
5432
|
+
if (e < 0 || e >= S.length || t < 0 || t >= l) return null;
|
|
5433
|
+
let n = S[e][t];
|
|
5434
|
+
return n < 0 ? null : x[n];
|
|
5435
|
+
}, T = (r, i, a, o, s) => {
|
|
5436
|
+
if (si(e, r, n, {
|
|
5363
5437
|
x: Math.min(i, o),
|
|
5364
5438
|
y: Math.min(a, s),
|
|
5365
5439
|
w: Math.max(1, Math.abs(o - i)),
|
|
5366
5440
|
h: Math.max(1, Math.abs(s - a))
|
|
5367
5441
|
}, t.rotation), r.cmpd === "dbl" && !r.dashStyle && !r.customDash?.length && (i === o || a === s)) {
|
|
5368
|
-
e.fillStyle = e.strokeStyle,
|
|
5442
|
+
e.fillStyle = e.strokeStyle, Se(e, i, a, o, s, Math.max(.5, X(r.width, n)), C);
|
|
5369
5443
|
return;
|
|
5370
5444
|
}
|
|
5371
|
-
let c = i === o ?
|
|
5445
|
+
let c = i === o ? _(i, e.lineWidth, C) : 0, l = a === s ? _(a, e.lineWidth, C) : 0;
|
|
5372
5446
|
e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
|
|
5373
5447
|
};
|
|
5374
|
-
for (let r of
|
|
5448
|
+
for (let r of x) {
|
|
5375
5449
|
let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } = r;
|
|
5376
5450
|
e.save();
|
|
5377
|
-
let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR,
|
|
5378
|
-
if (r.ri === 0 && i.borderT &&
|
|
5451
|
+
let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, m = t.rtl ? r.ci + r.span === l : r.ci === 0, h = t.rtl ? r.ci === 0 : r.ci + r.span === l, _ = t.rtl ? r.ci - 1 : r.ci + r.span, y = (e) => t.rtl ? e.borderR : e.borderL;
|
|
5452
|
+
if (r.ri === 0 && i.borderT && T(i.borderT, a, o, a + s, o), m && f && T(f, a, o, a, o + c), r.lastRi === t.rows.length - 1) {
|
|
5379
5453
|
let e = i.borderB;
|
|
5380
|
-
e &&
|
|
5454
|
+
e && T(e, a, o + c, a + s, o + c);
|
|
5381
5455
|
} else {
|
|
5382
5456
|
let e = r.lastRi + 1, t = o + c, n = Math.min(r.ci + r.span, l), a = r.ci;
|
|
5383
5457
|
for (; a < n;) {
|
|
5384
|
-
let r =
|
|
5385
|
-
for (; o < n &&
|
|
5386
|
-
let s =
|
|
5458
|
+
let r = S[e][a], o = a + 1;
|
|
5459
|
+
for (; o < n && S[e][o] === r;) o++;
|
|
5460
|
+
let s = w(e, a), c = gn(i.borderB, s ? s.cell.borderT : null);
|
|
5387
5461
|
if (c) {
|
|
5388
|
-
let e =
|
|
5389
|
-
|
|
5462
|
+
let e = g(a, o - a);
|
|
5463
|
+
T(c, e, t, e + u(a, o - a), t);
|
|
5390
5464
|
}
|
|
5391
5465
|
a = o;
|
|
5392
5466
|
}
|
|
5393
5467
|
}
|
|
5394
|
-
if (
|
|
5468
|
+
if (h) {
|
|
5395
5469
|
let e = p;
|
|
5396
|
-
e &&
|
|
5470
|
+
e && T(e, a + s, o, a + s, o + c);
|
|
5397
5471
|
} else {
|
|
5398
5472
|
let e = a + s, t = r.ri;
|
|
5399
5473
|
for (; t <= r.lastRi;) {
|
|
5400
|
-
let n =
|
|
5401
|
-
for (; i + 1 <= r.lastRi &&
|
|
5402
|
-
let a =
|
|
5403
|
-
o &&
|
|
5474
|
+
let n = S[t][_], i = t;
|
|
5475
|
+
for (; i + 1 <= r.lastRi && S[i + 1][_] === n;) i++;
|
|
5476
|
+
let a = w(t, _), o = gn(p, a ? y(a.cell) : null);
|
|
5477
|
+
o && T(o, e, v[t], e, v[i] + d[i]), t = i + 1;
|
|
5404
5478
|
}
|
|
5405
5479
|
}
|
|
5406
|
-
i.diagonalTL && (
|
|
5480
|
+
i.diagonalTL && (si(e, i.diagonalTL, n, {
|
|
5407
5481
|
x: a,
|
|
5408
5482
|
y: o,
|
|
5409
5483
|
w: s,
|
|
5410
5484
|
h: c
|
|
5411
|
-
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (
|
|
5485
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (si(e, i.diagonalTR, n, {
|
|
5412
5486
|
x: a,
|
|
5413
5487
|
y: o,
|
|
5414
5488
|
w: s,
|
|
@@ -5417,14 +5491,14 @@ function ti(e, t, n, r, i = {
|
|
|
5417
5491
|
}
|
|
5418
5492
|
e.restore();
|
|
5419
5493
|
}
|
|
5420
|
-
function
|
|
5494
|
+
function ui(e, t, n, r) {
|
|
5421
5495
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5422
5496
|
}
|
|
5423
|
-
var
|
|
5424
|
-
function
|
|
5425
|
-
|
|
5497
|
+
var di = /* @__PURE__ */ new WeakMap();
|
|
5498
|
+
function fi(e) {
|
|
5499
|
+
di.set(e, (di.get(e) ?? 0) + 1);
|
|
5426
5500
|
}
|
|
5427
|
-
function
|
|
5501
|
+
function pi(e, t, n, r, i) {
|
|
5428
5502
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5429
5503
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5430
5504
|
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([]);
|
|
@@ -5444,35 +5518,35 @@ function ai(e, t, n, r, i) {
|
|
|
5444
5518
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5445
5519
|
e.restore();
|
|
5446
5520
|
}
|
|
5447
|
-
async function
|
|
5448
|
-
return
|
|
5449
|
-
}
|
|
5450
|
-
async function
|
|
5451
|
-
let o = i.fetchImage ?? (i.fetchMedia ?
|
|
5452
|
-
|
|
5453
|
-
let c = () =>
|
|
5454
|
-
return o &&
|
|
5455
|
-
}
|
|
5456
|
-
async function
|
|
5457
|
-
let l = a.width ?? ((
|
|
5458
|
-
t.width = m.width, t.height = m.height,
|
|
5459
|
-
let
|
|
5460
|
-
if (!
|
|
5461
|
-
if (
|
|
5462
|
-
let
|
|
5521
|
+
async function mi(e, t, n, r, i = {}, a) {
|
|
5522
|
+
return hi(e, t, n, r, i, a);
|
|
5523
|
+
}
|
|
5524
|
+
async function hi(e, t, n, r, i = {}, a) {
|
|
5525
|
+
let o = i.fetchImage ?? (i.fetchMedia ? ti(i.fetchMedia) : void 0), s = (di.get(e) ?? 0) + 1;
|
|
5526
|
+
di.set(e, s);
|
|
5527
|
+
let c = () => di.get(e) !== s, l = () => c() ? Promise.resolve(e) : gi(e, t, n, r, i, a, o, c);
|
|
5528
|
+
return o && Mn(t) ? fe(o, i.imageResources, l) : l();
|
|
5529
|
+
}
|
|
5530
|
+
async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
5531
|
+
let l = a.width ?? ((P(t) ? t.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? e(), m = He(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await jn(n, d, f, u, h, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff);
|
|
5532
|
+
t.width = m.width, t.height = m.height, P(t) && (t.style.width = `${d}px`, t.style.display || (t.style.display = "block"));
|
|
5533
|
+
let _ = t.getContext("2d");
|
|
5534
|
+
if (!_) throw Error("Could not get 2D context");
|
|
5535
|
+
if (_.scale(h, h), n.parseError) return pi(_, d, f, n.slideNumber, n.parseError), t;
|
|
5536
|
+
let v = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), x = {
|
|
5463
5537
|
themeMajorFont: a.majorFont ?? null,
|
|
5464
5538
|
themeMinorFont: a.minorFont ?? null,
|
|
5465
5539
|
themeHlinkColor: a.hlinkColor ?? null,
|
|
5466
5540
|
embeddedFontAliases: a.embeddedFontAliases,
|
|
5467
5541
|
embeddedFontAuthoredFamilies: a.embeddedFontAuthoredFamilies,
|
|
5468
5542
|
dpr: h,
|
|
5469
|
-
smartArtFallbackTextColor:
|
|
5470
|
-
pictureBulletImages:
|
|
5543
|
+
smartArtFallbackTextColor: bn(n.background, v),
|
|
5544
|
+
pictureBulletImages: y
|
|
5471
5545
|
};
|
|
5472
|
-
if (await
|
|
5546
|
+
if (await pr(_, n.background, d, f, u, c, a.fetchImage, a.tiff, a.svgDecoder, g), c() || (a.math && await Rn(n, a.math), c())) return t;
|
|
5473
5547
|
let S = n.slideNumber;
|
|
5474
5548
|
for (let e of n.elements) if (e.type === "picture" && a.fetchImage) {
|
|
5475
|
-
let t = e, n = t.mimeType === "image/svg+xml", r =
|
|
5549
|
+
let t = e, n = t.mimeType === "image/svg+xml", r = z(t) || n, i = !r && !t.duotone ? On(g, Z(kn(t), t.duotone)) : void 0, o = Dn(X(t.width, u), X(t.height, u), h, t.srcRect), s = r ? o : i, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
|
|
5476
5550
|
...s ? {
|
|
5477
5551
|
targetWidthPx: s.targetWidthPx,
|
|
5478
5552
|
targetHeightPx: s.targetHeightPx,
|
|
@@ -5480,12 +5554,12 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5480
5554
|
} : {},
|
|
5481
5555
|
workerDecoder: a.svgDecoder
|
|
5482
5556
|
};
|
|
5483
|
-
if (
|
|
5484
|
-
else if (n)
|
|
5557
|
+
if (z(t)) ce(t.svgImagePath, a.fetchImage, l).catch(() => void 0);
|
|
5558
|
+
else if (n) ce(t.imagePath, a.fetchImage, l).catch(() => void 0);
|
|
5485
5559
|
else {
|
|
5486
|
-
let e =
|
|
5560
|
+
let e = Pe(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5487
5561
|
if (!e) continue;
|
|
5488
|
-
|
|
5562
|
+
Ye(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
|
|
5489
5563
|
widthPt: e.widthPt,
|
|
5490
5564
|
heightPt: e.heightPt,
|
|
5491
5565
|
...s ?? {},
|
|
@@ -5495,7 +5569,7 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5495
5569
|
}
|
|
5496
5570
|
} else if (e.type === "media") {
|
|
5497
5571
|
let t = e;
|
|
5498
|
-
t.posterPath && a.fetchMedia &&
|
|
5572
|
+
t.posterPath && a.fetchMedia && ni(t, a.fetchMedia, s, a.tiff, t.posterMimeType === "image/svg+xml" ? Dn(X(t.width, u), X(t.height, u), h) : On(g, Z(t.posterPath)), a.svgDecoder).catch(() => void 0);
|
|
5499
5573
|
}
|
|
5500
5574
|
let C = /* @__PURE__ */ new Map();
|
|
5501
5575
|
if (a.fetchImage) {
|
|
@@ -5508,8 +5582,8 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5508
5582
|
targetWidthPx: X(e.width, u) * h,
|
|
5509
5583
|
targetHeightPx: X(e.height, u) * h
|
|
5510
5584
|
}, n = [], r = !0;
|
|
5511
|
-
for (let i of
|
|
5512
|
-
let e =
|
|
5585
|
+
for (let i of Ee(e.chart)) {
|
|
5586
|
+
let e = De(i, t);
|
|
5513
5587
|
if (!e) {
|
|
5514
5588
|
r = !1;
|
|
5515
5589
|
break;
|
|
@@ -5526,8 +5600,8 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5526
5600
|
});
|
|
5527
5601
|
}
|
|
5528
5602
|
let o = /* @__PURE__ */ new Map();
|
|
5529
|
-
for (let e of
|
|
5530
|
-
let { fill: t } = e, n =
|
|
5603
|
+
for (let e of Ne(i.map(({ element: e }) => e.chart), (e, t) => De(e, i[t].frame) != null)) {
|
|
5604
|
+
let { fill: t } = e, n = Le(t);
|
|
5531
5605
|
o.has(n) || o.set(n, {
|
|
5532
5606
|
fill: t,
|
|
5533
5607
|
widthPt: 0,
|
|
@@ -5537,9 +5611,9 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5537
5611
|
});
|
|
5538
5612
|
}
|
|
5539
5613
|
for (let { usages: e } of i) for (let { usage: t, size: n } of e) {
|
|
5540
|
-
let { fill: e } = t, r =
|
|
5614
|
+
let { fill: e } = t, r = Le(e), i = o.get(r);
|
|
5541
5615
|
if (!i) continue;
|
|
5542
|
-
let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 :
|
|
5616
|
+
let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : On(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || z({
|
|
5543
5617
|
svgImagePath: e.svgImagePath,
|
|
5544
5618
|
srcRect: s ? !0 : null
|
|
5545
5619
|
}));
|
|
@@ -5555,9 +5629,9 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5555
5629
|
});
|
|
5556
5630
|
}
|
|
5557
5631
|
for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5558
|
-
let n =
|
|
5632
|
+
let n = $e(t.bullet);
|
|
5559
5633
|
if (n.type === "blip") {
|
|
5560
|
-
let i =
|
|
5634
|
+
let i = Qn(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
|
|
5561
5635
|
a ? Number.isFinite(i) && i > 0 && (a.targetHeightPx = Math.max(a.targetHeightPx ?? 0, i)) : r.set(n.imagePath, {
|
|
5562
5636
|
mimeType: n.mimeType,
|
|
5563
5637
|
...Number.isFinite(i) && i > 0 ? { targetHeightPx: i } : {}
|
|
@@ -5570,21 +5644,21 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5570
5644
|
let i = n === "image/svg+xml" ? r === void 0 ? {} : {
|
|
5571
5645
|
targetWidthPx: 1,
|
|
5572
5646
|
targetHeightPx: r
|
|
5573
|
-
} :
|
|
5647
|
+
} : On(g, Z(t)) ?? {}, o = n === "image/svg+xml" ? await ce(t, e, {
|
|
5574
5648
|
...i,
|
|
5575
5649
|
workerDecoder: a.svgDecoder
|
|
5576
|
-
}) : await
|
|
5650
|
+
}) : await J(t, n, e, {
|
|
5577
5651
|
tiff: a.tiff,
|
|
5578
5652
|
...i
|
|
5579
5653
|
});
|
|
5580
|
-
|
|
5654
|
+
y.set(t, o);
|
|
5581
5655
|
} catch (e) {
|
|
5582
|
-
if (
|
|
5583
|
-
|
|
5656
|
+
if (b(e, "tiff")) {
|
|
5657
|
+
y.set(t, null);
|
|
5584
5658
|
return;
|
|
5585
5659
|
}
|
|
5586
|
-
if (
|
|
5587
|
-
|
|
5660
|
+
if (Re(e) || Je(e)) throw e;
|
|
5661
|
+
y.set(t, null);
|
|
5588
5662
|
}
|
|
5589
5663
|
}), i = [...o].map(async ([t, n]) => {
|
|
5590
5664
|
let { fill: r, widthPt: i, heightPt: o, targetWidthPx: s, targetHeightPx: c, maxRetainedPixels: l, hasSourceCrop: u } = n, d = s && c ? {
|
|
@@ -5593,10 +5667,10 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5593
5667
|
...l === void 0 ? {} : { maxRetainedPixels: l }
|
|
5594
5668
|
} : void 0;
|
|
5595
5669
|
try {
|
|
5596
|
-
let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) :
|
|
5670
|
+
let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : ce(r.imagePath, e, {
|
|
5597
5671
|
...d ?? {},
|
|
5598
5672
|
workerDecoder: a.svgDecoder
|
|
5599
|
-
}) :
|
|
5673
|
+
}) : Ye(r.imagePath, r.mimeType, r.duotone, e, {
|
|
5600
5674
|
widthPt: i,
|
|
5601
5675
|
heightPt: o,
|
|
5602
5676
|
...d ?? {},
|
|
@@ -5606,8 +5680,8 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5606
5680
|
svgImagePath: r.svgImagePath,
|
|
5607
5681
|
srcRect: u ? !0 : null
|
|
5608
5682
|
};
|
|
5609
|
-
if (!r.duotone &&
|
|
5610
|
-
s = await
|
|
5683
|
+
if (!r.duotone && z(c)) try {
|
|
5684
|
+
s = await ce(c.svgImagePath, e, {
|
|
5611
5685
|
...d ?? {},
|
|
5612
5686
|
workerDecoder: a.svgDecoder
|
|
5613
5687
|
});
|
|
@@ -5617,11 +5691,11 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5617
5691
|
else s = await n();
|
|
5618
5692
|
C.set(t, s);
|
|
5619
5693
|
} catch (e) {
|
|
5620
|
-
if (
|
|
5694
|
+
if (b(e, "tiff")) {
|
|
5621
5695
|
C.set(t, null);
|
|
5622
5696
|
return;
|
|
5623
5697
|
}
|
|
5624
|
-
if (
|
|
5698
|
+
if (Re(e) || Je(e)) throw e;
|
|
5625
5699
|
C.set(t, null);
|
|
5626
5700
|
}
|
|
5627
5701
|
});
|
|
@@ -5630,66 +5704,66 @@ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
|
5630
5704
|
}
|
|
5631
5705
|
for (let [e, r] of n.elements.entries()) {
|
|
5632
5706
|
if (c()) return t;
|
|
5633
|
-
if (r.type === "shape")
|
|
5707
|
+
if (r.type === "shape") Ur(_, r, u, v, S, x, o ? (t) => o({
|
|
5634
5708
|
...t,
|
|
5635
5709
|
elementIndex: e,
|
|
5636
5710
|
origin: n.elementSources?.[e]?.origin ?? "slide"
|
|
5637
5711
|
}) : void 0, a.fetchImage);
|
|
5638
|
-
else if (r.type === "picture") await
|
|
5639
|
-
else if (r.type === "table")
|
|
5712
|
+
else if (r.type === "picture") await ii(_, r, u, c, a.fetchImage, a.tiff, h, a.svgDecoder, g);
|
|
5713
|
+
else if (r.type === "table") li(_, r, u, S, x, o ? (t) => o({
|
|
5640
5714
|
...t,
|
|
5641
5715
|
elementIndex: e,
|
|
5642
5716
|
origin: n.elementSources?.[e]?.origin ?? "slide"
|
|
5643
5717
|
}) : void 0);
|
|
5644
|
-
else if (r.type === "media") await
|
|
5718
|
+
else if (r.type === "media") await ai(_, r, u, c, a.fetchMedia, a.skipMediaControls, a.fetchImage, a.tiff, h, a.svgDecoder, g);
|
|
5645
5719
|
else if (r.type === "chart") {
|
|
5646
5720
|
let e = Y * u;
|
|
5647
|
-
|
|
5721
|
+
_.save(), ci(_, r, u), qe(_, r.chart, {
|
|
5648
5722
|
x: X(r.x, u),
|
|
5649
5723
|
y: X(r.y, u),
|
|
5650
5724
|
w: X(r.width, u),
|
|
5651
5725
|
h: X(r.height, u)
|
|
5652
|
-
}, e, r.rotation, a.threeD, a.regionMap, (e) => C.get(
|
|
5726
|
+
}, e, r.rotation, a.threeD, a.regionMap, (e) => C.get(Le(e)), a.chartEx), _.restore();
|
|
5653
5727
|
}
|
|
5654
5728
|
}
|
|
5655
|
-
return c() || a.dim &&
|
|
5729
|
+
return c() || a.dim && ui(_, a.dim, d, f), t;
|
|
5656
5730
|
}
|
|
5657
5731
|
//#endregion
|
|
5658
5732
|
//#region packages/pptx/src/google-fonts.ts
|
|
5659
|
-
var
|
|
5660
|
-
...
|
|
5661
|
-
...
|
|
5733
|
+
var _i = {
|
|
5734
|
+
...C,
|
|
5735
|
+
...f
|
|
5662
5736
|
};
|
|
5663
|
-
function*
|
|
5737
|
+
function* vi(e) {
|
|
5664
5738
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5665
5739
|
}
|
|
5666
|
-
function*
|
|
5740
|
+
function* yi(e) {
|
|
5667
5741
|
for (let t of e?.paragraphs ?? []) {
|
|
5668
5742
|
t.defFontFamily && (yield t.defFontFamily);
|
|
5669
5743
|
for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
|
|
5670
5744
|
}
|
|
5671
5745
|
}
|
|
5672
|
-
function*
|
|
5673
|
-
for (let t of e.elements) if (t.type === "shape") yield*
|
|
5674
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield*
|
|
5746
|
+
function* bi(e) {
|
|
5747
|
+
for (let t of e.elements) if (t.type === "shape") yield* vi(t.textBody);
|
|
5748
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* vi(t.textBody);
|
|
5675
5749
|
else if (t.type === "chart") {
|
|
5676
5750
|
t.chart.title && (yield t.chart.title);
|
|
5677
5751
|
for (let e of t.chart.categories) yield e;
|
|
5678
5752
|
for (let e of t.chart.series) e.name && (yield e.name);
|
|
5679
5753
|
}
|
|
5680
5754
|
}
|
|
5681
|
-
var
|
|
5755
|
+
var xi = class e {
|
|
5682
5756
|
scripts;
|
|
5683
5757
|
families;
|
|
5684
|
-
constructor(e, t, n,
|
|
5758
|
+
constructor(e, t, n, i) {
|
|
5685
5759
|
this.majorFont = e, this.minorFont = t;
|
|
5686
|
-
let
|
|
5687
|
-
this.scripts = n ?? new
|
|
5760
|
+
let a = r(e) ?? r(t) ?? null;
|
|
5761
|
+
this.scripts = n ?? new v(a), this.families = i ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
|
|
5688
5762
|
}
|
|
5689
5763
|
addSlide(e) {
|
|
5690
|
-
this.scripts.addText(
|
|
5691
|
-
for (let t of e.elements) if (t.type === "shape") for (let e of
|
|
5692
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of
|
|
5764
|
+
this.scripts.addText(bi(e));
|
|
5765
|
+
for (let t of e.elements) if (t.type === "shape") for (let e of yi(t.textBody)) this.families.add(e);
|
|
5766
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of yi(t.textBody)) this.families.add(e);
|
|
5693
5767
|
}
|
|
5694
5768
|
names() {
|
|
5695
5769
|
return [...this.families, ...this.scripts.names()];
|
|
@@ -5698,16 +5772,16 @@ var pi = class e {
|
|
|
5698
5772
|
let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families));
|
|
5699
5773
|
return n.addSlide(t), n;
|
|
5700
5774
|
}
|
|
5701
|
-
},
|
|
5775
|
+
}, Si = Object.freeze({
|
|
5702
5776
|
archiveEntryCount: 0,
|
|
5703
5777
|
declaredInflatedBytes: 0,
|
|
5704
5778
|
distinctInflatedBytes: 0,
|
|
5705
5779
|
operationInflatedBytes: 0
|
|
5706
|
-
}),
|
|
5707
|
-
function
|
|
5780
|
+
}), Ci = T;
|
|
5781
|
+
function wi(e, t) {
|
|
5708
5782
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5709
5783
|
}
|
|
5710
|
-
function
|
|
5784
|
+
function Ti(e, t) {
|
|
5711
5785
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5712
5786
|
let n = e;
|
|
5713
5787
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5717,7 +5791,7 @@ function _i(e, t) {
|
|
|
5717
5791
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5718
5792
|
});
|
|
5719
5793
|
}
|
|
5720
|
-
function
|
|
5794
|
+
function Ei(e, t) {
|
|
5721
5795
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap embedded font at ${t}`);
|
|
5722
5796
|
let n = e;
|
|
5723
5797
|
if (typeof n.fontName != "string" || n.fontName.length === 0 || ![
|
|
@@ -5733,11 +5807,11 @@ function vi(e, t) {
|
|
|
5733
5807
|
contentType: n.contentType
|
|
5734
5808
|
});
|
|
5735
5809
|
}
|
|
5736
|
-
function
|
|
5810
|
+
function Di(e) {
|
|
5737
5811
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5738
5812
|
let t = e;
|
|
5739
5813
|
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.embeddedFonts) || !Array.isArray(t.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
|
|
5740
|
-
return
|
|
5814
|
+
return wi(t.defaultTextColor, "defaultTextColor"), wi(t.majorFont, "majorFont"), wi(t.minorFont, "minorFont"), wi(t.hlinkColor, "hlinkColor"), wi(t.folHlinkColor, "folHlinkColor"), Object.freeze({
|
|
5741
5815
|
slideCount: t.slideCount,
|
|
5742
5816
|
slideWidth: t.slideWidth,
|
|
5743
5817
|
slideHeight: t.slideHeight,
|
|
@@ -5746,11 +5820,11 @@ function yi(e) {
|
|
|
5746
5820
|
minorFont: t.minorFont,
|
|
5747
5821
|
hlinkColor: t.hlinkColor,
|
|
5748
5822
|
folHlinkColor: t.folHlinkColor,
|
|
5749
|
-
embeddedFonts: Object.freeze(t.embeddedFonts.map(
|
|
5750
|
-
slides: Object.freeze(t.slides.map(
|
|
5823
|
+
embeddedFonts: Object.freeze(t.embeddedFonts.map(Ei)),
|
|
5824
|
+
slides: Object.freeze(t.slides.map(Ti))
|
|
5751
5825
|
});
|
|
5752
5826
|
}
|
|
5753
|
-
function
|
|
5827
|
+
function Oi(e) {
|
|
5754
5828
|
return Object.freeze({
|
|
5755
5829
|
type: "media",
|
|
5756
5830
|
x: e.x,
|
|
@@ -5767,7 +5841,7 @@ function bi(e) {
|
|
|
5767
5841
|
mimeType: e.mimeType
|
|
5768
5842
|
});
|
|
5769
5843
|
}
|
|
5770
|
-
function
|
|
5844
|
+
function ki(e) {
|
|
5771
5845
|
return Object.freeze({
|
|
5772
5846
|
...e.id === void 0 ? {} : { id: e.id },
|
|
5773
5847
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
@@ -5777,10 +5851,10 @@ function xi(e) {
|
|
|
5777
5851
|
text: e.text
|
|
5778
5852
|
});
|
|
5779
5853
|
}
|
|
5780
|
-
function
|
|
5854
|
+
function Ai(e) {
|
|
5781
5855
|
return Object.freeze({ ...e });
|
|
5782
5856
|
}
|
|
5783
|
-
function
|
|
5857
|
+
function ji(e) {
|
|
5784
5858
|
return Object.freeze({
|
|
5785
5859
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
5786
5860
|
...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
|
|
@@ -5790,16 +5864,16 @@ function Ci(e) {
|
|
|
5790
5864
|
...e.date === void 0 ? {} : { date: e.date },
|
|
5791
5865
|
...e.x === void 0 ? {} : { x: e.x },
|
|
5792
5866
|
...e.y === void 0 ? {} : { y: e.y },
|
|
5793
|
-
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(
|
|
5867
|
+
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Ai)) } : {},
|
|
5794
5868
|
...e.status === void 0 ? {} : { status: e.status },
|
|
5795
5869
|
text: e.text,
|
|
5796
|
-
...e.replies?.length ? { replies: Object.freeze(e.replies.map(
|
|
5870
|
+
...e.replies?.length ? { replies: Object.freeze(e.replies.map(ki)) } : {}
|
|
5797
5871
|
});
|
|
5798
5872
|
}
|
|
5799
|
-
function
|
|
5873
|
+
function Mi(e, t, n) {
|
|
5800
5874
|
if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
|
|
5801
5875
|
}
|
|
5802
|
-
function
|
|
5876
|
+
function Ni(e, t) {
|
|
5803
5877
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
|
|
5804
5878
|
let n = e;
|
|
5805
5879
|
for (let e of [
|
|
@@ -5808,16 +5882,16 @@ function Ti(e, t) {
|
|
|
5808
5882
|
"author",
|
|
5809
5883
|
"date",
|
|
5810
5884
|
"status"
|
|
5811
|
-
])
|
|
5885
|
+
]) Mi(n[e], e, t);
|
|
5812
5886
|
if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
|
|
5813
5887
|
if (n.status !== void 0 && ![
|
|
5814
5888
|
"active",
|
|
5815
5889
|
"resolved",
|
|
5816
5890
|
"closed"
|
|
5817
5891
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
|
|
5818
|
-
return
|
|
5892
|
+
return ki(n);
|
|
5819
5893
|
}
|
|
5820
|
-
function
|
|
5894
|
+
function Pi(e, t) {
|
|
5821
5895
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
|
|
5822
5896
|
let n = e;
|
|
5823
5897
|
for (let e of [
|
|
@@ -5826,7 +5900,7 @@ function Ei(e, t) {
|
|
|
5826
5900
|
"author",
|
|
5827
5901
|
"date",
|
|
5828
5902
|
"status"
|
|
5829
|
-
])
|
|
5903
|
+
]) Mi(n[e], e, t);
|
|
5830
5904
|
for (let e of [
|
|
5831
5905
|
"authorId",
|
|
5832
5906
|
"index",
|
|
@@ -5842,23 +5916,23 @@ function Ei(e, t) {
|
|
|
5842
5916
|
"resolved",
|
|
5843
5917
|
"closed"
|
|
5844
5918
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
|
|
5845
|
-
return
|
|
5919
|
+
return ji({
|
|
5846
5920
|
...n,
|
|
5847
|
-
...n.anchors?.length ? { anchors: n.anchors.map((e) =>
|
|
5848
|
-
...n.replies?.length ? { replies: n.replies.map((e) =>
|
|
5921
|
+
...n.anchors?.length ? { anchors: n.anchors.map((e) => Fi(e, t)) } : {},
|
|
5922
|
+
...n.replies?.length ? { replies: n.replies.map((e) => Ni(e, t)) } : {}
|
|
5849
5923
|
});
|
|
5850
5924
|
}
|
|
5851
|
-
function
|
|
5925
|
+
function Fi(e, t) {
|
|
5852
5926
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
|
|
5853
5927
|
let n = e;
|
|
5854
5928
|
if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
|
|
5855
|
-
if (n.type === "drawingElement") return
|
|
5929
|
+
if (n.type === "drawingElement") return Mi(n.elementId, "anchor.elementId", t), Mi(n.creationId, "anchor.creationId", t), Object.freeze({
|
|
5856
5930
|
type: "drawingElement",
|
|
5857
5931
|
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
5858
5932
|
...n.creationId === void 0 ? {} : { creationId: n.creationId }
|
|
5859
5933
|
});
|
|
5860
5934
|
if (n.type === "textRange") {
|
|
5861
|
-
|
|
5935
|
+
Mi(n.elementId, "anchor.elementId", t);
|
|
5862
5936
|
for (let e of ["start", "length"]) {
|
|
5863
5937
|
let r = n[e];
|
|
5864
5938
|
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
|
|
@@ -5872,7 +5946,7 @@ function Di(e, t) {
|
|
|
5872
5946
|
}
|
|
5873
5947
|
throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
|
|
5874
5948
|
}
|
|
5875
|
-
function
|
|
5949
|
+
function Ii(e, t) {
|
|
5876
5950
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5877
5951
|
let n = e;
|
|
5878
5952
|
for (let e of [
|
|
@@ -5883,13 +5957,13 @@ function Oi(e, t) {
|
|
|
5883
5957
|
"rotation"
|
|
5884
5958
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5885
5959
|
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}`);
|
|
5886
|
-
return
|
|
5960
|
+
return Oi(n);
|
|
5887
5961
|
}
|
|
5888
|
-
function
|
|
5962
|
+
function Li(e, t) {
|
|
5889
5963
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5890
5964
|
let n = e;
|
|
5891
5965
|
if (!Number.isSafeInteger(n.slideCount) || (n.slideCount ?? -1) < 0 || !Number.isSafeInteger(n.slideWidth) || (n.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(n.slideHeight) || (n.slideHeight ?? 0) <= 0 || !Array.isArray(n.embeddedFonts) || !Array.isArray(n.slides) || (t ? n.slides.length > (n.slideCount ?? -1) : n.slides.length !== n.slideCount) || !Array.isArray(n.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
|
|
5892
|
-
|
|
5966
|
+
wi(n.defaultTextColor, "defaultTextColor"), wi(n.majorFont, "majorFont"), wi(n.minorFont, "minorFont"), wi(n.hlinkColor, "hlinkColor"), wi(n.folHlinkColor, "folHlinkColor");
|
|
5893
5967
|
let r = n.slides.map((e, t) => {
|
|
5894
5968
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
|
|
5895
5969
|
let n = e;
|
|
@@ -5899,8 +5973,8 @@ function ki(e, t) {
|
|
|
5899
5973
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5900
5974
|
notes: n.notes,
|
|
5901
5975
|
hidden: n.hidden,
|
|
5902
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5903
|
-
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) =>
|
|
5976
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => Ii(e, t))),
|
|
5977
|
+
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Pi(e, t))) } : {}
|
|
5904
5978
|
});
|
|
5905
5979
|
}), i = n.fontPreloadNames.map((e, t) => {
|
|
5906
5980
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5915,37 +5989,37 @@ function ki(e, t) {
|
|
|
5915
5989
|
minorFont: n.minorFont,
|
|
5916
5990
|
hlinkColor: n.hlinkColor,
|
|
5917
5991
|
folHlinkColor: n.folHlinkColor,
|
|
5918
|
-
embeddedFonts: Object.freeze(n.embeddedFonts.map(
|
|
5992
|
+
embeddedFonts: Object.freeze(n.embeddedFonts.map(Ei)),
|
|
5919
5993
|
slides: Object.freeze(r),
|
|
5920
5994
|
fontPreloadNames: Object.freeze(i)
|
|
5921
5995
|
});
|
|
5922
5996
|
}
|
|
5923
|
-
function
|
|
5924
|
-
return
|
|
5997
|
+
function Ri(e) {
|
|
5998
|
+
return Li(e, !1);
|
|
5925
5999
|
}
|
|
5926
|
-
function
|
|
5927
|
-
return
|
|
6000
|
+
function zi(e) {
|
|
6001
|
+
return Li(e, !0);
|
|
5928
6002
|
}
|
|
5929
|
-
function
|
|
6003
|
+
function Bi(e, t) {
|
|
5930
6004
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5931
6005
|
if (e.mediaPath === t) return e.mimeType;
|
|
5932
6006
|
if (e.posterPath === t) return e.posterMimeType;
|
|
5933
6007
|
}
|
|
5934
6008
|
return "";
|
|
5935
6009
|
}
|
|
5936
|
-
function
|
|
6010
|
+
function Vi(e, t) {
|
|
5937
6011
|
if (e.index !== t.index || e.partName !== t.partName) throw Error(`PPTX pulled slide identity does not match bootstrap index ${t.index}`);
|
|
5938
6012
|
return Object.freeze({
|
|
5939
6013
|
index: t.index,
|
|
5940
6014
|
...t.partName === void 0 ? {} : { partName: t.partName },
|
|
5941
6015
|
notes: e.notes ?? null,
|
|
5942
6016
|
hidden: e.hidden ?? !1,
|
|
5943
|
-
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(
|
|
5944
|
-
...e.comments?.length ? { comments: Object.freeze(e.comments.map(
|
|
6017
|
+
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(Oi)),
|
|
6018
|
+
...e.comments?.length ? { comments: Object.freeze(e.comments.map(ji)) } : {}
|
|
5945
6019
|
});
|
|
5946
6020
|
}
|
|
5947
|
-
function
|
|
5948
|
-
if (!(e <= t)) throw new
|
|
6021
|
+
function Hi(e, t, n) {
|
|
6022
|
+
if (!(e <= t)) throw new j(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
|
|
5949
6023
|
stage: "parsing",
|
|
5950
6024
|
violation: {
|
|
5951
6025
|
format: "pptx",
|
|
@@ -5959,7 +6033,7 @@ function Pi(e, t, n) {
|
|
|
5959
6033
|
}
|
|
5960
6034
|
});
|
|
5961
6035
|
}
|
|
5962
|
-
var
|
|
6036
|
+
var Ui = class {
|
|
5963
6037
|
slideCountValue;
|
|
5964
6038
|
slideWidthValue;
|
|
5965
6039
|
slideHeightValue;
|
|
@@ -5979,9 +6053,9 @@ var Fi = class {
|
|
|
5979
6053
|
pending = null;
|
|
5980
6054
|
finished = null;
|
|
5981
6055
|
constructor(e, t = {}) {
|
|
5982
|
-
let n =
|
|
5983
|
-
if (!Number.isSafeInteger(r) || r <= 0 || r >
|
|
5984
|
-
this.limit = r, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new
|
|
6056
|
+
let n = Di(e), r = t.hardLimitForTesting ?? Ci;
|
|
6057
|
+
if (!Number.isSafeInteger(r) || r <= 0 || r > Ci) throw Error("invalid PPTX presentation preflight test limit");
|
|
6058
|
+
this.limit = r, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new xi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Ze(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Ze({
|
|
5985
6059
|
slideCount: this.slideCountValue,
|
|
5986
6060
|
slideWidth: this.slideWidthValue,
|
|
5987
6061
|
slideHeight: this.slideHeightValue,
|
|
@@ -5994,7 +6068,7 @@ var Fi = class {
|
|
|
5994
6068
|
remainingSlides: this.descriptors,
|
|
5995
6069
|
slides: [],
|
|
5996
6070
|
fontPreloadNames: this.fontPreloadNames
|
|
5997
|
-
}, this.limit).jsonBytes,
|
|
6071
|
+
}, this.limit).jsonBytes, Hi(this.projectionBytesValue, this.limit, Si);
|
|
5998
6072
|
}
|
|
5999
6073
|
get acceptedSlideCount() {
|
|
6000
6074
|
return this.finished?.slideCount ?? this.slides.length;
|
|
@@ -6028,21 +6102,21 @@ var Fi = class {
|
|
|
6028
6102
|
fontPreloadNames: this.fontPreloadNames
|
|
6029
6103
|
});
|
|
6030
6104
|
}
|
|
6031
|
-
addSlide(e, t =
|
|
6105
|
+
addSlide(e, t = Si) {
|
|
6032
6106
|
this.prepareSlide(e, t).commit();
|
|
6033
6107
|
}
|
|
6034
|
-
prepareSlide(e, t =
|
|
6108
|
+
prepareSlide(e, t = Si) {
|
|
6035
6109
|
if (this.finished) throw Error("PPTX presentation preflight is already finished");
|
|
6036
6110
|
if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
|
|
6037
6111
|
let n = this.slides.length, r = this.descriptors[n];
|
|
6038
6112
|
if (!r) throw Error("PPTX presentation preflight received an extra slide");
|
|
6039
|
-
let i =
|
|
6040
|
-
l =
|
|
6041
|
-
let u =
|
|
6113
|
+
let i = Vi(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = Ze(o, this.limit).jsonBytes, c = Ze(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - Ze(r, this.limit).jsonBytes + 4;
|
|
6114
|
+
l = Qe(l, s, this.limit), l = Qe(l, c, this.limit), this.slides.length !== 0 && (l = Qe(l, 1, this.limit));
|
|
6115
|
+
let u = Ze({
|
|
6042
6116
|
slide: i,
|
|
6043
6117
|
fontPreloadNames: o
|
|
6044
|
-
}, this.limit).jsonBytes, d =
|
|
6045
|
-
|
|
6118
|
+
}, this.limit).jsonBytes, d = Qe(this.projectionBytesValue, u, this.limit);
|
|
6119
|
+
Hi(Math.max(d, l), this.limit, t);
|
|
6046
6120
|
let f = {
|
|
6047
6121
|
state: "prepared",
|
|
6048
6122
|
fact: i,
|
|
@@ -6085,9 +6159,9 @@ var Fi = class {
|
|
|
6085
6159
|
embeddedFonts: this.embeddedFontsValue,
|
|
6086
6160
|
slides: Object.freeze([...this.slides]),
|
|
6087
6161
|
fontPreloadNames: this.fontPreloadNames
|
|
6088
|
-
}), this.descriptors = [], this.slides = [], this.projectionBytesValue =
|
|
6162
|
+
}), this.descriptors = [], this.slides = [], this.projectionBytesValue = Ze(this.finished, this.limit).jsonBytes, this.finished;
|
|
6089
6163
|
}
|
|
6090
|
-
},
|
|
6164
|
+
}, Wi = 1024 * 1024, Gi = class {
|
|
6091
6165
|
active = /* @__PURE__ */ new Set();
|
|
6092
6166
|
nextSessionId = 1;
|
|
6093
6167
|
constructor(e) {
|
|
@@ -6100,7 +6174,7 @@ var Fi = class {
|
|
|
6100
6174
|
sessionId: r,
|
|
6101
6175
|
operationId: r,
|
|
6102
6176
|
generation: this.options.generation ?? 1
|
|
6103
|
-
}, a = new
|
|
6177
|
+
}, a = new p(this.options.transport, {
|
|
6104
6178
|
...i,
|
|
6105
6179
|
maxByteCredit: w,
|
|
6106
6180
|
timeoutMs: n
|
|
@@ -6108,7 +6182,7 @@ var Fi = class {
|
|
|
6108
6182
|
this.active.add(a);
|
|
6109
6183
|
try {
|
|
6110
6184
|
await this.options.open(e, i, n);
|
|
6111
|
-
let r = await
|
|
6185
|
+
let r = await qi(a);
|
|
6112
6186
|
try {
|
|
6113
6187
|
let e = r.usage ?? a.usageCheckpoint;
|
|
6114
6188
|
e && this.options.onUsage?.(e);
|
|
@@ -6131,20 +6205,20 @@ var Fi = class {
|
|
|
6131
6205
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
6132
6206
|
}
|
|
6133
6207
|
};
|
|
6134
|
-
function
|
|
6208
|
+
function Ki(e) {
|
|
6135
6209
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
6136
6210
|
}
|
|
6137
|
-
async function
|
|
6211
|
+
async function qi(e) {
|
|
6138
6212
|
try {
|
|
6139
|
-
return await e.pull(
|
|
6213
|
+
return await e.pull(Wi);
|
|
6140
6214
|
} catch (t) {
|
|
6141
|
-
let n =
|
|
6215
|
+
let n = Ji(t);
|
|
6142
6216
|
if (n === void 0) throw t;
|
|
6143
6217
|
return e.pull(n);
|
|
6144
6218
|
}
|
|
6145
6219
|
}
|
|
6146
|
-
function
|
|
6147
|
-
return
|
|
6220
|
+
function Ji(e) {
|
|
6221
|
+
return ne(e, Wi, w);
|
|
6148
6222
|
}
|
|
6149
6223
|
//#endregion
|
|
6150
|
-
export {
|
|
6224
|
+
export { Di as a, _i as c, hi as d, on as f, Bi as i, fi as l, Ki as n, Ri as o, Ui as r, zi as s, Gi as t, mi as u };
|