@silurus/ooxml 0.72.0 → 0.72.2

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.
@@ -1,4 +1,4 @@
1
- import { A as e, Ct as t, N as n, W as r, bt as i, k as a, ut as o } from "./find-cursor-DTrEBxjE.js";
1
+ import { A as e, Ct as t, N as n, W as r, bt as i, k as a, ut as o } from "./find-cursor-DBifiZop.js";
2
2
  //#region packages/core/src/fonts/symbol-font.ts
3
3
  var s = {
4
4
  167: "♣",
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./docx-BPF-eH0O.js";
2
- import { t } from "./pptx-BMxDfEYI.js";
3
- import { t as n } from "./xlsx-bwQD8c1Q.js";
1
+ import { t as e } from "./docx-wLLJuetI.js";
2
+ import { t } from "./pptx-D3L4FQfI.js";
3
+ import { t as n } from "./xlsx-BWEqRZ25.js";
4
4
  export { e as docx, t as pptx, n as xlsx };
@@ -1,6 +1,6 @@
1
- import { At as e, B as t, Bt as n, C as r, E as i, Ft as a, G as o, H as s, Ht as c, I as l, It as u, J as d, Jt as f, K as p, L as m, Lt as h, M as g, Mt as _, N as v, Nt as y, O as b, Pt as x, Q as S, S as C, T as w, Tt as T, U as E, Ut as D, V as O, W as k, X as A, Xt as j, Yt as M, Z as N, _ as P, _t as F, at as I, b as L, bt as R, c as z, ct as B, d as V, dt as H, f as U, ft as W, gt as ee, h as te, ht as ne, i as re, it as ie, j as ae, kt as G, 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, s as ye, st as be, t as xe, tt as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, x as Oe, xt as ke, y as Ae, z as je, zt as Me } from "./find-cursor-DTrEBxjE.js";
2
- 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, p as Ve, r as He, s as Ue, t as K, u as We } from "./highlight-rect-B--cPQOV.js";
3
- import { a as Ge, i as Ke, n as qe, r as Je, t as Ye } from "./visible-index-5hdq_oAL.js";
1
+ import { At as e, B as t, Bt as n, C as r, E as i, Ft as a, G as o, H as s, Ht as c, I as l, It as u, J as d, Jt as f, K as p, L as m, Lt as h, M as g, Mt as _, N as v, Nt as y, O as b, Pt as x, Q as S, S as C, T as w, Tt as T, U as E, Ut as D, V as O, W as k, X as A, Xt as j, Yt as M, Z as N, _ as P, _t as F, at as I, b as L, bt as R, c as z, ct as B, d as V, dt as H, f as U, ft as W, gt as ee, h as te, ht as ne, i as re, it as ie, j as ae, kt as G, 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, s as ye, st as be, t as xe, tt as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, x as Oe, xt as ke, y as Ae, z as je, zt as Me } from "./find-cursor-DBifiZop.js";
2
+ 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, p as Ve, r as He, s as Ue, t as K, u as We } from "./highlight-rect-DTgfiJgA.js";
3
+ import { a as Ge, i as Ke, n as qe, r as Je, t as Ye } from "./visible-index-DSN5XPnm.js";
4
4
  import { t as Xe } from "./mathjax-Dk_JzbFj.js";
5
5
  //#region packages/core/src/shape/custgeom-endpoints.ts
6
6
  var q = 1e-9;
@@ -5146,12 +5146,11 @@ async function ri(e, t, n, r) {
5146
5146
  } catch {}
5147
5147
  }
