@silurus/ooxml 0.72.1 → 0.73.0
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/chunk-DmhlhrBa.js +11 -0
- package/dist/docx-4NIiH5kn.js +25037 -0
- package/dist/docx.mjs +2 -2
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-CABDFafh.js → find-cursor-CaGrVs7z.js} +1522 -1458
- package/dist/highlight-rect-DZn1OD1x.js +988 -0
- package/dist/index.mjs +3 -3
- package/dist/math.mjs +1 -1
- package/dist/{mathjax-Dk_JzbFj.js → mathjax-BPjQ2C_j.js} +2 -2
- package/dist/{pptx-WoReGPPJ.js → pptx-BVDbKJFr.js} +1176 -1278
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-Bz0flu1p.js +27 -0
- package/dist/render-worker-host-Custze53.js +27 -0
- package/dist/render-worker-host-GLvdN4Ok.js +27 -0
- package/dist/types/docx.d.ts +3968 -4022
- package/dist/types/index.d.ts +8183 -8583
- package/dist/types/math.d.ts +41 -38
- package/dist/types/pptx.d.ts +3629 -3704
- package/dist/types/xlsx.d.ts +3218 -3301
- package/dist/{visible-index-YRawP6W8.js → visible-index-CyuaF_ZP.js} +11 -11
- package/dist/{xlsx-CHfWgWy8.js → xlsx-z4Bs4HLQ.js} +955 -941
- package/dist/xlsx.mjs +2 -2
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +16 -6
- package/dist/docx-CM-oHSyZ.js +0 -10241
- package/dist/highlight-rect-DIReGC3z.js +0 -881
- package/dist/render-worker-host-BNYGV6vm.js +0 -27
- package/dist/render-worker-host-CJc3E4ej.js +0 -27
- package/dist/render-worker-host-DcfYux0W.js +0 -27
- package/dist/segments-2VsQNClV.js +0 -7
|
@@ -1,156 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
import { t as
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
function Ze(e) {
|
|
8
|
-
return e.cmd === "lineTo" || e.cmd === "cubicBezTo" || e.cmd === "arcTo";
|
|
9
|
-
}
|
|
10
|
-
function Qe(e, t, n, r) {
|
|
11
|
-
let i = n === 0 ? 0 : n, a = r === 0 ? 0 : r;
|
|
12
|
-
return {
|
|
13
|
-
x: e,
|
|
14
|
-
y: t,
|
|
15
|
-
dx: i,
|
|
16
|
-
dy: a,
|
|
17
|
-
angle: Math.atan2(a, i)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function $e(e, t, n) {
|
|
21
|
-
switch (n.cmd) {
|
|
22
|
-
case "lineTo": return {
|
|
23
|
-
dx: n.x - e,
|
|
24
|
-
dy: n.y - t
|
|
25
|
-
};
|
|
26
|
-
case "cubicBezTo": {
|
|
27
|
-
let r = n.x1 - e, i = n.y1 - t;
|
|
28
|
-
return Math.abs(r) < q && Math.abs(i) < q && (r = n.x2 - e, i = n.y2 - t), Math.abs(r) < q && Math.abs(i) < q && (r = n.x - e, i = n.y - t), {
|
|
29
|
-
dx: r,
|
|
30
|
-
dy: i
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
case "arcTo": {
|
|
34
|
-
let e = n.stAng * Math.PI / 180, t = n.swAng < 0 ? -1 : 1;
|
|
35
|
-
return {
|
|
36
|
-
dx: -n.wr * Math.sin(e) * t,
|
|
37
|
-
dy: n.hr * Math.cos(e) * t
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
default: return {
|
|
41
|
-
dx: 0,
|
|
42
|
-
dy: 0
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function et(e, t, n) {
|
|
47
|
-
switch (n.cmd) {
|
|
48
|
-
case "moveTo":
|
|
49
|
-
case "lineTo":
|
|
50
|
-
case "cubicBezTo": return {
|
|
51
|
-
x: n.x,
|
|
52
|
-
y: n.y
|
|
53
|
-
};
|
|
54
|
-
case "arcTo": {
|
|
55
|
-
if (n.wr <= 0 || n.hr <= 0) return {
|
|
56
|
-
x: e,
|
|
57
|
-
y: t
|
|
58
|
-
};
|
|
59
|
-
let r = n.stAng * Math.PI / 180, i = r + n.swAng * Math.PI / 180, a = e - n.wr * Math.cos(r), o = t - n.hr * Math.sin(r);
|
|
60
|
-
return {
|
|
61
|
-
x: a + n.wr * Math.cos(i),
|
|
62
|
-
y: o + n.hr * Math.sin(i)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
default: return {
|
|
66
|
-
x: e,
|
|
67
|
-
y: t
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function tt(e, t, n) {
|
|
72
|
-
let { x: r, y: i } = et(e, t, n);
|
|
73
|
-
switch (n.cmd) {
|
|
74
|
-
case "lineTo": return {
|
|
75
|
-
dx: n.x - e,
|
|
76
|
-
dy: n.y - t,
|
|
77
|
-
x: r,
|
|
78
|
-
y: i
|
|
79
|
-
};
|
|
80
|
-
case "cubicBezTo": {
|
|
81
|
-
let a = n.x - n.x2, o = n.y - n.y2;
|
|
82
|
-
return Math.abs(a) < q && Math.abs(o) < q && (a = n.x - n.x1, o = n.y - n.y1), Math.abs(a) < q && Math.abs(o) < q && (a = n.x - e, o = n.y - t), {
|
|
83
|
-
dx: a,
|
|
84
|
-
dy: o,
|
|
85
|
-
x: r,
|
|
86
|
-
y: i
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
case "arcTo": {
|
|
90
|
-
if (n.wr <= 0 || n.hr <= 0) return {
|
|
91
|
-
dx: 0,
|
|
92
|
-
dy: 0,
|
|
93
|
-
x: r,
|
|
94
|
-
y: i
|
|
95
|
-
};
|
|
96
|
-
let e = n.stAng * Math.PI / 180 + n.swAng * Math.PI / 180, t = n.swAng < 0 ? -1 : 1;
|
|
97
|
-
return {
|
|
98
|
-
dx: -n.wr * Math.sin(e) * t,
|
|
99
|
-
dy: n.hr * Math.cos(e) * t,
|
|
100
|
-
x: r,
|
|
101
|
-
y: i
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
default: return {
|
|
105
|
-
dx: 0,
|
|
106
|
-
dy: 0,
|
|
107
|
-
x: r,
|
|
108
|
-
y: i
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function nt(e) {
|
|
113
|
-
let t = 0, n = 0, r = !1;
|
|
114
|
-
for (let i of e) i.cmd === "moveTo" && (r = !0), {x: t, y: n} = et(t, n, i);
|
|
115
|
-
return r ? {
|
|
116
|
-
x: t,
|
|
117
|
-
y: n
|
|
118
|
-
} : null;
|
|
119
|
-
}
|
|
120
|
-
function rt(e) {
|
|
121
|
-
if (e.some((e) => e.cmd === "close")) return !0;
|
|
122
|
-
let t = e.find((e) => e.cmd === "moveTo");
|
|
123
|
-
if (!t) return !1;
|
|
124
|
-
let n = nt(e);
|
|
125
|
-
return !n || !e.some(Ze) ? !1 : Math.abs(n.x - t.x) < q && Math.abs(n.y - t.y) < q;
|
|
126
|
-
}
|
|
127
|
-
function it(e) {
|
|
128
|
-
let t = {
|
|
129
|
-
start: null,
|
|
130
|
-
end: null
|
|
131
|
-
};
|
|
132
|
-
if (!e || e.length === 0) return t;
|
|
133
|
-
let n = e[0];
|
|
134
|
-
if (n && n.length > 0 && !rt(n)) {
|
|
135
|
-
let e = n.find((e) => e.cmd === "moveTo"), r = n.find(Ze);
|
|
136
|
-
if (e && r) {
|
|
137
|
-
let n = $e(e.x, e.y, r);
|
|
138
|
-
(Math.abs(n.dx) > q || Math.abs(n.dy) > q) && (t.start = Qe(e.x, e.y, -n.dx, -n.dy));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
let r = e[e.length - 1];
|
|
142
|
-
if (r && r.length > 0 && !rt(r)) {
|
|
143
|
-
let e = 0, n = 0, i = -1;
|
|
144
|
-
for (let e = 0; e < r.length; e++) Ze(r[e]) && (i = e);
|
|
145
|
-
if (i >= 0) {
|
|
146
|
-
for (let t = 0; t < i; t++) ({x: e, y: n} = et(e, n, r[t]));
|
|
147
|
-
let a = tt(e, n, r[i]);
|
|
148
|
-
(Math.abs(a.dx) > q || Math.abs(a.dy) > q) && (t.end = Qe(a.x, a.y, a.dx, a.dy));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return t;
|
|
152
|
-
}
|
|
153
|
-
var at = {
|
|
1
|
+
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
+
import { $ as t, At as n, B as r, Bt as i, C as a, D as o, E as s, Et as c, Ft as l, G as u, H as d, Ht as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, N as b, Nt as x, P as S, Pt as C, Q as w, R as T, Rt as E, S as D, St as O, T as k, U as A, Ut as j, V as M, W as N, Y as P, Yt as F, Z as I, _ as L, _t as R, at as z, b as B, c as V, ct as H, d as U, dt as ee, f as W, ft as G, gt as te, h as ne, ht as re, i as ie, jt as K, k as ae, l as oe, lt as se, m as ce, mt as le, n as ue, nt as de, o as fe, ot as pe, p as me, pt as he, q as ge, qt as _e, r as ve, rt as ye, s as be, st as xe, t as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, wt as Oe, x as ke, xt as Ae, yt as je, zt as Me } from "./find-cursor-CaGrVs7z.js";
|
|
3
|
+
import { a as Ne, c as Pe, d as Fe, f as Ie, i as Le, l as Re, n as ze, o as Be, r as Ve, s as He, t as q, u as Ue } from "./highlight-rect-DZn1OD1x.js";
|
|
4
|
+
import { a as We, i as Ge, n as Ke, r as qe, t as Je } from "./visible-index-CyuaF_ZP.js";
|
|
5
|
+
import { t as Ye } from "./mathjax-BPjQ2C_j.js";
|
|
6
|
+
var Xe = {
|
|
154
7
|
textarchdown: {
|
|
155
8
|
adj: [["adj", "val 0"]],
|
|
156
9
|
gd: [
|
|
@@ -2532,22 +2385,22 @@ var at = {
|
|
|
2532
2385
|
]
|
|
2533
2386
|
}]
|
|
2534
2387
|
}
|
|
2535
|
-
},
|
|
2536
|
-
function
|
|
2537
|
-
return e.toLowerCase() in
|
|
2388
|
+
}, Ze = Math.PI * 2 / 216e5, Qe = Xe, $e = /* @__PURE__ */ new Map();
|
|
2389
|
+
function et(e) {
|
|
2390
|
+
return e.toLowerCase() in Qe;
|
|
2538
2391
|
}
|
|
2539
|
-
function
|
|
2540
|
-
let t =
|
|
2392
|
+
function tt(e) {
|
|
2393
|
+
let t = $e.get(e);
|
|
2541
2394
|
if (t) return t;
|
|
2542
|
-
let n =
|
|
2395
|
+
let n = Qe[e];
|
|
2543
2396
|
return n ? (t = {
|
|
2544
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2545
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2397
|
+
adj: n.adj.map(([e, t]) => [e, re(t)]),
|
|
2398
|
+
gd: n.gd.map(([e, t]) => [e, re(t)]),
|
|
2546
2399
|
paths: n.paths
|
|
2547
|
-
},
|
|
2400
|
+
}, $e.set(e, t), t) : null;
|
|
2548
2401
|
}
|
|
2549
|
-
var
|
|
2550
|
-
function
|
|
2402
|
+
var nt = 48;
|
|
2403
|
+
function rt(e, t, n, r) {
|
|
2551
2404
|
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;
|
|
2552
2405
|
for (let n of e.cmds) switch (n[0]) {
|
|
2553
2406
|
case "m":
|
|
@@ -2564,8 +2417,8 @@ function ft(e, t, n, r) {
|
|
|
2564
2417
|
break;
|
|
2565
2418
|
case "C": {
|
|
2566
2419
|
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]));
|
|
2567
|
-
for (let t = 1; t <=
|
|
2568
|
-
let n = t /
|
|
2420
|
+
for (let t = 1; t <= nt; t++) {
|
|
2421
|
+
let n = t / nt, 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;
|
|
2569
2422
|
c.push({
|
|
2570
2423
|
x: s,
|
|
2571
2424
|
y: p
|
|
@@ -2576,8 +2429,8 @@ function ft(e, t, n, r) {
|
|
|
2576
2429
|
}
|
|
2577
2430
|
case "Q": {
|
|
2578
2431
|
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]));
|
|
2579
|
-
for (let t = 1; t <=
|
|
2580
|
-
let n = t /
|
|
2432
|
+
for (let t = 1; t <= nt; t++) {
|
|
2433
|
+
let n = t / nt, 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;
|
|
2581
2434
|
c.push({
|
|
2582
2435
|
x: s,
|
|
2583
2436
|
y: d
|
|
@@ -2587,9 +2440,9 @@ function ft(e, t, n, r) {
|
|
|
2587
2440
|
break;
|
|
2588
2441
|
}
|
|
2589
2442
|
case "a": {
|
|
2590
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2443
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * Ze, f = t.resolve(n[4]) * Ze, 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;
|
|
2591
2444
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2592
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2445
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(nt, Math.ceil(Math.abs(y) / m * 96));
|
|
2593
2446
|
for (let e = 1; e <= S; e++) {
|
|
2594
2447
|
let t = h + y * e / S;
|
|
2595
2448
|
c.push({
|
|
@@ -2604,7 +2457,7 @@ function ft(e, t, n, r) {
|
|
|
2604
2457
|
}
|
|
2605
2458
|
return c;
|
|
2606
2459
|
}
|
|
2607
|
-
function
|
|
2460
|
+
function it(e) {
|
|
2608
2461
|
let t = [0];
|
|
2609
2462
|
for (let n = 1; n < e.length; n++) {
|
|
2610
2463
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2612,23 +2465,23 @@ function pt(e) {
|
|
|
2612
2465
|
}
|
|
2613
2466
|
return t;
|
|
2614
2467
|
}
|
|
2615
|
-
function
|
|
2616
|
-
let i =
|
|
2468
|
+
function at(e, t, n, r) {
|
|
2469
|
+
let i = tt(e.toLowerCase());
|
|
2617
2470
|
if (!i || i.paths.length === 0) return null;
|
|
2618
|
-
let a =
|
|
2471
|
+
let a = te({
|
|
2619
2472
|
w: n,
|
|
2620
2473
|
h: r,
|
|
2621
2474
|
adj: t
|
|
2622
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s =
|
|
2475
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = rt(i.paths[0], a, n, r), c = o ? s : rt(i.paths[i.paths.length - 1], a, n, r);
|
|
2623
2476
|
return {
|
|
2624
2477
|
top: s,
|
|
2625
2478
|
bottom: c,
|
|
2626
|
-
topLen:
|
|
2627
|
-
bottomLen:
|
|
2479
|
+
topLen: it(s),
|
|
2480
|
+
bottomLen: it(c),
|
|
2628
2481
|
singleEdge: o
|
|
2629
2482
|
};
|
|
2630
2483
|
}
|
|
2631
|
-
function
|
|
2484
|
+
function ot(e, t, n) {
|
|
2632
2485
|
let r = t[t.length - 1];
|
|
2633
2486
|
if (e.length === 1 || r === 0) return {
|
|
2634
2487
|
x: e[0].x,
|
|
@@ -2649,17 +2502,17 @@ function ht(e, t, n) {
|
|
|
2649
2502
|
ty: f / p
|
|
2650
2503
|
};
|
|
2651
2504
|
}
|
|
2652
|
-
function
|
|
2505
|
+
function st(e) {
|
|
2653
2506
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2654
2507
|
}
|
|
2655
|
-
function
|
|
2508
|
+
function ct(e, t) {
|
|
2656
2509
|
if (!e.singleEdge) return 1;
|
|
2657
|
-
let n =
|
|
2510
|
+
let n = st(e);
|
|
2658
2511
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2659
2512
|
}
|
|
2660
|
-
function
|
|
2513
|
+
function lt(e, t, n, r) {
|
|
2661
2514
|
if (e.singleEdge) {
|
|
2662
|
-
let i =
|
|
2515
|
+
let i = ot(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2663
2516
|
return {
|
|
2664
2517
|
x: i.x - o * c,
|
|
2665
2518
|
y: i.y - s * c,
|
|
@@ -2668,7 +2521,7 @@ function vt(e, t, n, r) {
|
|
|
2668
2521
|
shear: 0
|
|
2669
2522
|
};
|
|
2670
2523
|
}
|
|
2671
|
-
let i =
|
|
2524
|
+
let i = ot(e.top, e.topLen, t), a = ot(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);
|
|
2672
2525
|
return {
|
|
2673
2526
|
x: c,
|
|
2674
2527
|
y: l,
|
|
@@ -2679,13 +2532,13 @@ function vt(e, t, n, r) {
|
|
|
2679
2532
|
}
|
|
2680
2533
|
//#endregion
|
|
2681
2534
|
//#region packages/core/src/shape/effects.ts
|
|
2682
|
-
function
|
|
2535
|
+
function ut(e, t) {
|
|
2683
2536
|
return e * t;
|
|
2684
2537
|
}
|
|
2685
|
-
function
|
|
2538
|
+
function dt(e) {
|
|
2686
2539
|
return e.getContext("2d") ?? null;
|
|
2687
2540
|
}
|
|
2688
|
-
function
|
|
2541
|
+
function ft(e, t, n, r) {
|
|
2689
2542
|
let i = Math.max(0, Math.floor(e.x - t)), a = Math.max(0, Math.floor(e.y - t)), o = Math.min(n, Math.ceil(e.x + e.w + t)), s = Math.min(r, Math.ceil(e.y + e.h + t));
|
|
2690
2543
|
return {
|
|
2691
2544
|
x: i,
|
|
@@ -2694,7 +2547,7 @@ function xt(e, t, n, r) {
|
|
|
2694
2547
|
h: Math.max(1, s - a)
|
|
2695
2548
|
};
|
|
2696
2549
|
}
|
|
2697
|
-
function
|
|
2550
|
+
function pt(e, t) {
|
|
2698
2551
|
if (t.x === 0 && t.y === 0) return e;
|
|
2699
2552
|
let n = t.x, r = t.y;
|
|
2700
2553
|
return new Proxy(e, {
|
|
@@ -2710,58 +2563,58 @@ function St(e, t) {
|
|
|
2710
2563
|
}
|
|
2711
2564
|
});
|
|
2712
2565
|
}
|
|
2713
|
-
function
|
|
2714
|
-
let s =
|
|
2715
|
-
if (!p) return;
|
|
2716
|
-
let m = bt(p);
|
|
2566
|
+
function mt(e, t, n, r, i, a, o) {
|
|
2567
|
+
let s = ut(r.blur, i), l = ut(r.dist, i), u = r.dir * Math.PI / 180, d = Math.cos(u) * l, f = Math.sin(u) * l, p = ft(n, Math.ceil(3 * s + Math.abs(l)) + 2, a, o), m = c(p.w, p.h);
|
|
2717
2568
|
if (!m) return;
|
|
2718
|
-
let h =
|
|
2719
|
-
|
|
2569
|
+
let h = dt(m);
|
|
2570
|
+
if (!h) return;
|
|
2571
|
+
let g = pt(h, p);
|
|
2572
|
+
g.save(), g.fillStyle = Ae(r.color, r.alpha), t(g), g.restore(), g.save(), g.globalCompositeOperation = "destination-out", g.filter = s > 0 ? `blur(${s}px)` : "none", g.translate(d, f), g.fillStyle = "#000", t(g), g.restore(), g.save(), g.globalCompositeOperation = "destination-in", g.filter = "none", g.fillStyle = "#000", t(g), g.restore(), e.save(), e.drawImage(m, p.x, p.y), e.restore();
|
|
2720
2573
|
}
|
|
2721
|
-
function
|
|
2722
|
-
let
|
|
2723
|
-
if (
|
|
2574
|
+
function ht(e, t, n, r, i, a, o, s) {
|
|
2575
|
+
let l = ut(r.radius, i);
|
|
2576
|
+
if (l <= 0) {
|
|
2724
2577
|
t(e);
|
|
2725
2578
|
return;
|
|
2726
2579
|
}
|
|
2727
|
-
let
|
|
2728
|
-
if (!
|
|
2580
|
+
let u = ft(n, Math.ceil(l) + 2, a, o), d = n.x - u.x, f = n.y - u.y, p = c(u.w, u.h);
|
|
2581
|
+
if (!p) {
|
|
2729
2582
|
t(e);
|
|
2730
2583
|
return;
|
|
2731
2584
|
}
|
|
2732
|
-
let
|
|
2733
|
-
if (!
|
|
2585
|
+
let m = dt(p);
|
|
2586
|
+
if (!m) {
|
|
2734
2587
|
t(e);
|
|
2735
2588
|
return;
|
|
2736
2589
|
}
|
|
2737
|
-
let
|
|
2738
|
-
t(
|
|
2739
|
-
let
|
|
2740
|
-
if (
|
|
2741
|
-
let t =
|
|
2742
|
-
t.fillStyle = "#000",
|
|
2590
|
+
let h = pt(m, u), g = s ?? t;
|
|
2591
|
+
t(h);
|
|
2592
|
+
let _ = c(u.w, u.h), v = c(u.w, u.h), y = _ ? dt(_) : null, b = v ? dt(v) : null;
|
|
2593
|
+
if (_ && y && v && b) {
|
|
2594
|
+
let t = pt(y, u);
|
|
2595
|
+
t.fillStyle = "#000", g(t), b.drawImage(p, d, f, n.w, n.h, d - l, f - l, n.w + l * 2, n.h + l * 2), b.drawImage(p, 0, 0), b.globalCompositeOperation = "destination-in", b.filter = `blur(${l / 3}px)`, b.drawImage(_, 0, 0), b.filter = "none", b.globalCompositeOperation = "source-over", e.save(), e.drawImage(v, u.x, u.y), e.restore();
|
|
2743
2596
|
return;
|
|
2744
2597
|
}
|
|
2745
|
-
e.save(), e.drawImage(
|
|
2598
|
+
e.save(), e.drawImage(p, 0, 0), e.restore();
|
|
2746
2599
|
}
|
|
2747
|
-
function
|
|
2748
|
-
let s =
|
|
2600
|
+
function gt(e, t, n, r, i, a, o) {
|
|
2601
|
+
let s = c(a, o);
|
|
2749
2602
|
if (!s) return;
|
|
2750
|
-
let
|
|
2751
|
-
if (!
|
|
2752
|
-
let
|
|
2753
|
-
|
|
2754
|
-
let
|
|
2755
|
-
|
|
2756
|
-
let
|
|
2757
|
-
e.save(), e.translate(n.x +
|
|
2758
|
-
}
|
|
2759
|
-
function
|
|
2603
|
+
let l = dt(s);
|
|
2604
|
+
if (!l) return;
|
|
2605
|
+
let u = ut(r.blur, i);
|
|
2606
|
+
l.save(), u > 0 && (l.filter = `blur(${u}px)`), t(l), l.restore(), l.save(), l.globalCompositeOperation = "destination-in";
|
|
2607
|
+
let d = n.y, f = n.y + n.h, p = l.createLinearGradient(0, f, 0, d), m = _t(r.stPos), h = _t(r.endPos);
|
|
2608
|
+
p.addColorStop(0, `rgba(0,0,0,${r.stA})`), m > 0 && p.addColorStop(m, `rgba(0,0,0,${r.stA})`), h < 1 && h > m && p.addColorStop(h, `rgba(0,0,0,${r.endA})`), p.addColorStop(1, `rgba(0,0,0,${r.endA})`), l.fillStyle = p, l.fillRect(0, 0, a, o), l.restore();
|
|
2609
|
+
let g = ut(r.dist, i), _ = r.dir * Math.PI / 180, v = Math.cos(_) * g, y = Math.sin(_) * g;
|
|
2610
|
+
e.save(), e.translate(n.x + v, f + y), e.scale(r.sx, r.sy), e.translate(-n.x, -f), e.drawImage(s, 0, 0), e.restore();
|
|
2611
|
+
}
|
|
2612
|
+
function _t(e) {
|
|
2760
2613
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2761
2614
|
}
|
|
2762
2615
|
//#endregion
|
|
2763
2616
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2764
|
-
var J = 26,
|
|
2617
|
+
var J = 26, vt = {
|
|
2765
2618
|
orthographicFront: {
|
|
2766
2619
|
kind: "orthographic",
|
|
2767
2620
|
baseLat: 0,
|
|
@@ -2819,7 +2672,7 @@ var J = 26, Dt = {
|
|
|
2819
2672
|
fovDeg: J
|
|
2820
2673
|
}
|
|
2821
2674
|
};
|
|
2822
|
-
function
|
|
2675
|
+
function yt(e, t) {
|
|
2823
2676
|
let n = Array(9).fill(0);
|
|
2824
2677
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2825
2678
|
let a = 0;
|
|
@@ -2828,7 +2681,7 @@ function Ot(e, t) {
|
|
|
2828
2681
|
}
|
|
2829
2682
|
return n;
|
|
2830
2683
|
}
|
|
2831
|
-
function
|
|
2684
|
+
function bt(e) {
|
|
2832
2685
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2833
2686
|
return [
|
|
2834
2687
|
1,
|
|
@@ -2842,7 +2695,7 @@ function kt(e) {
|
|
|
2842
2695
|
n
|
|
2843
2696
|
];
|
|
2844
2697
|
}
|
|
2845
|
-
function
|
|
2698
|
+
function xt(e) {
|
|
2846
2699
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2847
2700
|
return [
|
|
2848
2701
|
n,
|
|
@@ -2856,7 +2709,7 @@ function At(e) {
|
|
|
2856
2709
|
n
|
|
2857
2710
|
];
|
|
2858
2711
|
}
|
|
2859
|
-
function
|
|
2712
|
+
function St(e) {
|
|
2860
2713
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2861
2714
|
return [
|
|
2862
2715
|
n,
|
|
@@ -2870,22 +2723,22 @@ function jt(e) {
|
|
|
2870
2723
|
1
|
|
2871
2724
|
];
|
|
2872
2725
|
}
|
|
2873
|
-
function
|
|
2726
|
+
function Ct(e, t, n, r) {
|
|
2874
2727
|
return [
|
|
2875
2728
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2876
2729
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2877
2730
|
e[6] * t + e[7] * n + e[8] * r
|
|
2878
2731
|
];
|
|
2879
2732
|
}
|
|
2880
|
-
function
|
|
2733
|
+
function wt(e, t) {
|
|
2881
2734
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2882
|
-
return
|
|
2735
|
+
return yt(St(-(t ? t.rev : e.baseRev)), yt(bt(-n), xt(-r)));
|
|
2883
2736
|
}
|
|
2884
|
-
function
|
|
2885
|
-
return
|
|
2737
|
+
function Tt(e) {
|
|
2738
|
+
return vt[e] ?? vt.orthographicFront;
|
|
2886
2739
|
}
|
|
2887
|
-
function
|
|
2888
|
-
let r =
|
|
2740
|
+
function Et(e, t, n) {
|
|
2741
|
+
let r = Tt(e.prst), i = wt(r, e.rot);
|
|
2889
2742
|
if (t <= 0 || n <= 0) return {
|
|
2890
2743
|
corners: [
|
|
2891
2744
|
{
|
|
@@ -2917,11 +2770,11 @@ function Ft(e, t, n) {
|
|
|
2917
2770
|
if (r.kind === "perspective") {
|
|
2918
2771
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2919
2772
|
u = s.map(([e, t]) => {
|
|
2920
|
-
let [n, r, o] =
|
|
2773
|
+
let [n, r, o] = Ct(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
|
|
2921
2774
|
return [n * c, r * c];
|
|
2922
2775
|
});
|
|
2923
2776
|
} else u = s.map(([e, t]) => {
|
|
2924
|
-
let [n, r] =
|
|
2777
|
+
let [n, r] = Ct(i, e, t, 0);
|
|
2925
2778
|
return [n, r];
|
|
2926
2779
|
});
|
|
2927
2780
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -2946,18 +2799,18 @@ function Ft(e, t, n) {
|
|
|
2946
2799
|
isIdentity: E
|
|
2947
2800
|
};
|
|
2948
2801
|
}
|
|
2949
|
-
function
|
|
2950
|
-
let { isIdentity: t } =
|
|
2802
|
+
function Dt(e) {
|
|
2803
|
+
let { isIdentity: t } = Et(e, 1e3, 1e3);
|
|
2951
2804
|
return !t;
|
|
2952
2805
|
}
|
|
2953
|
-
function
|
|
2954
|
-
let i =
|
|
2806
|
+
function Ot(e, t, n, r) {
|
|
2807
|
+
let i = Tt(e.prst), a = wt(i, e.rot);
|
|
2955
2808
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
2956
2809
|
x: 0,
|
|
2957
2810
|
y: 0
|
|
2958
2811
|
};
|
|
2959
2812
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
2960
|
-
let [n, r, o] =
|
|
2813
|
+
let [n, r, o] = Ct(a, 0, 0, t);
|
|
2961
2814
|
if (i.kind === "perspective") {
|
|
2962
2815
|
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);
|
|
2963
2816
|
return [n * d * l, r * d * l];
|
|
@@ -2971,7 +2824,7 @@ function Lt(e, t, n, r) {
|
|
|
2971
2824
|
}
|
|
2972
2825
|
//#endregion
|
|
2973
2826
|
//#region packages/core/src/shape/scene3d-draw.ts
|
|
2974
|
-
function
|
|
2827
|
+
function kt(e, t, n, r) {
|
|
2975
2828
|
let i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = o - c, p = u - c, m = i - o + c - u, h = s - l, g = d - l, _ = a - s + l - d, v, y;
|
|
2976
2829
|
if (Math.abs(m) < 1e-12 && Math.abs(_) < 1e-12) v = 0, y = 0;
|
|
2977
2830
|
else {
|
|
@@ -2991,15 +2844,15 @@ function Rt(e, t, n, r) {
|
|
|
2991
2844
|
1
|
|
2992
2845
|
];
|
|
2993
2846
|
}
|
|
2994
|
-
function
|
|
2847
|
+
function At(e, t, n) {
|
|
2995
2848
|
let r = e[6] * t + e[7] * n + e[8];
|
|
2996
2849
|
return {
|
|
2997
2850
|
x: (e[0] * t + e[1] * n + e[2]) / r,
|
|
2998
2851
|
y: (e[3] * t + e[4] * n + e[5]) / r
|
|
2999
2852
|
};
|
|
3000
2853
|
}
|
|
3001
|
-
var
|
|
3002
|
-
function
|
|
2854
|
+
var jt = 1;
|
|
2855
|
+
function Mt(e, t) {
|
|
3003
2856
|
let [n, r, i, a, o, s] = e, [c, l, u, d, f, p] = t;
|
|
3004
2857
|
return [
|
|
3005
2858
|
n * c + i * l,
|
|
@@ -3010,13 +2863,13 @@ function Vt(e, t) {
|
|
|
3010
2863
|
r * f + a * p + s
|
|
3011
2864
|
];
|
|
3012
2865
|
}
|
|
3013
|
-
function
|
|
2866
|
+
function Nt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
3014
2867
|
let p = c - o, m = l - s;
|
|
3015
2868
|
if (p <= 0 || m <= 0) return;
|
|
3016
|
-
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x =
|
|
2869
|
+
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x = jt * p / y, S = jt * m / b, C = Math.max(0, o - x), w = Math.max(0, s - S), T = Math.min(n, c + x), E = Math.min(r, l + S), D = T - C, O = E - w;
|
|
3017
2870
|
if (D <= 0 || O <= 0) return;
|
|
3018
2871
|
e.save();
|
|
3019
|
-
let [k, A, j, M, N, P] =
|
|
2872
|
+
let [k, A, j, M, N, P] = Mt(i, [
|
|
3020
2873
|
h,
|
|
3021
2874
|
g,
|
|
3022
2875
|
_,
|
|
@@ -3026,22 +2879,22 @@ function Ht(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
3026
2879
|
]);
|
|
3027
2880
|
e.setTransform(k, A, j, M, N, P), e.drawImage(t, C, w, D, O, C, w, D, O), e.restore();
|
|
3028
2881
|
}
|
|
3029
|
-
function
|
|
3030
|
-
let p =
|
|
2882
|
+
function Pt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2883
|
+
let p = At(o, s, c), m = At(o, l, c), h = At(o, s, u), g = At(o, l, u), _ = (s + l) / 2, v = (c + u) / 2, y = At(o, _, v), b = {
|
|
3031
2884
|
x: (p.x + m.x + h.x + g.x) / 4,
|
|
3032
2885
|
y: (p.y + m.y + h.y + g.y) / 4
|
|
3033
|
-
}, x =
|
|
2886
|
+
}, x = It(i), S = Math.hypot(y.x - b.x, y.y - b.y) * x;
|
|
3034
2887
|
if (f <= 0 || S <= d) {
|
|
3035
|
-
|
|
2888
|
+
Nt(e, t, n, r, i, a, s * n, c * r, l * n, u * r, p, m, h);
|
|
3036
2889
|
return;
|
|
3037
2890
|
}
|
|
3038
|
-
l - s >= u - c ? (
|
|
2891
|
+
l - s >= u - c ? (Pt(e, t, n, r, i, a, o, s, c, _, u, d, f - 1), Pt(e, t, n, r, i, a, o, _, c, l, u, d, f - 1)) : (Pt(e, t, n, r, i, a, o, s, c, l, v, d, f - 1), Pt(e, t, n, r, i, a, o, s, v, l, u, d, f - 1));
|
|
3039
2892
|
}
|
|
3040
|
-
function
|
|
2893
|
+
function Ft(e, t, n, r, i, a = .5) {
|
|
3041
2894
|
if (n <= 0 || r <= 0) return;
|
|
3042
2895
|
let [o, s, c, l] = i;
|
|
3043
2896
|
if (Math.abs(o.x * s.y - s.x * o.y + s.x * c.y - c.x * s.y + c.x * l.y - l.x * c.y + l.x * o.y - o.x * l.y) / 2 < 1e-6) return;
|
|
3044
|
-
let u =
|
|
2897
|
+
let u = kt(i[0], i[1], i[2], i[3]);
|
|
3045
2898
|
if (!u) return;
|
|
3046
2899
|
let d = t.getTransform(), f = [
|
|
3047
2900
|
d.a,
|
|
@@ -3050,14 +2903,14 @@ function Wt(e, t, n, r, i, a = .5) {
|
|
|
3050
2903
|
d.d,
|
|
3051
2904
|
d.e,
|
|
3052
2905
|
d.f
|
|
3053
|
-
], p =
|
|
3054
|
-
|
|
2906
|
+
], p = It(f);
|
|
2907
|
+
Vt(e, t, n, r, i, f, p, u, a, 14) || (zt(), t.save(), t.beginPath(), t.moveTo(i[0].x, i[0].y), t.lineTo(i[1].x, i[1].y), t.lineTo(i[2].x, i[2].y), t.lineTo(i[3].x, i[3].y), t.closePath(), t.clip(), Pt(t, e, n, r, f, p, u, 0, 0, 1, 1, a, 14), t.restore());
|
|
3055
2908
|
}
|
|
3056
|
-
function
|
|
2909
|
+
function It(e) {
|
|
3057
2910
|
return Math.sqrt(Math.abs(e[0] * e[3] - e[1] * e[2])) || 1;
|
|
3058
2911
|
}
|
|
3059
|
-
function
|
|
3060
|
-
let r =
|
|
2912
|
+
function Lt(e, t, n) {
|
|
2913
|
+
let r = kt(e[0], e[1], e[2], e[3]);
|
|
3061
2914
|
if (!r) return null;
|
|
3062
2915
|
let i = [
|
|
3063
2916
|
[-t, -n],
|
|
@@ -3067,48 +2920,48 @@ function Kt(e, t, n) {
|
|
|
3067
2920
|
], a = [];
|
|
3068
2921
|
for (let [e, t] of i) {
|
|
3069
2922
|
if (!(r[6] * e + r[7] * t + r[8] > 1e-9)) return null;
|
|
3070
|
-
a.push(
|
|
2923
|
+
a.push(At(r, e, t));
|
|
3071
2924
|
}
|
|
3072
2925
|
return a;
|
|
3073
2926
|
}
|
|
3074
|
-
var
|
|
3075
|
-
function
|
|
3076
|
-
|
|
2927
|
+
var Rt = !1;
|
|
2928
|
+
function zt() {
|
|
2929
|
+
Rt || (Rt = !0, typeof console < "u" && typeof console.warn == "function" && console.warn("[ooxml] scene3d: no offscreen canvas available — using the direct warp fallback (per-cell bleed only, no supersample). Textured-source seams may be faintly visible; the silhouette and geometry are unaffected."));
|
|
3077
2930
|
}
|
|
3078
|
-
var
|
|
3079
|
-
function
|
|
3080
|
-
let
|
|
2931
|
+
var Bt = 2;
|
|
2932
|
+
function Vt(e, t, n, r, i, a, o, s, l, u) {
|
|
2933
|
+
let d = i.map((e) => ({
|
|
3081
2934
|
x: a[0] * e.x + a[2] * e.y + a[4],
|
|
3082
2935
|
y: a[1] * e.x + a[3] * e.y + a[5]
|
|
3083
|
-
})),
|
|
3084
|
-
for (let e of
|
|
3085
|
-
|
|
3086
|
-
let
|
|
3087
|
-
if (
|
|
3088
|
-
let
|
|
3089
|
-
if (!
|
|
3090
|
-
let
|
|
3091
|
-
if (!
|
|
3092
|
-
let
|
|
3093
|
-
a[0] *
|
|
3094
|
-
a[1] *
|
|
3095
|
-
a[2] *
|
|
3096
|
-
a[3] *
|
|
3097
|
-
(a[4] -
|
|
3098
|
-
(a[5] -
|
|
2936
|
+
})), f = Infinity, p = Infinity, m = -Infinity, h = -Infinity;
|
|
2937
|
+
for (let e of d) e.x < f && (f = e.x), e.y < p && (p = e.y), e.x > m && (m = e.x), e.y > h && (h = e.y);
|
|
2938
|
+
f = Math.floor(f) - 1, p = Math.floor(p) - 1, m = Math.ceil(m) + 1, h = Math.ceil(h) + 1;
|
|
2939
|
+
let g = m - f, _ = h - p;
|
|
2940
|
+
if (g <= 0 || _ <= 0) return !1;
|
|
2941
|
+
let v = Math.max(1, Math.ceil(g * Bt)), y = Math.max(1, Math.ceil(_ * Bt)), b = c(v, y);
|
|
2942
|
+
if (!b || b.width !== v || b.height !== y) return !1;
|
|
2943
|
+
let x = b.getContext("2d") ?? null;
|
|
2944
|
+
if (!x) return !1;
|
|
2945
|
+
let S = Bt, C = [
|
|
2946
|
+
a[0] * S,
|
|
2947
|
+
a[1] * S,
|
|
2948
|
+
a[2] * S,
|
|
2949
|
+
a[3] * S,
|
|
2950
|
+
(a[4] - f) * S,
|
|
2951
|
+
(a[5] - p) * S
|
|
3099
2952
|
];
|
|
3100
|
-
|
|
3101
|
-
let
|
|
3102
|
-
return t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high", t.drawImage(
|
|
2953
|
+
x.save(), x.setTransform(C[0], C[1], C[2], C[3], C[4], C[5]), x.beginPath(), x.moveTo(i[0].x, i[0].y), x.lineTo(i[1].x, i[1].y), x.lineTo(i[2].x, i[2].y), x.lineTo(i[3].x, i[3].y), x.closePath(), x.clip(), Pt(x, e, n, r, C, o, s, 0, 0, 1, 1, l * S, u), x.restore(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0);
|
|
2954
|
+
let w = t.imageSmoothingEnabled, T = t.imageSmoothingQuality;
|
|
2955
|
+
return t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high", t.drawImage(b, 0, 0, g * S, _ * S, f, p, g, _), t.imageSmoothingEnabled = w, t.imageSmoothingQuality = T, t.restore(), !0;
|
|
3103
2956
|
}
|
|
3104
2957
|
//#endregion
|
|
3105
2958
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
3106
|
-
function
|
|
2959
|
+
function Ht(e, t) {
|
|
3107
2960
|
if (t <= 0) return () => 1;
|
|
3108
2961
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
3109
2962
|
switch (e) {
|
|
3110
2963
|
case "hardEdge": {
|
|
3111
|
-
let e =
|
|
2964
|
+
let e = Xt;
|
|
3112
2965
|
return (t) => {
|
|
3113
2966
|
let r = Math.min(1, n(t) / e);
|
|
3114
2967
|
return r * r * (3 - 2 * r);
|
|
@@ -3128,7 +2981,7 @@ function Zt(e, t) {
|
|
|
3128
2981
|
};
|
|
3129
2982
|
}
|
|
3130
2983
|
}
|
|
3131
|
-
function
|
|
2984
|
+
function Ut(e) {
|
|
3132
2985
|
let t = e.length, n = new Float64Array(t);
|
|
3133
2986
|
if (t === 0) return n;
|
|
3134
2987
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -3146,7 +2999,7 @@ function Qt(e) {
|
|
|
3146
2999
|
}
|
|
3147
3000
|
return n;
|
|
3148
3001
|
}
|
|
3149
|
-
function
|
|
3002
|
+
function Wt(e, t = 3) {
|
|
3150
3003
|
if (e <= 0) return Array(t).fill(1);
|
|
3151
3004
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
3152
3005
|
r % 2 == 0 && r--;
|
|
@@ -3154,7 +3007,7 @@ function $t(e, t = 3) {
|
|
|
3154
3007
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
3155
3008
|
return s;
|
|
3156
3009
|
}
|
|
3157
|
-
function
|
|
3010
|
+
function Gt(e, t, n, r, i, a) {
|
|
3158
3011
|
let o = 1 / (2 * i + 1);
|
|
3159
3012
|
if (a) for (let a = 0; a < r; a++) {
|
|
3160
3013
|
let r = a * n, s = 0;
|
|
@@ -3175,29 +3028,29 @@ function en(e, t, n, r, i, a) {
|
|
|
3175
3028
|
}
|
|
3176
3029
|
}
|
|
3177
3030
|
}
|
|
3178
|
-
function
|
|
3031
|
+
function Kt(e, t, n, r) {
|
|
3179
3032
|
let i = Float64Array.from(e);
|
|
3180
3033
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
3181
3034
|
let a = new Float64Array(t * n);
|
|
3182
|
-
for (let e of
|
|
3035
|
+
for (let e of Wt(r, 3)) {
|
|
3183
3036
|
let r = Math.max(1, (e - 1) / 2);
|
|
3184
|
-
|
|
3037
|
+
Gt(i, a, t, n, r, !0), Gt(a, i, t, n, r, !1);
|
|
3185
3038
|
}
|
|
3186
3039
|
return i;
|
|
3187
3040
|
}
|
|
3188
|
-
function
|
|
3041
|
+
function qt(e, t, n, r = 128) {
|
|
3189
3042
|
let i = new Float64Array(t * n);
|
|
3190
3043
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
3191
3044
|
let a = new Float64Array(n);
|
|
3192
3045
|
for (let e = 0; e < t; e++) {
|
|
3193
3046
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
3194
|
-
let r =
|
|
3047
|
+
let r = Ut(a);
|
|
3195
3048
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
3196
3049
|
}
|
|
3197
3050
|
let o = new Float64Array(t);
|
|
3198
3051
|
for (let e = 0; e < n; e++) {
|
|
3199
3052
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
3200
|
-
let n =
|
|
3053
|
+
let n = Ut(o);
|
|
3201
3054
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
3202
3055
|
}
|
|
3203
3056
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -3209,15 +3062,15 @@ function nn(e, t, n, r = 128) {
|
|
|
3209
3062
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
3210
3063
|
return i;
|
|
3211
3064
|
}
|
|
3212
|
-
var
|
|
3213
|
-
function
|
|
3065
|
+
var Jt = .25, Yt = .35, Xt = .5;
|
|
3066
|
+
function Zt(e, t, n, r, i, a) {
|
|
3214
3067
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
3215
3068
|
if (t <= 0 || n <= 0) return {
|
|
3216
3069
|
normals: o,
|
|
3217
3070
|
bandMask: s,
|
|
3218
3071
|
bandWeight: c
|
|
3219
3072
|
};
|
|
3220
|
-
let l =
|
|
3073
|
+
let l = qt(e, t, n), u = Ht(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) => {
|
|
3221
3074
|
let t = u(Math.max(0, e - .5));
|
|
3222
3075
|
return u(e + .5) - t;
|
|
3223
3076
|
};
|
|
@@ -3232,9 +3085,9 @@ function sn(e, t, n, r, i, a) {
|
|
|
3232
3085
|
o[a * 3 + 2] = 1;
|
|
3233
3086
|
continue;
|
|
3234
3087
|
}
|
|
3235
|
-
let g = u / r, _ = 1 -
|
|
3088
|
+
let g = u / r, _ = 1 - Yt, v = 1;
|
|
3236
3089
|
if (g > _) {
|
|
3237
|
-
let e = Math.min(1, (g - _) /
|
|
3090
|
+
let e = Math.min(1, (g - _) / Yt);
|
|
3238
3091
|
v = 1 - e * e * (3 - 2 * e);
|
|
3239
3092
|
}
|
|
3240
3093
|
c[a] = v;
|
|
@@ -3249,7 +3102,7 @@ function sn(e, t, n, r, i, a) {
|
|
|
3249
3102
|
bandWeight: c
|
|
3250
3103
|
};
|
|
3251
3104
|
}
|
|
3252
|
-
var
|
|
3105
|
+
var Qt = 35 * Math.PI / 180, $t = 12 * Math.PI / 180, en = {
|
|
3253
3106
|
t: {
|
|
3254
3107
|
x: 0,
|
|
3255
3108
|
y: -1
|
|
@@ -3283,22 +3136,22 @@ var cn = 35 * Math.PI / 180, ln = 12 * Math.PI / 180, un = {
|
|
|
3283
3136
|
y: 1
|
|
3284
3137
|
}
|
|
3285
3138
|
};
|
|
3286
|
-
function
|
|
3139
|
+
function tn(e, t, n) {
|
|
3287
3140
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
3288
3141
|
return {
|
|
3289
3142
|
x: e * i - t * a,
|
|
3290
3143
|
y: e * a + t * i
|
|
3291
3144
|
};
|
|
3292
3145
|
}
|
|
3293
|
-
function
|
|
3294
|
-
let r =
|
|
3295
|
-
return n && n.rev && (r =
|
|
3146
|
+
function nn(e, t, n) {
|
|
3147
|
+
let r = en[t] ?? en.t;
|
|
3148
|
+
return n && n.rev && (r = tn(r.x, r.y, n.rev)), an(r.x, r.y, Qt);
|
|
3296
3149
|
}
|
|
3297
|
-
function
|
|
3150
|
+
function rn(e) {
|
|
3298
3151
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
3299
|
-
return
|
|
3152
|
+
return an(-e.x / t, -e.y / t, $t);
|
|
3300
3153
|
}
|
|
3301
|
-
function
|
|
3154
|
+
function an(e, t, n) {
|
|
3302
3155
|
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;
|
|
3303
3156
|
return {
|
|
3304
3157
|
x: o / l,
|
|
@@ -3306,7 +3159,7 @@ function mn(e, t, n) {
|
|
|
3306
3159
|
z: c / l
|
|
3307
3160
|
};
|
|
3308
3161
|
}
|
|
3309
|
-
var
|
|
3162
|
+
var on = 2, sn = {
|
|
3310
3163
|
matte: {
|
|
3311
3164
|
ambient: .62,
|
|
3312
3165
|
diffuse: .45,
|
|
@@ -3319,8 +3172,8 @@ var hn = 2, gn = {
|
|
|
3319
3172
|
specular: .35,
|
|
3320
3173
|
shininess: 22
|
|
3321
3174
|
}
|
|
3322
|
-
},
|
|
3323
|
-
function
|
|
3175
|
+
}, cn = .8;
|
|
3176
|
+
function ln(e) {
|
|
3324
3177
|
switch (e) {
|
|
3325
3178
|
case "plastic":
|
|
3326
3179
|
case "metal":
|
|
@@ -3331,8 +3184,8 @@ function vn(e) {
|
|
|
3331
3184
|
default: return "matte";
|
|
3332
3185
|
}
|
|
3333
3186
|
}
|
|
3334
|
-
function
|
|
3335
|
-
let r =
|
|
3187
|
+
function un(e, t, n = !0) {
|
|
3188
|
+
let r = sn[e], i = {
|
|
3336
3189
|
light: t,
|
|
3337
3190
|
material: e,
|
|
3338
3191
|
ambient: r.ambient,
|
|
@@ -3340,9 +3193,9 @@ function yn(e, t, n = !0) {
|
|
|
3340
3193
|
specular: r.specular,
|
|
3341
3194
|
shininess: r.shininess
|
|
3342
3195
|
};
|
|
3343
|
-
return n && (i.fillLight =
|
|
3196
|
+
return n && (i.fillLight = rn(t), i.fillDiffuse = i.diffuse * cn), i;
|
|
3344
3197
|
}
|
|
3345
|
-
function
|
|
3198
|
+
function dn(e, t) {
|
|
3346
3199
|
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;
|
|
3347
3200
|
if (t.fillLight && t.fillDiffuse) {
|
|
3348
3201
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -3355,7 +3208,7 @@ function bn(e, t) {
|
|
|
3355
3208
|
}
|
|
3356
3209
|
return Math.max(0, t.ambient + r + i + a);
|
|
3357
3210
|
}
|
|
3358
|
-
function
|
|
3211
|
+
function fn(e, t, n) {
|
|
3359
3212
|
if (!e) return {
|
|
3360
3213
|
x: 0,
|
|
3361
3214
|
y: 0,
|
|
@@ -3370,16 +3223,16 @@ function xn(e, t, n) {
|
|
|
3370
3223
|
h: Math.max(0, o - i)
|
|
3371
3224
|
};
|
|
3372
3225
|
}
|
|
3373
|
-
function
|
|
3226
|
+
function pn(e, t, n) {
|
|
3374
3227
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3375
3228
|
if (r <= 0 || i <= 0) return;
|
|
3376
3229
|
let a = t.widthPx;
|
|
3377
3230
|
if (a < .75) return;
|
|
3378
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3231
|
+
let { x: o, y: s, w: c, h: l } = fn(n, r, i);
|
|
3379
3232
|
if (c <= 0 || l <= 0) return;
|
|
3380
3233
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3381
3234
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3382
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3235
|
+
let { bandMask: p, bandWeight: m, normals: h } = Zt(f, c, l, a, t.prst, t.heightPx), g = un(t.material, t.light), _ = dn({
|
|
3383
3236
|
x: 0,
|
|
3384
3237
|
y: 0,
|
|
3385
3238
|
z: 1
|
|
@@ -3390,13 +3243,13 @@ function Sn(e, t, n) {
|
|
|
3390
3243
|
if (n <= 0) continue;
|
|
3391
3244
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3392
3245
|
t.bottom && (r = -r, i = -i);
|
|
3393
|
-
let o = 1 + (
|
|
3246
|
+
let o = 1 + (dn({
|
|
3394
3247
|
x: r,
|
|
3395
3248
|
y: i,
|
|
3396
3249
|
z: a
|
|
3397
3250
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3398
3251
|
if (o >= 1) {
|
|
3399
|
-
let e = Math.min(1, (o - 1) *
|
|
3252
|
+
let e = Math.min(1, (o - 1) * on);
|
|
3400
3253
|
for (let t = 0; t < 3; t++) {
|
|
3401
3254
|
let n = Math.min(255, d[s + t] * o);
|
|
3402
3255
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3405,12 +3258,12 @@ function Sn(e, t, n) {
|
|
|
3405
3258
|
}
|
|
3406
3259
|
e.putImageData(u, o, s);
|
|
3407
3260
|
}
|
|
3408
|
-
function
|
|
3261
|
+
function mn(e, t, n) {
|
|
3409
3262
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3410
3263
|
if (r <= 0 || i <= 0) return;
|
|
3411
3264
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3412
3265
|
if (s < .75) return;
|
|
3413
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3266
|
+
let { x: c, y: l, w: u, h: d } = fn(n, r, i);
|
|
3414
3267
|
if (u <= 0 || d <= 0) return;
|
|
3415
3268
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3416
3269
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3433,29 +3286,71 @@ function Cn(e, t, n) {
|
|
|
3433
3286
|
e.putImageData(f, c, l);
|
|
3434
3287
|
}
|
|
3435
3288
|
//#endregion
|
|
3289
|
+
//#region packages/core/src/text/underline.ts
|
|
3290
|
+
function hn(e, t, n, r, i, a, o, s = 1) {
|
|
3291
|
+
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, d = n + Math.max(2, l), f = u(d, l, s);
|
|
3292
|
+
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3293
|
+
let n = l, i = l * 6;
|
|
3294
|
+
e.beginPath(), e.moveTo(t, d);
|
|
3295
|
+
let a = Math.max(1, l * .5);
|
|
3296
|
+
for (let o = 0; o <= r; o += a) {
|
|
3297
|
+
let r = d + Math.sin(o / i * Math.PI * 2) * n;
|
|
3298
|
+
e.lineTo(t + o, r);
|
|
3299
|
+
}
|
|
3300
|
+
if (e.stroke(), o === "wavyDbl") {
|
|
3301
|
+
e.beginPath(), e.moveTo(t, d + n * 2.5);
|
|
3302
|
+
for (let o = 0; o <= r; o += a) {
|
|
3303
|
+
let r = d + n * 2.5 + Math.sin(o / i * Math.PI * 2) * n;
|
|
3304
|
+
e.lineTo(t + o, r);
|
|
3305
|
+
}
|
|
3306
|
+
e.stroke();
|
|
3307
|
+
}
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
if (o === "dbl") {
|
|
3311
|
+
let n = l * 1.4, i = d - n / 2, a = d + n / 2;
|
|
3312
|
+
e.beginPath(), e.moveTo(t, i + u(i, l, s)), e.lineTo(t + r, i + u(i, l, s)), e.moveTo(t, a + u(a, l, s)), e.lineTo(t + r, a + u(a, l, s)), e.stroke();
|
|
3313
|
+
return;
|
|
3314
|
+
}
|
|
3315
|
+
e.setLineDash(Oe(o ?? "sng", l)), e.beginPath(), e.moveTo(t, d + f), e.lineTo(t + r, d + f), e.stroke(), e.setLineDash([]);
|
|
3316
|
+
}
|
|
3317
|
+
//#endregion
|
|
3436
3318
|
//#region packages/core/src/text/highlight-box.ts
|
|
3437
|
-
function
|
|
3319
|
+
function gn(e, t) {
|
|
3438
3320
|
return {
|
|
3439
3321
|
top: e - t * .85,
|
|
3440
3322
|
height: t * 1.1
|
|
3441
3323
|
};
|
|
3442
3324
|
}
|
|
3443
3325
|
//#endregion
|
|
3326
|
+
//#region packages/core/src/text/justify-positions.ts
|
|
3327
|
+
function _n(e, t, n, r, i = 0) {
|
|
3328
|
+
let a = [], o = 0, s = 0;
|
|
3329
|
+
for (let c of t) a.push({
|
|
3330
|
+
text: e.slice(o, c).join(""),
|
|
3331
|
+
dx: r(e.slice(0, o).join("")) + o * i + s * n
|
|
3332
|
+
}), o = c, s++;
|
|
3333
|
+
return a.push({
|
|
3334
|
+
text: e.slice(o).join(""),
|
|
3335
|
+
dx: r(e.slice(0, o).join("")) + o * i + s * n
|
|
3336
|
+
}), a;
|
|
3337
|
+
}
|
|
3338
|
+
//#endregion
|
|
3444
3339
|
//#region packages/core/src/nav/internal-target.ts
|
|
3445
|
-
function
|
|
3340
|
+
function vn(e, t) {
|
|
3446
3341
|
let n = t.startsWith("/") ? [] : e.split("/").filter((e) => e !== "");
|
|
3447
3342
|
for (let e of t.split("/")) if (e === "..") n.pop();
|
|
3448
3343
|
else if (e === "." || e === "") continue;
|
|
3449
3344
|
else n.push(e);
|
|
3450
3345
|
return n.join("/");
|
|
3451
3346
|
}
|
|
3452
|
-
function
|
|
3347
|
+
function yn(e) {
|
|
3453
3348
|
let t = /[?&]jump=([a-zA-Z]+)/.exec(e);
|
|
3454
3349
|
if (!t) return null;
|
|
3455
3350
|
let n = t[1].toLowerCase();
|
|
3456
3351
|
return n === "firstslide" || n === "lastslide" || n === "nextslide" || n === "previousslide" ? n : null;
|
|
3457
3352
|
}
|
|
3458
|
-
function
|
|
3353
|
+
function bn(e, t, n) {
|
|
3459
3354
|
if (!(n <= 0)) switch (e) {
|
|
3460
3355
|
case "firstslide": return 0;
|
|
3461
3356
|
case "lastslide": return n - 1;
|
|
@@ -3465,14 +3360,14 @@ function Dn(e, t, n) {
|
|
|
3465
3360
|
}
|
|
3466
3361
|
//#endregion
|
|
3467
3362
|
//#region packages/pptx/src/text-layer.ts
|
|
3468
|
-
function
|
|
3363
|
+
function xn(e, t, n, r, i) {
|
|
3469
3364
|
e.innerHTML = "";
|
|
3470
3365
|
let a = /* @__PURE__ */ new Map();
|
|
3471
3366
|
for (let o of t) {
|
|
3472
3367
|
let t = o.rotation + (o.textBodyRotation ?? 0), s = `${o.shapeX},${o.shapeY},${o.shapeW},${o.shapeH},${t}`;
|
|
3473
3368
|
if (!a.has(s)) {
|
|
3474
3369
|
let i = document.createElement("div");
|
|
3475
|
-
i.style.cssText = `position:absolute;left:${
|
|
3370
|
+
i.style.cssText = `position:absolute;left:${q(o.shapeX, n)};top:${q(o.shapeY, r)};width:${q(o.shapeW, n)};height:${q(o.shapeH, r)};pointer-events:all;overflow:hidden;`, t !== 0 && (i.style.transformOrigin = "center center", i.style.transform = `rotate(${t}deg)`), a.set(s, {
|
|
3476
3371
|
div: i,
|
|
3477
3372
|
x: o.shapeX,
|
|
3478
3373
|
y: o.shapeY,
|
|
@@ -3484,18 +3379,18 @@ function On(e, t, n, r, i) {
|
|
|
3484
3379
|
let c = a.get(s), l = document.createElement("span");
|
|
3485
3380
|
l.textContent = o.text;
|
|
3486
3381
|
let u = i ? o.hyperlink : void 0;
|
|
3487
|
-
l.style.cssText = `position:absolute;left:${
|
|
3382
|
+
l.style.cssText = `position:absolute;left:${q(o.inShapeX, c.w)};top:${q(o.inShapeY, c.h)};font:${o.font};line-height:${o.h}px;letter-spacing:0;white-space:pre;color:transparent;cursor:${u ? "pointer" : "text"};`, u && i && (l.title = u.kind === "external" ? u.url : u.ref, l.addEventListener("click", (e) => {
|
|
3488
3383
|
e.preventDefault(), i(u);
|
|
3489
3384
|
})), c.div.appendChild(l);
|
|
3490
3385
|
}
|
|
3491
3386
|
}
|
|
3492
|
-
function
|
|
3387
|
+
function Sn(e, t, n, r, i, a, o = {}) {
|
|
3493
3388
|
e.innerHTML = "";
|
|
3494
3389
|
let s = o.match ?? "rgba(255, 214, 0, 0.42)", c = o.active ?? "rgba(255, 140, 0, 0.55)", l = /* @__PURE__ */ new Map(), u = (t) => {
|
|
3495
3390
|
let n = t.rotation + (t.textBodyRotation ?? 0), a = `${t.shapeX},${t.shapeY},${t.shapeW},${t.shapeH},${n}`, o = l.get(a);
|
|
3496
3391
|
if (!o) {
|
|
3497
3392
|
let s = document.createElement("div");
|
|
3498
|
-
s.style.cssText = `position:absolute;left:${
|
|
3393
|
+
s.style.cssText = `position:absolute;left:${q(t.shapeX, r)};top:${q(t.shapeY, i)};width:${q(t.shapeW, r)};height:${q(t.shapeH, i)};pointer-events:none;overflow:hidden;`, n !== 0 && (s.style.transformOrigin = "center center", s.style.transform = `rotate(${n}deg)`), o = {
|
|
3499
3394
|
div: s,
|
|
3500
3395
|
w: t.shapeW,
|
|
3501
3396
|
h: t.shapeH
|
|
@@ -3511,13 +3406,13 @@ function kn(e, t, n, r, i, a, o = {}) {
|
|
|
3511
3406
|
let i = a(e.font), { x: o, width: s } = ze(e.text, r.start, r.end, i);
|
|
3512
3407
|
if (s <= 0) continue;
|
|
3513
3408
|
let c = u(e), l = document.createElement("div");
|
|
3514
|
-
l.style.cssText = `position:absolute;left:${
|
|
3409
|
+
l.style.cssText = `position:absolute;left:${q(e.inShapeX + o, c.w)};top:${q(e.inShapeY, c.h)};width:${q(s, c.w)};height:${q(e.h, c.h)};background:${n};pointer-events:none;`, c.div.appendChild(l);
|
|
3515
3410
|
}
|
|
3516
3411
|
}
|
|
3517
3412
|
}
|
|
3518
3413
|
//#endregion
|
|
3519
3414
|
//#region packages/pptx/src/find.ts
|
|
3520
|
-
var
|
|
3415
|
+
var Cn = class {
|
|
3521
3416
|
_slideRuns = /* @__PURE__ */ new Map();
|
|
3522
3417
|
_matches = [];
|
|
3523
3418
|
_active = -1;
|
|
@@ -3560,7 +3455,7 @@ var An = class {
|
|
|
3560
3455
|
let n = this._slideCount();
|
|
3561
3456
|
for (let r = 0; r < n; r++) {
|
|
3562
3457
|
let n = await this._ensureSlideRuns(r), i = ve(n);
|
|
3563
|
-
for (let a of
|
|
3458
|
+
for (let a of ie(i, e, t)) {
|
|
3564
3459
|
let e = a.slices.map((e) => n[e.runIndex].text.slice(e.start, e.end)).join("");
|
|
3565
3460
|
this._matches.push({
|
|
3566
3461
|
slide: r,
|
|
@@ -3572,7 +3467,7 @@ var An = class {
|
|
|
3572
3467
|
return this.matches();
|
|
3573
3468
|
}
|
|
3574
3469
|
next() {
|
|
3575
|
-
return this._active =
|
|
3470
|
+
return this._active = Se(this._active, this._matches.length), this._activePublic();
|
|
3576
3471
|
}
|
|
3577
3472
|
prev() {
|
|
3578
3473
|
return this._active = ue(this._active, this._matches.length), this._activePublic();
|
|
@@ -3594,20 +3489,20 @@ var An = class {
|
|
|
3594
3489
|
};
|
|
3595
3490
|
//#endregion
|
|
3596
3491
|
//#region packages/pptx/src/types.ts
|
|
3597
|
-
function
|
|
3492
|
+
function wn(e) {
|
|
3598
3493
|
return e;
|
|
3599
3494
|
}
|
|
3600
3495
|
//#endregion
|
|
3601
3496
|
//#region packages/pptx/src/hyperlink.ts
|
|
3602
|
-
function
|
|
3497
|
+
function Tn(e, t) {
|
|
3603
3498
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3604
3499
|
if (n === void 0 && r === void 0) return;
|
|
3605
3500
|
if (r !== void 0) return {
|
|
3606
3501
|
kind: "internal",
|
|
3607
3502
|
ref: n ?? r
|
|
3608
3503
|
};
|
|
3609
|
-
let i = n, a =
|
|
3610
|
-
return a !== null &&
|
|
3504
|
+
let i = n, a = V(i);
|
|
3505
|
+
return a !== null && be.includes(a) ? {
|
|
3611
3506
|
kind: "external",
|
|
3612
3507
|
url: i
|
|
3613
3508
|
} : {
|
|
@@ -3617,7 +3512,7 @@ function Mn(e, t) {
|
|
|
3617
3512
|
}
|
|
3618
3513
|
//#endregion
|
|
3619
3514
|
//#region packages/pptx/src/media-chrome.ts
|
|
3620
|
-
function
|
|
3515
|
+
function En(e, t, n, r, i, a) {
|
|
3621
3516
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3622
3517
|
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") {
|
|
3623
3518
|
e.beginPath();
|
|
@@ -3631,43 +3526,43 @@ function Nn(e, t, n, r, i, a) {
|
|
|
3631
3526
|
}
|
|
3632
3527
|
//#endregion
|
|
3633
3528
|
//#region packages/pptx/src/bidi-line.ts
|
|
3634
|
-
var
|
|
3529
|
+
var Dn = (e) => {
|
|
3635
3530
|
let t = e.text;
|
|
3636
3531
|
return typeof t == "string" ? t : void 0;
|
|
3637
|
-
},
|
|
3638
|
-
function
|
|
3639
|
-
for (let
|
|
3640
|
-
let e =
|
|
3641
|
-
if (e !== void 0 &&
|
|
3532
|
+
}, On = (e) => "isTab" in e;
|
|
3533
|
+
function kn(e) {
|
|
3534
|
+
for (let t of e) {
|
|
3535
|
+
let e = Dn(t);
|
|
3536
|
+
if (e !== void 0 && M(e)) return !0;
|
|
3642
3537
|
}
|
|
3643
3538
|
return !1;
|
|
3644
3539
|
}
|
|
3645
|
-
function
|
|
3540
|
+
function An(e, t) {
|
|
3646
3541
|
let n = e.length;
|
|
3647
3542
|
if (n === 0) return {
|
|
3648
3543
|
order: [],
|
|
3649
3544
|
rtl: []
|
|
3650
3545
|
};
|
|
3651
|
-
let
|
|
3546
|
+
let i = "", a = Array(n), o;
|
|
3652
3547
|
for (let t = 0; t < n; t++) {
|
|
3653
|
-
|
|
3654
|
-
let n =
|
|
3655
|
-
if (
|
|
3656
|
-
for (
|
|
3657
|
-
a[
|
|
3548
|
+
a[t] = i.length;
|
|
3549
|
+
let n = Dn(e[t]) ?? "";
|
|
3550
|
+
if (i += n.length > 0 ? n : "", On(e[t])) {
|
|
3551
|
+
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3552
|
+
o[a[t]] = "S";
|
|
3658
3553
|
}
|
|
3659
3554
|
}
|
|
3660
|
-
if (
|
|
3661
|
-
let { levels:
|
|
3662
|
-
for (let e = 0; e < n; e++)
|
|
3555
|
+
if (o) for (; o.length < i.length;) o.push(null);
|
|
3556
|
+
let { levels: s, paragraphLevel: c } = d().computeLevels(i, t ? "rtl" : "ltr", o), { order: l, segLevels: u } = r(s, c, a), f = Array(n);
|
|
3557
|
+
for (let e = 0; e < n; e++) f[e] = (u[e] & 1) == 1;
|
|
3663
3558
|
return {
|
|
3664
|
-
order:
|
|
3665
|
-
rtl:
|
|
3559
|
+
order: l,
|
|
3560
|
+
rtl: f
|
|
3666
3561
|
};
|
|
3667
3562
|
}
|
|
3668
3563
|
//#endregion
|
|
3669
3564
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3670
|
-
function
|
|
3565
|
+
function jn(e, t, n, r) {
|
|
3671
3566
|
if (e.length === 0) return 0;
|
|
3672
3567
|
let i = t === 0, a = 0, o = t;
|
|
3673
3568
|
for (let t of e) {
|
|
@@ -3678,20 +3573,20 @@ function Rn(e, t, n, r) {
|
|
|
3678
3573
|
}
|
|
3679
3574
|
o += t.w, a++;
|
|
3680
3575
|
}
|
|
3681
|
-
return a === 0 ? 0 : a >= e.length ? e.length :
|
|
3576
|
+
return a === 0 ? 0 : a >= e.length ? e.length : _(e.map((e) => e.ch), a, r, +!!i);
|
|
3682
3577
|
}
|
|
3683
3578
|
//#endregion
|
|
3684
3579
|
//#region packages/pptx/src/text-justify.ts
|
|
3685
|
-
var
|
|
3686
|
-
function
|
|
3580
|
+
var Mn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3581
|
+
function Nn(e, t, n, r, i) {
|
|
3687
3582
|
if (r === "just" && i) return null;
|
|
3688
3583
|
let a = t - n;
|
|
3689
3584
|
if (a <= .5) return null;
|
|
3690
|
-
let o =
|
|
3585
|
+
let o = Le(e, a, {
|
|
3691
3586
|
firstContentSi: 0,
|
|
3692
3587
|
lastDrawnSi: e.length,
|
|
3693
|
-
isGapChar:
|
|
3694
|
-
isWhitespace:
|
|
3588
|
+
isGapChar: S,
|
|
3589
|
+
isWhitespace: Mn,
|
|
3695
3590
|
seaClusterGaps: r === "thaiDist"
|
|
3696
3591
|
});
|
|
3697
3592
|
if (!o) return null;
|
|
@@ -3712,7 +3607,7 @@ function Bn(e, t, n, r, i) {
|
|
|
3712
3607
|
}
|
|
3713
3608
|
//#endregion
|
|
3714
3609
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3715
|
-
function
|
|
3610
|
+
function Pn(e) {
|
|
3716
3611
|
if (!e) return {
|
|
3717
3612
|
r: 0,
|
|
3718
3613
|
g: 0,
|
|
@@ -3729,37 +3624,37 @@ function Vn(e) {
|
|
|
3729
3624
|
b: parseInt(t.slice(4, 6), 16)
|
|
3730
3625
|
};
|
|
3731
3626
|
}
|
|
3732
|
-
function
|
|
3733
|
-
let t =
|
|
3627
|
+
function Fn(e) {
|
|
3628
|
+
let t = Pn(e);
|
|
3734
3629
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3735
3630
|
}
|
|
3736
|
-
function
|
|
3631
|
+
function In(e, t) {
|
|
3737
3632
|
if (!e && !t) return null;
|
|
3738
3633
|
if (!e) return t;
|
|
3739
3634
|
if (!t) return e;
|
|
3740
3635
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3741
|
-
let n =
|
|
3636
|
+
let n = Fn(e.color), r = Fn(t.color);
|
|
3742
3637
|
return n === r || n < r ? e : t;
|
|
3743
3638
|
}
|
|
3744
3639
|
//#endregion
|
|
3745
3640
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3746
|
-
function
|
|
3747
|
-
let t =
|
|
3641
|
+
function Ln(e) {
|
|
3642
|
+
let t = I(e.length === 8 ? e.slice(0, 6) : e);
|
|
3748
3643
|
if (!t) return null;
|
|
3749
|
-
let n =
|
|
3644
|
+
let n = w(t[0], t[1], t[2]);
|
|
3750
3645
|
if (e.length !== 8) return n;
|
|
3751
3646
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3752
3647
|
if (Number.isNaN(r)) return null;
|
|
3753
3648
|
let i = r / 255;
|
|
3754
3649
|
return i * n + (1 - i);
|
|
3755
3650
|
}
|
|
3756
|
-
function
|
|
3651
|
+
function Rn(e) {
|
|
3757
3652
|
if (!e) return null;
|
|
3758
|
-
if (e.fillType === "solid") return
|
|
3653
|
+
if (e.fillType === "solid") return Ln(e.color);
|
|
3759
3654
|
if (e.fillType === "gradient") {
|
|
3760
3655
|
let t = e.stops.map((e) => ({
|
|
3761
3656
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3762
|
-
l:
|
|
3657
|
+
l: Ln(e.color)
|
|
3763
3658
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3764
3659
|
if (t.length === 0) return null;
|
|
3765
3660
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3768,18 +3663,18 @@ function Gn(e) {
|
|
|
3768
3663
|
}
|
|
3769
3664
|
return null;
|
|
3770
3665
|
}
|
|
3771
|
-
function
|
|
3666
|
+
function zn(e) {
|
|
3772
3667
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3773
3668
|
}
|
|
3774
|
-
function
|
|
3775
|
-
let n =
|
|
3669
|
+
function Bn(e, t) {
|
|
3670
|
+
let n = Rn(e);
|
|
3776
3671
|
if (n === null || n >= .5) return null;
|
|
3777
|
-
let r =
|
|
3672
|
+
let r = Ln(t.replace(/^#/, ""));
|
|
3778
3673
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3779
3674
|
}
|
|
3780
3675
|
//#endregion
|
|
3781
3676
|
//#region packages/pptx/src/tab-layout.ts
|
|
3782
|
-
function
|
|
3677
|
+
function Vn(e, t, n, r, i, a = 0) {
|
|
3783
3678
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3784
3679
|
let n = 0;
|
|
3785
3680
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3807,8 +3702,8 @@ function Jn(e, t, n, r, i, a = 0) {
|
|
|
3807
3702
|
}
|
|
3808
3703
|
//#endregion
|
|
3809
3704
|
//#region packages/pptx/src/vertical-text.ts
|
|
3810
|
-
var
|
|
3811
|
-
function
|
|
3705
|
+
var Hn = () => !1;
|
|
3706
|
+
function Un(e, t, n) {
|
|
3812
3707
|
let r = e.textBaseline;
|
|
3813
3708
|
e.textBaseline = "alphabetic";
|
|
3814
3709
|
let i = e.measureText(t);
|
|
@@ -3816,7 +3711,7 @@ function Xn(e, t, n) {
|
|
|
3816
3711
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3817
3712
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3818
3713
|
}
|
|
3819
|
-
function
|
|
3714
|
+
function Wn(e, t) {
|
|
3820
3715
|
let n = e.textAlign, r = e.textBaseline;
|
|
3821
3716
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3822
3717
|
let i = e.measureText(t);
|
|
@@ -3824,45 +3719,45 @@ function Zn(e, t) {
|
|
|
3824
3719
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3825
3720
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3826
3721
|
}
|
|
3827
|
-
function
|
|
3828
|
-
let l = e.textAlign, u = e.textBaseline, d = s === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), f =
|
|
3722
|
+
function Gn(e, t, n, r, i, o, s = "fill", c = Hn) {
|
|
3723
|
+
let l = e.textAlign, u = e.textBaseline, d = s === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), f = r - Un(e, t, i), p = 0;
|
|
3829
3724
|
for (let s of t) {
|
|
3830
|
-
let t = s.codePointAt(0) ?? 0, u =
|
|
3831
|
-
if (
|
|
3725
|
+
let t = s.codePointAt(0) ?? 0, u = D(t), m = e.measureText(s).width + o, h = u === "Tr" ? B(t) : null, g = u === "Tr" && h === null && De(t), _ = u === "U" || u === "Tu" || h !== null || g;
|
|
3726
|
+
if (a(t) && c(t)) {
|
|
3832
3727
|
let t = n + p + m / 2;
|
|
3833
3728
|
e.save(), e.translate(t, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", Te(e, () => d(s, 0, 0)), e.restore();
|
|
3834
3729
|
} else if (_) {
|
|
3835
|
-
let r = h === null && u === "Tu" ?
|
|
3836
|
-
e.save(), e.translate(c, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", d(o, 0, l *
|
|
3730
|
+
let r = h === null && u === "Tu" ? ke(t) : null, a = h === null ? r : h, o = a === null ? s : String.fromCodePoint(a), c = n + p + m / 2, l = r === null ? Wn(e, o) / i : 0;
|
|
3731
|
+
e.save(), e.translate(c, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", d(o, 0, l * i), e.restore();
|
|
3837
3732
|
} else if (u === "Tr") {
|
|
3838
3733
|
let t = n + p + m / 2;
|
|
3839
3734
|
e.textAlign = "center", e.textBaseline = "middle", d(s, t, f);
|
|
3840
|
-
} else e.textAlign = l, e.textBaseline = "alphabetic", d(s, n + p,
|
|
3735
|
+
} else e.textAlign = l, e.textBaseline = "alphabetic", d(s, n + p, r);
|
|
3841
3736
|
p += m;
|
|
3842
3737
|
}
|
|
3843
3738
|
e.textAlign = l, e.textBaseline = u;
|
|
3844
3739
|
}
|
|
3845
|
-
function
|
|
3846
|
-
|
|
3740
|
+
function Kn(e, t, n, r, i, a, o = "fill") {
|
|
3741
|
+
Gn(e, t, n, r, i, a, o, (t) => L(e, t));
|
|
3847
3742
|
}
|
|
3848
3743
|
//#endregion
|
|
3849
3744
|
//#region packages/pptx/src/renderer.ts
|
|
3850
3745
|
function Y(e, t) {
|
|
3851
3746
|
return e * t;
|
|
3852
3747
|
}
|
|
3853
|
-
var X =
|
|
3854
|
-
function
|
|
3855
|
-
let { top: s, height: c } =
|
|
3748
|
+
var X = Ae;
|
|
3749
|
+
function qn(e, t, n, r, i, a, o) {
|
|
3750
|
+
let { top: s, height: c } = gn(n, i);
|
|
3856
3751
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3857
3752
|
}
|
|
3858
|
-
function
|
|
3753
|
+
function Jn(e) {
|
|
3859
3754
|
return !e || e.fillType === "none" ? null : e.fillType === "solid" ? X(e.color) : e.fillType === "gradient" ? e.stops.length > 0 ? X(e.stops[0].color) : null : e.fillType === "pattern" ? X(e.fg) : null;
|
|
3860
3755
|
}
|
|
3861
|
-
function
|
|
3862
|
-
return
|
|
3756
|
+
function Yn(e, t, n, r, i, a) {
|
|
3757
|
+
return O(e, t, n, r, i, a);
|
|
3863
3758
|
}
|
|
3864
|
-
var
|
|
3865
|
-
function
|
|
3759
|
+
var Xn = /* @__PURE__ */ new WeakMap();
|
|
3760
|
+
function Zn(e, t) {
|
|
3866
3761
|
let n = e.tinted.get(t);
|
|
3867
3762
|
if (n) return n;
|
|
3868
3763
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3870,18 +3765,18 @@ function ir(e, t) {
|
|
|
3870
3765
|
let o = a.getContext("2d");
|
|
3871
3766
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3872
3767
|
}
|
|
3873
|
-
function
|
|
3768
|
+
function Qn(e) {
|
|
3874
3769
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3875
3770
|
return new Promise((e, r) => {
|
|
3876
3771
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3877
3772
|
});
|
|
3878
3773
|
}
|
|
3879
|
-
var
|
|
3880
|
-
function
|
|
3881
|
-
let r = Math.max(1, Math.round(t *
|
|
3774
|
+
var $n = 256;
|
|
3775
|
+
function er(e, t, n) {
|
|
3776
|
+
let r = Math.max(1, Math.round(t * $n)), i = Math.max(1, Math.round(n * $n));
|
|
3882
3777
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3883
3778
|
}
|
|
3884
|
-
function
|
|
3779
|
+
function tr(e) {
|
|
3885
3780
|
let t = [], n = (e) => {
|
|
3886
3781
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3887
3782
|
nodes: e.nodes,
|
|
@@ -3892,13 +3787,13 @@ function cr(e) {
|
|
|
3892
3787
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3893
3788
|
return t;
|
|
3894
3789
|
}
|
|
3895
|
-
async function
|
|
3896
|
-
let n =
|
|
3790
|
+
async function nr(e, t) {
|
|
3791
|
+
let n = tr(e);
|
|
3897
3792
|
if (n.length !== 0) {
|
|
3898
3793
|
await t.loadMathJax();
|
|
3899
|
-
for (let e of n) if (!
|
|
3900
|
-
let n = await t.mathMLToSvg(
|
|
3901
|
-
|
|
3794
|
+
for (let e of n) if (!Xn.has(e.nodes)) try {
|
|
3795
|
+
let n = await t.mathMLToSvg(m(e.nodes, e.display)), r = await Qn(er(Ye(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3796
|
+
Xn.set(e.nodes, {
|
|
3902
3797
|
img: r,
|
|
3903
3798
|
widthEm: n.widthEm,
|
|
3904
3799
|
ascentEm: n.ascentEm,
|
|
@@ -3908,10 +3803,10 @@ async function lr(e, t) {
|
|
|
3908
3803
|
} catch {}
|
|
3909
3804
|
}
|
|
3910
3805
|
}
|
|
3911
|
-
function
|
|
3806
|
+
function rr(e, t) {
|
|
3912
3807
|
return e ? e.startsWith("+") ? e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif" : e.split(",")[0].trim() || (t.themeMinorFont ?? "sans-serif") : t.themeMinorFont ?? "sans-serif";
|
|
3913
3808
|
}
|
|
3914
|
-
var
|
|
3809
|
+
var ir = new Set([
|
|
3915
3810
|
"serif",
|
|
3916
3811
|
"sans-serif",
|
|
3917
3812
|
"monospace",
|
|
@@ -3919,11 +3814,11 @@ var dr = new Set([
|
|
|
3919
3814
|
"fantasy",
|
|
3920
3815
|
"system-ui"
|
|
3921
3816
|
]);
|
|
3922
|
-
function
|
|
3923
|
-
let t =
|
|
3817
|
+
function ar(e) {
|
|
3818
|
+
let t = E(e);
|
|
3924
3819
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3925
3820
|
}
|
|
3926
|
-
var
|
|
3821
|
+
var or = {
|
|
3927
3822
|
calibri: "Carlito",
|
|
3928
3823
|
"calibri light": "Carlito",
|
|
3929
3824
|
cambria: "Caladea",
|
|
@@ -3933,48 +3828,48 @@ var pr = {
|
|
|
3933
3828
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3934
3829
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3935
3830
|
"univers next arabic": "Noto Sans Arabic"
|
|
3936
|
-
},
|
|
3937
|
-
function
|
|
3938
|
-
if (
|
|
3831
|
+
}, sr = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3832
|
+
function cr(e) {
|
|
3833
|
+
if (or[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3939
3834
|
let t = e.toLowerCase();
|
|
3940
3835
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3941
3836
|
}
|
|
3942
|
-
function
|
|
3837
|
+
function lr(e) {
|
|
3943
3838
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3944
3839
|
}
|
|
3945
|
-
function
|
|
3946
|
-
let t =
|
|
3947
|
-
if (
|
|
3948
|
-
let i = t === "serif" ? "serif" : "sans",
|
|
3949
|
-
return `"${e}", ${r}${
|
|
3840
|
+
function ur(e) {
|
|
3841
|
+
let t = ar(e), n = or[e.toLowerCase()], r = n ? `"${n}", ` : "";
|
|
3842
|
+
if (cr(e)) return `"${e}", ${r}${sr}, ${t}`;
|
|
3843
|
+
let i = t === "serif" ? "serif" : "sans", a = v(e);
|
|
3844
|
+
return `"${e}", ${r}${a ? `${lr(p(a, i))}, ` : ""}${`${lr(i === "serif" ? C : x)}, `}${t}`;
|
|
3950
3845
|
}
|
|
3951
|
-
function
|
|
3846
|
+
function dr(e) {
|
|
3952
3847
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3953
3848
|
}
|
|
3954
3849
|
function Z(e, t, n, r, i) {
|
|
3955
|
-
let a = t ? "italic " : "", o = e ? "bold " : "", s =
|
|
3956
|
-
return
|
|
3850
|
+
let a = t ? "italic " : "", o = e ? "bold " : "", s = rr(r, i);
|
|
3851
|
+
return ir.has(s) ? `${a}${o}${n}px ${s}` : `${a}${o}${n}px ${ur(s)}`;
|
|
3957
3852
|
}
|
|
3958
|
-
function
|
|
3959
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3853
|
+
function fr(e) {
|
|
3854
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || wn(e.bullet).type === "blip";
|
|
3960
3855
|
}
|
|
3961
|
-
function
|
|
3856
|
+
function pr(e, t) {
|
|
3962
3857
|
return e ? 0 : Math.max(0, t);
|
|
3963
3858
|
}
|
|
3964
|
-
function
|
|
3965
|
-
let
|
|
3966
|
-
for (let
|
|
3967
|
-
let
|
|
3968
|
-
for (let
|
|
3969
|
-
if (
|
|
3970
|
-
let
|
|
3971
|
-
if (e.font = Z(
|
|
3859
|
+
function mr(e, t, r, i, a, o, s) {
|
|
3860
|
+
let c = (t.defaultFontSize ?? 18) * n * o;
|
|
3861
|
+
for (let l of t.paragraphs) {
|
|
3862
|
+
let u = Y(l.marL, o), d = Y(l.marR, o), f = Y(l.indent, o), p = pr(fr(l), f), m = r - i - a - u - d - p, h = 0;
|
|
3863
|
+
for (let r of l.runs) {
|
|
3864
|
+
if (r.type !== "text") continue;
|
|
3865
|
+
let i = r.fontSize == null ? l.defFontSize == null ? c : l.defFontSize * n * o : r.fontSize * n * o, a = rr(r.fontFamily ?? l.defFontFamily ?? null, s);
|
|
3866
|
+
if (e.font = Z(r.bold ?? l.defBold ?? t.defaultBold ?? !1, r.italic ?? l.defItalic ?? t.defaultItalic ?? !1, i, a, s), h += e.measureText(r.text).width, h > m) return !0;
|
|
3972
3867
|
}
|
|
3973
3868
|
}
|
|
3974
3869
|
return !1;
|
|
3975
3870
|
}
|
|
3976
|
-
function
|
|
3977
|
-
for (let t of e) if (
|
|
3871
|
+
function hr(e) {
|
|
3872
|
+
for (let t of e) if (S(t.codePointAt(0) ?? 0)) return !0;
|
|
3978
3873
|
return !1;
|
|
3979
3874
|
}
|
|
3980
3875
|
function Q(e) {
|
|
@@ -3982,47 +3877,47 @@ function Q(e) {
|
|
|
3982
3877
|
for (let n of e) t++;
|
|
3983
3878
|
return t;
|
|
3984
3879
|
}
|
|
3985
|
-
function
|
|
3880
|
+
function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
3986
3881
|
themeMajorFont: null,
|
|
3987
3882
|
themeMinorFont: null,
|
|
3988
3883
|
dpr: 1
|
|
3989
|
-
},
|
|
3990
|
-
let
|
|
3991
|
-
pos: Y(e.pos,
|
|
3884
|
+
}, h = 0) {
|
|
3885
|
+
let g = [], _ = () => r - (g.length === 0 ? h : 0), v = { segments: [] }, x = 0, C = !1, w = t.rtl === !0, E = Y(t.marR, c), D = (t.tabStops ?? []).map((e) => ({
|
|
3886
|
+
pos: Y(e.pos, c),
|
|
3992
3887
|
algn: e.algn
|
|
3993
|
-
})),
|
|
3994
|
-
let t =
|
|
3888
|
+
})), O = Y(t.defTabSz ?? 914400, c), A = !1, j = [], M = 0, N = () => w ? E : l + (g.length === 0 ? h : 0), P = (e = 0) => {
|
|
3889
|
+
let t = Vn(e > 0 ? [...j, {
|
|
3995
3890
|
isTab: !1,
|
|
3996
3891
|
width: e
|
|
3997
|
-
}] :
|
|
3892
|
+
}] : j, D, N(), Infinity, M, O), n = 0;
|
|
3998
3893
|
for (let e of t) n += e;
|
|
3999
3894
|
return n;
|
|
4000
|
-
},
|
|
3895
|
+
}, F = (e) => {
|
|
4001
3896
|
let t = _();
|
|
4002
|
-
return Number.isFinite(t) ?
|
|
4003
|
-
},
|
|
3897
|
+
return Number.isFinite(t) ? A ? P(e) <= t : x + e <= t : !0;
|
|
3898
|
+
}, I = () => {
|
|
4004
3899
|
let e = _();
|
|
4005
|
-
if (!
|
|
3900
|
+
if (!A) return e - x;
|
|
4006
3901
|
if (!Number.isFinite(e)) return Infinity;
|
|
4007
|
-
if (
|
|
3902
|
+
if (P(0) >= e) return 0;
|
|
4008
3903
|
let t = 0, n = e;
|
|
4009
3904
|
for (let r = 0; r < 40; r++) {
|
|
4010
3905
|
let r = (t + n) / 2;
|
|
4011
|
-
|
|
3906
|
+
P(r) <= e ? t = r : n = r;
|
|
4012
3907
|
}
|
|
4013
3908
|
return t;
|
|
4014
|
-
},
|
|
4015
|
-
e && (
|
|
4016
|
-
},
|
|
3909
|
+
}, L = (e = !1) => {
|
|
3910
|
+
e && (v.endsWithBreak = !0), g.push(v), v = { segments: [] }, x = 0, A = !1, j = [], C = !1;
|
|
3911
|
+
}, R = (t, n, r, i, a, o, s, c) => {
|
|
4017
3912
|
if (!t) return;
|
|
4018
3913
|
e.font = n;
|
|
4019
|
-
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * Q(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.outline, g = c?.highlight, _ = c?.fontFamily,
|
|
4020
|
-
x += u,
|
|
3914
|
+
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * Q(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.outline, g = c?.highlight, _ = c?.fontFamily, y = c?.hyperlink, b = (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.outline === h && (e.highlight ?? "") === (g ?? "") && (e.fontFamily ?? "") === (_ ?? "") && dr(e.hyperlink) === dr(y);
|
|
3915
|
+
x += u, j.push({
|
|
4021
3916
|
isTab: !1,
|
|
4022
3917
|
width: u
|
|
4023
3918
|
});
|
|
4024
|
-
let S =
|
|
4025
|
-
S && b(S) ? S.text += t :
|
|
3919
|
+
let S = v.segments.at(-1);
|
|
3920
|
+
S && b(S) ? S.text += t : v.segments.push({
|
|
4026
3921
|
text: t,
|
|
4027
3922
|
font: n,
|
|
4028
3923
|
fontFamily: _,
|
|
@@ -4038,16 +3933,16 @@ function Cr(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4038
3933
|
shadow: m,
|
|
4039
3934
|
outline: h,
|
|
4040
3935
|
highlight: g,
|
|
4041
|
-
hyperlink:
|
|
3936
|
+
hyperlink: y
|
|
4042
3937
|
});
|
|
4043
|
-
},
|
|
4044
|
-
let e =
|
|
3938
|
+
}, z = () => {
|
|
3939
|
+
let e = v.segments.at(-1);
|
|
4045
3940
|
if (!e || e.math) return !1;
|
|
4046
3941
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
4047
3942
|
if (t) e.text = t[1], n = t[2];
|
|
4048
|
-
else if (
|
|
3943
|
+
else if (v.segments.length > 1) v.segments.pop(), n = e.text;
|
|
4049
3944
|
else return !1;
|
|
4050
|
-
return
|
|
3945
|
+
return L(), R(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
4051
3946
|
strikeDouble: e.strikeDouble,
|
|
4052
3947
|
letterSpacingPx: e.letterSpacingPx,
|
|
4053
3948
|
underlineStyle: e.underlineStyle,
|
|
@@ -4058,90 +3953,90 @@ function Cr(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4058
3953
|
fontFamily: e.fontFamily
|
|
4059
3954
|
}), !0;
|
|
4060
3955
|
};
|
|
4061
|
-
for (let
|
|
4062
|
-
if (
|
|
4063
|
-
|
|
3956
|
+
for (let r of t.runs) {
|
|
3957
|
+
if (r.type === "break") {
|
|
3958
|
+
L(!0);
|
|
4064
3959
|
continue;
|
|
4065
3960
|
}
|
|
4066
|
-
if (
|
|
4067
|
-
let e =
|
|
4068
|
-
(
|
|
3961
|
+
if (r.type === "math") {
|
|
3962
|
+
let e = Xn.get(r.nodes), t = r.fontSize == null ? i : r.fontSize * n * c * f, o = e ? e.widthEm * t : 0, s = e ? e.ascentEm * t : 0, l = e ? e.descentEm * t : 0;
|
|
3963
|
+
(r.display && x > 0 || !F(o) && x > 0) && L(), j.push({
|
|
4069
3964
|
isTab: !1,
|
|
4070
|
-
width:
|
|
4071
|
-
}),
|
|
3965
|
+
width: o
|
|
3966
|
+
}), v.segments.push({
|
|
4072
3967
|
text: "",
|
|
4073
3968
|
font: `${t}px sans-serif`,
|
|
4074
3969
|
sizePx: t,
|
|
4075
|
-
color:
|
|
3970
|
+
color: r.color ? X(r.color) : a,
|
|
4076
3971
|
underline: !1,
|
|
4077
3972
|
strikethrough: !1,
|
|
4078
3973
|
math: {
|
|
4079
|
-
nodes:
|
|
4080
|
-
display:
|
|
4081
|
-
width:
|
|
3974
|
+
nodes: r.nodes,
|
|
3975
|
+
display: r.display,
|
|
3976
|
+
width: o,
|
|
4082
3977
|
ascent: s,
|
|
4083
|
-
descent:
|
|
3978
|
+
descent: l
|
|
4084
3979
|
}
|
|
4085
|
-
}), x +=
|
|
3980
|
+
}), x += o, r.display && L();
|
|
4086
3981
|
continue;
|
|
4087
3982
|
}
|
|
4088
|
-
let
|
|
4089
|
-
|
|
4090
|
-
let
|
|
4091
|
-
e.font =
|
|
4092
|
-
let
|
|
4093
|
-
(
|
|
4094
|
-
let
|
|
4095
|
-
strikeDouble:
|
|
4096
|
-
letterSpacingPx:
|
|
4097
|
-
underlineStyle:
|
|
4098
|
-
underlineColor:
|
|
4099
|
-
shadow:
|
|
4100
|
-
outline:
|
|
4101
|
-
fontFamily:
|
|
4102
|
-
highlight:
|
|
4103
|
-
hyperlink:
|
|
4104
|
-
},
|
|
4105
|
-
for (let
|
|
4106
|
-
if (!
|
|
4107
|
-
if (/^\t+$/.test(
|
|
4108
|
-
|
|
4109
|
-
for (let e of
|
|
3983
|
+
let l = r.fontSize == null ? i : r.fontSize * n * c * f, h = rr(r.fontFamily ?? t.defFontFamily ?? null, m), g = r.fontFamilyEa ? rr(r.fontFamilyEa, m) : null, w = r.fontFamilySym ? rr(r.fontFamilySym, m) : null, E;
|
|
3984
|
+
E = r.color ? X(r.color) : r.hyperlink && m.themeHlinkColor ? X(m.themeHlinkColor) : a;
|
|
3985
|
+
let D = r.bold ?? t.defBold ?? u, O = r.italic ?? t.defItalic ?? d, N = Z(D, O, l, h, m), P = g ? Z(D, O, l, g, m) : N;
|
|
3986
|
+
e.font = N;
|
|
3987
|
+
let B = r.caps, V = r.text;
|
|
3988
|
+
(B === "all" || B === "small") && (V = V.toUpperCase());
|
|
3989
|
+
let H = r.fieldType === "slidenum" && p !== void 0 ? String(p) : V, U = r.underline || r.hyperlink !== void 0, ee = r.strikeDouble === !0, W = r.letterSpacing == null ? 0 : r.letterSpacing * n * c, G = {
|
|
3990
|
+
strikeDouble: ee,
|
|
3991
|
+
letterSpacingPx: W,
|
|
3992
|
+
underlineStyle: r.underlineStyle,
|
|
3993
|
+
underlineColor: r.underlineColor ? X(r.underlineColor) : void 0,
|
|
3994
|
+
shadow: r.shadow,
|
|
3995
|
+
outline: r.outline,
|
|
3996
|
+
fontFamily: h,
|
|
3997
|
+
highlight: r.highlight ? X(r.highlight) : void 0,
|
|
3998
|
+
hyperlink: Tn(r.hyperlink)
|
|
3999
|
+
}, te = H.split(/(\s+)/);
|
|
4000
|
+
for (let n of te) {
|
|
4001
|
+
if (!n) continue;
|
|
4002
|
+
if (/^\t+$/.test(n)) {
|
|
4003
|
+
A || (e.font = N, M = e.measureText(" ").width);
|
|
4004
|
+
for (let e of n) v.segments.push({
|
|
4110
4005
|
text: "",
|
|
4111
4006
|
isTab: !0,
|
|
4112
|
-
font:
|
|
4113
|
-
fontFamily:
|
|
4114
|
-
sizePx:
|
|
4115
|
-
color:
|
|
4007
|
+
font: N,
|
|
4008
|
+
fontFamily: h,
|
|
4009
|
+
sizePx: l,
|
|
4010
|
+
color: E,
|
|
4116
4011
|
underline: !1,
|
|
4117
4012
|
strikethrough: !1
|
|
4118
|
-
}),
|
|
4013
|
+
}), j.push({
|
|
4119
4014
|
isTab: !0,
|
|
4120
4015
|
width: 0
|
|
4121
4016
|
});
|
|
4122
|
-
|
|
4017
|
+
A = !0;
|
|
4123
4018
|
continue;
|
|
4124
4019
|
}
|
|
4125
|
-
e.font =
|
|
4126
|
-
let
|
|
4127
|
-
if (c.test(
|
|
4128
|
-
let t =
|
|
4129
|
-
for (let i of
|
|
4130
|
-
let
|
|
4020
|
+
e.font = N;
|
|
4021
|
+
let i = e.measureText(n).width, a = /^\s+$/.test(n), c = /[-]/;
|
|
4022
|
+
if (c.test(n) && (w != null || Fe(h))) {
|
|
4023
|
+
let t = w ?? h;
|
|
4024
|
+
for (let i of n) {
|
|
4025
|
+
let n = i, a = N;
|
|
4131
4026
|
if (c.test(i)) {
|
|
4132
|
-
let e =
|
|
4133
|
-
e === i ? a = Z(
|
|
4027
|
+
let e = Ie(i, t);
|
|
4028
|
+
e === i ? a = Z(D, O, l, t, m) : (n = e, a = Z(D, O, l, "sans-serif", m));
|
|
4134
4029
|
}
|
|
4135
4030
|
e.font = a;
|
|
4136
|
-
let o = e.measureText(
|
|
4137
|
-
!
|
|
4031
|
+
let o = e.measureText(n).width;
|
|
4032
|
+
!F(o) && x > 0 && L(), R(n, a, l, E, U, r.strikethrough, r.baseline ?? void 0, G);
|
|
4138
4033
|
}
|
|
4139
4034
|
continue;
|
|
4140
4035
|
}
|
|
4141
|
-
if (
|
|
4036
|
+
if (hr(n) && (!k(n) || t.eaLnBrk === !1)) {
|
|
4142
4037
|
let i = [];
|
|
4143
|
-
for (let t of
|
|
4144
|
-
let n =
|
|
4038
|
+
for (let t of n) {
|
|
4039
|
+
let n = S(t.codePointAt(0) ?? 0) && g != null, r = n ? P : N, a = n ? g : h;
|
|
4145
4040
|
e.font = r, i.push({
|
|
4146
4041
|
ch: t,
|
|
4147
4042
|
w: e.measureText(t).width,
|
|
@@ -4151,116 +4046,116 @@ function Cr(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4151
4046
|
}
|
|
4152
4047
|
if (t.eaLnBrk === !1) {
|
|
4153
4048
|
let e = i.reduce((e, t) => e + t.w, 0);
|
|
4154
|
-
x > 0 && !
|
|
4155
|
-
for (let e of i)
|
|
4156
|
-
...
|
|
4049
|
+
x > 0 && !F(e) && L();
|
|
4050
|
+
for (let e of i) R(e.ch, e.font, l, E, U, r.strikethrough, r.baseline ?? void 0, {
|
|
4051
|
+
...G,
|
|
4157
4052
|
fontFamily: e.family
|
|
4158
4053
|
});
|
|
4159
4054
|
continue;
|
|
4160
4055
|
}
|
|
4161
4056
|
let a = i;
|
|
4162
4057
|
for (; a.length > 0;) {
|
|
4163
|
-
let e = Number.isFinite(_()) ? _() -
|
|
4058
|
+
let e = Number.isFinite(_()) ? _() - I() : x, t = jn(a, e, _(), T);
|
|
4164
4059
|
if (t === 0) {
|
|
4165
4060
|
if (x > 0) {
|
|
4166
|
-
|
|
4061
|
+
L();
|
|
4167
4062
|
continue;
|
|
4168
4063
|
}
|
|
4169
4064
|
t = 1;
|
|
4170
4065
|
}
|
|
4171
4066
|
for (let e = 0; e < t; e++) {
|
|
4172
4067
|
let t = a[e];
|
|
4173
|
-
|
|
4174
|
-
...
|
|
4068
|
+
R(t.ch, t.font, l, E, U, r.strikethrough, r.baseline ?? void 0, {
|
|
4069
|
+
...G,
|
|
4175
4070
|
fontFamily: t.family
|
|
4176
4071
|
});
|
|
4177
4072
|
}
|
|
4178
|
-
a = a.slice(t), a.length > 0 &&
|
|
4073
|
+
a = a.slice(t), a.length > 0 && L();
|
|
4179
4074
|
}
|
|
4180
4075
|
continue;
|
|
4181
4076
|
}
|
|
4182
|
-
if (
|
|
4183
|
-
let t =
|
|
4077
|
+
if (k(n)) {
|
|
4078
|
+
let t = y(n, {
|
|
4184
4079
|
cjk: !0,
|
|
4185
|
-
kinsoku:
|
|
4186
|
-
}),
|
|
4187
|
-
let n =
|
|
4188
|
-
r !== "" && (e.font = i ?
|
|
4080
|
+
kinsoku: T
|
|
4081
|
+
}), i = g != null && P !== N, a = (e) => i && S(e.codePointAt(0) ?? 0), c = (t) => {
|
|
4082
|
+
let n = W * Q(t), r = "", i = null, o = () => {
|
|
4083
|
+
r !== "" && (e.font = i ? P : N, n += e.measureText(r).width, r = "");
|
|
4189
4084
|
};
|
|
4190
4085
|
for (let e of t) {
|
|
4191
|
-
let t =
|
|
4192
|
-
i === null || t === i ? (r += e, i = t) : (
|
|
4086
|
+
let t = a(e);
|
|
4087
|
+
i === null || t === i ? (r += e, i = t) : (o(), r = e, i = t);
|
|
4193
4088
|
}
|
|
4194
|
-
return
|
|
4195
|
-
},
|
|
4196
|
-
let t = "",
|
|
4089
|
+
return o(), n;
|
|
4090
|
+
}, u = (e) => {
|
|
4091
|
+
let t = "", n = null, i = () => {
|
|
4197
4092
|
if (t === "") return;
|
|
4198
|
-
let e =
|
|
4199
|
-
|
|
4200
|
-
...
|
|
4093
|
+
let e = n ? P : N, i = n ? g : h;
|
|
4094
|
+
R(t, e, l, E, U, r.strikethrough, r.baseline ?? void 0, {
|
|
4095
|
+
...G,
|
|
4201
4096
|
fontFamily: i
|
|
4202
4097
|
}), t = "";
|
|
4203
4098
|
};
|
|
4204
|
-
for (let
|
|
4205
|
-
let e =
|
|
4206
|
-
|
|
4099
|
+
for (let r of e) {
|
|
4100
|
+
let e = a(r);
|
|
4101
|
+
n === null || e === n ? (t += r, n = e) : (i(), t = r, n = e);
|
|
4207
4102
|
}
|
|
4208
4103
|
i();
|
|
4209
|
-
},
|
|
4210
|
-
for (;
|
|
4211
|
-
let e =
|
|
4212
|
-
if (
|
|
4104
|
+
}, d = ae(n), f = n.length, p = 0;
|
|
4105
|
+
for (; p < f;) {
|
|
4106
|
+
let e = I(), r = s(n, t, p, e, c, d);
|
|
4107
|
+
if (r <= p) {
|
|
4213
4108
|
if (x > 0) {
|
|
4214
|
-
|
|
4109
|
+
L();
|
|
4215
4110
|
continue;
|
|
4216
4111
|
}
|
|
4217
|
-
let
|
|
4218
|
-
|
|
4112
|
+
let i = t.find((e) => e > p) ?? f, a = n.slice(p, i), l = o(a), u = s(a, l, 0, e, c, d);
|
|
4113
|
+
u <= 0 && (u = l.length > 0 ? l[0] : a.length), r = p + u;
|
|
4219
4114
|
}
|
|
4220
|
-
|
|
4115
|
+
u(n.slice(p, r)), p = r, p < f && L();
|
|
4221
4116
|
}
|
|
4222
4117
|
continue;
|
|
4223
4118
|
}
|
|
4224
|
-
if (
|
|
4225
|
-
else if (
|
|
4226
|
-
else if (
|
|
4227
|
-
x > 0 &&
|
|
4228
|
-
for (let t of
|
|
4229
|
-
e.font =
|
|
4230
|
-
let
|
|
4231
|
-
!
|
|
4119
|
+
if (F(i)) R(n, N, l, E, U, r.strikethrough, r.baseline ?? void 0, G), a && (C = !0);
|
|
4120
|
+
else if (a) x > 0 && L();
|
|
4121
|
+
else if (i > _()) {
|
|
4122
|
+
x > 0 && L();
|
|
4123
|
+
for (let t of n) {
|
|
4124
|
+
e.font = N;
|
|
4125
|
+
let n = e.measureText(t).width;
|
|
4126
|
+
!F(n) && x > 0 && L(), R(t, N, l, E, U, r.strikethrough, r.baseline ?? void 0, G);
|
|
4232
4127
|
}
|
|
4233
|
-
} else if (!
|
|
4128
|
+
} else if (!C) R(n, N, l, E, U, r.strikethrough, r.baseline ?? void 0, G);
|
|
4234
4129
|
else {
|
|
4235
|
-
let e =
|
|
4236
|
-
(o ||
|
|
4130
|
+
let e = v.segments.at(-1)?.text ?? "", t = n.codePointAt(0), i = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(n) && i !== 8203 && t !== 8203, o = t !== void 0 && T.lineStartForbidden.has(t) && a, s = i !== void 0 && t !== void 0 && a && !k(e) && !k(n) && b(i, t);
|
|
4131
|
+
(o || s) && z() || L(), R(n, N, l, E, U, r.strikethrough, r.baseline ?? void 0, G);
|
|
4237
4132
|
}
|
|
4238
4133
|
}
|
|
4239
4134
|
}
|
|
4240
|
-
return
|
|
4135
|
+
return g.push(v), g;
|
|
4241
4136
|
}
|
|
4242
|
-
async function
|
|
4137
|
+
async function _r(e, t, r, i, a, o) {
|
|
4243
4138
|
if (t && t.fillType === "image") {
|
|
4244
|
-
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0,
|
|
4139
|
+
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, r, i), !t.imagePath || !t.mimeType || !o) return;
|
|
4245
4140
|
try {
|
|
4246
|
-
let
|
|
4247
|
-
widthPt:
|
|
4248
|
-
heightPt:
|
|
4141
|
+
let s = await We(t.imagePath, t.mimeType, t.duotone, o, {
|
|
4142
|
+
widthPt: r / a / n,
|
|
4143
|
+
heightPt: i / a / n
|
|
4249
4144
|
});
|
|
4250
|
-
if (!
|
|
4251
|
-
if (e.save(), e.beginPath(), e.rect(0, 0,
|
|
4145
|
+
if (!s) return;
|
|
4146
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) br(e, s, t.tile, r, i, a);
|
|
4252
4147
|
else {
|
|
4253
|
-
let
|
|
4254
|
-
e.drawImage(
|
|
4148
|
+
let n = t.fillRect ?? {}, a = n.l ?? 0, o = n.t ?? 0, c = n.r ?? 0, l = n.b ?? 0, u = a * r, d = o * i, f = r * (1 - a - c), p = i * (1 - o - l);
|
|
4149
|
+
e.drawImage(s, u, d, f, p);
|
|
4255
4150
|
}
|
|
4256
4151
|
e.restore();
|
|
4257
4152
|
} catch {}
|
|
4258
4153
|
return;
|
|
4259
4154
|
}
|
|
4260
|
-
e.fillStyle =
|
|
4155
|
+
e.fillStyle = Yn(t, e, 0, 0, r, i) ?? "#FFFFFF", e.fillRect(0, 0, r, i);
|
|
4261
4156
|
}
|
|
4262
|
-
var
|
|
4263
|
-
function
|
|
4157
|
+
var vr = 9525;
|
|
4158
|
+
function yr(e, t, n, r, i) {
|
|
4264
4159
|
let a;
|
|
4265
4160
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4266
4161
|
let o;
|
|
@@ -4269,145 +4164,145 @@ function Er(e, t, n, r, i) {
|
|
|
4269
4164
|
ay: o
|
|
4270
4165
|
};
|
|
4271
4166
|
}
|
|
4272
|
-
function
|
|
4273
|
-
let o = t.width *
|
|
4167
|
+
function br(e, t, n, r, i, a) {
|
|
4168
|
+
let o = t.width * vr * n.sx * a, s = t.height * vr * n.sy * a;
|
|
4274
4169
|
if (!(o > 0) || !(s > 0)) return;
|
|
4275
|
-
let
|
|
4276
|
-
if (!u) return;
|
|
4277
|
-
let d = u.getContext("2d");
|
|
4170
|
+
let l = n.flip === "x" || n.flip === "xy", u = n.flip === "y" || n.flip === "xy", d = c(o * (l ? 2 : 1), s * (u ? 2 : 1));
|
|
4278
4171
|
if (!d) return;
|
|
4279
|
-
let f = (
|
|
4280
|
-
|
|
4172
|
+
let f = d.getContext("2d");
|
|
4173
|
+
if (!f) return;
|
|
4174
|
+
let p = (e, n, r, i) => {
|
|
4175
|
+
f.save(), f.translate(e + (r ? o : 0), n + (i ? s : 0)), f.scale(r ? -1 : 1, i ? -1 : 1), f.drawImage(t, 0, 0, o, s), f.restore();
|
|
4281
4176
|
};
|
|
4282
|
-
|
|
4283
|
-
let
|
|
4284
|
-
if (!
|
|
4285
|
-
let { ax:
|
|
4286
|
-
typeof
|
|
4177
|
+
p(0, 0, !1, !1), l && p(o, 0, !0, !1), u && p(0, s, !1, !0), l && u && p(o, s, !0, !0);
|
|
4178
|
+
let m = e.createPattern(d, "repeat");
|
|
4179
|
+
if (!m) return;
|
|
4180
|
+
let { ax: h, ay: g } = yr(n.algn, r, i, o, s), _ = h + Y(n.tx, a), v = g + Y(n.ty, a);
|
|
4181
|
+
typeof m.setTransform == "function" && typeof DOMMatrix < "u" ? (m.setTransform(new DOMMatrix().translateSelf(_, v)), e.fillStyle = m, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(_, v), e.fillStyle = m, e.fillRect(-_, -v, r, i), e.restore());
|
|
4287
4182
|
}
|
|
4288
|
-
function
|
|
4183
|
+
function xr(e, t, n) {
|
|
4289
4184
|
if (!t) return;
|
|
4290
4185
|
let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
|
|
4291
4186
|
e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.blur, n), e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4292
4187
|
}
|
|
4293
|
-
function
|
|
4188
|
+
function Sr(e, t, n) {
|
|
4294
4189
|
t && (e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4295
4190
|
}
|
|
4296
|
-
function
|
|
4191
|
+
function Cr(e) {
|
|
4297
4192
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4298
4193
|
}
|
|
4299
|
-
var
|
|
4300
|
-
function
|
|
4194
|
+
var wr = 8, Tr = 1, Er = 1, Dr = 256;
|
|
4195
|
+
function Or(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h) {
|
|
4301
4196
|
if (r <= 0) return;
|
|
4302
|
-
let
|
|
4303
|
-
for (;
|
|
4304
|
-
let e = Math.min(
|
|
4305
|
-
if (n >=
|
|
4306
|
-
|
|
4197
|
+
let g = e.measureText(t), _ = g.actualBoundingBoxAscent > 0 ? g.actualBoundingBoxAscent : r, v = g.actualBoundingBoxDescent > 0 ? g.actualBoundingBoxDescent : r * .25, y = g.actualBoundingBoxLeft > 0 ? g.actualBoundingBoxLeft : 0, b = g.actualBoundingBoxRight > 0 ? g.actualBoundingBoxRight : r, x = r * u * i, S = Math.min(Dr, Math.max(1, Math.round(x / wr))), C = (e) => jr(e, a, r, o, s, l, d, f), w = C(S), T = Nr(w, a, o, s, l, d, f, u, i, -_, v);
|
|
4198
|
+
for (; T > Er && S < Dr;) {
|
|
4199
|
+
let e = Math.min(Dr, S * 2), t = C(e), n = Nr(t, a, o, s, l, d, f, u, i, -_, v);
|
|
4200
|
+
if (n >= T * .75) {
|
|
4201
|
+
w = t;
|
|
4307
4202
|
break;
|
|
4308
4203
|
}
|
|
4309
|
-
|
|
4204
|
+
S = e, w = t, T = n;
|
|
4310
4205
|
}
|
|
4311
|
-
let E = 1e4, D =
|
|
4206
|
+
let E = 1e4, D = Tr / (u * i), O = w.length - 1, k = (e, t, n) => e === 0 ? -E : t - n - D, A = (e, t, n) => e === O ? E : t - n + D, j = (e, r) => {
|
|
4312
4207
|
e.fillStyle = r;
|
|
4313
4208
|
for (let r = 0; r <= O; r++) {
|
|
4314
|
-
let { s0: i, s1: a, g: o } =
|
|
4315
|
-
e.save(), e.translate(
|
|
4316
|
-
let c = k(r, i, s),
|
|
4317
|
-
e.rect(c, -E,
|
|
4209
|
+
let { s0: i, s1: a, g: o } = w[r], s = (i + a) / 2;
|
|
4210
|
+
e.save(), e.translate(p + o.x, m + o.y), e.rotate(o.angle), o.shear !== 0 && e.transform(1, 0, o.shear, 1, 0, 0), (u !== 1 || o.vScale !== 1) && e.scale(u, o.vScale), e.beginPath();
|
|
4211
|
+
let c = k(r, i, s), l = A(r, a, s);
|
|
4212
|
+
e.rect(c, -E, l - c, 2 * E), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4318
4213
|
}
|
|
4319
|
-
}, M =
|
|
4214
|
+
}, M = kr(h), N = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4320
4215
|
if (M >= 1 && N >= 1) {
|
|
4321
|
-
j(e,
|
|
4216
|
+
j(e, h);
|
|
4322
4217
|
return;
|
|
4323
4218
|
}
|
|
4324
4219
|
if (M <= 0 || N <= 0) return;
|
|
4325
4220
|
let P = typeof e.getTransform == "function" ? e.getTransform() : null;
|
|
4326
4221
|
if (!P) {
|
|
4327
|
-
j(e,
|
|
4222
|
+
j(e, h);
|
|
4328
4223
|
return;
|
|
4329
4224
|
}
|
|
4330
4225
|
let F = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
|
|
4331
4226
|
for (let e = 0; e <= O; e++) {
|
|
4332
|
-
let { s0: t, s1: r, g: i } =
|
|
4227
|
+
let { s0: t, s1: r, g: i } = w[e], a = (t + r) / 2, o = -a + n / 2, s = Math.max(k(e, t, a), o - y), c = Math.min(A(e, r, a), o + b);
|
|
4333
4228
|
if (!(c <= s)) for (let [e, t] of [
|
|
4334
|
-
[s, -
|
|
4335
|
-
[c, -
|
|
4336
|
-
[s,
|
|
4337
|
-
[c,
|
|
4229
|
+
[s, -_],
|
|
4230
|
+
[c, -_],
|
|
4231
|
+
[s, v],
|
|
4232
|
+
[c, v]
|
|
4338
4233
|
]) {
|
|
4339
|
-
let n =
|
|
4234
|
+
let n = Mr(i, u, e, t), r = p + n.x, a = m + n.y, o = P.a * r + P.c * a + P.e, s = P.b * r + P.d * a + P.f;
|
|
4340
4235
|
o < F && (F = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
|
|
4341
4236
|
}
|
|
4342
4237
|
}
|
|
4343
4238
|
if (!(L > F && R > I)) return;
|
|
4344
|
-
let z = Math.floor(F - 2), B = Math.floor(I - 2), V =
|
|
4239
|
+
let z = Math.floor(F - 2), B = Math.floor(I - 2), V = c(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
|
|
4345
4240
|
if (!V || !H) {
|
|
4346
|
-
j(e,
|
|
4241
|
+
j(e, h);
|
|
4347
4242
|
return;
|
|
4348
4243
|
}
|
|
4349
|
-
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H,
|
|
4244
|
+
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H, Ar(h)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = N * M, e.drawImage(V, z, B), e.restore();
|
|
4350
4245
|
}
|
|
4351
|
-
function
|
|
4246
|
+
function kr(e) {
|
|
4352
4247
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4353
4248
|
if (!t) return 1;
|
|
4354
4249
|
let n = parseFloat(t[1]);
|
|
4355
4250
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4356
4251
|
}
|
|
4357
|
-
function
|
|
4252
|
+
function Ar(e) {
|
|
4358
4253
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4359
4254
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4360
4255
|
}
|
|
4361
|
-
function
|
|
4256
|
+
function jr(e, t, n, r, i, a, o, s) {
|
|
4362
4257
|
let c = Array(e);
|
|
4363
4258
|
for (let l = 0; l < e; l++) {
|
|
4364
4259
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4365
4260
|
c[l] = {
|
|
4366
4261
|
s0: u,
|
|
4367
4262
|
s1: d,
|
|
4368
|
-
g:
|
|
4263
|
+
g: lt(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4369
4264
|
};
|
|
4370
4265
|
}
|
|
4371
4266
|
return c;
|
|
4372
4267
|
}
|
|
4373
|
-
function
|
|
4268
|
+
function Mr(e, t, n, r) {
|
|
4374
4269
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4375
4270
|
return {
|
|
4376
4271
|
x: e.x + s * o - c * a,
|
|
4377
4272
|
y: e.y + c * o + s * a
|
|
4378
4273
|
};
|
|
4379
4274
|
}
|
|
4380
|
-
function
|
|
4275
|
+
function Nr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4381
4276
|
let d = 0;
|
|
4382
4277
|
for (let f of e) {
|
|
4383
4278
|
let e = (f.s0 + f.s1) / 2;
|
|
4384
4279
|
for (let p of [f.s0, f.s1]) {
|
|
4385
|
-
let m =
|
|
4280
|
+
let m = lt(t, (n + p) / r * i, a, o);
|
|
4386
4281
|
for (let t of [l, u]) {
|
|
4387
|
-
let n =
|
|
4282
|
+
let n = Mr(m, s, 0, t), r = Mr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4388
4283
|
i > d && (d = i);
|
|
4389
4284
|
}
|
|
4390
4285
|
}
|
|
4391
4286
|
}
|
|
4392
4287
|
return d;
|
|
4393
4288
|
}
|
|
4394
|
-
function
|
|
4395
|
-
let
|
|
4396
|
-
if (!
|
|
4397
|
-
let
|
|
4398
|
-
for (let
|
|
4399
|
-
let t =
|
|
4400
|
-
for (let e of t)
|
|
4289
|
+
function Pr(e, t, r, i, a, o, s, c, l, u, d) {
|
|
4290
|
+
let f = a, p = o, m = Math.max(1, s), h = Math.max(1, c), g = at(r, i, m, h);
|
|
4291
|
+
if (!g) return;
|
|
4292
|
+
let _ = t.defaultBold ?? !1, v = t.defaultItalic ?? !1, y = (t.defaultFontSize ?? 18) * n * l, b = [];
|
|
4293
|
+
for (let r of t.paragraphs) {
|
|
4294
|
+
let t = gr(e, r, Infinity, r.defFontSize == null ? y : r.defFontSize * n * l, r.defColor ? X(r.defColor) : u, l, 0, _, v, 1, void 0, d, 0);
|
|
4295
|
+
for (let e of t) b.push(e);
|
|
4401
4296
|
}
|
|
4402
|
-
if (
|
|
4297
|
+
if (b.length === 0) return;
|
|
4403
4298
|
e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4404
|
-
let
|
|
4405
|
-
if (
|
|
4299
|
+
let x = -1, S = () => {
|
|
4300
|
+
if (x >= 0) return x;
|
|
4406
4301
|
let t = typeof e.getTransform == "function" ? e.getTransform() : null, n = t ? Math.abs(t.a * t.d - t.b * t.c) : 1;
|
|
4407
|
-
return
|
|
4408
|
-
},
|
|
4409
|
-
for (let t = 0; t <
|
|
4410
|
-
let n =
|
|
4302
|
+
return x = n > 0 ? Math.sqrt(n) : 1, x;
|
|
4303
|
+
}, C = b.length;
|
|
4304
|
+
for (let t = 0; t < C; t++) {
|
|
4305
|
+
let n = b[t], r = t / C, i = (t + 1) / C, a = 0, o = 0, s = 0, c = 0;
|
|
4411
4306
|
for (let t of n.segments) {
|
|
4412
4307
|
if (t.math) {
|
|
4413
4308
|
a += t.math.width, o = Math.max(o, t.sizePx), s = Math.max(s, t.math.ascent), c = Math.max(c, t.math.descent);
|
|
@@ -4418,28 +4313,28 @@ function Vr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4418
4313
|
a += r.width + n * Q(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));
|
|
4419
4314
|
}
|
|
4420
4315
|
if (a <= 0) continue;
|
|
4421
|
-
let l = s + c > 0 ? s + c : o, u =
|
|
4316
|
+
let l = s + c > 0 ? s + c : o, u = g.singleEdge ? .8 : l > 0 ? s / l : .8, d = g.singleEdge ? 1 : m / a, _ = g.singleEdge ? h : l / (i - r), v = ct(g, a), y = 0;
|
|
4422
4317
|
for (let t of n.segments) {
|
|
4423
4318
|
if (t.math) {
|
|
4424
|
-
|
|
4319
|
+
y += t.math.width;
|
|
4425
4320
|
continue;
|
|
4426
4321
|
}
|
|
4427
4322
|
e.font = t.font, e.fillStyle = t.color;
|
|
4428
4323
|
let n = t.letterSpacingPx ?? 0, o = [...t.text];
|
|
4429
4324
|
for (let s of o) {
|
|
4430
4325
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4431
|
-
if (!
|
|
4432
|
-
|
|
4326
|
+
if (!g.singleEdge && o > 0) {
|
|
4327
|
+
Or(e, s, n, o, S(), g, y, a, v, d, _, c, f, p, t.color), y += o;
|
|
4433
4328
|
continue;
|
|
4434
4329
|
}
|
|
4435
|
-
let l =
|
|
4436
|
-
e.save(), e.translate(
|
|
4330
|
+
let l = lt(g, (y + o / 2) / a * v, _, c);
|
|
4331
|
+
e.save(), e.translate(f + l.x, p + l.y), e.rotate(l.angle), l.shear !== 0 && e.transform(1, 0, l.shear, 1, 0, 0), (d !== 1 || l.vScale !== 1) && e.scale(d, l.vScale), e.fillText(s, -o / 2 + n / 2, 0), e.restore(), y += o;
|
|
4437
4332
|
}
|
|
4438
4333
|
}
|
|
4439
4334
|
}
|
|
4440
4335
|
e.restore();
|
|
4441
4336
|
}
|
|
4442
|
-
function
|
|
4337
|
+
function Fr(e, t, n, r, i, a, o) {
|
|
4443
4338
|
let s = Math.min(r, i);
|
|
4444
4339
|
switch (e) {
|
|
4445
4340
|
case "rightarrow":
|
|
@@ -4469,25 +4364,28 @@ function Hr(e, t, n, r, i, a, o) {
|
|
|
4469
4364
|
default: return null;
|
|
4470
4365
|
}
|
|
4471
4366
|
}
|
|
4472
|
-
function
|
|
4473
|
-
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null &&
|
|
4367
|
+
function Ir(e, t) {
|
|
4368
|
+
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null && zn(e) ? t.smartArtFallbackTextColor : null;
|
|
4474
4369
|
}
|
|
4475
|
-
function
|
|
4370
|
+
function Lr(e, t, n, r = "#000000", i, a = {
|
|
4476
4371
|
themeMajorFont: null,
|
|
4477
4372
|
themeMinorFont: null,
|
|
4478
4373
|
dpr: 1
|
|
4479
4374
|
}, o, s) {
|
|
4480
|
-
let c = Y(t.x, n), l = Y(t.y, n), u = Y(t.width, n), d = Y(t.height, n)
|
|
4375
|
+
let c = Y(t.x, n), l = Y(t.y, n), u = Y(t.width, n), d = Y(t.height, n), f = o && t.id !== void 0 ? (e) => o({
|
|
4376
|
+
...e,
|
|
4377
|
+
shapeId: t.id
|
|
4378
|
+
}) : o;
|
|
4481
4379
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4482
4380
|
if (t.stroke && (e.save(), $(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
4483
|
-
let
|
|
4484
|
-
|
|
4381
|
+
let o = Ir(t, a);
|
|
4382
|
+
Ur(e, t.textBody, c, l, u, d, n, o, t.rotation, t.flipH, t.flipV, r, i, a, f, !1, s);
|
|
4485
4383
|
}
|
|
4486
4384
|
return;
|
|
4487
4385
|
}
|
|
4488
|
-
let
|
|
4489
|
-
if (
|
|
4490
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c),
|
|
4386
|
+
let p = t.scene3d && Dt(t.scene3d.camera) ? t.scene3d : null;
|
|
4387
|
+
if (p && u > 0 && d > 0) {
|
|
4388
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, m = Wr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, f), h = Gr(t.sp3d, p.camera, u, d, n, f);
|
|
4491
4389
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4492
4390
|
let g = {
|
|
4493
4391
|
...t,
|
|
@@ -4498,12 +4396,12 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4498
4396
|
flipV: !1,
|
|
4499
4397
|
scene3d: void 0
|
|
4500
4398
|
};
|
|
4501
|
-
if (
|
|
4502
|
-
|
|
4399
|
+
if (Kr(e, p.camera, c, l, u, d, (e) => {
|
|
4400
|
+
Lr(e, g, n, r, i, a, void 0);
|
|
4503
4401
|
}, {
|
|
4504
4402
|
bevels: m,
|
|
4505
4403
|
extrusion: h ?? void 0,
|
|
4506
|
-
edgePadCss: (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) /
|
|
4404
|
+
edgePadCss: (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) / f : 0) + 2
|
|
4507
4405
|
})) {
|
|
4508
4406
|
e.restore();
|
|
4509
4407
|
return;
|
|
@@ -4511,9 +4409,9 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4511
4409
|
e.restore();
|
|
4512
4410
|
}
|
|
4513
4411
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4514
|
-
let
|
|
4515
|
-
|
|
4516
|
-
let
|
|
4412
|
+
let m = t.geometry.toLowerCase(), h = Yn(t.fill, e, c, l, u, d);
|
|
4413
|
+
xr(e, t.shadow ?? null, n), t.shadow || Sr(e, t.glow ?? null, n);
|
|
4414
|
+
let g = new Set([
|
|
4517
4415
|
"line",
|
|
4518
4416
|
"straightconnector1",
|
|
4519
4417
|
"bentconnector2",
|
|
@@ -4524,7 +4422,7 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4524
4422
|
"curvedconnector3",
|
|
4525
4423
|
"curvedconnector4",
|
|
4526
4424
|
"curvedconnector5"
|
|
4527
|
-
]),
|
|
4425
|
+
]), _ = new Set([
|
|
4528
4426
|
"callout1",
|
|
4529
4427
|
"callout2",
|
|
4530
4428
|
"callout3",
|
|
@@ -4537,12 +4435,12 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4537
4435
|
"accentbordercallout1",
|
|
4538
4436
|
"accentbordercallout2",
|
|
4539
4437
|
"accentbordercallout3"
|
|
4540
|
-
]),
|
|
4541
|
-
let i = r ??
|
|
4438
|
+
]), v = (e) => _.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), y = !t.custGeom && he(m), b = (e, r) => {
|
|
4439
|
+
let i = r ?? h, a = r ? null : t.stroke ? () => {
|
|
4542
4440
|
$(e, t.stroke, n), e.stroke();
|
|
4543
|
-
} : null, o = () =>
|
|
4544
|
-
if (
|
|
4545
|
-
|
|
4441
|
+
} : null, o = () => Cr(e);
|
|
4442
|
+
if (y && !r) {
|
|
4443
|
+
le(e, m, c, l, u, d, [
|
|
4546
4444
|
t.adj,
|
|
4547
4445
|
t.adj2,
|
|
4548
4446
|
t.adj3,
|
|
@@ -4551,28 +4449,28 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4551
4449
|
t.adj6,
|
|
4552
4450
|
t.adj7,
|
|
4553
4451
|
t.adj8
|
|
4554
|
-
], i, a, o,
|
|
4452
|
+
], i, a, o, v(m) ? { skipTrailingStroke: !0 } : void 0);
|
|
4555
4453
|
return;
|
|
4556
4454
|
}
|
|
4557
|
-
e.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4558
|
-
},
|
|
4559
|
-
x: c *
|
|
4560
|
-
y: l *
|
|
4561
|
-
w: u *
|
|
4562
|
-
h: d *
|
|
4563
|
-
},
|
|
4564
|
-
e.setTransform(
|
|
4455
|
+
e.beginPath(), t.custGeom && t.custGeom.length > 0 ? Rr(e, t.custGeom, c, l, u, d) : Pe(e, m, c, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), i && m !== "arc" && (e.fillStyle = i, m === "donut" || m === "smileyface" || m === "frame" ? e.fill("evenodd") : e.fill(), r || o()), a && a();
|
|
4456
|
+
}, x = e.canvas.width || 0, S = e.canvas.height || 0, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = {
|
|
4457
|
+
x: c * T,
|
|
4458
|
+
y: l * T,
|
|
4459
|
+
w: u * T,
|
|
4460
|
+
h: d * T
|
|
4461
|
+
}, D = n * T, O = (e) => {
|
|
4462
|
+
e.setTransform(C);
|
|
4565
4463
|
};
|
|
4566
|
-
if (t.reflection &&
|
|
4567
|
-
|
|
4568
|
-
},
|
|
4569
|
-
|
|
4570
|
-
},
|
|
4571
|
-
|
|
4572
|
-
}), e.restore()) :
|
|
4573
|
-
|
|
4574
|
-
},
|
|
4575
|
-
let r =
|
|
4464
|
+
if (t.reflection && x > 0 && S > 0 && (e.save(), e.setTransform(new DOMMatrix()), gt(e, (e) => {
|
|
4465
|
+
O(e), b(e);
|
|
4466
|
+
}, E, t.reflection, D, x, S), e.restore()), t.softEdge && x > 0 && S > 0 ? (e.save(), e.setTransform(new DOMMatrix()), ht(e, (e) => {
|
|
4467
|
+
O(e), b(e);
|
|
4468
|
+
}, E, t.softEdge, D, x, S, (e) => {
|
|
4469
|
+
O(e), b(e, "#000");
|
|
4470
|
+
}), e.restore()) : b(e), t.innerShadow && x > 0 && S > 0 && (e.save(), e.setTransform(new DOMMatrix()), mt(e, (e) => {
|
|
4471
|
+
O(e), b(e, "#000");
|
|
4472
|
+
}, E, t.innerShadow, D, x, S), e.restore()), t.stroke && (g.has(m) || _.has(m))) {
|
|
4473
|
+
let r = G(m, c, l, u, d, [
|
|
4576
4474
|
t.adj,
|
|
4577
4475
|
t.adj2,
|
|
4578
4476
|
t.adj3,
|
|
@@ -4583,52 +4481,52 @@ function Wr(e, t, n, r = "#000000", i, a = {
|
|
|
4583
4481
|
t.adj8
|
|
4584
4482
|
]);
|
|
4585
4483
|
if (r) {
|
|
4586
|
-
let i = t.stroke.cmpd, a =
|
|
4587
|
-
if (
|
|
4484
|
+
let i = t.stroke.cmpd, a = m === "line" || m === "straightconnector1";
|
|
4485
|
+
if (v(m) && r.vertices.length >= 2 && !(i && a)) {
|
|
4588
4486
|
let i = r.vertices.map((e) => ({
|
|
4589
4487
|
x: e.x,
|
|
4590
4488
|
y: e.y
|
|
4591
4489
|
}));
|
|
4592
4490
|
if (t.stroke.tailEnd) {
|
|
4593
|
-
let e =
|
|
4594
|
-
i[i.length - 1] =
|
|
4491
|
+
let e = Be(t.stroke.tailEnd, t.stroke, n);
|
|
4492
|
+
i[i.length - 1] = He(i[i.length - 1], i[i.length - 2], e);
|
|
4595
4493
|
}
|
|
4596
4494
|
if (t.stroke.headEnd) {
|
|
4597
|
-
let e =
|
|
4598
|
-
i[0] =
|
|
4495
|
+
let e = Be(t.stroke.headEnd, t.stroke, n);
|
|
4496
|
+
i[0] = He(i[0], i[1], e);
|
|
4599
4497
|
}
|
|
4600
4498
|
$(e, t.stroke, n), e.beginPath(), e.moveTo(i[0].x, i[0].y);
|
|
4601
4499
|
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
4602
4500
|
e.stroke();
|
|
4603
4501
|
}
|
|
4604
|
-
i && a &&
|
|
4502
|
+
i && a && Qr(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && Ne(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && Ne(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
4605
4503
|
}
|
|
4606
4504
|
} else 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")) {
|
|
4607
|
-
let { start: r, end: i } =
|
|
4608
|
-
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4505
|
+
let { start: r, end: i } = Re(t.custGeom);
|
|
4506
|
+
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && Ne(e, c + r.x * u, l + r.y * d, Math.atan2(r.dy * d, r.dx * u), t.stroke.headEnd, t.stroke, n), i && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && Ne(e, c + i.x * u, l + i.y * d, Math.atan2(i.dy * d, i.dx * u), t.stroke.tailEnd, t.stroke, n);
|
|
4609
4507
|
}
|
|
4610
4508
|
if (t.textBody) {
|
|
4611
|
-
let
|
|
4509
|
+
let o = Ir(t, a);
|
|
4612
4510
|
if (e.save(), t.flipH || t.flipV) {
|
|
4613
4511
|
let n = c + u / 2, r = l + d / 2;
|
|
4614
4512
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4615
4513
|
}
|
|
4616
|
-
let
|
|
4617
|
-
if (t.textRect)
|
|
4618
|
-
else if (
|
|
4514
|
+
let p = c, h = l, g = u, _ = d;
|
|
4515
|
+
if (t.textRect) p = Y(t.textRect.x, n), h = Y(t.textRect.y, n), g = Y(t.textRect.width, n), _ = Y(t.textRect.height, n);
|
|
4516
|
+
else if (m === "ellipse") {
|
|
4619
4517
|
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
4620
|
-
|
|
4518
|
+
p = c + e, h = l + t, g = u / Math.SQRT2, _ = d / Math.SQRT2;
|
|
4621
4519
|
} else {
|
|
4622
|
-
let e =
|
|
4623
|
-
e && (
|
|
4520
|
+
let e = Fr(m, c, l, u, d, t.adj, t.adj2);
|
|
4521
|
+
e && (p = e.tx, h = e.ty, g = e.tw, _ = e.th);
|
|
4624
4522
|
}
|
|
4625
|
-
|
|
4523
|
+
Ur(e, t.textBody, p, h, g, _, n, o, t.rotation, !1, !1, r, i, a, f, !1, s), e.restore();
|
|
4626
4524
|
}
|
|
4627
4525
|
e.restore();
|
|
4628
4526
|
}
|
|
4629
|
-
var
|
|
4630
|
-
function
|
|
4631
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4527
|
+
var Rr = Ue;
|
|
4528
|
+
function zr(e, t) {
|
|
4529
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Br(e).toLowerCase(), o = Br(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4632
4530
|
switch (t) {
|
|
4633
4531
|
case "arabicPlain": return n;
|
|
4634
4532
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4655,7 +4553,7 @@ function Kr(e, t) {
|
|
|
4655
4553
|
default: return `${n}.`;
|
|
4656
4554
|
}
|
|
4657
4555
|
}
|
|
4658
|
-
function
|
|
4556
|
+
function Br(e) {
|
|
4659
4557
|
let t = [
|
|
4660
4558
|
1e3,
|
|
4661
4559
|
900,
|
|
@@ -4688,143 +4586,143 @@ function qr(e) {
|
|
|
4688
4586
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4689
4587
|
return r;
|
|
4690
4588
|
}
|
|
4691
|
-
function
|
|
4589
|
+
function Vr(e) {
|
|
4692
4590
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4693
4591
|
return !1;
|
|
4694
4592
|
}
|
|
4695
|
-
function
|
|
4696
|
-
let n =
|
|
4697
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4593
|
+
function Hr(e, t) {
|
|
4594
|
+
let n = Vr(e);
|
|
4595
|
+
if (e.bullet.type === "char") return t.clear(), n ? Ie(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4698
4596
|
if (e.bullet.type === "autoNum") {
|
|
4699
4597
|
if (!n) return "";
|
|
4700
4598
|
let r = e.lvl;
|
|
4701
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4599
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), zr(t.get(r), e.bullet.numType);
|
|
4702
4600
|
}
|
|
4703
4601
|
return t.clear(), "";
|
|
4704
4602
|
}
|
|
4705
|
-
function
|
|
4603
|
+
function Ur(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000", m, h = {
|
|
4706
4604
|
themeMajorFont: null,
|
|
4707
4605
|
themeMinorFont: null,
|
|
4708
4606
|
dpr: 1
|
|
4709
|
-
},
|
|
4710
|
-
let
|
|
4711
|
-
if (
|
|
4712
|
-
let
|
|
4607
|
+
}, g, _ = !1, v, y = !1) {
|
|
4608
|
+
let b = t.vert === "vert" || t.vert === "eaVert", x = t.vert === "vert270";
|
|
4609
|
+
if (b || x) {
|
|
4610
|
+
let n = r + a / 2, u = i + o / 2, d = b ? 90 : -90, f = g ? (e) => g({
|
|
4713
4611
|
...e,
|
|
4714
|
-
inShapeX: e.inShapeX -
|
|
4715
|
-
inShapeY: e.inShapeY -
|
|
4716
|
-
shapeX:
|
|
4717
|
-
shapeY:
|
|
4718
|
-
shapeW:
|
|
4719
|
-
shapeH:
|
|
4720
|
-
rotation:
|
|
4721
|
-
textBodyRotation:
|
|
4612
|
+
inShapeX: e.inShapeX - o / 2 + a / 2,
|
|
4613
|
+
inShapeY: e.inShapeY - a / 2 + o / 2,
|
|
4614
|
+
shapeX: r,
|
|
4615
|
+
shapeY: i,
|
|
4616
|
+
shapeW: a,
|
|
4617
|
+
shapeH: o,
|
|
4618
|
+
rotation: l,
|
|
4619
|
+
textBodyRotation: d
|
|
4722
4620
|
}) : void 0;
|
|
4723
|
-
if (
|
|
4724
|
-
e.save(), e.translate(
|
|
4621
|
+
if (_) return a;
|
|
4622
|
+
e.save(), e.translate(n, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), Ur(e, {
|
|
4725
4623
|
...t,
|
|
4726
4624
|
vert: "horz"
|
|
4727
|
-
}, -
|
|
4625
|
+
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, p, m, h, f, !1, v, t.vert === "eaVert"), e.restore();
|
|
4728
4626
|
return;
|
|
4729
4627
|
}
|
|
4730
|
-
let
|
|
4731
|
-
if (!
|
|
4732
|
-
|
|
4628
|
+
let S = t.textWarp;
|
|
4629
|
+
if (!_ && S && et(S.preset)) {
|
|
4630
|
+
Pr(e, t, S.preset, S.adj ?? [], r, i, a, o, s, c ?? p, h);
|
|
4733
4631
|
return;
|
|
4734
4632
|
}
|
|
4735
|
-
let
|
|
4736
|
-
let
|
|
4737
|
-
for (let
|
|
4738
|
-
let
|
|
4739
|
-
for (let e of
|
|
4633
|
+
let C = Y(t.lIns, s), w = Y(t.rIns, s), T = Y(t.tIns, s), E = Y(t.bIns, s), D = t.wrap !== "none", O = t.autoFit === "sp" ? D && mr(e, t, a, C, w, s, h) : D, k = Math.max(1, t.numCol ?? 1), A = Y(t.spcCol ?? 0, s), j = t.defaultBold ?? !1, M = t.defaultItalic ?? !1, N = c ?? p, P = (i) => {
|
|
4634
|
+
let o = (t.defaultFontSize ?? 18) * n * s * i, c = [], l = 0, u = /* @__PURE__ */ new Map();
|
|
4635
|
+
for (let d = 0; d < t.paragraphs.length; d++) {
|
|
4636
|
+
let f = t.paragraphs[d], p = Y(f.marL, s), g = Y(f.marR, s), _ = Y(f.indent, s), v = f.defFontSize == null ? o : f.defFontSize * n * s * i, y = f.defColor ? X(f.defColor) : N, b = fr(f), x = (() => {
|
|
4637
|
+
for (let e of f.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4740
4638
|
return null;
|
|
4741
|
-
})(),
|
|
4742
|
-
for (let e of
|
|
4639
|
+
})(), S = x == null ? v : x * n * s * i, T = (() => {
|
|
4640
|
+
for (let e of f.runs) if (e.type === "text" && e.color) return e.color;
|
|
4743
4641
|
return null;
|
|
4744
|
-
})(),
|
|
4745
|
-
|
|
4746
|
-
let
|
|
4747
|
-
if (
|
|
4748
|
-
let e =
|
|
4749
|
-
|
|
4750
|
-
} else if (
|
|
4751
|
-
else if (
|
|
4752
|
-
let e =
|
|
4753
|
-
|
|
4642
|
+
})(), E = T ? X(T) : y, D = "", P = Z(!1, !1, S, "sans-serif", h), F = E, I = null;
|
|
4643
|
+
D = Hr(f, u);
|
|
4644
|
+
let L = wn(f.bullet);
|
|
4645
|
+
if (L.type === "char") {
|
|
4646
|
+
let e = L;
|
|
4647
|
+
P = Z(!1, !1, e.sizePts == null ? e.sizePct == null ? S : S * (e.sizePct / 100) : e.sizePts * n * s * i, D === e.char ? rr(e.fontFamily ?? null, h) : "sans-serif", h), F = e.color ? X(e.color) : E;
|
|
4648
|
+
} else if (L.type === "autoNum") P = Z(!1, !1, S, "sans-serif", h), F = L.color ? X(L.color) : E;
|
|
4649
|
+
else if (L.type === "blip") {
|
|
4650
|
+
let e = L, t = e.sizePts == null ? e.sizePct == null ? S : S * (e.sizePct / 100) : e.sizePts * n * s * i;
|
|
4651
|
+
I = {
|
|
4754
4652
|
imagePath: e.imagePath,
|
|
4755
4653
|
mimeType: e.mimeType,
|
|
4756
4654
|
sizePx: t
|
|
4757
4655
|
};
|
|
4758
4656
|
}
|
|
4759
|
-
let
|
|
4760
|
-
for (let
|
|
4761
|
-
let
|
|
4762
|
-
for (let e of
|
|
4657
|
+
let R = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, z = r + C + p, B = r + C + p + _, V = R - p - g, H = gr(e, f, O ? V : Infinity, v, y, s, p, j, M, i, m, h, pr(b, _)), U = f.spaceBefore == null ? 0 : f.spaceBefore / 100 * n * s * i, ee = f.spaceAfter == null ? 0 : f.spaceAfter / 100 * n * s * i;
|
|
4658
|
+
for (let r = 0; r < H.length; r++) {
|
|
4659
|
+
let i = H[r], a = r === 0, o = r === H.length - 1, u = 0, p = 0;
|
|
4660
|
+
for (let e of i.segments) {
|
|
4763
4661
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4764
|
-
if (t >
|
|
4662
|
+
if (t > u && (u = t), !e.math) {
|
|
4765
4663
|
let t = fe(e.fontFamily, e.sizePx);
|
|
4766
|
-
t >
|
|
4664
|
+
t > p && (p = t);
|
|
4767
4665
|
}
|
|
4768
4666
|
}
|
|
4769
|
-
if (
|
|
4770
|
-
e.font =
|
|
4667
|
+
if (u === 0 && (u = v), a && D) {
|
|
4668
|
+
e.font = P;
|
|
4771
4669
|
let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
|
|
4772
|
-
n >
|
|
4670
|
+
n > u && (u = n);
|
|
4773
4671
|
}
|
|
4774
|
-
|
|
4775
|
-
let
|
|
4776
|
-
|
|
4777
|
-
let
|
|
4778
|
-
|
|
4779
|
-
line:
|
|
4780
|
-
linePx:
|
|
4781
|
-
lineHeight:
|
|
4782
|
-
topGapPx:
|
|
4783
|
-
textXOffset:
|
|
4784
|
-
bulletLabel:
|
|
4785
|
-
bulletFont:
|
|
4786
|
-
bulletColor:
|
|
4787
|
-
bulletX:
|
|
4788
|
-
bulletImage:
|
|
4789
|
-
textX:
|
|
4790
|
-
textMaxW:
|
|
4791
|
-
alignment:
|
|
4792
|
-
isLastLine:
|
|
4793
|
-
para:
|
|
4794
|
-
}),
|
|
4672
|
+
a && I && I.sizePx > u && (u = I.sizePx);
|
|
4673
|
+
let m = Math.max(u * 1.2, p), h;
|
|
4674
|
+
h = f.spaceLine ? f.spaceLine.type === "pct" ? m * (f.spaceLine.val / 1e5) : f.spaceLine.val * n * s : m, t.autoFit === "norm" && t.lnSpcReduction != null && f.spaceLine?.type !== "pts" && (h *= 1 - t.lnSpcReduction);
|
|
4675
|
+
let g = h + (o ? ee : 0), y = a && d > 0 ? U : 0, x = a ? pr(b, _) : 0, S = i.segments.some((e) => e.text && e.text.length > 0 || e.math != null), C = a && S ? I : null;
|
|
4676
|
+
c.push({
|
|
4677
|
+
line: i,
|
|
4678
|
+
linePx: g,
|
|
4679
|
+
lineHeight: h,
|
|
4680
|
+
topGapPx: y,
|
|
4681
|
+
textXOffset: x,
|
|
4682
|
+
bulletLabel: a ? D : "",
|
|
4683
|
+
bulletFont: P,
|
|
4684
|
+
bulletColor: F,
|
|
4685
|
+
bulletX: B,
|
|
4686
|
+
bulletImage: C,
|
|
4687
|
+
textX: z,
|
|
4688
|
+
textMaxW: V,
|
|
4689
|
+
alignment: f.alignment,
|
|
4690
|
+
isLastLine: o,
|
|
4691
|
+
para: f
|
|
4692
|
+
}), l += g + y;
|
|
4795
4693
|
}
|
|
4796
4694
|
}
|
|
4797
4695
|
return {
|
|
4798
|
-
allLines:
|
|
4799
|
-
totalHeight:
|
|
4696
|
+
allLines: c,
|
|
4697
|
+
totalHeight: l
|
|
4800
4698
|
};
|
|
4801
|
-
}, { allLines:
|
|
4802
|
-
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines:
|
|
4699
|
+
}, { allLines: F, totalHeight: I } = P(1);
|
|
4700
|
+
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: F, totalHeight: I} = P(t.fontScale));
|
|
4803
4701
|
else {
|
|
4804
|
-
let e =
|
|
4805
|
-
if (
|
|
4702
|
+
let e = o - T - E;
|
|
4703
|
+
if (I > e && e > 0) {
|
|
4806
4704
|
let t = .1, n = 1;
|
|
4807
4705
|
for (let r = 0; r < 6; r++) {
|
|
4808
4706
|
let r = (t + n) / 2;
|
|
4809
|
-
|
|
4707
|
+
P(r).totalHeight <= e ? t = r : n = r;
|
|
4810
4708
|
}
|
|
4811
|
-
({allLines:
|
|
4709
|
+
({allLines: F, totalHeight: I} = P(t));
|
|
4812
4710
|
}
|
|
4813
4711
|
}
|
|
4814
|
-
if (
|
|
4815
|
-
let
|
|
4816
|
-
|
|
4817
|
-
let
|
|
4818
|
-
|
|
4819
|
-
let
|
|
4820
|
-
for (let
|
|
4821
|
-
let { line:
|
|
4822
|
-
|
|
4823
|
-
let
|
|
4712
|
+
if (_) return T + I + E;
|
|
4713
|
+
let L = t.verticalAnchor ?? "t", R = i, z;
|
|
4714
|
+
o === 0 && L === "b" ? (z = T + I + E, R = i - z) : z = t.autoFit === "sp" ? Math.max(o, T + I + E) : o;
|
|
4715
|
+
let B, V = Math.max(0, z - T - E);
|
|
4716
|
+
B = L === "ctr" ? R + T + (V - I) / 2 : L === "b" ? R + z - E - I : R + T, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4717
|
+
let H = B, U = k > 1 ? (a - C - w - (k - 1) * A) / k + A : 0, ee = Math.max(0, z - T - E), W = o === 0 || I <= ee + .5, G = k > 1 && !W ? Math.ceil(F.length / k) : F.length, te = 0, ne = 0;
|
|
4718
|
+
for (let n of F) {
|
|
4719
|
+
let { line: c, linePx: d, lineHeight: f, topGapPx: p, textXOffset: m, bulletLabel: _, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = n;
|
|
4720
|
+
k > 1 && te < k - 1 && ne >= G && (te++, ne = 0, B = H), B += p, ne++;
|
|
4721
|
+
let T = (t.rtlCol ? k - 1 - te : te) * U, E = n.textX + T, D = n.bulletX + T, O = n.textMaxW, A = n.para.rtl === !0, j = A || kn(c.segments), M = c.segments.some((e) => e.isTab);
|
|
4824
4722
|
if (M) {
|
|
4825
|
-
let t = Y(
|
|
4826
|
-
e.font =
|
|
4827
|
-
let
|
|
4723
|
+
let t = Y(n.para.marL, s), r = Y(n.para.marR, s), i = A ? r : t + m, a = O + t + r;
|
|
4724
|
+
e.font = c.segments.find((e) => e.isTab).font;
|
|
4725
|
+
let o = e.measureText(" ").width, l = Vn(c.segments.map((t) => {
|
|
4828
4726
|
if (t.isTab) return {
|
|
4829
4727
|
isTab: !0,
|
|
4830
4728
|
width: 0
|
|
@@ -4839,14 +4737,14 @@ function Xr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4839
4737
|
isTab: !1,
|
|
4840
4738
|
width: t.text ? e.measureText(t.text).width + n * Q(t.text) : 0
|
|
4841
4739
|
};
|
|
4842
|
-
}), (
|
|
4843
|
-
pos: Y(e.pos,
|
|
4740
|
+
}), (n.para.tabStops ?? []).map((e) => ({
|
|
4741
|
+
pos: Y(e.pos, s),
|
|
4844
4742
|
algn: e.algn
|
|
4845
|
-
})),
|
|
4846
|
-
for (let e = 0; e <
|
|
4743
|
+
})), i, a, o, Y(n.para.defTabSz ?? 914400, s));
|
|
4744
|
+
for (let e = 0; e < c.segments.length; e++) c.segments[e].isTab && (c.segments[e].tabWidthPx = l[e]);
|
|
4847
4745
|
}
|
|
4848
|
-
let N = 0, P =
|
|
4849
|
-
for (let t of
|
|
4746
|
+
let N = 0, P = f * .8;
|
|
4747
|
+
for (let t of c.segments) {
|
|
4850
4748
|
if (t.isTab) {
|
|
4851
4749
|
N += t.tabWidthPx ?? 0;
|
|
4852
4750
|
continue;
|
|
@@ -4859,124 +4757,124 @@ function Xr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4859
4757
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4860
4758
|
N += t.text ? n.width + r * Q(t.text) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
|
|
4861
4759
|
}
|
|
4862
|
-
let F =
|
|
4760
|
+
let F = B + P, I = E + O, L = 0, R = null;
|
|
4863
4761
|
if (j && A) {
|
|
4864
|
-
if (
|
|
4865
|
-
else if (
|
|
4866
|
-
let e =
|
|
4762
|
+
if (_) e.font = b, L = e.measureText(_).width;
|
|
4763
|
+
else if (S && v && (R = xe(S.imagePath, v), R)) {
|
|
4764
|
+
let e = S.sizePx;
|
|
4867
4765
|
L = R.height > 0 ? e * (R.width / R.height) : e;
|
|
4868
4766
|
}
|
|
4869
4767
|
}
|
|
4870
|
-
if (
|
|
4768
|
+
if (_) if (e.font = b, e.fillStyle = x, j && A) {
|
|
4871
4769
|
let t = e.direction;
|
|
4872
|
-
e.direction = "rtl", e.fillText(
|
|
4873
|
-
} else e.fillText(
|
|
4874
|
-
if (
|
|
4875
|
-
let t =
|
|
4770
|
+
e.direction = "rtl", e.fillText(_, I - L, F), e.direction = t;
|
|
4771
|
+
} else e.fillText(_, D, F);
|
|
4772
|
+
if (S && v) {
|
|
4773
|
+
let t = xe(S.imagePath, v);
|
|
4876
4774
|
if (t) {
|
|
4877
|
-
let n =
|
|
4878
|
-
j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t,
|
|
4775
|
+
let n = S.sizePx, r = t.height > 0 ? n * (t.width / t.height) : n, i = F - n;
|
|
4776
|
+
j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t, D, i, r, n);
|
|
4879
4777
|
}
|
|
4880
4778
|
}
|
|
4881
|
-
let
|
|
4882
|
-
|
|
4883
|
-
let
|
|
4884
|
-
for (let t = 0; t <
|
|
4885
|
-
let
|
|
4886
|
-
if (j && (e.direction =
|
|
4887
|
-
|
|
4779
|
+
let z = E + m, V;
|
|
4780
|
+
V = M ? A ? E + O - L - N : z : C === "ctr" ? z + (O - m - N) / 2 : C === "r" ? E + O - L - N : z;
|
|
4781
|
+
let ee = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, W = w || (c.endsWithBreak ?? !1), re = (ee && !j && !M ? Nn(c.segments, O - m, N, ee, W) : null) ?? c.segments, ie = j ? An(c.segments, A) : null, K = re.length;
|
|
4782
|
+
for (let t = 0; t < K; t++) {
|
|
4783
|
+
let n = ie ? ie.order[t] : t, c = re[n], d = ie ? ie.rtl[n] : !1;
|
|
4784
|
+
if (j && (e.direction = d ? "rtl" : "ltr"), c.isTab) {
|
|
4785
|
+
V += c.tabWidthPx ?? 0;
|
|
4888
4786
|
continue;
|
|
4889
4787
|
}
|
|
4890
|
-
let
|
|
4891
|
-
if (
|
|
4892
|
-
let t =
|
|
4788
|
+
let p = c.jext ?? 0, m = c.splitBefore, _ = c.perGap ?? 0, v = m && m.length > 0 ? m.length * _ : 0;
|
|
4789
|
+
if (c.math) {
|
|
4790
|
+
let t = Xn.get(c.math.nodes), n = c.math.width, r = c.math.ascent + c.math.descent;
|
|
4893
4791
|
if (t && n > 0 && r > 0) {
|
|
4894
|
-
let i = F -
|
|
4895
|
-
e.drawImage(a,
|
|
4792
|
+
let i = F - c.math.ascent, a = Zn(t, c.color);
|
|
4793
|
+
e.drawImage(a, V, i, n, r);
|
|
4896
4794
|
}
|
|
4897
|
-
|
|
4795
|
+
V += n, V += p;
|
|
4898
4796
|
continue;
|
|
4899
4797
|
}
|
|
4900
|
-
e.font =
|
|
4901
|
-
let
|
|
4902
|
-
if (
|
|
4903
|
-
let t = e.measureText(
|
|
4904
|
-
|
|
4798
|
+
e.font = c.font, e.fillStyle = c.color;
|
|
4799
|
+
let b = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0), x = c.letterSpacingPx ?? 0;
|
|
4800
|
+
if (c.highlight && c.text) {
|
|
4801
|
+
let t = e.measureText(c.text).width + (x > 0 ? x * Q(c.text) : 0) + v + p;
|
|
4802
|
+
qn(e, V, b, t, c.sizePx, c.highlight, c.color);
|
|
4905
4803
|
}
|
|
4906
|
-
let
|
|
4907
|
-
if (
|
|
4908
|
-
let t =
|
|
4909
|
-
e.save(), e.shadowColor = X(
|
|
4804
|
+
let S = c.shadow;
|
|
4805
|
+
if (S) {
|
|
4806
|
+
let t = S.dir * Math.PI / 180, n = Y(S.dist, s);
|
|
4807
|
+
e.save(), e.shadowColor = X(S.color, S.alpha), e.shadowBlur = Y(S.blur, s), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4910
4808
|
}
|
|
4911
|
-
let
|
|
4809
|
+
let C = (t, n, r) => {
|
|
4912
4810
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4913
|
-
if (
|
|
4811
|
+
if (x > 0 && t.length > 1) {
|
|
4914
4812
|
let r = e, a = r.letterSpacing;
|
|
4915
4813
|
try {
|
|
4916
|
-
r.letterSpacing = `${
|
|
4814
|
+
r.letterSpacing = `${x}px`;
|
|
4917
4815
|
} catch {}
|
|
4918
|
-
i(t, n,
|
|
4816
|
+
i(t, n, b);
|
|
4919
4817
|
try {
|
|
4920
4818
|
r.letterSpacing = a;
|
|
4921
4819
|
} catch {}
|
|
4922
|
-
} else i(t, n,
|
|
4923
|
-
},
|
|
4924
|
-
if (
|
|
4925
|
-
let n =
|
|
4926
|
-
|
|
4820
|
+
} else i(t, n, b);
|
|
4821
|
+
}, w = (t) => e.measureText(t).width, T = m && m.length > 0 ? _n([...c.text], m, _, w, x) : null, E = [...c.text], D = !!m && m.length === E.length - 1 && E.length > 1, O = (t) => {
|
|
4822
|
+
if (y) {
|
|
4823
|
+
let n = D ? x + _ : x;
|
|
4824
|
+
Kn(e, c.text, V, b, c.sizePx, n, t);
|
|
4927
4825
|
return;
|
|
4928
4826
|
}
|
|
4929
|
-
if (
|
|
4827
|
+
if (D) {
|
|
4930
4828
|
let n = e, r = n.letterSpacing;
|
|
4931
4829
|
try {
|
|
4932
|
-
n.letterSpacing = `${
|
|
4830
|
+
n.letterSpacing = `${x + _}px`;
|
|
4933
4831
|
} catch {}
|
|
4934
|
-
(t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e))(
|
|
4832
|
+
(t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e))(c.text, V, b);
|
|
4935
4833
|
try {
|
|
4936
4834
|
n.letterSpacing = r;
|
|
4937
4835
|
} catch {}
|
|
4938
|
-
} else if (
|
|
4939
|
-
else
|
|
4836
|
+
} else if (T) for (let { text: e, dx: n } of T) C(e, V + n, t);
|
|
4837
|
+
else C(c.text, V, t);
|
|
4940
4838
|
};
|
|
4941
|
-
|
|
4942
|
-
let
|
|
4943
|
-
|
|
4944
|
-
let A = e.measureText(
|
|
4945
|
-
if (
|
|
4946
|
-
text:
|
|
4947
|
-
inShapeX:
|
|
4948
|
-
inShapeY:
|
|
4949
|
-
w: A +
|
|
4950
|
-
h:
|
|
4951
|
-
fontSize:
|
|
4952
|
-
font:
|
|
4953
|
-
shapeX:
|
|
4954
|
-
shapeY:
|
|
4955
|
-
shapeW:
|
|
4956
|
-
shapeH:
|
|
4957
|
-
rotation:
|
|
4958
|
-
hyperlink:
|
|
4959
|
-
}),
|
|
4960
|
-
let t = Math.max(1,
|
|
4961
|
-
e.strokeStyle =
|
|
4962
|
-
let n =
|
|
4963
|
-
if (
|
|
4839
|
+
O("fill"), S && e.restore();
|
|
4840
|
+
let k = c.outline;
|
|
4841
|
+
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, Y(k.width, s)), e.strokeStyle = k.color ? `#${k.color}` : c.color, e.lineJoin = "round", O("stroke"), e.restore()), e.font = c.font;
|
|
4842
|
+
let A = e.measureText(c.text).width + (x > 0 ? x * Q(c.text) : 0) + v;
|
|
4843
|
+
if (g && c.text && g({
|
|
4844
|
+
text: c.text,
|
|
4845
|
+
inShapeX: V - r,
|
|
4846
|
+
inShapeY: B - i,
|
|
4847
|
+
w: A + p,
|
|
4848
|
+
h: f,
|
|
4849
|
+
fontSize: c.sizePx,
|
|
4850
|
+
font: c.font,
|
|
4851
|
+
shapeX: r,
|
|
4852
|
+
shapeY: i,
|
|
4853
|
+
shapeW: a,
|
|
4854
|
+
shapeH: o,
|
|
4855
|
+
rotation: l,
|
|
4856
|
+
hyperlink: c.hyperlink
|
|
4857
|
+
}), c.underline && hn(e, V, b, A + p, c.sizePx, c.underlineColor ?? c.color, c.underlineStyle, h.dpr), c.strikethrough) {
|
|
4858
|
+
let t = Math.max(1, c.sizePx * .05);
|
|
4859
|
+
e.strokeStyle = c.color, e.lineWidth = t, e.setLineDash([]);
|
|
4860
|
+
let n = b - c.sizePx * .32;
|
|
4861
|
+
if (c.strikeDouble) {
|
|
4964
4862
|
let r = t * .9, i = n - r, a = n + r;
|
|
4965
|
-
e.beginPath(), e.moveTo(
|
|
4863
|
+
e.beginPath(), e.moveTo(V, i + u(i, t, h.dpr)), e.lineTo(V + A + p, i + u(i, t, h.dpr)), e.moveTo(V, a + u(a, t, h.dpr)), e.lineTo(V + A + p, a + u(a, t, h.dpr)), e.stroke();
|
|
4966
4864
|
} else {
|
|
4967
|
-
let r = n +
|
|
4968
|
-
e.beginPath(), e.moveTo(
|
|
4865
|
+
let r = n + u(n, t, h.dpr);
|
|
4866
|
+
e.beginPath(), e.moveTo(V, r), e.lineTo(V + A + p, r), e.stroke();
|
|
4969
4867
|
}
|
|
4970
4868
|
}
|
|
4971
|
-
|
|
4869
|
+
V += A, V += p;
|
|
4972
4870
|
}
|
|
4973
|
-
j && (e.direction = "ltr"),
|
|
4871
|
+
j && (e.direction = "ltr"), B += d;
|
|
4974
4872
|
}
|
|
4975
4873
|
e.restore();
|
|
4976
4874
|
}
|
|
4977
|
-
function
|
|
4875
|
+
function Wr(e, t, n, r, i) {
|
|
4978
4876
|
if (!e) return [];
|
|
4979
|
-
let a =
|
|
4877
|
+
let a = nn(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = ln(n), s = r * i, c = [];
|
|
4980
4878
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4981
4879
|
widthPx: e.bevelT.w * s,
|
|
4982
4880
|
heightPx: e.bevelT.h * s,
|
|
@@ -4992,9 +4890,9 @@ function Zr(e, t, n, r, i) {
|
|
|
4992
4890
|
bottom: !0
|
|
4993
4891
|
}), c;
|
|
4994
4892
|
}
|
|
4995
|
-
function
|
|
4893
|
+
function Gr(e, t, n, r, i, a) {
|
|
4996
4894
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4997
|
-
let o = e.extrusionH * i * a, s =
|
|
4895
|
+
let o = e.extrusionH * i * a, s = Ot(t, n * a, r * a, o);
|
|
4998
4896
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4999
4897
|
let c = [
|
|
5000
4898
|
64,
|
|
@@ -5015,144 +4913,144 @@ function Qr(e, t, n, r, i, a) {
|
|
|
5015
4913
|
rgb: c
|
|
5016
4914
|
};
|
|
5017
4915
|
}
|
|
5018
|
-
function
|
|
4916
|
+
function Kr(e, t, n, r, i, a, o, s = {}) {
|
|
5019
4917
|
if (i <= 0 || a <= 0) return !1;
|
|
5020
|
-
let
|
|
5021
|
-
if (
|
|
5022
|
-
let e =
|
|
5023
|
-
t ?
|
|
4918
|
+
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((s.edgePadCss ?? 0) * d)), p = Et(t, i, a), m = p.corners;
|
|
4919
|
+
if (f > 0) {
|
|
4920
|
+
let e = f / d, t = Lt(p.corners, e / i, e / a);
|
|
4921
|
+
t ? m = t : f = 0;
|
|
5024
4922
|
}
|
|
5025
|
-
let
|
|
5026
|
-
if (!_) return !1;
|
|
5027
|
-
let v = _.getContext("2d");
|
|
4923
|
+
let h = f / d, g = Math.max(1, Math.ceil(i * d) + 2 * f), _ = Math.max(1, Math.ceil(a * d) + 2 * f), v = c(g, _);
|
|
5028
4924
|
if (!v) return !1;
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
4925
|
+
let y = v.getContext("2d");
|
|
4926
|
+
if (!y) return !1;
|
|
4927
|
+
y.save(), y.scale(d, d), y.translate(h, h), o(y, 0, 0, i, a), y.restore();
|
|
4928
|
+
let b = Math.ceil(i * d), x = Math.ceil(a * d), S = (e) => ({
|
|
4929
|
+
x: f - e,
|
|
4930
|
+
y: f - e,
|
|
4931
|
+
w: b + 2 * e,
|
|
4932
|
+
h: x + 2 * e
|
|
5035
4933
|
});
|
|
5036
4934
|
if (s.extrusion) {
|
|
5037
4935
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
5038
|
-
|
|
4936
|
+
mn(y, s.extrusion, S(e));
|
|
5039
4937
|
}
|
|
5040
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
5041
|
-
return s.paintEdges && (
|
|
4938
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) pn(y, e, S(Math.ceil(e.widthPx) + 2));
|
|
4939
|
+
return s.paintEdges && (y.save(), y.scale(d, d), y.translate(h, h), s.paintEdges(y, 0, 0, i, a), y.restore()), Ft(v, e, g, _, m.map((e) => ({
|
|
5042
4940
|
x: n + e.x,
|
|
5043
4941
|
y: r + e.y
|
|
5044
4942
|
}))), !0;
|
|
5045
4943
|
}
|
|
5046
|
-
function
|
|
4944
|
+
function qr(e, t, n, r, i, a, o, s, l = 0) {
|
|
5047
4945
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5048
|
-
let
|
|
5049
|
-
if (!g) return !1;
|
|
5050
|
-
let _ = g.getContext("2d");
|
|
4946
|
+
let u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1, p = Math.max(0, Math.ceil(l * f)), m = p / f, h = Math.max(1, Math.ceil(r * f) + 2 * p), g = Math.max(1, Math.ceil(i * f) + 2 * p), _ = c(h, g);
|
|
5051
4947
|
if (!_) return !1;
|
|
5052
|
-
|
|
5053
|
-
|
|
4948
|
+
let v = _.getContext("2d");
|
|
4949
|
+
if (!v) return !1;
|
|
4950
|
+
v.save(), v.scale(f, f), v.translate(m, m), o(v, 0, 0, r, i), v.restore();
|
|
4951
|
+
let y = Math.ceil(r * f), b = Math.ceil(i * f);
|
|
5054
4952
|
for (let e of a) {
|
|
5055
4953
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5056
|
-
|
|
5057
|
-
x:
|
|
5058
|
-
y:
|
|
5059
|
-
w:
|
|
5060
|
-
h:
|
|
4954
|
+
pn(v, e, {
|
|
4955
|
+
x: p - t,
|
|
4956
|
+
y: p - t,
|
|
4957
|
+
w: y + 2 * t,
|
|
4958
|
+
h: b + 2 * t
|
|
5061
4959
|
});
|
|
5062
4960
|
}
|
|
5063
|
-
return s && (
|
|
4961
|
+
return s && (v.save(), v.scale(f, f), v.translate(m, m), s(v, 0, 0, r, i), v.restore()), e.drawImage(_, t - m, n - m, h / f, g / f), !0;
|
|
5064
4962
|
}
|
|
5065
|
-
var
|
|
5066
|
-
function
|
|
5067
|
-
let n =
|
|
4963
|
+
var Jr = /* @__PURE__ */ new WeakMap();
|
|
4964
|
+
function Yr(e, t) {
|
|
4965
|
+
let n = Jr.get(e);
|
|
5068
4966
|
if (n) return n;
|
|
5069
4967
|
let r = (async () => {
|
|
5070
4968
|
let n = await t(e.posterPath), r = e.posterMimeType ? new Blob([n], { type: e.posterMimeType }) : n;
|
|
5071
|
-
if (
|
|
4969
|
+
if (H(new Uint8Array(await r.slice(0, 64 * 1024).arrayBuffer()))) throw Error("poster raster exceeds the pixel budget");
|
|
5072
4970
|
return createImageBitmap(r);
|
|
5073
4971
|
})();
|
|
5074
|
-
return
|
|
4972
|
+
return Jr.set(e, r), r;
|
|
5075
4973
|
}
|
|
5076
|
-
async function
|
|
5077
|
-
if (
|
|
5078
|
-
let
|
|
5079
|
-
if (
|
|
5080
|
-
|
|
4974
|
+
async function Xr(e, r, i, a) {
|
|
4975
|
+
if (a) try {
|
|
4976
|
+
let o = r.mimeType === "image/svg+xml", { widthPt: s, heightPt: c } = de(r.mimeType, r.srcRect, r.width / n, r.height / n), l;
|
|
4977
|
+
if (P(r)) try {
|
|
4978
|
+
l = await we(r.svgImagePath, a);
|
|
5081
4979
|
} catch {
|
|
5082
|
-
|
|
5083
|
-
widthPt:
|
|
5084
|
-
heightPt:
|
|
4980
|
+
l = o ? await we(r.imagePath, a) : await We(r.imagePath, r.mimeType, r.duotone, a, {
|
|
4981
|
+
widthPt: s,
|
|
4982
|
+
heightPt: c
|
|
5085
4983
|
});
|
|
5086
4984
|
}
|
|
5087
|
-
else
|
|
5088
|
-
widthPt:
|
|
5089
|
-
heightPt:
|
|
4985
|
+
else l = o ? await we(r.imagePath, a) : await We(r.imagePath, r.mimeType, r.duotone, a, {
|
|
4986
|
+
widthPt: s,
|
|
4987
|
+
heightPt: c
|
|
5090
4988
|
});
|
|
5091
|
-
if (!
|
|
5092
|
-
e.save(),
|
|
5093
|
-
let
|
|
5094
|
-
(
|
|
5095
|
-
let
|
|
5096
|
-
|
|
5097
|
-
},
|
|
5098
|
-
e.beginPath(),
|
|
5099
|
-
},
|
|
5100
|
-
(
|
|
5101
|
-
},
|
|
5102
|
-
|
|
5103
|
-
},
|
|
5104
|
-
let s =
|
|
4989
|
+
if (!l) return;
|
|
4990
|
+
e.save(), r.alpha != null && (e.globalAlpha *= r.alpha);
|
|
4991
|
+
let u = Y(r.x, i), d = Y(r.y, i), f = Y(r.width, i), p = Y(r.height, i);
|
|
4992
|
+
(r.rotation !== 0 || r.flipH || r.flipV) && (e.translate(u + f / 2, d + p / 2), e.rotate(r.rotation * Math.PI / 180), r.flipH && e.scale(-1, 1), r.flipV && e.scale(1, -1), e.translate(-(u + f / 2), -(d + p / 2)));
|
|
4993
|
+
let m = t(l, r.srcRect), h = (e, t, n, i, a) => {
|
|
4994
|
+
r.custGeom && r.custGeom.length > 0 ? Rr(e, r.custGeom, t, n, i, a) : r.prstGeom && ee(e, r.prstGeom, t, n, i, a, r.prstAdjust ?? []) || e.rect(t, n, i, a);
|
|
4995
|
+
}, g = (e, t, n, r, i) => {
|
|
4996
|
+
e.beginPath(), h(e, t, n, r, i);
|
|
4997
|
+
}, _ = (e, t, n, i, a) => {
|
|
4998
|
+
(r.prstGeom || r.custGeom && r.custGeom.length > 0) && (g(e, t, n, i, a), e.clip());
|
|
4999
|
+
}, v = (e, t, n, a, o) => {
|
|
5000
|
+
r.stroke && (e.save(), $(e, r.stroke, i), g(e, t, n, a, o), e.stroke(), e.restore());
|
|
5001
|
+
}, y = (e, t, n, a, o) => {
|
|
5002
|
+
let s = r.sp3d;
|
|
5105
5003
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
5106
|
-
let
|
|
5004
|
+
let r = Math.max(.5, s.contourW * i);
|
|
5107
5005
|
e.save(), e.beginPath();
|
|
5108
|
-
let c =
|
|
5109
|
-
e.rect(
|
|
5006
|
+
let c = r * 2 + Math.max(a, o);
|
|
5007
|
+
e.rect(t - c, n - c, a + 2 * c, o + 2 * c), h(e, t, n, a, o), e.clip("evenodd"), e.beginPath(), g(e, t, n, a, o), e.strokeStyle = X(s.contourClr), e.lineWidth = r * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5110
5008
|
}
|
|
5111
|
-
},
|
|
5112
|
-
e.save(),
|
|
5113
|
-
},
|
|
5114
|
-
|
|
5009
|
+
}, b = r.scene3d && Dt(r.scene3d.camera) ? r.scene3d : null, x = (e, t, n, r, i) => {
|
|
5010
|
+
e.save(), _(e, t, n, r, i), m ? e.drawImage(l, m.sx, m.sy, m.sw, m.sh, t, n, r, i) : e.drawImage(l, t, n, r, i), e.restore();
|
|
5011
|
+
}, S = (e, t, n, r, i) => {
|
|
5012
|
+
x(e, t, n, r, i), v(e, t, n, r, i), y(e, t, n, r, i);
|
|
5115
5013
|
}, C = (e, t, n, r, i) => {
|
|
5116
|
-
|
|
5117
|
-
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D =
|
|
5118
|
-
if (
|
|
5119
|
-
if (
|
|
5014
|
+
x(e, t, n, r, i), v(e, t, n, r, i);
|
|
5015
|
+
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = Wr(r.sp3d, r.scene3d?.lightRig, r.sp3d ? r.sp3d.prstMaterial : void 0, i, E), O = b ? Gr(r.sp3d, b.camera, f, p, i, E) : null, k = r.stroke ? r.stroke.width * i / 2 : 0, A = r.sp3d?.contourW ? r.sp3d.contourW * i : 0, j = O ? Math.hypot(O.offsetX, O.offsetY) / E : 0, M = k + A + j + 2, N = (e) => {
|
|
5016
|
+
if (b) {
|
|
5017
|
+
if (Kr(e, b.camera, u, d, f, p, C, {
|
|
5120
5018
|
bevels: D,
|
|
5121
5019
|
extrusion: O ?? void 0,
|
|
5122
|
-
paintEdges:
|
|
5020
|
+
paintEdges: y,
|
|
5123
5021
|
edgePadCss: M
|
|
5124
5022
|
})) return;
|
|
5125
|
-
} else if (D.length > 0 &&
|
|
5126
|
-
|
|
5127
|
-
},
|
|
5128
|
-
e.save(),
|
|
5129
|
-
},
|
|
5130
|
-
|
|
5131
|
-
},
|
|
5132
|
-
x:
|
|
5133
|
-
y:
|
|
5134
|
-
w:
|
|
5135
|
-
h:
|
|
5136
|
-
},
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
},
|
|
5140
|
-
|
|
5141
|
-
},
|
|
5142
|
-
|
|
5143
|
-
}), e.restore()) : N(e), (
|
|
5144
|
-
|
|
5145
|
-
},
|
|
5023
|
+
} else if (D.length > 0 && qr(e, u, d, f, p, D, C, y, M)) return;
|
|
5024
|
+
S(e, u, d, f, p);
|
|
5025
|
+
}, F = (e, t, n, r, i, a) => {
|
|
5026
|
+
e.save(), _(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5027
|
+
}, I = (e, t) => {
|
|
5028
|
+
b && Kr(e, b.camera, u, d, f, p, (e, n, r, i, a) => F(e, t, n, r, i, a)) || F(e, t, u, d, f, p);
|
|
5029
|
+
}, L = e.canvas.width || 0, R = e.canvas.height || 0, z = e.getTransform(), B = Math.abs(z.a * z.d - z.b * z.c), V = B > 0 ? Math.sqrt(B) : 1, H = {
|
|
5030
|
+
x: u * V,
|
|
5031
|
+
y: d * V,
|
|
5032
|
+
w: f * V,
|
|
5033
|
+
h: p * V
|
|
5034
|
+
}, U = i * V, W = (e) => e.setTransform(z), G = L > 0 && R > 0;
|
|
5035
|
+
r.reflection && G && (e.save(), e.setTransform(new DOMMatrix()), gt(e, (e) => {
|
|
5036
|
+
W(e), N(e);
|
|
5037
|
+
}, H, r.reflection, U, L, R), e.restore()), r.shadow ? xr(e, r.shadow, i) : r.glow && Sr(e, r.glow, i), r.softEdge && G ? (e.save(), e.setTransform(new DOMMatrix()), ht(e, (e) => {
|
|
5038
|
+
W(e), N(e);
|
|
5039
|
+
}, H, r.softEdge, U, L, R, (e) => {
|
|
5040
|
+
W(e), I(e, "#000");
|
|
5041
|
+
}), e.restore()) : N(e), (r.shadow || r.glow) && Cr(e), r.innerShadow && G && (e.save(), e.setTransform(new DOMMatrix()), mt(e, (e) => {
|
|
5042
|
+
W(e), I(e, "#000");
|
|
5043
|
+
}, H, r.innerShadow, U, L, R), e.restore()), e.restore();
|
|
5146
5044
|
} catch {}
|
|
5147
5045
|
}
|
|
5148
|
-
async function
|
|
5046
|
+
async function Zr(e, t, n, r, i) {
|
|
5149
5047
|
let a = Y(t.x, n), o = Y(t.y, n), s = Y(t.width, n), c = Y(t.height, n), l;
|
|
5150
5048
|
if (t.posterPath && r) try {
|
|
5151
|
-
l = await
|
|
5049
|
+
l = await Yr(t, r);
|
|
5152
5050
|
} catch {}
|
|
5153
|
-
e.save(),
|
|
5051
|
+
e.save(), $r(e, t, n), l ? e.drawImage(l, a, o, s, c) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), i || En(e, a + s / 2, o + c / 2, s, c, "paused"), e.restore();
|
|
5154
5052
|
}
|
|
5155
|
-
function
|
|
5053
|
+
function Qr(e, t, n, r, i, a) {
|
|
5156
5054
|
let o = Math.max(.5, Y(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
5157
5055
|
if (l === 0) return;
|
|
5158
5056
|
let u = -c / l, d = s / l, f;
|
|
@@ -5210,31 +5108,31 @@ function ai(e, t, n, r, i, a) {
|
|
|
5210
5108
|
e.restore();
|
|
5211
5109
|
}
|
|
5212
5110
|
function $(e, t, n) {
|
|
5213
|
-
|
|
5111
|
+
je(e, t, n);
|
|
5214
5112
|
}
|
|
5215
|
-
function
|
|
5113
|
+
function $r(e, t, n) {
|
|
5216
5114
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5217
5115
|
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5218
5116
|
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));
|
|
5219
5117
|
}
|
|
5220
|
-
function
|
|
5118
|
+
function ei(e, t, n, r, i = {
|
|
5221
5119
|
themeMajorFont: null,
|
|
5222
5120
|
themeMinorFont: null,
|
|
5223
5121
|
dpr: 1
|
|
5224
5122
|
}) {
|
|
5225
|
-
e.save(),
|
|
5123
|
+
e.save(), $r(e, t, n);
|
|
5226
5124
|
let a = Y(t.x, n), o = Y(t.y, n), s = t.cols.map((e) => Y(e, n)), c = s.length, l = (e, t) => {
|
|
5227
5125
|
let n = 0;
|
|
5228
5126
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
5229
5127
|
return n;
|
|
5230
|
-
},
|
|
5128
|
+
}, d = t.rows.map((e) => Y(e.height, n));
|
|
5231
5129
|
for (let a = 0; a < t.rows.length; a++) {
|
|
5232
5130
|
let o = t.rows[a];
|
|
5233
5131
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5234
5132
|
let s = o.cells[t];
|
|
5235
5133
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5236
|
-
let c = l(t, s.gridSpan || 1),
|
|
5237
|
-
|
|
5134
|
+
let c = l(t, s.gridSpan || 1), u = Ur(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5135
|
+
u > d[a] && (d[a] = u);
|
|
5238
5136
|
}
|
|
5239
5137
|
}
|
|
5240
5138
|
for (let a = 0; a < t.rows.length; a++) {
|
|
@@ -5244,107 +5142,107 @@ function si(e, t, n, r, i = {
|
|
|
5244
5142
|
if (s.hMerge || s.vMerge) continue;
|
|
5245
5143
|
let c = s.rowSpan || 1;
|
|
5246
5144
|
if (c <= 1 || !s.textBody) continue;
|
|
5247
|
-
let
|
|
5248
|
-
for (let e = 0; e < c && a + e <
|
|
5145
|
+
let u = l(t, s.gridSpan || 1), f = Ur(e, s.textBody, 0, 0, u, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5146
|
+
for (let e = 0; e < c && a + e < d.length; e++) p += d[a + e];
|
|
5249
5147
|
if (f > p) {
|
|
5250
5148
|
let e = (f - p) / c;
|
|
5251
|
-
for (let t = 0; t < c && a + t <
|
|
5149
|
+
for (let t = 0; t < c && a + t < d.length; t++) d[a + t] += e;
|
|
5252
5150
|
}
|
|
5253
5151
|
}
|
|
5254
5152
|
}
|
|
5255
|
-
let
|
|
5153
|
+
let f = s.reduce((e, t) => e + t, 0), p = Array(c);
|
|
5256
5154
|
if (t.rtl) {
|
|
5257
|
-
let e = a +
|
|
5258
|
-
for (let t = 0; t < c; t++) e -= s[t],
|
|
5155
|
+
let e = a + f;
|
|
5156
|
+
for (let t = 0; t < c; t++) e -= s[t], p[t] = e;
|
|
5259
5157
|
} else {
|
|
5260
5158
|
let e = a;
|
|
5261
|
-
for (let t = 0; t < c; t++)
|
|
5159
|
+
for (let t = 0; t < c; t++) p[t] = e, e += s[t];
|
|
5262
5160
|
}
|
|
5263
|
-
let
|
|
5161
|
+
let m = (e, n) => t.rtl ? p[e + n - 1] : p[e], h = Array(t.rows.length);
|
|
5264
5162
|
{
|
|
5265
5163
|
let e = o;
|
|
5266
|
-
for (let n = 0; n < t.rows.length; n++)
|
|
5164
|
+
for (let n = 0; n < t.rows.length; n++) h[n] = e, e += d[n];
|
|
5267
5165
|
}
|
|
5268
|
-
let
|
|
5166
|
+
let g = [], _ = t.rows.map(() => Array(c).fill(-1));
|
|
5269
5167
|
for (let e = 0; e < t.rows.length; e++) {
|
|
5270
|
-
let n = t.rows[e], r =
|
|
5168
|
+
let n = t.rows[e], r = h[e];
|
|
5271
5169
|
for (let i = 0; i < n.cells.length; i++) {
|
|
5272
5170
|
let a = n.cells[i];
|
|
5273
5171
|
if (a.hMerge || a.vMerge) continue;
|
|
5274
|
-
let o = a.gridSpan || 1, s = a.rowSpan || 1,
|
|
5275
|
-
for (let t = 0; t < s; t++) f +=
|
|
5276
|
-
let
|
|
5277
|
-
|
|
5172
|
+
let o = a.gridSpan || 1, s = a.rowSpan || 1, u = l(i, o), f = 0;
|
|
5173
|
+
for (let t = 0; t < s; t++) f += d[e + t] ?? 0;
|
|
5174
|
+
let p = m(i, o), h = Math.min(e + s - 1, t.rows.length - 1), v = g.length;
|
|
5175
|
+
g.push({
|
|
5278
5176
|
cell: a,
|
|
5279
|
-
colX:
|
|
5177
|
+
colX: p,
|
|
5280
5178
|
rowY: r,
|
|
5281
|
-
cellW:
|
|
5179
|
+
cellW: u,
|
|
5282
5180
|
cellH: f,
|
|
5283
5181
|
ci: i,
|
|
5284
5182
|
ri: e,
|
|
5285
5183
|
span: o,
|
|
5286
|
-
lastRi:
|
|
5184
|
+
lastRi: h
|
|
5287
5185
|
});
|
|
5288
|
-
for (let t = e; t <=
|
|
5186
|
+
for (let t = e; t <= h; t++) for (let e = i; e < i + o && e < c; e++) _[t][e] = v;
|
|
5289
5187
|
}
|
|
5290
5188
|
}
|
|
5291
|
-
for (let { cell: t, colX: a, rowY: o, cellW: s, cellH: c } of
|
|
5292
|
-
let l =
|
|
5189
|
+
for (let { cell: t, colX: a, rowY: o, cellW: s, cellH: c } of g) {
|
|
5190
|
+
let l = Jn(t.fill);
|
|
5293
5191
|
if (l && (e.fillStyle = l, e.fillRect(a, o, s, c)), t.textBody) {
|
|
5294
5192
|
let l = t.textColor ? X(t.textColor) : null;
|
|
5295
|
-
|
|
5193
|
+
Ur(e, t.textBody, a, o, s, c, n, l, 0, !1, !1, "#000000", r, i);
|
|
5296
5194
|
}
|
|
5297
5195
|
}
|
|
5298
|
-
let
|
|
5299
|
-
if (e < 0 || e >=
|
|
5300
|
-
let n =
|
|
5301
|
-
return n < 0 ? null :
|
|
5302
|
-
},
|
|
5196
|
+
let v = i.dpr, y = (e, t) => {
|
|
5197
|
+
if (e < 0 || e >= _.length || t < 0 || t >= c) return null;
|
|
5198
|
+
let n = _[e][t];
|
|
5199
|
+
return n < 0 ? null : g[n];
|
|
5200
|
+
}, b = (t, r, i, a, o) => {
|
|
5303
5201
|
$(e, t, n);
|
|
5304
|
-
let s = r === a ?
|
|
5202
|
+
let s = r === a ? u(r, e.lineWidth, v) : 0, c = i === o ? u(i, e.lineWidth, v) : 0;
|
|
5305
5203
|
e.beginPath(), e.moveTo(r + s, i + c), e.lineTo(a + s, o + c), e.stroke();
|
|
5306
5204
|
};
|
|
5307
|
-
for (let r of
|
|
5308
|
-
let { cell: i, colX: a, rowY: o, cellW: s, cellH:
|
|
5205
|
+
for (let r of g) {
|
|
5206
|
+
let { cell: i, colX: a, rowY: o, cellW: s, cellH: u } = r;
|
|
5309
5207
|
e.save();
|
|
5310
|
-
let f = t.rtl ? i.borderR : i.borderL,
|
|
5311
|
-
if (r.ri === 0 && i.borderT &&
|
|
5208
|
+
let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, g = t.rtl ? r.ci + r.span === c : r.ci === 0, v = t.rtl ? r.ci === 0 : r.ci + r.span === c, x = t.rtl ? r.ci - 1 : r.ci + r.span, S = (e) => t.rtl ? e.borderR : e.borderL;
|
|
5209
|
+
if (r.ri === 0 && i.borderT && b(i.borderT, a, o, a + s, o), g && f && b(f, a, o, a, o + u), r.lastRi === t.rows.length - 1) {
|
|
5312
5210
|
let e = i.borderB;
|
|
5313
|
-
e &&
|
|
5211
|
+
e && b(e, a, o + u, a + s, o + u);
|
|
5314
5212
|
} else {
|
|
5315
|
-
let e = r.lastRi + 1, t = o +
|
|
5213
|
+
let e = r.lastRi + 1, t = o + u, n = Math.min(r.ci + r.span, c), a = r.ci;
|
|
5316
5214
|
for (; a < n;) {
|
|
5317
|
-
let r =
|
|
5318
|
-
for (; o < n &&
|
|
5319
|
-
let s =
|
|
5215
|
+
let r = _[e][a], o = a + 1;
|
|
5216
|
+
for (; o < n && _[e][o] === r;) o++;
|
|
5217
|
+
let s = y(e, a), c = In(i.borderB, s ? s.cell.borderT : null);
|
|
5320
5218
|
if (c) {
|
|
5321
|
-
let e =
|
|
5322
|
-
|
|
5219
|
+
let e = m(a, o - a);
|
|
5220
|
+
b(c, e, t, e + l(a, o - a), t);
|
|
5323
5221
|
}
|
|
5324
5222
|
a = o;
|
|
5325
5223
|
}
|
|
5326
5224
|
}
|
|
5327
|
-
if (
|
|
5328
|
-
let e =
|
|
5329
|
-
e &&
|
|
5225
|
+
if (v) {
|
|
5226
|
+
let e = p;
|
|
5227
|
+
e && b(e, a + s, o, a + s, o + u);
|
|
5330
5228
|
} else {
|
|
5331
5229
|
let e = a + s, t = r.ri;
|
|
5332
5230
|
for (; t <= r.lastRi;) {
|
|
5333
|
-
let n =
|
|
5334
|
-
for (; i + 1 <= r.lastRi &&
|
|
5335
|
-
let a =
|
|
5336
|
-
o &&
|
|
5231
|
+
let n = _[t][x], i = t;
|
|
5232
|
+
for (; i + 1 <= r.lastRi && _[i + 1][x] === n;) i++;
|
|
5233
|
+
let a = y(t, x), o = In(p, a ? S(a.cell) : null);
|
|
5234
|
+
o && b(o, e, h[t], e, h[i] + d[i]), t = i + 1;
|
|
5337
5235
|
}
|
|
5338
5236
|
}
|
|
5339
|
-
i.diagonalTL && ($(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o +
|
|
5237
|
+
i.diagonalTL && ($(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + u), e.stroke()), i.diagonalTR && ($(e, i.diagonalTR, n), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + u), e.stroke()), e.restore();
|
|
5340
5238
|
}
|
|
5341
5239
|
e.restore();
|
|
5342
5240
|
}
|
|
5343
|
-
function
|
|
5241
|
+
function ti(e, t, n, r) {
|
|
5344
5242
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5345
5243
|
}
|
|
5346
|
-
var
|
|
5347
|
-
function
|
|
5244
|
+
var ni = /* @__PURE__ */ new WeakMap();
|
|
5245
|
+
function ri(e, t, n, r, i) {
|
|
5348
5246
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5349
5247
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5350
5248
|
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([]);
|
|
@@ -5364,93 +5262,93 @@ function ui(e, t, n, r, i) {
|
|
|
5364
5262
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5365
5263
|
e.restore();
|
|
5366
5264
|
}
|
|
5367
|
-
async function
|
|
5368
|
-
let o = i.fetchImage ?
|
|
5265
|
+
async function ii(e, t, n, r, i = {}, a) {
|
|
5266
|
+
let o = i.fetchImage ? ye(i.fetchImage) : void 0;
|
|
5369
5267
|
try {
|
|
5370
|
-
return await
|
|
5268
|
+
return await ai(e, t, n, r, i, a);
|
|
5371
5269
|
} finally {
|
|
5372
5270
|
o?.();
|
|
5373
5271
|
}
|
|
5374
5272
|
}
|
|
5375
|
-
async function
|
|
5376
|
-
let s = (
|
|
5377
|
-
|
|
5378
|
-
let c = () =>
|
|
5379
|
-
e.width =
|
|
5380
|
-
let
|
|
5381
|
-
if (!
|
|
5382
|
-
if (
|
|
5383
|
-
let
|
|
5384
|
-
themeMajorFont:
|
|
5385
|
-
themeMinorFont:
|
|
5386
|
-
themeHlinkColor:
|
|
5387
|
-
dpr:
|
|
5388
|
-
smartArtFallbackTextColor:
|
|
5273
|
+
async function ai(e, t, r, i, a = {}, o) {
|
|
5274
|
+
let s = (ni.get(e) ?? 0) + 1;
|
|
5275
|
+
ni.set(e, s);
|
|
5276
|
+
let c = () => ni.get(e) !== s, l = a.width ?? ((ge(e) ? e.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? g(), m = N(d * p, f * p), h = m.clamped ? p * m.scale : p;
|
|
5277
|
+
e.width = m.width, e.height = m.height, ge(e) && (e.style.width = `${d}px`, e.style.display || (e.style.display = "block"));
|
|
5278
|
+
let _ = e.getContext("2d");
|
|
5279
|
+
if (!_) throw Error("Could not get 2D context");
|
|
5280
|
+
if (_.scale(h, h), t.parseError) return ri(_, d, f, t.slideNumber, t.parseError), e;
|
|
5281
|
+
let v = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = {
|
|
5282
|
+
themeMajorFont: a.majorFont ?? null,
|
|
5283
|
+
themeMinorFont: a.minorFont ?? null,
|
|
5284
|
+
themeHlinkColor: a.hlinkColor ?? null,
|
|
5285
|
+
dpr: h,
|
|
5286
|
+
smartArtFallbackTextColor: Bn(t.background, v)
|
|
5389
5287
|
};
|
|
5390
|
-
if (await
|
|
5391
|
-
let
|
|
5392
|
-
for (let e of t.elements) if (e.type === "picture" &&
|
|
5393
|
-
let t = e,
|
|
5394
|
-
if (
|
|
5395
|
-
else if (
|
|
5288
|
+
if (await _r(_, t.background, d, f, u, a.fetchImage), c() || (a.math && await nr(t, a.math), c())) return e;
|
|
5289
|
+
let b = t.slideNumber;
|
|
5290
|
+
for (let e of t.elements) if (e.type === "picture" && a.fetchImage) {
|
|
5291
|
+
let t = e, r = t.mimeType === "image/svg+xml";
|
|
5292
|
+
if (P(t)) we(t.svgImagePath, a.fetchImage).catch(() => void 0);
|
|
5293
|
+
else if (r) we(t.imagePath, a.fetchImage).catch(() => void 0);
|
|
5396
5294
|
else {
|
|
5397
|
-
let e =
|
|
5398
|
-
|
|
5295
|
+
let e = de(t.mimeType, t.srcRect, t.width / n, t.height / n);
|
|
5296
|
+
We(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
|
|
5399
5297
|
widthPt: e.widthPt,
|
|
5400
5298
|
heightPt: e.heightPt
|
|
5401
5299
|
}).catch(() => void 0);
|
|
5402
5300
|
}
|
|
5403
5301
|
} else if (e.type === "media") {
|
|
5404
5302
|
let t = e;
|
|
5405
|
-
t.posterPath &&
|
|
5303
|
+
t.posterPath && a.fetchMedia && Yr(t, a.fetchMedia).catch(() => void 0);
|
|
5406
5304
|
}
|
|
5407
|
-
if (
|
|
5408
|
-
let n =
|
|
5305
|
+
if (a.fetchImage) {
|
|
5306
|
+
let n = a.fetchImage, r = /* @__PURE__ */ new Set();
|
|
5409
5307
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5410
|
-
let e =
|
|
5308
|
+
let e = wn(t.bullet);
|
|
5411
5309
|
e.type === "blip" && r.add(`${e.imagePath} ${e.mimeType}`);
|
|
5412
5310
|
}
|
|
5413
5311
|
if (r.size > 0 && (await Promise.all([...r].map((e) => {
|
|
5414
5312
|
let [t, r] = e.split(" ");
|
|
5415
|
-
return
|
|
5313
|
+
return pe(t, r, n).catch(() => void 0);
|
|
5416
5314
|
})), c())) return e;
|
|
5417
5315
|
}
|
|
5418
|
-
for (let
|
|
5316
|
+
for (let r of t.elements) {
|
|
5419
5317
|
if (c()) return e;
|
|
5420
|
-
if (
|
|
5421
|
-
else if (
|
|
5422
|
-
else if (
|
|
5423
|
-
else if (
|
|
5424
|
-
else if (
|
|
5425
|
-
let e =
|
|
5426
|
-
|
|
5427
|
-
x: Y(
|
|
5428
|
-
y: Y(
|
|
5429
|
-
w: Y(
|
|
5430
|
-
h: Y(
|
|
5431
|
-
}, e),
|
|
5318
|
+
if (r.type === "shape") Lr(_, r, u, v, b, y, o, a.fetchImage);
|
|
5319
|
+
else if (r.type === "picture") await Xr(_, r, u, a.fetchImage);
|
|
5320
|
+
else if (r.type === "table") ei(_, r, u, b, y);
|
|
5321
|
+
else if (r.type === "media") await Zr(_, r, u, a.fetchMedia, a.skipMediaControls);
|
|
5322
|
+
else if (r.type === "chart") {
|
|
5323
|
+
let e = n * u;
|
|
5324
|
+
_.save(), $r(_, r, u), Ee(_, r.chart, {
|
|
5325
|
+
x: Y(r.x, u),
|
|
5326
|
+
y: Y(r.y, u),
|
|
5327
|
+
w: Y(r.width, u),
|
|
5328
|
+
h: Y(r.height, u)
|
|
5329
|
+
}, e), _.restore();
|
|
5432
5330
|
}
|
|
5433
5331
|
}
|
|
5434
|
-
return c() ||
|
|
5332
|
+
return c() || a.dim && ti(_, a.dim, d, f), e;
|
|
5435
5333
|
}
|
|
5436
5334
|
//#endregion
|
|
5437
5335
|
//#region packages/pptx/src/tabular-text.ts
|
|
5438
|
-
var
|
|
5439
|
-
function
|
|
5336
|
+
var oi = (e) => e >= "0" && e <= "9";
|
|
5337
|
+
function si(e) {
|
|
5440
5338
|
let t = 0;
|
|
5441
5339
|
for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
|
|
5442
5340
|
return t;
|
|
5443
5341
|
}
|
|
5444
|
-
function
|
|
5342
|
+
function ci(e, t, n) {
|
|
5445
5343
|
let r = 0;
|
|
5446
|
-
for (let i of t) r +=
|
|
5344
|
+
for (let i of t) r += oi(i) ? n : e.measureText(i).width;
|
|
5447
5345
|
return r;
|
|
5448
5346
|
}
|
|
5449
|
-
function
|
|
5347
|
+
function li(e, t, n, r, i) {
|
|
5450
5348
|
let a = e.textAlign;
|
|
5451
5349
|
e.textAlign = "left";
|
|
5452
5350
|
let o = n;
|
|
5453
|
-
for (let n of t) if (
|
|
5351
|
+
for (let n of t) if (oi(n)) {
|
|
5454
5352
|
let t = e.measureText(n).width;
|
|
5455
5353
|
e.fillText(n, o + (i - t) / 2, r), o += i;
|
|
5456
5354
|
} else e.fillText(n, o, r), o += e.measureText(n).width;
|
|
@@ -5458,75 +5356,75 @@ function gi(e, t, n, r, i) {
|
|
|
5458
5356
|
}
|
|
5459
5357
|
//#endregion
|
|
5460
5358
|
//#region packages/pptx/src/presentation-handle.ts
|
|
5461
|
-
var
|
|
5462
|
-
async function
|
|
5463
|
-
let
|
|
5464
|
-
if (!
|
|
5465
|
-
let
|
|
5466
|
-
await
|
|
5467
|
-
let
|
|
5468
|
-
|
|
5469
|
-
let
|
|
5470
|
-
if (!
|
|
5471
|
-
|
|
5472
|
-
let
|
|
5473
|
-
for (let e of
|
|
5359
|
+
var ui = (e, t) => e / K * t;
|
|
5360
|
+
async function di(e, t, n) {
|
|
5361
|
+
let r = e.getContext("2d");
|
|
5362
|
+
if (!r) throw Error("2D context not available");
|
|
5363
|
+
let i = n.width / (n.slideWidthEmu / K);
|
|
5364
|
+
await n.drawBase();
|
|
5365
|
+
let a = document.createElement("canvas");
|
|
5366
|
+
a.width = e.width, a.height = e.height;
|
|
5367
|
+
let o = a.getContext("2d");
|
|
5368
|
+
if (!o) throw Error("base 2D context not available");
|
|
5369
|
+
o.drawImage(e, 0, 0);
|
|
5370
|
+
let s = [];
|
|
5371
|
+
for (let e of t) {
|
|
5474
5372
|
let t;
|
|
5475
5373
|
try {
|
|
5476
|
-
t = await
|
|
5374
|
+
t = await n.fetchMedia(e.mediaPath);
|
|
5477
5375
|
} catch {
|
|
5478
5376
|
continue;
|
|
5479
5377
|
}
|
|
5480
|
-
let
|
|
5481
|
-
|
|
5378
|
+
let r = e.mimeType || t.type, a = t.type === r ? t : new Blob([t], { type: r }), o = URL.createObjectURL(a), c = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
|
|
5379
|
+
c.src = o, c.preload = "metadata", e.mediaKind === "video" && (c.playsInline = !0);
|
|
5482
5380
|
let l = {
|
|
5483
|
-
x:
|
|
5484
|
-
y:
|
|
5485
|
-
w:
|
|
5486
|
-
h:
|
|
5381
|
+
x: ui(e.x, i),
|
|
5382
|
+
y: ui(e.y, i),
|
|
5383
|
+
w: ui(e.width, i),
|
|
5384
|
+
h: ui(e.height, i)
|
|
5487
5385
|
}, u = e.mediaKind === "audio" ? {
|
|
5488
5386
|
x: l.x + l.w / 2 - Math.max(l.w, 260) / 2,
|
|
5489
5387
|
y: l.y,
|
|
5490
5388
|
w: Math.max(l.w, 260),
|
|
5491
5389
|
h: l.h + 36
|
|
5492
5390
|
} : l;
|
|
5493
|
-
|
|
5391
|
+
s.push({
|
|
5494
5392
|
el: e,
|
|
5495
5393
|
rect: u,
|
|
5496
5394
|
posterRect: l,
|
|
5497
|
-
media:
|
|
5395
|
+
media: c,
|
|
5498
5396
|
objectUrl: o
|
|
5499
5397
|
});
|
|
5500
5398
|
}
|
|
5501
|
-
let
|
|
5502
|
-
|
|
5503
|
-
let
|
|
5504
|
-
|
|
5505
|
-
for (let e of
|
|
5399
|
+
let c = null, l = !1, u = null, d = () => {
|
|
5400
|
+
r.setTransform(n.dpr, 0, 0, n.dpr, 0, 0);
|
|
5401
|
+
let t = e.width / n.dpr, i = e.height / n.dpr;
|
|
5402
|
+
r.drawImage(a, 0, 0, e.width, e.height, 0, 0, t, i);
|
|
5403
|
+
for (let e of s) {
|
|
5506
5404
|
let t = e.media;
|
|
5507
5405
|
if (e.el.mediaKind === "video" && t.readyState >= 2) {
|
|
5508
|
-
let { x: n, y:
|
|
5509
|
-
|
|
5406
|
+
let { x: n, y: i, w: a, h: o } = e.posterRect;
|
|
5407
|
+
r.drawImage(t, n, i, a, o);
|
|
5510
5408
|
}
|
|
5511
|
-
if (e ===
|
|
5409
|
+
if (e === u || h?.state === e) _i(r, e, t);
|
|
5512
5410
|
else if (t.paused) {
|
|
5513
|
-
let { x: t, y: n, w:
|
|
5514
|
-
|
|
5411
|
+
let { x: t, y: n, w: i, h: a } = e.posterRect;
|
|
5412
|
+
En(r, t + i / 2, n + a / 2, i, a, "paused");
|
|
5515
5413
|
}
|
|
5516
5414
|
}
|
|
5517
|
-
},
|
|
5518
|
-
|
|
5519
|
-
},
|
|
5520
|
-
let i =
|
|
5415
|
+
}, f = () => {
|
|
5416
|
+
l || (d(), c = requestAnimationFrame(f));
|
|
5417
|
+
}, p = (t, r) => {
|
|
5418
|
+
let i = e.getBoundingClientRect(), a = e.width / n.dpr, o = e.height / n.dpr;
|
|
5521
5419
|
return {
|
|
5522
|
-
x: (
|
|
5523
|
-
y: (
|
|
5420
|
+
x: (t - i.left) / i.width * a,
|
|
5421
|
+
y: (r - i.top) / i.height * o
|
|
5524
5422
|
};
|
|
5525
|
-
},
|
|
5526
|
-
for (let n of
|
|
5423
|
+
}, m = (e, t) => {
|
|
5424
|
+
for (let n of s) {
|
|
5527
5425
|
let { x: r, y: i, w: a, h: o } = n.rect;
|
|
5528
5426
|
if (e < r || e > r + a || t < i || t > i + o) continue;
|
|
5529
|
-
let s =
|
|
5427
|
+
let s = Ci(n), c = s.y - 12, l = s.y + s.h + 8;
|
|
5530
5428
|
return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
|
|
5531
5429
|
kind: "seek",
|
|
5532
5430
|
state: n,
|
|
@@ -5537,131 +5435,131 @@ async function vi(t, n, r) {
|
|
|
5537
5435
|
};
|
|
5538
5436
|
}
|
|
5539
5437
|
return null;
|
|
5540
|
-
},
|
|
5438
|
+
}, h = null, g = (e, t) => {
|
|
5541
5439
|
let n = Number.isFinite(e.media.duration) ? e.media.duration : 0;
|
|
5542
5440
|
n <= 0 || (e.media.currentTime = n * t);
|
|
5543
|
-
},
|
|
5544
|
-
let { x: n, y: r } =
|
|
5545
|
-
i && (i.kind === "seek" ? (
|
|
5441
|
+
}, _ = (t) => {
|
|
5442
|
+
let { x: n, y: r } = p(t.clientX, t.clientY), i = m(n, r);
|
|
5443
|
+
i && (i.kind === "seek" ? (h = {
|
|
5546
5444
|
state: i.state,
|
|
5547
5445
|
wasPlaying: !i.state.media.paused
|
|
5548
|
-
}, i.state.media.pause(),
|
|
5549
|
-
},
|
|
5550
|
-
let { x: t, y: n } =
|
|
5551
|
-
|
|
5552
|
-
for (let e of
|
|
5446
|
+
}, i.state.media.pause(), g(i.state, i.fraction), e.setPointerCapture(t.pointerId), t.preventDefault()) : i.state.media.paused ? i.state.media.play().catch(() => void 0) : i.state.media.pause());
|
|
5447
|
+
}, v = (e) => {
|
|
5448
|
+
let { x: t, y: n } = p(e.clientX, e.clientY);
|
|
5449
|
+
u = null;
|
|
5450
|
+
for (let e of s) {
|
|
5553
5451
|
let { x: r, y: i, w: a, h: o } = e.rect;
|
|
5554
5452
|
if (t >= r && t <= r + a && n >= i && n <= i + o) {
|
|
5555
|
-
|
|
5453
|
+
u = e;
|
|
5556
5454
|
break;
|
|
5557
5455
|
}
|
|
5558
5456
|
}
|
|
5559
|
-
if (
|
|
5560
|
-
let e =
|
|
5561
|
-
|
|
5457
|
+
if (h) {
|
|
5458
|
+
let e = Ci(h.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
|
|
5459
|
+
g(h.state, n);
|
|
5562
5460
|
}
|
|
5563
|
-
},
|
|
5564
|
-
|
|
5565
|
-
},
|
|
5566
|
-
if (!
|
|
5567
|
-
let { wasPlaying: n, state: r } =
|
|
5568
|
-
|
|
5461
|
+
}, y = () => {
|
|
5462
|
+
u = null;
|
|
5463
|
+
}, b = (t) => {
|
|
5464
|
+
if (!h) return;
|
|
5465
|
+
let { wasPlaying: n, state: r } = h;
|
|
5466
|
+
h = null, e.releasePointerCapture(t.pointerId), n && r.media.play().catch(() => void 0);
|
|
5569
5467
|
};
|
|
5570
|
-
return
|
|
5468
|
+
return s.length > 0 && (e.addEventListener("pointerdown", _), e.addEventListener("pointermove", v), e.addEventListener("pointerleave", y), e.addEventListener("pointerup", b), e.addEventListener("pointercancel", b), e.style.cursor = "pointer", f()), {
|
|
5571
5469
|
play(e) {
|
|
5572
|
-
for (let t of
|
|
5470
|
+
for (let t of s) (!e || t.el.mediaPath === e) && t.media.play().catch(() => void 0);
|
|
5573
5471
|
},
|
|
5574
5472
|
pause(e) {
|
|
5575
|
-
for (let t of
|
|
5473
|
+
for (let t of s) (!e || t.el.mediaPath === e) && t.media.pause();
|
|
5576
5474
|
},
|
|
5577
5475
|
destroy() {
|
|
5578
|
-
if (!
|
|
5579
|
-
|
|
5580
|
-
for (let e of
|
|
5476
|
+
if (!l) {
|
|
5477
|
+
l = !0, c !== null && cancelAnimationFrame(c), e.removeEventListener("pointerdown", _), e.removeEventListener("pointermove", v), e.removeEventListener("pointerleave", y), e.removeEventListener("pointerup", b), e.removeEventListener("pointercancel", b), e.style.cursor = "";
|
|
5478
|
+
for (let e of s) e.media.pause(), e.media.removeAttribute("src"), e.media.load(), URL.revokeObjectURL(e.objectUrl);
|
|
5581
5479
|
}
|
|
5582
5480
|
}
|
|
5583
5481
|
};
|
|
5584
5482
|
}
|
|
5585
|
-
var
|
|
5586
|
-
function
|
|
5483
|
+
var fi = 28, pi = 14, mi = 72, hi = 10, gi = 3;
|
|
5484
|
+
function _i(e, t, n) {
|
|
5587
5485
|
let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
|
|
5588
|
-
|
|
5486
|
+
En(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? yi(e, t, n, r, i) : vi(e, t, n, r, i);
|
|
5589
5487
|
}
|
|
5590
|
-
function
|
|
5488
|
+
function vi(e, t, n, r, i) {
|
|
5591
5489
|
let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
|
|
5592
5490
|
e.save();
|
|
5593
5491
|
let d = e.createLinearGradient(0, u, 0, o + c);
|
|
5594
5492
|
d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
|
|
5595
|
-
let f =
|
|
5596
|
-
|
|
5493
|
+
let f = Ci(t);
|
|
5494
|
+
xi(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", bi(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
|
|
5597
5495
|
}
|
|
5598
|
-
function
|
|
5599
|
-
let a =
|
|
5600
|
-
e.save(),
|
|
5496
|
+
function yi(e, t, n, r, i) {
|
|
5497
|
+
let a = Si(t.rect);
|
|
5498
|
+
e.save(), wi(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", bi(e, n.currentTime, r, a.x + pi, a.y + a.h / 2, "middle"), e.restore(), xi(e, Ci(t), i, r > 0);
|
|
5601
5499
|
}
|
|
5602
|
-
function
|
|
5603
|
-
let o =
|
|
5604
|
-
|
|
5500
|
+
function bi(e, t, n, r, i, a) {
|
|
5501
|
+
let o = Ti(t), s = Ti(n), c = si(e), l = ci(e, o, c), u = ci(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
|
|
5502
|
+
li(e, o, r + f - l, i, c);
|
|
5605
5503
|
let p = e.textAlign;
|
|
5606
|
-
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p,
|
|
5504
|
+
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, li(e, s, r + f + d, i, c);
|
|
5607
5505
|
}
|
|
5608
|
-
function
|
|
5506
|
+
function xi(e, t, n, r) {
|
|
5609
5507
|
let i = t.h / 2;
|
|
5610
|
-
if (e.save(),
|
|
5508
|
+
if (e.save(), wi(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (wi(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
|
|
5611
5509
|
let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
|
|
5612
5510
|
e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = 3, e.fillStyle = "#fff", e.beginPath(), e.arc(r, t.y + t.h / 2, 5, 0, Math.PI * 2), e.fill();
|
|
5613
5511
|
}
|
|
5614
5512
|
e.restore();
|
|
5615
5513
|
}
|
|
5616
|
-
function
|
|
5514
|
+
function Si(e) {
|
|
5617
5515
|
let t = Math.max(220, e.w - 24);
|
|
5618
5516
|
return {
|
|
5619
5517
|
x: e.x + e.w / 2 - t / 2,
|
|
5620
|
-
y: e.y + e.h -
|
|
5518
|
+
y: e.y + e.h - fi - 4,
|
|
5621
5519
|
w: t,
|
|
5622
|
-
h:
|
|
5520
|
+
h: fi
|
|
5623
5521
|
};
|
|
5624
5522
|
}
|
|
5625
|
-
function
|
|
5523
|
+
function Ci(e) {
|
|
5626
5524
|
if (e.el.mediaKind === "audio") {
|
|
5627
|
-
let t =
|
|
5525
|
+
let t = Si(e.rect), n = t.x + pi + mi + hi, r = Math.max(40, t.x + t.w - pi - n);
|
|
5628
5526
|
return {
|
|
5629
5527
|
x: n,
|
|
5630
|
-
y: t.y + (t.h -
|
|
5528
|
+
y: t.y + (t.h - gi) / 2,
|
|
5631
5529
|
w: r,
|
|
5632
|
-
h:
|
|
5530
|
+
h: gi
|
|
5633
5531
|
};
|
|
5634
5532
|
}
|
|
5635
5533
|
let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
|
|
5636
5534
|
return {
|
|
5637
5535
|
x: t.x + n,
|
|
5638
|
-
y: t.y + t.h -
|
|
5536
|
+
y: t.y + t.h - gi - r,
|
|
5639
5537
|
w: t.w - n * 2,
|
|
5640
|
-
h:
|
|
5538
|
+
h: gi
|
|
5641
5539
|
};
|
|
5642
5540
|
}
|
|
5643
|
-
function
|
|
5541
|
+
function wi(e, t, n, r, i, a) {
|
|
5644
5542
|
let o = Math.min(a, i / 2, r / 2);
|
|
5645
5543
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
5646
5544
|
}
|
|
5647
|
-
function
|
|
5545
|
+
function Ti(e) {
|
|
5648
5546
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
5649
5547
|
let t = Math.floor(e);
|
|
5650
5548
|
return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
|
|
5651
5549
|
}
|
|
5652
5550
|
//#endregion
|
|
5653
5551
|
//#region packages/pptx/src/notes.ts
|
|
5654
|
-
function
|
|
5552
|
+
function Ei(e, t) {
|
|
5655
5553
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? null : e[t].notes ?? null;
|
|
5656
5554
|
}
|
|
5657
5555
|
//#endregion
|
|
5658
5556
|
//#region packages/pptx/src/hidden.ts
|
|
5659
|
-
function
|
|
5557
|
+
function Di(e, t) {
|
|
5660
5558
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? !1 : e[t].hidden ?? !1;
|
|
5661
5559
|
}
|
|
5662
5560
|
//#endregion
|
|
5663
5561
|
//#region packages/pptx/src/slide-nav.ts
|
|
5664
|
-
function
|
|
5562
|
+
function Oi(e) {
|
|
5665
5563
|
let t = /* @__PURE__ */ new Map();
|
|
5666
5564
|
for (let n = 0; n < e.length; n++) {
|
|
5667
5565
|
let r = e[n];
|
|
@@ -5669,44 +5567,44 @@ function Fi(e) {
|
|
|
5669
5567
|
}
|
|
5670
5568
|
return t;
|
|
5671
5569
|
}
|
|
5672
|
-
function
|
|
5570
|
+
function ki(e, t) {
|
|
5673
5571
|
if (e === "") return;
|
|
5674
|
-
let n =
|
|
5572
|
+
let n = vn("ppt/slides", e);
|
|
5675
5573
|
return t.get(n);
|
|
5676
5574
|
}
|
|
5677
|
-
function
|
|
5678
|
-
let r =
|
|
5679
|
-
return r === null ?
|
|
5575
|
+
function Ai(e, t, n) {
|
|
5576
|
+
let r = yn(e);
|
|
5577
|
+
return r === null ? ki(e, t) : bn(r, n, t.size);
|
|
5680
5578
|
}
|
|
5681
5579
|
//#endregion
|
|
5682
5580
|
//#region packages/pptx/src/google-fonts.ts
|
|
5683
|
-
var
|
|
5684
|
-
...
|
|
5685
|
-
...
|
|
5581
|
+
var ji = {
|
|
5582
|
+
...i,
|
|
5583
|
+
...l
|
|
5686
5584
|
};
|
|
5687
|
-
function*
|
|
5585
|
+
function* Mi(e) {
|
|
5688
5586
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5689
5587
|
}
|
|
5690
|
-
function*
|
|
5691
|
-
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield*
|
|
5692
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield*
|
|
5588
|
+
function* Ni(e) {
|
|
5589
|
+
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* Mi(e.textBody);
|
|
5590
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* Mi(e.textBody);
|
|
5693
5591
|
else if (e.type === "chart") {
|
|
5694
5592
|
e.chart.title && (yield e.chart.title);
|
|
5695
5593
|
for (let t of e.chart.categories) yield t;
|
|
5696
5594
|
for (let t of e.chart.series) t.name && (yield t.name);
|
|
5697
5595
|
}
|
|
5698
5596
|
}
|
|
5699
|
-
function
|
|
5700
|
-
let t =
|
|
5597
|
+
function Pi(e) {
|
|
5598
|
+
let t = v(e.majorFont) ?? v(e.minorFont) ?? null;
|
|
5701
5599
|
return [
|
|
5702
5600
|
e.majorFont,
|
|
5703
5601
|
e.minorFont,
|
|
5704
|
-
...Me(
|
|
5602
|
+
...Me(Ni(e), t)
|
|
5705
5603
|
];
|
|
5706
5604
|
}
|
|
5707
5605
|
//#endregion
|
|
5708
5606
|
//#region packages/pptx/src/media-mime.ts
|
|
5709
|
-
function
|
|
5607
|
+
function Fi(e, t) {
|
|
5710
5608
|
for (let n of e.slides) for (let e of n.elements) {
|
|
5711
5609
|
if (e.type !== "media") continue;
|
|
5712
5610
|
let n = e;
|
|
@@ -5717,11 +5615,11 @@ function Hi(e, t) {
|
|
|
5717
5615
|
}
|
|
5718
5616
|
//#endregion
|
|
5719
5617
|
//#region packages/pptx/src/worker.ts?worker&inline
|
|
5720
|
-
var
|
|
5721
|
-
function
|
|
5618
|
+
var Ii = "function e(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var t=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function n(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var r=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw n(e)?(this._poison(),new t(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}},i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o.unregister(this),e}free(){let e=this.__destroy_into_raw();S.__wbg_pptxarchive_free(e,0)}extract_image(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}extract_media(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_media(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t){let n=m(e,S.__wbindgen_malloc),r=x,i=S.pptxarchive_new(n,r,!p(t),p(t)?BigInt(0):t);if(i[2])throw g(i[1]);return this.__wbg_ptr=i[0]>>>0,o.register(this,this.__wbg_ptr,this),this}parse(){let e=S.pptxarchive_parse(this.__wbg_ptr);if(e[3])throw g(e[2]);var t=s(e[0],e[1]).slice();return S.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=S.pptxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,g(i[2]);return e=n,t=r,u(n,r)}finally{S.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);function a(){return{__proto__:null,\"./pptx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(u(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(u(e,t))}finally{S.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=h(n,S.__wbindgen_malloc,S.__wbindgen_realloc),i=x;l().setInt32(e+4,i,!0),l().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return u(e,t)},__wbindgen_init_externref_table:function(){let e=S.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const o=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>S.__wbg_pptxarchive_free(e>>>0,1));function s(e,t){return e>>>=0,f().subarray(e/1,e/1+t)}let c=null;function l(){return(c===null||c.buffer.detached===!0||c.buffer.detached===void 0&&c.buffer!==S.memory.buffer)&&(c=new DataView(S.memory.buffer)),c}function u(e,t){return e>>>=0,y(e,t)}let d=null;function f(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(S.memory.buffer)),d}function p(e){return e==null}function m(e,t){let n=t(e.length*1,1)>>>0;return f().set(e,n/1),x=e.length,n}function h(e,t,n){if(n===void 0){let n=b.encode(e),r=t(n.length,1)>>>0;return f().subarray(r,r+n.length).set(n),x=n.length,r}let r=e.length,i=t(r,1)>>>0,a=f(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=f().subarray(i+o,i+r),a=b.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return x=o,i}function g(e){let t=S.__wbindgen_externrefs.get(e);return S.__externref_table_dealloc(e),t}let _=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});_.decode();let v=0;function y(e,t){return v+=t,v>=2146435072&&(_=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),_.decode(),v=t),_.decode(f().subarray(e,e+t))}const b=new TextEncoder;`encodeInto`in b||(b.encodeInto=function(e,t){let n=b.encode(e);return t.set(n),{read:e.length,written:n.length}});let x=0,S;function C(e,t){return S=e.exports,c=null,d=null,S.__wbindgen_start(),S}async function w(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function T(e){if(S!==void 0)return S;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=a();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await w(await e,t);return C(n,r)}async function E(e){return S=void 0,c=null,d=null,T(e)}const D=new r(T,{freeArchive:e=>e.free(),reinit:E});self.onmessage=async t=>{let n=t.data;if(n.kind===`init`){D.setWasmUrl(e(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.kind===`parse`){let e=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,t=new Uint8Array(n.buffer),a=D.run(()=>{let n=new i(t,e);return D.setArchive(n),n.parse()}).buffer,o={kind:`parsed`,id:r,presentationJson:a};self.postMessage(o,[a]);return}let e=D.archive;if(n.kind===`extractMedia`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_media(n.path).buffer),i={kind:`mediaExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`extractImage`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_image(n.path).buffer),i={kind:`imageExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`toMarkdown`){if(!e)throw Error(`No pptx loaded`);let t={kind:`markdownRendered`,id:r,markdown:D.run(()=>e.to_markdown())};self.postMessage(t);return}}catch(e){let t={kind:`error`,id:r,message:e instanceof Error?e.message:String(e)};self.postMessage(t)}};", Li = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Ii], { type: "text/javascript;charset=utf-8" });
|
|
5619
|
+
function Ri(e) {
|
|
5722
5620
|
let t;
|
|
5723
5621
|
try {
|
|
5724
|
-
if (t =
|
|
5622
|
+
if (t = Li && (self.URL || self.webkitURL).createObjectURL(Li), !t) throw "";
|
|
5725
5623
|
let n = new Worker(t, {
|
|
5726
5624
|
type: "module",
|
|
5727
5625
|
name: e?.name
|
|
@@ -5730,7 +5628,7 @@ function Gi(e) {
|
|
|
5730
5628
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
5731
5629
|
}), n;
|
|
5732
5630
|
} catch {
|
|
5733
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
5631
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Ii), {
|
|
5734
5632
|
type: "module",
|
|
5735
5633
|
name: e?.name
|
|
5736
5634
|
});
|
|
@@ -5738,7 +5636,7 @@ function Gi(e) {
|
|
|
5738
5636
|
}
|
|
5739
5637
|
//#endregion
|
|
5740
5638
|
//#region packages/pptx/src/wasm/pptx_parser_bg.wasm?url
|
|
5741
|
-
var
|
|
5639
|
+
var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
5742
5640
|
_worker;
|
|
5743
5641
|
_bridge;
|
|
5744
5642
|
_mode = "main";
|
|
@@ -5751,11 +5649,11 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5751
5649
|
_fetchImage = (e, t) => this.getImage(e, t);
|
|
5752
5650
|
_math;
|
|
5753
5651
|
constructor(e, t, n) {
|
|
5754
|
-
this._worker = e, this._mode = t, this._bridge = new
|
|
5652
|
+
this._worker = e, this._mode = t, this._bridge = new A(this._worker, {
|
|
5755
5653
|
correlate: (e) => e.id,
|
|
5756
5654
|
toError: (e) => e.kind === "error" ? e.message : void 0
|
|
5757
5655
|
});
|
|
5758
|
-
let r = new URL(n ??
|
|
5656
|
+
let r = new URL(n ?? zi, location.href).href;
|
|
5759
5657
|
this._bridge.post({
|
|
5760
5658
|
kind: "init",
|
|
5761
5659
|
wasmUrl: r
|
|
@@ -5770,9 +5668,9 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5770
5668
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
5771
5669
|
i = await e.arrayBuffer();
|
|
5772
5670
|
} else i = t;
|
|
5773
|
-
i =
|
|
5774
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
5775
|
-
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await
|
|
5671
|
+
i = h(await _e(i, n.password));
|
|
5672
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-Bz0flu1p.js")).createRenderWorker() : new Ri(), r, n.wasmUrl);
|
|
5673
|
+
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await f(Pi(a._presentation), ji)), a;
|
|
5776
5674
|
}
|
|
5777
5675
|
async _parse(e, t, n = !1, r) {
|
|
5778
5676
|
let i = await this._bridge.request((r) => this._mode === "worker" ? {
|
|
@@ -5806,30 +5704,30 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5806
5704
|
return this._mode;
|
|
5807
5705
|
}
|
|
5808
5706
|
getNotes(e) {
|
|
5809
|
-
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null :
|
|
5707
|
+
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Ei(this._presentation?.slides ?? [], e);
|
|
5810
5708
|
}
|
|
5811
5709
|
isHidden(e) {
|
|
5812
|
-
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 :
|
|
5710
|
+
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Di(this._presentation?.slides ?? [], e);
|
|
5813
5711
|
}
|
|
5814
5712
|
_partNames() {
|
|
5815
5713
|
return this._meta ? this._meta.partNames : (this._presentation?.slides ?? []).map((e) => e.partName);
|
|
5816
5714
|
}
|
|
5817
5715
|
_partIndex() {
|
|
5818
|
-
return this._slidePartIndex ||=
|
|
5716
|
+
return this._slidePartIndex ||= Oi(this._partNames()), this._slidePartIndex;
|
|
5819
5717
|
}
|
|
5820
5718
|
getSlideIndexByPartName(e) {
|
|
5821
5719
|
return this._partIndex().get(e);
|
|
5822
5720
|
}
|
|
5823
5721
|
resolveInternalTarget(e, t = 0) {
|
|
5824
|
-
return
|
|
5722
|
+
return Ai(e, this._partIndex(), t);
|
|
5825
5723
|
}
|
|
5826
5724
|
async renderSlide(e, t, n = {}) {
|
|
5827
5725
|
if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
5828
5726
|
if (!this._presentation) throw Error("Presentation not loaded");
|
|
5829
5727
|
let r = this._presentation.slides[t];
|
|
5830
5728
|
if (!r) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
5831
|
-
let i = n.dpr ??
|
|
5832
|
-
await
|
|
5729
|
+
let i = n.dpr ?? g(), a = n.width ?? ((ge(e) ? e.offsetWidth : 0) || 960);
|
|
5730
|
+
await ii(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
|
|
5833
5731
|
width: a,
|
|
5834
5732
|
dpr: i,
|
|
5835
5733
|
defaultTextColor: this._presentation.defaultTextColor,
|
|
@@ -5844,7 +5742,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5844
5742
|
}, n.onTextRun);
|
|
5845
5743
|
}
|
|
5846
5744
|
async renderSlideToBitmap(e, t = {}) {
|
|
5847
|
-
let n = t.width ?? 960, r = t.dpr ??
|
|
5745
|
+
let n = t.width ?? 960, r = t.dpr ?? g();
|
|
5848
5746
|
if (this._mode === "worker") {
|
|
5849
5747
|
if (!Number.isInteger(e) || e < 0 || e >= this.slideCount) throw Error(`Slide index ${e} out of range (count: ${this.slideCount})`);
|
|
5850
5748
|
let i = await this._bridge.request((i) => ({
|
|
@@ -5898,7 +5796,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5898
5796
|
return this._mediaCache.set(e, r), r;
|
|
5899
5797
|
}
|
|
5900
5798
|
_findMimeTypeForPath(e) {
|
|
5901
|
-
return this._presentation ?
|
|
5799
|
+
return this._presentation ? Fi(this._presentation, e) : "";
|
|
5902
5800
|
}
|
|
5903
5801
|
async getImage(e, t) {
|
|
5904
5802
|
let n = this._imageCache.get(e);
|
|
@@ -5922,7 +5820,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5922
5820
|
async presentSlide(e, t, n = {}) {
|
|
5923
5821
|
if (this._mode === "main" && !this._presentation) throw Error("Presentation not loaded");
|
|
5924
5822
|
if (!Number.isInteger(t) || t < 0 || t >= this.slideCount) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
5925
|
-
let r = n.dpr ??
|
|
5823
|
+
let r = n.dpr ?? g(), i = n.width ?? (e.offsetWidth || 960), a = this._mode === "worker" ? async () => {
|
|
5926
5824
|
let a = await this.renderSlideToBitmap(t, {
|
|
5927
5825
|
width: i,
|
|
5928
5826
|
dpr: r,
|
|
@@ -5941,7 +5839,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5941
5839
|
dim: n.dim,
|
|
5942
5840
|
onTextRun: n.onTextRun
|
|
5943
5841
|
});
|
|
5944
|
-
return
|
|
5842
|
+
return di(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
|
|
5945
5843
|
width: i,
|
|
5946
5844
|
dpr: r,
|
|
5947
5845
|
slideWidthEmu: this.slideWidth,
|
|
@@ -5951,12 +5849,12 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5951
5849
|
});
|
|
5952
5850
|
}
|
|
5953
5851
|
destroy() {
|
|
5954
|
-
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (
|
|
5852
|
+
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (j(this._googleFontFaces), this._googleFontFaces = []), z(this._fetchImage), Ge(this._fetchImage), se(this._fetchImage);
|
|
5955
5853
|
}
|
|
5956
|
-
},
|
|
5854
|
+
}, Vi = {
|
|
5957
5855
|
color: "#ffffff",
|
|
5958
5856
|
opacity: .6
|
|
5959
|
-
},
|
|
5857
|
+
}, Hi = class {
|
|
5960
5858
|
canvas;
|
|
5961
5859
|
wrapper;
|
|
5962
5860
|
_scale = null;
|
|
@@ -5979,12 +5877,12 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
5979
5877
|
constructor(e, t = {}) {
|
|
5980
5878
|
this.opts = t, this.canvas = e, this._mode = t.mode ?? "main", this._hiddenMode = t.hiddenSlideMode ?? "show";
|
|
5981
5879
|
let n = e.parentElement;
|
|
5982
|
-
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new
|
|
5880
|
+
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new Cn(() => this.slideCount, (e) => this._collectSlideRuns(e));
|
|
5983
5881
|
}
|
|
5984
5882
|
async load(e) {
|
|
5985
5883
|
let t = ++this._loadGen, n = this.engine;
|
|
5986
5884
|
try {
|
|
5987
|
-
let r = await
|
|
5885
|
+
let r = await Bi.load(e, {
|
|
5988
5886
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5989
5887
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
5990
5888
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
@@ -6017,19 +5915,19 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6017
5915
|
await this.goToSlide(this._step(-1));
|
|
6018
5916
|
}
|
|
6019
5917
|
_step(e) {
|
|
6020
|
-
return this._hiddenMode === "skip" && this.engine ?
|
|
5918
|
+
return this._hiddenMode === "skip" && this.engine ? Ke(this.currentSlide, e, (e) => this.engine.isHidden(e), this.slideCount) : this.currentSlide + e;
|
|
6021
5919
|
}
|
|
6022
5920
|
_initialSlide() {
|
|
6023
|
-
return this._hiddenMode === "skip" && this.engine ?
|
|
5921
|
+
return this._hiddenMode === "skip" && this.engine ? qe(0, (e) => this.engine.isHidden(e), this.slideCount) : 0;
|
|
6024
5922
|
}
|
|
6025
5923
|
_dim() {
|
|
6026
5924
|
return {
|
|
6027
|
-
color: this.opts.hiddenSlideDim?.color ??
|
|
6028
|
-
opacity: this.opts.hiddenSlideDim?.opacity ??
|
|
5925
|
+
color: this.opts.hiddenSlideDim?.color ?? Vi.color,
|
|
5926
|
+
opacity: this.opts.hiddenSlideDim?.opacity ?? Vi.opacity
|
|
6029
5927
|
};
|
|
6030
5928
|
}
|
|
6031
5929
|
async setHiddenSlideMode(e) {
|
|
6032
|
-
this._hiddenMode = e, e === "skip" && this.engine && (this.currentSlide =
|
|
5930
|
+
this._hiddenMode = e, e === "skip" && this.engine && (this.currentSlide = qe(this.currentSlide, (e) => this.engine.isHidden(e), this.slideCount)), await this.renderCurrentSlide();
|
|
6033
5931
|
}
|
|
6034
5932
|
get hiddenSlideMode() {
|
|
6035
5933
|
return this._hiddenMode;
|
|
@@ -6037,7 +5935,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6037
5935
|
get visibleSlideCount() {
|
|
6038
5936
|
if (!this.engine) return 0;
|
|
6039
5937
|
let e = this.engine;
|
|
6040
|
-
return
|
|
5938
|
+
return Je((t) => e.isHidden(t), this.slideCount);
|
|
6041
5939
|
}
|
|
6042
5940
|
get slideIndex() {
|
|
6043
5941
|
return this.currentSlide;
|
|
@@ -6052,8 +5950,8 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6052
5950
|
return this.canvas;
|
|
6053
5951
|
}
|
|
6054
5952
|
_naturalWidthPx() {
|
|
6055
|
-
let
|
|
6056
|
-
return
|
|
5953
|
+
let e = this.engine?.slideWidth ?? 0;
|
|
5954
|
+
return e > 0 ? e / K : 0;
|
|
6057
5955
|
}
|
|
6058
5956
|
_targetWidth() {
|
|
6059
5957
|
if (this._scale === null) return this.opts.width ?? (this.canvas.offsetWidth || 960);
|
|
@@ -6076,7 +5974,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6076
5974
|
this._scale = t, await this.renderCurrentSlide(), n && this.opts.onScaleChange?.(t);
|
|
6077
5975
|
}
|
|
6078
5976
|
async zoomIn() {
|
|
6079
|
-
await this.setScale(
|
|
5977
|
+
await this.setScale(W(this.getScale()));
|
|
6080
5978
|
}
|
|
6081
5979
|
async zoomOut() {
|
|
6082
5980
|
await this.setScale(me(this.getScale()));
|
|
@@ -6087,17 +5985,17 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6087
5985
|
async fitPage() {
|
|
6088
5986
|
await this._fit("page");
|
|
6089
5987
|
}
|
|
6090
|
-
async _fit(
|
|
5988
|
+
async _fit(e) {
|
|
6091
5989
|
if (!this.engine) return;
|
|
6092
|
-
let
|
|
6093
|
-
if (!
|
|
6094
|
-
let
|
|
6095
|
-
contentWidth: this.engine.slideWidth /
|
|
6096
|
-
contentHeight: this.engine.slideHeight /
|
|
6097
|
-
containerWidth:
|
|
6098
|
-
containerHeight:
|
|
6099
|
-
},
|
|
6100
|
-
|
|
5990
|
+
let t = this.wrapper.parentElement;
|
|
5991
|
+
if (!t) return;
|
|
5992
|
+
let n = U({
|
|
5993
|
+
contentWidth: this.engine.slideWidth / K,
|
|
5994
|
+
contentHeight: this.engine.slideHeight / K,
|
|
5995
|
+
containerWidth: t.clientWidth,
|
|
5996
|
+
containerHeight: t.clientHeight
|
|
5997
|
+
}, e);
|
|
5998
|
+
n <= 0 || await this.setScale(n);
|
|
6101
5999
|
}
|
|
6102
6000
|
async renderCurrentSlide() {
|
|
6103
6001
|
if (!this.engine) return;
|
|
@@ -6133,7 +6031,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6133
6031
|
}
|
|
6134
6032
|
_buildHighlightLayer(e, t, n) {
|
|
6135
6033
|
let r = this.highlightLayer;
|
|
6136
|
-
r &&
|
|
6034
|
+
r && Sn(r, e, this._find.slideHighlights(this.currentSlide), t, n, (e) => this._measureForFont(e));
|
|
6137
6035
|
}
|
|
6138
6036
|
_measureForFont(e) {
|
|
6139
6037
|
this._measureCtx ||= document.createElement("canvas").getContext("2d");
|
|
@@ -6165,7 +6063,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6165
6063
|
this._buildHighlightLayer(e, t, n);
|
|
6166
6064
|
}
|
|
6167
6065
|
_buildTextLayer(e, t, n, r) {
|
|
6168
|
-
|
|
6066
|
+
xn(e, t, n, r, this._hyperlinkHandler());
|
|
6169
6067
|
}
|
|
6170
6068
|
_hyperlinkHandler() {
|
|
6171
6069
|
if (this.opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
|
|
@@ -6202,7 +6100,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6202
6100
|
} else this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
|
|
6203
6101
|
this.canvas.style.display = this._originalDisplay, this.wrapper.remove();
|
|
6204
6102
|
}
|
|
6205
|
-
},
|
|
6103
|
+
}, Ui = 150, Wi = "0 1px 3px rgba(0,0,0,0.2)", Gi = class {
|
|
6206
6104
|
_pres = null;
|
|
6207
6105
|
_injected;
|
|
6208
6106
|
_opts;
|
|
@@ -6233,7 +6131,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6233
6131
|
_pageShadow;
|
|
6234
6132
|
constructor(e, t = {}) {
|
|
6235
6133
|
if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
|
|
6236
|
-
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ??
|
|
6134
|
+
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Wi, this._injected = !!t.presentation, this._injected) {
|
|
6237
6135
|
let e = t.presentation;
|
|
6238
6136
|
if (t.mode !== void 0 && t.mode !== e.mode) throw Error(`PptxScrollViewer: opts.mode='${t.mode}' conflicts with the injected engine's mode='${e.mode}'. Omit opts.mode when injecting an engine — the engine owns its render mode.`);
|
|
6239
6137
|
this._pres = e, this._mode = e.mode;
|
|
@@ -6244,14 +6142,14 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6244
6142
|
this._pendingZoomAnchor = Number.isFinite(n) && Number.isFinite(r) ? {
|
|
6245
6143
|
x: n,
|
|
6246
6144
|
y: r
|
|
6247
|
-
} : null, this.setScale(
|
|
6145
|
+
} : null, this.setScale(ne(this._scale, e.deltaY));
|
|
6248
6146
|
}, this._scrollHost.addEventListener("wheel", this._wheelListener, { passive: !1 })), typeof ResizeObserver < "u" && (this._resizeObserver = new ResizeObserver(() => this._onResize()), this._resizeObserver.observe(this._container)), this._injected && this.relayout();
|
|
6249
6147
|
}
|
|
6250
6148
|
async load(e) {
|
|
6251
6149
|
if (this._injected) throw Error("PptxScrollViewer.load() is unsupported when an engine is injected via opts.presentation; the injected engine is already loaded.");
|
|
6252
6150
|
let t = ++this._loadGen, n = this._pres;
|
|
6253
6151
|
try {
|
|
6254
|
-
let r = await
|
|
6152
|
+
let r = await Bi.load(e, {
|
|
6255
6153
|
useGoogleFonts: this._opts.useGoogleFonts,
|
|
6256
6154
|
maxZipEntryBytes: this._opts.maxZipEntryBytes,
|
|
6257
6155
|
workerTimeoutMs: this._opts.workerTimeoutMs,
|
|
@@ -6282,10 +6180,10 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6282
6180
|
return this._pres?.slideCount ?? 0;
|
|
6283
6181
|
}
|
|
6284
6182
|
_slideWidthPx() {
|
|
6285
|
-
return this._pres.slideWidth /
|
|
6183
|
+
return this._pres.slideWidth / K * this._scale;
|
|
6286
6184
|
}
|
|
6287
6185
|
_slideHeightPx() {
|
|
6288
|
-
return this._pres.slideHeight /
|
|
6186
|
+
return this._pres.slideHeight / K * this._scale;
|
|
6289
6187
|
}
|
|
6290
6188
|
_fitWidthPx() {
|
|
6291
6189
|
if (this._opts.width && this._opts.width > 0) return this._opts.width;
|
|
@@ -6296,8 +6194,8 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6296
6194
|
}
|
|
6297
6195
|
_baseScale() {
|
|
6298
6196
|
if (!this._pres || this._pres.slideCount === 0) return 0;
|
|
6299
|
-
let
|
|
6300
|
-
return
|
|
6197
|
+
let e = this._fitWidthPx(), t = this._pres.slideWidth / K;
|
|
6198
|
+
return e <= 0 || t <= 0 ? 0 : e / t;
|
|
6301
6199
|
}
|
|
6302
6200
|
relayout() {
|
|
6303
6201
|
if (this._pres) {
|
|
@@ -6346,7 +6244,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6346
6244
|
return a;
|
|
6347
6245
|
}
|
|
6348
6246
|
_range() {
|
|
6349
|
-
return
|
|
6247
|
+
return Ve(this._heights, this._gap(), this._scrollHost.scrollTop, this._scrollHost.clientHeight, this._overscan(), this._pad());
|
|
6350
6248
|
}
|
|
6351
6249
|
_syncSpacer() {
|
|
6352
6250
|
let e = this._range();
|
|
@@ -6419,7 +6317,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6419
6317
|
dpr: n,
|
|
6420
6318
|
onTextRun: c
|
|
6421
6319
|
}).then(() => {
|
|
6422
|
-
i !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e || (t.renderedScale = a, s && t.textLayer &&
|
|
6320
|
+
i !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e || (t.renderedScale = a, s && t.textLayer && xn(t.textLayer, o, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler()));
|
|
6423
6321
|
}).catch((e) => {
|
|
6424
6322
|
this._reportRenderError(e);
|
|
6425
6323
|
});
|
|
@@ -6446,7 +6344,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6446
6344
|
l.close();
|
|
6447
6345
|
return;
|
|
6448
6346
|
}
|
|
6449
|
-
t.bitmap && t.bitmap.close(), t.bitmap = l, t.canvas.width = l.width, t.canvas.height = l.height, t.canvas.style.width = `${Math.round(l.width / r)}px`, t.canvas.style.height = `${Math.round(l.height / r)}px`, t.bitmapCtx?.transferFromImageBitmap(l), t.bitmap = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", s &&
|
|
6347
|
+
t.bitmap && t.bitmap.close(), t.bitmap = l, t.canvas.width = l.width, t.canvas.height = l.height, t.canvas.style.width = `${Math.round(l.width / r)}px`, t.canvas.style.height = `${Math.round(l.height / r)}px`, t.bitmapCtx?.transferFromImageBitmap(l), t.bitmap = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", s && xn(t.textLayer, c, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler())), o = !0;
|
|
6450
6348
|
} catch (e) {
|
|
6451
6349
|
this._reportRenderError(e);
|
|
6452
6350
|
} finally {
|
|
@@ -6466,7 +6364,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6466
6364
|
d = Math.min(1, Math.max(0, d));
|
|
6467
6365
|
let f = this._padH().left, p = this._scrollHost.scrollLeft || 0;
|
|
6468
6366
|
this._renderEpoch++, this._scale = r, this._recomputeHeights();
|
|
6469
|
-
let m =
|
|
6367
|
+
let m = Ve(this._heights, this._gap(), 0, this._scrollHost.clientHeight, this._overscan(), this._pad());
|
|
6470
6368
|
this._spacer.style.height = `${m.totalHeight}px`, this._syncSpacerWidth();
|
|
6471
6369
|
let h = Math.max(0, m.totalHeight - this._scrollHost.clientHeight), g = (m.offsets[l] ?? 0) + d * (this._heights[l] || 0);
|
|
6472
6370
|
if (this._scrollHost.scrollTop = Math.min(h, Math.max(0, g - o)), i) {
|
|
@@ -6479,7 +6377,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6479
6377
|
return this._scaleEstablished ? this._scale : this._pendingScale ?? 1;
|
|
6480
6378
|
}
|
|
6481
6379
|
zoomIn() {
|
|
6482
|
-
this.setScale(
|
|
6380
|
+
this.setScale(W(this.getScale()));
|
|
6483
6381
|
}
|
|
6484
6382
|
zoomOut() {
|
|
6485
6383
|
this.setScale(me(this.getScale()));
|
|
@@ -6490,15 +6388,15 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6490
6388
|
fitPage() {
|
|
6491
6389
|
this._fit("page");
|
|
6492
6390
|
}
|
|
6493
|
-
_fit(
|
|
6391
|
+
_fit(e) {
|
|
6494
6392
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
6495
|
-
let
|
|
6496
|
-
contentWidth: this._pres.slideWidth /
|
|
6497
|
-
contentHeight: this._pres.slideHeight /
|
|
6393
|
+
let t = U({
|
|
6394
|
+
contentWidth: this._pres.slideWidth / K,
|
|
6395
|
+
contentHeight: this._pres.slideHeight / K,
|
|
6498
6396
|
containerWidth: this._fitWidthPx(),
|
|
6499
6397
|
containerHeight: this._scrollHost.clientHeight
|
|
6500
|
-
},
|
|
6501
|
-
|
|
6398
|
+
}, e);
|
|
6399
|
+
t <= 0 || this.setScale(t);
|
|
6502
6400
|
}
|
|
6503
6401
|
_previewVisible() {
|
|
6504
6402
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
@@ -6524,7 +6422,7 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6524
6422
|
_scheduleSettle() {
|
|
6525
6423
|
this._settleTimer !== null && clearTimeout(this._settleTimer), this._settleTimer = setTimeout(() => {
|
|
6526
6424
|
this._settleTimer = null, this._settleRender();
|
|
6527
|
-
},
|
|
6425
|
+
}, Ui);
|
|
6528
6426
|
}
|
|
6529
6427
|
_settleRender() {
|
|
6530
6428
|
if (!(this._destroyed || !this._pres || this._pres.slideCount === 0)) for (let [e, t] of [...this._slots]) t.renderedScale !== this._scale && this._settleSlot(e, t);
|
|
@@ -6546,14 +6444,14 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6546
6444
|
}).then(() => {
|
|
6547
6445
|
if (a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) return;
|
|
6548
6446
|
let n = t.canvas;
|
|
6549
|
-
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", c &&
|
|
6447
|
+
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", c && xn(t.textLayer, s, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler()));
|
|
6550
6448
|
}).catch((e) => {
|
|
6551
6449
|
this._reportRenderError(e);
|
|
6552
6450
|
});
|
|
6553
6451
|
}
|
|
6554
6452
|
scrollToSlide(e, t) {
|
|
6555
6453
|
if (!this._pres || this._pres.slideCount === 0 || !this._scaleEstablished) return;
|
|
6556
|
-
let n = Math.max(0, Math.min(e, this._pres.slideCount - 1)), r =
|
|
6454
|
+
let n = Math.max(0, Math.min(e, this._pres.slideCount - 1)), r = Ve(this._heights, this._gap(), 0, this._scrollHost.clientHeight, this._overscan(), this._pad()), i = r.offsets[n] ?? 0, a = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), o = Math.min(a, Math.max(0, i)), s = this._scrollHost;
|
|
6557
6455
|
typeof s.scrollTo == "function" ? s.scrollTo({
|
|
6558
6456
|
top: o,
|
|
6559
6457
|
behavior: t?.behavior ?? "auto"
|
|
@@ -6632,16 +6530,16 @@ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
|
|
|
6632
6530
|
for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
|
|
6633
6531
|
this._free.length = 0, this._injected || this._pres?.destroy(), this._pres = null, this._wrapper.remove();
|
|
6634
6532
|
}
|
|
6635
|
-
},
|
|
6636
|
-
OoxmlError: () =>
|
|
6637
|
-
PptxPresentation: () =>
|
|
6638
|
-
PptxScrollViewer: () =>
|
|
6639
|
-
PptxViewer: () =>
|
|
6640
|
-
autoResize: () =>
|
|
6641
|
-
buildPptxHighlightLayer: () =>
|
|
6642
|
-
buildPptxTextLayer: () =>
|
|
6533
|
+
}, Ki = /* @__PURE__ */ e({
|
|
6534
|
+
OoxmlError: () => F,
|
|
6535
|
+
PptxPresentation: () => Bi,
|
|
6536
|
+
PptxScrollViewer: () => Gi,
|
|
6537
|
+
PptxViewer: () => Hi,
|
|
6538
|
+
autoResize: () => R,
|
|
6539
|
+
buildPptxHighlightLayer: () => Sn,
|
|
6540
|
+
buildPptxTextLayer: () => xn,
|
|
6643
6541
|
openExternalHyperlink: () => oe,
|
|
6644
|
-
renderSlide: () =>
|
|
6542
|
+
renderSlide: () => ii
|
|
6645
6543
|
});
|
|
6646
6544
|
//#endregion
|
|
6647
|
-
export {
|
|
6545
|
+
export { ii as a, Bi as i, Gi as n, Sn as o, Hi as r, xn as s, Ki as t };
|