@silurus/ooxml 0.73.2 → 0.74.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 +5 -1
- package/dist/{docx-C6i4Ut3d.js → docx-CgeW6eIH.js} +3295 -3289
- package/dist/docx.mjs +2 -2
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-CaGrVs7z.js → find-cursor-DtgyGs5V.js} +1358 -1337
- package/dist/{highlight-rect-DZn1OD1x.js → highlight-rect-IjFkGg4X.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-BVDbKJFr.js → pptx-9C5JKbFv.js} +170 -165
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-1rPbze5W.js +27 -0
- package/dist/render-worker-host-B-Y1DmN9.js +27 -0
- package/dist/render-worker-host-B5otq5TA.js +27 -0
- package/dist/types/index.d.ts +131 -4
- package/dist/types/pptx.d.ts +8 -2
- package/dist/types/xlsx.d.ts +124 -3
- package/dist/{visible-index-CyuaF_ZP.js → visible-index-C3_3gBg-.js} +1 -1
- package/dist/{xlsx-z4Bs4HLQ.js → xlsx-D-UFFxVs.js} +133 -121
- package/dist/xlsx.mjs +2 -2
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-Bz0flu1p.js +0 -27
- package/dist/render-worker-host-Custze53.js +0 -27
- package/dist/render-worker-host-G3B-g9HJ.js +0 -27
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { $ as t, At as n, B as r, Bt as i, C as a, D as o, E as s, Et as c, Ft as l, G as u, H as d, Ht as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, N as b, Nt as x, P as S, Pt as C, Q as w, R as T, Rt as E, S as D, St as O, T as k, U as A, Ut as j, V as M, W as N, Y as P, Yt as F, Z as I, _ as L, _t as R, at as z, b as B, c as V, ct as H, d as U, dt as ee, f as W, ft as G, gt as te, h as ne, ht as re, i as ie, jt as K, k as ae, l as oe, lt as se, m as ce, mt as le, n as ue, nt as de, o as fe, ot as pe, p as me, pt as he, q as ge, qt as _e, r as ve, rt as ye, s as be, st as xe, t as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, wt as Oe, x as ke, xt as Ae, yt as je, zt as Me } from "./find-cursor-
|
|
3
|
-
import { a as Ne, c as Pe, d as Fe, f as Ie, i as Le, l as Re, n as ze, o as Be, r as Ve, s as He, t as q, u as Ue } from "./highlight-rect-
|
|
4
|
-
import { a as We, i as Ge, n as Ke, r as qe, t as Je } from "./visible-index-
|
|
2
|
+
import { $ as t, At as n, B as r, Bt as i, C as a, D as o, E as s, Et as c, Ft as l, G as u, H as d, Ht as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, N as b, Nt as x, P as S, Pt as C, Q as w, R as T, Rt as E, S as D, St as O, T as k, U as A, Ut as j, V as M, W as N, Y as P, Yt as F, Z as I, _ as L, _t as R, at as z, b as B, c as V, ct as H, d as U, dt as ee, f as W, ft as G, gt as te, h as ne, ht as re, i as ie, jt as K, k as ae, l as oe, lt as se, m as ce, mt as le, n as ue, nt as de, o as fe, ot as pe, p as me, pt as he, q as ge, qt as _e, r as ve, rt as ye, s as be, st as xe, t as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, wt as Oe, x as ke, xt as Ae, yt as je, zt as Me } from "./find-cursor-DtgyGs5V.js";
|
|
3
|
+
import { a as Ne, c as Pe, d as Fe, f as Ie, i as Le, l as Re, n as ze, o as Be, r as Ve, s as He, t as q, u as Ue } from "./highlight-rect-IjFkGg4X.js";
|
|
4
|
+
import { a as We, i as Ge, n as Ke, r as qe, t as Je } from "./visible-index-C3_3gBg-.js";
|
|
5
5
|
import { t as Ye } from "./mathjax-BPjQ2C_j.js";
|
|
6
6
|
var Xe = {
|
|
7
7
|
textarchdown: {
|
|
@@ -2735,7 +2735,7 @@ function wt(e, t) {
|
|
|
2735
2735
|
return yt(St(-(t ? t.rev : e.baseRev)), yt(bt(-n), xt(-r)));
|
|
2736
2736
|
}
|
|
2737
2737
|
function Tt(e) {
|
|
2738
|
-
return vt[e]
|
|
2738
|
+
return vt[e] || (e.startsWith("perspective") ? vt.perspectiveFront : vt.orthographicFront);
|
|
2739
2739
|
}
|
|
2740
2740
|
function Et(e, t, n) {
|
|
2741
2741
|
let r = Tt(e.prst), i = wt(r, e.rot);
|
|
@@ -2778,25 +2778,23 @@ function Et(e, t, n) {
|
|
|
2778
2778
|
return [n, r];
|
|
2779
2779
|
});
|
|
2780
2780
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
2781
|
-
let d =
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
y: n / 2 + (r - y) * _
|
|
2786
|
-
})), x = .001 * Math.max(t, n), S = b[0].x + b[2].x - (b[1].x + b[3].x), C = b[0].y + b[2].y - (b[1].y + b[3].y), w = Math.abs(S) < x && Math.abs(C) < x, T = [
|
|
2781
|
+
let d = u.map(([e, r]) => ({
|
|
2782
|
+
x: t / 2 + e,
|
|
2783
|
+
y: n / 2 + r
|
|
2784
|
+
})), f = .001 * Math.max(t, n), p = d[0].x + d[2].x - (d[1].x + d[3].x), m = d[0].y + d[2].y - (d[1].y + d[3].y), h = Math.abs(p) < f && Math.abs(m) < f, g = [
|
|
2787
2785
|
[0, 0],
|
|
2788
2786
|
[t, 0],
|
|
2789
2787
|
[t, n],
|
|
2790
2788
|
[0, n]
|
|
2791
|
-
],
|
|
2792
|
-
for (let e = 0; e < 4; e++) if (Math.abs(
|
|
2793
|
-
|
|
2789
|
+
], _ = !0;
|
|
2790
|
+
for (let e = 0; e < 4; e++) if (Math.abs(d[e].x - g[e][0]) > f || Math.abs(d[e].y - g[e][1]) > f) {
|
|
2791
|
+
_ = !1;
|
|
2794
2792
|
break;
|
|
2795
2793
|
}
|
|
2796
2794
|
return {
|
|
2797
|
-
corners:
|
|
2798
|
-
isAffine:
|
|
2799
|
-
isIdentity:
|
|
2795
|
+
corners: d,
|
|
2796
|
+
isAffine: h,
|
|
2797
|
+
isIdentity: _
|
|
2800
2798
|
};
|
|
2801
2799
|
}
|
|
2802
2800
|
function Dt(e) {
|
|
@@ -4367,7 +4365,14 @@ function Fr(e, t, n, r, i, a, o) {
|
|
|
4367
4365
|
function Ir(e, t) {
|
|
4368
4366
|
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null && zn(e) ? t.smartArtFallbackTextColor : null;
|
|
4369
4367
|
}
|
|
4370
|
-
function Lr(e, t, n
|
|
4368
|
+
function Lr(e, t, n) {
|
|
4369
|
+
return {
|
|
4370
|
+
outerRotation: e,
|
|
4371
|
+
localFlipH: t,
|
|
4372
|
+
localFlipV: n
|
|
4373
|
+
};
|
|
4374
|
+
}
|
|
4375
|
+
function Rr(e, t, n, r = "#000000", i, a = {
|
|
4371
4376
|
themeMajorFont: null,
|
|
4372
4377
|
themeMinorFont: null,
|
|
4373
4378
|
dpr: 1
|
|
@@ -4379,25 +4384,25 @@ function Lr(e, t, n, r = "#000000", i, a = {
|
|
|
4379
4384
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4380
4385
|
if (t.stroke && (e.save(), $(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
4381
4386
|
let o = Ir(t, a);
|
|
4382
|
-
|
|
4387
|
+
Wr(e, t.textBody, c, l, u, d, n, o, t.rotation, t.flipH, t.flipV, r, i, a, f, !1, s);
|
|
4383
4388
|
}
|
|
4384
4389
|
return;
|
|
4385
4390
|
}
|
|
4386
4391
|
let p = t.scene3d && Dt(t.scene3d.camera) ? t.scene3d : null;
|
|
4387
4392
|
if (p && u > 0 && d > 0) {
|
|
4388
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, m =
|
|
4389
|
-
e.save(),
|
|
4390
|
-
let
|
|
4393
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, m = Gr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, f), h = Kr(t.sp3d, p.camera, u, d, n, f), g = Lr(t.rotation, t.flipH, t.flipV);
|
|
4394
|
+
e.save(), g.outerRotation !== 0 && (e.translate(c + u / 2, l + d / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4395
|
+
let _ = {
|
|
4391
4396
|
...t,
|
|
4392
4397
|
x: 0,
|
|
4393
4398
|
y: 0,
|
|
4394
4399
|
rotation: 0,
|
|
4395
|
-
flipH:
|
|
4396
|
-
flipV:
|
|
4400
|
+
flipH: g.localFlipH,
|
|
4401
|
+
flipV: g.localFlipV,
|
|
4397
4402
|
scene3d: void 0
|
|
4398
4403
|
};
|
|
4399
|
-
if (
|
|
4400
|
-
|
|
4404
|
+
if (qr(e, p.camera, c, l, u, d, (e) => {
|
|
4405
|
+
Rr(e, _, n, r, i, a, void 0);
|
|
4401
4406
|
}, {
|
|
4402
4407
|
bevels: m,
|
|
4403
4408
|
extrusion: h ?? void 0,
|
|
@@ -4452,7 +4457,7 @@ function Lr(e, t, n, r = "#000000", i, a = {
|
|
|
4452
4457
|
], i, a, o, v(m) ? { skipTrailingStroke: !0 } : void 0);
|
|
4453
4458
|
return;
|
|
4454
4459
|
}
|
|
4455
|
-
e.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4460
|
+
e.beginPath(), t.custGeom && t.custGeom.length > 0 ? zr(e, t.custGeom, c, l, u, d) : Pe(e, m, c, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), i && m !== "arc" && (e.fillStyle = i, m === "donut" || m === "smileyface" || m === "frame" ? e.fill("evenodd") : e.fill(), r || o()), a && a();
|
|
4456
4461
|
}, x = e.canvas.width || 0, S = e.canvas.height || 0, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = {
|
|
4457
4462
|
x: c * T,
|
|
4458
4463
|
y: l * T,
|
|
@@ -4499,7 +4504,7 @@ function Lr(e, t, n, r = "#000000", i, a = {
|
|
|
4499
4504
|
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
4500
4505
|
e.stroke();
|
|
4501
4506
|
}
|
|
4502
|
-
i && a &&
|
|
4507
|
+
i && a && $r(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && Ne(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && Ne(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
4503
4508
|
}
|
|
4504
4509
|
} else if (t.stroke && t.custGeom && t.custGeom.length > 0 && (t.stroke.headEnd && t.stroke.headEnd.type !== "none" || t.stroke.tailEnd && t.stroke.tailEnd.type !== "none")) {
|
|
4505
4510
|
let { start: r, end: i } = Re(t.custGeom);
|
|
@@ -4520,13 +4525,13 @@ function Lr(e, t, n, r = "#000000", i, a = {
|
|
|
4520
4525
|
let e = Fr(m, c, l, u, d, t.adj, t.adj2);
|
|
4521
4526
|
e && (p = e.tx, h = e.ty, g = e.tw, _ = e.th);
|
|
4522
4527
|
}
|
|
4523
|
-
|
|
4528
|
+
Wr(e, t.textBody, p, h, g, _, n, o, t.rotation, !1, !1, r, i, a, f, !1, s), e.restore();
|
|
4524
4529
|
}
|
|
4525
4530
|
e.restore();
|
|
4526
4531
|
}
|
|
4527
|
-
var
|
|
4528
|
-
function
|
|
4529
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4532
|
+
var zr = Ue;
|
|
4533
|
+
function Br(e, t) {
|
|
4534
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Vr(e).toLowerCase(), o = Vr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4530
4535
|
switch (t) {
|
|
4531
4536
|
case "arabicPlain": return n;
|
|
4532
4537
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4553,7 +4558,7 @@ function zr(e, t) {
|
|
|
4553
4558
|
default: return `${n}.`;
|
|
4554
4559
|
}
|
|
4555
4560
|
}
|
|
4556
|
-
function
|
|
4561
|
+
function Vr(e) {
|
|
4557
4562
|
let t = [
|
|
4558
4563
|
1e3,
|
|
4559
4564
|
900,
|
|
@@ -4586,21 +4591,21 @@ function Br(e) {
|
|
|
4586
4591
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4587
4592
|
return r;
|
|
4588
4593
|
}
|
|
4589
|
-
function
|
|
4594
|
+
function Hr(e) {
|
|
4590
4595
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4591
4596
|
return !1;
|
|
4592
4597
|
}
|
|
4593
|
-
function
|
|
4594
|
-
let n =
|
|
4598
|
+
function Ur(e, t) {
|
|
4599
|
+
let n = Hr(e);
|
|
4595
4600
|
if (e.bullet.type === "char") return t.clear(), n ? Ie(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4596
4601
|
if (e.bullet.type === "autoNum") {
|
|
4597
4602
|
if (!n) return "";
|
|
4598
4603
|
let r = e.lvl;
|
|
4599
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4604
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Br(t.get(r), e.bullet.numType);
|
|
4600
4605
|
}
|
|
4601
4606
|
return t.clear(), "";
|
|
4602
4607
|
}
|
|
4603
|
-
function
|
|
4608
|
+
function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000", m, h = {
|
|
4604
4609
|
themeMajorFont: null,
|
|
4605
4610
|
themeMinorFont: null,
|
|
4606
4611
|
dpr: 1
|
|
@@ -4619,7 +4624,7 @@ function Ur(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4619
4624
|
textBodyRotation: d
|
|
4620
4625
|
}) : void 0;
|
|
4621
4626
|
if (_) return a;
|
|
4622
|
-
e.save(), e.translate(n, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4627
|
+
e.save(), e.translate(n, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), Wr(e, {
|
|
4623
4628
|
...t,
|
|
4624
4629
|
vert: "horz"
|
|
4625
4630
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, p, m, h, f, !1, v, t.vert === "eaVert"), e.restore();
|
|
@@ -4640,7 +4645,7 @@ function Ur(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4640
4645
|
for (let e of f.runs) if (e.type === "text" && e.color) return e.color;
|
|
4641
4646
|
return null;
|
|
4642
4647
|
})(), E = T ? X(T) : y, D = "", P = Z(!1, !1, S, "sans-serif", h), F = E, I = null;
|
|
4643
|
-
D =
|
|
4648
|
+
D = Ur(f, u);
|
|
4644
4649
|
let L = wn(f.bullet);
|
|
4645
4650
|
if (L.type === "char") {
|
|
4646
4651
|
let e = L;
|
|
@@ -4872,7 +4877,7 @@ function Ur(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4872
4877
|
}
|
|
4873
4878
|
e.restore();
|
|
4874
4879
|
}
|
|
4875
|
-
function
|
|
4880
|
+
function Gr(e, t, n, r, i) {
|
|
4876
4881
|
if (!e) return [];
|
|
4877
4882
|
let a = nn(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = ln(n), s = r * i, c = [];
|
|
4878
4883
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
@@ -4890,7 +4895,7 @@ function Wr(e, t, n, r, i) {
|
|
|
4890
4895
|
bottom: !0
|
|
4891
4896
|
}), c;
|
|
4892
4897
|
}
|
|
4893
|
-
function
|
|
4898
|
+
function Kr(e, t, n, r, i, a) {
|
|
4894
4899
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4895
4900
|
let o = e.extrusionH * i * a, s = Ot(t, n * a, r * a, o);
|
|
4896
4901
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
@@ -4913,7 +4918,7 @@ function Gr(e, t, n, r, i, a) {
|
|
|
4913
4918
|
rgb: c
|
|
4914
4919
|
};
|
|
4915
4920
|
}
|
|
4916
|
-
function
|
|
4921
|
+
function qr(e, t, n, r, i, a, o, s = {}) {
|
|
4917
4922
|
if (i <= 0 || a <= 0) return !1;
|
|
4918
4923
|
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * d)), p = Et(t, i, a), m = p.corners;
|
|
4919
4924
|
if (f > 0) {
|
|
@@ -4941,7 +4946,7 @@ function Kr(e, t, n, r, i, a, o, s = {}) {
|
|
|
4941
4946
|
y: r + e.y
|
|
4942
4947
|
}))), !0;
|
|
4943
4948
|
}
|
|
4944
|
-
function
|
|
4949
|
+
function Jr(e, t, n, r, i, a, o, s, l = 0) {
|
|
4945
4950
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
4946
4951
|
let u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1, p = Math.max(0, Math.ceil(l * f)), m = p / f, h = Math.max(1, Math.ceil(r * f) + 2 * p), g = Math.max(1, Math.ceil(i * f) + 2 * p), _ = c(h, g);
|
|
4947
4952
|
if (!_) return !1;
|
|
@@ -4960,18 +4965,18 @@ function qr(e, t, n, r, i, a, o, s, l = 0) {
|
|
|
4960
4965
|
}
|
|
4961
4966
|
return s && (v.save(), v.scale(f, f), v.translate(m, m), s(v, 0, 0, r, i), v.restore()), e.drawImage(_, t - m, n - m, h / f, g / f), !0;
|
|
4962
4967
|
}
|
|
4963
|
-
var
|
|
4964
|
-
function
|
|
4965
|
-
let n =
|
|
4968
|
+
var Yr = /* @__PURE__ */ new WeakMap();
|
|
4969
|
+
function Xr(e, t) {
|
|
4970
|
+
let n = Yr.get(e);
|
|
4966
4971
|
if (n) return n;
|
|
4967
4972
|
let r = (async () => {
|
|
4968
4973
|
let n = await t(e.posterPath), r = e.posterMimeType ? new Blob([n], { type: e.posterMimeType }) : n;
|
|
4969
4974
|
if (H(new Uint8Array(await r.slice(0, 64 * 1024).arrayBuffer()))) throw Error("poster raster exceeds the pixel budget");
|
|
4970
4975
|
return createImageBitmap(r);
|
|
4971
4976
|
})();
|
|
4972
|
-
return
|
|
4977
|
+
return Yr.set(e, r), r;
|
|
4973
4978
|
}
|
|
4974
|
-
async function
|
|
4979
|
+
async function Zr(e, r, i, a) {
|
|
4975
4980
|
if (a) try {
|
|
4976
4981
|
let o = r.mimeType === "image/svg+xml", { widthPt: s, heightPt: c } = de(r.mimeType, r.srcRect, r.width / n, r.height / n), l;
|
|
4977
4982
|
if (P(r)) try {
|
|
@@ -4991,7 +4996,7 @@ async function Xr(e, r, i, a) {
|
|
|
4991
4996
|
let u = Y(r.x, i), d = Y(r.y, i), f = Y(r.width, i), p = Y(r.height, i);
|
|
4992
4997
|
(r.rotation !== 0 || r.flipH || r.flipV) && (e.translate(u + f / 2, d + p / 2), e.rotate(r.rotation * Math.PI / 180), r.flipH && e.scale(-1, 1), r.flipV && e.scale(1, -1), e.translate(-(u + f / 2), -(d + p / 2)));
|
|
4993
4998
|
let m = t(l, r.srcRect), h = (e, t, n, i, a) => {
|
|
4994
|
-
r.custGeom && r.custGeom.length > 0 ?
|
|
4999
|
+
r.custGeom && r.custGeom.length > 0 ? zr(e, r.custGeom, t, n, i, a) : r.prstGeom && ee(e, r.prstGeom, t, n, i, a, r.prstAdjust ?? []) || e.rect(t, n, i, a);
|
|
4995
5000
|
}, g = (e, t, n, r, i) => {
|
|
4996
5001
|
e.beginPath(), h(e, t, n, r, i);
|
|
4997
5002
|
}, _ = (e, t, n, i, a) => {
|
|
@@ -5012,20 +5017,20 @@ async function Xr(e, r, i, a) {
|
|
|
5012
5017
|
x(e, t, n, r, i), v(e, t, n, r, i), y(e, t, n, r, i);
|
|
5013
5018
|
}, C = (e, t, n, r, i) => {
|
|
5014
5019
|
x(e, t, n, r, i), v(e, t, n, r, i);
|
|
5015
|
-
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D =
|
|
5020
|
+
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = Gr(r.sp3d, r.scene3d?.lightRig, r.sp3d ? r.sp3d.prstMaterial : void 0, i, E), O = b ? Kr(r.sp3d, b.camera, f, p, i, E) : null, k = r.stroke ? r.stroke.width * i / 2 : 0, A = r.sp3d?.contourW ? r.sp3d.contourW * i : 0, j = O ? Math.hypot(O.offsetX, O.offsetY) / E : 0, M = k + A + j + 2, N = (e) => {
|
|
5016
5021
|
if (b) {
|
|
5017
|
-
if (
|
|
5022
|
+
if (qr(e, b.camera, u, d, f, p, C, {
|
|
5018
5023
|
bevels: D,
|
|
5019
5024
|
extrusion: O ?? void 0,
|
|
5020
5025
|
paintEdges: y,
|
|
5021
5026
|
edgePadCss: M
|
|
5022
5027
|
})) return;
|
|
5023
|
-
} else if (D.length > 0 &&
|
|
5028
|
+
} else if (D.length > 0 && Jr(e, u, d, f, p, D, C, y, M)) return;
|
|
5024
5029
|
S(e, u, d, f, p);
|
|
5025
5030
|
}, F = (e, t, n, r, i, a) => {
|
|
5026
5031
|
e.save(), _(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5027
5032
|
}, I = (e, t) => {
|
|
5028
|
-
b &&
|
|
5033
|
+
b && qr(e, b.camera, u, d, f, p, (e, n, r, i, a) => F(e, t, n, r, i, a)) || F(e, t, u, d, f, p);
|
|
5029
5034
|
}, L = e.canvas.width || 0, R = e.canvas.height || 0, z = e.getTransform(), B = Math.abs(z.a * z.d - z.b * z.c), V = B > 0 ? Math.sqrt(B) : 1, H = {
|
|
5030
5035
|
x: u * V,
|
|
5031
5036
|
y: d * V,
|
|
@@ -5043,14 +5048,14 @@ async function Xr(e, r, i, a) {
|
|
|
5043
5048
|
}, H, r.innerShadow, U, L, R), e.restore()), e.restore();
|
|
5044
5049
|
} catch {}
|
|
5045
5050
|
}
|
|
5046
|
-
async function
|
|
5051
|
+
async function Qr(e, t, n, r, i) {
|
|
5047
5052
|
let a = Y(t.x, n), o = Y(t.y, n), s = Y(t.width, n), c = Y(t.height, n), l;
|
|
5048
5053
|
if (t.posterPath && r) try {
|
|
5049
|
-
l = await
|
|
5054
|
+
l = await Xr(t, r);
|
|
5050
5055
|
} catch {}
|
|
5051
|
-
e.save(),
|
|
5056
|
+
e.save(), ei(e, t, n), l ? e.drawImage(l, a, o, s, c) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), i || En(e, a + s / 2, o + c / 2, s, c, "paused"), e.restore();
|
|
5052
5057
|
}
|
|
5053
|
-
function
|
|
5058
|
+
function $r(e, t, n, r, i, a) {
|
|
5054
5059
|
let o = Math.max(.5, Y(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
5055
5060
|
if (l === 0) return;
|
|
5056
5061
|
let u = -c / l, d = s / l, f;
|
|
@@ -5110,17 +5115,17 @@ function Qr(e, t, n, r, i, a) {
|
|
|
5110
5115
|
function $(e, t, n) {
|
|
5111
5116
|
je(e, t, n);
|
|
5112
5117
|
}
|
|
5113
|
-
function
|
|
5118
|
+
function ei(e, t, n) {
|
|
5114
5119
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5115
5120
|
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5116
5121
|
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));
|
|
5117
5122
|
}
|
|
5118
|
-
function
|
|
5123
|
+
function ti(e, t, n, r, i = {
|
|
5119
5124
|
themeMajorFont: null,
|
|
5120
5125
|
themeMinorFont: null,
|
|
5121
5126
|
dpr: 1
|
|
5122
5127
|
}) {
|
|
5123
|
-
e.save(),
|
|
5128
|
+
e.save(), ei(e, t, n);
|
|
5124
5129
|
let a = Y(t.x, n), o = Y(t.y, n), s = t.cols.map((e) => Y(e, n)), c = s.length, l = (e, t) => {
|
|
5125
5130
|
let n = 0;
|
|
5126
5131
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
@@ -5131,7 +5136,7 @@ function ei(e, t, n, r, i = {
|
|
|
5131
5136
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5132
5137
|
let s = o.cells[t];
|
|
5133
5138
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5134
|
-
let c = l(t, s.gridSpan || 1), u =
|
|
5139
|
+
let c = l(t, s.gridSpan || 1), u = Wr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5135
5140
|
u > d[a] && (d[a] = u);
|
|
5136
5141
|
}
|
|
5137
5142
|
}
|
|
@@ -5142,7 +5147,7 @@ function ei(e, t, n, r, i = {
|
|
|
5142
5147
|
if (s.hMerge || s.vMerge) continue;
|
|
5143
5148
|
let c = s.rowSpan || 1;
|
|
5144
5149
|
if (c <= 1 || !s.textBody) continue;
|
|
5145
|
-
let u = l(t, s.gridSpan || 1), f =
|
|
5150
|
+
let u = l(t, s.gridSpan || 1), f = Wr(e, s.textBody, 0, 0, u, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5146
5151
|
for (let e = 0; e < c && a + e < d.length; e++) p += d[a + e];
|
|
5147
5152
|
if (f > p) {
|
|
5148
5153
|
let e = (f - p) / c;
|
|
@@ -5190,7 +5195,7 @@ function ei(e, t, n, r, i = {
|
|
|
5190
5195
|
let l = Jn(t.fill);
|
|
5191
5196
|
if (l && (e.fillStyle = l, e.fillRect(a, o, s, c)), t.textBody) {
|
|
5192
5197
|
let l = t.textColor ? X(t.textColor) : null;
|
|
5193
|
-
|
|
5198
|
+
Wr(e, t.textBody, a, o, s, c, n, l, 0, !1, !1, "#000000", r, i);
|
|
5194
5199
|
}
|
|
5195
5200
|
}
|
|
5196
5201
|
let v = i.dpr, y = (e, t) => {
|
|
@@ -5238,11 +5243,11 @@ function ei(e, t, n, r, i = {
|
|
|
5238
5243
|
}
|
|
5239
5244
|
e.restore();
|
|
5240
5245
|
}
|
|
5241
|
-
function
|
|
5246
|
+
function ni(e, t, n, r) {
|
|
5242
5247
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5243
5248
|
}
|
|
5244
|
-
var
|
|
5245
|
-
function
|
|
5249
|
+
var ri = /* @__PURE__ */ new WeakMap();
|
|
5250
|
+
function ii(e, t, n, r, i) {
|
|
5246
5251
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5247
5252
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5248
5253
|
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([]);
|
|
@@ -5262,22 +5267,22 @@ function ri(e, t, n, r, i) {
|
|
|
5262
5267
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5263
5268
|
e.restore();
|
|
5264
5269
|
}
|
|
5265
|
-
async function
|
|
5270
|
+
async function ai(e, t, n, r, i = {}, a) {
|
|
5266
5271
|
let o = i.fetchImage ? ye(i.fetchImage) : void 0;
|
|
5267
5272
|
try {
|
|
5268
|
-
return await
|
|
5273
|
+
return await oi(e, t, n, r, i, a);
|
|
5269
5274
|
} finally {
|
|
5270
5275
|
o?.();
|
|
5271
5276
|
}
|
|
5272
5277
|
}
|
|
5273
|
-
async function
|
|
5274
|
-
let s = (
|
|
5275
|
-
|
|
5276
|
-
let c = () =>
|
|
5278
|
+
async function oi(e, t, r, i, a = {}, o) {
|
|
5279
|
+
let s = (ri.get(e) ?? 0) + 1;
|
|
5280
|
+
ri.set(e, s);
|
|
5281
|
+
let c = () => ri.get(e) !== s, l = a.width ?? ((ge(e) ? e.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? g(), m = N(d * p, f * p), h = m.clamped ? p * m.scale : p;
|
|
5277
5282
|
e.width = m.width, e.height = m.height, ge(e) && (e.style.width = `${d}px`, e.style.display || (e.style.display = "block"));
|
|
5278
5283
|
let _ = e.getContext("2d");
|
|
5279
5284
|
if (!_) throw Error("Could not get 2D context");
|
|
5280
|
-
if (_.scale(h, h), t.parseError) return
|
|
5285
|
+
if (_.scale(h, h), t.parseError) return ii(_, d, f, t.slideNumber, t.parseError), e;
|
|
5281
5286
|
let v = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = {
|
|
5282
5287
|
themeMajorFont: a.majorFont ?? null,
|
|
5283
5288
|
themeMinorFont: a.minorFont ?? null,
|
|
@@ -5300,7 +5305,7 @@ async function ai(e, t, r, i, a = {}, o) {
|
|
|
5300
5305
|
}
|
|
5301
5306
|
} else if (e.type === "media") {
|
|
5302
5307
|
let t = e;
|
|
5303
|
-
t.posterPath && a.fetchMedia &&
|
|
5308
|
+
t.posterPath && a.fetchMedia && Xr(t, a.fetchMedia).catch(() => void 0);
|
|
5304
5309
|
}
|
|
5305
5310
|
if (a.fetchImage) {
|
|
5306
5311
|
let n = a.fetchImage, r = /* @__PURE__ */ new Set();
|
|
@@ -5315,13 +5320,13 @@ async function ai(e, t, r, i, a = {}, o) {
|
|
|
5315
5320
|
}
|
|
5316
5321
|
for (let r of t.elements) {
|
|
5317
5322
|
if (c()) return e;
|
|
5318
|
-
if (r.type === "shape")
|
|
5319
|
-
else if (r.type === "picture") await
|
|
5320
|
-
else if (r.type === "table")
|
|
5321
|
-
else if (r.type === "media") await
|
|
5323
|
+
if (r.type === "shape") Rr(_, r, u, v, b, y, o, a.fetchImage);
|
|
5324
|
+
else if (r.type === "picture") await Zr(_, r, u, a.fetchImage);
|
|
5325
|
+
else if (r.type === "table") ti(_, r, u, b, y);
|
|
5326
|
+
else if (r.type === "media") await Qr(_, r, u, a.fetchMedia, a.skipMediaControls);
|
|
5322
5327
|
else if (r.type === "chart") {
|
|
5323
5328
|
let e = n * u;
|
|
5324
|
-
_.save(),
|
|
5329
|
+
_.save(), ei(_, r, u), Ee(_, r.chart, {
|
|
5325
5330
|
x: Y(r.x, u),
|
|
5326
5331
|
y: Y(r.y, u),
|
|
5327
5332
|
w: Y(r.width, u),
|
|
@@ -5329,26 +5334,26 @@ async function ai(e, t, r, i, a = {}, o) {
|
|
|
5329
5334
|
}, e), _.restore();
|
|
5330
5335
|
}
|
|
5331
5336
|
}
|
|
5332
|
-
return c() || a.dim &&
|
|
5337
|
+
return c() || a.dim && ni(_, a.dim, d, f), e;
|
|
5333
5338
|
}
|
|
5334
5339
|
//#endregion
|
|
5335
5340
|
//#region packages/pptx/src/tabular-text.ts
|
|
5336
|
-
var
|
|
5337
|
-
function
|
|
5341
|
+
var si = (e) => e >= "0" && e <= "9";
|
|
5342
|
+
function ci(e) {
|
|
5338
5343
|
let t = 0;
|
|
5339
5344
|
for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
|
|
5340
5345
|
return t;
|
|
5341
5346
|
}
|
|
5342
|
-
function
|
|
5347
|
+
function li(e, t, n) {
|
|
5343
5348
|
let r = 0;
|
|
5344
|
-
for (let i of t) r +=
|
|
5349
|
+
for (let i of t) r += si(i) ? n : e.measureText(i).width;
|
|
5345
5350
|
return r;
|
|
5346
5351
|
}
|
|
5347
|
-
function
|
|
5352
|
+
function ui(e, t, n, r, i) {
|
|
5348
5353
|
let a = e.textAlign;
|
|
5349
5354
|
e.textAlign = "left";
|
|
5350
5355
|
let o = n;
|
|
5351
|
-
for (let n of t) if (
|
|
5356
|
+
for (let n of t) if (si(n)) {
|
|
5352
5357
|
let t = e.measureText(n).width;
|
|
5353
5358
|
e.fillText(n, o + (i - t) / 2, r), o += i;
|
|
5354
5359
|
} else e.fillText(n, o, r), o += e.measureText(n).width;
|
|
@@ -5356,8 +5361,8 @@ function li(e, t, n, r, i) {
|
|
|
5356
5361
|
}
|
|
5357
5362
|
//#endregion
|
|
5358
5363
|
//#region packages/pptx/src/presentation-handle.ts
|
|
5359
|
-
var
|
|
5360
|
-
async function
|
|
5364
|
+
var di = (e, t) => e / K * t;
|
|
5365
|
+
async function fi(e, t, n) {
|
|
5361
5366
|
let r = e.getContext("2d");
|
|
5362
5367
|
if (!r) throw Error("2D context not available");
|
|
5363
5368
|
let i = n.width / (n.slideWidthEmu / K);
|
|
@@ -5378,10 +5383,10 @@ async function di(e, t, n) {
|
|
|
5378
5383
|
let r = e.mimeType || t.type, a = t.type === r ? t : new Blob([t], { type: r }), o = URL.createObjectURL(a), c = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
|
|
5379
5384
|
c.src = o, c.preload = "metadata", e.mediaKind === "video" && (c.playsInline = !0);
|
|
5380
5385
|
let l = {
|
|
5381
|
-
x:
|
|
5382
|
-
y:
|
|
5383
|
-
w:
|
|
5384
|
-
h:
|
|
5386
|
+
x: di(e.x, i),
|
|
5387
|
+
y: di(e.y, i),
|
|
5388
|
+
w: di(e.width, i),
|
|
5389
|
+
h: di(e.height, i)
|
|
5385
5390
|
}, u = e.mediaKind === "audio" ? {
|
|
5386
5391
|
x: l.x + l.w / 2 - Math.max(l.w, 260) / 2,
|
|
5387
5392
|
y: l.y,
|
|
@@ -5406,7 +5411,7 @@ async function di(e, t, n) {
|
|
|
5406
5411
|
let { x: n, y: i, w: a, h: o } = e.posterRect;
|
|
5407
5412
|
r.drawImage(t, n, i, a, o);
|
|
5408
5413
|
}
|
|
5409
|
-
if (e === u || h?.state === e)
|
|
5414
|
+
if (e === u || h?.state === e) vi(r, e, t);
|
|
5410
5415
|
else if (t.paused) {
|
|
5411
5416
|
let { x: t, y: n, w: i, h: a } = e.posterRect;
|
|
5412
5417
|
En(r, t + i / 2, n + a / 2, i, a, "paused");
|
|
@@ -5424,7 +5429,7 @@ async function di(e, t, n) {
|
|
|
5424
5429
|
for (let n of s) {
|
|
5425
5430
|
let { x: r, y: i, w: a, h: o } = n.rect;
|
|
5426
5431
|
if (e < r || e > r + a || t < i || t > i + o) continue;
|
|
5427
|
-
let s =
|
|
5432
|
+
let s = wi(n), c = s.y - 12, l = s.y + s.h + 8;
|
|
5428
5433
|
return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
|
|
5429
5434
|
kind: "seek",
|
|
5430
5435
|
state: n,
|
|
@@ -5455,7 +5460,7 @@ async function di(e, t, n) {
|
|
|
5455
5460
|
}
|
|
5456
5461
|
}
|
|
5457
5462
|
if (h) {
|
|
5458
|
-
let e =
|
|
5463
|
+
let e = wi(h.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
|
|
5459
5464
|
g(h.state, n);
|
|
5460
5465
|
}
|
|
5461
5466
|
}, y = () => {
|
|
@@ -5480,86 +5485,86 @@ async function di(e, t, n) {
|
|
|
5480
5485
|
}
|
|
5481
5486
|
};
|
|
5482
5487
|
}
|
|
5483
|
-
var
|
|
5484
|
-
function
|
|
5488
|
+
var pi = 28, mi = 14, hi = 72, gi = 10, _i = 3;
|
|
5489
|
+
function vi(e, t, n) {
|
|
5485
5490
|
let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
|
|
5486
|
-
En(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ?
|
|
5491
|
+
En(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? bi(e, t, n, r, i) : yi(e, t, n, r, i);
|
|
5487
5492
|
}
|
|
5488
|
-
function
|
|
5493
|
+
function yi(e, t, n, r, i) {
|
|
5489
5494
|
let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
|
|
5490
5495
|
e.save();
|
|
5491
5496
|
let d = e.createLinearGradient(0, u, 0, o + c);
|
|
5492
5497
|
d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
|
|
5493
|
-
let f =
|
|
5494
|
-
|
|
5498
|
+
let f = wi(t);
|
|
5499
|
+
Si(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", xi(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
|
|
5495
5500
|
}
|
|
5496
|
-
function
|
|
5497
|
-
let a =
|
|
5498
|
-
e.save(),
|
|
5501
|
+
function bi(e, t, n, r, i) {
|
|
5502
|
+
let a = Ci(t.rect);
|
|
5503
|
+
e.save(), Ti(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", xi(e, n.currentTime, r, a.x + mi, a.y + a.h / 2, "middle"), e.restore(), Si(e, wi(t), i, r > 0);
|
|
5499
5504
|
}
|
|
5500
|
-
function
|
|
5501
|
-
let o =
|
|
5502
|
-
|
|
5505
|
+
function xi(e, t, n, r, i, a) {
|
|
5506
|
+
let o = Ei(t), s = Ei(n), c = ci(e), l = li(e, o, c), u = li(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
|
|
5507
|
+
ui(e, o, r + f - l, i, c);
|
|
5503
5508
|
let p = e.textAlign;
|
|
5504
|
-
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p,
|
|
5509
|
+
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, ui(e, s, r + f + d, i, c);
|
|
5505
5510
|
}
|
|
5506
|
-
function
|
|
5511
|
+
function Si(e, t, n, r) {
|
|
5507
5512
|
let i = t.h / 2;
|
|
5508
|
-
if (e.save(),
|
|
5513
|
+
if (e.save(), Ti(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (Ti(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
|
|
5509
5514
|
let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
|
|
5510
5515
|
e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = 3, e.fillStyle = "#fff", e.beginPath(), e.arc(r, t.y + t.h / 2, 5, 0, Math.PI * 2), e.fill();
|
|
5511
5516
|
}
|
|
5512
5517
|
e.restore();
|
|
5513
5518
|
}
|
|
5514
|
-
function
|
|
5519
|
+
function Ci(e) {
|
|
5515
5520
|
let t = Math.max(220, e.w - 24);
|
|
5516
5521
|
return {
|
|
5517
5522
|
x: e.x + e.w / 2 - t / 2,
|
|
5518
|
-
y: e.y + e.h -
|
|
5523
|
+
y: e.y + e.h - pi - 4,
|
|
5519
5524
|
w: t,
|
|
5520
|
-
h:
|
|
5525
|
+
h: pi
|
|
5521
5526
|
};
|
|
5522
5527
|
}
|
|
5523
|
-
function
|
|
5528
|
+
function wi(e) {
|
|
5524
5529
|
if (e.el.mediaKind === "audio") {
|
|
5525
|
-
let t =
|
|
5530
|
+
let t = Ci(e.rect), n = t.x + mi + hi + gi, r = Math.max(40, t.x + t.w - mi - n);
|
|
5526
5531
|
return {
|
|
5527
5532
|
x: n,
|
|
5528
|
-
y: t.y + (t.h -
|
|
5533
|
+
y: t.y + (t.h - _i) / 2,
|
|
5529
5534
|
w: r,
|
|
5530
|
-
h:
|
|
5535
|
+
h: _i
|
|
5531
5536
|
};
|
|
5532
5537
|
}
|
|
5533
5538
|
let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
|
|
5534
5539
|
return {
|
|
5535
5540
|
x: t.x + n,
|
|
5536
|
-
y: t.y + t.h -
|
|
5541
|
+
y: t.y + t.h - _i - r,
|
|
5537
5542
|
w: t.w - n * 2,
|
|
5538
|
-
h:
|
|
5543
|
+
h: _i
|
|
5539
5544
|
};
|
|
5540
5545
|
}
|
|
5541
|
-
function
|
|
5546
|
+
function Ti(e, t, n, r, i, a) {
|
|
5542
5547
|
let o = Math.min(a, i / 2, r / 2);
|
|
5543
5548
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
5544
5549
|
}
|
|
5545
|
-
function
|
|
5550
|
+
function Ei(e) {
|
|
5546
5551
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
5547
5552
|
let t = Math.floor(e);
|
|
5548
5553
|
return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
|
|
5549
5554
|
}
|
|
5550
5555
|
//#endregion
|
|
5551
5556
|
//#region packages/pptx/src/notes.ts
|
|
5552
|
-
function
|
|
5557
|
+
function Di(e, t) {
|
|
5553
5558
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? null : e[t].notes ?? null;
|
|
5554
5559
|
}
|
|
5555
5560
|
//#endregion
|
|
5556
5561
|
//#region packages/pptx/src/hidden.ts
|
|
5557
|
-
function
|
|
5562
|
+
function Oi(e, t) {
|
|
5558
5563
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? !1 : e[t].hidden ?? !1;
|
|
5559
5564
|
}
|
|
5560
5565
|
//#endregion
|
|
5561
5566
|
//#region packages/pptx/src/slide-nav.ts
|
|
5562
|
-
function
|
|
5567
|
+
function ki(e) {
|
|
5563
5568
|
let t = /* @__PURE__ */ new Map();
|
|
5564
5569
|
for (let n = 0; n < e.length; n++) {
|
|
5565
5570
|
let r = e[n];
|
|
@@ -5567,44 +5572,44 @@ function Oi(e) {
|
|
|
5567
5572
|
}
|
|
5568
5573
|
return t;
|
|
5569
5574
|
}
|
|
5570
|
-
function
|
|
5575
|
+
function Ai(e, t) {
|
|
5571
5576
|
if (e === "") return;
|
|
5572
5577
|
let n = vn("ppt/slides", e);
|
|
5573
5578
|
return t.get(n);
|
|
5574
5579
|
}
|
|
5575
|
-
function
|
|
5580
|
+
function ji(e, t, n) {
|
|
5576
5581
|
let r = yn(e);
|
|
5577
|
-
return r === null ?
|
|
5582
|
+
return r === null ? Ai(e, t) : bn(r, n, t.size);
|
|
5578
5583
|
}
|
|
5579
5584
|
//#endregion
|
|
5580
5585
|
//#region packages/pptx/src/google-fonts.ts
|
|
5581
|
-
var
|
|
5586
|
+
var Mi = {
|
|
5582
5587
|
...i,
|
|
5583
5588
|
...l
|
|
5584
5589
|
};
|
|
5585
|
-
function*
|
|
5590
|
+
function* Ni(e) {
|
|
5586
5591
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5587
5592
|
}
|
|
5588
|
-
function*
|
|
5589
|
-
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield*
|
|
5590
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield*
|
|
5593
|
+
function* Pi(e) {
|
|
5594
|
+
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* Ni(e.textBody);
|
|
5595
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* Ni(e.textBody);
|
|
5591
5596
|
else if (e.type === "chart") {
|
|
5592
5597
|
e.chart.title && (yield e.chart.title);
|
|
5593
5598
|
for (let t of e.chart.categories) yield t;
|
|
5594
5599
|
for (let t of e.chart.series) t.name && (yield t.name);
|
|
5595
5600
|
}
|
|
5596
5601
|
}
|
|
5597
|
-
function
|
|
5602
|
+
function Fi(e) {
|
|
5598
5603
|
let t = v(e.majorFont) ?? v(e.minorFont) ?? null;
|
|
5599
5604
|
return [
|
|
5600
5605
|
e.majorFont,
|
|
5601
5606
|
e.minorFont,
|
|
5602
|
-
...Me(
|
|
5607
|
+
...Me(Pi(e), t)
|
|
5603
5608
|
];
|
|
5604
5609
|
}
|
|
5605
5610
|
//#endregion
|
|
5606
5611
|
//#region packages/pptx/src/media-mime.ts
|
|
5607
|
-
function
|
|
5612
|
+
function Ii(e, t) {
|
|
5608
5613
|
for (let n of e.slides) for (let e of n.elements) {
|
|
5609
5614
|
if (e.type !== "media") continue;
|
|
5610
5615
|
let n = e;
|
|
@@ -5615,11 +5620,11 @@ function Fi(e, t) {
|
|
|
5615
5620
|
}
|
|
5616
5621
|
//#endregion
|
|
5617
5622
|
//#region packages/pptx/src/worker.ts?worker&inline
|
|
5618
|
-
var
|
|
5619
|
-
function
|
|
5623
|
+
var Li = "function e(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var t=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function n(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var r=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw n(e)?(this._poison(),new t(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}},i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o.unregister(this),e}free(){let e=this.__destroy_into_raw();S.__wbg_pptxarchive_free(e,0)}extract_image(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}extract_media(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_media(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t){let n=m(e,S.__wbindgen_malloc),r=x,i=S.pptxarchive_new(n,r,!p(t),p(t)?BigInt(0):t);if(i[2])throw g(i[1]);return this.__wbg_ptr=i[0]>>>0,o.register(this,this.__wbg_ptr,this),this}parse(){let e=S.pptxarchive_parse(this.__wbg_ptr);if(e[3])throw g(e[2]);var t=s(e[0],e[1]).slice();return S.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=S.pptxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,g(i[2]);return e=n,t=r,u(n,r)}finally{S.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);function a(){return{__proto__:null,\"./pptx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(u(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(u(e,t))}finally{S.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=h(n,S.__wbindgen_malloc,S.__wbindgen_realloc),i=x;l().setInt32(e+4,i,!0),l().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return u(e,t)},__wbindgen_init_externref_table:function(){let e=S.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const o=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>S.__wbg_pptxarchive_free(e>>>0,1));function s(e,t){return e>>>=0,f().subarray(e/1,e/1+t)}let c=null;function l(){return(c===null||c.buffer.detached===!0||c.buffer.detached===void 0&&c.buffer!==S.memory.buffer)&&(c=new DataView(S.memory.buffer)),c}function u(e,t){return e>>>=0,y(e,t)}let d=null;function f(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(S.memory.buffer)),d}function p(e){return e==null}function m(e,t){let n=t(e.length*1,1)>>>0;return f().set(e,n/1),x=e.length,n}function h(e,t,n){if(n===void 0){let n=b.encode(e),r=t(n.length,1)>>>0;return f().subarray(r,r+n.length).set(n),x=n.length,r}let r=e.length,i=t(r,1)>>>0,a=f(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=f().subarray(i+o,i+r),a=b.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return x=o,i}function g(e){let t=S.__wbindgen_externrefs.get(e);return S.__externref_table_dealloc(e),t}let _=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});_.decode();let v=0;function y(e,t){return v+=t,v>=2146435072&&(_=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),_.decode(),v=t),_.decode(f().subarray(e,e+t))}const b=new TextEncoder;`encodeInto`in b||(b.encodeInto=function(e,t){let n=b.encode(e);return t.set(n),{read:e.length,written:n.length}});let x=0,S;function C(e,t){return S=e.exports,c=null,d=null,S.__wbindgen_start(),S}async function w(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function T(e){if(S!==void 0)return S;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=a();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await w(await e,t);return C(n,r)}async function E(e){return S=void 0,c=null,d=null,T(e)}const D=new r(T,{freeArchive:e=>e.free(),reinit:E});self.onmessage=async t=>{let n=t.data;if(n.kind===`init`){D.setWasmUrl(e(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.kind===`parse`){let e=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,t=new Uint8Array(n.buffer),a=D.run(()=>{let n=new i(t,e);return D.setArchive(n),n.parse()}).buffer,o={kind:`parsed`,id:r,presentationJson:a};self.postMessage(o,[a]);return}let e=D.archive;if(n.kind===`extractMedia`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_media(n.path).buffer),i={kind:`mediaExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`extractImage`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_image(n.path).buffer),i={kind:`imageExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`toMarkdown`){if(!e)throw Error(`No pptx loaded`);let t={kind:`markdownRendered`,id:r,markdown:D.run(()=>e.to_markdown())};self.postMessage(t);return}}catch(e){let t={kind:`error`,id:r,message:e instanceof Error?e.message:String(e)};self.postMessage(t)}};", Ri = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Li], { type: "text/javascript;charset=utf-8" });
|
|
5624
|
+
function zi(e) {
|
|
5620
5625
|
let t;
|
|
5621
5626
|
try {
|
|
5622
|
-
if (t =
|
|
5627
|
+
if (t = Ri && (self.URL || self.webkitURL).createObjectURL(Ri), !t) throw "";
|
|
5623
5628
|
let n = new Worker(t, {
|
|
5624
5629
|
type: "module",
|
|
5625
5630
|
name: e?.name
|
|
@@ -5628,7 +5633,7 @@ function Ri(e) {
|
|
|
5628
5633
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
5629
5634
|
}), n;
|
|
5630
5635
|
} catch {
|
|
5631
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
5636
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Li), {
|
|
5632
5637
|
type: "module",
|
|
5633
5638
|
name: e?.name
|
|
5634
5639
|
});
|
|
@@ -5636,7 +5641,7 @@ function Ri(e) {
|
|
|
5636
5641
|
}
|
|
5637
5642
|
//#endregion
|
|
5638
5643
|
//#region packages/pptx/src/wasm/pptx_parser_bg.wasm?url
|
|
5639
|
-
var
|
|
5644
|
+
var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
5640
5645
|
_worker;
|
|
5641
5646
|
_bridge;
|
|
5642
5647
|
_mode = "main";
|
|
@@ -5653,7 +5658,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5653
5658
|
correlate: (e) => e.id,
|
|
5654
5659
|
toError: (e) => e.kind === "error" ? e.message : void 0
|
|
5655
5660
|
});
|
|
5656
|
-
let r = new URL(n ??
|
|
5661
|
+
let r = new URL(n ?? Bi, location.href).href;
|
|
5657
5662
|
this._bridge.post({
|
|
5658
5663
|
kind: "init",
|
|
5659
5664
|
wasmUrl: r
|
|
@@ -5669,8 +5674,8 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5669
5674
|
i = await e.arrayBuffer();
|
|
5670
5675
|
} else i = t;
|
|
5671
5676
|
i = h(await _e(i, n.password));
|
|
5672
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
5673
|
-
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await f(
|
|
5677
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-B5otq5TA.js")).createRenderWorker() : new zi(), r, n.wasmUrl);
|
|
5678
|
+
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await f(Fi(a._presentation), Mi)), a;
|
|
5674
5679
|
}
|
|
5675
5680
|
async _parse(e, t, n = !1, r) {
|
|
5676
5681
|
let i = await this._bridge.request((r) => this._mode === "worker" ? {
|
|
@@ -5704,22 +5709,22 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5704
5709
|
return this._mode;
|
|
5705
5710
|
}
|
|
5706
5711
|
getNotes(e) {
|
|
5707
|
-
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null :
|
|
5712
|
+
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Di(this._presentation?.slides ?? [], e);
|
|
5708
5713
|
}
|
|
5709
5714
|
isHidden(e) {
|
|
5710
|
-
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 :
|
|
5715
|
+
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Oi(this._presentation?.slides ?? [], e);
|
|
5711
5716
|
}
|
|
5712
5717
|
_partNames() {
|
|
5713
5718
|
return this._meta ? this._meta.partNames : (this._presentation?.slides ?? []).map((e) => e.partName);
|
|
5714
5719
|
}
|
|
5715
5720
|
_partIndex() {
|
|
5716
|
-
return this._slidePartIndex ||=
|
|
5721
|
+
return this._slidePartIndex ||= ki(this._partNames()), this._slidePartIndex;
|
|
5717
5722
|
}
|
|
5718
5723
|
getSlideIndexByPartName(e) {
|
|
5719
5724
|
return this._partIndex().get(e);
|
|
5720
5725
|
}
|
|
5721
5726
|
resolveInternalTarget(e, t = 0) {
|
|
5722
|
-
return
|
|
5727
|
+
return ji(e, this._partIndex(), t);
|
|
5723
5728
|
}
|
|
5724
5729
|
async renderSlide(e, t, n = {}) {
|
|
5725
5730
|
if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
@@ -5727,7 +5732,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5727
5732
|
let r = this._presentation.slides[t];
|
|
5728
5733
|
if (!r) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
5729
5734
|
let i = n.dpr ?? g(), a = n.width ?? ((ge(e) ? e.offsetWidth : 0) || 960);
|
|
5730
|
-
await
|
|
5735
|
+
await ai(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
|
|
5731
5736
|
width: a,
|
|
5732
5737
|
dpr: i,
|
|
5733
5738
|
defaultTextColor: this._presentation.defaultTextColor,
|
|
@@ -5796,7 +5801,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5796
5801
|
return this._mediaCache.set(e, r), r;
|
|
5797
5802
|
}
|
|
5798
5803
|
_findMimeTypeForPath(e) {
|
|
5799
|
-
return this._presentation ?
|
|
5804
|
+
return this._presentation ? Ii(this._presentation, e) : "";
|
|
5800
5805
|
}
|
|
5801
5806
|
async getImage(e, t) {
|
|
5802
5807
|
let n = this._imageCache.get(e);
|
|
@@ -5839,7 +5844,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5839
5844
|
dim: n.dim,
|
|
5840
5845
|
onTextRun: n.onTextRun
|
|
5841
5846
|
});
|
|
5842
|
-
return
|
|
5847
|
+
return fi(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
|
|
5843
5848
|
width: i,
|
|
5844
5849
|
dpr: r,
|
|
5845
5850
|
slideWidthEmu: this.slideWidth,
|
|
@@ -5851,10 +5856,10 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5851
5856
|
destroy() {
|
|
5852
5857
|
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (j(this._googleFontFaces), this._googleFontFaces = []), z(this._fetchImage), Ge(this._fetchImage), se(this._fetchImage);
|
|
5853
5858
|
}
|
|
5854
|
-
},
|
|
5859
|
+
}, Hi = {
|
|
5855
5860
|
color: "#ffffff",
|
|
5856
5861
|
opacity: .6
|
|
5857
|
-
},
|
|
5862
|
+
}, Ui = class {
|
|
5858
5863
|
canvas;
|
|
5859
5864
|
wrapper;
|
|
5860
5865
|
_scale = null;
|
|
@@ -5882,7 +5887,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5882
5887
|
async load(e) {
|
|
5883
5888
|
let t = ++this._loadGen, n = this.engine;
|
|
5884
5889
|
try {
|
|
5885
|
-
let r = await
|
|
5890
|
+
let r = await Vi.load(e, {
|
|
5886
5891
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5887
5892
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
5888
5893
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
@@ -5922,8 +5927,8 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
5922
5927
|
}
|
|
5923
5928
|
_dim() {
|
|
5924
5929
|
return {
|
|
5925
|
-
color: this.opts.hiddenSlideDim?.color ??
|
|
5926
|
-
opacity: this.opts.hiddenSlideDim?.opacity ??
|
|
5930
|
+
color: this.opts.hiddenSlideDim?.color ?? Hi.color,
|
|
5931
|
+
opacity: this.opts.hiddenSlideDim?.opacity ?? Hi.opacity
|
|
5927
5932
|
};
|
|
5928
5933
|
}
|
|
5929
5934
|
async setHiddenSlideMode(e) {
|
|
@@ -6100,7 +6105,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
6100
6105
|
} else this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
|
|
6101
6106
|
this.canvas.style.display = this._originalDisplay, this.wrapper.remove();
|
|
6102
6107
|
}
|
|
6103
|
-
},
|
|
6108
|
+
}, Wi = 150, Gi = "0 1px 3px rgba(0,0,0,0.2)", Ki = class {
|
|
6104
6109
|
_pres = null;
|
|
6105
6110
|
_injected;
|
|
6106
6111
|
_opts;
|
|
@@ -6131,7 +6136,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
6131
6136
|
_pageShadow;
|
|
6132
6137
|
constructor(e, t = {}) {
|
|
6133
6138
|
if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
|
|
6134
|
-
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ??
|
|
6139
|
+
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Gi, this._injected = !!t.presentation, this._injected) {
|
|
6135
6140
|
let e = t.presentation;
|
|
6136
6141
|
if (t.mode !== void 0 && t.mode !== e.mode) throw Error(`PptxScrollViewer: opts.mode='${t.mode}' conflicts with the injected engine's mode='${e.mode}'. Omit opts.mode when injecting an engine — the engine owns its render mode.`);
|
|
6137
6142
|
this._pres = e, this._mode = e.mode;
|
|
@@ -6149,7 +6154,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
6149
6154
|
if (this._injected) throw Error("PptxScrollViewer.load() is unsupported when an engine is injected via opts.presentation; the injected engine is already loaded.");
|
|
6150
6155
|
let t = ++this._loadGen, n = this._pres;
|
|
6151
6156
|
try {
|
|
6152
|
-
let r = await
|
|
6157
|
+
let r = await Vi.load(e, {
|
|
6153
6158
|
useGoogleFonts: this._opts.useGoogleFonts,
|
|
6154
6159
|
maxZipEntryBytes: this._opts.maxZipEntryBytes,
|
|
6155
6160
|
workerTimeoutMs: this._opts.workerTimeoutMs,
|
|
@@ -6422,7 +6427,7 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
6422
6427
|
_scheduleSettle() {
|
|
6423
6428
|
this._settleTimer !== null && clearTimeout(this._settleTimer), this._settleTimer = setTimeout(() => {
|
|
6424
6429
|
this._settleTimer = null, this._settleRender();
|
|
6425
|
-
},
|
|
6430
|
+
}, Wi);
|
|
6426
6431
|
}
|
|
6427
6432
|
_settleRender() {
|
|
6428
6433
|
if (!(this._destroyed || !this._pres || this._pres.slideCount === 0)) for (let [e, t] of [...this._slots]) t.renderedScale !== this._scale && this._settleSlot(e, t);
|
|
@@ -6530,16 +6535,16 @@ var zi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Bi = class e {
|
|
|
6530
6535
|
for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
|
|
6531
6536
|
this._free.length = 0, this._injected || this._pres?.destroy(), this._pres = null, this._wrapper.remove();
|
|
6532
6537
|
}
|
|
6533
|
-
},
|
|
6538
|
+
}, qi = /* @__PURE__ */ e({
|
|
6534
6539
|
OoxmlError: () => F,
|
|
6535
|
-
PptxPresentation: () =>
|
|
6536
|
-
PptxScrollViewer: () =>
|
|
6537
|
-
PptxViewer: () =>
|
|
6540
|
+
PptxPresentation: () => Vi,
|
|
6541
|
+
PptxScrollViewer: () => Ki,
|
|
6542
|
+
PptxViewer: () => Ui,
|
|
6538
6543
|
autoResize: () => R,
|
|
6539
6544
|
buildPptxHighlightLayer: () => Sn,
|
|
6540
6545
|
buildPptxTextLayer: () => xn,
|
|
6541
6546
|
openExternalHyperlink: () => oe,
|
|
6542
|
-
renderSlide: () =>
|
|
6547
|
+
renderSlide: () => ai
|
|
6543
6548
|
});
|
|
6544
6549
|
//#endregion
|
|
6545
|
-
export {
|
|
6550
|
+
export { ai as a, Vi as i, Ki as n, Sn as o, Ui as r, xn as s, qi as t };
|