5148
5148
  async function ii(e, t, n, r, i) {
5149
- let a = Y(t.x, n), o = Y(t.y, n), s = Y(t.width, n), c = Y(t.height, n), l = !1;
5149
+ let a = Y(t.x, n), o = Y(t.y, n), s = Y(t.width, n), c = Y(t.height, n), l;
5150
5150
  if (t.posterPath && r) try {
5151
- let n = await ni(t, r);
5152
- e.drawImage(n, a, o, s, c), l = !0;
5151
+ l = await ni(t, r);
5153
5152
  } catch {}
5154
- l || (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), !i && Nn(e, a + s / 2, o + c / 2, s, c, "paused");
5153
+ e.save(), oi(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 || Nn(e, a + s / 2, o + c / 2, s, c, "paused"), e.restore();
5155
5154
  }
5156
5155
  function ai(e, t, n, r, i, a) {
5157
5156
  let o = Math.max(.5, Y(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
@@ -5213,11 +5212,17 @@ function ai(e, t, n, r, i, a) {
5213
5212
  function $(e, t, n) {
5214
5213
  Ee(e, t, n);
5215
5214
  }
5216
- function oi(e, t, n, r, i = {
5215
+ function oi(e, t, n) {
5216
+ if (t.rotation === 0 && !t.flipH && !t.flipV) return;
5217
+ let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
5218
+ e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(r + a / 2), -(i + o / 2));
5219
+ }
5220
+ function si(e, t, n, r, i = {
5217
5221
  themeMajorFont: null,
5218
5222
  themeMinorFont: null,
5219
5223
  dpr: 1
5220
5224
  }) {
5225
+ e.save(), oi(e, t, n);
5221
5226
  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) => {
5222
5227
  let n = 0;
5223
5228
  for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
@@ -5333,12 +5338,13 @@ function oi(e, t, n, r, i = {
5333
5338
  }
5334
5339
  i.diagonalTL && ($(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && ($(e, i.diagonalTR, n), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + d), e.stroke()), e.restore();
5335
5340
  }
5341
+ e.restore();
5336
5342
  }
5337
- function si(e, t, n, r) {
5343
+ function ci(e, t, n, r) {
5338
5344
  e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
5339
5345
  }
5340
- var ci = /* @__PURE__ */ new WeakMap();
5341
- function li(e, t, n, r, i) {
5346
+ var li = /* @__PURE__ */ new WeakMap();
5347
+ function ui(e, t, n, r, i) {
5342
5348
  e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
5343
5349
  let a = Math.max(12, Math.min(t, n) * .04);
5344
5350
  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([]);
@@ -5358,22 +5364,22 @@ function li(e, t, n, r, i) {
5358
5364
  for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
5359
5365
  e.restore();
5360
5366
  }
5361
- async function ui(e, t, n, r, i = {}, a) {
5367
+ async function di(e, t, n, r, i = {}, a) {
5362
5368
  let o = i.fetchImage ? de(i.fetchImage) : void 0;
5363
5369
  try {
5364
- return await di(e, t, n, r, i, a);
5370
+ return await fi(e, t, n, r, i, a);
5365
5371
  } finally {
5366
5372
  o?.();
5367
5373
  }
5368
5374
  }
5369
- async function di(e, t, n, r, i = {}, a) {
5370
- let s = (ci.get(e) ?? 0) + 1;
5371
- ci.set(e, s);
5372
- let c = () => ci.get(e) !== s, l = i.width ?? ((p(e) ? e.offsetWidth : 0) || 960), u = l / n, f = Math.round(l), m = Math.round(r * u), h = i.dpr ?? o(), g = E(f * h, m * h), _ = g.clamped ? h * g.scale : h;
5375
+ async function fi(e, t, n, r, i = {}, a) {
5376
+ let s = (li.get(e) ?? 0) + 1;
5377
+ li.set(e, s);
5378
+ let c = () => li.get(e) !== s, l = i.width ?? ((p(e) ? e.offsetWidth : 0) || 960), u = l / n, f = Math.round(l), m = Math.round(r * u), h = i.dpr ?? o(), g = E(f * h, m * h), _ = g.clamped ? h * g.scale : h;
5373
5379
  e.width = g.width, e.height = g.height, p(e) && (e.style.width = `${f}px`, e.style.display || (e.style.display = "block"));
5374
5380
  let v = e.getContext("2d");
5375
5381
  if (!v) throw Error("Could not get 2D context");
5376
- if (v.scale(_, _), t.parseError) return li(v, f, m, t.slideNumber, t.parseError), e;
5382
+ if (v.scale(_, _), t.parseError) return ui(v, f, m, t.slideNumber, t.parseError), e;
5377
5383
  let y = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", b = {
5378
5384
  themeMajorFont: i.majorFont ?? null,
5379
5385
  themeMinorFont: i.minorFont ?? null,
@@ -5413,38 +5419,38 @@ async function di(e, t, n, r, i = {}, a) {
5413
5419
  if (c()) return e;
5414
5420
  if (n.type === "shape") Wr(v, n, u, y, x, b, a, i.fetchImage);
5415
5421
  else if (n.type === "picture") await ri(v, n, u, i.fetchImage);
5416
- else if (n.type === "table") oi(v, n, u, x, b);
5422
+ else if (n.type === "table") si(v, n, u, x, b);
5417
5423
  else if (n.type === "media") await ii(v, n, u, i.fetchMedia, i.skipMediaControls);
5418
5424
  else if (n.type === "chart") {
5419
5425
  let e = G * u;
5420
- F(v, n.chart, {
5426
+ v.save(), oi(v, n, u), F(v, n.chart, {
5421
5427
  x: Y(n.x, u),
5422
5428
  y: Y(n.y, u),
5423
5429
  w: Y(n.width, u),
5424
5430
  h: Y(n.height, u)
5425
- }, e);
5431
+ }, e), v.restore();
5426
5432
  }
5427
5433
  }
5428
- return c() || i.dim && si(v, i.dim, f, m), e;
5434
+ return c() || i.dim && ci(v, i.dim, f, m), e;
5429
5435
  }
5430
5436
  //#endregion
5431
5437
  //#region packages/pptx/src/tabular-text.ts
5432
- var fi = (e) => e >= "0" && e <= "9";
5433
- function pi(e) {
5438
+ var pi = (e) => e >= "0" && e <= "9";
5439
+ function mi(e) {
5434
5440
  let t = 0;
5435
5441
  for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
5436
5442
  return t;
5437
5443
  }
5438
- function mi(e, t, n) {
5444
+ function hi(e, t, n) {
5439
5445
  let r = 0;
5440
- for (let i of t) r += fi(i) ? n : e.measureText(i).width;
5446
+ for (let i of t) r += pi(i) ? n : e.measureText(i).width;
5441
5447
  return r;
5442
5448
  }
5443
- function hi(e, t, n, r, i) {
5449
+ function gi(e, t, n, r, i) {
5444
5450
  let a = e.textAlign;
5445
5451
  e.textAlign = "left";
5446
5452
  let o = n;
5447
- for (let n of t) if (fi(n)) {
5453
+ for (let n of t) if (pi(n)) {
5448
5454
  let t = e.measureText(n).width;
5449
5455
  e.fillText(n, o + (i - t) / 2, r), o += i;
5450
5456
  } else e.fillText(n, o, r), o += e.measureText(n).width;
@@ -5452,8 +5458,8 @@ function hi(e, t, n, r, i) {
5452
5458
  }
5453
5459
  //#endregion
5454
5460
  //#region packages/pptx/src/presentation-handle.ts
5455
- var gi = (t, n) => t / e * n;
5456
- async function _i(t, n, r) {
5461
+ var _i = (t, n) => t / e * n;
5462
+ async function vi(t, n, r) {
5457
5463
  let i = t.getContext("2d");
5458
5464
  if (!i) throw Error("2D context not available");
5459
5465
  let a = r.width / (r.slideWidthEmu / e);
@@ -5474,10 +5480,10 @@ async function _i(t, n, r) {
5474
5480
  let n = e.mimeType || t.type, i = t.type === n ? t : new Blob([t], { type: n }), o = URL.createObjectURL(i), s = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
5475
5481
  s.src = o, s.preload = "metadata", e.mediaKind === "video" && (s.playsInline = !0);
5476
5482
  let l = {
5477
- x: gi(e.x, a),
5478
- y: gi(e.y, a),
5479
- w: gi(e.width, a),
5480
- h: gi(e.height, a)
5483
+ x: _i(e.x, a),
5484
+ y: _i(e.y, a),
5485
+ w: _i(e.width, a),
5486
+ h: _i(e.height, a)
5481
5487
  }, u = e.mediaKind === "audio" ? {
5482
5488
  x: l.x + l.w / 2 - Math.max(l.w, 260) / 2,
5483
5489
  y: l.y,
@@ -5502,7 +5508,7 @@ async function _i(t, n, r) {
5502
5508
  let { x: n, y: r, w: a, h: o } = e.posterRect;
5503
5509
  i.drawImage(t, n, r, a, o);
5504
5510
  }
5505
- if (e === d || g?.state === e) Ci(i, e, t);
5511
+ if (e === d || g?.state === e) wi(i, e, t);
5506
5512
  else if (t.paused) {
5507
5513
  let { x: t, y: n, w: r, h: a } = e.posterRect;
5508
5514
  Nn(i, t + r / 2, n + a / 2, r, a, "paused");
@@ -5520,7 +5526,7 @@ async function _i(t, n, r) {
5520
5526
  for (let n of c) {
5521
5527
  let { x: r, y: i, w: a, h: o } = n.rect;
5522
5528
  if (e < r || e > r + a || t < i || t > i + o) continue;
5523
- let s = ki(n), c = s.y - 12, l = s.y + s.h + 8;
5529
+ let s = Ai(n), c = s.y - 12, l = s.y + s.h + 8;
5524
5530
  return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
5525
5531
  kind: "seek",
5526
5532
  state: n,
@@ -5551,7 +5557,7 @@ async function _i(t, n, r) {
5551
5557
  }
5552
5558
  }
5553
5559
  if (g) {
5554
- let e = ki(g.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
5560
+ let e = Ai(g.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
5555
5561
  _(g.state, n);
5556
5562
  }
5557
5563
  }, b = () => {
@@ -5576,86 +5582,86 @@ async function _i(t, n, r) {
5576
5582
  }
5577
5583
  };
5578
5584
  }
5579
- var vi = 28, yi = 14, bi = 72, xi = 10, Si = 3;
5580
- function Ci(e, t, n) {
5585
+ var yi = 28, bi = 14, xi = 72, Si = 10, Ci = 3;
5586
+ function wi(e, t, n) {
5581
5587
  let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
5582
- Nn(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? Ti(e, t, n, r, i) : wi(e, t, n, r, i);
5588
+ Nn(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? Ei(e, t, n, r, i) : Ti(e, t, n, r, i);
5583
5589
  }
5584
- function wi(e, t, n, r, i) {
5590
+ function Ti(e, t, n, r, i) {
5585
5591
  let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
5586
5592
  e.save();
5587
5593
  let d = e.createLinearGradient(0, u, 0, o + c);
5588
5594
  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();
5589
- let f = ki(t);
5590
- Di(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)", Ei(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
5595
+ let f = Ai(t);
5596
+ Oi(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)", Di(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
5591
5597
  }
5592
- function Ti(e, t, n, r, i) {
5593
- let a = Oi(t.rect);
5594
- e.save(), Ai(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)", Ei(e, n.currentTime, r, a.x + yi, a.y + a.h / 2, "middle"), e.restore(), Di(e, ki(t), i, r > 0);
5598
+ function Ei(e, t, n, r, i) {
5599
+ let a = ki(t.rect);
5600
+ e.save(), ji(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)", Di(e, n.currentTime, r, a.x + bi, a.y + a.h / 2, "middle"), e.restore(), Oi(e, Ai(t), i, r > 0);
5595
5601
  }
5596
- function Ei(e, t, n, r, i, a) {
5597
- let o = ji(t), s = ji(n), c = pi(e), l = mi(e, o, c), u = mi(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
5598
- hi(e, o, r + f - l, i, c);
5602
+ function Di(e, t, n, r, i, a) {
5603
+ let o = Mi(t), s = Mi(n), c = mi(e), l = hi(e, o, c), u = hi(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
5604
+ gi(e, o, r + f - l, i, c);
5599
5605
  let p = e.textAlign;
5600
- e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, hi(e, s, r + f + d, i, c);
5606
+ e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, gi(e, s, r + f + d, i, c);
5601
5607
  }
5602
- function Di(e, t, n, r) {
5608
+ function Oi(e, t, n, r) {
5603
5609
  let i = t.h / 2;
5604
- if (e.save(), Ai(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (Ai(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
5610
+ if (e.save(), ji(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (ji(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
5605
5611
  let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
5606
5612
  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();
5607
5613
  }
5608
5614
  e.restore();
5609
5615
  }
5610
- function Oi(e) {
5616
+ function ki(e) {
5611
5617
  let t = Math.max(220, e.w - 24);
5612
5618
  return {
5613
5619
  x: e.x + e.w / 2 - t / 2,
5614
- y: e.y + e.h - vi - 4,
5620
+ y: e.y + e.h - yi - 4,
5615
5621
  w: t,
5616
- h: vi
5622
+ h: yi
5617
5623
  };
5618
5624
  }
5619
- function ki(e) {
5625
+ function Ai(e) {
5620
5626
  if (e.el.mediaKind === "audio") {
5621
- let t = Oi(e.rect), n = t.x + yi + bi + xi, r = Math.max(40, t.x + t.w - yi - n);
5627
+ let t = ki(e.rect), n = t.x + bi + xi + Si, r = Math.max(40, t.x + t.w - bi - n);
5622
5628
  return {
5623
5629
  x: n,
5624
- y: t.y + (t.h - Si) / 2,
5630
+ y: t.y + (t.h - Ci) / 2,
5625
5631
  w: r,
5626
- h: Si
5632
+ h: Ci
5627
5633
  };
5628
5634
  }
5629
5635
  let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
5630
5636
  return {
5631
5637
  x: t.x + n,
5632
- y: t.y + t.h - Si - r,
5638
+ y: t.y + t.h - Ci - r,
5633
5639
  w: t.w - n * 2,
5634
- h: Si
5640
+ h: Ci
5635
5641
  };
5636
5642
  }
5637
- function Ai(e, t, n, r, i, a) {
5643
+ function ji(e, t, n, r, i, a) {
5638
5644
  let o = Math.min(a, i / 2, r / 2);
5639
5645
  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();
5640
5646
  }
5641
- function ji(e) {
5647
+ function Mi(e) {
5642
5648
  if (!Number.isFinite(e) || e < 0) return "0:00";
5643
5649
  let t = Math.floor(e);
5644
5650
  return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
5645
5651
  }
5646
5652
  //#endregion
5647
5653
  //#region packages/pptx/src/notes.ts
5648
- function Mi(e, t) {
5654
+ function Ni(e, t) {
5649
5655
  return !Number.isInteger(t) || t < 0 || t >= e.length ? null : e[t].notes ?? null;
5650
5656
  }
5651
5657
  //#endregion
5652
5658
  //#region packages/pptx/src/hidden.ts
5653
- function Ni(e, t) {
5659
+ function Pi(e, t) {
5654
5660
  return !Number.isInteger(t) || t < 0 || t >= e.length ? !1 : e[t].hidden ?? !1;
5655
5661
  }
5656
5662
  //#endregion
5657
5663
  //#region packages/pptx/src/slide-nav.ts
5658
- function Pi(e) {
5664
+ function Fi(e) {
5659
5665
  let t = /* @__PURE__ */ new Map();
5660
5666
  for (let n = 0; n < e.length; n++) {
5661
5667
  let r = e[n];
@@ -5663,44 +5669,44 @@ function Pi(e) {
5663
5669
  }
5664
5670
  return t;
5665
5671
  }
5666
- function Fi(e, t) {
5672
+ function Ii(e, t) {
5667
5673
  if (e === "") return;
5668
5674
  let n = Tn("ppt/slides", e);
5669
5675
  return t.get(n);
5670
5676
  }
5671
- function Ii(e, t, n) {
5677
+ function Li(e, t, n) {
5672
5678
  let r = En(e);
5673
- return r === null ? Fi(e, t) : Dn(r, n, t.size);
5679
+ return r === null ? Ii(e, t) : Dn(r, n, t.size);
5674
5680
  }
5675
5681
  //#endregion
5676
5682
  //#region packages/pptx/src/google-fonts.ts
5677
- var Li = {
5683
+ var Ri = {
5678
5684
  ...n,
5679
5685
  ...x
5680
5686
  };
5681
- function* Ri(e) {
5687
+ function* zi(e) {
5682
5688
  for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
5683
5689
  }
5684
- function* zi(e) {
5685
- for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* Ri(e.textBody);
5686
- else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* Ri(e.textBody);
5690
+ function* Bi(e) {
5691
+ for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* zi(e.textBody);
5692
+ else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* zi(e.textBody);
5687
5693
  else if (e.type === "chart") {
5688
5694
  e.chart.title && (yield e.chart.title);
5689
5695
  for (let t of e.chart.categories) yield t;
5690
5696
  for (let t of e.chart.series) t.name && (yield t.name);
5691
5697
  }
5692
5698
  }
5693
- function Bi(e) {
5699
+ function Vi(e) {
5694
5700
  let t = u(e.majorFont) ?? u(e.minorFont) ?? null;
5695
5701
  return [
5696
5702
  e.majorFont,
5697
5703
  e.minorFont,
5698
- ...Me(zi(e), t)
5704
+ ...Me(Bi(e), t)
5699
5705
  ];
5700
5706
  }
5701
5707
  //#endregion
5702
5708
  //#region packages/pptx/src/media-mime.ts
5703
- function Vi(e, t) {
5709
+ function Hi(e, t) {
5704
5710
  for (let n of e.slides) for (let e of n.elements) {
5705
5711
  if (e.type !== "media") continue;
5706
5712
  let n = e;
@@ -5711,11 +5717,11 @@ function Vi(e, t) {
5711
5717
  }
5712
5718
  //#endregion
5713
5719
  //#region packages/pptx/src/worker.ts?worker&inline
5714
- var Hi = "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)}};", Ui = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Hi], { type: "text/javascript;charset=utf-8" });
5715
- function Wi(e) {
5720
+ var Ui = "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)}};", Wi = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Ui], { type: "text/javascript;charset=utf-8" });
5721
+ function Gi(e) {
5716
5722
  let t;
5717
5723
  try {
5718
- if (t = Ui && (self.URL || self.webkitURL).createObjectURL(Ui), !t) throw "";
5724
+ if (t = Wi && (self.URL || self.webkitURL).createObjectURL(Wi), !t) throw "";
5719
5725
  let n = new Worker(t, {
5720
5726
  type: "module",
5721
5727
  name: e?.name
@@ -5724,7 +5730,7 @@ function Wi(e) {
5724
5730
  (self.URL || self.webkitURL).revokeObjectURL(t);
5725
5731
  }), n;
5726
5732
  } catch {
5727
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Hi), {
5733
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Ui), {
5728
5734
  type: "module",
5729
5735
  name: e?.name
5730
5736
  });
@@ -5732,7 +5738,7 @@ function Wi(e) {
5732
5738
  }
5733
5739
  //#endregion
5734
5740
  //#region packages/pptx/src/wasm/pptx_parser_bg.wasm?url
5735
- var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5741
+ var Ki = new URL("pptx_parser_bg.wasm", import.meta.url).href, qi = class e {
5736
5742
  _worker;
5737
5743
  _bridge;
5738
5744
  _mode = "main";
@@ -5749,7 +5755,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5749
5755
  correlate: (e) => e.id,
5750
5756
  toError: (e) => e.kind === "error" ? e.message : void 0
5751
5757
  });
5752
- let r = new URL(n ?? Gi, location.href).href;
5758
+ let r = new URL(n ?? Ki, location.href).href;
5753
5759
  this._bridge.post({
5754
5760
  kind: "init",
5755
5761
  wasmUrl: r
@@ -5765,8 +5771,8 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5765
5771
  i = await e.arrayBuffer();
5766
5772
  } else i = t;
5767
5773
  i = f(await _e(i, n.password));
5768
- let a = new e(r === "worker" ? (await import("./render-worker-host-DL_kkykF.js")).createRenderWorker() : new Wi(), r, n.wasmUrl);
5769
- 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 c(Bi(a._presentation), Li)), a;
5774
+ let a = new e(r === "worker" ? (await import("./render-worker-host-BzhGwe0I.js")).createRenderWorker() : new Gi(), r, n.wasmUrl);
5775
+ return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await c(Vi(a._presentation), Ri)), a;
5770
5776
  }
5771
5777
  async _parse(e, t, n = !1, r) {
5772
5778
  let i = await this._bridge.request((r) => this._mode === "worker" ? {
@@ -5800,22 +5806,22 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5800
5806
  return this._mode;
5801
5807
  }
5802
5808
  getNotes(e) {
5803
- return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Mi(this._presentation?.slides ?? [], e);
5809
+ return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Ni(this._presentation?.slides ?? [], e);
5804
5810
  }
5805
5811
  isHidden(e) {
5806
- return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Ni(this._presentation?.slides ?? [], e);
5812
+ return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Pi(this._presentation?.slides ?? [], e);
5807
5813
  }
5808
5814
  _partNames() {
5809
5815
  return this._meta ? this._meta.partNames : (this._presentation?.slides ?? []).map((e) => e.partName);
5810
5816
  }
5811
5817
  _partIndex() {
5812
- return this._slidePartIndex ||= Pi(this._partNames()), this._slidePartIndex;
5818
+ return this._slidePartIndex ||= Fi(this._partNames()), this._slidePartIndex;
5813
5819
  }
5814
5820
  getSlideIndexByPartName(e) {
5815
5821
  return this._partIndex().get(e);
5816
5822
  }
5817
5823
  resolveInternalTarget(e, t = 0) {
5818
- return Ii(e, this._partIndex(), t);
5824
+ return Li(e, this._partIndex(), t);
5819
5825
  }
5820
5826
  async renderSlide(e, t, n = {}) {
5821
5827
  if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
@@ -5823,7 +5829,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5823
5829
  let r = this._presentation.slides[t];
5824
5830
  if (!r) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
5825
5831
  let i = n.dpr ?? o(), a = n.width ?? ((p(e) ? e.offsetWidth : 0) || 960);
5826
- await ui(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
5832
+ await di(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
5827
5833
  width: a,
5828
5834
  dpr: i,
5829
5835
  defaultTextColor: this._presentation.defaultTextColor,
@@ -5892,7 +5898,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5892
5898
  return this._mediaCache.set(e, r), r;
5893
5899
  }
5894
5900
  _findMimeTypeForPath(e) {
5895
- return this._presentation ? Vi(this._presentation, e) : "";
5901
+ return this._presentation ? Hi(this._presentation, e) : "";
5896
5902
  }
5897
5903
  async getImage(e, t) {
5898
5904
  let n = this._imageCache.get(e);
@@ -5935,7 +5941,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5935
5941
  dim: n.dim,
5936
5942
  onTextRun: n.onTextRun
5937
5943
  });
5938
- return _i(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
5944
+ return vi(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
5939
5945
  width: i,
5940
5946
  dpr: r,
5941
5947
  slideWidthEmu: this.slideWidth,
@@ -5947,10 +5953,10 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5947
5953
  destroy() {
5948
5954
  this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (D(this._googleFontFaces), this._googleFontFaces = []), ie(this._fetchImage), Ke(this._fetchImage), B(this._fetchImage);
5949
5955
  }
5950
- }, qi = {
5956
+ }, Ji = {
5951
5957
  color: "#ffffff",
5952
5958
  opacity: .6
5953
- }, Ji = class {
5959
+ }, Yi = class {
5954
5960
  canvas;
5955
5961
  wrapper;
5956
5962
  _scale = null;
@@ -5978,7 +5984,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
5978
5984
  async load(e) {
5979
5985
  let t = ++this._loadGen, n = this.engine;
5980
5986
  try {
5981
- let r = await Ki.load(e, {
5987
+ let r = await qi.load(e, {
5982
5988
  useGoogleFonts: this.opts.useGoogleFonts,
5983
5989
  maxZipEntryBytes: this.opts.maxZipEntryBytes,
5984
5990
  workerTimeoutMs: this.opts.workerTimeoutMs,
@@ -6018,8 +6024,8 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6018
6024
  }
6019
6025
  _dim() {
6020
6026
  return {
6021
- color: this.opts.hiddenSlideDim?.color ?? qi.color,
6022
- opacity: this.opts.hiddenSlideDim?.opacity ?? qi.opacity
6027
+ color: this.opts.hiddenSlideDim?.color ?? Ji.color,
6028
+ opacity: this.opts.hiddenSlideDim?.opacity ?? Ji.opacity
6023
6029
  };
6024
6030
  }
6025
6031
  async setHiddenSlideMode(e) {
@@ -6196,7 +6202,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6196
6202
  } else this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
6197
6203
  this.canvas.style.display = this._originalDisplay, this.wrapper.remove();
6198
6204
  }
6199
- }, Yi = 150, Xi = "0 1px 3px rgba(0,0,0,0.2)", Zi = class {
6205
+ }, Xi = 150, Zi = "0 1px 3px rgba(0,0,0,0.2)", Qi = class {
6200
6206
  _pres = null;
6201
6207
  _injected;
6202
6208
  _opts;
@@ -6227,7 +6233,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6227
6233
  _pageShadow;
6228
6234
  constructor(e, t = {}) {
6229
6235
  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.");
6230
- if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Xi, this._injected = !!t.presentation, this._injected) {
6236
+ if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Zi, this._injected = !!t.presentation, this._injected) {
6231
6237
  let e = t.presentation;
6232
6238
  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.`);
6233
6239
  this._pres = e, this._mode = e.mode;
@@ -6245,7 +6251,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6245
6251
  if (this._injected) throw Error("PptxScrollViewer.load() is unsupported when an engine is injected via opts.presentation; the injected engine is already loaded.");
6246
6252
  let t = ++this._loadGen, n = this._pres;
6247
6253
  try {
6248
- let r = await Ki.load(e, {
6254
+ let r = await qi.load(e, {
6249
6255
  useGoogleFonts: this._opts.useGoogleFonts,
6250
6256
  maxZipEntryBytes: this._opts.maxZipEntryBytes,
6251
6257
  workerTimeoutMs: this._opts.workerTimeoutMs,
@@ -6518,7 +6524,7 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6518
6524
  _scheduleSettle() {
6519
6525
  this._settleTimer !== null && clearTimeout(this._settleTimer), this._settleTimer = setTimeout(() => {
6520
6526
  this._settleTimer = null, this._settleRender();
6521
- }, Yi);
6527
+ }, Xi);
6522
6528
  }
6523
6529
  _settleRender() {
6524
6530
  if (!(this._destroyed || !this._pres || this._pres.slideCount === 0)) for (let [e, t] of [...this._slots]) t.renderedScale !== this._scale && this._settleSlot(e, t);
@@ -6626,16 +6632,16 @@ var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
6626
6632
  for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
6627
6633
  this._free.length = 0, this._injected || this._pres?.destroy(), this._pres = null, this._wrapper.remove();
6628
6634
  }
6629
- }, Qi = /* @__PURE__ */ j({
6635
+ }, $i = /* @__PURE__ */ j({
6630
6636
  OoxmlError: () => M,
6631
- PptxPresentation: () => Ki,
6632
- PptxScrollViewer: () => Zi,
6633
- PptxViewer: () => Ji,
6637
+ PptxPresentation: () => qi,
6638
+ PptxScrollViewer: () => Qi,
6639
+ PptxViewer: () => Yi,
6634
6640
  autoResize: () => ee,
6635
6641
  buildPptxHighlightLayer: () => kn,
6636
6642
  buildPptxTextLayer: () => On,
6637
6643
  openExternalHyperlink: () => oe,
6638
- renderSlide: () => ui
6644
+ renderSlide: () => di
6639
6645
  });
6640
6646
  //#endregion
6641
- export { ui as a, Ki as i, Zi as n, kn as o, Ji as r, On as s, Qi as t };
6647
+ export { di as a, qi as i, Qi as n, kn as o, Yi as r, On as s, $i as t };
package/dist/pptx.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { Yt as e, gt as t, l as n } from "./find-cursor-DTrEBxjE.js";
2
- import { a as r, i, n as a, o, r as s, s as c } from "./pptx-BMxDfEYI.js";
1
+ import { Yt as e, gt as t, l as n } from "./find-cursor-DBifiZop.js";
2
+ import { a as r, i, n as a, o, r as s, s as c } from "./pptx-D3L4FQfI.js";
3
3
  export { e as OoxmlError, i as PptxPresentation, a as PptxScrollViewer, s as PptxViewer, t as autoResize, o as buildPptxHighlightLayer, c as buildPptxTextLayer, n as openExternalHyperlink, r as renderSlide };
Binary file