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