@silurus/ooxml 0.85.2 → 0.85.3
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-CV9Mg4j9.js → render-worker-D1O73gYW.js} +3 -3
- package/dist/assets/render-worker-V2wWYA4O.js +11 -0
- package/dist/{document-pull-client-BssAk95w.js → document-pull-client-F3ox_VXK.js} +3079 -3078
- package/dist/{docx-BY7oyoml.js → docx-BYvm3TWw.js} +6 -3
- package/dist/docx.mjs +1 -1
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +2 -2
- package/dist/node.mjs +5 -5
- package/dist/{pptx-C4z96sAA.js → pptx-BqpVTP8p.js} +6 -3
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-Dxvwes39.js → render-DeZpRCfx.js} +1 -1
- package/dist/{render-worker-host-CXTCU4PO.js → render-worker-host-BKtXmlEF.js} +1 -1
- package/dist/{render-worker-host-BAXcBGq3.js → render-worker-host-CBcQXsR5.js} +1 -1
- package/dist/{session-BmP4lcEo.js → session-n2p5_jxV.js} +1 -1
- package/dist/{slide-pull-client-RTwQbJiy.js → slide-pull-client-Dwek7xW8.js} +683 -675
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-DdvOGyrn.js +0 -11
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Et as s, Ft as c, Ht as l, It as u, J as d, Lt as f, M as p, Mt as m, N as h, Nt as g, O as _, Ot as v, Pt as y, Rt as b, S as x, St as S, Tt as C, Vt as w, Wt as T, Xt as E, Yt as D, _ as O, _t as k, at as A, bt as j, c as M, cn as N, ct as P, d as F, dt as I, et as L, f as R, g as z, gt as B, h as V, i as H, it as U, j as ee, jt as W, lt as
|
|
2
|
-
import { a as
|
|
3
|
-
import { A as
|
|
4
|
-
import { l as
|
|
5
|
-
import { r as
|
|
6
|
-
import { A as
|
|
7
|
-
import { k as
|
|
8
|
-
import { s as
|
|
9
|
-
import { a as
|
|
1
|
+
import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Et as s, Ft as c, Ht as l, It as u, J as d, Lt as f, M as p, Mt as m, N as h, Nt as g, O as _, Ot as v, Pt as y, Rt as b, S as x, St as S, Tt as C, Vt as w, Wt as T, Xt as E, Yt as D, _ as O, _t as k, at as A, bt as j, c as M, cn as N, ct as P, d as F, dt as I, et as L, f as R, g as z, gt as B, h as V, i as H, it as U, j as ee, jt as W, lt as G, m as K, mt as q, n as J, nt as te, p as ne, r as re, rt as ie, s as ae, tt as oe, u as se, w as ce, wt as le, xt as ue, y as de, zt as fe } from "./line-metrics-BGtFM-ec.js";
|
|
2
|
+
import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-BsV4MVZ2.js";
|
|
3
|
+
import { A as Te, D as Ee, S as De, _ as Oe, h as ke, hn as Ae, in as je, j as Me, on as Ne, sn as Pe, v as Fe, w as Ie } from "./plot-area-frame-D5hEOgkJ.js";
|
|
4
|
+
import { l as Le } from "./pixel-budget-Dgjw269h.js";
|
|
5
|
+
import { r as Y } from "./units-EJdC96r6.js";
|
|
6
|
+
import { A as Re, F as ze, I as Be, L as Ve, M as He, N as Ue, P as We, j as Ge } from "./three-d-YYghQndN.js";
|
|
7
|
+
import { k as Ke } from "./renderer-XFSCOT6m.js";
|
|
8
|
+
import { s as qe } from "./raster-target-ojDdQizC.js";
|
|
9
|
+
import { a as Je, i as Ye, n as Xe, t as Ze } from "./resource-measurement-D41R-0Bl.js";
|
|
10
10
|
//#region packages/pptx/src/types.ts
|
|
11
|
-
function
|
|
11
|
+
function Qe(e) {
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var $e = {
|
|
15
15
|
textarchdown: {
|
|
16
16
|
adj: [["adj", "val 0"]],
|
|
17
17
|
gd: [
|
|
@@ -2393,22 +2393,22 @@ var et = {
|
|
|
2393
2393
|
]
|
|
2394
2394
|
}]
|
|
2395
2395
|
}
|
|
2396
|
-
},
|
|
2397
|
-
function
|
|
2398
|
-
return e.toLowerCase() in
|
|
2396
|
+
}, et = Math.PI * 2 / 216e5, tt = $e, nt = /* @__PURE__ */ new Map();
|
|
2397
|
+
function rt(e) {
|
|
2398
|
+
return e.toLowerCase() in tt;
|
|
2399
2399
|
}
|
|
2400
|
-
function
|
|
2401
|
-
let t =
|
|
2400
|
+
function it(e) {
|
|
2401
|
+
let t = nt.get(e);
|
|
2402
2402
|
if (t) return t;
|
|
2403
|
-
let n =
|
|
2403
|
+
let n = tt[e];
|
|
2404
2404
|
return n ? (t = {
|
|
2405
2405
|
adj: n.adj.map(([e, t]) => [e, y(t)]),
|
|
2406
2406
|
gd: n.gd.map(([e, t]) => [e, y(t)]),
|
|
2407
2407
|
paths: n.paths
|
|
2408
|
-
},
|
|
2408
|
+
}, nt.set(e, t), t) : null;
|
|
2409
2409
|
}
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2410
|
+
var at = 48;
|
|
2411
|
+
function ot(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 st(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 <= at; t++) {
|
|
2429
|
+
let n = t / at, 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 st(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 <= at; t++) {
|
|
2441
|
+
let n = t / at, 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 st(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]) * et, f = t.resolve(n[4]) * et, 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(at, 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 st(e, t, n, r) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return c;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function st(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 ct(e) {
|
|
|
2473
2473
|
}
|
|
2474
2474
|
return t;
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2477
|
-
let i =
|
|
2476
|
+
function ct(e, t, n, r) {
|
|
2477
|
+
let i = it(e.toLowerCase());
|
|
2478
2478
|
if (!i || i.paths.length === 0) return null;
|
|
2479
2479
|
let a = c({
|
|
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 = ot(i.paths[0], a, n, r), l = o ? s : ot(i.paths[i.paths.length - 1], a, n, r);
|
|
2484
2484
|
return {
|
|
2485
2485
|
top: s,
|
|
2486
2486
|
bottom: l,
|
|
2487
|
-
topLen:
|
|
2488
|
-
bottomLen:
|
|
2487
|
+
topLen: st(s),
|
|
2488
|
+
bottomLen: st(l),
|
|
2489
2489
|
singleEdge: o
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2492
|
+
function lt(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 ut(e, t, n) {
|
|
|
2510
2510
|
ty: f / p
|
|
2511
2511
|
};
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2513
|
+
function ut(e) {
|
|
2514
2514
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function dt(e, t) {
|
|
2517
2517
|
if (!e.singleEdge) return 1;
|
|
2518
|
-
let n =
|
|
2518
|
+
let n = ut(e);
|
|
2519
2519
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function ft(e, t, n, r) {
|
|
2522
2522
|
if (e.singleEdge) {
|
|
2523
|
-
let i =
|
|
2523
|
+
let i = lt(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 pt(e, t, n, r) {
|
|
|
2529
2529
|
shear: 0
|
|
2530
2530
|
};
|
|
2531
2531
|
}
|
|
2532
|
-
let i =
|
|
2532
|
+
let i = lt(e.top, e.topLen, t), a = lt(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 pt(e, t, n, r) {
|
|
|
2540
2540
|
}
|
|
2541
2541
|
//#endregion
|
|
2542
2542
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2543
|
-
var
|
|
2543
|
+
var pt = 26, mt = {
|
|
2544
2544
|
orthographicFront: {
|
|
2545
2545
|
kind: "orthographic",
|
|
2546
2546
|
baseLat: 0,
|
|
@@ -2553,52 +2553,52 @@ var mt = 26, ht = {
|
|
|
2553
2553
|
baseLat: 0,
|
|
2554
2554
|
baseLon: 0,
|
|
2555
2555
|
baseRev: 0,
|
|
2556
|
-
fovDeg:
|
|
2556
|
+
fovDeg: pt
|
|
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: pt
|
|
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: pt
|
|
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: pt
|
|
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: pt
|
|
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: pt
|
|
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: pt
|
|
2599
2599
|
}
|
|
2600
2600
|
};
|
|
2601
|
-
function
|
|
2601
|
+
function ht(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 gt(e, t) {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
return n;
|
|
2609
2609
|
}
|
|
2610
|
-
function
|
|
2610
|
+
function gt(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 _t(e) {
|
|
|
2621
2621
|
n
|
|
2622
2622
|
];
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2624
|
+
function _t(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 vt(e) {
|
|
|
2635
2635
|
n
|
|
2636
2636
|
];
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function vt(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 yt(e) {
|
|
|
2649
2649
|
1
|
|
2650
2650
|
];
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2652
|
+
function yt(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 bt(e, t) {
|
|
2660
2660
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2661
|
-
return
|
|
2661
|
+
return ht(vt(-(t ? t.rev : e.baseRev)), ht(gt(-n), _t(-r)));
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2663
|
+
function xt(e) {
|
|
2664
|
+
return mt[e] || (e.startsWith("perspective") ? mt.perspectiveFront : mt.orthographicFront);
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2667
|
-
let r =
|
|
2666
|
+
function St(e, t, n) {
|
|
2667
|
+
let r = xt(e.prst), i = bt(r, e.rot);
|
|
2668
2668
|
if (t <= 0 || n <= 0) return {
|
|
2669
2669
|
corners: [
|
|
2670
2670
|
{
|
|
@@ -2696,11 +2696,11 @@ function Ct(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] = yt(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] = yt(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 Ct(e, t, n) {
|
|
|
2723
2723
|
isIdentity: _
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
let { isIdentity: t } =
|
|
2726
|
+
function Ct(e) {
|
|
2727
|
+
let { isIdentity: t } = St(e, 1e3, 1e3);
|
|
2728
2728
|
return !t;
|
|
2729
2729
|
}
|
|
2730
|
-
function
|
|
2731
|
-
let i =
|
|
2730
|
+
function wt(e, t, n, r) {
|
|
2731
|
+
let i = xt(e.prst), a = bt(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] = yt(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 Tt(e, t, n, r) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
//#endregion
|
|
2750
2750
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2751
|
-
function
|
|
2751
|
+
function Tt(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 = Nt;
|
|
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 Et(e, t) {
|
|
|
2773
2773
|
};
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function Et(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 Dt(e) {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
return n;
|
|
2793
2793
|
}
|
|
2794
|
-
function
|
|
2794
|
+
function Dt(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 Ot(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 Ot(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 kt(e, t, n, r, i, a) {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2823
|
+
function kt(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 Dt(r, 3)) {
|
|
2828
2828
|
let r = Math.max(1, (e - 1) / 2);
|
|
2829
|
-
|
|
2829
|
+
Ot(i, a, t, n, r, !0), Ot(a, i, t, n, r, !1);
|
|
2830
2830
|
}
|
|
2831
2831
|
return i;
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2833
|
+
function At(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 = Et(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 = Et(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 jt(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 jt = .25, Mt = .35, Nt = .5;
|
|
2858
|
+
function Pt(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 = At(e, t, n), u = Tt(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = kt(l, t, n, Math.max(1, r * jt)), 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 Ft(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 - Mt, v = 1;
|
|
2881
2881
|
if (g > _) {
|
|
2882
|
-
let e = Math.min(1, (g - _) /
|
|
2882
|
+
let e = Math.min(1, (g - _) / Mt);
|
|
2883
2883
|
v = 1 - e * e * (3 - 2 * e);
|
|
2884
2884
|
}
|
|
2885
2885
|
c[a] = v;
|
|
@@ -2894,7 +2894,7 @@ function Ft(e, t, n, r, i, a) {
|
|
|
2894
2894
|
bandWeight: c
|
|
2895
2895
|
};
|
|
2896
2896
|
}
|
|
2897
|
-
var
|
|
2897
|
+
var Ft = 35 * Math.PI / 180, It = 12 * Math.PI / 180, Lt = {
|
|
2898
2898
|
t: {
|
|
2899
2899
|
x: 0,
|
|
2900
2900
|
y: -1
|
|
@@ -2928,22 +2928,22 @@ var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
|
|
|
2928
2928
|
y: 1
|
|
2929
2929
|
}
|
|
2930
2930
|
};
|
|
2931
|
-
function
|
|
2931
|
+
function Rt(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 zt(e, t, n) {
|
|
2939
|
+
let r = Lt[t] ?? Lt.t;
|
|
2940
|
+
return n && n.rev && (r = Rt(r.x, r.y, n.rev)), Vt(r.x, r.y, Ft);
|
|
2941
2941
|
}
|
|
2942
|
-
function
|
|
2942
|
+
function Bt(e) {
|
|
2943
2943
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
2944
|
-
return
|
|
2944
|
+
return Vt(-e.x / t, -e.y / t, It);
|
|
2945
2945
|
}
|
|
2946
|
-
function
|
|
2946
|
+
function Vt(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 Ht(e, t, n) {
|
|
|
2951
2951
|
z: c / l
|
|
2952
2952
|
};
|
|
2953
2953
|
}
|
|
2954
|
-
var
|
|
2954
|
+
var Ht = 2, Ut = {
|
|
2955
2955
|
matte: {
|
|
2956
2956
|
ambient: .62,
|
|
2957
2957
|
diffuse: .45,
|
|
@@ -2964,8 +2964,8 @@ var Ut = 2, Wt = {
|
|
|
2964
2964
|
specular: .35,
|
|
2965
2965
|
shininess: 22
|
|
2966
2966
|
}
|
|
2967
|
-
},
|
|
2968
|
-
function
|
|
2967
|
+
}, Wt = .8;
|
|
2968
|
+
function Gt(e) {
|
|
2969
2969
|
switch (e) {
|
|
2970
2970
|
case "plastic":
|
|
2971
2971
|
case "metal":
|
|
@@ -2976,8 +2976,8 @@ function Kt(e) {
|
|
|
2976
2976
|
default: return "matte";
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2980
|
-
let r =
|
|
2979
|
+
function Kt(e, t, n = !0) {
|
|
2980
|
+
let r = Ut[e], i = {
|
|
2981
2981
|
light: t,
|
|
2982
2982
|
material: e,
|
|
2983
2983
|
ambient: r.ambient,
|
|
@@ -2985,9 +2985,9 @@ function qt(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 = Bt(t), i.fillDiffuse = i.diffuse * Wt), i;
|
|
2989
2989
|
}
|
|
2990
|
-
function
|
|
2990
|
+
function qt(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 Jt(e, t) {
|
|
|
3000
3000
|
}
|
|
3001
3001
|
return Math.max(0, t.ambient + r + i + a);
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3003
|
+
function Jt(e, t, n) {
|
|
3004
3004
|
if (!e) return {
|
|
3005
3005
|
x: 0,
|
|
3006
3006
|
y: 0,
|
|
@@ -3015,16 +3015,16 @@ function Yt(e, t, n) {
|
|
|
3015
3015
|
h: Math.max(0, o - i)
|
|
3016
3016
|
};
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3018
|
+
function Yt(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 } = Jt(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 } = Pt(f, c, l, a, t.prst, t.heightPx), g = Kt(t.material, t.light), _ = qt({
|
|
3028
3028
|
x: 0,
|
|
3029
3029
|
y: 0,
|
|
3030
3030
|
z: 1
|
|
@@ -3035,13 +3035,13 @@ function Xt(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 + (qt({
|
|
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) * Ht);
|
|
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 Xt(e, t, n) {
|
|
|
3050
3050
|
}
|
|
3051
3051
|
e.putImageData(u, o, s);
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3053
|
+
function Xt(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 } = Jt(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,7 +3079,7 @@ function Zt(e, t, n) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
//#endregion
|
|
3081
3081
|
//#region packages/core/src/text/underline.ts
|
|
3082
|
-
function
|
|
3082
|
+
function Zt(t, n, r, i, a, o, s, c = 1) {
|
|
3083
3083
|
let l = Math.max(1, a * .05), u = s === "heavy" || (s?.endsWith("Heavy") ?? !1) ? l * 1.8 : l, d = r + Math.max(2, u), f = e(d, u, c);
|
|
3084
3084
|
if (t.strokeStyle = o, t.lineWidth = u, t.setLineDash([]), s && s.startsWith("wavy")) {
|
|
3085
3085
|
let e = u, r = u * 6;
|
|
@@ -3104,11 +3104,11 @@ function Qt(t, n, r, i, a, o, s, c = 1) {
|
|
|
3104
3104
|
t.beginPath(), t.moveTo(n, a + e(a, u, c)), t.lineTo(n + i, a + e(a, u, c)), t.moveTo(n, o + e(o, u, c)), t.lineTo(n + i, o + e(o, u, c)), t.stroke();
|
|
3105
3105
|
return;
|
|
3106
3106
|
}
|
|
3107
|
-
t.setLineDash(
|
|
3107
|
+
t.setLineDash(De(s ?? "sng", u)), t.beginPath(), t.moveTo(n, d + f), t.lineTo(n + i, d + f), t.stroke(), t.setLineDash([]);
|
|
3108
3108
|
}
|
|
3109
3109
|
//#endregion
|
|
3110
3110
|
//#region packages/core/src/text/highlight-box.ts
|
|
3111
|
-
function
|
|
3111
|
+
function Qt(e, t) {
|
|
3112
3112
|
return {
|
|
3113
3113
|
top: e - t * .85,
|
|
3114
3114
|
height: t * 1.1
|
|
@@ -3116,7 +3116,7 @@ function $t(e, t) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
//#endregion
|
|
3118
3118
|
//#region packages/core/src/text/justify-positions.ts
|
|
3119
|
-
function
|
|
3119
|
+
function $t(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 en(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 en = .5;
|
|
3133
|
+
function tn(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 / en) + 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,12 +3147,12 @@ function nn(e, t) {
|
|
|
3147
3147
|
}
|
|
3148
3148
|
return i;
|
|
3149
3149
|
}
|
|
3150
|
-
function
|
|
3151
|
-
for (let a of
|
|
3150
|
+
function nn(e, t, n, r, i) {
|
|
3151
|
+
for (let a of tn(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 rn(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 {
|
|
@@ -3160,7 +3160,7 @@ function an(e, t) {
|
|
|
3160
3160
|
ref: n ?? r
|
|
3161
3161
|
};
|
|
3162
3162
|
let i = n, a = H(i);
|
|
3163
|
-
return a !== null &&
|
|
3163
|
+
return a !== null && re.includes(a) ? {
|
|
3164
3164
|
kind: "external",
|
|
3165
3165
|
url: i
|
|
3166
3166
|
} : {
|
|
@@ -3170,7 +3170,7 @@ function an(e, t) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
//#endregion
|
|
3172
3172
|
//#region packages/pptx/src/media-chrome.ts
|
|
3173
|
-
function
|
|
3173
|
+
function an(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,18 +3184,18 @@ function on(e, t, n, r, i, a) {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
//#endregion
|
|
3186
3186
|
//#region packages/pptx/src/bidi-line.ts
|
|
3187
|
-
var
|
|
3187
|
+
var on = (e) => {
|
|
3188
3188
|
let t = e.text;
|
|
3189
3189
|
return typeof t == "string" ? t : void 0;
|
|
3190
|
-
},
|
|
3191
|
-
function
|
|
3190
|
+
}, sn = (e) => "isTab" in e;
|
|
3191
|
+
function cn(e) {
|
|
3192
3192
|
for (let t of e) {
|
|
3193
|
-
let e =
|
|
3193
|
+
let e = on(t);
|
|
3194
3194
|
if (e !== void 0 && ee(e)) return !0;
|
|
3195
3195
|
}
|
|
3196
3196
|
return !1;
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3198
|
+
function ln(e, n) {
|
|
3199
3199
|
let r = e.length;
|
|
3200
3200
|
if (r === 0) return {
|
|
3201
3201
|
order: [],
|
|
@@ -3204,8 +3204,8 @@ function un(e, n) {
|
|
|
3204
3204
|
let i = "", a = Array(r), o;
|
|
3205
3205
|
for (let t = 0; t < r; t++) {
|
|
3206
3206
|
a[t] = i.length;
|
|
3207
|
-
let n =
|
|
3208
|
-
if (i += n.length > 0 ? n : "",
|
|
3207
|
+
let n = on(e[t]) ?? "";
|
|
3208
|
+
if (i += n.length > 0 ? n : "", sn(e[t])) {
|
|
3209
3209
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3210
3210
|
o[a[t]] = "S";
|
|
3211
3211
|
}
|
|
@@ -3220,7 +3220,7 @@ function un(e, n) {
|
|
|
3220
3220
|
}
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3223
|
-
function
|
|
3223
|
+
function un(e, t, n, r, i = 0, a = !1) {
|
|
3224
3224
|
if (e.length === 0) return 0;
|
|
3225
3225
|
let s = t === 0, c = 0, l = t;
|
|
3226
3226
|
for (let t of e) {
|
|
@@ -3236,16 +3236,16 @@ function dn(e, t, n, r, i = 0, a = !1) {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
//#endregion
|
|
3238
3238
|
//#region packages/pptx/src/text-justify.ts
|
|
3239
|
-
var
|
|
3240
|
-
function
|
|
3239
|
+
var dn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3240
|
+
function fn(e, t, n, r, i) {
|
|
3241
3241
|
if (r === "just" && i) return null;
|
|
3242
3242
|
let a = t - n;
|
|
3243
3243
|
if (a <= .5) return null;
|
|
3244
|
-
let o =
|
|
3244
|
+
let o = Ce(e, a, {
|
|
3245
3245
|
firstContentSi: 0,
|
|
3246
3246
|
lastDrawnSi: e.length,
|
|
3247
|
-
isGapChar:
|
|
3248
|
-
isWhitespace:
|
|
3247
|
+
isGapChar: ce,
|
|
3248
|
+
isWhitespace: dn,
|
|
3249
3249
|
seaClusterGaps: r === "thaiDist"
|
|
3250
3250
|
});
|
|
3251
3251
|
if (!o) return null;
|
|
@@ -3266,7 +3266,7 @@ function pn(e, t, n, r, i) {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
//#endregion
|
|
3268
3268
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3269
|
-
function
|
|
3269
|
+
function pn(e) {
|
|
3270
3270
|
if (!e) return {
|
|
3271
3271
|
r: 0,
|
|
3272
3272
|
g: 0,
|
|
@@ -3283,37 +3283,37 @@ function mn(e) {
|
|
|
3283
3283
|
b: parseInt(t.slice(4, 6), 16)
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
|
-
function
|
|
3287
|
-
let t =
|
|
3286
|
+
function mn(e) {
|
|
3287
|
+
let t = pn(e);
|
|
3288
3288
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3289
3289
|
}
|
|
3290
|
-
function
|
|
3290
|
+
function hn(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 = mn(e.color), r = mn(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
|
|
3300
|
+
function gn(e) {
|
|
3301
3301
|
let t = P(e.length === 8 ? e.slice(0, 6) : e);
|
|
3302
3302
|
if (!t) return null;
|
|
3303
|
-
let n =
|
|
3303
|
+
let n = G(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 _n(e) {
|
|
3311
3311
|
if (!e) return null;
|
|
3312
|
-
if (e.fillType === "solid") return
|
|
3312
|
+
if (e.fillType === "solid") return gn(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: gn(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 vn(e) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return null;
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function vn(e) {
|
|
3326
3326
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let n =
|
|
3328
|
+
function yn(e, t) {
|
|
3329
|
+
let n = _n(e);
|
|
3330
3330
|
if (n === null || n >= .5) return null;
|
|
3331
|
-
let r =
|
|
3331
|
+
let r = gn(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 bn(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 xn(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 xn = () => !1;
|
|
3365
|
+
function Sn(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 Cn(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 Cn(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 wn(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 wn(e, t, n, r, i, a, o = "fill", s = xn) {
|
|
3382
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Sn(e, t, i), f = 0;
|
|
3383
3383
|
for (let o of t) {
|
|
3384
|
-
let t = o.codePointAt(0) ?? 0, l = R(t), p = e.measureText(o).width + a, m = l === "Tr" ?
|
|
3385
|
-
if (
|
|
3384
|
+
let t = o.codePointAt(0) ?? 0, l = R(t), p = e.measureText(o).width + a, m = l === "Tr" ? se(t) : null, h = l === "Tr" && m === null && K(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3385
|
+
if (ne(t) && s(t)) {
|
|
3386
3386
|
let t = n + f + p / 2;
|
|
3387
3387
|
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", M(e, () => u(o, 0, 0)), e.restore();
|
|
3388
3388
|
} else if (g) {
|
|
3389
|
-
let r = m === null && l === "Tu" ? F(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ?
|
|
3389
|
+
let r = m === null && l === "Tu" ? F(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Cn(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 Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
e.textAlign = c, e.textBaseline = l;
|
|
3398
3398
|
}
|
|
3399
|
-
function
|
|
3400
|
-
|
|
3399
|
+
function Tn(e, t, n, r, i, a, o = "fill") {
|
|
3400
|
+
wn(e, t, n, r, i, a, o, (t) => ae(e, t));
|
|
3401
3401
|
}
|
|
3402
3402
|
//#endregion
|
|
3403
3403
|
//#region packages/pptx/src/renderer.ts
|
|
3404
|
-
function
|
|
3404
|
+
function X(e, t) {
|
|
3405
3405
|
return e * t;
|
|
3406
3406
|
}
|
|
3407
|
-
function
|
|
3408
|
-
let i =
|
|
3407
|
+
function En(e, t, n, r) {
|
|
3408
|
+
let i = Pe(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
|
-
function
|
|
3415
|
-
return
|
|
3414
|
+
function Z(e, t) {
|
|
3415
|
+
return Ye(e, t);
|
|
3416
3416
|
}
|
|
3417
|
-
function
|
|
3417
|
+
function Dn(e, t) {
|
|
3418
3418
|
let n = e.targets.get(t);
|
|
3419
3419
|
return n ? {
|
|
3420
3420
|
targetWidthPx: n.width,
|
|
@@ -3422,11 +3422,11 @@ function On(e, t) {
|
|
|
3422
3422
|
maxRetainedPixels: n.maxRetainedPixels
|
|
3423
3423
|
} : void 0;
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3425
|
+
function On(e) {
|
|
3426
3426
|
return A(e) ? e.svgImagePath : e.imagePath;
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3429
|
-
let i =
|
|
3428
|
+
function kn(e, t, n, r) {
|
|
3429
|
+
let i = Qe(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) {
|
|
@@ -3434,10 +3434,10 @@ function An(e, t, n, r) {
|
|
|
3434
3434
|
break;
|
|
3435
3435
|
}
|
|
3436
3436
|
let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
|
|
3437
|
-
return Math.max(1, s *
|
|
3437
|
+
return Math.max(1, s * Y * n * r);
|
|
3438
3438
|
}
|
|
3439
|
-
async function
|
|
3440
|
-
let d =
|
|
3439
|
+
async function An(e, t, n, r, i, a, o, c, l, u) {
|
|
3440
|
+
let d = ue(a), f = [], p = [], m = (e, t, n, r, i, a = 1, o = i) => {
|
|
3441
3441
|
if (!(!t || !i)) {
|
|
3442
3442
|
if (C(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
|
|
3443
3443
|
f.push({
|
|
@@ -3458,35 +3458,35 @@ async function jn(e, t, n, r, i, a, o, c, l, u) {
|
|
|
3458
3458
|
}, h = e.background;
|
|
3459
3459
|
if (h?.fillType === "image" && h.imagePath && !h.tile && !h.duotone) {
|
|
3460
3460
|
let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), a = n * (1 - (e.t ?? 0) - (e.b ?? 0));
|
|
3461
|
-
m(
|
|
3461
|
+
m(Z(h.imagePath, h.duotone), En(r, a, i, h.srcRect), h.imagePath, h.mimeType, o, 1);
|
|
3462
3462
|
}
|
|
3463
|
-
for (let t of e.elements) if (t.type === "picture") !(A(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(
|
|
3463
|
+
for (let t of e.elements) if (t.type === "picture") !(A(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(Z(t.imagePath, t.duotone), En(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 = c ?
|
|
3466
|
-
m(
|
|
3465
|
+
let e = c ? qr(c) : void 0;
|
|
3466
|
+
m(Z(t.posterPath), En(X(t.width, r), X(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, l ?? e);
|
|
3467
3467
|
} else if (t.type === "chart") {
|
|
3468
3468
|
let e = {
|
|
3469
|
-
widthPt: t.width /
|
|
3470
|
-
heightPt: t.height /
|
|
3471
|
-
targetWidthPx:
|
|
3472
|
-
targetHeightPx:
|
|
3469
|
+
widthPt: t.width / Y,
|
|
3470
|
+
heightPt: t.height / Y,
|
|
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 =
|
|
3474
|
+
for (let n of Te(t.chart)) {
|
|
3475
|
+
let t = n.fill, r = Ee(n, e);
|
|
3476
3476
|
!(t.mimeType === "image/svg+xml" || A({
|
|
3477
3477
|
svgImagePath: t.svgImagePath,
|
|
3478
3478
|
srcRect: n.hasSourceCrop ? !0 : null
|
|
3479
|
-
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(
|
|
3479
|
+
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(Z(t.imagePath, t.duotone), {
|
|
3480
3480
|
targetWidthPx: r.targetWidthPx,
|
|
3481
3481
|
targetHeightPx: r.targetHeightPx
|
|
3482
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 = Qe(e.bullet);
|
|
3486
3486
|
if (n.type !== "blip") continue;
|
|
3487
|
-
let a =
|
|
3487
|
+
let a = kn(t.textBody, e, r, i);
|
|
3488
3488
|
!a || !o || p.push(B(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && s(e.format, u !== void 0) ? {
|
|
3489
|
-
key:
|
|
3489
|
+
key: Z(n.imagePath),
|
|
3490
3490
|
targetWidthPx: a * e.dimensions.width / e.dimensions.height,
|
|
3491
3491
|
targetHeightPx: a,
|
|
3492
3492
|
sourceWidthPx: e.dimensions.width,
|
|
@@ -3495,25 +3495,25 @@ async function jn(e, t, n, r, i, a, o, c, l, u) {
|
|
|
3495
3495
|
}
|
|
3496
3496
|
return f.push(...(await Promise.all(p)).filter((e) => e !== null)), S(f, d);
|
|
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 jn(e) {
|
|
3499
|
+
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Te(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => Qe(e.bullet).type === "blip"));
|
|
3500
3500
|
}
|
|
3501
|
-
var
|
|
3502
|
-
function
|
|
3503
|
-
let { top: s, height: c } =
|
|
3501
|
+
var Q = Oe;
|
|
3502
|
+
function Mn(e, t, n, r, i, a, o) {
|
|
3503
|
+
let { top: s, height: c } = Qt(n, i);
|
|
3504
3504
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3505
3505
|
}
|
|
3506
|
-
function
|
|
3507
|
-
return
|
|
3506
|
+
function Nn(e, t, n, r, i, a, o = 0) {
|
|
3507
|
+
return Fe(e, t, n, r, i, a, o);
|
|
3508
3508
|
}
|
|
3509
|
-
var
|
|
3510
|
-
function
|
|
3509
|
+
var Pn = /* @__PURE__ */ new WeakMap();
|
|
3510
|
+
function Fn(e, t) {
|
|
3511
3511
|
let n = e.tinted.get(t);
|
|
3512
3512
|
if (n) return n;
|
|
3513
|
-
let r =
|
|
3513
|
+
let r = ie(e.raster, t);
|
|
3514
3514
|
return e.tinted.set(t, r), r;
|
|
3515
3515
|
}
|
|
3516
|
-
function
|
|
3516
|
+
function In(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 Ln(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 Ln(e, t) {
|
|
3528
|
+
let n = In(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(U(e.nodes, e.display)), r = await
|
|
3533
|
-
|
|
3531
|
+
for (let e of n) if (!Pn.has(e.nodes)) try {
|
|
3532
|
+
let n = await t.mathMLToSvg(U(e.nodes, e.display)), r = await te(n, "#000000");
|
|
3533
|
+
Pn.set(e.nodes, {
|
|
3534
3534
|
raster: r,
|
|
3535
3535
|
widthEm: n.widthEm,
|
|
3536
3536
|
ascentEm: n.ascentEm,
|
|
@@ -3540,14 +3540,14 @@ async function Rn(e, t) {
|
|
|
3540
3540
|
} catch {}
|
|
3541
3541
|
}
|
|
3542
3542
|
}
|
|
3543
|
-
function
|
|
3543
|
+
function Rn(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 zn = new Set([
|
|
3551
3551
|
"serif",
|
|
3552
3552
|
"sans-serif",
|
|
3553
3553
|
"monospace",
|
|
@@ -3555,11 +3555,11 @@ var Bn = new Set([
|
|
|
3555
3555
|
"fantasy",
|
|
3556
3556
|
"system-ui"
|
|
3557
3557
|
]);
|
|
3558
|
-
function
|
|
3558
|
+
function Bn(e) {
|
|
3559
3559
|
let t = l(e);
|
|
3560
3560
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3561
3561
|
}
|
|
3562
|
-
var
|
|
3562
|
+
var Vn = {
|
|
3563
3563
|
calibri: "Carlito",
|
|
3564
3564
|
"calibri light": "Carlito",
|
|
3565
3565
|
cambria: "Caladea",
|
|
@@ -3571,38 +3571,38 @@ var Hn = {
|
|
|
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
|
+
}, Hn = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3575
|
+
function Un(e) {
|
|
3576
|
+
if (Vn[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 Wn(e) {
|
|
3581
3581
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3582
3582
|
}
|
|
3583
|
-
function
|
|
3584
|
-
let n =
|
|
3585
|
-
if (
|
|
3583
|
+
function Gn(e, t = e) {
|
|
3584
|
+
let n = Bn(t), i = Vn[t.toLowerCase()], a = i ? `"${i}", ` : "";
|
|
3585
|
+
if (Un(t)) return `"${e}", ${a}${Hn}, ${n}`;
|
|
3586
3586
|
let o = n === "serif" ? "serif" : "sans", s = w(t);
|
|
3587
|
-
return `"${e}", ${a}${s ? `${
|
|
3587
|
+
return `"${e}", ${a}${s ? `${Wn(r(s, o))}, ` : ""}${`${Wn(o === "serif" ? f : u)}, `}${n}`;
|
|
3588
3588
|
}
|
|
3589
|
-
function
|
|
3589
|
+
function Kn(e) {
|
|
3590
3590
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3592
|
+
function qn(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 Jn(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 = Ae(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 = Ae(m, h), t = e?.getContext("2d");
|
|
3603
3603
|
e && t && (b = e, x = t);
|
|
3604
3604
|
}
|
|
3605
|
-
b !== g &&
|
|
3605
|
+
b !== g && nn(x, g, {
|
|
3606
3606
|
x: n.x - u,
|
|
3607
3607
|
y: v,
|
|
3608
3608
|
w: n.w,
|
|
@@ -3629,14 +3629,14 @@ function Yn(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 Yn(e, t, n, r, i) {
|
|
3633
|
+
let a = t ? "italic " : "", o = Rn(r, i), s = i.embeddedFontAuthoredFamilies?.get(o) ?? o, c = qn(s), l = e ? "bold " : c ? `${c} ` : "";
|
|
3634
|
+
return zn.has(o) ? `${a}${l}${n}px ${o}` : `${a}${l}${n}px ${Gn(o, s)}`;
|
|
3635
3635
|
}
|
|
3636
|
-
function
|
|
3637
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3636
|
+
function Xn(e) {
|
|
3637
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || Qe(e.bullet).type === "blip";
|
|
3638
3638
|
}
|
|
3639
|
-
function
|
|
3639
|
+
function Zn(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,41 @@ function Qn(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 Qn(e, t) {
|
|
3649
3649
|
return e ? 0 : Math.max(0, t);
|
|
3650
3650
|
}
|
|
3651
|
-
function
|
|
3651
|
+
function $n(e, t) {
|
|
3652
3652
|
return t != null && t !== 0 ? e * .65 : e;
|
|
3653
3653
|
}
|
|
3654
|
-
function
|
|
3655
|
-
let s = (t.defaultFontSize ?? 18) *
|
|
3654
|
+
function er(e, t, n, r, i, a, o) {
|
|
3655
|
+
let s = (t.defaultFontSize ?? 18) * Y * a;
|
|
3656
3656
|
for (let c of t.paragraphs) {
|
|
3657
|
-
let l =
|
|
3657
|
+
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Qn(Xn(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3658
3658
|
for (let n of c.runs) {
|
|
3659
3659
|
if (n.type !== "text") continue;
|
|
3660
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize *
|
|
3661
|
-
e.font =
|
|
3662
|
-
let l = (n.letterSpacing ?? 0) *
|
|
3663
|
-
if (m +=
|
|
3660
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = Rn(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3661
|
+
e.font = Yn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, $n(r, n.baseline ?? void 0), i, o);
|
|
3662
|
+
let l = (n.letterSpacing ?? 0) * Y * a;
|
|
3663
|
+
if (m += $(e, n.text, l), m > p) return !0;
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
3666
3666
|
return !1;
|
|
3667
3667
|
}
|
|
3668
|
-
function
|
|
3669
|
-
for (let t of e) if (
|
|
3668
|
+
function tr(e) {
|
|
3669
|
+
for (let t of e) if (ce(t.codePointAt(0) ?? 0)) return !0;
|
|
3670
3670
|
return !1;
|
|
3671
3671
|
}
|
|
3672
|
-
function
|
|
3672
|
+
function nr(e) {
|
|
3673
3673
|
let t = 0;
|
|
3674
3674
|
for (let n of e) t++;
|
|
3675
3675
|
return t;
|
|
3676
3676
|
}
|
|
3677
|
-
var
|
|
3678
|
-
function
|
|
3679
|
-
let t =
|
|
3677
|
+
var rr = /* @__PURE__ */ new WeakMap();
|
|
3678
|
+
function ir(e) {
|
|
3679
|
+
let t = rr.get(e);
|
|
3680
3680
|
if (t != null) return t;
|
|
3681
3681
|
let n = e, r = n.letterSpacing;
|
|
3682
|
-
if (typeof r != "string") return
|
|
3682
|
+
if (typeof r != "string") return rr.set(e, !1), !1;
|
|
3683
3683
|
let i = !1;
|
|
3684
3684
|
try {
|
|
3685
3685
|
n.letterSpacing = "0px";
|
|
@@ -3694,11 +3694,11 @@ function ar(e) {
|
|
|
3694
3694
|
n.letterSpacing = r;
|
|
3695
3695
|
} catch {}
|
|
3696
3696
|
}
|
|
3697
|
-
return
|
|
3697
|
+
return rr.set(e, i), i;
|
|
3698
3698
|
}
|
|
3699
|
-
function
|
|
3699
|
+
function $(e, t, n) {
|
|
3700
3700
|
let r = e, i = r.letterSpacing;
|
|
3701
|
-
if (n !== 0 &&
|
|
3701
|
+
if (n !== 0 && ir(e)) try {
|
|
3702
3702
|
r.letterSpacing = `${n}px`;
|
|
3703
3703
|
let i = e.measureText(t).width;
|
|
3704
3704
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3707,10 +3707,10 @@ function Q(e, t, n) {
|
|
|
3707
3707
|
r.letterSpacing = i;
|
|
3708
3708
|
} catch {}
|
|
3709
3709
|
}
|
|
3710
|
-
let a = Math.max(0,
|
|
3710
|
+
let a = Math.max(0, nr(t) - 1);
|
|
3711
3711
|
return e.measureText(t).width + n * a;
|
|
3712
3712
|
}
|
|
3713
|
-
function
|
|
3713
|
+
function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3714
3714
|
themeMajorFont: null,
|
|
3715
3715
|
themeMinorFont: null,
|
|
3716
3716
|
dpr: 1
|
|
@@ -3723,11 +3723,11 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3723
3723
|
let r = n.text.replace(/ +$/u, "");
|
|
3724
3724
|
r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (g = !1);
|
|
3725
3725
|
}
|
|
3726
|
-
let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] }, b = 0, S = !1, C = t.rtl === !0, w =
|
|
3727
|
-
pos:
|
|
3726
|
+
let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] }, b = 0, S = !1, C = t.rtl === !0, w = X(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
|
|
3727
|
+
pos: X(e.pos, o),
|
|
3728
3728
|
algn: e.algn
|
|
3729
|
-
})), E =
|
|
3730
|
-
let t =
|
|
3729
|
+
})), E = X(t.defTabSz ?? 914400, o), D = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
|
|
3730
|
+
let t = bn(e > 0 ? [...k, {
|
|
3731
3731
|
isTab: !1,
|
|
3732
3732
|
width: e
|
|
3733
3733
|
}] : k, T, j(), Infinity, A, E), n = 0;
|
|
@@ -3751,13 +3751,13 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3751
3751
|
e && (y.endsWithBreak = !0), m.push(y), y = { segments: [] }, b = 0, D = !1, k = [], S = !1;
|
|
3752
3752
|
}, I = (t, n, r, i) => {
|
|
3753
3753
|
e.font = n;
|
|
3754
|
-
let a =
|
|
3755
|
-
return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ?
|
|
3754
|
+
let a = $(e, t, r), o = y.segments.at(-1);
|
|
3755
|
+
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
3756
|
}, L = (t, n, r, i, a, o, s, c) => {
|
|
3757
3757
|
if (!t) return;
|
|
3758
3758
|
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, v = c?.fontFamily, x = c?.hyperlink, S = c?.drawSizePx ?? r, C = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && (e.drawSizePx ?? e.sizePx) === S &&
|
|
3760
|
-
if (w && C(w) ? T =
|
|
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, v = c?.fontFamily, x = c?.hyperlink, S = c?.drawSizePx ?? r, C = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && (e.drawSizePx ?? e.sizePx) === S && Kn(e.hyperlink) === Kn(x) && (l === 0 || e.sourceRunId === u), w = y.segments.at(-1), T = $(e, t, l);
|
|
3760
|
+
if (w && C(w) ? T = $(e, w.text + t, l) - $(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l), b += T, k.push({
|
|
3761
3761
|
isTab: !1,
|
|
3762
3762
|
width: T
|
|
3763
3763
|
}), w && C(w)) w.text += t;
|
|
@@ -3813,7 +3813,7 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3813
3813
|
continue;
|
|
3814
3814
|
}
|
|
3815
3815
|
if (s.type === "math") {
|
|
3816
|
-
let e =
|
|
3816
|
+
let e = Pn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3817
3817
|
(s.display && b > 0 || !N(n) && b > 0) && F(), k.push({
|
|
3818
3818
|
isTab: !1,
|
|
3819
3819
|
width: n
|
|
@@ -3821,7 +3821,7 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3821
3821
|
text: "",
|
|
3822
3822
|
font: `${t}px sans-serif`,
|
|
3823
3823
|
sizePx: t,
|
|
3824
|
-
color: s.color ?
|
|
3824
|
+
color: s.color ? Q(s.color) : a,
|
|
3825
3825
|
underline: !1,
|
|
3826
3826
|
strikethrough: !1,
|
|
3827
3827
|
math: {
|
|
@@ -3834,27 +3834,27 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3834
3834
|
}), b += n, s.display && F();
|
|
3835
3835
|
continue;
|
|
3836
3836
|
}
|
|
3837
|
-
let p = s.fontSize == null ? r : s.fontSize *
|
|
3838
|
-
T = s.color ?
|
|
3839
|
-
let E = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M =
|
|
3837
|
+
let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = $n(p, s.baseline ?? void 0), g = Rn(s.fontFamily ?? t.defFontFamily ?? null, f), C = s.fontFamilyEa ? Rn(s.fontFamilyEa, f) : null, w = s.fontFamilySym ? Rn(s.fontFamilySym, f) : null, T;
|
|
3838
|
+
T = s.color ? Q(s.color) : s.hyperlink && f.themeHlinkColor ? Q(f.themeHlinkColor) : a;
|
|
3839
|
+
let E = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M = Yn(E, j, m, g, f), B = C ? Yn(E, j, m, C, f) : M;
|
|
3840
3840
|
e.font = M;
|
|
3841
3841
|
let H = s.caps, U = h.get(s) ?? s.text;
|
|
3842
3842
|
(H === "all" || H === "small") && (U = U.toUpperCase());
|
|
3843
|
-
let ee = s.fieldType === "slidenum" && d !== void 0 ? String(d) : U, W = s.underline || s.hyperlink !== void 0,
|
|
3844
|
-
strikeDouble:
|
|
3845
|
-
letterSpacingPx:
|
|
3843
|
+
let ee = s.fieldType === "slidenum" && d !== void 0 ? String(d) : U, W = s.underline || s.hyperlink !== void 0, G = s.strikeDouble === !0, K = s.letterSpacing == null ? 0 : s.letterSpacing * Y * o, q = {
|
|
3844
|
+
strikeDouble: G,
|
|
3845
|
+
letterSpacingPx: K,
|
|
3846
3846
|
underlineStyle: s.underlineStyle,
|
|
3847
|
-
underlineColor: s.underlineColor ?
|
|
3847
|
+
underlineColor: s.underlineColor ? Q(s.underlineColor) : void 0,
|
|
3848
3848
|
shadow: s.shadow,
|
|
3849
3849
|
reflection: s.reflection,
|
|
3850
3850
|
outline: s.outline,
|
|
3851
3851
|
fontFamily: g,
|
|
3852
|
-
highlight: s.highlight ?
|
|
3853
|
-
hyperlink:
|
|
3852
|
+
highlight: s.highlight ? Q(s.highlight) : void 0,
|
|
3853
|
+
hyperlink: rn(s.hyperlink),
|
|
3854
3854
|
sourceRunId: n,
|
|
3855
3855
|
drawSizePx: m
|
|
3856
|
-
},
|
|
3857
|
-
for (let r of
|
|
3856
|
+
}, J = ee.split(/(\s+)/);
|
|
3857
|
+
for (let r of J) {
|
|
3858
3858
|
if (!r) continue;
|
|
3859
3859
|
if (/^\t+$/.test(r)) {
|
|
3860
3860
|
D || (e.font = M, A = e.measureText(" ").width);
|
|
@@ -3875,42 +3875,42 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3875
3875
|
continue;
|
|
3876
3876
|
}
|
|
3877
3877
|
e.font = M;
|
|
3878
|
-
let a = I(r, M,
|
|
3879
|
-
if (c.test(r) && (w != null ||
|
|
3878
|
+
let a = I(r, M, K, n), o = /^\s+$/.test(r), c = /[-]/;
|
|
3879
|
+
if (c.test(r) && (w != null || ge(g))) {
|
|
3880
3880
|
let t = w ?? g;
|
|
3881
3881
|
for (let i of r) {
|
|
3882
3882
|
let r = i, a = M;
|
|
3883
3883
|
if (c.test(i)) {
|
|
3884
|
-
let e =
|
|
3885
|
-
e === i ? a =
|
|
3884
|
+
let e = be(i, t);
|
|
3885
|
+
e === i ? a = Yn(E, j, m, t, f) : (r = e, a = Yn(E, j, m, "sans-serif", f));
|
|
3886
3886
|
}
|
|
3887
|
-
e.font = a, !N(I(r, a,
|
|
3887
|
+
e.font = a, !N(I(r, a, K, n)) && b > 0 && F(), L(r, a, p, T, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3888
3888
|
}
|
|
3889
3889
|
continue;
|
|
3890
3890
|
}
|
|
3891
|
-
if (
|
|
3891
|
+
if (tr(r) && (!V(r) || t.eaLnBrk === !1)) {
|
|
3892
3892
|
let i = [];
|
|
3893
3893
|
for (let t of r) {
|
|
3894
|
-
let n =
|
|
3894
|
+
let n = ce(t.codePointAt(0) ?? 0) && C != null, r = n ? B : M, a = n ? C : g;
|
|
3895
3895
|
e.font = r, i.push({
|
|
3896
3896
|
ch: t,
|
|
3897
|
-
w:
|
|
3897
|
+
w: $(e, t, 0),
|
|
3898
3898
|
font: r,
|
|
3899
3899
|
family: a
|
|
3900
3900
|
});
|
|
3901
3901
|
}
|
|
3902
3902
|
if (t.eaLnBrk === !1) {
|
|
3903
|
-
let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) *
|
|
3903
|
+
let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * K + (t && i.length > 0 ? K : 0);
|
|
3904
3904
|
b > 0 && !N(r) && F();
|
|
3905
3905
|
for (let e of i) L(e.ch, e.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3906
|
-
...
|
|
3906
|
+
...q,
|
|
3907
3907
|
fontFamily: e.family
|
|
3908
3908
|
});
|
|
3909
3909
|
continue;
|
|
3910
3910
|
}
|
|
3911
3911
|
let a = i;
|
|
3912
3912
|
for (; a.length > 0;) {
|
|
3913
|
-
let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i =
|
|
3913
|
+
let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = un(a, e, v(), _, K, r);
|
|
3914
3914
|
if (i === 0) {
|
|
3915
3915
|
if (b > 0) {
|
|
3916
3916
|
F();
|
|
@@ -3921,7 +3921,7 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3921
3921
|
for (let e = 0; e < i; e++) {
|
|
3922
3922
|
let t = a[e];
|
|
3923
3923
|
L(t.ch, t.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3924
|
-
...
|
|
3924
|
+
...q,
|
|
3925
3925
|
fontFamily: t.family
|
|
3926
3926
|
});
|
|
3927
3927
|
}
|
|
@@ -3933,9 +3933,9 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3933
3933
|
let t = x(r, {
|
|
3934
3934
|
cjk: !0,
|
|
3935
3935
|
kinsoku: _
|
|
3936
|
-
}), i = C != null && B !== M, a = (e) => i &&
|
|
3936
|
+
}), i = C != null && B !== M, a = (e) => i && ce(e.codePointAt(0) ?? 0), o = (t) => {
|
|
3937
3937
|
let r = 0, i = y.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
3938
|
-
s !== "" && (e.font = c ? B : M, r +=
|
|
3938
|
+
s !== "" && (e.font = c ? B : M, r += $(e, s, K), o && (r += K), o = !0, s = "");
|
|
3939
3939
|
};
|
|
3940
3940
|
for (let e of t) {
|
|
3941
3941
|
let t = a(e);
|
|
@@ -3947,7 +3947,7 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3947
3947
|
if (t === "") return;
|
|
3948
3948
|
let e = n ? B : M, r = n ? C : g;
|
|
3949
3949
|
L(t, e, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3950
|
-
...
|
|
3950
|
+
...q,
|
|
3951
3951
|
fontFamily: r
|
|
3952
3952
|
}), t = "";
|
|
3953
3953
|
};
|
|
@@ -3956,7 +3956,7 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3956
3956
|
n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
|
|
3957
3957
|
}
|
|
3958
3958
|
r();
|
|
3959
|
-
}, l =
|
|
3959
|
+
}, l = de(r), u = r.length, d = 0;
|
|
3960
3960
|
for (; d < u;) {
|
|
3961
3961
|
let e = P(), n = z(r, t, d, e, o, l);
|
|
3962
3962
|
if (n <= d) {
|
|
@@ -3971,36 +3971,36 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3971
3971
|
}
|
|
3972
3972
|
continue;
|
|
3973
3973
|
}
|
|
3974
|
-
if (N(a)) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0,
|
|
3974
|
+
if (N(a)) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, q), o && (S = !0);
|
|
3975
3975
|
else if (o) b > 0 && F();
|
|
3976
3976
|
else if (a > v()) {
|
|
3977
3977
|
b > 0 && F();
|
|
3978
|
-
for (let t of r) e.font = M, !N(I(t, M,
|
|
3979
|
-
} else if (!S) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0,
|
|
3978
|
+
for (let t of r) e.font = M, !N(I(t, M, K, n)) && b > 0 && F(), L(t, M, p, T, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3979
|
+
} else if (!S) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3980
3980
|
else {
|
|
3981
3981
|
let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && _.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !V(e) && !V(r) && i(n, t);
|
|
3982
|
-
(o || c) && R() || F(), L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0,
|
|
3982
|
+
(o || c) && R() || F(), L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3983
3983
|
}
|
|
3984
3984
|
}
|
|
3985
3985
|
}
|
|
3986
3986
|
return m.push(y), m;
|
|
3987
3987
|
}
|
|
3988
|
-
async function
|
|
3988
|
+
async function or(e, t, n, r, i, o, s, c, l, u) {
|
|
3989
3989
|
if (t && t.fillType === "image") {
|
|
3990
3990
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !s) return;
|
|
3991
3991
|
try {
|
|
3992
|
-
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 ?
|
|
3993
|
-
widthPt: n / i /
|
|
3994
|
-
heightPt: r / i /
|
|
3992
|
+
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 ? Dn(u, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await B(t.imagePath, t.mimeType, s) : void 0, x = await Je(t.imagePath, t.mimeType, t.duotone, s, {
|
|
3993
|
+
widthPt: n / i / Y,
|
|
3994
|
+
heightPt: r / i / Y,
|
|
3995
3995
|
...y ?? {},
|
|
3996
3996
|
tiff: c,
|
|
3997
3997
|
svgDecoder: l
|
|
3998
3998
|
});
|
|
3999
3999
|
if (o() || !x) return;
|
|
4000
|
-
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ?
|
|
4000
|
+
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? ur(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : je(e, x, t.srcRect, h, g, _, v), e.restore();
|
|
4001
4001
|
} catch (t) {
|
|
4002
4002
|
if (a(t, "tiff")) {
|
|
4003
|
-
|
|
4003
|
+
le(e, "tiff", {
|
|
4004
4004
|
x: 0,
|
|
4005
4005
|
y: 0,
|
|
4006
4006
|
width: n,
|
|
@@ -4008,14 +4008,14 @@ async function sr(e, t, n, r, i, o, s, c, l, u) {
|
|
|
4008
4008
|
});
|
|
4009
4009
|
return;
|
|
4010
4010
|
}
|
|
4011
|
-
if (
|
|
4011
|
+
if (Le(t) || qe(t)) throw t;
|
|
4012
4012
|
}
|
|
4013
4013
|
return;
|
|
4014
4014
|
}
|
|
4015
|
-
e.fillStyle =
|
|
4015
|
+
e.fillStyle = Nn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4016
4016
|
}
|
|
4017
|
-
var
|
|
4018
|
-
function
|
|
4017
|
+
var sr = 9525;
|
|
4018
|
+
function cr(e, t, n, r, i) {
|
|
4019
4019
|
let a;
|
|
4020
4020
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4021
4021
|
let o;
|
|
@@ -4024,52 +4024,52 @@ function lr(e, t, n, r, i) {
|
|
|
4024
4024
|
ay: o
|
|
4025
4025
|
};
|
|
4026
4026
|
}
|
|
4027
|
-
function
|
|
4027
|
+
function lr(e, t, n) {
|
|
4028
4028
|
return {
|
|
4029
4029
|
width: e * (n ? 1 - n.l - n.r : 1),
|
|
4030
4030
|
height: t * (n ? 1 - n.t - n.b : 1)
|
|
4031
4031
|
};
|
|
4032
4032
|
}
|
|
4033
|
-
function
|
|
4034
|
-
let c =
|
|
4033
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
4034
|
+
let c = lr(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * sr * (n.sx ?? 1) * a, u = c.height * sr * (n.sy ?? 1) * a;
|
|
4035
4035
|
if (!(l > 0) || !(u > 0)) return;
|
|
4036
|
-
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p =
|
|
4036
|
+
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p = Ae(l * (d ? 2 : 1), u * (f ? 2 : 1));
|
|
4037
4037
|
if (!p) return;
|
|
4038
4038
|
let m = p.getContext("2d");
|
|
4039
4039
|
if (!m) return;
|
|
4040
4040
|
let h = (e, n, r, i) => {
|
|
4041
|
-
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1),
|
|
4041
|
+
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), je(m, t, o, 0, 0, l, u), m.restore();
|
|
4042
4042
|
};
|
|
4043
4043
|
h(0, 0, !1, !1), d && h(l, 0, !0, !1), f && h(0, u, !1, !0), d && f && h(l, u, !0, !0);
|
|
4044
4044
|
let g = e.createPattern(p, "repeat");
|
|
4045
4045
|
if (!g) return;
|
|
4046
|
-
let { ax: _, ay: v } =
|
|
4046
|
+
let { ax: _, ay: v } = cr(n.algn ?? "tl", r, i, l, u), y = _ + X(n.tx ?? 0, a), b = v + X(n.ty ?? 0, a);
|
|
4047
4047
|
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());
|
|
4048
4048
|
}
|
|
4049
|
-
function
|
|
4049
|
+
function dr(e, t, n) {
|
|
4050
4050
|
if (!t) return;
|
|
4051
|
-
let r = t.dir * Math.PI / 180, i =
|
|
4052
|
-
e.shadowColor =
|
|
4051
|
+
let r = t.dir * Math.PI / 180, i = X(t.dist, n);
|
|
4052
|
+
e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4053
4053
|
}
|
|
4054
|
-
function
|
|
4055
|
-
t && (e.shadowColor =
|
|
4054
|
+
function fr(e, t, n) {
|
|
4055
|
+
t && (e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4056
4056
|
}
|
|
4057
|
-
function
|
|
4057
|
+
function pr(e) {
|
|
4058
4058
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4059
4059
|
}
|
|
4060
|
-
var
|
|
4061
|
-
function
|
|
4060
|
+
var mr = 8, hr = 1, gr = 1, _r = 256;
|
|
4061
|
+
function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
4062
4062
|
if (r <= 0) return;
|
|
4063
|
-
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(
|
|
4064
|
-
for (; w >
|
|
4065
|
-
let e = Math.min(
|
|
4063
|
+
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(_r, Math.max(1, Math.round(b / mr))), S = (e) => xr(e, a, r, o, s, c, u, d), C = S(x), w = Cr(C, a, o, s, c, u, d, l, i, -g, _);
|
|
4064
|
+
for (; w > gr && x < _r;) {
|
|
4065
|
+
let e = Math.min(_r, x * 2), t = S(e), n = Cr(t, a, o, s, c, u, d, l, i, -g, _);
|
|
4066
4066
|
if (n >= w * .75) {
|
|
4067
4067
|
C = t;
|
|
4068
4068
|
break;
|
|
4069
4069
|
}
|
|
4070
4070
|
x = e, C = t, w = n;
|
|
4071
4071
|
}
|
|
4072
|
-
let T = 1e4, E =
|
|
4072
|
+
let T = 1e4, E = hr / (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) => {
|
|
4073
4073
|
e.fillStyle = r;
|
|
4074
4074
|
for (let r = 0; r <= D; r++) {
|
|
4075
4075
|
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
@@ -4077,7 +4077,7 @@ function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4077
4077
|
let c = O(r, i, s), u = k(r, a, s);
|
|
4078
4078
|
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4079
4079
|
}
|
|
4080
|
-
}, j =
|
|
4080
|
+
}, j = yr(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4081
4081
|
if (j >= 1 && M >= 1) {
|
|
4082
4082
|
A(e, m);
|
|
4083
4083
|
return;
|
|
@@ -4097,67 +4097,67 @@ function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4097
4097
|
[s, _],
|
|
4098
4098
|
[c, _]
|
|
4099
4099
|
]) {
|
|
4100
|
-
let n =
|
|
4100
|
+
let n = Sr(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;
|
|
4101
4101
|
o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
|
|
4102
4102
|
}
|
|
4103
4103
|
}
|
|
4104
4104
|
if (!(I > P && L > F)) return;
|
|
4105
|
-
let R = Math.floor(P - 2), z = Math.floor(F - 2), B =
|
|
4105
|
+
let R = Math.floor(P - 2), z = Math.floor(F - 2), B = Ae(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
|
|
4106
4106
|
if (!B || !V) {
|
|
4107
4107
|
A(e, m);
|
|
4108
4108
|
return;
|
|
4109
4109
|
}
|
|
4110
|
-
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,
|
|
4110
|
+
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, br(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
|
|
4111
4111
|
}
|
|
4112
|
-
function
|
|
4112
|
+
function yr(e) {
|
|
4113
4113
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4114
4114
|
if (!t) return 1;
|
|
4115
4115
|
let n = parseFloat(t[1]);
|
|
4116
4116
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4117
4117
|
}
|
|
4118
|
-
function
|
|
4118
|
+
function br(e) {
|
|
4119
4119
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4120
4120
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function xr(e, t, n, r, i, a, o, s) {
|
|
4123
4123
|
let c = Array(e);
|
|
4124
4124
|
for (let l = 0; l < e; l++) {
|
|
4125
4125
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4126
4126
|
c[l] = {
|
|
4127
4127
|
s0: u,
|
|
4128
4128
|
s1: d,
|
|
4129
|
-
g:
|
|
4129
|
+
g: ft(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4130
4130
|
};
|
|
4131
4131
|
}
|
|
4132
4132
|
return c;
|
|
4133
4133
|
}
|
|
4134
|
-
function
|
|
4134
|
+
function Sr(e, t, n, r) {
|
|
4135
4135
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4136
4136
|
return {
|
|
4137
4137
|
x: e.x + s * o - c * a,
|
|
4138
4138
|
y: e.y + c * o + s * a
|
|
4139
4139
|
};
|
|
4140
4140
|
}
|
|
4141
|
-
function
|
|
4141
|
+
function Cr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4142
4142
|
let d = 0;
|
|
4143
4143
|
for (let f of e) {
|
|
4144
4144
|
let e = (f.s0 + f.s1) / 2;
|
|
4145
4145
|
for (let p of [f.s0, f.s1]) {
|
|
4146
|
-
let m =
|
|
4146
|
+
let m = ft(t, (n + p) / r * i, a, o);
|
|
4147
4147
|
for (let t of [l, u]) {
|
|
4148
|
-
let n =
|
|
4148
|
+
let n = Sr(m, s, 0, t), r = Sr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4149
4149
|
i > d && (d = i);
|
|
4150
4150
|
}
|
|
4151
4151
|
}
|
|
4152
4152
|
}
|
|
4153
4153
|
return d;
|
|
4154
4154
|
}
|
|
4155
|
-
function
|
|
4156
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4155
|
+
function wr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4156
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = ct(n, r, p, m);
|
|
4157
4157
|
if (!h) return;
|
|
4158
|
-
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) *
|
|
4158
|
+
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [];
|
|
4159
4159
|
for (let n of t.paragraphs) {
|
|
4160
|
-
let t =
|
|
4160
|
+
let t = ar(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * Y * c, n.defColor ? Q(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4161
4161
|
for (let e of t) y.push(e);
|
|
4162
4162
|
}
|
|
4163
4163
|
if (y.length === 0) return;
|
|
@@ -4176,10 +4176,10 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4176
4176
|
}
|
|
4177
4177
|
e.font = t.font;
|
|
4178
4178
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4179
|
-
a += r.width + n *
|
|
4179
|
+
a += r.width + n * nr(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
|
|
4180
4180
|
}
|
|
4181
4181
|
if (a <= 0) continue;
|
|
4182
|
-
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v =
|
|
4182
|
+
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = dt(h, a), b = 0;
|
|
4183
4183
|
for (let t of n.segments) {
|
|
4184
4184
|
if (t.math) {
|
|
4185
4185
|
b += t.math.width;
|
|
@@ -4190,17 +4190,17 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4190
4190
|
for (let s of o) {
|
|
4191
4191
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4192
4192
|
if (!h.singleEdge && o > 0) {
|
|
4193
|
-
|
|
4193
|
+
vr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4194
4194
|
continue;
|
|
4195
4195
|
}
|
|
4196
|
-
let l =
|
|
4196
|
+
let l = ft(h, (b + o / 2) / a * v, _, c);
|
|
4197
4197
|
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), (g !== 1 || l.vScale !== 1) && e.scale(g, l.vScale), e.fillText(s, -o / 2 + n / 2, 0), e.restore(), b += o;
|
|
4198
4198
|
}
|
|
4199
4199
|
}
|
|
4200
4200
|
}
|
|
4201
4201
|
e.restore();
|
|
4202
4202
|
}
|
|
4203
|
-
function
|
|
4203
|
+
function Tr(e, t, n, r, i, a, o) {
|
|
4204
4204
|
let s = Math.min(r, i);
|
|
4205
4205
|
switch (e) {
|
|
4206
4206
|
case "rightarrow":
|
|
@@ -4230,17 +4230,17 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
4230
4230
|
default: return null;
|
|
4231
4231
|
}
|
|
4232
4232
|
}
|
|
4233
|
-
function
|
|
4234
|
-
return e.defaultTextColor ?
|
|
4233
|
+
function Er(e, t) {
|
|
4234
|
+
return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null && vn(e) ? t.smartArtFallbackTextColor : null;
|
|
4235
4235
|
}
|
|
4236
|
-
function
|
|
4236
|
+
function Dr(e, t, n) {
|
|
4237
4237
|
return {
|
|
4238
4238
|
outerRotation: e,
|
|
4239
4239
|
localFlipH: t,
|
|
4240
4240
|
localFlipV: n
|
|
4241
4241
|
};
|
|
4242
4242
|
}
|
|
4243
|
-
function
|
|
4243
|
+
function Or(e, t, n, r, i) {
|
|
4244
4244
|
let a = [
|
|
4245
4245
|
{
|
|
4246
4246
|
x: t,
|
|
@@ -4269,7 +4269,7 @@ function kr(e, t, n, r, i) {
|
|
|
4269
4269
|
h: l - s
|
|
4270
4270
|
};
|
|
4271
4271
|
}
|
|
4272
|
-
var
|
|
4272
|
+
var kr = {
|
|
4273
4273
|
tl: [0, 0],
|
|
4274
4274
|
t: [.5, 0],
|
|
4275
4275
|
tr: [1, 0],
|
|
@@ -4280,15 +4280,15 @@ var Ar = {
|
|
|
4280
4280
|
b: [.5, 1],
|
|
4281
4281
|
br: [1, 1]
|
|
4282
4282
|
};
|
|
4283
|
-
function
|
|
4283
|
+
function Ar(e, t, n) {
|
|
4284
4284
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4287
|
-
let [o, s] =
|
|
4288
|
-
return
|
|
4286
|
+
function jr(e, t, n, r, i, a) {
|
|
4287
|
+
let [o, s] = kr[a ?? "b"];
|
|
4288
|
+
return Ar(e, t + o * r, n + s * i);
|
|
4289
4289
|
}
|
|
4290
|
-
function
|
|
4291
|
-
let c =
|
|
4290
|
+
function Mr(e, t, n, r, i, a, o, s) {
|
|
4291
|
+
let c = St(e, i, a).corners, l = (o > 0 ? Ge(c, o / i, o / a) ?? c : c).map((e) => Ar(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, _] = kr[s ?? "b"], v = He(c, g, _);
|
|
4292
4292
|
return {
|
|
4293
4293
|
bbox: {
|
|
4294
4294
|
x: f,
|
|
@@ -4296,15 +4296,15 @@ function Nr(e, t, n, r, i, a, o, s) {
|
|
|
4296
4296
|
w: m - f,
|
|
4297
4297
|
h: h - p
|
|
4298
4298
|
},
|
|
4299
|
-
anchor: v ?
|
|
4299
|
+
anchor: v ? Ar(t, n + v.x, r + v.y) : jr(t, n, r, i, a, s)
|
|
4300
4300
|
};
|
|
4301
4301
|
}
|
|
4302
|
-
function
|
|
4302
|
+
function Nr(e, t, n, r) {
|
|
4303
4303
|
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);
|
|
4304
|
-
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) ||
|
|
4304
|
+
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || Ve(o, s).clamped) return e;
|
|
4305
4305
|
let c = null;
|
|
4306
4306
|
try {
|
|
4307
|
-
c =
|
|
4307
|
+
c = Ae(o, s);
|
|
4308
4308
|
} catch {
|
|
4309
4309
|
return e;
|
|
4310
4310
|
}
|
|
@@ -4323,7 +4323,7 @@ function Pr(e, t, n, r) {
|
|
|
4323
4323
|
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4324
4324
|
};
|
|
4325
4325
|
}
|
|
4326
|
-
function
|
|
4326
|
+
function Pr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4327
4327
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4328
4328
|
a: 1,
|
|
4329
4329
|
b: 0,
|
|
@@ -4338,32 +4338,32 @@ function Fr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4338
4338
|
}, v = (e) => {
|
|
4339
4339
|
h(e), u(e);
|
|
4340
4340
|
}, y = !1;
|
|
4341
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !
|
|
4341
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !We(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), ze(e, g, i, t.reflection, s, d, f), e.restore()), y ? dr(e, t.shadow ?? null, o) : t.glow && fr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Be(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && pr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Ue(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4342
4342
|
}
|
|
4343
|
-
function
|
|
4343
|
+
function Fr(e, t, r, i = "#000000", a, o = {
|
|
4344
4344
|
themeMajorFont: null,
|
|
4345
4345
|
themeMinorFont: null,
|
|
4346
4346
|
dpr: 1
|
|
4347
4347
|
}, s, c) {
|
|
4348
|
-
let l =
|
|
4348
|
+
let l = X(t.x, r), u = X(t.y, r), d = X(t.width, r), f = X(t.height, r), p = s && t.id !== void 0 ? (e) => s({
|
|
4349
4349
|
...e,
|
|
4350
4350
|
shapeId: t.id
|
|
4351
4351
|
}) : s;
|
|
4352
4352
|
if (f === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4353
|
-
if (t.stroke && (e.save(),
|
|
4353
|
+
if (t.stroke && (e.save(), $r(e, t.stroke, r, {
|
|
4354
4354
|
x: l,
|
|
4355
4355
|
y: u,
|
|
4356
4356
|
w: d,
|
|
4357
4357
|
h: 1
|
|
4358
4358
|
}, t.rotation), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
|
|
4359
|
-
let n =
|
|
4360
|
-
|
|
4359
|
+
let n = Er(t, o);
|
|
4360
|
+
Vr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
|
|
4361
4361
|
}
|
|
4362
4362
|
return;
|
|
4363
4363
|
}
|
|
4364
|
-
let h = t.scene3d &&
|
|
4364
|
+
let h = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null;
|
|
4365
4365
|
if (h && d > 0 && f > 0) {
|
|
4366
|
-
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p =
|
|
4366
|
+
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Ur(t.sp3d, h.camera, d, f, r, c), g = Dr(t.rotation, t.flipH, t.flipV);
|
|
4367
4367
|
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)));
|
|
4368
4368
|
let _ = {
|
|
4369
4369
|
...t,
|
|
@@ -4386,21 +4386,21 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4386
4386
|
..._,
|
|
4387
4387
|
fill: null,
|
|
4388
4388
|
stroke: null
|
|
4389
|
-
}, 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) =>
|
|
4390
|
-
|
|
4389
|
+
}, 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) => Wr(e, h.camera, l, u, d, f, (e) => {
|
|
4390
|
+
Fr(e, t, r, i, a, o, void 0);
|
|
4391
4391
|
}, n ? {
|
|
4392
4392
|
bevels: p,
|
|
4393
4393
|
extrusion: m ?? void 0,
|
|
4394
4394
|
edgePadCss: b
|
|
4395
4395
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4396
4396
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4397
|
-
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4397
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Mr(h.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Nr((e) => {
|
|
4398
4398
|
s = S(e) || s;
|
|
4399
4399
|
}, n, o.bbox, {
|
|
4400
4400
|
w: e.canvas.width || 0,
|
|
4401
4401
|
h: e.canvas.height || 0
|
|
4402
4402
|
});
|
|
4403
|
-
if (
|
|
4403
|
+
if (Pr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
|
|
4404
4404
|
C(e), e.restore();
|
|
4405
4405
|
return;
|
|
4406
4406
|
}
|
|
@@ -4411,8 +4411,8 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4411
4411
|
e.restore();
|
|
4412
4412
|
}
|
|
4413
4413
|
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)));
|
|
4414
|
-
let _ = t.geometry.toLowerCase(), v =
|
|
4415
|
-
t.shadow ||
|
|
4414
|
+
let _ = t.geometry.toLowerCase(), v = Nn(t.fill, e, l, u, d, f, t.rotation);
|
|
4415
|
+
t.shadow || fr(e, t.glow ?? null, r);
|
|
4416
4416
|
let y = new Set([
|
|
4417
4417
|
"line",
|
|
4418
4418
|
"straightconnector1",
|
|
@@ -4443,14 +4443,14 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4443
4443
|
w: d,
|
|
4444
4444
|
h: f
|
|
4445
4445
|
}) => {
|
|
4446
|
-
let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? v :
|
|
4447
|
-
|
|
4446
|
+
let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? v : Nn(t.fill, n, o, s, c, p, t.rotation)), h = i ? null : t.stroke ? () => {
|
|
4447
|
+
$r(n, t.stroke, r, {
|
|
4448
4448
|
x: o,
|
|
4449
4449
|
y: s,
|
|
4450
4450
|
w: c,
|
|
4451
4451
|
h: p
|
|
4452
4452
|
}, t.rotation), n.stroke();
|
|
4453
|
-
} : null, y = () =>
|
|
4453
|
+
} : null, y = () => pr(n);
|
|
4454
4454
|
if (S && !i) {
|
|
4455
4455
|
g(n, _, o, s, c, p, [
|
|
4456
4456
|
t.adj,
|
|
@@ -4464,7 +4464,7 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4464
4464
|
], m, h, y, x(_) ? { skipTrailingStroke: !0 } : void 0);
|
|
4465
4465
|
return;
|
|
4466
4466
|
}
|
|
4467
|
-
n.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4467
|
+
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Ir(n, t.custGeom, o, s, c, p) : me(n, _, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && _ !== "arc" && (n.fillStyle = m, _ === "donut" || _ === "smileyface" || _ === "frame" ? n.fill("evenodd") : n.fill(), i || y()), h && h();
|
|
4468
4468
|
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? S ? W(_, l, u, d, f, [
|
|
4469
4469
|
t.adj,
|
|
4470
4470
|
t.adj2,
|
|
@@ -4474,18 +4474,18 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4474
4474
|
t.adj6,
|
|
4475
4475
|
t.adj7,
|
|
4476
4476
|
t.adj8
|
|
4477
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4477
|
+
]) : t.custGeom && t.custGeom.length > 0 ? he(t.custGeom, l, u, d, f) : null : null) ?? {
|
|
4478
4478
|
x: l,
|
|
4479
4479
|
y: u,
|
|
4480
4480
|
w: d,
|
|
4481
4481
|
h: f
|
|
4482
|
-
}, O = t.stroke ? t.stroke.width * r / 2 : 0, k = t.stroke ? Math.max(t.stroke.headEnd ?
|
|
4482
|
+
}, O = t.stroke ? t.stroke.width * r / 2 : 0, k = t.stroke ? Math.max(t.stroke.headEnd ? pe(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? pe(t.stroke.tailEnd, t.stroke, r) : 0) : 0, A = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, j = Math.max(O, k, A), M = j > 0 ? {
|
|
4483
4483
|
x: D.x - j,
|
|
4484
4484
|
y: D.y - j,
|
|
4485
4485
|
w: D.w + j * 2,
|
|
4486
4486
|
h: D.h + j * 2
|
|
4487
|
-
} : D, N =
|
|
4488
|
-
let i = t.stroke?.fill ?
|
|
4487
|
+
} : D, N = Or(w, M.x, M.y, M.w, M.h), P = r * E, F = h ? [] : Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, E), I = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, L = (e) => {
|
|
4488
|
+
let i = t.stroke?.fill ? Nn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
|
|
4489
4489
|
if (t.stroke && (y.has(_) || b.has(_))) {
|
|
4490
4490
|
let a = n(_, l, u, d, f, [
|
|
4491
4491
|
t.adj,
|
|
@@ -4505,14 +4505,14 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4505
4505
|
y: e.y
|
|
4506
4506
|
}));
|
|
4507
4507
|
if (t.stroke.tailEnd) {
|
|
4508
|
-
let e =
|
|
4509
|
-
n[n.length - 1] =
|
|
4508
|
+
let e = ye(t.stroke.tailEnd, t.stroke, r);
|
|
4509
|
+
n[n.length - 1] = Se(n[n.length - 1], n[n.length - 2], e);
|
|
4510
4510
|
}
|
|
4511
4511
|
if (t.stroke.headEnd) {
|
|
4512
|
-
let e =
|
|
4513
|
-
n[0] =
|
|
4512
|
+
let e = ye(t.stroke.headEnd, t.stroke, r);
|
|
4513
|
+
n[0] = Se(n[0], n[1], e);
|
|
4514
4514
|
}
|
|
4515
|
-
|
|
4515
|
+
$r(e, t.stroke, r, {
|
|
4516
4516
|
x: l,
|
|
4517
4517
|
y: u,
|
|
4518
4518
|
w: d,
|
|
@@ -4521,46 +4521,46 @@ function Ir(e, t, r, i = "#000000", a, o = {
|
|
|
4521
4521
|
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
4522
4522
|
e.stroke();
|
|
4523
4523
|
}
|
|
4524
|
-
o && s &&
|
|
4524
|
+
o && s && Qr(e, a.start, a.end, t.stroke, o, r, t.rotation), t.stroke.tailEnd && _e(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, r, i), t.stroke.headEnd && _e(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, r, i);
|
|
4525
4525
|
return;
|
|
4526
4526
|
}
|
|
4527
4527
|
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;
|
|
4528
|
-
let { start: a, end: o } =
|
|
4529
|
-
a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4528
|
+
let { start: a, end: o } = ve(t.custGeom);
|
|
4529
|
+
a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && _e(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.headEnd, t.stroke, r, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && _e(e, l + o.x * d, u + o.y * f, Math.atan2(o.dy * f, o.dx * d), t.stroke.tailEnd, t.stroke, r, i);
|
|
4530
4530
|
}, R = (e) => {
|
|
4531
|
-
if (F.length > 0 &&
|
|
4531
|
+
if (F.length > 0 && Gr(e, l, u, d, f, F, (e, t, n, r, i) => C(e, void 0, {
|
|
4532
4532
|
x: t,
|
|
4533
4533
|
y: n,
|
|
4534
4534
|
w: r,
|
|
4535
4535
|
h: i
|
|
4536
4536
|
}), void 0, I)) {
|
|
4537
|
-
L(e),
|
|
4537
|
+
L(e), pr(e);
|
|
4538
4538
|
return;
|
|
4539
4539
|
}
|
|
4540
4540
|
C(e), L(e);
|
|
4541
4541
|
};
|
|
4542
|
-
if (
|
|
4543
|
-
let n =
|
|
4542
|
+
if (Pr(e, t, R, R, N, jr(w, l, u, d, f, t.shadow?.algn), r, P, w, !!v, (e) => C(e, "#000")), t.textBody) {
|
|
4543
|
+
let n = Er(t, o);
|
|
4544
4544
|
if (e.save(), t.flipH || t.flipV) {
|
|
4545
4545
|
let n = l + d / 2, r = u + f / 2;
|
|
4546
4546
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4547
4547
|
}
|
|
4548
4548
|
let s = l, m = u, h = d, g = f;
|
|
4549
|
-
if (t.textRect) s =
|
|
4549
|
+
if (t.textRect) s = X(t.textRect.x, r), m = X(t.textRect.y, r), h = X(t.textRect.width, r), g = X(t.textRect.height, r);
|
|
4550
4550
|
else if (_ === "ellipse") {
|
|
4551
4551
|
let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
|
|
4552
4552
|
s = l + e, m = u + t, h = d / Math.SQRT2, g = f / Math.SQRT2;
|
|
4553
4553
|
} else {
|
|
4554
|
-
let e =
|
|
4554
|
+
let e = Tr(_, l, u, d, f, t.adj, t.adj2);
|
|
4555
4555
|
e && (s = e.tx, m = e.ty, h = e.tw, g = e.th);
|
|
4556
4556
|
}
|
|
4557
|
-
|
|
4557
|
+
Vr(e, t.textBody, s, m, h, g, r, n, t.rotation, !1, !1, i, a, o, p, !1, c), e.restore();
|
|
4558
4558
|
}
|
|
4559
4559
|
e.restore();
|
|
4560
4560
|
}
|
|
4561
|
-
var
|
|
4562
|
-
function
|
|
4563
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4561
|
+
var Ir = we;
|
|
4562
|
+
function Lr(e, t) {
|
|
4563
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Rr(e).toLowerCase(), o = Rr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4564
4564
|
switch (t) {
|
|
4565
4565
|
case "arabicPlain": return n;
|
|
4566
4566
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4587,7 +4587,7 @@ function Rr(e, t) {
|
|
|
4587
4587
|
default: return `${n}.`;
|
|
4588
4588
|
}
|
|
4589
4589
|
}
|
|
4590
|
-
function
|
|
4590
|
+
function Rr(e) {
|
|
4591
4591
|
let t = [
|
|
4592
4592
|
1e3,
|
|
4593
4593
|
900,
|
|
@@ -4620,21 +4620,21 @@ function zr(e) {
|
|
|
4620
4620
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4621
4621
|
return r;
|
|
4622
4622
|
}
|
|
4623
|
-
function
|
|
4623
|
+
function zr(e) {
|
|
4624
4624
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4625
4625
|
return !1;
|
|
4626
4626
|
}
|
|
4627
|
-
function
|
|
4628
|
-
let n =
|
|
4629
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4627
|
+
function Br(e, t) {
|
|
4628
|
+
let n = zr(e);
|
|
4629
|
+
if (e.bullet.type === "char") return t.clear(), n ? be(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4630
4630
|
if (e.bullet.type === "autoNum") {
|
|
4631
4631
|
if (!n) return "";
|
|
4632
4632
|
let r = e.lvl;
|
|
4633
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4633
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Lr(t.get(r), e.bullet.numType);
|
|
4634
4634
|
}
|
|
4635
4635
|
return t.clear(), "";
|
|
4636
4636
|
}
|
|
4637
|
-
function
|
|
4637
|
+
function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
4638
4638
|
themeMajorFont: null,
|
|
4639
4639
|
themeMinorFont: null,
|
|
4640
4640
|
dpr: 1
|
|
@@ -4653,115 +4653,120 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4653
4653
|
textBodyRotation: d
|
|
4654
4654
|
}) : void 0;
|
|
4655
4655
|
if (g) return a;
|
|
4656
|
-
t.save(), t.translate(e, u), t.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4656
|
+
t.save(), t.translate(e, u), t.rotate(x ? -Math.PI / 2 : Math.PI / 2), Vr(t, {
|
|
4657
4657
|
...n,
|
|
4658
4658
|
vert: "horz"
|
|
4659
4659
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, v, !1, _, n.vert === "eaVert"), t.restore();
|
|
4660
4660
|
return;
|
|
4661
4661
|
}
|
|
4662
4662
|
let S = n.textWarp;
|
|
4663
|
-
if (!g && S &&
|
|
4664
|
-
|
|
4663
|
+
if (!g && S && rt(S.preset)) {
|
|
4664
|
+
wr(t, n, S.preset, S.adj ?? [], r, i, a, o, s, c ?? f, m);
|
|
4665
4665
|
return;
|
|
4666
4666
|
}
|
|
4667
|
-
let C =
|
|
4668
|
-
let i = (n.defaultFontSize ?? 18) *
|
|
4667
|
+
let C = X(n.lIns, s), w = X(n.rIns, s), T = X(n.tIns, s), E = X(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp", A = O ? D && er(t, n, a, C, w, s, m) : D, j = Math.max(1, n.numCol ?? 1), M = X(n.spcCol ?? 0, s), N = n.defaultBold ?? !1, P = n.defaultItalic ?? !1, F = c ?? f, I = (e) => {
|
|
4668
|
+
let i = (n.defaultFontSize ?? 18) * Y * s * e, o = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4669
4669
|
for (let u = 0; u < n.paragraphs.length; u++) {
|
|
4670
|
-
let d = n.paragraphs[u], f =
|
|
4670
|
+
let d = n.paragraphs[u], f = X(d.marL, s), h = X(d.marR, s), _ = X(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * Y * s * e, b = d.defColor ? Q(d.defColor) : F, x = Xn(d), S = (() => {
|
|
4671
4671
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4672
4672
|
return d.defFontSize ?? n.defaultFontSize ?? 18;
|
|
4673
|
-
})() *
|
|
4673
|
+
})() * Y * s * e, T = (() => {
|
|
4674
4674
|
for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
|
|
4675
4675
|
return null;
|
|
4676
|
-
})(), E = T ?
|
|
4676
|
+
})(), E = T ? Q(T) : b, D = (() => {
|
|
4677
4677
|
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4678
4678
|
return d.defFontFamily ?? null;
|
|
4679
|
-
})(), k = "",
|
|
4680
|
-
k =
|
|
4681
|
-
let
|
|
4682
|
-
if (
|
|
4683
|
-
let t =
|
|
4684
|
-
|
|
4685
|
-
} else if (
|
|
4686
|
-
let t =
|
|
4687
|
-
|
|
4688
|
-
} else if (
|
|
4689
|
-
let t =
|
|
4690
|
-
|
|
4679
|
+
})(), k = "", I = Yn(!1, !1, S, "sans-serif", m), L = E, R = null;
|
|
4680
|
+
k = Br(d, l);
|
|
4681
|
+
let z = Qe(d.bullet);
|
|
4682
|
+
if (z.type === "char") {
|
|
4683
|
+
let t = z;
|
|
4684
|
+
I = Yn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * Y * s * e, k === t.char ? Rn(t.fontFamily ?? null, m) : "sans-serif", m), L = t.color ? Q(t.color) : E;
|
|
4685
|
+
} else if (z.type === "autoNum") {
|
|
4686
|
+
let t = z;
|
|
4687
|
+
I = Yn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * Y * s * e, Rn(t.fontFamily ?? D, m), m), L = z.color ? Q(z.color) : E;
|
|
4688
|
+
} else if (z.type === "blip") {
|
|
4689
|
+
let t = z, r = Zn(n, d, t) * Y * s * e;
|
|
4690
|
+
R = {
|
|
4691
4691
|
imagePath: t.imagePath,
|
|
4692
4692
|
mimeType: t.mimeType,
|
|
4693
4693
|
sizePx: r
|
|
4694
4694
|
};
|
|
4695
4695
|
}
|
|
4696
|
-
let
|
|
4697
|
-
for (let e = 0; e <
|
|
4698
|
-
let r =
|
|
4696
|
+
let B = j > 1 ? (a - C - w - (j - 1) * M) / j : a - C - w, V = r + C + f, H = r + C + f + _, U = B - f - h, ee = ar(t, d, A ? U : Infinity, v, b, s, f, N, P, e, p, m, Qn(x, _)), W = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * Y * s * e, G = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * Y * s * e;
|
|
4697
|
+
for (let e = 0; e < ee.length; e++) {
|
|
4698
|
+
let r = ee[e], i = e === 0, a = e === ee.length - 1, l = 0, f = 0, p = 0;
|
|
4699
4699
|
for (let e of r.segments) {
|
|
4700
|
-
let
|
|
4701
|
-
if (
|
|
4702
|
-
let
|
|
4703
|
-
|
|
4700
|
+
let n = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4701
|
+
if (n > l && (l = n), !e.math) {
|
|
4702
|
+
let n = J(e.fontFamily, e.sizePx);
|
|
4703
|
+
if (n > f && (f = n), O) {
|
|
4704
|
+
t.font = e.font;
|
|
4705
|
+
let n = t.measureText(e.text || "M"), r = (n.fontBoundingBoxAscent ?? 0) + (n.fontBoundingBoxDescent ?? 0);
|
|
4706
|
+
r > p && (p = r);
|
|
4707
|
+
}
|
|
4704
4708
|
}
|
|
4705
4709
|
}
|
|
4706
4710
|
if (l === 0 && (l = v), i && k) {
|
|
4707
|
-
t.font =
|
|
4711
|
+
t.font = I;
|
|
4708
4712
|
let e = t.measureText("M"), n = e.actualBoundingBoxAscent + e.actualBoundingBoxDescent;
|
|
4709
4713
|
n > l && (l = n);
|
|
4710
4714
|
}
|
|
4711
|
-
i &&
|
|
4712
|
-
let
|
|
4713
|
-
|
|
4714
|
-
let
|
|
4715
|
+
i && R && R.sizePx > l && (l = R.sizePx);
|
|
4716
|
+
let m = l * 1.2, h = O && f > m && p > 0, b = h ? Math.max(m, p) : Math.max(m, f), S;
|
|
4717
|
+
S = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : m) * (d.spaceLine.val / 1e5) : d.spaceLine.val * Y * s : g && !O ? y ? m : l : b, n.autoFit === "norm" && n.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (S *= 1 - n.lnSpcReduction);
|
|
4718
|
+
let C = S + (a ? G : 0), w = i && u > 0 ? W : 0, T = i ? Qn(x, _) : 0, E = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), D = i && E ? R : null;
|
|
4715
4719
|
o.push({
|
|
4716
4720
|
line: r,
|
|
4717
|
-
linePx:
|
|
4718
|
-
lineHeight:
|
|
4719
|
-
topGapPx:
|
|
4720
|
-
textXOffset:
|
|
4721
|
+
linePx: C,
|
|
4722
|
+
lineHeight: S,
|
|
4723
|
+
topGapPx: w,
|
|
4724
|
+
textXOffset: T,
|
|
4721
4725
|
bulletLabel: i ? k : "",
|
|
4722
|
-
bulletFont:
|
|
4723
|
-
bulletColor:
|
|
4724
|
-
bulletX:
|
|
4725
|
-
bulletImage:
|
|
4726
|
-
textX:
|
|
4727
|
-
textMaxW:
|
|
4726
|
+
bulletFont: I,
|
|
4727
|
+
bulletColor: L,
|
|
4728
|
+
bulletX: H,
|
|
4729
|
+
bulletImage: D,
|
|
4730
|
+
textX: V,
|
|
4731
|
+
textMaxW: U,
|
|
4728
4732
|
alignment: d.alignment,
|
|
4729
4733
|
isLastLine: a,
|
|
4730
|
-
para: d
|
|
4731
|
-
|
|
4734
|
+
para: d,
|
|
4735
|
+
useResolvedFontMetrics: h
|
|
4736
|
+
}), c += C + w;
|
|
4732
4737
|
}
|
|
4733
4738
|
}
|
|
4734
4739
|
return {
|
|
4735
4740
|
allLines: o,
|
|
4736
4741
|
totalHeight: c
|
|
4737
4742
|
};
|
|
4738
|
-
}, { allLines:
|
|
4739
|
-
if (n.autoFit === "norm") if (n.fontScale != null && n.fontScale > 0) n.fontScale < 1 && ({allLines:
|
|
4743
|
+
}, { allLines: L, totalHeight: R } = I(1);
|
|
4744
|
+
if (n.autoFit === "norm") if (n.fontScale != null && n.fontScale > 0) n.fontScale < 1 && ({allLines: L, totalHeight: R} = I(n.fontScale));
|
|
4740
4745
|
else {
|
|
4741
4746
|
let e = o - T - E;
|
|
4742
|
-
if (
|
|
4747
|
+
if (R > e && e > 0) {
|
|
4743
4748
|
let t = .1, n = 1;
|
|
4744
4749
|
for (let r = 0; r < 6; r++) {
|
|
4745
4750
|
let r = (t + n) / 2;
|
|
4746
|
-
|
|
4751
|
+
I(r).totalHeight <= e ? t = r : n = r;
|
|
4747
4752
|
}
|
|
4748
|
-
({allLines:
|
|
4753
|
+
({allLines: L, totalHeight: R} = I(t));
|
|
4749
4754
|
}
|
|
4750
4755
|
}
|
|
4751
|
-
if (g) return T +
|
|
4752
|
-
let
|
|
4753
|
-
o === 0 &&
|
|
4754
|
-
let
|
|
4755
|
-
|
|
4756
|
-
let
|
|
4757
|
-
for (let c of
|
|
4758
|
-
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = c;
|
|
4759
|
-
|
|
4760
|
-
let
|
|
4761
|
-
if (
|
|
4762
|
-
let e =
|
|
4756
|
+
if (g) return T + R + E;
|
|
4757
|
+
let z = n.verticalAnchor ?? "t", B = i, V;
|
|
4758
|
+
o === 0 && z === "b" ? (V = T + R + E, B = i - V) : V = n.autoFit === "sp" ? Math.max(o, T + R + E) : o;
|
|
4759
|
+
let H, U = Math.max(0, V - T - E);
|
|
4760
|
+
H = z === "ctr" ? B + T + (U - R) / 2 : z === "b" ? B + V - E - R : B + T, t.save(), t.textAlign = "left", t.textBaseline = "alphabetic";
|
|
4761
|
+
let ee = H, W = j > 1 ? (a - C - w - (j - 1) * M) / j + M : 0, G = Math.max(0, V - T - E), K = L[L.length - 1], q = K ? Math.max(0, K.linePx - K.lineHeight) : 0, te = R - q, ne = o === 0 || te <= G + .5, re = j > 1 && !ne ? Math.ceil(L.length / j) : L.length, ie = 0, ae = 0;
|
|
4762
|
+
for (let c of L) {
|
|
4763
|
+
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w, useResolvedFontMetrics: T } = c;
|
|
4764
|
+
j > 1 && ie < j - 1 && ae >= re && (ie++, ae = 0, H = ee), H += p, ae++;
|
|
4765
|
+
let E = (n.rtlCol ? j - 1 - ie : ie) * W, D = c.textX + E, O = c.bulletX + E, A = c.textMaxW, M = c.para.rtl === !0, N = M || cn(u.segments), P = u.segments.some((e) => e.isTab);
|
|
4766
|
+
if (P) {
|
|
4767
|
+
let e = X(c.para.marL, s), n = X(c.para.marR, s), r = M ? n : e + g, i = A + e + n;
|
|
4763
4768
|
t.font = u.segments.find((e) => e.isTab).font;
|
|
4764
|
-
let a = t.measureText(" ").width, o =
|
|
4769
|
+
let a = t.measureText(" ").width, o = bn(u.segments.map((e) => {
|
|
4765
4770
|
if (e.isTab) return {
|
|
4766
4771
|
isTab: !0,
|
|
4767
4772
|
width: 0
|
|
@@ -4774,82 +4779,85 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4774
4779
|
let n = e.letterSpacingPx ?? 0;
|
|
4775
4780
|
return {
|
|
4776
4781
|
isTab: !1,
|
|
4777
|
-
width: e.text ? (e.leadingLetterSpacingPx ?? 0) +
|
|
4782
|
+
width: e.text ? (e.leadingLetterSpacingPx ?? 0) + $(t, e.text, n) : 0
|
|
4778
4783
|
};
|
|
4779
4784
|
}), (c.para.tabStops ?? []).map((e) => ({
|
|
4780
|
-
pos:
|
|
4785
|
+
pos: X(e.pos, s),
|
|
4781
4786
|
algn: e.algn
|
|
4782
|
-
})), r, i, a,
|
|
4787
|
+
})), r, i, a, X(c.para.defTabSz ?? 914400, s));
|
|
4783
4788
|
for (let e = 0; e < u.segments.length; e++) u.segments[e].isTab && (u.segments[e].tabWidthPx = o[e]);
|
|
4784
4789
|
}
|
|
4785
|
-
let
|
|
4790
|
+
let F = 0, I = 0, L = 0, R = 0;
|
|
4786
4791
|
for (let e of u.segments) {
|
|
4787
4792
|
if (e.isTab) {
|
|
4788
|
-
|
|
4793
|
+
F += e.tabWidthPx ?? 0;
|
|
4789
4794
|
continue;
|
|
4790
4795
|
}
|
|
4791
4796
|
if (e.math) {
|
|
4792
|
-
|
|
4797
|
+
F += e.math.width, I = Math.max(I, e.math.ascent);
|
|
4793
4798
|
continue;
|
|
4794
4799
|
}
|
|
4795
4800
|
t.font = e.font;
|
|
4796
4801
|
let n = t.measureText(e.text || "M"), r = e.letterSpacingPx ?? 0;
|
|
4797
|
-
|
|
4802
|
+
if (F += e.leadingLetterSpacingPx ?? 0, F += e.text ? $(t, e.text, r) : 0, n.actualBoundingBoxAscent > 0 && (I = Math.max(I, n.actualBoundingBoxAscent)), T) {
|
|
4803
|
+
let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
|
|
4804
|
+
t > R && (R = t, L = e);
|
|
4805
|
+
}
|
|
4798
4806
|
}
|
|
4799
|
-
let
|
|
4800
|
-
if (
|
|
4801
|
-
if (y) t.font = b,
|
|
4802
|
-
else if (S &&
|
|
4807
|
+
let B = T && R > 0 ? z === "t" && I > 0 ? I : Math.max(I, L + Math.max(0, f - R) / 2) : Math.max(f * .8, I), V = H + B, U = D + A, G = S && _ ? m.pictureBulletImages?.has(S.imagePath) ? m.pictureBulletImages.get(S.imagePath) : k(S.imagePath, _) : void 0, K = 0;
|
|
4808
|
+
if (N && M) {
|
|
4809
|
+
if (y) t.font = b, K = t.measureText(y).width;
|
|
4810
|
+
else if (S && G) {
|
|
4803
4811
|
let e = S.sizePx;
|
|
4804
|
-
|
|
4812
|
+
K = G.height > 0 ? e * (G.width / G.height) : e;
|
|
4805
4813
|
}
|
|
4806
4814
|
}
|
|
4807
|
-
if (y) if (t.font = b, t.fillStyle = x,
|
|
4815
|
+
if (y) if (t.font = b, t.fillStyle = x, N && M) {
|
|
4808
4816
|
let e = t.direction;
|
|
4809
|
-
t.direction = "rtl", t.fillText(y,
|
|
4810
|
-
} else t.fillText(y,
|
|
4811
|
-
if (S && _ &&
|
|
4812
|
-
let e = S.sizePx, n =
|
|
4813
|
-
|
|
4817
|
+
t.direction = "rtl", t.fillText(y, U - K, V), t.direction = e;
|
|
4818
|
+
} else t.fillText(y, O, V);
|
|
4819
|
+
if (S && _ && G) {
|
|
4820
|
+
let e = S.sizePx, n = G.height > 0 ? e * (G.width / G.height) : e, r = V - e;
|
|
4821
|
+
N && M ? t.drawImage(G, U - n, r, n, e) : t.drawImage(G, O, r, n, e);
|
|
4814
4822
|
}
|
|
4815
|
-
let
|
|
4816
|
-
|
|
4817
|
-
let
|
|
4823
|
+
let q = D + g, J;
|
|
4824
|
+
J = P ? M ? D + A - K - F : q : C === "ctr" ? q + (A - g - F) / 2 : C === "r" ? D + A - K - F : q;
|
|
4825
|
+
let te = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ne = w || (u.endsWithBreak ?? !1), oe = (te && !N && !P ? fn(u.segments, A - g, F, te, ne) : null) ?? u.segments, se = N ? ln(u.segments, M) : null, ce = (e, t) => {
|
|
4818
4826
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4819
4827
|
let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
|
|
4820
4828
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
4821
|
-
},
|
|
4822
|
-
for (let n = 0; n <
|
|
4823
|
-
let c =
|
|
4824
|
-
if (
|
|
4825
|
-
let e =
|
|
4826
|
-
|
|
4829
|
+
}, le = oe.length;
|
|
4830
|
+
for (let n = 0; n < le; n++) {
|
|
4831
|
+
let c = se ? se.order[n] : n, u = oe[c], d = se ? se.rtl[c] : !1;
|
|
4832
|
+
if (N && (t.direction = d ? "rtl" : "ltr"), n > 0) {
|
|
4833
|
+
let e = se ? se.order[n - 1] : n - 1;
|
|
4834
|
+
J += ce(e, c);
|
|
4827
4835
|
}
|
|
4828
4836
|
if (u.isTab) {
|
|
4829
|
-
|
|
4837
|
+
J += u.tabWidthPx ?? 0;
|
|
4830
4838
|
continue;
|
|
4831
4839
|
}
|
|
4832
4840
|
let p = u.jext ?? 0, g = u.splitBefore, _ = u.perGap ?? 0, y = g && g.length > 0 ? g.length * _ : 0;
|
|
4833
4841
|
if (u.math) {
|
|
4834
|
-
let e =
|
|
4842
|
+
let e = Pn.get(u.math.nodes), n = u.math.width, r = u.math.ascent + u.math.descent;
|
|
4835
4843
|
if (e && n > 0 && r > 0) {
|
|
4836
|
-
let i =
|
|
4837
|
-
t.drawImage(a,
|
|
4844
|
+
let i = V - u.math.ascent, a = Fn(e, u.color);
|
|
4845
|
+
t.drawImage(a, J, i, n, r);
|
|
4838
4846
|
}
|
|
4839
|
-
|
|
4847
|
+
J += n, J += p;
|
|
4840
4848
|
continue;
|
|
4841
4849
|
}
|
|
4842
4850
|
t.font = u.font, t.fillStyle = u.color;
|
|
4843
|
-
let b = u.drawSizePx ?? u.sizePx, x =
|
|
4851
|
+
let b = u.drawSizePx ?? u.sizePx, x = V + (u.baseline ? -(u.baseline / 1e5) * u.sizePx : 0), S = u.letterSpacingPx ?? 0;
|
|
4844
4852
|
if (u.highlight && u.text) {
|
|
4845
|
-
let e =
|
|
4846
|
-
|
|
4853
|
+
let e = $(t, u.text, S) + y + p;
|
|
4854
|
+
Mn(t, J, x, e, b, u.highlight, u.color);
|
|
4847
4855
|
}
|
|
4848
4856
|
let C = u.shadow, w = (e, t, n, r) => {
|
|
4849
4857
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4850
|
-
if (S !== 0 &&
|
|
4858
|
+
if (S !== 0 && nr(t) > 1) {
|
|
4851
4859
|
let r = e, a = r.letterSpacing;
|
|
4852
|
-
if (
|
|
4860
|
+
if (ir(e)) {
|
|
4853
4861
|
r.letterSpacing = `${S}px`, i(t, n, x);
|
|
4854
4862
|
try {
|
|
4855
4863
|
r.letterSpacing = a;
|
|
@@ -4862,39 +4870,39 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4862
4870
|
}
|
|
4863
4871
|
}
|
|
4864
4872
|
} else i(t, n, x);
|
|
4865
|
-
}, T = (e) =>
|
|
4873
|
+
}, T = (e) => $(t, e, S), E = g && g.length > 0 ? $t([...u.text], g, _, T) : null, D = [...u.text], O = !!g && g.length === D.length - 1 && D.length > 1, k = (e, t) => {
|
|
4866
4874
|
if (v) {
|
|
4867
4875
|
let n = O ? S + _ : S;
|
|
4868
|
-
|
|
4876
|
+
Tn(e, u.text, J, x, b, n, t);
|
|
4869
4877
|
return;
|
|
4870
4878
|
}
|
|
4871
4879
|
if (O) {
|
|
4872
4880
|
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = S + _;
|
|
4873
|
-
if (
|
|
4881
|
+
if (ir(e)) {
|
|
4874
4882
|
let t = e, i = t.letterSpacing;
|
|
4875
|
-
t.letterSpacing = `${r}px`, n(u.text,
|
|
4883
|
+
t.letterSpacing = `${r}px`, n(u.text, J, x);
|
|
4876
4884
|
try {
|
|
4877
4885
|
t.letterSpacing = i;
|
|
4878
4886
|
} catch {}
|
|
4879
4887
|
} else {
|
|
4880
|
-
let t =
|
|
4888
|
+
let t = J;
|
|
4881
4889
|
for (let i = 0; i < D.length; i++) {
|
|
4882
4890
|
let a = D[i];
|
|
4883
4891
|
n(a, t, x), i < D.length - 1 && (t += e.measureText(a).width + r);
|
|
4884
4892
|
}
|
|
4885
4893
|
}
|
|
4886
|
-
} else if (E) for (let { text: n, dx: r } of E) w(e, n,
|
|
4887
|
-
else w(e, u.text,
|
|
4894
|
+
} else if (E) for (let { text: n, dx: r } of E) w(e, n, J + r, t);
|
|
4895
|
+
else w(e, u.text, J, t);
|
|
4888
4896
|
}, A = u.reflection;
|
|
4889
4897
|
if (A && u.text) {
|
|
4890
4898
|
let e = t.canvas.width || 0, n = t.canvas.height || 0;
|
|
4891
4899
|
if (e > 0 && n > 0) {
|
|
4892
4900
|
t.font = u.font;
|
|
4893
4901
|
let r = t.measureText(u.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : b * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : b * .2, o = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, l = t.getTransform(), d = Math.abs(l.a * l.d - l.b * l.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4894
|
-
|
|
4902
|
+
Jn(t, (e) => {
|
|
4895
4903
|
e.font = u.font, e.fillStyle = u.color, k(e, "fill");
|
|
4896
4904
|
}, {
|
|
4897
|
-
x: (
|
|
4905
|
+
x: (J - o) * f,
|
|
4898
4906
|
y: (x - i) * f,
|
|
4899
4907
|
w: Math.max(1, o + c) * f,
|
|
4900
4908
|
h: Math.max(1, i + a) * f
|
|
@@ -4902,18 +4910,18 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4902
4910
|
}
|
|
4903
4911
|
}
|
|
4904
4912
|
if (C) {
|
|
4905
|
-
let e = C.dir * Math.PI / 180, n =
|
|
4906
|
-
t.save(), t.shadowColor =
|
|
4913
|
+
let e = C.dir * Math.PI / 180, n = X(C.dist, s);
|
|
4914
|
+
t.save(), t.shadowColor = Q(C.color, C.alpha), t.shadowBlur = X(C.blur, s), t.shadowOffsetX = Math.cos(e) * n, t.shadowOffsetY = Math.sin(e) * n;
|
|
4907
4915
|
}
|
|
4908
4916
|
k(t, "fill"), C && t.restore();
|
|
4909
4917
|
let j = u.outline;
|
|
4910
|
-
j && j.width > 0 && (t.save(), t.lineWidth = Math.max(.5,
|
|
4911
|
-
let
|
|
4918
|
+
j && j.width > 0 && (t.save(), t.lineWidth = Math.max(.5, X(j.width, s)), t.strokeStyle = j.color ? `#${j.color}` : u.color, t.lineJoin = "round", k(t, "stroke"), t.restore()), t.font = u.font;
|
|
4919
|
+
let M = $(t, u.text, S) + y;
|
|
4912
4920
|
if (h && u.text && h({
|
|
4913
4921
|
text: u.text,
|
|
4914
|
-
inShapeX:
|
|
4915
|
-
inShapeY:
|
|
4916
|
-
w:
|
|
4922
|
+
inShapeX: J - r,
|
|
4923
|
+
inShapeY: H - i,
|
|
4924
|
+
w: M + p,
|
|
4917
4925
|
h: f,
|
|
4918
4926
|
fontSize: b,
|
|
4919
4927
|
font: u.font,
|
|
@@ -4923,27 +4931,27 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4923
4931
|
shapeH: o,
|
|
4924
4932
|
rotation: l,
|
|
4925
4933
|
hyperlink: u.hyperlink
|
|
4926
|
-
}), u.underline &&
|
|
4934
|
+
}), u.underline && Zt(t, J, x, M + p, b, u.underlineColor ?? u.color, u.underlineStyle, m.dpr), u.strikethrough) {
|
|
4927
4935
|
let n = Math.max(1, b * .05);
|
|
4928
4936
|
t.strokeStyle = u.color, t.lineWidth = n, t.setLineDash([]);
|
|
4929
4937
|
let r = x - b * .32;
|
|
4930
4938
|
if (u.strikeDouble) {
|
|
4931
4939
|
let i = n * .9, a = r - i, o = r + i;
|
|
4932
|
-
t.beginPath(), t.moveTo(
|
|
4940
|
+
t.beginPath(), t.moveTo(J, a + e(a, n, m.dpr)), t.lineTo(J + M + p, a + e(a, n, m.dpr)), t.moveTo(J, o + e(o, n, m.dpr)), t.lineTo(J + M + p, o + e(o, n, m.dpr)), t.stroke();
|
|
4933
4941
|
} else {
|
|
4934
4942
|
let i = r + e(r, n, m.dpr);
|
|
4935
|
-
t.beginPath(), t.moveTo(
|
|
4943
|
+
t.beginPath(), t.moveTo(J, i), t.lineTo(J + M + p, i), t.stroke();
|
|
4936
4944
|
}
|
|
4937
4945
|
}
|
|
4938
|
-
|
|
4946
|
+
J += M, J += p;
|
|
4939
4947
|
}
|
|
4940
|
-
|
|
4948
|
+
N && (t.direction = "ltr"), H += d;
|
|
4941
4949
|
}
|
|
4942
4950
|
t.restore();
|
|
4943
4951
|
}
|
|
4944
|
-
function
|
|
4952
|
+
function Hr(e, t, n, r, i) {
|
|
4945
4953
|
if (!e) return [];
|
|
4946
|
-
let a =
|
|
4954
|
+
let a = zt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Gt(n), s = r * i, c = [];
|
|
4947
4955
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4948
4956
|
widthPx: e.bevelT.w * s,
|
|
4949
4957
|
heightPx: e.bevelT.h * s,
|
|
@@ -4959,9 +4967,9 @@ function Ur(e, t, n, r, i) {
|
|
|
4959
4967
|
bottom: !0
|
|
4960
4968
|
}), c;
|
|
4961
4969
|
}
|
|
4962
|
-
function
|
|
4970
|
+
function Ur(e, t, n, r, i, a) {
|
|
4963
4971
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4964
|
-
let o = e.extrusionH * i * a, s =
|
|
4972
|
+
let o = e.extrusionH * i * a, s = wt(t, n * a, r * a, o);
|
|
4965
4973
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4966
4974
|
let c = [
|
|
4967
4975
|
64,
|
|
@@ -4982,14 +4990,14 @@ function Wr(e, t, n, r, i, a) {
|
|
|
4982
4990
|
rgb: c
|
|
4983
4991
|
};
|
|
4984
4992
|
}
|
|
4985
|
-
function
|
|
4993
|
+
function Wr(e, t, n, r, i, a, o, s = {}) {
|
|
4986
4994
|
if (i <= 0 || a <= 0) return !1;
|
|
4987
|
-
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 =
|
|
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 = St(t, i, a), p = f.corners;
|
|
4988
4996
|
if (d > 0) {
|
|
4989
|
-
let e = d / u, t =
|
|
4997
|
+
let e = d / u, t = Ge(f.corners, e / i, e / a);
|
|
4990
4998
|
t ? p = t : d = 0;
|
|
4991
4999
|
}
|
|
4992
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
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), _ = Ae(h, g);
|
|
4993
5001
|
if (!_) return !1;
|
|
4994
5002
|
let v = _.getContext("2d");
|
|
4995
5003
|
if (!v) return !1;
|
|
@@ -5002,17 +5010,17 @@ function Gr(e, t, n, r, i, a, o, s = {}) {
|
|
|
5002
5010
|
});
|
|
5003
5011
|
if (s.extrusion) {
|
|
5004
5012
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
5005
|
-
|
|
5013
|
+
Xt(v, s.extrusion, x(e));
|
|
5006
5014
|
}
|
|
5007
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
5008
|
-
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()),
|
|
5015
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Yt(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
5016
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), Re(_, e, h, g, p.map((e) => ({
|
|
5009
5017
|
x: n + e.x,
|
|
5010
5018
|
y: r + e.y
|
|
5011
5019
|
}))), !0;
|
|
5012
5020
|
}
|
|
5013
|
-
function
|
|
5021
|
+
function Gr(e, t, n, r, i, a, o, s, c = 0) {
|
|
5014
5022
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5015
|
-
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 =
|
|
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 = Ae(m, h);
|
|
5016
5024
|
if (!g) return !1;
|
|
5017
5025
|
let _ = g.getContext("2d");
|
|
5018
5026
|
if (!_) return !1;
|
|
@@ -5020,7 +5028,7 @@ function Kr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5020
5028
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
5021
5029
|
for (let e of a) {
|
|
5022
5030
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5023
|
-
|
|
5031
|
+
Yt(_, e, {
|
|
5024
5032
|
x: f - t,
|
|
5025
5033
|
y: f - t,
|
|
5026
5034
|
w: v + 2 * t,
|
|
@@ -5029,17 +5037,17 @@ function Kr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5029
5037
|
}
|
|
5030
5038
|
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;
|
|
5031
5039
|
}
|
|
5032
|
-
var
|
|
5033
|
-
function
|
|
5034
|
-
let t =
|
|
5040
|
+
var Kr = /* @__PURE__ */ new WeakMap();
|
|
5041
|
+
function qr(e) {
|
|
5042
|
+
let t = Kr.get(e);
|
|
5035
5043
|
return t || (t = async (t, n) => {
|
|
5036
5044
|
let r = await e(t);
|
|
5037
5045
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
5038
|
-
},
|
|
5046
|
+
}, Kr.set(e, t)), t;
|
|
5039
5047
|
}
|
|
5040
|
-
function
|
|
5041
|
-
let o =
|
|
5042
|
-
return
|
|
5048
|
+
function Jr(e, t, n = qr(t), r, i, a) {
|
|
5049
|
+
let o = qr(t);
|
|
5050
|
+
return q(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
|
|
5043
5051
|
tiff: r,
|
|
5044
5052
|
svgDecoder: a,
|
|
5045
5053
|
...i ?? {}
|
|
@@ -5048,11 +5056,11 @@ function Yr(e, t, n = Jr(t), r, i, a) {
|
|
|
5048
5056
|
return e;
|
|
5049
5057
|
});
|
|
5050
5058
|
}
|
|
5051
|
-
function
|
|
5052
|
-
let r =
|
|
5059
|
+
function Yr(e, t, n) {
|
|
5060
|
+
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5053
5061
|
e.save();
|
|
5054
5062
|
try {
|
|
5055
|
-
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))),
|
|
5063
|
+
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), le(e, "tiff", {
|
|
5056
5064
|
x: r,
|
|
5057
5065
|
y: i,
|
|
5058
5066
|
width: a,
|
|
@@ -5062,11 +5070,11 @@ function Xr(e, t, n) {
|
|
|
5062
5070
|
e.restore();
|
|
5063
5071
|
}
|
|
5064
5072
|
}
|
|
5065
|
-
async function
|
|
5073
|
+
async function Xr(e, t, n, r, i, o, s = 1, c, l) {
|
|
5066
5074
|
if (i) try {
|
|
5067
|
-
let a = t.mimeType === "image/svg+xml", u =
|
|
5075
|
+
let a = t.mimeType === "image/svg+xml", u = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5068
5076
|
if (!u) return;
|
|
5069
|
-
let { widthPt: d, heightPt: f } = u, p =
|
|
5077
|
+
let { widthPt: d, heightPt: f } = u, p = En(X(t.width, n), X(t.height, n), s, t.srcRect), h = A(t) || a, g = h ? p : l && !t.duotone ? Dn(l, Z(On(t), h ? void 0 : t.duotone)) : void 0, _ = g && "maxRetainedPixels" in g ? g.maxRetainedPixels : void 0, y = {
|
|
5070
5078
|
...g ? {
|
|
5071
5079
|
targetWidthPx: g.targetWidthPx,
|
|
5072
5080
|
targetHeightPx: g.targetHeightPx,
|
|
@@ -5077,14 +5085,14 @@ async function Zr(e, t, n, r, i, o, s = 1, c, l) {
|
|
|
5077
5085
|
if (A(t)) try {
|
|
5078
5086
|
b = await I(t.svgImagePath, i, y);
|
|
5079
5087
|
} catch {
|
|
5080
|
-
b = a ? await I(t.imagePath, i, y) : await
|
|
5088
|
+
b = a ? await I(t.imagePath, i, y) : await Je(t.imagePath, t.mimeType, t.duotone, i, {
|
|
5081
5089
|
widthPt: d,
|
|
5082
5090
|
heightPt: f,
|
|
5083
5091
|
...g ?? {},
|
|
5084
5092
|
tiff: o
|
|
5085
5093
|
});
|
|
5086
5094
|
}
|
|
5087
|
-
else b = a ? await I(t.imagePath, i, y) : await
|
|
5095
|
+
else b = a ? await I(t.imagePath, i, y) : await Je(t.imagePath, t.mimeType, t.duotone, i, {
|
|
5088
5096
|
widthPt: d,
|
|
5089
5097
|
heightPt: f,
|
|
5090
5098
|
...g ?? {},
|
|
@@ -5092,16 +5100,16 @@ async function Zr(e, t, n, r, i, o, s = 1, c, l) {
|
|
|
5092
5100
|
});
|
|
5093
5101
|
if (!b || r()) return;
|
|
5094
5102
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5095
|
-
let x =
|
|
5103
|
+
let x = X(t.x, n), S = X(t.y, n), C = X(t.width, n), w = X(t.height, n);
|
|
5096
5104
|
(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)));
|
|
5097
5105
|
let T = (e, n, r, i, a) => {
|
|
5098
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
5106
|
+
t.custGeom && t.custGeom.length > 0 ? Ir(e, t.custGeom, n, r, i, a) : t.prstGeom && v(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5099
5107
|
}, E = (e, t, n, r, i) => {
|
|
5100
5108
|
e.beginPath(), T(e, t, n, r, i);
|
|
5101
5109
|
}, D = (e, n, r, i, a) => {
|
|
5102
5110
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
|
|
5103
5111
|
}, O = (e, r, i, a, o) => {
|
|
5104
|
-
t.stroke && (e.save(),
|
|
5112
|
+
t.stroke && (e.save(), $r(e, t.stroke, n, {
|
|
5105
5113
|
x: r,
|
|
5106
5114
|
y: i,
|
|
5107
5115
|
w: a,
|
|
@@ -5113,69 +5121,69 @@ async function Zr(e, t, n, r, i, o, s = 1, c, l) {
|
|
|
5113
5121
|
let t = Math.max(.5, s.contourW * n);
|
|
5114
5122
|
e.save(), e.beginPath();
|
|
5115
5123
|
let c = t * 2 + Math.max(a, o);
|
|
5116
|
-
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), T(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, r, i, a, o), e.strokeStyle =
|
|
5124
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), T(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, r, i, a, o), e.strokeStyle = Q(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5117
5125
|
}
|
|
5118
|
-
}, j = t.scene3d &&
|
|
5119
|
-
e.save(), D(e, n, r, i, a),
|
|
5126
|
+
}, j = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null, M = (e, n, r, i, a) => {
|
|
5127
|
+
e.save(), D(e, n, r, i, a), je(e, b, t.srcRect, n, r, i, a), e.restore();
|
|
5120
5128
|
}, N = (e, t, n, r, i) => {
|
|
5121
5129
|
M(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
|
|
5122
5130
|
}, P = (e, t, n, r, i) => {
|
|
5123
5131
|
M(e, t, n, r, i), O(e, t, n, r, i);
|
|
5124
|
-
}, F = e.getTransform(), L = Math.abs(F.a * F.d - F.b * F.c), R = L > 0 ? Math.sqrt(L) : 1, z =
|
|
5132
|
+
}, F = e.getTransform(), L = Math.abs(F.a * F.d - F.b * F.c), R = L > 0 ? Math.sqrt(L) : 1, z = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, R), B = j ? Ur(t.sp3d, j.camera, C, w, n, R) : null, V = t.stroke ? t.stroke.width * n / 2 : 0, H = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, U = B ? Math.hypot(B.offsetX, B.offsetY) / R : 0, ee = V + H + U + 2, G = (e) => {
|
|
5125
5133
|
if (j) {
|
|
5126
|
-
if (
|
|
5134
|
+
if (Wr(e, j.camera, x, S, C, w, P, {
|
|
5127
5135
|
bevels: z,
|
|
5128
5136
|
extrusion: B ?? void 0,
|
|
5129
5137
|
paintEdges: k,
|
|
5130
5138
|
edgePadCss: ee
|
|
5131
5139
|
})) return;
|
|
5132
|
-
} else if (z.length > 0 &&
|
|
5140
|
+
} else if (z.length > 0 && Gr(e, x, S, C, w, z, P, k, ee)) return;
|
|
5133
5141
|
N(e, x, S, C, w);
|
|
5134
|
-
},
|
|
5142
|
+
}, K = (e, t, n, r, i, a) => {
|
|
5135
5143
|
e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5136
|
-
},
|
|
5137
|
-
j &&
|
|
5138
|
-
},
|
|
5144
|
+
}, q = (e, t) => {
|
|
5145
|
+
j && Wr(e, j.camera, x, S, C, w, (e, n, r, i, a) => K(e, t, n, r, i, a)) || K(e, t, x, S, C, w);
|
|
5146
|
+
}, J = e.getTransform(), te = Math.abs(J.a * J.d - J.b * J.c), ne = te > 0 ? Math.sqrt(te) : 1, re = V + H, ie = (t.custGeom && t.custGeom.length > 0 ? he(t.custGeom, x, S, C, w) : t.prstGeom && m(t.prstGeom.toLowerCase()) ? W(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
|
|
5139
5147
|
x,
|
|
5140
5148
|
y: S,
|
|
5141
5149
|
w: C,
|
|
5142
5150
|
h: w
|
|
5143
|
-
},
|
|
5144
|
-
bbox:
|
|
5145
|
-
anchor:
|
|
5146
|
-
},
|
|
5147
|
-
|
|
5151
|
+
}, ae = j ? Mr(j.camera, J, x, S, C, w, ee, t.shadow?.algn) : {
|
|
5152
|
+
bbox: Or(J, ie.x - re, ie.y - re, ie.w + re * 2, ie.h + re * 2),
|
|
5153
|
+
anchor: jr(J, x, S, C, w, t.shadow?.algn)
|
|
5154
|
+
}, oe = n * ne, se = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), ce = (e) => q(e, "#000");
|
|
5155
|
+
Pr(e, t, j && se ? Nr(G, J, ae.bbox, {
|
|
5148
5156
|
w: e.canvas.width || 0,
|
|
5149
5157
|
h: e.canvas.height || 0
|
|
5150
|
-
}) :
|
|
5158
|
+
}) : G, j && se ? Nr(ce, J, ae.bbox, {
|
|
5151
5159
|
w: e.canvas.width || 0,
|
|
5152
5160
|
h: e.canvas.height || 0
|
|
5153
|
-
}) :
|
|
5161
|
+
}) : ce, ae.bbox, ae.anchor, n, oe, J), e.restore();
|
|
5154
5162
|
} catch (i) {
|
|
5155
5163
|
if (a(i, "tiff")) {
|
|
5156
|
-
r() ||
|
|
5164
|
+
r() || Yr(e, t, n);
|
|
5157
5165
|
return;
|
|
5158
5166
|
}
|
|
5159
|
-
if (
|
|
5167
|
+
if (Le(i) || qe(i)) throw i;
|
|
5160
5168
|
}
|
|
5161
5169
|
}
|
|
5162
|
-
async function
|
|
5163
|
-
let f =
|
|
5170
|
+
async function Zr(e, t, n, r, i, o, s, c, l = 1, u, d) {
|
|
5171
|
+
let f = X(t.x, n), p = X(t.y, n), m = X(t.width, n), h = X(t.height, n), g, _ = !1;
|
|
5164
5172
|
if (t.posterPath && i) try {
|
|
5165
|
-
g = await
|
|
5173
|
+
g = await Jr(t, i, s, c, t.posterMimeType === "image/svg+xml" ? En(m, h, l) : d ? Dn(d, Z(t.posterPath)) : void 0, u);
|
|
5166
5174
|
} catch (e) {
|
|
5167
5175
|
if (a(e, "tiff")) _ = !0;
|
|
5168
|
-
else if (
|
|
5176
|
+
else if (Le(e) || qe(e)) throw e;
|
|
5169
5177
|
}
|
|
5170
|
-
r() || (e.save(),
|
|
5178
|
+
r() || (e.save(), ei(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && le(e, "tiff", {
|
|
5171
5179
|
x: f,
|
|
5172
5180
|
y: p,
|
|
5173
5181
|
width: m,
|
|
5174
5182
|
height: h
|
|
5175
|
-
})), o ||
|
|
5183
|
+
})), o || an(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
|
|
5176
5184
|
}
|
|
5177
|
-
function
|
|
5178
|
-
let s = Math.max(.5,
|
|
5185
|
+
function Qr(e, t, n, r, i, a, o) {
|
|
5186
|
+
let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5179
5187
|
if (u === 0) return;
|
|
5180
5188
|
let d = -l / u, f = c / u, p;
|
|
5181
5189
|
switch (i) {
|
|
@@ -5224,41 +5232,41 @@ function $r(e, t, n, r, i, a, o) {
|
|
|
5224
5232
|
break;
|
|
5225
5233
|
default: return;
|
|
5226
5234
|
}
|
|
5227
|
-
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 ?
|
|
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 ? Nn(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);
|
|
5228
5236
|
for (let r of p) {
|
|
5229
5237
|
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5230
5238
|
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();
|
|
5231
5239
|
}
|
|
5232
5240
|
e.restore();
|
|
5233
5241
|
}
|
|
5234
|
-
function
|
|
5235
|
-
if (
|
|
5236
|
-
let n =
|
|
5242
|
+
function $r(e, t, n, r, i = 0) {
|
|
5243
|
+
if (ke(e, t, n), t?.fill && r) {
|
|
5244
|
+
let n = Nn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5237
5245
|
n && (e.strokeStyle = n);
|
|
5238
5246
|
}
|
|
5239
5247
|
}
|
|
5240
|
-
function
|
|
5248
|
+
function ei(e, t, n) {
|
|
5241
5249
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5242
|
-
let r =
|
|
5250
|
+
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5243
5251
|
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));
|
|
5244
5252
|
}
|
|
5245
|
-
function
|
|
5253
|
+
function ti(t, n, r, i, a = {
|
|
5246
5254
|
themeMajorFont: null,
|
|
5247
5255
|
themeMinorFont: null,
|
|
5248
5256
|
dpr: 1
|
|
5249
5257
|
}, o) {
|
|
5250
|
-
t.save(),
|
|
5251
|
-
let s =
|
|
5258
|
+
t.save(), ei(t, n, r);
|
|
5259
|
+
let s = X(n.x, r), c = X(n.y, r), l = n.cols.map((e) => X(e, r)), u = l.length, d = (e, t) => {
|
|
5252
5260
|
let n = 0;
|
|
5253
5261
|
for (let r = 0; r < t; r++) n += l[e + r] ?? 0;
|
|
5254
5262
|
return n;
|
|
5255
|
-
}, f = n.rows.map((e) =>
|
|
5263
|
+
}, f = n.rows.map((e) => X(e.height, r));
|
|
5256
5264
|
for (let e = 0; e < n.rows.length; e++) {
|
|
5257
5265
|
let o = n.rows[e];
|
|
5258
5266
|
for (let n = 0; n < o.cells.length; n++) {
|
|
5259
5267
|
let s = o.cells[n];
|
|
5260
5268
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5261
|
-
let c = d(n, s.gridSpan || 1), l =
|
|
5269
|
+
let c = d(n, s.gridSpan || 1), l = Vr(t, s.textBody, 0, 0, c, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5262
5270
|
l > f[e] && (f[e] = l);
|
|
5263
5271
|
}
|
|
5264
5272
|
}
|
|
@@ -5269,7 +5277,7 @@ function ni(t, n, r, i, a = {
|
|
|
5269
5277
|
if (c.hMerge || c.vMerge) continue;
|
|
5270
5278
|
let l = c.rowSpan || 1;
|
|
5271
5279
|
if (l <= 1 || !c.textBody) continue;
|
|
5272
|
-
let u = d(s, c.gridSpan || 1), p = n.rows.slice(e, Math.min(n.rows.length, e + l)).some((e) => e.height === 0), m =
|
|
5280
|
+
let u = d(s, c.gridSpan || 1), p = n.rows.slice(e, Math.min(n.rows.length, e + l)).some((e) => e.height === 0), m = Vr(t, c.textBody, 0, 0, u, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, p) || 0, h = 0;
|
|
5273
5281
|
for (let t = 0; t < l && e + t < f.length; t++) h += f[e + t];
|
|
5274
5282
|
if (m > h) {
|
|
5275
5283
|
let t = (m - h) / l;
|
|
@@ -5295,7 +5303,7 @@ function ni(t, n, r, i, a = {
|
|
|
5295
5303
|
column: 0
|
|
5296
5304
|
};
|
|
5297
5305
|
if (o) {
|
|
5298
|
-
let e =
|
|
5306
|
+
let e = X(n.width, r), t = X(n.height, r), i = s + e / 2, a = c + t / 2, l = n.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l);
|
|
5299
5307
|
_ = (e) => {
|
|
5300
5308
|
let t = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - a;
|
|
5301
5309
|
n.flipH && (t = -t), n.flipV && (r = -r);
|
|
@@ -5336,14 +5344,14 @@ function ni(t, n, r, i, a = {
|
|
|
5336
5344
|
}
|
|
5337
5345
|
}
|
|
5338
5346
|
for (let { cell: e, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of y) {
|
|
5339
|
-
let f =
|
|
5347
|
+
let f = Nn(e.fill, t, o, s, c, l, n.rotation);
|
|
5340
5348
|
if (f && (t.fillStyle = f, t.fillRect(o, s, c, l)), e.textBody) {
|
|
5341
5349
|
_ && (v = {
|
|
5342
5350
|
row: d,
|
|
5343
5351
|
column: u
|
|
5344
5352
|
});
|
|
5345
|
-
let n = e.textColor ?
|
|
5346
|
-
|
|
5353
|
+
let n = e.textColor ? Q(e.textColor) : null;
|
|
5354
|
+
Vr(t, e.textBody, o, s, c, l, r, n, 0, !1, !1, "#000000", i, a, _);
|
|
5347
5355
|
}
|
|
5348
5356
|
}
|
|
5349
5357
|
let x = a.dpr, S = (e, t) => {
|
|
@@ -5351,13 +5359,13 @@ function ni(t, n, r, i, a = {
|
|
|
5351
5359
|
let n = b[e][t];
|
|
5352
5360
|
return n < 0 ? null : y[n];
|
|
5353
5361
|
}, C = (i, a, o, s, c) => {
|
|
5354
|
-
if (
|
|
5362
|
+
if ($r(t, i, r, {
|
|
5355
5363
|
x: Math.min(a, s),
|
|
5356
5364
|
y: Math.min(o, c),
|
|
5357
5365
|
w: Math.max(1, Math.abs(s - a)),
|
|
5358
5366
|
h: Math.max(1, Math.abs(c - o))
|
|
5359
5367
|
}, n.rotation), i.cmpd === "dbl" && !i.dashStyle && !i.customDash?.length && (a === s || o === c)) {
|
|
5360
|
-
t.fillStyle = t.strokeStyle,
|
|
5368
|
+
t.fillStyle = t.strokeStyle, xe(t, a, o, s, c, Math.max(.5, X(i.width, r)), x);
|
|
5361
5369
|
return;
|
|
5362
5370
|
}
|
|
5363
5371
|
let l = a === s ? e(a, t.lineWidth, x) : 0, u = o === c ? e(o, t.lineWidth, x) : 0;
|
|
@@ -5375,7 +5383,7 @@ function ni(t, n, r, i, a = {
|
|
|
5375
5383
|
for (; a < r;) {
|
|
5376
5384
|
let e = b[t][a], o = a + 1;
|
|
5377
5385
|
for (; o < r && b[t][o] === e;) o++;
|
|
5378
|
-
let s = S(t, a), c =
|
|
5386
|
+
let s = S(t, a), c = hn(i.borderB, s ? s.cell.borderT : null);
|
|
5379
5387
|
if (c) {
|
|
5380
5388
|
let e = h(a, o - a);
|
|
5381
5389
|
C(c, e, n, e + d(a, o - a), n);
|
|
@@ -5391,16 +5399,16 @@ function ni(t, n, r, i, a = {
|
|
|
5391
5399
|
for (; n <= e.lastRi;) {
|
|
5392
5400
|
let r = b[n][v], i = n;
|
|
5393
5401
|
for (; i + 1 <= e.lastRi && b[i + 1][v] === r;) i++;
|
|
5394
|
-
let a = S(n, v), o =
|
|
5402
|
+
let a = S(n, v), o = hn(p, a ? y(a.cell) : null);
|
|
5395
5403
|
o && C(o, t, g[n], t, g[i] + f[i]), n = i + 1;
|
|
5396
5404
|
}
|
|
5397
5405
|
}
|
|
5398
|
-
i.diagonalTL && (
|
|
5406
|
+
i.diagonalTL && ($r(t, i.diagonalTL, r, {
|
|
5399
5407
|
x: a,
|
|
5400
5408
|
y: o,
|
|
5401
5409
|
w: s,
|
|
5402
5410
|
h: c
|
|
5403
|
-
}, n.rotation), t.beginPath(), t.moveTo(a, o), t.lineTo(a + s, o + c), t.stroke()), i.diagonalTR && (
|
|
5411
|
+
}, n.rotation), t.beginPath(), t.moveTo(a, o), t.lineTo(a + s, o + c), t.stroke()), i.diagonalTR && ($r(t, i.diagonalTR, r, {
|
|
5404
5412
|
x: a,
|
|
5405
5413
|
y: o,
|
|
5406
5414
|
w: s,
|
|
@@ -5409,14 +5417,14 @@ function ni(t, n, r, i, a = {
|
|
|
5409
5417
|
}
|
|
5410
5418
|
t.restore();
|
|
5411
5419
|
}
|
|
5412
|
-
function
|
|
5420
|
+
function ni(e, t, n, r) {
|
|
5413
5421
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5414
5422
|
}
|
|
5415
|
-
var
|
|
5416
|
-
function
|
|
5417
|
-
|
|
5423
|
+
var ri = /* @__PURE__ */ new WeakMap();
|
|
5424
|
+
function ii(e) {
|
|
5425
|
+
ri.set(e, (ri.get(e) ?? 0) + 1);
|
|
5418
5426
|
}
|
|
5419
|
-
function
|
|
5427
|
+
function ai(e, t, n, r, i) {
|
|
5420
5428
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5421
5429
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5422
5430
|
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([]);
|
|
@@ -5436,21 +5444,21 @@ function oi(e, t, n, r, i) {
|
|
|
5436
5444
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5437
5445
|
e.restore();
|
|
5438
5446
|
}
|
|
5439
|
-
async function
|
|
5440
|
-
return
|
|
5441
|
-
}
|
|
5442
|
-
async function ci(e, t, n, r, i = {}, a) {
|
|
5443
|
-
let o = i.fetchImage ?? (i.fetchMedia ? Jr(i.fetchMedia) : void 0), s = (ii.get(e) ?? 0) + 1;
|
|
5444
|
-
ii.set(e, s);
|
|
5445
|
-
let c = () => ii.get(e) !== s, l = () => c() ? Promise.resolve(e) : li(e, t, n, r, i, a, o, c);
|
|
5446
|
-
return o && Mn(t) ? j(o, i.imageResources, l) : l();
|
|
5447
|
+
async function oi(e, t, n, r, i = {}, a) {
|
|
5448
|
+
return si(e, t, n, r, i, a);
|
|
5447
5449
|
}
|
|
5448
|
-
async function
|
|
5449
|
-
let
|
|
5450
|
-
|
|
5450
|
+
async function si(e, t, n, r, i = {}, a) {
|
|
5451
|
+
let o = i.fetchImage ?? (i.fetchMedia ? qr(i.fetchMedia) : void 0), s = (ri.get(e) ?? 0) + 1;
|
|
5452
|
+
ri.set(e, s);
|
|
5453
|
+
let c = () => ri.get(e) !== s, l = () => c() ? Promise.resolve(e) : ci(e, t, n, r, i, a, o, c);
|
|
5454
|
+
return o && jn(t) ? j(o, i.imageResources, l) : l();
|
|
5455
|
+
}
|
|
5456
|
+
async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
5457
|
+
let l = i.width ?? ((oe(e) ? e.offsetWidth : 0) || 960), u = l / n, d = Math.round(l), f = Math.round(r * u), p = i.dpr ?? L(), m = Ve(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await An(t, d, f, u, h, i.imageResources, i.fetchImage, i.fetchMedia, s, i.tiff);
|
|
5458
|
+
e.width = m.width, e.height = m.height, oe(e) && (e.style.width = `${d}px`, e.style.display || (e.style.display = "block"));
|
|
5451
5459
|
let _ = e.getContext("2d");
|
|
5452
5460
|
if (!_) throw Error("Could not get 2D context");
|
|
5453
|
-
if (_.scale(h, h), t.parseError) return
|
|
5461
|
+
if (_.scale(h, h), t.parseError) return ai(_, d, f, t.slideNumber, t.parseError), e;
|
|
5454
5462
|
let v = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), b = {
|
|
5455
5463
|
themeMajorFont: i.majorFont ?? null,
|
|
5456
5464
|
themeMinorFont: i.minorFont ?? null,
|
|
@@ -5458,13 +5466,13 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5458
5466
|
embeddedFontAliases: i.embeddedFontAliases,
|
|
5459
5467
|
embeddedFontAuthoredFamilies: i.embeddedFontAuthoredFamilies,
|
|
5460
5468
|
dpr: h,
|
|
5461
|
-
smartArtFallbackTextColor:
|
|
5469
|
+
smartArtFallbackTextColor: yn(t.background, v),
|
|
5462
5470
|
pictureBulletImages: y
|
|
5463
5471
|
};
|
|
5464
|
-
if (await
|
|
5472
|
+
if (await or(_, t.background, d, f, u, c, i.fetchImage, i.tiff, i.svgDecoder, g), c() || (i.math && await Ln(t, i.math), c())) return e;
|
|
5465
5473
|
let x = t.slideNumber;
|
|
5466
5474
|
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5467
|
-
let t = e, n = t.mimeType === "image/svg+xml", r = A(t) || n, a = !r && !t.duotone ?
|
|
5475
|
+
let t = e, n = t.mimeType === "image/svg+xml", r = A(t) || n, a = !r && !t.duotone ? Dn(g, Z(On(t), t.duotone)) : void 0, o = En(X(t.width, u), X(t.height, u), h, t.srcRect), s = r ? o : a, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
|
|
5468
5476
|
...s ? {
|
|
5469
5477
|
targetWidthPx: s.targetWidthPx,
|
|
5470
5478
|
targetHeightPx: s.targetHeightPx,
|
|
@@ -5475,9 +5483,9 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5475
5483
|
if (A(t)) I(t.svgImagePath, i.fetchImage, l).catch(() => void 0);
|
|
5476
5484
|
else if (n) I(t.imagePath, i.fetchImage, l).catch(() => void 0);
|
|
5477
5485
|
else {
|
|
5478
|
-
let e =
|
|
5486
|
+
let e = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5479
5487
|
if (!e) continue;
|
|
5480
|
-
|
|
5488
|
+
Je(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5481
5489
|
widthPt: e.widthPt,
|
|
5482
5490
|
heightPt: e.heightPt,
|
|
5483
5491
|
...s ?? {},
|
|
@@ -5487,7 +5495,7 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5487
5495
|
}
|
|
5488
5496
|
} else if (e.type === "media") {
|
|
5489
5497
|
let t = e;
|
|
5490
|
-
t.posterPath && i.fetchMedia &&
|
|
5498
|
+
t.posterPath && i.fetchMedia && Jr(t, i.fetchMedia, s, i.tiff, t.posterMimeType === "image/svg+xml" ? En(X(t.width, u), X(t.height, u), h) : Dn(g, Z(t.posterPath)), i.svgDecoder).catch(() => void 0);
|
|
5491
5499
|
}
|
|
5492
5500
|
let S = /* @__PURE__ */ new Map();
|
|
5493
5501
|
if (i.fetchImage) {
|
|
@@ -5495,13 +5503,13 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5495
5503
|
for (let e of t.elements) {
|
|
5496
5504
|
if (e.type !== "chart" || !Number.isFinite(e.width) || e.width <= 0 || !Number.isFinite(e.height) || e.height <= 0) continue;
|
|
5497
5505
|
let t = {
|
|
5498
|
-
widthPt: e.width /
|
|
5499
|
-
heightPt: e.height /
|
|
5500
|
-
targetWidthPx:
|
|
5501
|
-
targetHeightPx:
|
|
5506
|
+
widthPt: e.width / Y,
|
|
5507
|
+
heightPt: e.height / Y,
|
|
5508
|
+
targetWidthPx: X(e.width, u) * h,
|
|
5509
|
+
targetHeightPx: X(e.height, u) * h
|
|
5502
5510
|
}, n = [], r = !0;
|
|
5503
|
-
for (let i of
|
|
5504
|
-
let e =
|
|
5511
|
+
for (let i of Te(e.chart)) {
|
|
5512
|
+
let e = Ee(i, t);
|
|
5505
5513
|
if (!e) {
|
|
5506
5514
|
r = !1;
|
|
5507
5515
|
break;
|
|
@@ -5518,8 +5526,8 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5518
5526
|
});
|
|
5519
5527
|
}
|
|
5520
5528
|
let s = /* @__PURE__ */ new Map();
|
|
5521
|
-
for (let e of
|
|
5522
|
-
let { fill: t } = e, n =
|
|
5529
|
+
for (let e of Me(o.map(({ element: e }) => e.chart), (e, t) => Ee(e, o[t].frame) != null)) {
|
|
5530
|
+
let { fill: t } = e, n = Ie(t);
|
|
5523
5531
|
s.has(n) || s.set(n, {
|
|
5524
5532
|
fill: t,
|
|
5525
5533
|
widthPt: 0,
|
|
@@ -5529,9 +5537,9 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5529
5537
|
});
|
|
5530
5538
|
}
|
|
5531
5539
|
for (let { usages: e } of o) for (let { usage: t, size: n } of e) {
|
|
5532
|
-
let { fill: e } = t, r =
|
|
5540
|
+
let { fill: e } = t, r = Ie(e), i = s.get(r);
|
|
5533
5541
|
if (!i) continue;
|
|
5534
|
-
let a = i.preserveNaturalSize || t.preserveNaturalSize, o = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 :
|
|
5542
|
+
let a = i.preserveNaturalSize || t.preserveNaturalSize, o = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : Dn(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || A({
|
|
5535
5543
|
svgImagePath: e.svgImagePath,
|
|
5536
5544
|
srcRect: o ? !0 : null
|
|
5537
5545
|
}));
|
|
@@ -5547,9 +5555,9 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5547
5555
|
});
|
|
5548
5556
|
}
|
|
5549
5557
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5550
|
-
let n =
|
|
5558
|
+
let n = Qe(t.bullet);
|
|
5551
5559
|
if (n.type === "blip") {
|
|
5552
|
-
let i =
|
|
5560
|
+
let i = Zn(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
|
|
5553
5561
|
a ? Number.isFinite(i) && i > 0 && (a.targetHeightPx = Math.max(a.targetHeightPx ?? 0, i)) : r.set(n.imagePath, {
|
|
5554
5562
|
mimeType: n.mimeType,
|
|
5555
5563
|
...Number.isFinite(i) && i > 0 ? { targetHeightPx: i } : {}
|
|
@@ -5562,10 +5570,10 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5562
5570
|
let a = t === "image/svg+xml" ? r === void 0 ? {} : {
|
|
5563
5571
|
targetWidthPx: 1,
|
|
5564
5572
|
targetHeightPx: r
|
|
5565
|
-
} :
|
|
5573
|
+
} : Dn(g, Z(e)) ?? {}, o = t === "image/svg+xml" ? await I(e, n, {
|
|
5566
5574
|
...a,
|
|
5567
5575
|
workerDecoder: i.svgDecoder
|
|
5568
|
-
}) : await
|
|
5576
|
+
}) : await q(e, t, n, {
|
|
5569
5577
|
tiff: i.tiff,
|
|
5570
5578
|
...a
|
|
5571
5579
|
});
|
|
@@ -5575,7 +5583,7 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5575
5583
|
y.set(e, null);
|
|
5576
5584
|
return;
|
|
5577
5585
|
}
|
|
5578
|
-
if (
|
|
5586
|
+
if (Le(t) || qe(t)) throw t;
|
|
5579
5587
|
y.set(e, null);
|
|
5580
5588
|
}
|
|
5581
5589
|
}), o = [...s].map(async ([e, t]) => {
|
|
@@ -5588,7 +5596,7 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5588
5596
|
let t = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : I(r.imagePath, n, {
|
|
5589
5597
|
...f ?? {},
|
|
5590
5598
|
workerDecoder: i.svgDecoder
|
|
5591
|
-
}) :
|
|
5599
|
+
}) : Je(r.imagePath, r.mimeType, r.duotone, n, {
|
|
5592
5600
|
widthPt: o,
|
|
5593
5601
|
heightPt: s,
|
|
5594
5602
|
...f ?? {},
|
|
@@ -5613,7 +5621,7 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5613
5621
|
S.set(e, null);
|
|
5614
5622
|
return;
|
|
5615
5623
|
}
|
|
5616
|
-
if (
|
|
5624
|
+
if (Le(t) || qe(t)) throw t;
|
|
5617
5625
|
S.set(e, null);
|
|
5618
5626
|
}
|
|
5619
5627
|
});
|
|
@@ -5622,66 +5630,66 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5622
5630
|
}
|
|
5623
5631
|
for (let [n, r] of t.elements.entries()) {
|
|
5624
5632
|
if (c()) return e;
|
|
5625
|
-
if (r.type === "shape")
|
|
5633
|
+
if (r.type === "shape") Fr(_, r, u, v, x, b, o ? (e) => o({
|
|
5626
5634
|
...e,
|
|
5627
5635
|
elementIndex: n,
|
|
5628
5636
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5629
5637
|
}) : void 0, i.fetchImage);
|
|
5630
|
-
else if (r.type === "picture") await
|
|
5631
|
-
else if (r.type === "table")
|
|
5638
|
+
else if (r.type === "picture") await Xr(_, r, u, c, i.fetchImage, i.tiff, h, i.svgDecoder, g);
|
|
5639
|
+
else if (r.type === "table") ti(_, r, u, x, b, o ? (e) => o({
|
|
5632
5640
|
...e,
|
|
5633
5641
|
elementIndex: n,
|
|
5634
5642
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5635
5643
|
}) : void 0);
|
|
5636
|
-
else if (r.type === "media") await
|
|
5644
|
+
else if (r.type === "media") await Zr(_, r, u, c, i.fetchMedia, i.skipMediaControls, i.fetchImage, i.tiff, h, i.svgDecoder, g);
|
|
5637
5645
|
else if (r.type === "chart") {
|
|
5638
|
-
let e =
|
|
5639
|
-
_.save(),
|
|
5640
|
-
x:
|
|
5641
|
-
y:
|
|
5642
|
-
w:
|
|
5643
|
-
h:
|
|
5644
|
-
}, e, r.rotation, i.threeD, i.regionMap, (e) => S.get(
|
|
5646
|
+
let e = Y * u;
|
|
5647
|
+
_.save(), ei(_, r, u), Ke(_, r.chart, {
|
|
5648
|
+
x: X(r.x, u),
|
|
5649
|
+
y: X(r.y, u),
|
|
5650
|
+
w: X(r.width, u),
|
|
5651
|
+
h: X(r.height, u)
|
|
5652
|
+
}, e, r.rotation, i.threeD, i.regionMap, (e) => S.get(Ie(e)), i.chartEx), _.restore();
|
|
5645
5653
|
}
|
|
5646
5654
|
}
|
|
5647
|
-
return c() || i.dim &&
|
|
5655
|
+
return c() || i.dim && ni(_, i.dim, d, f), e;
|
|
5648
5656
|
}
|
|
5649
5657
|
//#endregion
|
|
5650
5658
|
//#region packages/pptx/src/google-fonts.ts
|
|
5651
|
-
var
|
|
5659
|
+
var li = {
|
|
5652
5660
|
...T,
|
|
5653
5661
|
...b
|
|
5654
5662
|
};
|
|
5655
|
-
function*
|
|
5663
|
+
function* ui(e) {
|
|
5656
5664
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5657
5665
|
}
|
|
5658
|
-
function*
|
|
5666
|
+
function* di(e) {
|
|
5659
5667
|
for (let t of e?.paragraphs ?? []) {
|
|
5660
5668
|
t.defFontFamily && (yield t.defFontFamily);
|
|
5661
5669
|
for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
|
|
5662
5670
|
}
|
|
5663
5671
|
}
|
|
5664
|
-
function*
|
|
5665
|
-
for (let t of e.elements) if (t.type === "shape") yield*
|
|
5666
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield*
|
|
5672
|
+
function* fi(e) {
|
|
5673
|
+
for (let t of e.elements) if (t.type === "shape") yield* ui(t.textBody);
|
|
5674
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* ui(t.textBody);
|
|
5667
5675
|
else if (t.type === "chart") {
|
|
5668
5676
|
t.chart.title && (yield t.chart.title);
|
|
5669
5677
|
for (let e of t.chart.categories) yield e;
|
|
5670
5678
|
for (let e of t.chart.series) e.name && (yield e.name);
|
|
5671
5679
|
}
|
|
5672
5680
|
}
|
|
5673
|
-
var
|
|
5681
|
+
var pi = class e {
|
|
5674
5682
|
scripts;
|
|
5675
5683
|
families;
|
|
5676
5684
|
constructor(e, t, n, r) {
|
|
5677
5685
|
this.majorFont = e, this.minorFont = t;
|
|
5678
5686
|
let i = w(e) ?? w(t) ?? null;
|
|
5679
|
-
this.scripts = n ?? new
|
|
5687
|
+
this.scripts = n ?? new fe(i), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
|
|
5680
5688
|
}
|
|
5681
5689
|
addSlide(e) {
|
|
5682
|
-
this.scripts.addText(
|
|
5683
|
-
for (let t of e.elements) if (t.type === "shape") for (let e of
|
|
5684
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of
|
|
5690
|
+
this.scripts.addText(fi(e));
|
|
5691
|
+
for (let t of e.elements) if (t.type === "shape") for (let e of di(t.textBody)) this.families.add(e);
|
|
5692
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of di(t.textBody)) this.families.add(e);
|
|
5685
5693
|
}
|
|
5686
5694
|
names() {
|
|
5687
5695
|
return [...this.families, ...this.scripts.names()];
|
|
@@ -5690,13 +5698,13 @@ var mi = class e {
|
|
|
5690
5698
|
let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families));
|
|
5691
5699
|
return n.addSlide(t), n;
|
|
5692
5700
|
}
|
|
5693
|
-
},
|
|
5701
|
+
}, mi = Object.freeze({
|
|
5694
5702
|
archiveEntryCount: 0,
|
|
5695
5703
|
declaredInflatedBytes: 0,
|
|
5696
5704
|
distinctInflatedBytes: 0,
|
|
5697
5705
|
operationInflatedBytes: 0
|
|
5698
|
-
}),
|
|
5699
|
-
function
|
|
5706
|
+
}), hi = D;
|
|
5707
|
+
function gi(e, t) {
|
|
5700
5708
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5701
5709
|
}
|
|
5702
5710
|
function _i(e, t) {
|
|
@@ -5729,7 +5737,7 @@ function yi(e) {
|
|
|
5729
5737
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5730
5738
|
let t = e;
|
|
5731
5739
|
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");
|
|
5732
|
-
return
|
|
5740
|
+
return gi(t.defaultTextColor, "defaultTextColor"), gi(t.majorFont, "majorFont"), gi(t.minorFont, "minorFont"), gi(t.hlinkColor, "hlinkColor"), gi(t.folHlinkColor, "folHlinkColor"), Object.freeze({
|
|
5733
5741
|
slideCount: t.slideCount,
|
|
5734
5742
|
slideWidth: t.slideWidth,
|
|
5735
5743
|
slideHeight: t.slideHeight,
|
|
@@ -5881,7 +5889,7 @@ function ki(e, t) {
|
|
|
5881
5889
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5882
5890
|
let n = e;
|
|
5883
5891
|
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");
|
|
5884
|
-
|
|
5892
|
+
gi(n.defaultTextColor, "defaultTextColor"), gi(n.majorFont, "majorFont"), gi(n.minorFont, "minorFont"), gi(n.hlinkColor, "hlinkColor"), gi(n.folHlinkColor, "folHlinkColor");
|
|
5885
5893
|
let r = n.slides.map((e, t) => {
|
|
5886
5894
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
|
|
5887
5895
|
let n = e;
|
|
@@ -5971,9 +5979,9 @@ var Fi = class {
|
|
|
5971
5979
|
pending = null;
|
|
5972
5980
|
finished = null;
|
|
5973
5981
|
constructor(e, t = {}) {
|
|
5974
|
-
let n = yi(e), r = t.hardLimitForTesting ??
|
|
5975
|
-
if (!Number.isSafeInteger(r) || r <= 0 || r >
|
|
5976
|
-
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
|
|
5982
|
+
let n = yi(e), r = t.hardLimitForTesting ?? hi;
|
|
5983
|
+
if (!Number.isSafeInteger(r) || r <= 0 || r > hi) throw Error("invalid PPTX presentation preflight test limit");
|
|
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 pi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Xe(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Xe({
|
|
5977
5985
|
slideCount: this.slideCountValue,
|
|
5978
5986
|
slideWidth: this.slideWidthValue,
|
|
5979
5987
|
slideHeight: this.slideHeightValue,
|
|
@@ -5986,7 +5994,7 @@ var Fi = class {
|
|
|
5986
5994
|
remainingSlides: this.descriptors,
|
|
5987
5995
|
slides: [],
|
|
5988
5996
|
fontPreloadNames: this.fontPreloadNames
|
|
5989
|
-
}, this.limit).jsonBytes, Pi(this.projectionBytesValue, this.limit,
|
|
5997
|
+
}, this.limit).jsonBytes, Pi(this.projectionBytesValue, this.limit, mi);
|
|
5990
5998
|
}
|
|
5991
5999
|
get acceptedSlideCount() {
|
|
5992
6000
|
return this.finished?.slideCount ?? this.slides.length;
|
|
@@ -6020,20 +6028,20 @@ var Fi = class {
|
|
|
6020
6028
|
fontPreloadNames: this.fontPreloadNames
|
|
6021
6029
|
});
|
|
6022
6030
|
}
|
|
6023
|
-
addSlide(e, t =
|
|
6031
|
+
addSlide(e, t = mi) {
|
|
6024
6032
|
this.prepareSlide(e, t).commit();
|
|
6025
6033
|
}
|
|
6026
|
-
prepareSlide(e, t =
|
|
6034
|
+
prepareSlide(e, t = mi) {
|
|
6027
6035
|
if (this.finished) throw Error("PPTX presentation preflight is already finished");
|
|
6028
6036
|
if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
|
|
6029
6037
|
let n = this.slides.length, r = this.descriptors[n];
|
|
6030
6038
|
if (!r) throw Error("PPTX presentation preflight received an extra slide");
|
|
6031
|
-
let i = Ni(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s =
|
|
6032
|
-
l =
|
|
6033
|
-
let u =
|
|
6039
|
+
let i = Ni(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = Xe(o, this.limit).jsonBytes, c = Xe(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - Xe(r, this.limit).jsonBytes + 4;
|
|
6040
|
+
l = Ze(l, s, this.limit), l = Ze(l, c, this.limit), this.slides.length !== 0 && (l = Ze(l, 1, this.limit));
|
|
6041
|
+
let u = Xe({
|
|
6034
6042
|
slide: i,
|
|
6035
6043
|
fontPreloadNames: o
|
|
6036
|
-
}, this.limit).jsonBytes, d =
|
|
6044
|
+
}, this.limit).jsonBytes, d = Ze(this.projectionBytesValue, u, this.limit);
|
|
6037
6045
|
Pi(Math.max(d, l), this.limit, t);
|
|
6038
6046
|
let f = {
|
|
6039
6047
|
state: "prepared",
|
|
@@ -6077,7 +6085,7 @@ var Fi = class {
|
|
|
6077
6085
|
embeddedFonts: this.embeddedFontsValue,
|
|
6078
6086
|
slides: Object.freeze([...this.slides]),
|
|
6079
6087
|
fontPreloadNames: this.fontPreloadNames
|
|
6080
|
-
}), this.descriptors = [], this.slides = [], this.projectionBytesValue =
|
|
6088
|
+
}), this.descriptors = [], this.slides = [], this.projectionBytesValue = Xe(this.finished, this.limit).jsonBytes, this.finished;
|
|
6081
6089
|
}
|
|
6082
6090
|
}, Ii = 1024 * 1024, Li = class {
|
|
6083
6091
|
active = /* @__PURE__ */ new Set();
|
|
@@ -6139,4 +6147,4 @@ function Bi(e) {
|
|
|
6139
6147
|
return d(e, Ii, E);
|
|
6140
6148
|
}
|
|
6141
6149
|
//#endregion
|
|
6142
|
-
export { yi as a,
|
|
6150
|
+
export { yi as a, li as c, si as d, an as f, Mi as i, ii as l, Ri as n, Ai as o, Fi as r, ji as s, Li as t, oi as u };
|