@mxmweb/fviewer 1.1.15 → 1.1.16

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.
Files changed (3) hide show
  1. package/index.js +771 -769
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  var mm = Object.defineProperty;
2
- var K0 = (e) => {
2
+ var X0 = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
5
  var vm = (e, t, n) => t in e ? mm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var Yg = (e, t, n) => vm(e, typeof t != "symbol" ? t + "" : t, n), _0 = (e, t, n) => t.has(e) || K0("Cannot " + n);
7
- var Gr = (e, t, n) => (_0(e, t, "read from private field"), n ? n.call(e) : t.get(e)), bl = (e, t, n) => t.has(e) ? K0("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Cl = (e, t, n, r) => (_0(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), gl = (e, t, n) => (_0(e, t, "access private method"), n);
6
+ var Yg = (e, t, n) => vm(e, typeof t != "symbol" ? t + "" : t, n), _0 = (e, t, n) => t.has(e) || X0("Cannot " + n);
7
+ var Gr = (e, t, n) => (_0(e, t, "read from private field"), n ? n.call(e) : t.get(e)), bl = (e, t, n) => t.has(e) ? X0("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Cl = (e, t, n, r) => (_0(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), gl = (e, t, n) => (_0(e, t, "access private method"), n);
8
8
  var k0 = (e, t, n, r) => ({
9
9
  set _(s) {
10
10
  Cl(e, t, s, n);
@@ -1017,17 +1017,17 @@ function it$1(e, t, n) {
1017
1017
  var pe = new Qe$1(n, de, r ? s.componentStyle : void 0);
1018
1018
  function st(Le, N) {
1019
1019
  return function(P, p, Dt) {
1020
- var Lt = P.attrs, Zn = P.componentStyle, ln = P.defaultProps, qs = P.foldedComponentIds, ki = P.styledComponentId, As = P.target, Ur = React.useContext(et), Br = Ge$1(), Ar = P.shouldForwardProp || Br.shouldForwardProp, Is = I(p, Ur, ln) || C$1, Pi = function(Xn, It, Kn) {
1021
- for (var Gn, me = __assign(__assign({}, It), { className: void 0, theme: Kn }), kt = 0; kt < Xn.length; kt += 1) {
1022
- var St = re(Gn = Xn[kt]) ? Gn(me) : Gn;
1020
+ var Lt = P.attrs, Zn = P.componentStyle, ln = P.defaultProps, qs = P.foldedComponentIds, ki = P.styledComponentId, As = P.target, Ur = React.useContext(et), Br = Ge$1(), Ar = P.shouldForwardProp || Br.shouldForwardProp, Is = I(p, Ur, ln) || C$1, Pi = function(Gn, It, Xn) {
1021
+ for (var Kn, me = __assign(__assign({}, It), { className: void 0, theme: Xn }), kt = 0; kt < Gn.length; kt += 1) {
1022
+ var St = re(Kn = Gn[kt]) ? Kn(me) : Kn;
1023
1023
  for (var zt in St) me[zt] = zt === "className" ? ie(me[zt], St[zt]) : zt === "style" ? __assign(__assign({}, me[zt]), St[zt]) : St[zt];
1024
1024
  }
1025
1025
  return It.className && (me.className = ie(me.className, It.className)), me;
1026
1026
  }(Lt, p, Is), Oi = Pi.as || As, hl = {};
1027
1027
  for (var ur in Pi) Pi[ur] === void 0 || ur[0] === "$" || ur === "as" || ur === "theme" && Pi.theme === Is || (ur === "forwardedAs" ? hl.as = Pi.forwardedAs : Ar && !Ar(ur, Oi) || (hl[ur] = Pi[ur]));
1028
- var mt = function(Xn, It) {
1029
- var Kn = Ge$1(), Gn = Xn.generateAndInjectStyles(It, Kn.styleSheet, Kn.stylis);
1030
- return Gn;
1028
+ var mt = function(Gn, It) {
1029
+ var Xn = Ge$1(), Kn = Gn.generateAndInjectStyles(It, Xn.styleSheet, Xn.stylis);
1030
+ return Kn;
1031
1031
  }(Zn, Pi), ot = ie(qs, ki);
1032
1032
  return mt && (ot += " " + mt), Pi.className && (ot += " " + Pi.className), hl[L$1(Oi) && !A$1.has(Oi) ? "class" : "className"] = ot, Dt && (hl.ref = Dt), createElement(Oi, hl);
1033
1033
  }(nt, Le, N);
@@ -2163,16 +2163,16 @@ var Yl = (e, t, n) => {
2163
2163
  if (t != null && ot != null)
2164
2164
  t[mt] = ot;
2165
2165
  else {
2166
- var Xn = void 0, It = void 0;
2167
- for (var [Kn, Gn] of L.texts(e))
2168
- if (C.compare(Gn, Pi) === -1)
2169
- Xn = [Kn, Gn];
2166
+ var Gn = void 0, It = void 0;
2167
+ for (var [Xn, Kn] of L.texts(e))
2168
+ if (C.compare(Kn, Pi) === -1)
2169
+ Gn = [Xn, Kn];
2170
2170
  else {
2171
- It = [Kn, Gn];
2171
+ It = [Xn, Kn];
2172
2172
  break;
2173
2173
  }
2174
2174
  var me = !1;
2175
- Xn && It && (C.equals(It[1], Pi) ? me = !C.hasPrevious(It[1]) : me = C.common(Xn[1], Pi).length < C.common(It[1], Pi).length), Xn && !me ? (ur.path = Xn[1], ur.offset = Xn[0].text.length) : It ? (ur.path = It[1], ur.offset = 0) : t = null;
2175
+ Gn && It && (C.equals(It[1], Pi) ? me = !C.hasPrevious(It[1]) : me = C.common(Gn[1], Pi).length < C.common(It[1], Pi).length), Gn && !me ? (ur.path = Gn[1], ur.offset = Gn[0].text.length) : It ? (ur.path = It[1], ur.offset = 0) : t = null;
2176
2176
  }
2177
2177
  }
2178
2178
  break;
@@ -2211,45 +2211,45 @@ var Yl = (e, t, n) => {
2211
2211
  }
2212
2212
  case "set_selection": {
2213
2213
  var {
2214
- newProperties: Fl
2214
+ newProperties: wl
2215
2215
  } = n;
2216
- if (Fl == null)
2217
- t = Fl;
2216
+ if (wl == null)
2217
+ t = wl;
2218
2218
  else {
2219
2219
  if (t == null) {
2220
- if (!A.isRange(Fl))
2221
- throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(ze.stringify(Fl), " when there is no current selection."));
2222
- t = Or({}, Fl);
2220
+ if (!A.isRange(wl))
2221
+ throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(ze.stringify(wl), " when there is no current selection."));
2222
+ t = Or({}, wl);
2223
2223
  }
2224
- for (var Al in Fl) {
2225
- var Dl = Fl[Al];
2226
- if (Dl == null) {
2227
- if (Al === "anchor" || Al === "focus")
2228
- throw new Error('Cannot remove the "'.concat(Al, '" selection property'));
2229
- delete t[Al];
2224
+ for (var Dl in wl) {
2225
+ var Fl = wl[Dl];
2226
+ if (Fl == null) {
2227
+ if (Dl === "anchor" || Dl === "focus")
2228
+ throw new Error('Cannot remove the "'.concat(Dl, '" selection property'));
2229
+ delete t[Dl];
2230
2230
  } else
2231
- t[Al] = Dl;
2231
+ t[Dl] = Fl;
2232
2232
  }
2233
2233
  }
2234
2234
  break;
2235
2235
  }
2236
2236
  case "split_node": {
2237
2237
  var {
2238
- path: xl,
2238
+ path: Bl,
2239
2239
  position: Pl,
2240
2240
  properties: Ol
2241
2241
  } = n;
2242
- if (xl.length === 0)
2243
- throw new Error('Cannot apply a "split_node" operation at path ['.concat(xl, "] because the root node cannot be split."));
2244
- var Rl = L.get(e, xl), fg = L.parent(e, xl), cg = xl[xl.length - 1], lg;
2242
+ if (Bl.length === 0)
2243
+ throw new Error('Cannot apply a "split_node" operation at path ['.concat(Bl, "] because the root node cannot be split."));
2244
+ var Rl = L.get(e, Bl), fg = L.parent(e, Bl), cg = Bl[Bl.length - 1], lg;
2245
2245
  if (U.isText(Rl)) {
2246
- var s0 = Rl.text.slice(0, Pl), i0 = Rl.text.slice(Pl);
2246
+ var s0 = Rl.text.slice(0, Pl), o0 = Rl.text.slice(Pl);
2247
2247
  Rl.text = s0, lg = Or(Or({}, Ol), {}, {
2248
- text: i0
2248
+ text: o0
2249
2249
  });
2250
2250
  } else {
2251
- var o0 = Rl.children.slice(0, Pl), pl = Rl.children.slice(Pl);
2252
- Rl.children = o0, lg = Or(Or({}, Ol), {}, {
2251
+ var a0 = Rl.children.slice(0, Pl), pl = Rl.children.slice(Pl);
2252
+ Rl.children = a0, lg = Or(Or({}, Ol), {}, {
2253
2253
  children: pl
2254
2254
  });
2255
2255
  }
@@ -4502,13 +4502,13 @@ var If = (e, t) => {
4502
4502
  at: Un,
4503
4503
  voids: c
4504
4504
  })), !Dt) {
4505
- var Xn = Is.current, [It] = d.leaf(e, Xn), {
4506
- path: Kn
4507
- } = Xn, Gn = P ? pe.offset : 0, me = It.text.slice(Gn, st.offset);
4505
+ var Gn = Is.current, [It] = d.leaf(e, Gn), {
4506
+ path: Xn
4507
+ } = Gn, Kn = P ? pe.offset : 0, me = It.text.slice(Kn, st.offset);
4508
4508
  me.length > 0 && (e.apply({
4509
4509
  type: "remove_text",
4510
- path: Kn,
4511
- offset: Gn,
4510
+ path: Xn,
4511
+ offset: Kn,
4512
4512
  text: me
4513
4513
  }), Pi = me);
4514
4514
  }
@@ -4578,8 +4578,8 @@ var If = (e, t) => {
4578
4578
  }, []), [, N] = L.last({
4579
4579
  children: t
4580
4580
  }, []), P = [], p = (ot) => {
4581
- var [Xn, It] = ot, Kn = It.length === 0;
4582
- return Kn ? !1 : pe ? !0 : !(st && C.isAncestor(It, Le) && K.isElement(Xn) && !e.isVoid(Xn) && !e.isInline(Xn) || nt && C.isAncestor(It, N) && K.isElement(Xn) && !e.isVoid(Xn) && !e.isInline(Xn));
4581
+ var [Gn, It] = ot, Xn = It.length === 0;
4582
+ return Xn ? !1 : pe ? !0 : !(st && C.isAncestor(It, Le) && K.isElement(Gn) && !e.isVoid(Gn) && !e.isInline(Gn) || nt && C.isAncestor(It, N) && K.isElement(Gn) && !e.isVoid(Gn) && !e.isInline(Gn));
4583
4583
  };
4584
4584
  for (var Dt of L.nodes({
4585
4585
  children: t
@@ -6025,12 +6025,12 @@ const Od = /* @__PURE__ */ Qa(Fd), zu = (e) => typeof e == "object" && e != null
6025
6025
  for (let Br = 0; Br < Ye.length; Br++) {
6026
6026
  const Ar = Ye[Br], { height: Is, width: Pi, top: Oi, right: hl, bottom: ur, left: mt } = Ar.getBoundingClientRect();
6027
6027
  if (a === "if-needed" && N >= 0 && Dt >= 0 && p <= o && P <= u && (Ar === de && !Jr(Ar) || N >= Oi && p <= ur && Dt >= mt && P <= hl)) return Ur;
6028
- const ot = getComputedStyle(Ar), Xn = parseInt(ot.borderLeftWidth, 10), It = parseInt(ot.borderTopWidth, 10), Kn = parseInt(ot.borderRightWidth, 10), Gn = parseInt(ot.borderBottomWidth, 10);
6028
+ const ot = getComputedStyle(Ar), Gn = parseInt(ot.borderLeftWidth, 10), It = parseInt(ot.borderTopWidth, 10), Xn = parseInt(ot.borderRightWidth, 10), Kn = parseInt(ot.borderBottomWidth, 10);
6029
6029
  let me = 0, kt = 0;
6030
- const St = "offsetWidth" in Ar ? Ar.offsetWidth - Ar.clientWidth - Xn - Kn : 0, zt = "offsetHeight" in Ar ? Ar.offsetHeight - Ar.clientHeight - It - Gn : 0, Un = "offsetWidth" in Ar ? Ar.offsetWidth === 0 ? 0 : Pi / Ar.offsetWidth : 0, nr = "offsetHeight" in Ar ? Ar.offsetHeight === 0 ? 0 : Is / Ar.offsetHeight : 0;
6031
- if (de === Ar) me = c === "start" ? ki : c === "end" ? ki - o : c === "nearest" ? Qr(st, st + o, o, It, Gn, st + ki, st + ki + nt, nt) : ki - o / 2, kt = h === "start" ? As : h === "center" ? As - u / 2 : h === "end" ? As - u : Qr(pe, pe + u, u, Xn, Kn, pe + As, pe + As + Le, Le), me = Math.max(0, me + st), kt = Math.max(0, kt + pe);
6030
+ const St = "offsetWidth" in Ar ? Ar.offsetWidth - Ar.clientWidth - Gn - Xn : 0, zt = "offsetHeight" in Ar ? Ar.offsetHeight - Ar.clientHeight - It - Kn : 0, Un = "offsetWidth" in Ar ? Ar.offsetWidth === 0 ? 0 : Pi / Ar.offsetWidth : 0, nr = "offsetHeight" in Ar ? Ar.offsetHeight === 0 ? 0 : Is / Ar.offsetHeight : 0;
6031
+ if (de === Ar) me = c === "start" ? ki : c === "end" ? ki - o : c === "nearest" ? Qr(st, st + o, o, It, Kn, st + ki, st + ki + nt, nt) : ki - o / 2, kt = h === "start" ? As : h === "center" ? As - u / 2 : h === "end" ? As - u : Qr(pe, pe + u, u, Gn, Xn, pe + As, pe + As + Le, Le), me = Math.max(0, me + st), kt = Math.max(0, kt + pe);
6032
6032
  else {
6033
- me = c === "start" ? ki - Oi - It : c === "end" ? ki - ur + Gn + zt : c === "nearest" ? Qr(Oi, ur, Is, It, Gn + zt, ki, ki + nt, nt) : ki - (Oi + Is / 2) + zt / 2, kt = h === "start" ? As - mt - Xn : h === "center" ? As - (mt + Pi / 2) + St / 2 : h === "end" ? As - hl + Kn + St : Qr(mt, hl, Pi, Xn, Kn + St, As, As + Le, Le);
6033
+ me = c === "start" ? ki - Oi - It : c === "end" ? ki - ur + Kn + zt : c === "nearest" ? Qr(Oi, ur, Is, It, Kn + zt, ki, ki + nt, nt) : ki - (Oi + Is / 2) + zt / 2, kt = h === "start" ? As - mt - Gn : h === "center" ? As - (mt + Pi / 2) + St / 2 : h === "end" ? As - hl + Xn + St : Qr(mt, hl, Pi, Gn, Xn + St, As, As + Le, Le);
6034
6034
  const { scrollLeft: Yn, scrollTop: un } = Ar;
6035
6035
  me = nr === 0 ? 0 : Math.max(0, Math.min(un + me / nr, Ar.scrollHeight - Is / nr + zt)), kt = Un === 0 ? 0 : Math.max(0, Math.min(Yn + kt / Un, Ar.scrollWidth - Pi / Un + St)), ki += un - me, As += Yn - kt;
6036
6036
  }
@@ -7386,11 +7386,11 @@ function Ph(e) {
7386
7386
  });
7387
7387
  }
7388
7388
  }
7389
- var Xn = As.endsWith("Backward") ? "backward" : "forward", [It, Kn] = A.edges(Ur), [Gn, me] = d.leaf(t, It.path), kt = {
7389
+ var Gn = As.endsWith("Backward") ? "backward" : "forward", [It, Xn] = A.edges(Ur), [Kn, me] = d.leaf(t, It.path), kt = {
7390
7390
  text: "",
7391
7391
  start: It.offset,
7392
- end: Kn.offset
7393
- }, St = Ze.get(t), zt = St == null ? void 0 : St.find((xl) => C.equals(xl.path, me)), Un = zt ? [zt.diff, kt] : [kt], nr = bo(Gn.text, ...Un);
7392
+ end: Xn.offset
7393
+ }, St = Ze.get(t), zt = St == null ? void 0 : St.find((Bl) => C.equals(Bl.path, me)), Un = zt ? [zt.diff, kt] : [kt], nr = bo(Kn.text, ...Un);
7394
7394
  if (nr.length === 0 && (Oi = !1), A.isExpanded(Ur)) {
7395
7395
  if (Oi && C.equals(Ur.anchor.path, Ur.focus.path)) {
7396
7396
  var Yn = {
@@ -7399,12 +7399,12 @@ function Ph(e) {
7399
7399
  }, un = d.range(t, Yn, Yn);
7400
7400
  return p(un), o(Ur.anchor.path, {
7401
7401
  text: "",
7402
- end: Kn.offset,
7402
+ end: Xn.offset,
7403
7403
  start: It.offset
7404
7404
  });
7405
7405
  }
7406
7406
  return pe(() => d.deleteFragment(t, {
7407
- direction: Xn
7407
+ direction: Gn
7408
7408
  }), {
7409
7409
  at: Ur
7410
7410
  });
@@ -7517,28 +7517,28 @@ function Ph(e) {
7517
7517
  if (gt.get(t) && (Ha = Ha.replace("\uFEFF", "")), As === "insertText" && /.*\n.*\n$/.test(Ha) && (Ha = Ha.slice(0, -1)), Ha.includes(`
7518
7518
  `))
7519
7519
  return pe(() => {
7520
- var xl = Ha.split(`
7520
+ var Bl = Ha.split(`
7521
7521
  `);
7522
- xl.forEach((Pl, Ol) => {
7523
- Pl && d.insertText(t, Pl), Ol !== xl.length - 1 && d.insertSoftBreak(t);
7522
+ Bl.forEach((Pl, Ol) => {
7523
+ Pl && d.insertText(t, Pl), Ol !== Bl.length - 1 && d.insertSoftBreak(t);
7524
7524
  });
7525
7525
  }, {
7526
7526
  at: Ur
7527
7527
  });
7528
7528
  if (C.equals(Ur.anchor.path, Ur.focus.path)) {
7529
- var [ml, dl] = A.edges(Ur), Fl = {
7529
+ var [ml, dl] = A.edges(Ur), wl = {
7530
7530
  start: ml.offset,
7531
7531
  end: dl.offset,
7532
7532
  text: Ha
7533
7533
  };
7534
7534
  if (Ha && l && As === "insertCompositionText") {
7535
- var Al = l.start + l.text.search(/\S|$/), Dl = Fl.start + Fl.text.search(/\S|$/);
7536
- Dl === Al + 1 && Fl.end === l.start + l.text.length ? (Fl.start -= 1, l = null, Zn()) : l = !1;
7537
- } else As === "insertText" ? l === null ? l = Fl : l && A.isCollapsed(Ur) && l.end + l.text.length === ml.offset ? l = nn(nn({}, l), {}, {
7535
+ var Dl = l.start + l.text.search(/\S|$/), Fl = wl.start + wl.text.search(/\S|$/);
7536
+ Fl === Dl + 1 && wl.end === l.start + l.text.length ? (wl.start -= 1, l = null, Zn()) : l = !1;
7537
+ } else As === "insertText" ? l === null ? l = wl : l && A.isCollapsed(Ur) && l.end + l.text.length === ml.offset ? l = nn(nn({}, l), {}, {
7538
7538
  text: l.text + Ha
7539
7539
  }) : l = !1 : l = !1;
7540
7540
  if (Oi) {
7541
- o(ml.path, Fl);
7541
+ o(ml.path, wl);
7542
7542
  return;
7543
7543
  }
7544
7544
  }
@@ -8192,11 +8192,11 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8192
8192
  ki();
8193
8193
  return;
8194
8194
  }
8195
- var It = F.toDOMNode(o, o), Kn = It.getRootNode();
8196
- if (!p.current && qt && Kn instanceof ShadowRoot) {
8195
+ var It = F.toDOMNode(o, o), Xn = It.getRootNode();
8196
+ if (!p.current && qt && Xn instanceof ShadowRoot) {
8197
8197
  p.current = !0;
8198
- var Gn = mh();
8199
- Gn ? document.execCommand("indent") : j.deselect(o), p.current = !1;
8198
+ var Kn = mh();
8199
+ Kn ? document.execCommand("indent") : j.deselect(o), p.current = !1;
8200
8200
  return;
8201
8201
  }
8202
8202
  var me = qs.current;
@@ -8225,8 +8225,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8225
8225
  onDOMSelectionChange: ki,
8226
8226
  scheduleOnDOMSelectionChange: As
8227
8227
  }), Vr(() => {
8228
- var It, Kn, Gn;
8229
- nt.current && (Gn = di(nt.current)) ? (ho.set(o, Gn), hn.set(o, nt.current), Gt.set(o, nt.current), Hr.set(nt.current, o)) : Gt.delete(o);
8228
+ var It, Xn, Kn;
8229
+ nt.current && (Kn = di(nt.current)) ? (ho.set(o, Kn), hn.set(o, nt.current), Gt.set(o, nt.current), Hr.set(nt.current, o)) : Gt.delete(o);
8230
8230
  var {
8231
8231
  selection: me
8232
8232
  } = o, kt = F.findDocumentOrShadowRoot(o), St = Nr(kt);
@@ -8249,8 +8249,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8249
8249
  suppressThrow: !0
8250
8250
  });
8251
8251
  if (dl && A.equals(dl, me)) {
8252
- var Fl;
8253
- if (!ln.hasMarkPlaceholder || (Fl = Si) !== null && Fl !== void 0 && (Fl = Fl.parentElement) !== null && Fl !== void 0 && Fl.hasAttribute("data-slate-mark-placeholder"))
8252
+ var wl;
8253
+ if (!ln.hasMarkPlaceholder || (wl = Si) !== null && wl !== void 0 && (wl = wl.parentElement) !== null && wl !== void 0 && wl.hasAttribute("data-slate-mark-placeholder"))
8254
8254
  return;
8255
8255
  }
8256
8256
  }
@@ -8262,12 +8262,12 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8262
8262
  return;
8263
8263
  }
8264
8264
  ln.isUpdatingSelection = !0;
8265
- var Al = me && F.toDOMRange(o, me);
8266
- return Al ? (F.isComposing(o) && !Ue ? St.collapseToEnd() : A.isBackward(me) ? St.setBaseAndExtent(Al.endContainer, Al.endOffset, Al.startContainer, Al.startOffset) : St.setBaseAndExtent(Al.startContainer, Al.startOffset, Al.endContainer, Al.endOffset), tt(o, Al)) : St.removeAllRanges(), Al;
8265
+ var Dl = me && F.toDOMRange(o, me);
8266
+ return Dl ? (F.isComposing(o) && !Ue ? St.collapseToEnd() : A.isBackward(me) ? St.setBaseAndExtent(Dl.endContainer, Dl.endOffset, Dl.startContainer, Dl.startOffset) : St.setBaseAndExtent(Dl.startContainer, Dl.startOffset, Dl.endContainer, Dl.endOffset), tt(o, Dl)) : St.removeAllRanges(), Dl;
8267
8267
  }
8268
8268
  };
8269
8269
  St.rangeCount <= 1 && zt();
8270
- var Un = ((Kn = qs.current) === null || Kn === void 0 ? void 0 : Kn.isFlushing()) === "action";
8270
+ var Un = ((Xn = qs.current) === null || Xn === void 0 ? void 0 : Xn.isFlushing()) === "action";
8271
8271
  if (!Ue || !Un) {
8272
8272
  setTimeout(() => {
8273
8273
  ln.isUpdatingSelection = !1;
@@ -8294,8 +8294,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8294
8294
  }
8295
8295
  });
8296
8296
  var Ur = useCallback((It) => {
8297
- var Kn = F.toDOMNode(o, o), Gn = Kn.getRootNode();
8298
- if (p != null && p.current && qt && Gn instanceof ShadowRoot) {
8297
+ var Xn = F.toDOMNode(o, o), Kn = Xn.getRootNode();
8298
+ if (p != null && p.current && qt && Kn instanceof ShadowRoot) {
8299
8299
  var me = It.getTargetRanges(), kt = me[0], St = new window.Range();
8300
8300
  St.setStart(kt.startContainer, kt.startOffset), St.setEnd(kt.endContainer, kt.endOffset);
8301
8301
  var zt = F.toSlateRange(o, St, {
@@ -8327,17 +8327,17 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8327
8327
  nr.anchor.offset !== 0 && (Ni = !0, o.marks && (Ni = !1), !fr.get(o))) {
8328
8328
  var Si, Ti, {
8329
8329
  anchor: ji
8330
- } = nr, [Ha, ml] = F.toDOMPoint(o, ji), dl = (Si = Ha.parentElement) === null || Si === void 0 ? void 0 : Si.closest("a"), Fl = F.getWindow(o);
8330
+ } = nr, [Ha, ml] = F.toDOMPoint(o, ji), dl = (Si = Ha.parentElement) === null || Si === void 0 ? void 0 : Si.closest("a"), wl = F.getWindow(o);
8331
8331
  if (Ni && dl && F.hasDOMNode(o, dl)) {
8332
- var Al, Dl = Fl == null ? void 0 : Fl.document.createTreeWalker(dl, NodeFilter.SHOW_TEXT).lastChild();
8333
- Dl === Ha && ((Al = Dl.textContent) === null || Al === void 0 ? void 0 : Al.length) === ml && (Ni = !1);
8332
+ var Dl, Fl = wl == null ? void 0 : wl.document.createTreeWalker(dl, NodeFilter.SHOW_TEXT).lastChild();
8333
+ Fl === Ha && ((Dl = Fl.textContent) === null || Dl === void 0 ? void 0 : Dl.length) === ml && (Ni = !1);
8334
8334
  }
8335
- if (Ni && Ha.parentElement && (Fl == null || (Ti = Fl.getComputedStyle(Ha.parentElement)) === null || Ti === void 0 ? void 0 : Ti.whiteSpace) === "pre") {
8336
- var xl = d.above(o, {
8335
+ if (Ni && Ha.parentElement && (wl == null || (Ti = wl.getComputedStyle(Ha.parentElement)) === null || Ti === void 0 ? void 0 : Ti.whiteSpace) === "pre") {
8336
+ var Bl = d.above(o, {
8337
8337
  at: ji.path,
8338
8338
  match: (lg) => K.isElement(lg) && d.isBlock(o, lg)
8339
8339
  });
8340
- xl && L.string(xl[0]).includes(" ") && (Ni = !1);
8340
+ Bl && L.string(Bl[0]).includes(" ") && (Ni = !1);
8341
8341
  }
8342
8342
  }
8343
8343
  if ((!Yn.startsWith("delete") || Yn.startsWith("deleteBy")) && !fr.get(o)) {
@@ -8449,17 +8449,17 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8449
8449
  Vr(() => {
8450
8450
  var It = F.getWindow(o);
8451
8451
  It.document.addEventListener("selectionchange", As);
8452
- var Kn = () => {
8452
+ var Xn = () => {
8453
8453
  ln.isDraggingInternally = !1;
8454
8454
  };
8455
- return It.document.addEventListener("dragend", Kn), It.document.addEventListener("drop", Kn), () => {
8456
- It.document.removeEventListener("selectionchange", As), It.document.removeEventListener("dragend", Kn), It.document.removeEventListener("drop", Kn);
8455
+ return It.document.addEventListener("dragend", Xn), It.document.addEventListener("drop", Xn), () => {
8456
+ It.document.removeEventListener("selectionchange", As), It.document.removeEventListener("dragend", Xn), It.document.removeEventListener("drop", Xn);
8457
8457
  };
8458
8458
  }, [As, ln]);
8459
8459
  var Ar = s([o, []]), Is = a && o.children.length === 1 && Array.from(L.texts(o)).length === 1 && L.string(o) === "" && !pe, Pi = useCallback((It) => {
8460
8460
  if (It && Is) {
8461
- var Kn;
8462
- P((Kn = It.getBoundingClientRect()) === null || Kn === void 0 ? void 0 : Kn.height);
8461
+ var Xn;
8462
+ P((Xn = It.getBoundingClientRect()) === null || Xn === void 0 ? void 0 : Xn.height);
8463
8463
  } else
8464
8464
  P(void 0);
8465
8465
  }, [Is]);
@@ -8484,10 +8484,10 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8484
8484
  loose: !0
8485
8485
  })) {
8486
8486
  ln.hasMarkPlaceholder = !0;
8487
- var Xn = Object.fromEntries(Object.keys(ot).map((It) => [It, null]));
8487
+ var Gn = Object.fromEntries(Object.keys(ot).map((It) => [It, null]));
8488
8488
  Ar.push(bt(bt(bt({
8489
8489
  [go]: !0
8490
- }, Xn), hl), {}, {
8490
+ }, Gn), hl), {}, {
8491
8491
  anchor: ur,
8492
8492
  focus: ur
8493
8493
  }));
@@ -8500,9 +8500,9 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8500
8500
  } = o;
8501
8501
  if (It) {
8502
8502
  var {
8503
- anchor: Kn
8504
- } = It, Gn = L.leaf(o, Kn.path);
8505
- if (hl && !U.equals(Gn, hl, {
8503
+ anchor: Xn
8504
+ } = It, Kn = L.leaf(o, Xn.path);
8505
+ if (hl && !U.equals(Kn, hl, {
8506
8506
  loose: !0
8507
8507
  })) {
8508
8508
  gt.set(o, hl);
@@ -8554,8 +8554,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8554
8554
  } : {})), de),
8555
8555
  onBeforeInput: useCallback((It) => {
8556
8556
  if (!Pt && !c && !Ve(It, u.onBeforeInput) && F.hasSelectableTarget(o, It.target) && (It.preventDefault(), !F.isComposing(o))) {
8557
- var Kn = It.data;
8558
- d.insertText(o, Kn);
8557
+ var Xn = It.data;
8558
+ d.insertText(o, Xn);
8559
8559
  }
8560
8560
  }, [u.onBeforeInput, o, c]),
8561
8561
  onInput: useCallback((It) => {
@@ -8564,15 +8564,15 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8564
8564
  qs.current.handleInput();
8565
8565
  return;
8566
8566
  }
8567
- for (var Kn of Le.current)
8568
- Kn();
8567
+ for (var Xn of Le.current)
8568
+ Xn();
8569
8569
  if (Le.current = [], !F.isFocused(o)) {
8570
- var Gn = It.nativeEvent, me = o;
8571
- if (Gn.inputType === "historyUndo" && typeof me.undo == "function") {
8570
+ var Kn = It.nativeEvent, me = o;
8571
+ if (Kn.inputType === "historyUndo" && typeof me.undo == "function") {
8572
8572
  me.undo();
8573
8573
  return;
8574
8574
  }
8575
- if (Gn.inputType === "historyRedo" && typeof me.redo == "function") {
8575
+ if (Kn.inputType === "historyRedo" && typeof me.redo == "function") {
8576
8576
  me.redo();
8577
8577
  return;
8578
8578
  }
@@ -8581,19 +8581,19 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8581
8581
  }, [u.onInput, o]),
8582
8582
  onBlur: useCallback((It) => {
8583
8583
  if (!(c || ln.isUpdatingSelection || !F.hasSelectableTarget(o, It.target) || Ve(It, u.onBlur))) {
8584
- var Kn = F.findDocumentOrShadowRoot(o);
8585
- if (ln.latestElement !== Kn.activeElement) {
8584
+ var Xn = F.findDocumentOrShadowRoot(o);
8585
+ if (ln.latestElement !== Xn.activeElement) {
8586
8586
  var {
8587
- relatedTarget: Gn
8587
+ relatedTarget: Kn
8588
8588
  } = It, me = F.toDOMNode(o, o);
8589
- if (Gn !== me && !(ct(Gn) && Gn.hasAttribute("data-slate-spacer"))) {
8590
- if (Gn != null && Nt(Gn) && F.hasDOMNode(o, Gn)) {
8591
- var kt = F.toSlateNode(o, Gn);
8589
+ if (Kn !== me && !(ct(Kn) && Kn.hasAttribute("data-slate-spacer"))) {
8590
+ if (Kn != null && Nt(Kn) && F.hasDOMNode(o, Kn)) {
8591
+ var kt = F.toSlateNode(o, Kn);
8592
8592
  if (K.isElement(kt) && !o.isVoid(kt))
8593
8593
  return;
8594
8594
  }
8595
8595
  if (qt) {
8596
- var St = Nr(Kn);
8596
+ var St = Nr(Xn);
8597
8597
  St == null || St.removeAllRanges();
8598
8598
  }
8599
8599
  $t.delete(o);
@@ -8603,17 +8603,17 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8603
8603
  }, [c, ln.isUpdatingSelection, ln.latestElement, o, u.onBlur]),
8604
8604
  onClick: useCallback((It) => {
8605
8605
  if (F.hasTarget(o, It.target) && !Ve(It, u.onClick) && Nt(It.target)) {
8606
- var Kn = F.toSlateNode(o, It.target), Gn = F.findPath(o, Kn);
8607
- if (!d.hasPath(o, Gn) || L.get(o, Gn) !== Kn)
8606
+ var Xn = F.toSlateNode(o, It.target), Kn = F.findPath(o, Xn);
8607
+ if (!d.hasPath(o, Kn) || L.get(o, Kn) !== Xn)
8608
8608
  return;
8609
- if (It.detail === up && Gn.length >= 1) {
8610
- var me = Gn;
8611
- if (!(K.isElement(Kn) && d.isBlock(o, Kn))) {
8609
+ if (It.detail === up && Kn.length >= 1) {
8610
+ var me = Kn;
8611
+ if (!(K.isElement(Xn) && d.isBlock(o, Xn))) {
8612
8612
  var kt, St = d.above(o, {
8613
8613
  match: (Ni) => K.isElement(Ni) && d.isBlock(o, Ni),
8614
- at: Gn
8614
+ at: Kn
8615
8615
  });
8616
- me = (kt = St == null ? void 0 : St[1]) !== null && kt !== void 0 ? kt : Gn.slice(0, 1);
8616
+ me = (kt = St == null ? void 0 : St[1]) !== null && kt !== void 0 ? kt : Kn.slice(0, 1);
8617
8617
  }
8618
8618
  var zt = d.range(o, me);
8619
8619
  j.select(o, zt);
@@ -8621,7 +8621,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8621
8621
  }
8622
8622
  if (c)
8623
8623
  return;
8624
- var Un = d.start(o, Gn), nr = d.end(o, Gn), Yn = d.void(o, {
8624
+ var Un = d.start(o, Kn), nr = d.end(o, Kn), Yn = d.void(o, {
8625
8625
  at: Un
8626
8626
  }), un = d.void(o, {
8627
8627
  at: nr
@@ -8634,14 +8634,14 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8634
8634
  }, [o, u.onClick, c]),
8635
8635
  onCompositionEnd: useCallback((It) => {
8636
8636
  if (F.hasSelectableTarget(o, It.target)) {
8637
- var Kn;
8637
+ var Xn;
8638
8638
  if (F.isComposing(o) && Promise.resolve().then(() => {
8639
8639
  st(!1), Ht.set(o, !1);
8640
- }), (Kn = qs.current) === null || Kn === void 0 || Kn.handleCompositionEnd(It), Ve(It, u.onCompositionEnd) || Ue)
8640
+ }), (Xn = qs.current) === null || Xn === void 0 || Xn.handleCompositionEnd(It), Ve(It, u.onCompositionEnd) || Ue)
8641
8641
  return;
8642
8642
  if (!qt && !uh && !co && !oh && !sh && It.data) {
8643
- var Gn = gt.get(o);
8644
- gt.delete(o), Gn !== void 0 && (At.set(o, o.marks), o.marks = Gn), d.insertText(o, It.data);
8643
+ var Kn = gt.get(o);
8644
+ gt.delete(o), Kn !== void 0 && (At.set(o, o.marks), o.marks = Kn), d.insertText(o, It.data);
8645
8645
  var me = At.get(o);
8646
8646
  At.delete(o), me !== void 0 && (o.marks = me);
8647
8647
  }
@@ -8652,14 +8652,14 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8652
8652
  }, [u.onCompositionUpdate, o]),
8653
8653
  onCompositionStart: useCallback((It) => {
8654
8654
  if (F.hasSelectableTarget(o, It.target)) {
8655
- var Kn;
8656
- if ((Kn = qs.current) === null || Kn === void 0 || Kn.handleCompositionStart(It), Ve(It, u.onCompositionStart) || Ue)
8655
+ var Xn;
8656
+ if ((Xn = qs.current) === null || Xn === void 0 || Xn.handleCompositionStart(It), Ve(It, u.onCompositionStart) || Ue)
8657
8657
  return;
8658
8658
  st(!0);
8659
8659
  var {
8660
- selection: Gn
8660
+ selection: Kn
8661
8661
  } = o;
8662
- if (Gn && A.isExpanded(Gn)) {
8662
+ if (Kn && A.isExpanded(Kn)) {
8663
8663
  d.deleteFragment(o);
8664
8664
  return;
8665
8665
  }
@@ -8672,31 +8672,31 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8672
8672
  if (!c && F.hasSelectableTarget(o, It.target) && !Ve(It, u.onCut) && !fs(It)) {
8673
8673
  It.preventDefault(), F.setFragmentData(o, It.clipboardData, "cut");
8674
8674
  var {
8675
- selection: Kn
8675
+ selection: Xn
8676
8676
  } = o;
8677
- if (Kn)
8678
- if (A.isExpanded(Kn))
8677
+ if (Xn)
8678
+ if (A.isExpanded(Xn))
8679
8679
  d.deleteFragment(o);
8680
8680
  else {
8681
- var Gn = L.parent(o, Kn.anchor.path);
8682
- d.isVoid(o, Gn) && j.delete(o);
8681
+ var Kn = L.parent(o, Xn.anchor.path);
8682
+ d.isVoid(o, Kn) && j.delete(o);
8683
8683
  }
8684
8684
  }
8685
8685
  }, [c, o, u.onCut]),
8686
8686
  onDragOver: useCallback((It) => {
8687
8687
  if (F.hasTarget(o, It.target) && !Ve(It, u.onDragOver)) {
8688
- var Kn = F.toSlateNode(o, It.target);
8689
- K.isElement(Kn) && d.isVoid(o, Kn) && It.preventDefault();
8688
+ var Xn = F.toSlateNode(o, It.target);
8689
+ K.isElement(Xn) && d.isVoid(o, Xn) && It.preventDefault();
8690
8690
  }
8691
8691
  }, [u.onDragOver, o]),
8692
8692
  onDragStart: useCallback((It) => {
8693
8693
  if (!c && F.hasTarget(o, It.target) && !Ve(It, u.onDragStart)) {
8694
- var Kn = F.toSlateNode(o, It.target), Gn = F.findPath(o, Kn), me = K.isElement(Kn) && d.isVoid(o, Kn) || d.void(o, {
8695
- at: Gn,
8694
+ var Xn = F.toSlateNode(o, It.target), Kn = F.findPath(o, Xn), me = K.isElement(Xn) && d.isVoid(o, Xn) || d.void(o, {
8695
+ at: Kn,
8696
8696
  voids: !0
8697
8697
  });
8698
8698
  if (me) {
8699
- var kt = d.range(o, Gn);
8699
+ var kt = d.range(o, Kn);
8700
8700
  j.select(o, kt);
8701
8701
  }
8702
8702
  ln.isDraggingInternally = !0, F.setFragmentData(o, It.dataTransfer, "drag");
@@ -8705,12 +8705,12 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8705
8705
  onDrop: useCallback((It) => {
8706
8706
  if (!c && F.hasTarget(o, It.target) && !Ve(It, u.onDrop)) {
8707
8707
  It.preventDefault();
8708
- var Kn = o.selection, Gn = F.findEventRange(o, It), me = It.dataTransfer;
8709
- j.select(o, Gn), ln.isDraggingInternally && Kn && !A.equals(Kn, Gn) && !d.void(o, {
8710
- at: Gn,
8708
+ var Xn = o.selection, Kn = F.findEventRange(o, It), me = It.dataTransfer;
8709
+ j.select(o, Kn), ln.isDraggingInternally && Xn && !A.equals(Xn, Kn) && !d.void(o, {
8710
+ at: Kn,
8711
8711
  voids: !0
8712
8712
  }) && j.delete(o, {
8713
- at: Kn
8713
+ at: Xn
8714
8714
  }), F.insertData(o, me), F.isFocused(o) || F.focus(o);
8715
8715
  }
8716
8716
  }, [c, o, u.onDrop, ln]),
@@ -8719,9 +8719,9 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8719
8719
  }, [c, ln, u, o]),
8720
8720
  onFocus: useCallback((It) => {
8721
8721
  if (!c && !ln.isUpdatingSelection && F.hasEditableTarget(o, It.target) && !Ve(It, u.onFocus)) {
8722
- var Kn = F.toDOMNode(o, o), Gn = F.findDocumentOrShadowRoot(o);
8723
- if (ln.latestElement = Gn.activeElement, lr && It.target !== Kn) {
8724
- Kn.focus();
8722
+ var Xn = F.toDOMNode(o, o), Kn = F.findDocumentOrShadowRoot(o);
8723
+ if (ln.latestElement = Kn.activeElement, lr && It.target !== Xn) {
8724
+ Xn.focus();
8725
8725
  return;
8726
8726
  }
8727
8727
  $t.set(o, !0);
@@ -8729,42 +8729,42 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8729
8729
  }, [c, ln, o, u.onFocus]),
8730
8730
  onKeyDown: useCallback((It) => {
8731
8731
  if (!c && F.hasEditableTarget(o, It.target)) {
8732
- var Kn;
8733
- (Kn = qs.current) === null || Kn === void 0 || Kn.handleKeyDown(It);
8732
+ var Xn;
8733
+ (Xn = qs.current) === null || Xn === void 0 || Xn.handleKeyDown(It);
8734
8734
  var {
8735
- nativeEvent: Gn
8735
+ nativeEvent: Kn
8736
8736
  } = It;
8737
- if (F.isComposing(o) && Gn.isComposing === !1 && (Ht.set(o, !1), st(!1)), Ve(It, u.onKeyDown) || F.isComposing(o))
8737
+ if (F.isComposing(o) && Kn.isComposing === !1 && (Ht.set(o, !1), st(!1)), Ve(It, u.onKeyDown) || F.isComposing(o))
8738
8738
  return;
8739
8739
  var {
8740
8740
  selection: me
8741
8741
  } = o, kt = o.children[me !== null ? me.focus.path[0] : 0], St = Qs(L.string(kt)) === "rtl";
8742
- if (Re.isRedo(Gn)) {
8742
+ if (Re.isRedo(Kn)) {
8743
8743
  It.preventDefault();
8744
8744
  var zt = o;
8745
8745
  typeof zt.redo == "function" && zt.redo();
8746
8746
  return;
8747
8747
  }
8748
- if (Re.isUndo(Gn)) {
8748
+ if (Re.isUndo(Kn)) {
8749
8749
  It.preventDefault();
8750
8750
  var Un = o;
8751
8751
  typeof Un.undo == "function" && Un.undo();
8752
8752
  return;
8753
8753
  }
8754
- if (Re.isMoveLineBackward(Gn)) {
8754
+ if (Re.isMoveLineBackward(Kn)) {
8755
8755
  It.preventDefault(), j.move(o, {
8756
8756
  unit: "line",
8757
8757
  reverse: !0
8758
8758
  });
8759
8759
  return;
8760
8760
  }
8761
- if (Re.isMoveLineForward(Gn)) {
8761
+ if (Re.isMoveLineForward(Kn)) {
8762
8762
  It.preventDefault(), j.move(o, {
8763
8763
  unit: "line"
8764
8764
  });
8765
8765
  return;
8766
8766
  }
8767
- if (Re.isExtendLineBackward(Gn)) {
8767
+ if (Re.isExtendLineBackward(Kn)) {
8768
8768
  It.preventDefault(), j.move(o, {
8769
8769
  unit: "line",
8770
8770
  edge: "focus",
@@ -8772,14 +8772,14 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8772
8772
  });
8773
8773
  return;
8774
8774
  }
8775
- if (Re.isExtendLineForward(Gn)) {
8775
+ if (Re.isExtendLineForward(Kn)) {
8776
8776
  It.preventDefault(), j.move(o, {
8777
8777
  unit: "line",
8778
8778
  edge: "focus"
8779
8779
  });
8780
8780
  return;
8781
8781
  }
8782
- if (Re.isMoveBackward(Gn)) {
8782
+ if (Re.isMoveBackward(Kn)) {
8783
8783
  It.preventDefault(), me && A.isCollapsed(me) ? j.move(o, {
8784
8784
  reverse: !St
8785
8785
  }) : j.collapse(o, {
@@ -8787,7 +8787,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8787
8787
  });
8788
8788
  return;
8789
8789
  }
8790
- if (Re.isMoveForward(Gn)) {
8790
+ if (Re.isMoveForward(Kn)) {
8791
8791
  It.preventDefault(), me && A.isCollapsed(me) ? j.move(o, {
8792
8792
  reverse: St
8793
8793
  }) : j.collapse(o, {
@@ -8795,7 +8795,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8795
8795
  });
8796
8796
  return;
8797
8797
  }
8798
- if (Re.isMoveWordBackward(Gn)) {
8798
+ if (Re.isMoveWordBackward(Kn)) {
8799
8799
  It.preventDefault(), me && A.isExpanded(me) && j.collapse(o, {
8800
8800
  edge: "focus"
8801
8801
  }), j.move(o, {
@@ -8804,7 +8804,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8804
8804
  });
8805
8805
  return;
8806
8806
  }
8807
- if (Re.isMoveWordForward(Gn)) {
8807
+ if (Re.isMoveWordForward(Kn)) {
8808
8808
  It.preventDefault(), me && A.isExpanded(me) && j.collapse(o, {
8809
8809
  edge: "focus"
8810
8810
  }), j.move(o, {
@@ -8814,7 +8814,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8814
8814
  return;
8815
8815
  }
8816
8816
  if (Pt) {
8817
- if ((fo || qt) && me && (Re.isDeleteBackward(Gn) || Re.isDeleteForward(Gn)) && A.isCollapsed(me)) {
8817
+ if ((fo || qt) && me && (Re.isDeleteBackward(Kn) || Re.isDeleteForward(Kn)) && A.isCollapsed(me)) {
8818
8818
  var nr = L.parent(o, me.anchor.path);
8819
8819
  if (K.isElement(nr) && d.isVoid(o, nr) && (d.isInline(o, nr) || d.isBlock(o, nr))) {
8820
8820
  It.preventDefault(), d.deleteBackward(o, {
@@ -8824,31 +8824,31 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8824
8824
  }
8825
8825
  }
8826
8826
  } else {
8827
- if (Re.isBold(Gn) || Re.isItalic(Gn) || Re.isTransposeCharacter(Gn)) {
8827
+ if (Re.isBold(Kn) || Re.isItalic(Kn) || Re.isTransposeCharacter(Kn)) {
8828
8828
  It.preventDefault();
8829
8829
  return;
8830
8830
  }
8831
- if (Re.isSoftBreak(Gn)) {
8831
+ if (Re.isSoftBreak(Kn)) {
8832
8832
  It.preventDefault(), d.insertSoftBreak(o);
8833
8833
  return;
8834
8834
  }
8835
- if (Re.isSplitBlock(Gn)) {
8835
+ if (Re.isSplitBlock(Kn)) {
8836
8836
  It.preventDefault(), d.insertBreak(o);
8837
8837
  return;
8838
8838
  }
8839
- if (Re.isDeleteBackward(Gn)) {
8839
+ if (Re.isDeleteBackward(Kn)) {
8840
8840
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8841
8841
  direction: "backward"
8842
8842
  }) : d.deleteBackward(o);
8843
8843
  return;
8844
8844
  }
8845
- if (Re.isDeleteForward(Gn)) {
8845
+ if (Re.isDeleteForward(Kn)) {
8846
8846
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8847
8847
  direction: "forward"
8848
8848
  }) : d.deleteForward(o);
8849
8849
  return;
8850
8850
  }
8851
- if (Re.isDeleteLineBackward(Gn)) {
8851
+ if (Re.isDeleteLineBackward(Kn)) {
8852
8852
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8853
8853
  direction: "backward"
8854
8854
  }) : d.deleteBackward(o, {
@@ -8856,7 +8856,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8856
8856
  });
8857
8857
  return;
8858
8858
  }
8859
- if (Re.isDeleteLineForward(Gn)) {
8859
+ if (Re.isDeleteLineForward(Kn)) {
8860
8860
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8861
8861
  direction: "forward"
8862
8862
  }) : d.deleteForward(o, {
@@ -8864,7 +8864,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8864
8864
  });
8865
8865
  return;
8866
8866
  }
8867
- if (Re.isDeleteWordBackward(Gn)) {
8867
+ if (Re.isDeleteWordBackward(Kn)) {
8868
8868
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8869
8869
  direction: "backward"
8870
8870
  }) : d.deleteBackward(o, {
@@ -8872,7 +8872,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
8872
8872
  });
8873
8873
  return;
8874
8874
  }
8875
- if (Re.isDeleteWordForward(Gn)) {
8875
+ if (Re.isDeleteWordForward(Kn)) {
8876
8876
  It.preventDefault(), me && A.isExpanded(me) ? d.deleteFragment(o, {
8877
8877
  direction: "forward"
8878
8878
  }) : d.deleteForward(o, {
@@ -11713,17 +11713,17 @@ function pv(e, t, n) {
11713
11713
  var pe = new hv(n, de, r ? s.componentStyle : void 0);
11714
11714
  function st(Le, N) {
11715
11715
  return function(P, p, Dt) {
11716
- var Lt = P.attrs, Zn = P.componentStyle, ln = P.defaultProps, qs = P.foldedComponentIds, ki = P.styledComponentId, As = P.target, Ur = React.useContext(ll), Br = js(), Ar = P.shouldForwardProp || Br.shouldForwardProp, Is = Rg(p, Ur, ln) || Dr, Pi = function(Xn, It, Kn) {
11717
- for (var Gn, me = Qe(Qe({}, It), { className: void 0, theme: Kn }), kt = 0; kt < Xn.length; kt += 1) {
11718
- var St = Cr(Gn = Xn[kt]) ? Gn(me) : Gn;
11716
+ var Lt = P.attrs, Zn = P.componentStyle, ln = P.defaultProps, qs = P.foldedComponentIds, ki = P.styledComponentId, As = P.target, Ur = React.useContext(ll), Br = js(), Ar = P.shouldForwardProp || Br.shouldForwardProp, Is = Rg(p, Ur, ln) || Dr, Pi = function(Gn, It, Xn) {
11717
+ for (var Kn, me = Qe(Qe({}, It), { className: void 0, theme: Xn }), kt = 0; kt < Gn.length; kt += 1) {
11718
+ var St = Cr(Kn = Gn[kt]) ? Kn(me) : Kn;
11719
11719
  for (var zt in St) me[zt] = zt === "className" ? Vt(me[zt], St[zt]) : zt === "style" ? Qe(Qe({}, me[zt]), St[zt]) : St[zt];
11720
11720
  }
11721
11721
  return It.className && (me.className = Vt(me.className, It.className)), me;
11722
11722
  }(Lt, p, Is), Oi = Pi.as || As, hl = {};
11723
11723
  for (var ur in Pi) Pi[ur] === void 0 || ur[0] === "$" || ur === "as" || ur === "theme" && Pi.theme === Is || (ur === "forwardedAs" ? hl.as = Pi.forwardedAs : Ar && !Ar(ur, Oi) || (hl[ur] = Pi[ur]));
11724
- var mt = function(Xn, It) {
11725
- var Kn = js(), Gn = Xn.generateAndInjectStyles(It, Kn.styleSheet, Kn.stylis);
11726
- return Gn;
11724
+ var mt = function(Gn, It) {
11725
+ var Xn = js(), Kn = Gn.generateAndInjectStyles(It, Xn.styleSheet, Xn.stylis);
11726
+ return Kn;
11727
11727
  }(Zn, Pi), ot = Vt(qs, ki);
11728
11728
  return mt && (ot += " " + mt), Pi.className && (ot += " " + Pi.className), hl[Ba(Oi) && !Ga.has(Oi) ? "class" : "className"] = ot, Dt && (hl.ref = Dt), createElement(Oi, hl);
11729
11729
  }(nt, Le, N);
@@ -12746,8 +12746,8 @@ const Fv = ut.div`
12746
12746
  }, [pe, nt, t, r]), Br = useCallback((hl) => {
12747
12747
  const { scrollTop: ur, scrollHeight: mt, clientHeight: ot } = hl.currentTarget;
12748
12748
  if (P(ur), t) {
12749
- const Xn = Math.floor(ur / n), It = Math.min(pe.length, Xn + Math.ceil(p / n) + 1);
12750
- Le({ start: Xn, end: It });
12749
+ const Gn = Math.floor(ur / n), It = Math.min(pe.length, Gn + Math.ceil(p / n) + 1);
12750
+ Le({ start: Gn, end: It });
12751
12751
  }
12752
12752
  b == null || b(ur, mt), s && i && !Lt && !a && mt - ur - p < 100 && Ar();
12753
12753
  }, [t, n, pe.length, p, s, i, Lt, a, b]), Ar = useCallback(async () => {
@@ -13279,17 +13279,17 @@ const Fv = ut.div`
13279
13279
  console.warn("[TableAnnotation] row out of range", { row: Is, rowsLength: ot.length, tableIndex: hl });
13280
13280
  return;
13281
13281
  }
13282
- const Xn = (mt = (ur = ot[Is]) == null ? void 0 : ur.cells) == null ? void 0 : mt[Pi];
13283
- if (!Xn) {
13282
+ const Gn = (mt = (ur = ot[Is]) == null ? void 0 : ur.cells) == null ? void 0 : mt[Pi];
13283
+ if (!Gn) {
13284
13284
  console.warn("[TableAnnotation] cell is undefined", { row: Is, col: Pi, tableIndex: hl });
13285
13285
  return;
13286
13286
  }
13287
13287
  qs.push({
13288
- cell: Xn,
13289
- original: Xn.style.backgroundColor,
13290
- originalTitle: Xn.title
13291
- }), Xn.style.backgroundColor = ki.color || "rgba(255, 229, 153, 0.5)", ki.content && (Xn.title = ki.content), Is && Xn && Ar === 0 && As === 0 && setTimeout(() => {
13292
- Xn.scrollIntoView({ behavior: "smooth", block: "start" });
13288
+ cell: Gn,
13289
+ original: Gn.style.backgroundColor,
13290
+ originalTitle: Gn.title
13291
+ }), Gn.style.backgroundColor = ki.color || "rgba(255, 229, 153, 0.5)", ki.content && (Gn.title = ki.content), Is && Gn && Ar === 0 && As === 0 && setTimeout(() => {
13292
+ Gn.scrollIntoView({ behavior: "smooth", block: "start" });
13293
13293
  }, 500);
13294
13294
  });
13295
13295
  });
@@ -13367,20 +13367,20 @@ const Fv = ut.div`
13367
13367
  if (console.log("\u627E\u5230\u6587\u672C\u8282\u70B9\u6570\u91CF:", Is.length), Is.length > 0) {
13368
13368
  const mt = Is[0], ot = mt.textContent || "";
13369
13369
  if (console.log("\u7B2C\u4E00\u4E2A\u6587\u672C\u8282\u70B9\u5185\u5BB9:", ot), ot.length > 10) {
13370
- const Xn = ot.slice(0, 10), It = ot.slice(10), Kn = document.createElement("span");
13371
- Kn.className = "md-annotation", Kn.style.backgroundColor = "#FF0000", Kn.textContent = Xn;
13372
- const Gn = document.createDocumentFragment();
13373
- Gn.appendChild(Kn), It && Gn.appendChild(document.createTextNode(It)), (Ur = mt.parentNode) == null || Ur.replaceChild(Gn, mt), console.log("\u6210\u529F\u5E94\u7528\u6D4B\u8BD5\u6807\u6CE8:", Xn);
13370
+ const Gn = ot.slice(0, 10), It = ot.slice(10), Xn = document.createElement("span");
13371
+ Xn.className = "md-annotation", Xn.style.backgroundColor = "#FF0000", Xn.textContent = Gn;
13372
+ const Kn = document.createDocumentFragment();
13373
+ Kn.appendChild(Xn), It && Kn.appendChild(document.createTextNode(It)), (Ur = mt.parentNode) == null || Ur.replaceChild(Kn, mt), console.log("\u6210\u529F\u5E94\u7528\u6D4B\u8BD5\u6807\u6CE8:", Gn);
13374
13374
  }
13375
13375
  }
13376
13376
  console.log("\u5F00\u59CB\u5E94\u7528\u771F\u6B63\u6807\u6CE8...");
13377
13377
  let Oi = 0;
13378
13378
  const hl = Is.map((mt) => {
13379
13379
  var ot;
13380
- const Xn = Oi;
13380
+ const Gn = Oi;
13381
13381
  return Oi += ((ot = mt.textContent) == null ? void 0 : ot.length) || 0, {
13382
13382
  node: mt,
13383
- start: Xn,
13383
+ start: Gn,
13384
13384
  end: Oi,
13385
13385
  text: mt.textContent
13386
13386
  };
@@ -13388,24 +13388,24 @@ const Fv = ut.div`
13388
13388
  console.log("\u6587\u672C\u8282\u70B9\u4F4D\u7F6E:", hl), console.log("\u603B\u6587\u672C\u957F\u5EA6:", Oi);
13389
13389
  const ur = [...P].sort((mt, ot) => ot.start - mt.start);
13390
13390
  console.log("\u6392\u5E8F\u540E\u7684\u6807\u6CE8:", ur), ur.forEach((mt) => {
13391
- const { start: ot, end: Xn, color: It } = mt;
13391
+ const { start: ot, end: Gn, color: It } = mt;
13392
13392
  console.log("\u5904\u7406\u6807\u6CE8:", { annotation: mt, nodePositions: hl });
13393
- const Kn = hl.filter(
13394
- (Gn) => ot < Gn.end && Xn > Gn.start
13393
+ const Xn = hl.filter(
13394
+ (Kn) => ot < Kn.end && Gn > Kn.start
13395
13395
  );
13396
- console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:", Kn.length), Kn.forEach(({ node: Gn, start: me }) => {
13396
+ console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:", Xn.length), Xn.forEach(({ node: Kn, start: me }) => {
13397
13397
  var kt, St, zt, Un, nr, Yn;
13398
- const un = Math.max(0, ot - me), Fr = Math.min(((kt = Gn.textContent) == null ? void 0 : kt.length) || 0, Xn - me);
13399
- if (console.log("\u672C\u5730\u4F4D\u7F6E:", { localStart: un, localEnd: Fr, nodeTextLength: (St = Gn.textContent) == null ? void 0 : St.length }), un >= Fr) {
13398
+ const un = Math.max(0, ot - me), Fr = Math.min(((kt = Kn.textContent) == null ? void 0 : kt.length) || 0, Gn - me);
13399
+ if (console.log("\u672C\u5730\u4F4D\u7F6E:", { localStart: un, localEnd: Fr, nodeTextLength: (St = Kn.textContent) == null ? void 0 : St.length }), un >= Fr) {
13400
13400
  console.log("\u672C\u5730\u4F4D\u7F6E\u65E0\u6548\uFF0C\u8DF3\u8FC7");
13401
13401
  return;
13402
13402
  }
13403
- const Ni = ((zt = Gn.textContent) == null ? void 0 : zt.slice(0, un)) || "", Si = ((Un = Gn.textContent) == null ? void 0 : Un.slice(un, Fr)) || "", Ti = ((nr = Gn.textContent) == null ? void 0 : nr.slice(Fr)) || "";
13403
+ const Ni = ((zt = Kn.textContent) == null ? void 0 : zt.slice(0, un)) || "", Si = ((Un = Kn.textContent) == null ? void 0 : Un.slice(un, Fr)) || "", Ti = ((nr = Kn.textContent) == null ? void 0 : nr.slice(Fr)) || "";
13404
13404
  console.log("\u5206\u5272\u6587\u672C:", { before: Ni, annotatedText: Si, after: Ti });
13405
13405
  const ji = document.createElement("span");
13406
13406
  ji.className = "md-annotation", ji.style.backgroundColor = It || "#FFE599", ji.textContent = Si;
13407
13407
  const Ha = document.createDocumentFragment();
13408
- Ni && Ha.appendChild(document.createTextNode(Ni)), Ha.appendChild(ji), Ti && Ha.appendChild(document.createTextNode(Ti)), (Yn = Gn.parentNode) == null || Yn.replaceChild(Ha, Gn), console.log("\u6210\u529F\u5E94\u7528\u6807\u6CE8:", Si);
13408
+ Ni && Ha.appendChild(document.createTextNode(Ni)), Ha.appendChild(ji), Ti && Ha.appendChild(document.createTextNode(Ti)), (Yn = Kn.parentNode) == null || Yn.replaceChild(Ha, Kn), console.log("\u6210\u529F\u5E94\u7528\u6807\u6CE8:", Si);
13409
13409
  });
13410
13410
  });
13411
13411
  };
@@ -13959,7 +13959,7 @@ function requirePdf() {
13959
13959
  (e, t, n) => {
13960
13960
  Object.defineProperty(t, "__esModule", {
13961
13961
  value: !0
13962
- }), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength = Fr, t.arraysToBytes = Ni, t.assert = mt, t.bytesToString = Yn, t.createPromiseCapability = o0, t.createValidAbsoluteUrl = Xn, t.escapeString = Pl, t.getModificationDate = i0, t.getVerbosityLevel = Pi, t.info = Oi, t.isArrayBuffer = lg, t.isArrayEqual = s0, t.isAscii = Ol, t.objectFromMap = ji, t.objectSize = Ti, t.setVerbosityLevel = Is, t.shadow = It, t.string32 = Si, t.stringToBytes = un, t.stringToPDFString = xl, t.stringToUTF16BEString = Rl, t.stringToUTF8String = fg, t.unreachable = ur, t.utf8StringToString = cg, t.warn = hl, n(2);
13962
+ }), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength = Fr, t.arraysToBytes = Ni, t.assert = mt, t.bytesToString = Yn, t.createPromiseCapability = a0, t.createValidAbsoluteUrl = Gn, t.escapeString = Pl, t.getModificationDate = o0, t.getVerbosityLevel = Pi, t.info = Oi, t.isArrayBuffer = lg, t.isArrayEqual = s0, t.isAscii = Ol, t.objectFromMap = ji, t.objectSize = Ti, t.setVerbosityLevel = Is, t.shadow = It, t.string32 = Si, t.stringToBytes = un, t.stringToPDFString = Bl, t.stringToUTF16BEString = Rl, t.stringToUTF8String = fg, t.unreachable = ur, t.utf8StringToString = cg, t.warn = hl, n(2);
13963
13963
  const r = [1, 0, 0, 1, 0, 0];
13964
13964
  t.IDENTITY_MATRIX = r;
13965
13965
  const s = [1e-3, 0, 0, 1e-3, 0, 0];
@@ -14355,7 +14355,7 @@ function requirePdf() {
14355
14355
  return !1;
14356
14356
  }
14357
14357
  }
14358
- function Xn(pl, Ri = null, sr = null) {
14358
+ function Gn(pl, Ri = null, sr = null) {
14359
14359
  if (!pl)
14360
14360
  return null;
14361
14361
  try {
@@ -14385,50 +14385,50 @@ function requirePdf() {
14385
14385
  writable: !1
14386
14386
  }), sr;
14387
14387
  }
14388
- const Kn = function() {
14388
+ const Xn = function() {
14389
14389
  function Ri(sr, _a) {
14390
14390
  this.constructor === Ri && ur("Cannot initialize BaseException."), this.message = sr, this.name = _a;
14391
14391
  }
14392
14392
  return Ri.prototype = new Error(), Ri.constructor = Ri, Ri;
14393
14393
  }();
14394
- t.BaseException = Kn;
14395
- class Gn extends Kn {
14394
+ t.BaseException = Xn;
14395
+ class Kn extends Xn {
14396
14396
  constructor(Ri, sr) {
14397
14397
  super(Ri, "PasswordException"), this.code = sr;
14398
14398
  }
14399
14399
  }
14400
- t.PasswordException = Gn;
14401
- class me extends Kn {
14400
+ t.PasswordException = Kn;
14401
+ class me extends Xn {
14402
14402
  constructor(Ri, sr) {
14403
14403
  super(Ri, "UnknownErrorException"), this.details = sr;
14404
14404
  }
14405
14405
  }
14406
14406
  t.UnknownErrorException = me;
14407
- class kt extends Kn {
14407
+ class kt extends Xn {
14408
14408
  constructor(Ri) {
14409
14409
  super(Ri, "InvalidPDFException");
14410
14410
  }
14411
14411
  }
14412
14412
  t.InvalidPDFException = kt;
14413
- class St extends Kn {
14413
+ class St extends Xn {
14414
14414
  constructor(Ri) {
14415
14415
  super(Ri, "MissingPDFException");
14416
14416
  }
14417
14417
  }
14418
14418
  t.MissingPDFException = St;
14419
- class zt extends Kn {
14419
+ class zt extends Xn {
14420
14420
  constructor(Ri, sr) {
14421
14421
  super(Ri, "UnexpectedResponseException"), this.status = sr;
14422
14422
  }
14423
14423
  }
14424
14424
  t.UnexpectedResponseException = zt;
14425
- class Un extends Kn {
14425
+ class Un extends Xn {
14426
14426
  constructor(Ri) {
14427
14427
  super(Ri, "FormatError");
14428
14428
  }
14429
14429
  }
14430
14430
  t.FormatError = Un;
14431
- class nr extends Kn {
14431
+ class nr extends Xn {
14432
14432
  constructor(Ri) {
14433
14433
  super(Ri, "AbortException");
14434
14434
  }
@@ -14441,8 +14441,8 @@ function requirePdf() {
14441
14441
  return String.fromCharCode.apply(null, pl);
14442
14442
  const _a = [];
14443
14443
  for (let vl = 0; vl < Ri; vl += sr) {
14444
- const wl = Math.min(vl + sr, Ri), Bl = pl.subarray(vl, wl);
14445
- _a.push(String.fromCharCode.apply(null, Bl));
14444
+ const Al = Math.min(vl + sr, Ri), xl = pl.subarray(vl, Al);
14445
+ _a.push(String.fromCharCode.apply(null, xl));
14446
14446
  }
14447
14447
  return _a.join("");
14448
14448
  }
@@ -14465,15 +14465,15 @@ function requirePdf() {
14465
14465
  if (Ri === 1 && pl[0] instanceof Uint8Array)
14466
14466
  return pl[0];
14467
14467
  let sr = 0;
14468
- for (let wl = 0; wl < Ri; wl++)
14469
- sr += Fr(pl[wl]);
14468
+ for (let Al = 0; Al < Ri; Al++)
14469
+ sr += Fr(pl[Al]);
14470
14470
  let _a = 0;
14471
14471
  const vl = new Uint8Array(sr);
14472
- for (let wl = 0; wl < Ri; wl++) {
14473
- let Bl = pl[wl];
14474
- Bl instanceof Uint8Array || (typeof Bl == "string" ? Bl = un(Bl) : Bl = new Uint8Array(Bl));
14475
- const Tg = Bl.byteLength;
14476
- vl.set(Bl, _a), _a += Tg;
14472
+ for (let Al = 0; Al < Ri; Al++) {
14473
+ let xl = pl[Al];
14474
+ xl instanceof Uint8Array || (typeof xl == "string" ? xl = un(xl) : xl = new Uint8Array(xl));
14475
+ const Tg = xl.byteLength;
14476
+ vl.set(xl, _a), _a += Tg;
14477
14477
  }
14478
14478
  return vl;
14479
14479
  }
@@ -14512,10 +14512,10 @@ function requirePdf() {
14512
14512
  }
14513
14513
  }
14514
14514
  t.FeatureTest = dl;
14515
- const Fl = [...Array(256).keys()].map((pl) => pl.toString(16).padStart(2, "0"));
14516
- class Al {
14515
+ const wl = [...Array(256).keys()].map((pl) => pl.toString(16).padStart(2, "0"));
14516
+ class Dl {
14517
14517
  static makeHexColor(Ri, sr, _a) {
14518
- return `#${Fl[Ri]}${Fl[sr]}${Fl[_a]}`;
14518
+ return `#${wl[Ri]}${wl[sr]}${wl[_a]}`;
14519
14519
  }
14520
14520
  static scaleMinMax(Ri, sr) {
14521
14521
  let _a;
@@ -14529,12 +14529,12 @@ function requirePdf() {
14529
14529
  return [_a, vl];
14530
14530
  }
14531
14531
  static applyInverseTransform(Ri, sr) {
14532
- const _a = sr[0] * sr[3] - sr[1] * sr[2], vl = (Ri[0] * sr[3] - Ri[1] * sr[2] + sr[2] * sr[5] - sr[4] * sr[3]) / _a, wl = (-Ri[0] * sr[1] + Ri[1] * sr[0] + sr[4] * sr[1] - sr[5] * sr[0]) / _a;
14533
- return [vl, wl];
14532
+ const _a = sr[0] * sr[3] - sr[1] * sr[2], vl = (Ri[0] * sr[3] - Ri[1] * sr[2] + sr[2] * sr[5] - sr[4] * sr[3]) / _a, Al = (-Ri[0] * sr[1] + Ri[1] * sr[0] + sr[4] * sr[1] - sr[5] * sr[0]) / _a;
14533
+ return [vl, Al];
14534
14534
  }
14535
14535
  static getAxialAlignedBoundingBox(Ri, sr) {
14536
- const _a = Al.applyTransform(Ri, sr), vl = Al.applyTransform(Ri.slice(2, 4), sr), wl = Al.applyTransform([Ri[0], Ri[3]], sr), Bl = Al.applyTransform([Ri[2], Ri[1]], sr);
14537
- return [Math.min(_a[0], vl[0], wl[0], Bl[0]), Math.min(_a[1], vl[1], wl[1], Bl[1]), Math.max(_a[0], vl[0], wl[0], Bl[0]), Math.max(_a[1], vl[1], wl[1], Bl[1])];
14536
+ const _a = Dl.applyTransform(Ri, sr), vl = Dl.applyTransform(Ri.slice(2, 4), sr), Al = Dl.applyTransform([Ri[0], Ri[3]], sr), xl = Dl.applyTransform([Ri[2], Ri[1]], sr);
14537
+ return [Math.min(_a[0], vl[0], Al[0], xl[0]), Math.min(_a[1], vl[1], Al[1], xl[1]), Math.max(_a[0], vl[0], Al[0], xl[0]), Math.max(_a[1], vl[1], Al[1], xl[1])];
14538
14538
  }
14539
14539
  static inverseTransform(Ri) {
14540
14540
  const sr = Ri[0] * Ri[3] - Ri[1] * Ri[2];
@@ -14544,7 +14544,7 @@ function requirePdf() {
14544
14544
  return [Ri[0] * sr[0] + Ri[1] * sr[1] + Ri[2] * sr[2], Ri[3] * sr[0] + Ri[4] * sr[1] + Ri[5] * sr[2], Ri[6] * sr[0] + Ri[7] * sr[1] + Ri[8] * sr[2]];
14545
14545
  }
14546
14546
  static singularValueDecompose2dScale(Ri) {
14547
- const sr = [Ri[0], Ri[2], Ri[1], Ri[3]], _a = Ri[0] * sr[0] + Ri[1] * sr[2], vl = Ri[0] * sr[1] + Ri[1] * sr[3], wl = Ri[2] * sr[0] + Ri[3] * sr[2], Bl = Ri[2] * sr[1] + Ri[3] * sr[3], Tg = (_a + Bl) / 2, e0 = Math.sqrt((_a + Bl) ** 2 - 4 * (_a * Bl - wl * vl)) / 2, Ug = Tg + e0 || 1, Kg = Tg - e0 || 1;
14547
+ const sr = [Ri[0], Ri[2], Ri[1], Ri[3]], _a = Ri[0] * sr[0] + Ri[1] * sr[2], vl = Ri[0] * sr[1] + Ri[1] * sr[3], Al = Ri[2] * sr[0] + Ri[3] * sr[2], xl = Ri[2] * sr[1] + Ri[3] * sr[3], Tg = (_a + xl) / 2, e0 = Math.sqrt((_a + xl) ** 2 - 4 * (_a * xl - Al * vl)) / 2, Ug = Tg + e0 || 1, Kg = Tg - e0 || 1;
14548
14548
  return [Math.sqrt(Ug), Math.sqrt(Kg)];
14549
14549
  }
14550
14550
  static normalizeRect(Ri) {
@@ -14555,31 +14555,31 @@ function requirePdf() {
14555
14555
  const _a = Math.max(Math.min(Ri[0], Ri[2]), Math.min(sr[0], sr[2])), vl = Math.min(Math.max(Ri[0], Ri[2]), Math.max(sr[0], sr[2]));
14556
14556
  if (_a > vl)
14557
14557
  return null;
14558
- const wl = Math.max(Math.min(Ri[1], Ri[3]), Math.min(sr[1], sr[3])), Bl = Math.min(Math.max(Ri[1], Ri[3]), Math.max(sr[1], sr[3]));
14559
- return wl > Bl ? null : [_a, wl, vl, Bl];
14558
+ const Al = Math.max(Math.min(Ri[1], Ri[3]), Math.min(sr[1], sr[3])), xl = Math.min(Math.max(Ri[1], Ri[3]), Math.max(sr[1], sr[3]));
14559
+ return Al > xl ? null : [_a, Al, vl, xl];
14560
14560
  }
14561
- static bezierBoundingBox(Ri, sr, _a, vl, wl, Bl, Tg, e0) {
14561
+ static bezierBoundingBox(Ri, sr, _a, vl, Al, xl, Tg, e0) {
14562
14562
  const Ug = [], Kg = [[], []];
14563
- let a0, u0, m0, t0, v0, b0, F0, w0;
14563
+ let i0, l0, c0, t0, v0, b0, F0, w0;
14564
14564
  for (let x0 = 0; x0 < 2; ++x0) {
14565
- if (x0 === 0 ? (u0 = 6 * Ri - 12 * _a + 6 * wl, a0 = -3 * Ri + 9 * _a - 9 * wl + 3 * Tg, m0 = 3 * _a - 3 * Ri) : (u0 = 6 * sr - 12 * vl + 6 * Bl, a0 = -3 * sr + 9 * vl - 9 * Bl + 3 * e0, m0 = 3 * vl - 3 * sr), Math.abs(a0) < 1e-12) {
14566
- if (Math.abs(u0) < 1e-12)
14565
+ if (x0 === 0 ? (l0 = 6 * Ri - 12 * _a + 6 * Al, i0 = -3 * Ri + 9 * _a - 9 * Al + 3 * Tg, c0 = 3 * _a - 3 * Ri) : (l0 = 6 * sr - 12 * vl + 6 * xl, i0 = -3 * sr + 9 * vl - 9 * xl + 3 * e0, c0 = 3 * vl - 3 * sr), Math.abs(i0) < 1e-12) {
14566
+ if (Math.abs(l0) < 1e-12)
14567
14567
  continue;
14568
- t0 = -m0 / u0, 0 < t0 && t0 < 1 && Ug.push(t0);
14568
+ t0 = -c0 / l0, 0 < t0 && t0 < 1 && Ug.push(t0);
14569
14569
  continue;
14570
14570
  }
14571
- F0 = u0 * u0 - 4 * m0 * a0, w0 = Math.sqrt(F0), !(F0 < 0) && (v0 = (-u0 + w0) / (2 * a0), 0 < v0 && v0 < 1 && Ug.push(v0), b0 = (-u0 - w0) / (2 * a0), 0 < b0 && b0 < 1 && Ug.push(b0));
14571
+ F0 = l0 * l0 - 4 * c0 * i0, w0 = Math.sqrt(F0), !(F0 < 0) && (v0 = (-l0 + w0) / (2 * i0), 0 < v0 && v0 < 1 && Ug.push(v0), b0 = (-l0 - w0) / (2 * i0), 0 < b0 && b0 < 1 && Ug.push(b0));
14572
14572
  }
14573
- let h0 = Ug.length, n0;
14574
- const f0 = h0;
14575
- for (; h0--; )
14576
- t0 = Ug[h0], n0 = 1 - t0, Kg[0][h0] = n0 * n0 * n0 * Ri + 3 * n0 * n0 * t0 * _a + 3 * n0 * t0 * t0 * wl + t0 * t0 * t0 * Tg, Kg[1][h0] = n0 * n0 * n0 * sr + 3 * n0 * n0 * t0 * vl + 3 * n0 * t0 * t0 * Bl + t0 * t0 * t0 * e0;
14577
- return Kg[0][f0] = Ri, Kg[1][f0] = sr, Kg[0][f0 + 1] = Tg, Kg[1][f0 + 1] = e0, Kg[0].length = Kg[1].length = f0 + 2, [Math.min(...Kg[0]), Math.min(...Kg[1]), Math.max(...Kg[0]), Math.max(...Kg[1])];
14573
+ let f0 = Ug.length, n0;
14574
+ const p0 = f0;
14575
+ for (; f0--; )
14576
+ t0 = Ug[f0], n0 = 1 - t0, Kg[0][f0] = n0 * n0 * n0 * Ri + 3 * n0 * n0 * t0 * _a + 3 * n0 * t0 * t0 * Al + t0 * t0 * t0 * Tg, Kg[1][f0] = n0 * n0 * n0 * sr + 3 * n0 * n0 * t0 * vl + 3 * n0 * t0 * t0 * xl + t0 * t0 * t0 * e0;
14577
+ return Kg[0][p0] = Ri, Kg[1][p0] = sr, Kg[0][p0 + 1] = Tg, Kg[1][p0 + 1] = e0, Kg[0].length = Kg[1].length = p0 + 2, [Math.min(...Kg[0]), Math.min(...Kg[1]), Math.max(...Kg[0]), Math.max(...Kg[1])];
14578
14578
  }
14579
14579
  }
14580
- t.Util = Al;
14581
- const Dl = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
14582
- function xl(pl) {
14580
+ t.Util = Dl;
14581
+ const Fl = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
14582
+ function Bl(pl) {
14583
14583
  if (pl[0] >= "\xEF") {
14584
14584
  let sr;
14585
14585
  if (pl[0] === "\xFE" && pl[1] === "\xFF" ? sr = "utf-16be" : pl[0] === "\xFF" && pl[1] === "\xFE" ? sr = "utf-16le" : pl[0] === "\xEF" && pl[1] === "\xBB" && pl[2] === "\xBF" && (sr = "utf-8"), sr)
@@ -14594,7 +14594,7 @@ function requirePdf() {
14594
14594
  }
14595
14595
  const Ri = [];
14596
14596
  for (let sr = 0, _a = pl.length; sr < _a; sr++) {
14597
- const vl = Dl[pl.charCodeAt(sr)];
14597
+ const vl = Fl[pl.charCodeAt(sr)];
14598
14598
  Ri.push(vl ? String.fromCharCode(vl) : pl.charAt(sr));
14599
14599
  }
14600
14600
  return Ri.join("");
@@ -14631,10 +14631,10 @@ function requirePdf() {
14631
14631
  return !1;
14632
14632
  return !0;
14633
14633
  }
14634
- function i0(pl = /* @__PURE__ */ new Date()) {
14634
+ function o0(pl = /* @__PURE__ */ new Date()) {
14635
14635
  return [pl.getUTCFullYear().toString(), (pl.getUTCMonth() + 1).toString().padStart(2, "0"), pl.getUTCDate().toString().padStart(2, "0"), pl.getUTCHours().toString().padStart(2, "0"), pl.getUTCMinutes().toString().padStart(2, "0"), pl.getUTCSeconds().toString().padStart(2, "0")].join("");
14636
14636
  }
14637
- function o0() {
14637
+ function a0() {
14638
14638
  const pl = /* @__PURE__ */ Object.create(null);
14639
14639
  let Ri = !1;
14640
14640
  return Object.defineProperty(pl, "settled", {
@@ -16044,7 +16044,7 @@ function requirePdf() {
16044
16044
  /* 5 */
16045
16045
  /***/
16046
16046
  (e, t, n) => {
16047
- var h, X0, b;
16047
+ var h, G0, b;
16048
16048
  Object.defineProperty(t, "__esModule", {
16049
16049
  value: !0
16050
16050
  }), t.PrintAnnotationStorage = t.AnnotationStorage = void 0;
@@ -16077,7 +16077,7 @@ function requirePdf() {
16077
16077
  E[o] !== pe && (u = !0, E[o] = pe);
16078
16078
  else
16079
16079
  u = !0, this._storage.set(de, Ye);
16080
- u && gl(this, h, X0).call(this), Ye instanceof s.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(Ye.constructor._type);
16080
+ u && gl(this, h, G0).call(this), Ye instanceof s.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(Ye.constructor._type);
16081
16081
  }
16082
16082
  has(de) {
16083
16083
  return this._storage.has(de);
@@ -16113,7 +16113,7 @@ function requirePdf() {
16113
16113
  return Ye.hexdigest();
16114
16114
  }
16115
16115
  }
16116
- h = new WeakSet(), X0 = function() {
16116
+ h = new WeakSet(), G0 = function() {
16117
16117
  this._modified || (this._modified = !0, typeof this.onSetModified == "function" && this.onSetModified());
16118
16118
  }, t.AnnotationStorage = a;
16119
16119
  class c extends a {
@@ -16325,7 +16325,7 @@ function requirePdf() {
16325
16325
  /* 7 */
16326
16326
  /***/
16327
16327
  (e, t, n) => {
16328
- var Ye, E, u, o, pe, st, Y0, N, p, Dt, Lt, Zn, ln, qs, ki, As, Ur, Br, Ar, Is, Pi, Oi, hl, ur, mt, ot, Z0, T0, r0, p0, J0, Q0, R0, g0, C0;
16328
+ var Ye, E, u, o, pe, st, Y0, N, p, Dt, Lt, Zn, ln, qs, ki, As, Ur, Br, Ar, Is, Pi, Oi, hl, ur, mt, ot, Z0, T0, r0, g0, J0, Q0, R0, m0, C0;
16329
16329
  Object.defineProperty(t, "__esModule", {
16330
16330
  value: !0
16331
16331
  }), t.KeyboardManager = t.CommandManager = t.ColorManager = t.AnnotationEditorUIManager = void 0, t.bindEvents = i, t.opacityToHex = a;
@@ -16522,7 +16522,7 @@ function requirePdf() {
16522
16522
  setEditingState(un) {
16523
16523
  un ? (gl(this, ot, Z0).call(this), gl(this, ot, r0).call(this, {
16524
16524
  isEditing: Gr(this, Ar) !== r.AnnotationEditorType.NONE,
16525
- isEmpty: gl(this, ot, g0).call(this),
16525
+ isEmpty: gl(this, ot, m0).call(this),
16526
16526
  hasSomethingToUndo: Gr(this, ln).hasSomethingToUndo(),
16527
16527
  hasSomethingToRedo: Gr(this, ln).hasSomethingToRedo(),
16528
16528
  hasSelectedEditor: !1,
@@ -16534,7 +16534,7 @@ function requirePdf() {
16534
16534
  registerEditorTypes(un) {
16535
16535
  Cl(this, ki, un);
16536
16536
  for (const Fr of Gr(this, ki))
16537
- gl(this, ot, p0).call(this, Fr.defaultPropertiesToUpdate);
16537
+ gl(this, ot, g0).call(this, Fr.defaultPropertiesToUpdate);
16538
16538
  }
16539
16539
  getId() {
16540
16540
  return Gr(this, Ur).getId();
@@ -16582,7 +16582,7 @@ function requirePdf() {
16582
16582
  Gr(this, Dt).delete(un.id), this.unselect(un);
16583
16583
  }
16584
16584
  setActiveEditor(un) {
16585
- Gr(this, p) !== un && (Cl(this, p, un), un && gl(this, ot, p0).call(this, un.propertiesToUpdate));
16585
+ Gr(this, p) !== un && (Cl(this, p, un), un && gl(this, ot, g0).call(this, un.propertiesToUpdate));
16586
16586
  }
16587
16587
  toggleSelected(un) {
16588
16588
  if (Gr(this, Is).has(un)) {
@@ -16591,14 +16591,14 @@ function requirePdf() {
16591
16591
  });
16592
16592
  return;
16593
16593
  }
16594
- Gr(this, Is).add(un), un.select(), gl(this, ot, p0).call(this, un.propertiesToUpdate), gl(this, ot, r0).call(this, {
16594
+ Gr(this, Is).add(un), un.select(), gl(this, ot, g0).call(this, un.propertiesToUpdate), gl(this, ot, r0).call(this, {
16595
16595
  hasSelectedEditor: !0
16596
16596
  });
16597
16597
  }
16598
16598
  setSelected(un) {
16599
16599
  for (const Fr of Gr(this, Is))
16600
16600
  Fr !== un && Fr.unselect();
16601
- Gr(this, Is).clear(), Gr(this, Is).add(un), un.select(), gl(this, ot, p0).call(this, un.propertiesToUpdate), gl(this, ot, r0).call(this, {
16601
+ Gr(this, Is).clear(), Gr(this, Is).add(un), un.select(), gl(this, ot, g0).call(this, un.propertiesToUpdate), gl(this, ot, r0).call(this, {
16602
16602
  hasSelectedEditor: !0
16603
16603
  });
16604
16604
  }
@@ -16617,21 +16617,21 @@ function requirePdf() {
16617
16617
  Gr(this, ln).undo(), gl(this, ot, r0).call(this, {
16618
16618
  hasSomethingToUndo: Gr(this, ln).hasSomethingToUndo(),
16619
16619
  hasSomethingToRedo: !0,
16620
- isEmpty: gl(this, ot, g0).call(this)
16620
+ isEmpty: gl(this, ot, m0).call(this)
16621
16621
  });
16622
16622
  }
16623
16623
  redo() {
16624
16624
  Gr(this, ln).redo(), gl(this, ot, r0).call(this, {
16625
16625
  hasSomethingToUndo: !0,
16626
16626
  hasSomethingToRedo: Gr(this, ln).hasSomethingToRedo(),
16627
- isEmpty: gl(this, ot, g0).call(this)
16627
+ isEmpty: gl(this, ot, m0).call(this)
16628
16628
  });
16629
16629
  }
16630
16630
  addCommands(un) {
16631
16631
  Gr(this, ln).add(un), gl(this, ot, r0).call(this, {
16632
16632
  hasSomethingToUndo: !0,
16633
16633
  hasSomethingToRedo: !1,
16634
- isEmpty: gl(this, ot, g0).call(this)
16634
+ isEmpty: gl(this, ot, m0).call(this)
16635
16635
  });
16636
16636
  }
16637
16637
  delete() {
@@ -16720,7 +16720,7 @@ function requirePdf() {
16720
16720
  source: this,
16721
16721
  details: Object.assign(Gr(this, ur), un)
16722
16722
  });
16723
- }, p0 = function(un) {
16723
+ }, g0 = function(un) {
16724
16724
  Gr(this, As).dispatch("annotationeditorparamschanged", {
16725
16725
  source: this,
16726
16726
  details: un
@@ -16740,7 +16740,7 @@ function requirePdf() {
16740
16740
  }, R0 = function(un) {
16741
16741
  const Fr = Gr(this, Lt).get(un.pageIndex);
16742
16742
  Fr ? Fr.addOrRebuild(un) : this.addEditor(un);
16743
- }, g0 = function() {
16743
+ }, m0 = function() {
16744
16744
  if (Gr(this, Dt).size === 0)
16745
16745
  return !0;
16746
16746
  if (Gr(this, Dt).size === 1)
@@ -16839,26 +16839,26 @@ function requirePdf() {
16839
16839
  }) {
16840
16840
  this.viewBox = Br, this.scale = Ar, this.rotation = Is, this.offsetX = Pi, this.offsetY = Oi;
16841
16841
  const ur = (Br[2] + Br[0]) / 2, mt = (Br[3] + Br[1]) / 2;
16842
- let ot, Xn, It, Kn;
16842
+ let ot, Gn, It, Xn;
16843
16843
  switch (Is %= 360, Is < 0 && (Is += 360), Is) {
16844
16844
  case 180:
16845
- ot = -1, Xn = 0, It = 0, Kn = 1;
16845
+ ot = -1, Gn = 0, It = 0, Xn = 1;
16846
16846
  break;
16847
16847
  case 90:
16848
- ot = 0, Xn = 1, It = 1, Kn = 0;
16848
+ ot = 0, Gn = 1, It = 1, Xn = 0;
16849
16849
  break;
16850
16850
  case 270:
16851
- ot = 0, Xn = -1, It = -1, Kn = 0;
16851
+ ot = 0, Gn = -1, It = -1, Xn = 0;
16852
16852
  break;
16853
16853
  case 0:
16854
- ot = 1, Xn = 0, It = 0, Kn = -1;
16854
+ ot = 1, Gn = 0, It = 0, Xn = -1;
16855
16855
  break;
16856
16856
  default:
16857
16857
  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
16858
16858
  }
16859
- hl && (It = -It, Kn = -Kn);
16860
- let Gn, me, kt, St;
16861
- ot === 0 ? (Gn = Math.abs(mt - Br[1]) * Ar + Pi, me = Math.abs(ur - Br[0]) * Ar + Oi, kt = Math.abs(Br[3] - Br[1]) * Ar, St = Math.abs(Br[2] - Br[0]) * Ar) : (Gn = Math.abs(ur - Br[0]) * Ar + Pi, me = Math.abs(mt - Br[1]) * Ar + Oi, kt = Math.abs(Br[2] - Br[0]) * Ar, St = Math.abs(Br[3] - Br[1]) * Ar), this.transform = [ot * Ar, Xn * Ar, It * Ar, Kn * Ar, Gn - ot * Ar * ur - It * Ar * mt, me - Xn * Ar * ur - Kn * Ar * mt], this.width = kt, this.height = St;
16859
+ hl && (It = -It, Xn = -Xn);
16860
+ let Kn, me, kt, St;
16861
+ ot === 0 ? (Kn = Math.abs(mt - Br[1]) * Ar + Pi, me = Math.abs(ur - Br[0]) * Ar + Oi, kt = Math.abs(Br[3] - Br[1]) * Ar, St = Math.abs(Br[2] - Br[0]) * Ar) : (Kn = Math.abs(ur - Br[0]) * Ar + Pi, me = Math.abs(mt - Br[1]) * Ar + Oi, kt = Math.abs(Br[2] - Br[0]) * Ar, St = Math.abs(Br[3] - Br[1]) * Ar), this.transform = [ot * Ar, Gn * Ar, It * Ar, Xn * Ar, Kn - ot * Ar * ur - It * Ar * mt, me - Gn * Ar * ur - Xn * Ar * mt], this.width = kt, this.height = St;
16862
16862
  }
16863
16863
  clone({
16864
16864
  scale: Br = this.scale,
@@ -16996,10 +16996,10 @@ function requirePdf() {
16996
16996
  let mt = parseInt(Ar[6], 10);
16997
16997
  mt = mt >= 0 && mt <= 59 ? mt : 0;
16998
16998
  const ot = Ar[7] || "Z";
16999
- let Xn = parseInt(Ar[8], 10);
17000
- Xn = Xn >= 0 && Xn <= 23 ? Xn : 0;
16999
+ let Gn = parseInt(Ar[8], 10);
17000
+ Gn = Gn >= 0 && Gn <= 23 ? Gn : 0;
17001
17001
  let It = parseInt(Ar[9], 10) || 0;
17002
- return It = It >= 0 && It <= 59 ? It : 0, ot === "-" ? (hl += Xn, ur += It) : ot === "+" && (hl -= Xn, ur -= It), new Date(Date.UTC(Is, Pi, Oi, hl, ur, mt));
17002
+ return It = It >= 0 && It <= 59 ? It : 0, ot === "-" ? (hl += Gn, ur += It) : ot === "+" && (hl -= Gn, ur -= It), new Date(Date.UTC(Is, Pi, Oi, hl, ur, mt));
17003
17003
  }
17004
17004
  }
17005
17005
  t.PDFDateString = Dt;
@@ -17462,28 +17462,28 @@ function requirePdf() {
17462
17462
  mt.save(), this.__originalSave();
17463
17463
  }, ur.restore = function() {
17464
17464
  mt.restore(), this.__originalRestore();
17465
- }, ur.translate = function(Xn, It) {
17466
- mt.translate(Xn, It), this.__originalTranslate(Xn, It);
17467
- }, ur.scale = function(Xn, It) {
17468
- mt.scale(Xn, It), this.__originalScale(Xn, It);
17469
- }, ur.transform = function(Xn, It, Kn, Gn, me, kt) {
17470
- mt.transform(Xn, It, Kn, Gn, me, kt), this.__originalTransform(Xn, It, Kn, Gn, me, kt);
17471
- }, ur.setTransform = function(Xn, It, Kn, Gn, me, kt) {
17472
- mt.setTransform(Xn, It, Kn, Gn, me, kt), this.__originalSetTransform(Xn, It, Kn, Gn, me, kt);
17465
+ }, ur.translate = function(Gn, It) {
17466
+ mt.translate(Gn, It), this.__originalTranslate(Gn, It);
17467
+ }, ur.scale = function(Gn, It) {
17468
+ mt.scale(Gn, It), this.__originalScale(Gn, It);
17469
+ }, ur.transform = function(Gn, It, Xn, Kn, me, kt) {
17470
+ mt.transform(Gn, It, Xn, Kn, me, kt), this.__originalTransform(Gn, It, Xn, Kn, me, kt);
17471
+ }, ur.setTransform = function(Gn, It, Xn, Kn, me, kt) {
17472
+ mt.setTransform(Gn, It, Xn, Kn, me, kt), this.__originalSetTransform(Gn, It, Xn, Kn, me, kt);
17473
17473
  }, ur.resetTransform = function() {
17474
17474
  mt.resetTransform(), this.__originalResetTransform();
17475
- }, ur.rotate = function(Xn) {
17476
- mt.rotate(Xn), this.__originalRotate(Xn);
17477
- }, ur.clip = function(Xn) {
17478
- mt.clip(Xn), this.__originalClip(Xn);
17479
- }, ur.moveTo = function(ot, Xn) {
17480
- mt.moveTo(ot, Xn), this.__originalMoveTo(ot, Xn);
17481
- }, ur.lineTo = function(ot, Xn) {
17482
- mt.lineTo(ot, Xn), this.__originalLineTo(ot, Xn);
17483
- }, ur.bezierCurveTo = function(ot, Xn, It, Kn, Gn, me) {
17484
- mt.bezierCurveTo(ot, Xn, It, Kn, Gn, me), this.__originalBezierCurveTo(ot, Xn, It, Kn, Gn, me);
17485
- }, ur.rect = function(ot, Xn, It, Kn) {
17486
- mt.rect(ot, Xn, It, Kn), this.__originalRect(ot, Xn, It, Kn);
17475
+ }, ur.rotate = function(Gn) {
17476
+ mt.rotate(Gn), this.__originalRotate(Gn);
17477
+ }, ur.clip = function(Gn) {
17478
+ mt.clip(Gn), this.__originalClip(Gn);
17479
+ }, ur.moveTo = function(ot, Gn) {
17480
+ mt.moveTo(ot, Gn), this.__originalMoveTo(ot, Gn);
17481
+ }, ur.lineTo = function(ot, Gn) {
17482
+ mt.lineTo(ot, Gn), this.__originalLineTo(ot, Gn);
17483
+ }, ur.bezierCurveTo = function(ot, Gn, It, Xn, Kn, me) {
17484
+ mt.bezierCurveTo(ot, Gn, It, Xn, Kn, me), this.__originalBezierCurveTo(ot, Gn, It, Xn, Kn, me);
17485
+ }, ur.rect = function(ot, Gn, It, Xn) {
17486
+ mt.rect(ot, Gn, It, Xn), this.__originalRect(ot, Gn, It, Xn);
17487
17487
  }, ur.closePath = function() {
17488
17488
  mt.closePath(), this.__originalClosePath();
17489
17489
  }, ur.beginPath = function() {
@@ -17494,9 +17494,9 @@ function requirePdf() {
17494
17494
  constructor(mt) {
17495
17495
  this.canvasFactory = mt, this.cache = /* @__PURE__ */ Object.create(null);
17496
17496
  }
17497
- getCanvas(mt, ot, Xn) {
17497
+ getCanvas(mt, ot, Gn) {
17498
17498
  let It;
17499
- return this.cache[mt] !== void 0 ? (It = this.cache[mt], this.canvasFactory.reset(It, ot, Xn)) : (It = this.canvasFactory.create(ot, Xn), this.cache[mt] = It), It;
17499
+ return this.cache[mt] !== void 0 ? (It = this.cache[mt], this.canvasFactory.reset(It, ot, Gn)) : (It = this.canvasFactory.create(ot, Gn), this.cache[mt] = It), It;
17500
17500
  }
17501
17501
  delete(mt) {
17502
17502
  delete this.cache[mt];
@@ -17508,17 +17508,17 @@ function requirePdf() {
17508
17508
  }
17509
17509
  }
17510
17510
  }
17511
- function pe(ur, mt, ot, Xn, It, Kn, Gn, me, kt, St) {
17511
+ function pe(ur, mt, ot, Gn, It, Xn, Kn, me, kt, St) {
17512
17512
  const [zt, Un, nr, Yn, un, Fr] = (0, r.getCurrentTransform)(ur);
17513
17513
  if (Un === 0 && nr === 0) {
17514
- const Ti = Gn * zt + un, ji = Math.round(Ti), Ha = me * Yn + Fr, ml = Math.round(Ha), dl = (Gn + kt) * zt + un, Fl = Math.abs(Math.round(dl) - ji) || 1, Al = (me + St) * Yn + Fr, Dl = Math.abs(Math.round(Al) - ml) || 1;
17515
- return ur.setTransform(Math.sign(zt), 0, 0, Math.sign(Yn), ji, ml), ur.drawImage(mt, ot, Xn, It, Kn, 0, 0, Fl, Dl), ur.setTransform(zt, Un, nr, Yn, un, Fr), [Fl, Dl];
17514
+ const Ti = Kn * zt + un, ji = Math.round(Ti), Ha = me * Yn + Fr, ml = Math.round(Ha), dl = (Kn + kt) * zt + un, wl = Math.abs(Math.round(dl) - ji) || 1, Dl = (me + St) * Yn + Fr, Fl = Math.abs(Math.round(Dl) - ml) || 1;
17515
+ return ur.setTransform(Math.sign(zt), 0, 0, Math.sign(Yn), ji, ml), ur.drawImage(mt, ot, Gn, It, Xn, 0, 0, wl, Fl), ur.setTransform(zt, Un, nr, Yn, un, Fr), [wl, Fl];
17516
17516
  }
17517
17517
  if (zt === 0 && Yn === 0) {
17518
- const Ti = me * nr + un, ji = Math.round(Ti), Ha = Gn * Un + Fr, ml = Math.round(Ha), dl = (me + St) * nr + un, Fl = Math.abs(Math.round(dl) - ji) || 1, Al = (Gn + kt) * Un + Fr, Dl = Math.abs(Math.round(Al) - ml) || 1;
17519
- return ur.setTransform(0, Math.sign(Un), Math.sign(nr), 0, ji, ml), ur.drawImage(mt, ot, Xn, It, Kn, 0, 0, Dl, Fl), ur.setTransform(zt, Un, nr, Yn, un, Fr), [Dl, Fl];
17518
+ const Ti = me * nr + un, ji = Math.round(Ti), Ha = Kn * Un + Fr, ml = Math.round(Ha), dl = (me + St) * nr + un, wl = Math.abs(Math.round(dl) - ji) || 1, Dl = (Kn + kt) * Un + Fr, Fl = Math.abs(Math.round(Dl) - ml) || 1;
17519
+ return ur.setTransform(0, Math.sign(Un), Math.sign(nr), 0, ji, ml), ur.drawImage(mt, ot, Gn, It, Xn, 0, 0, Fl, wl), ur.setTransform(zt, Un, nr, Yn, un, Fr), [Fl, wl];
17520
17520
  }
17521
- ur.drawImage(mt, ot, Xn, It, Kn, Gn, me, kt, St);
17521
+ ur.drawImage(mt, ot, Gn, It, Xn, Kn, me, kt, St);
17522
17522
  const Ni = Math.hypot(zt, Un), Si = Math.hypot(nr, Yn);
17523
17523
  return [Ni * kt, Si * St];
17524
17524
  }
@@ -17529,8 +17529,8 @@ function requirePdf() {
17529
17529
  } = ur;
17530
17530
  if (mt > Ye || ot > Ye)
17531
17531
  return null;
17532
- const Xn = 1e3, It = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), Kn = mt + 1;
17533
- let Gn = new Uint8Array(Kn * (ot + 1)), me, kt, St;
17532
+ const Gn = 1e3, It = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), Xn = mt + 1;
17533
+ let Kn = new Uint8Array(Xn * (ot + 1)), me, kt, St;
17534
17534
  const zt = mt + 7 & -8;
17535
17535
  let Un = new Uint8Array(zt * ot), nr = 0;
17536
17536
  for (const Si of ur.data) {
@@ -17539,42 +17539,42 @@ function requirePdf() {
17539
17539
  Un[nr++] = Si & Ti ? 0 : 255, Ti >>= 1;
17540
17540
  }
17541
17541
  let Yn = 0;
17542
- for (nr = 0, Un[nr] !== 0 && (Gn[0] = 1, ++Yn), kt = 1; kt < mt; kt++)
17543
- Un[nr] !== Un[nr + 1] && (Gn[kt] = Un[nr] ? 2 : 1, ++Yn), nr++;
17544
- for (Un[nr] !== 0 && (Gn[kt] = 2, ++Yn), me = 1; me < ot; me++) {
17545
- nr = me * zt, St = me * Kn, Un[nr - zt] !== Un[nr] && (Gn[St] = Un[nr] ? 1 : 8, ++Yn);
17542
+ for (nr = 0, Un[nr] !== 0 && (Kn[0] = 1, ++Yn), kt = 1; kt < mt; kt++)
17543
+ Un[nr] !== Un[nr + 1] && (Kn[kt] = Un[nr] ? 2 : 1, ++Yn), nr++;
17544
+ for (Un[nr] !== 0 && (Kn[kt] = 2, ++Yn), me = 1; me < ot; me++) {
17545
+ nr = me * zt, St = me * Xn, Un[nr - zt] !== Un[nr] && (Kn[St] = Un[nr] ? 1 : 8, ++Yn);
17546
17546
  let Si = (Un[nr] ? 4 : 0) + (Un[nr - zt] ? 8 : 0);
17547
17547
  for (kt = 1; kt < mt; kt++)
17548
- Si = (Si >> 2) + (Un[nr + 1] ? 4 : 0) + (Un[nr - zt + 1] ? 8 : 0), It[Si] && (Gn[St + kt] = It[Si], ++Yn), nr++;
17549
- if (Un[nr - zt] !== Un[nr] && (Gn[St + kt] = Un[nr] ? 2 : 4, ++Yn), Yn > Xn)
17548
+ Si = (Si >> 2) + (Un[nr + 1] ? 4 : 0) + (Un[nr - zt + 1] ? 8 : 0), It[Si] && (Kn[St + kt] = It[Si], ++Yn), nr++;
17549
+ if (Un[nr - zt] !== Un[nr] && (Kn[St + kt] = Un[nr] ? 2 : 4, ++Yn), Yn > Gn)
17550
17550
  return null;
17551
17551
  }
17552
- for (nr = zt * (ot - 1), St = me * Kn, Un[nr] !== 0 && (Gn[St] = 8, ++Yn), kt = 1; kt < mt; kt++)
17553
- Un[nr] !== Un[nr + 1] && (Gn[St + kt] = Un[nr] ? 4 : 8, ++Yn), nr++;
17554
- if (Un[nr] !== 0 && (Gn[St + kt] = 4, ++Yn), Yn > Xn)
17552
+ for (nr = zt * (ot - 1), St = me * Xn, Un[nr] !== 0 && (Kn[St] = 8, ++Yn), kt = 1; kt < mt; kt++)
17553
+ Un[nr] !== Un[nr + 1] && (Kn[St + kt] = Un[nr] ? 4 : 8, ++Yn), nr++;
17554
+ if (Un[nr] !== 0 && (Kn[St + kt] = 4, ++Yn), Yn > Gn)
17555
17555
  return null;
17556
- const un = new Int32Array([0, Kn, -1, 0, -Kn, 0, 0, 0, 1]), Fr = new Path2D();
17556
+ const un = new Int32Array([0, Xn, -1, 0, -Xn, 0, 0, 0, 1]), Fr = new Path2D();
17557
17557
  for (me = 0; Yn && me <= ot; me++) {
17558
- let Si = me * Kn;
17558
+ let Si = me * Xn;
17559
17559
  const Ti = Si + mt;
17560
- for (; Si < Ti && !Gn[Si]; )
17560
+ for (; Si < Ti && !Kn[Si]; )
17561
17561
  Si++;
17562
17562
  if (Si === Ti)
17563
17563
  continue;
17564
- Fr.moveTo(Si % Kn, me);
17564
+ Fr.moveTo(Si % Xn, me);
17565
17565
  const ji = Si;
17566
- let Ha = Gn[Si];
17566
+ let Ha = Kn[Si];
17567
17567
  do {
17568
17568
  const ml = un[Ha];
17569
17569
  do
17570
17570
  Si += ml;
17571
- while (!Gn[Si]);
17572
- const dl = Gn[Si];
17573
- dl !== 5 && dl !== 10 ? (Ha = dl, Gn[Si] = 0) : (Ha = dl & 51 * Ha >> 4, Gn[Si] &= Ha >> 2 | Ha << 2), Fr.lineTo(Si % Kn, Si / Kn | 0), Gn[Si] || --Yn;
17571
+ while (!Kn[Si]);
17572
+ const dl = Kn[Si];
17573
+ dl !== 5 && dl !== 10 ? (Ha = dl, Kn[Si] = 0) : (Ha = dl & 51 * Ha >> 4, Kn[Si] &= Ha >> 2 | Ha << 2), Fr.lineTo(Si % Xn, Si / Xn | 0), Kn[Si] || --Yn;
17574
17574
  } while (ji !== Si);
17575
17575
  --me;
17576
17576
  }
17577
- return Un = null, Gn = null, function(Si) {
17577
+ return Un = null, Kn = null, function(Si) {
17578
17578
  Si.save(), Si.scale(1 / mt, -1 / ot), Si.translate(0, -ot), Si.fill(Fr), Si.beginPath(), Si.restore();
17579
17579
  };
17580
17580
  }
@@ -17589,18 +17589,18 @@ function requirePdf() {
17589
17589
  setCurrentPoint(mt, ot) {
17590
17590
  this.x = mt, this.y = ot;
17591
17591
  }
17592
- updatePathMinMax(mt, ot, Xn) {
17593
- [ot, Xn] = s.Util.applyTransform([ot, Xn], mt), this.minX = Math.min(this.minX, ot), this.minY = Math.min(this.minY, Xn), this.maxX = Math.max(this.maxX, ot), this.maxY = Math.max(this.maxY, Xn);
17592
+ updatePathMinMax(mt, ot, Gn) {
17593
+ [ot, Gn] = s.Util.applyTransform([ot, Gn], mt), this.minX = Math.min(this.minX, ot), this.minY = Math.min(this.minY, Gn), this.maxX = Math.max(this.maxX, ot), this.maxY = Math.max(this.maxY, Gn);
17594
17594
  }
17595
17595
  updateRectMinMax(mt, ot) {
17596
- const Xn = s.Util.applyTransform(ot, mt), It = s.Util.applyTransform(ot.slice(2), mt);
17597
- this.minX = Math.min(this.minX, Xn[0], It[0]), this.minY = Math.min(this.minY, Xn[1], It[1]), this.maxX = Math.max(this.maxX, Xn[0], It[0]), this.maxY = Math.max(this.maxY, Xn[1], It[1]);
17596
+ const Gn = s.Util.applyTransform(ot, mt), It = s.Util.applyTransform(ot.slice(2), mt);
17597
+ this.minX = Math.min(this.minX, Gn[0], It[0]), this.minY = Math.min(this.minY, Gn[1], It[1]), this.maxX = Math.max(this.maxX, Gn[0], It[0]), this.maxY = Math.max(this.maxY, Gn[1], It[1]);
17598
17598
  }
17599
17599
  updateScalingPathMinMax(mt, ot) {
17600
17600
  s.Util.scaleMinMax(mt, ot), this.minX = Math.min(this.minX, ot[0]), this.maxX = Math.max(this.maxX, ot[1]), this.minY = Math.min(this.minY, ot[2]), this.maxY = Math.max(this.maxY, ot[3]);
17601
17601
  }
17602
- updateCurvePathMinMax(mt, ot, Xn, It, Kn, Gn, me, kt, St, zt) {
17603
- const Un = s.Util.bezierBoundingBox(ot, Xn, It, Kn, Gn, me, kt, St);
17602
+ updateCurvePathMinMax(mt, ot, Gn, It, Xn, Kn, me, kt, St, zt) {
17603
+ const Un = s.Util.bezierBoundingBox(ot, Gn, It, Xn, Kn, me, kt, St);
17604
17604
  if (zt) {
17605
17605
  zt[0] = Math.min(zt[0], Un[0], Un[2]), zt[1] = Math.max(zt[1], Un[0], Un[2]), zt[2] = Math.min(zt[2], Un[1], Un[3]), zt[3] = Math.max(zt[3], Un[1], Un[3]);
17606
17606
  return;
@@ -17608,13 +17608,13 @@ function requirePdf() {
17608
17608
  this.updateRectMinMax(mt, Un);
17609
17609
  }
17610
17610
  getPathBoundingBox(mt = i.PathType.FILL, ot = null) {
17611
- const Xn = [this.minX, this.minY, this.maxX, this.maxY];
17611
+ const Gn = [this.minX, this.minY, this.maxX, this.maxY];
17612
17612
  if (mt === i.PathType.STROKE) {
17613
17613
  ot || (0, s.unreachable)("Stroke bounding box must include transform.");
17614
- const It = s.Util.singularValueDecompose2dScale(ot), Kn = It[0] * this.lineWidth / 2, Gn = It[1] * this.lineWidth / 2;
17615
- Xn[0] -= Kn, Xn[1] -= Gn, Xn[2] += Kn, Xn[3] += Gn;
17614
+ const It = s.Util.singularValueDecompose2dScale(ot), Xn = It[0] * this.lineWidth / 2, Kn = It[1] * this.lineWidth / 2;
17615
+ Gn[0] -= Xn, Gn[1] -= Kn, Gn[2] += Xn, Gn[3] += Kn;
17616
17616
  }
17617
- return Xn;
17617
+ return Gn;
17618
17618
  }
17619
17619
  updateClipFromPath() {
17620
17620
  const mt = s.Util.intersect(this.clipBox, this.getPathBoundingBox());
@@ -17635,7 +17635,7 @@ function requirePdf() {
17635
17635
  ur.putImageData(mt, 0, 0);
17636
17636
  return;
17637
17637
  }
17638
- const Xn = mt.height, It = mt.width, Kn = Xn % E, Gn = (Xn - Kn) / E, me = Kn === 0 ? Gn : Gn + 1, kt = ur.createImageData(It, E);
17638
+ const Gn = mt.height, It = mt.width, Xn = Gn % E, Kn = (Gn - Xn) / E, me = Xn === 0 ? Kn : Kn + 1, kt = ur.createImageData(It, E);
17639
17639
  let St = 0, zt;
17640
17640
  const Un = mt.data, nr = kt.data;
17641
17641
  let Yn, un, Fr, Ni, Si, Ti, ji, Ha;
@@ -17649,33 +17649,33 @@ function requirePdf() {
17649
17649
  break;
17650
17650
  }
17651
17651
  if (mt.kind === s.ImageKind.GRAYSCALE_1BPP) {
17652
- const ml = Un.byteLength, dl = new Uint32Array(nr.buffer, 0, nr.byteLength >> 2), Fl = dl.length, Al = It + 7 >> 3;
17653
- let Dl = 4294967295, xl = s.FeatureTest.isLittleEndian ? 4278190080 : 255;
17654
- for (Ha && Ha[0] === 255 && Ha[255] === 0 && ([Dl, xl] = [xl, Dl]), Yn = 0; Yn < me; Yn++) {
17655
- for (Fr = Yn < Gn ? E : Kn, zt = 0, un = 0; un < Fr; un++) {
17652
+ const ml = Un.byteLength, dl = new Uint32Array(nr.buffer, 0, nr.byteLength >> 2), wl = dl.length, Dl = It + 7 >> 3;
17653
+ let Fl = 4294967295, Bl = s.FeatureTest.isLittleEndian ? 4278190080 : 255;
17654
+ for (Ha && Ha[0] === 255 && Ha[255] === 0 && ([Fl, Bl] = [Bl, Fl]), Yn = 0; Yn < me; Yn++) {
17655
+ for (Fr = Yn < Kn ? E : Xn, zt = 0, un = 0; un < Fr; un++) {
17656
17656
  const Pl = ml - St;
17657
17657
  let Ol = 0;
17658
- const Rl = Pl > Al ? It : Pl * 8 - 7, fg = Rl & -8;
17658
+ const Rl = Pl > Dl ? It : Pl * 8 - 7, fg = Rl & -8;
17659
17659
  let cg = 0, lg = 0;
17660
17660
  for (; Ol < fg; Ol += 8)
17661
- lg = Un[St++], dl[zt++] = lg & 128 ? Dl : xl, dl[zt++] = lg & 64 ? Dl : xl, dl[zt++] = lg & 32 ? Dl : xl, dl[zt++] = lg & 16 ? Dl : xl, dl[zt++] = lg & 8 ? Dl : xl, dl[zt++] = lg & 4 ? Dl : xl, dl[zt++] = lg & 2 ? Dl : xl, dl[zt++] = lg & 1 ? Dl : xl;
17661
+ lg = Un[St++], dl[zt++] = lg & 128 ? Fl : Bl, dl[zt++] = lg & 64 ? Fl : Bl, dl[zt++] = lg & 32 ? Fl : Bl, dl[zt++] = lg & 16 ? Fl : Bl, dl[zt++] = lg & 8 ? Fl : Bl, dl[zt++] = lg & 4 ? Fl : Bl, dl[zt++] = lg & 2 ? Fl : Bl, dl[zt++] = lg & 1 ? Fl : Bl;
17662
17662
  for (; Ol < Rl; Ol++)
17663
- cg === 0 && (lg = Un[St++], cg = 128), dl[zt++] = lg & cg ? Dl : xl, cg >>= 1;
17663
+ cg === 0 && (lg = Un[St++], cg = 128), dl[zt++] = lg & cg ? Fl : Bl, cg >>= 1;
17664
17664
  }
17665
- for (; zt < Fl; )
17665
+ for (; zt < wl; )
17666
17666
  dl[zt++] = 0;
17667
17667
  ur.putImageData(kt, 0, Yn * E);
17668
17668
  }
17669
17669
  } else if (mt.kind === s.ImageKind.RGBA_32BPP) {
17670
17670
  const ml = !!(Si || Ti || ji);
17671
- for (un = 0, Ni = It * E * 4, Yn = 0; Yn < Gn; Yn++) {
17671
+ for (un = 0, Ni = It * E * 4, Yn = 0; Yn < Kn; Yn++) {
17672
17672
  if (nr.set(Un.subarray(St, St + Ni)), St += Ni, ml)
17673
17673
  for (let dl = 0; dl < Ni; dl += 4)
17674
17674
  Si && (nr[dl + 0] = Si[nr[dl + 0]]), Ti && (nr[dl + 1] = Ti[nr[dl + 1]]), ji && (nr[dl + 2] = ji[nr[dl + 2]]);
17675
17675
  ur.putImageData(kt, 0, un), un += E;
17676
17676
  }
17677
17677
  if (Yn < me) {
17678
- if (Ni = It * Kn * 4, nr.set(Un.subarray(St, St + Ni)), ml)
17678
+ if (Ni = It * Xn * 4, nr.set(Un.subarray(St, St + Ni)), ml)
17679
17679
  for (let dl = 0; dl < Ni; dl += 4)
17680
17680
  Si && (nr[dl + 0] = Si[nr[dl + 0]]), Ti && (nr[dl + 1] = Ti[nr[dl + 1]]), ji && (nr[dl + 2] = ji[nr[dl + 2]]);
17681
17681
  ur.putImageData(kt, 0, un);
@@ -17683,7 +17683,7 @@ function requirePdf() {
17683
17683
  } else if (mt.kind === s.ImageKind.RGB_24BPP) {
17684
17684
  const ml = !!(Si || Ti || ji);
17685
17685
  for (Fr = E, Ni = It * Fr, Yn = 0; Yn < me; Yn++) {
17686
- for (Yn >= Gn && (Fr = Kn, Ni = It * Fr), zt = 0, un = Ni; un--; )
17686
+ for (Yn >= Kn && (Fr = Xn, Ni = It * Fr), zt = 0, un = Ni; un--; )
17687
17687
  nr[zt++] = Un[St++], nr[zt++] = Un[St++], nr[zt++] = Un[St++], nr[zt++] = 255;
17688
17688
  if (ml)
17689
17689
  for (let dl = 0; dl < zt; dl += 4)
@@ -17698,83 +17698,83 @@ function requirePdf() {
17698
17698
  ur.drawImage(mt.bitmap, 0, 0);
17699
17699
  return;
17700
17700
  }
17701
- const ot = mt.height, Xn = mt.width, It = ot % E, Kn = (ot - It) / E, Gn = It === 0 ? Kn : Kn + 1, me = ur.createImageData(Xn, E);
17701
+ const ot = mt.height, Gn = mt.width, It = ot % E, Xn = (ot - It) / E, Kn = It === 0 ? Xn : Xn + 1, me = ur.createImageData(Gn, E);
17702
17702
  let kt = 0;
17703
17703
  const St = mt.data, zt = me.data;
17704
- for (let Un = 0; Un < Gn; Un++) {
17705
- const nr = Un < Kn ? E : It;
17704
+ for (let Un = 0; Un < Kn; Un++) {
17705
+ const nr = Un < Xn ? E : It;
17706
17706
  ({
17707
17707
  srcPos: kt
17708
17708
  } = (0, a.applyMaskImageData)({
17709
17709
  src: St,
17710
17710
  srcPos: kt,
17711
17711
  dest: zt,
17712
- width: Xn,
17712
+ width: Gn,
17713
17713
  height: nr
17714
17714
  })), ur.putImageData(me, 0, Un * E);
17715
17715
  }
17716
17716
  }
17717
17717
  function P(ur, mt) {
17718
17718
  const ot = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font"];
17719
- for (let Xn = 0, It = ot.length; Xn < It; Xn++) {
17720
- const Kn = ot[Xn];
17721
- ur[Kn] !== void 0 && (mt[Kn] = ur[Kn]);
17719
+ for (let Gn = 0, It = ot.length; Gn < It; Gn++) {
17720
+ const Xn = ot[Gn];
17721
+ ur[Xn] !== void 0 && (mt[Xn] = ur[Xn]);
17722
17722
  }
17723
17723
  ur.setLineDash !== void 0 && (mt.setLineDash(ur.getLineDash()), mt.lineDashOffset = ur.lineDashOffset);
17724
17724
  }
17725
17725
  function p(ur, mt) {
17726
17726
  ur.strokeStyle = ur.fillStyle = mt || "#000000", ur.fillRule = "nonzero", ur.globalAlpha = 1, ur.lineWidth = 1, ur.lineCap = "butt", ur.lineJoin = "miter", ur.miterLimit = 10, ur.globalCompositeOperation = "source-over", ur.font = "10px sans-serif", ur.setLineDash !== void 0 && (ur.setLineDash([]), ur.lineDashOffset = 0);
17727
17727
  }
17728
- function Dt(ur, mt, ot, Xn) {
17728
+ function Dt(ur, mt, ot, Gn) {
17729
17729
  const It = ur.length;
17730
- for (let Kn = 3; Kn < It; Kn += 4) {
17731
- const Gn = ur[Kn];
17732
- if (Gn === 0)
17733
- ur[Kn - 3] = mt, ur[Kn - 2] = ot, ur[Kn - 1] = Xn;
17734
- else if (Gn < 255) {
17735
- const me = 255 - Gn;
17736
- ur[Kn - 3] = ur[Kn - 3] * Gn + mt * me >> 8, ur[Kn - 2] = ur[Kn - 2] * Gn + ot * me >> 8, ur[Kn - 1] = ur[Kn - 1] * Gn + Xn * me >> 8;
17730
+ for (let Xn = 3; Xn < It; Xn += 4) {
17731
+ const Kn = ur[Xn];
17732
+ if (Kn === 0)
17733
+ ur[Xn - 3] = mt, ur[Xn - 2] = ot, ur[Xn - 1] = Gn;
17734
+ else if (Kn < 255) {
17735
+ const me = 255 - Kn;
17736
+ ur[Xn - 3] = ur[Xn - 3] * Kn + mt * me >> 8, ur[Xn - 2] = ur[Xn - 2] * Kn + ot * me >> 8, ur[Xn - 1] = ur[Xn - 1] * Kn + Gn * me >> 8;
17737
17737
  }
17738
17738
  }
17739
17739
  }
17740
17740
  function Lt(ur, mt, ot) {
17741
- const Xn = ur.length, It = 1 / 255;
17742
- for (let Kn = 3; Kn < Xn; Kn += 4) {
17743
- const Gn = ot ? ot[ur[Kn]] : ur[Kn];
17744
- mt[Kn] = mt[Kn] * Gn * It | 0;
17741
+ const Gn = ur.length, It = 1 / 255;
17742
+ for (let Xn = 3; Xn < Gn; Xn += 4) {
17743
+ const Kn = ot ? ot[ur[Xn]] : ur[Xn];
17744
+ mt[Xn] = mt[Xn] * Kn * It | 0;
17745
17745
  }
17746
17746
  }
17747
17747
  function Zn(ur, mt, ot) {
17748
- const Xn = ur.length;
17749
- for (let It = 3; It < Xn; It += 4) {
17750
- const Kn = ur[It - 3] * 77 + ur[It - 2] * 152 + ur[It - 1] * 28;
17751
- mt[It] = ot ? mt[It] * ot[Kn >> 8] >> 8 : mt[It] * Kn >> 16;
17748
+ const Gn = ur.length;
17749
+ for (let It = 3; It < Gn; It += 4) {
17750
+ const Xn = ur[It - 3] * 77 + ur[It - 2] * 152 + ur[It - 1] * 28;
17751
+ mt[It] = ot ? mt[It] * ot[Xn >> 8] >> 8 : mt[It] * Xn >> 16;
17752
17752
  }
17753
17753
  }
17754
- function ln(ur, mt, ot, Xn, It, Kn, Gn, me, kt, St, zt) {
17755
- const Un = !!Kn, nr = Un ? Kn[0] : 0, Yn = Un ? Kn[1] : 0, un = Un ? Kn[2] : 0;
17754
+ function ln(ur, mt, ot, Gn, It, Xn, Kn, me, kt, St, zt) {
17755
+ const Un = !!Xn, nr = Un ? Xn[0] : 0, Yn = Un ? Xn[1] : 0, un = Un ? Xn[2] : 0;
17756
17756
  let Fr;
17757
17757
  It === "Luminosity" ? Fr = Zn : Fr = Lt;
17758
- const Si = Math.min(Xn, Math.ceil(1048576 / ot));
17759
- for (let Ti = 0; Ti < Xn; Ti += Si) {
17760
- const ji = Math.min(Si, Xn - Ti), Ha = ur.getImageData(me - St, Ti + (kt - zt), ot, ji), ml = mt.getImageData(me, Ti + kt, ot, ji);
17761
- Un && Dt(Ha.data, nr, Yn, un), Fr(Ha.data, ml.data, Gn), mt.putImageData(ml, me, Ti + kt);
17758
+ const Si = Math.min(Gn, Math.ceil(1048576 / ot));
17759
+ for (let Ti = 0; Ti < Gn; Ti += Si) {
17760
+ const ji = Math.min(Si, Gn - Ti), Ha = ur.getImageData(me - St, Ti + (kt - zt), ot, ji), ml = mt.getImageData(me, Ti + kt, ot, ji);
17761
+ Un && Dt(Ha.data, nr, Yn, un), Fr(Ha.data, ml.data, Kn), mt.putImageData(ml, me, Ti + kt);
17762
17762
  }
17763
17763
  }
17764
- function qs(ur, mt, ot, Xn) {
17765
- const It = Xn[0], Kn = Xn[1], Gn = Xn[2] - It, me = Xn[3] - Kn;
17766
- Gn === 0 || me === 0 || (ln(mt.context, ot, Gn, me, mt.subtype, mt.backdrop, mt.transferMap, It, Kn, mt.offsetX, mt.offsetY), ur.save(), ur.globalAlpha = 1, ur.globalCompositeOperation = "source-over", ur.setTransform(1, 0, 0, 1, 0, 0), ur.drawImage(ot.canvas, 0, 0), ur.restore());
17764
+ function qs(ur, mt, ot, Gn) {
17765
+ const It = Gn[0], Xn = Gn[1], Kn = Gn[2] - It, me = Gn[3] - Xn;
17766
+ Kn === 0 || me === 0 || (ln(mt.context, ot, Kn, me, mt.subtype, mt.backdrop, mt.transferMap, It, Xn, mt.offsetX, mt.offsetY), ur.save(), ur.globalAlpha = 1, ur.globalCompositeOperation = "source-over", ur.setTransform(1, 0, 0, 1, 0, 0), ur.drawImage(ot.canvas, 0, 0), ur.restore());
17767
17767
  }
17768
17768
  function ki(ur, mt) {
17769
17769
  const ot = s.Util.singularValueDecompose2dScale(ur);
17770
17770
  ot[0] = Math.fround(ot[0]), ot[1] = Math.fround(ot[1]);
17771
- const Xn = Math.fround((globalThis.devicePixelRatio || 1) * r.PixelsPerInch.PDF_TO_CSS_UNITS);
17772
- return mt !== void 0 ? mt : ot[0] <= Xn || ot[1] <= Xn;
17771
+ const Gn = Math.fround((globalThis.devicePixelRatio || 1) * r.PixelsPerInch.PDF_TO_CSS_UNITS);
17772
+ return mt !== void 0 ? mt : ot[0] <= Gn || ot[1] <= Gn;
17773
17773
  }
17774
17774
  const As = ["butt", "round", "square"], Ur = ["miter", "round", "bevel"], Br = {}, Ar = {}, hl = class hl {
17775
- constructor(mt, ot, Xn, It, Kn, Gn, me, kt) {
17775
+ constructor(mt, ot, Gn, It, Xn, Kn, me, kt) {
17776
17776
  bl(this, Pi);
17777
- this.ctx = mt, this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = ot, this.objs = Xn, this.canvasFactory = It, this.imageLayer = Kn, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = [], this.optionalContentConfig = Gn, this.cachedCanvases = new o(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = me, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.backgroundColor = (kt == null ? void 0 : kt.background) || null, this.foregroundColor = (kt == null ? void 0 : kt.foreground) || null, this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
17777
+ this.ctx = mt, this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = ot, this.objs = Gn, this.canvasFactory = It, this.imageLayer = Xn, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = [], this.optionalContentConfig = Kn, this.cachedCanvases = new o(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = me, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.backgroundColor = (kt == null ? void 0 : kt.background) || null, this.foregroundColor = (kt == null ? void 0 : kt.foreground) || null, this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
17778
17778
  }
17779
17779
  getObject(mt, ot = null) {
17780
17780
  return typeof mt == "string" ? mt.startsWith("g_") ? this.commonObjs.get(mt) : this.objs.get(mt) : ot;
@@ -17782,10 +17782,10 @@ function requirePdf() {
17782
17782
  beginDrawing({
17783
17783
  transform: mt,
17784
17784
  viewport: ot,
17785
- transparency: Xn = !1,
17785
+ transparency: Gn = !1,
17786
17786
  background: It = null
17787
17787
  }) {
17788
- const Kn = this.ctx.canvas.width, Gn = this.ctx.canvas.height, me = It || "#ffffff";
17788
+ const Xn = this.ctx.canvas.width, Kn = this.ctx.canvas.height, me = It || "#ffffff";
17789
17789
  if (this.ctx.save(), this.foregroundColor && this.backgroundColor) {
17790
17790
  this.ctx.fillStyle = this.foregroundColor;
17791
17791
  const kt = this.foregroundColor = this.ctx.fillStyle;
@@ -17802,38 +17802,38 @@ function requirePdf() {
17802
17802
  };
17803
17803
  }
17804
17804
  }
17805
- if (this.ctx.fillStyle = this.backgroundColor || me, this.ctx.fillRect(0, 0, Kn, Gn), this.ctx.restore(), Xn) {
17806
- const kt = this.cachedCanvases.getCanvas("transparent", Kn, Gn);
17805
+ if (this.ctx.fillStyle = this.backgroundColor || me, this.ctx.fillRect(0, 0, Xn, Kn), this.ctx.restore(), Gn) {
17806
+ const kt = this.cachedCanvases.getCanvas("transparent", Xn, Kn);
17807
17807
  this.compositeCtx = this.ctx, this.transparentCanvas = kt.canvas, this.ctx = kt.context, this.ctx.save(), this.ctx.transform(...(0, r.getCurrentTransform)(this.compositeCtx));
17808
17808
  }
17809
17809
  this.ctx.save(), p(this.ctx, this.foregroundColor), mt && (this.ctx.transform(...mt), this.outputScaleX = mt[0], this.outputScaleY = mt[0]), this.ctx.transform(...ot.transform), this.viewportScale = ot.scale, this.baseTransform = (0, r.getCurrentTransform)(this.ctx), this.imageLayer && ((0, r.deprecated)("The `imageLayer` functionality will be removed in the future."), this.imageLayer.beginLayout());
17810
17810
  }
17811
- executeOperatorList(mt, ot, Xn, It) {
17812
- const Kn = mt.argsArray, Gn = mt.fnArray;
17811
+ executeOperatorList(mt, ot, Gn, It) {
17812
+ const Xn = mt.argsArray, Kn = mt.fnArray;
17813
17813
  let me = ot || 0;
17814
- const kt = Kn.length;
17814
+ const kt = Xn.length;
17815
17815
  if (kt === me)
17816
17816
  return me;
17817
- const St = kt - me > de && typeof Xn == "function", zt = St ? Date.now() + tt : 0;
17817
+ const St = kt - me > de && typeof Gn == "function", zt = St ? Date.now() + tt : 0;
17818
17818
  let Un = 0;
17819
17819
  const nr = this.commonObjs, Yn = this.objs;
17820
17820
  let un;
17821
17821
  for (; ; ) {
17822
17822
  if (It !== void 0 && me === It.nextBreakPoint)
17823
- return It.breakIt(me, Xn), me;
17824
- if (un = Gn[me], un !== s.OPS.dependency)
17825
- this[un].apply(this, Kn[me]);
17823
+ return It.breakIt(me, Gn), me;
17824
+ if (un = Kn[me], un !== s.OPS.dependency)
17825
+ this[un].apply(this, Xn[me]);
17826
17826
  else
17827
- for (const Fr of Kn[me]) {
17827
+ for (const Fr of Xn[me]) {
17828
17828
  const Ni = Fr.startsWith("g_") ? nr : Yn;
17829
17829
  if (!Ni.has(Fr))
17830
- return Ni.get(Fr, Xn), me;
17830
+ return Ni.get(Fr, Gn), me;
17831
17831
  }
17832
17832
  if (me++, me === kt)
17833
17833
  return me;
17834
17834
  if (St && ++Un > de) {
17835
17835
  if (Date.now() > zt)
17836
- return Xn(), me;
17836
+ return Gn(), me;
17837
17837
  Un = 0;
17838
17838
  }
17839
17839
  }
@@ -17848,11 +17848,11 @@ function requirePdf() {
17848
17848
  this._cachedBitmapsMap.clear(), this.imageLayer && this.imageLayer.endLayout();
17849
17849
  }
17850
17850
  _scaleImage(mt, ot) {
17851
- const Xn = mt.width, It = mt.height;
17852
- let Kn = Math.max(Math.hypot(ot[0], ot[1]), 1), Gn = Math.max(Math.hypot(ot[2], ot[3]), 1), me = Xn, kt = It, St = "prescale1", zt, Un;
17853
- for (; Kn > 2 && me > 1 || Gn > 2 && kt > 1; ) {
17851
+ const Gn = mt.width, It = mt.height;
17852
+ let Xn = Math.max(Math.hypot(ot[0], ot[1]), 1), Kn = Math.max(Math.hypot(ot[2], ot[3]), 1), me = Gn, kt = It, St = "prescale1", zt, Un;
17853
+ for (; Xn > 2 && me > 1 || Kn > 2 && kt > 1; ) {
17854
17854
  let nr = me, Yn = kt;
17855
- Kn > 2 && me > 1 && (nr = Math.ceil(me / 2), Kn /= me / nr), Gn > 2 && kt > 1 && (Yn = Math.ceil(kt / 2), Gn /= kt / Yn), zt = this.cachedCanvases.getCanvas(St, nr, Yn), Un = zt.context, Un.clearRect(0, 0, nr, Yn), Un.drawImage(mt, 0, 0, me, kt, 0, 0, nr, Yn), mt = zt.canvas, me = nr, kt = Yn, St = St === "prescale1" ? "prescale2" : "prescale1";
17855
+ Xn > 2 && me > 1 && (nr = Math.ceil(me / 2), Xn /= me / nr), Kn > 2 && kt > 1 && (Yn = Math.ceil(kt / 2), Kn /= kt / Yn), zt = this.cachedCanvases.getCanvas(St, nr, Yn), Un = zt.context, Un.clearRect(0, 0, nr, Yn), Un.drawImage(mt, 0, 0, me, kt, 0, 0, nr, Yn), mt = zt.canvas, me = nr, kt = Yn, St = St === "prescale1" ? "prescale2" : "prescale1";
17856
17856
  }
17857
17857
  return {
17858
17858
  img: mt,
@@ -17862,31 +17862,31 @@ function requirePdf() {
17862
17862
  }
17863
17863
  _createMaskCanvas(mt) {
17864
17864
  const ot = this.ctx, {
17865
- width: Xn,
17865
+ width: Gn,
17866
17866
  height: It
17867
- } = mt, Kn = this.current.fillColor, Gn = this.current.patternFill, me = (0, r.getCurrentTransform)(ot);
17867
+ } = mt, Xn = this.current.fillColor, Kn = this.current.patternFill, me = (0, r.getCurrentTransform)(ot);
17868
17868
  let kt, St, zt, Un;
17869
17869
  if ((mt.bitmap || mt.data) && mt.count > 1) {
17870
- const Fl = mt.bitmap || mt.data.buffer, Al = me.slice(0, 4);
17871
- St = JSON.stringify(Gn ? Al : [Al, Kn]), kt = this._cachedBitmapsMap.get(Fl), kt || (kt = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(Fl, kt));
17872
- const Dl = kt.get(St);
17873
- if (Dl && !Gn) {
17874
- const xl = Math.round(Math.min(me[0], me[2]) + me[4]), Pl = Math.round(Math.min(me[1], me[3]) + me[5]);
17870
+ const wl = mt.bitmap || mt.data.buffer, Dl = me.slice(0, 4);
17871
+ St = JSON.stringify(Kn ? Dl : [Dl, Xn]), kt = this._cachedBitmapsMap.get(wl), kt || (kt = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(wl, kt));
17872
+ const Fl = kt.get(St);
17873
+ if (Fl && !Kn) {
17874
+ const Bl = Math.round(Math.min(me[0], me[2]) + me[4]), Pl = Math.round(Math.min(me[1], me[3]) + me[5]);
17875
17875
  return {
17876
- canvas: Dl,
17877
- offsetX: xl,
17876
+ canvas: Fl,
17877
+ offsetX: Bl,
17878
17878
  offsetY: Pl
17879
17879
  };
17880
17880
  }
17881
- zt = Dl;
17881
+ zt = Fl;
17882
17882
  }
17883
- zt || (Un = this.cachedCanvases.getCanvas("maskCanvas", Xn, It), N(Un.context, mt));
17884
- let nr = s.Util.transform(me, [1 / Xn, 0, 0, -1 / It, 0, 0]);
17883
+ zt || (Un = this.cachedCanvases.getCanvas("maskCanvas", Gn, It), N(Un.context, mt));
17884
+ let nr = s.Util.transform(me, [1 / Gn, 0, 0, -1 / It, 0, 0]);
17885
17885
  nr = s.Util.transform(nr, [1, 0, 0, 1, 0, -It]);
17886
- const Yn = s.Util.applyTransform([0, 0], nr), un = s.Util.applyTransform([Xn, It], nr), Fr = s.Util.normalizeRect([Yn[0], Yn[1], un[0], un[1]]), Ni = Math.round(Fr[2] - Fr[0]) || 1, Si = Math.round(Fr[3] - Fr[1]) || 1, Ti = this.cachedCanvases.getCanvas("fillCanvas", Ni, Si), ji = Ti.context, Ha = Math.min(Yn[0], un[0]), ml = Math.min(Yn[1], un[1]);
17887
- ji.translate(-Ha, -ml), ji.transform(...nr), zt || (zt = this._scaleImage(Un.canvas, (0, r.getCurrentTransformInverse)(ji)), zt = zt.img, kt && Gn && kt.set(St, zt)), ji.imageSmoothingEnabled = ki((0, r.getCurrentTransform)(ji), mt.interpolate), pe(ji, zt, 0, 0, zt.width, zt.height, 0, 0, Xn, It), ji.globalCompositeOperation = "source-in";
17886
+ const Yn = s.Util.applyTransform([0, 0], nr), un = s.Util.applyTransform([Gn, It], nr), Fr = s.Util.normalizeRect([Yn[0], Yn[1], un[0], un[1]]), Ni = Math.round(Fr[2] - Fr[0]) || 1, Si = Math.round(Fr[3] - Fr[1]) || 1, Ti = this.cachedCanvases.getCanvas("fillCanvas", Ni, Si), ji = Ti.context, Ha = Math.min(Yn[0], un[0]), ml = Math.min(Yn[1], un[1]);
17887
+ ji.translate(-Ha, -ml), ji.transform(...nr), zt || (zt = this._scaleImage(Un.canvas, (0, r.getCurrentTransformInverse)(ji)), zt = zt.img, kt && Kn && kt.set(St, zt)), ji.imageSmoothingEnabled = ki((0, r.getCurrentTransform)(ji), mt.interpolate), pe(ji, zt, 0, 0, zt.width, zt.height, 0, 0, Gn, It), ji.globalCompositeOperation = "source-in";
17888
17888
  const dl = s.Util.transform((0, r.getCurrentTransformInverse)(ji), [1, 0, 0, 1, -Ha, -ml]);
17889
- return ji.fillStyle = Gn ? Kn.getPattern(ot, this, dl, i.PathType.FILL) : Kn, ji.fillRect(0, 0, Xn, It), kt && !Gn && (this.cachedCanvases.delete("fillCanvas"), kt.set(St, Ti.canvas)), {
17889
+ return ji.fillStyle = Kn ? Xn.getPattern(ot, this, dl, i.PathType.FILL) : Xn, ji.fillRect(0, 0, Gn, It), kt && !Kn && (this.cachedCanvases.delete("fillCanvas"), kt.set(St, Ti.canvas)), {
17890
17890
  canvas: Ti.canvas,
17891
17891
  offsetX: Math.round(Ha),
17892
17892
  offsetY: Math.round(ml)
@@ -17905,40 +17905,40 @@ function requirePdf() {
17905
17905
  this.ctx.miterLimit = mt;
17906
17906
  }
17907
17907
  setDash(mt, ot) {
17908
- const Xn = this.ctx;
17909
- Xn.setLineDash !== void 0 && (Xn.setLineDash(mt), Xn.lineDashOffset = ot);
17908
+ const Gn = this.ctx;
17909
+ Gn.setLineDash !== void 0 && (Gn.setLineDash(mt), Gn.lineDashOffset = ot);
17910
17910
  }
17911
17911
  setRenderingIntent(mt) {
17912
17912
  }
17913
17913
  setFlatness(mt) {
17914
17914
  }
17915
17915
  setGState(mt) {
17916
- for (let ot = 0, Xn = mt.length; ot < Xn; ot++) {
17917
- const It = mt[ot], Kn = It[0], Gn = It[1];
17918
- switch (Kn) {
17916
+ for (let ot = 0, Gn = mt.length; ot < Gn; ot++) {
17917
+ const It = mt[ot], Xn = It[0], Kn = It[1];
17918
+ switch (Xn) {
17919
17919
  case "LW":
17920
- this.setLineWidth(Gn);
17920
+ this.setLineWidth(Kn);
17921
17921
  break;
17922
17922
  case "LC":
17923
- this.setLineCap(Gn);
17923
+ this.setLineCap(Kn);
17924
17924
  break;
17925
17925
  case "LJ":
17926
- this.setLineJoin(Gn);
17926
+ this.setLineJoin(Kn);
17927
17927
  break;
17928
17928
  case "ML":
17929
- this.setMiterLimit(Gn);
17929
+ this.setMiterLimit(Kn);
17930
17930
  break;
17931
17931
  case "D":
17932
- this.setDash(Gn[0], Gn[1]);
17932
+ this.setDash(Kn[0], Kn[1]);
17933
17933
  break;
17934
17934
  case "RI":
17935
- this.setRenderingIntent(Gn);
17935
+ this.setRenderingIntent(Kn);
17936
17936
  break;
17937
17937
  case "FL":
17938
- this.setFlatness(Gn);
17938
+ this.setFlatness(Kn);
17939
17939
  break;
17940
17940
  case "Font":
17941
- this.setFont(Gn[0], Gn[1]);
17941
+ this.setFont(Kn[0], Kn[1]);
17942
17942
  break;
17943
17943
  case "CA":
17944
17944
  this.current.strokeAlpha = It[1];
@@ -17947,13 +17947,13 @@ function requirePdf() {
17947
17947
  this.current.fillAlpha = It[1], this.ctx.globalAlpha = It[1];
17948
17948
  break;
17949
17949
  case "BM":
17950
- this.ctx.globalCompositeOperation = Gn;
17950
+ this.ctx.globalCompositeOperation = Kn;
17951
17951
  break;
17952
17952
  case "SMask":
17953
- this.current.activeSMask = Gn ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
17953
+ this.current.activeSMask = Kn ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
17954
17954
  break;
17955
17955
  case "TR":
17956
- this.current.transferMaps = Gn;
17956
+ this.current.transferMaps = Kn;
17957
17957
  }
17958
17958
  }
17959
17959
  }
@@ -17967,10 +17967,10 @@ function requirePdf() {
17967
17967
  beginSMaskMode() {
17968
17968
  if (this.inSMaskMode)
17969
17969
  throw new Error("beginSMaskMode called while already in smask mode");
17970
- const mt = this.ctx.canvas.width, ot = this.ctx.canvas.height, Xn = "smaskGroupAt" + this.groupLevel, It = this.cachedCanvases.getCanvas(Xn, mt, ot);
17970
+ const mt = this.ctx.canvas.width, ot = this.ctx.canvas.height, Gn = "smaskGroupAt" + this.groupLevel, It = this.cachedCanvases.getCanvas(Gn, mt, ot);
17971
17971
  this.suspendedCtx = this.ctx, this.ctx = It.context;
17972
- const Kn = this.ctx;
17973
- Kn.setTransform(...(0, r.getCurrentTransform)(this.suspendedCtx)), P(this.suspendedCtx, Kn), u(Kn, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
17972
+ const Xn = this.ctx;
17973
+ Xn.setTransform(...(0, r.getCurrentTransform)(this.suspendedCtx)), P(this.suspendedCtx, Xn), u(Xn, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
17974
17974
  }
17975
17975
  endSMaskMode() {
17976
17976
  if (!this.inSMaskMode)
@@ -17981,8 +17981,8 @@ function requirePdf() {
17981
17981
  if (!this.current.activeSMask)
17982
17982
  return;
17983
17983
  mt ? (mt[0] = Math.floor(mt[0]), mt[1] = Math.floor(mt[1]), mt[2] = Math.ceil(mt[2]), mt[3] = Math.ceil(mt[3])) : mt = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
17984
- const ot = this.current.activeSMask, Xn = this.suspendedCtx;
17985
- qs(Xn, ot, this.ctx, mt), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
17984
+ const ot = this.current.activeSMask, Gn = this.suspendedCtx;
17985
+ qs(Gn, ot, this.ctx, mt), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
17986
17986
  }
17987
17987
  save() {
17988
17988
  this.inSMaskMode ? (P(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
@@ -17992,59 +17992,59 @@ function requirePdf() {
17992
17992
  restore() {
17993
17993
  this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), P(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null);
17994
17994
  }
17995
- transform(mt, ot, Xn, It, Kn, Gn) {
17996
- this.ctx.transform(mt, ot, Xn, It, Kn, Gn), this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null;
17995
+ transform(mt, ot, Gn, It, Xn, Kn) {
17996
+ this.ctx.transform(mt, ot, Gn, It, Xn, Kn), this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null;
17997
17997
  }
17998
- constructPath(mt, ot, Xn) {
17999
- const It = this.ctx, Kn = this.current;
18000
- let Gn = Kn.x, me = Kn.y, kt, St;
18001
- const zt = (0, r.getCurrentTransform)(It), Un = zt[0] === 0 && zt[3] === 0 || zt[1] === 0 && zt[2] === 0, nr = Un ? Xn.slice(0) : null;
17998
+ constructPath(mt, ot, Gn) {
17999
+ const It = this.ctx, Xn = this.current;
18000
+ let Kn = Xn.x, me = Xn.y, kt, St;
18001
+ const zt = (0, r.getCurrentTransform)(It), Un = zt[0] === 0 && zt[3] === 0 || zt[1] === 0 && zt[2] === 0, nr = Un ? Gn.slice(0) : null;
18002
18002
  for (let Yn = 0, un = 0, Fr = mt.length; Yn < Fr; Yn++)
18003
18003
  switch (mt[Yn] | 0) {
18004
18004
  case s.OPS.rectangle:
18005
- Gn = ot[un++], me = ot[un++];
18006
- const Ni = ot[un++], Si = ot[un++], Ti = Gn + Ni, ji = me + Si;
18007
- It.moveTo(Gn, me), Ni === 0 || Si === 0 ? It.lineTo(Ti, ji) : (It.lineTo(Ti, me), It.lineTo(Ti, ji), It.lineTo(Gn, ji)), Un || Kn.updateRectMinMax(zt, [Gn, me, Ti, ji]), It.closePath();
18005
+ Kn = ot[un++], me = ot[un++];
18006
+ const Ni = ot[un++], Si = ot[un++], Ti = Kn + Ni, ji = me + Si;
18007
+ It.moveTo(Kn, me), Ni === 0 || Si === 0 ? It.lineTo(Ti, ji) : (It.lineTo(Ti, me), It.lineTo(Ti, ji), It.lineTo(Kn, ji)), Un || Xn.updateRectMinMax(zt, [Kn, me, Ti, ji]), It.closePath();
18008
18008
  break;
18009
18009
  case s.OPS.moveTo:
18010
- Gn = ot[un++], me = ot[un++], It.moveTo(Gn, me), Un || Kn.updatePathMinMax(zt, Gn, me);
18010
+ Kn = ot[un++], me = ot[un++], It.moveTo(Kn, me), Un || Xn.updatePathMinMax(zt, Kn, me);
18011
18011
  break;
18012
18012
  case s.OPS.lineTo:
18013
- Gn = ot[un++], me = ot[un++], It.lineTo(Gn, me), Un || Kn.updatePathMinMax(zt, Gn, me);
18013
+ Kn = ot[un++], me = ot[un++], It.lineTo(Kn, me), Un || Xn.updatePathMinMax(zt, Kn, me);
18014
18014
  break;
18015
18015
  case s.OPS.curveTo:
18016
- kt = Gn, St = me, Gn = ot[un + 4], me = ot[un + 5], It.bezierCurveTo(ot[un], ot[un + 1], ot[un + 2], ot[un + 3], Gn, me), Kn.updateCurvePathMinMax(zt, kt, St, ot[un], ot[un + 1], ot[un + 2], ot[un + 3], Gn, me, nr), un += 6;
18016
+ kt = Kn, St = me, Kn = ot[un + 4], me = ot[un + 5], It.bezierCurveTo(ot[un], ot[un + 1], ot[un + 2], ot[un + 3], Kn, me), Xn.updateCurvePathMinMax(zt, kt, St, ot[un], ot[un + 1], ot[un + 2], ot[un + 3], Kn, me, nr), un += 6;
18017
18017
  break;
18018
18018
  case s.OPS.curveTo2:
18019
- kt = Gn, St = me, It.bezierCurveTo(Gn, me, ot[un], ot[un + 1], ot[un + 2], ot[un + 3]), Kn.updateCurvePathMinMax(zt, kt, St, Gn, me, ot[un], ot[un + 1], ot[un + 2], ot[un + 3], nr), Gn = ot[un + 2], me = ot[un + 3], un += 4;
18019
+ kt = Kn, St = me, It.bezierCurveTo(Kn, me, ot[un], ot[un + 1], ot[un + 2], ot[un + 3]), Xn.updateCurvePathMinMax(zt, kt, St, Kn, me, ot[un], ot[un + 1], ot[un + 2], ot[un + 3], nr), Kn = ot[un + 2], me = ot[un + 3], un += 4;
18020
18020
  break;
18021
18021
  case s.OPS.curveTo3:
18022
- kt = Gn, St = me, Gn = ot[un + 2], me = ot[un + 3], It.bezierCurveTo(ot[un], ot[un + 1], Gn, me, Gn, me), Kn.updateCurvePathMinMax(zt, kt, St, ot[un], ot[un + 1], Gn, me, Gn, me, nr), un += 4;
18022
+ kt = Kn, St = me, Kn = ot[un + 2], me = ot[un + 3], It.bezierCurveTo(ot[un], ot[un + 1], Kn, me, Kn, me), Xn.updateCurvePathMinMax(zt, kt, St, ot[un], ot[un + 1], Kn, me, Kn, me, nr), un += 4;
18023
18023
  break;
18024
18024
  case s.OPS.closePath:
18025
18025
  It.closePath();
18026
18026
  break;
18027
18027
  }
18028
- Un && Kn.updateScalingPathMinMax(zt, nr), Kn.setCurrentPoint(Gn, me);
18028
+ Un && Xn.updateScalingPathMinMax(zt, nr), Xn.setCurrentPoint(Kn, me);
18029
18029
  }
18030
18030
  closePath() {
18031
18031
  this.ctx.closePath();
18032
18032
  }
18033
18033
  stroke(mt) {
18034
18034
  mt = typeof mt < "u" ? mt : !0;
18035
- const ot = this.ctx, Xn = this.current.strokeColor;
18036
- ot.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof Xn == "object" && (Xn != null && Xn.getPattern) ? (ot.save(), ot.strokeStyle = Xn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.STROKE), this.rescaleAndStroke(!1), ot.restore()) : this.rescaleAndStroke(!0)), mt && this.consumePath(this.current.getClippedPathBoundingBox()), ot.globalAlpha = this.current.fillAlpha;
18035
+ const ot = this.ctx, Gn = this.current.strokeColor;
18036
+ ot.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof Gn == "object" && (Gn != null && Gn.getPattern) ? (ot.save(), ot.strokeStyle = Gn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.STROKE), this.rescaleAndStroke(!1), ot.restore()) : this.rescaleAndStroke(!0)), mt && this.consumePath(this.current.getClippedPathBoundingBox()), ot.globalAlpha = this.current.fillAlpha;
18037
18037
  }
18038
18038
  closeStroke() {
18039
18039
  this.closePath(), this.stroke();
18040
18040
  }
18041
18041
  fill(mt) {
18042
18042
  mt = typeof mt < "u" ? mt : !0;
18043
- const ot = this.ctx, Xn = this.current.fillColor, It = this.current.patternFill;
18044
- let Kn = !1;
18045
- It && (ot.save(), ot.fillStyle = Xn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.FILL), Kn = !0);
18046
- const Gn = this.current.getClippedPathBoundingBox();
18047
- this.contentVisible && Gn !== null && (this.pendingEOFill ? (ot.fill("evenodd"), this.pendingEOFill = !1) : ot.fill()), Kn && ot.restore(), mt && this.consumePath(Gn);
18043
+ const ot = this.ctx, Gn = this.current.fillColor, It = this.current.patternFill;
18044
+ let Xn = !1;
18045
+ It && (ot.save(), ot.fillStyle = Gn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.FILL), Xn = !0);
18046
+ const Kn = this.current.getClippedPathBoundingBox();
18047
+ this.contentVisible && Kn !== null && (this.pendingEOFill ? (ot.fill("evenodd"), this.pendingEOFill = !1) : ot.fill()), Xn && ot.restore(), mt && this.consumePath(Kn);
18048
18048
  }
18049
18049
  eoFill() {
18050
18050
  this.pendingEOFill = !0, this.fill();
@@ -18080,8 +18080,8 @@ function requirePdf() {
18080
18080
  return;
18081
18081
  }
18082
18082
  ot.save(), ot.beginPath();
18083
- for (const Xn of mt)
18084
- ot.setTransform(...Xn.transform), ot.translate(Xn.x, Xn.y), Xn.addToPath(ot, Xn.fontSize);
18083
+ for (const Gn of mt)
18084
+ ot.setTransform(...Gn.transform), ot.translate(Gn.x, Gn.y), Gn.addToPath(ot, Gn.fontSize);
18085
18085
  ot.restore(), ot.clip(), ot.beginPath(), delete this.pendingTextPaths;
18086
18086
  }
18087
18087
  setCharSpacing(mt) {
@@ -18097,17 +18097,17 @@ function requirePdf() {
18097
18097
  this.current.leading = -mt;
18098
18098
  }
18099
18099
  setFont(mt, ot) {
18100
- const Xn = this.commonObjs.get(mt), It = this.current;
18101
- if (!Xn)
18100
+ const Gn = this.commonObjs.get(mt), It = this.current;
18101
+ if (!Gn)
18102
18102
  throw new Error(`Can't find font for ${mt}`);
18103
- if (It.fontMatrix = Xn.fontMatrix || s.FONT_IDENTITY_MATRIX, (It.fontMatrix[0] === 0 || It.fontMatrix[3] === 0) && (0, s.warn)("Invalid font matrix for font " + mt), ot < 0 ? (ot = -ot, It.fontDirection = -1) : It.fontDirection = 1, this.current.font = Xn, this.current.fontSize = ot, Xn.isType3Font)
18103
+ if (It.fontMatrix = Gn.fontMatrix || s.FONT_IDENTITY_MATRIX, (It.fontMatrix[0] === 0 || It.fontMatrix[3] === 0) && (0, s.warn)("Invalid font matrix for font " + mt), ot < 0 ? (ot = -ot, It.fontDirection = -1) : It.fontDirection = 1, this.current.font = Gn, this.current.fontSize = ot, Gn.isType3Font)
18104
18104
  return;
18105
- const Kn = Xn.loadedName || "sans-serif";
18106
- let Gn = "normal";
18107
- Xn.black ? Gn = "900" : Xn.bold && (Gn = "bold");
18108
- const me = Xn.italic ? "italic" : "normal", kt = `"${Kn}", ${Xn.fallbackName}`;
18105
+ const Xn = Gn.loadedName || "sans-serif";
18106
+ let Kn = "normal";
18107
+ Gn.black ? Kn = "900" : Gn.bold && (Kn = "bold");
18108
+ const me = Gn.italic ? "italic" : "normal", kt = `"${Xn}", ${Gn.fallbackName}`;
18109
18109
  let St = ot;
18110
- ot < h ? St = h : ot > l && (St = l), this.current.fontSizeScale = ot / St, this.ctx.font = `${me} ${Gn} ${St}px ${kt}`;
18110
+ ot < h ? St = h : ot > l && (St = l), this.current.fontSizeScale = ot / St, this.ctx.font = `${me} ${Kn} ${St}px ${kt}`;
18111
18111
  }
18112
18112
  setTextRenderingMode(mt) {
18113
18113
  this.current.textRenderingMode = mt;
@@ -18121,19 +18121,19 @@ function requirePdf() {
18121
18121
  setLeadingMoveText(mt, ot) {
18122
18122
  this.setLeading(-ot), this.moveText(mt, ot);
18123
18123
  }
18124
- setTextMatrix(mt, ot, Xn, It, Kn, Gn) {
18125
- this.current.textMatrix = [mt, ot, Xn, It, Kn, Gn], this.current.textMatrixScale = Math.hypot(mt, ot), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
18124
+ setTextMatrix(mt, ot, Gn, It, Xn, Kn) {
18125
+ this.current.textMatrix = [mt, ot, Gn, It, Xn, Kn], this.current.textMatrixScale = Math.hypot(mt, ot), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
18126
18126
  }
18127
18127
  nextLine() {
18128
18128
  this.moveText(0, this.current.leading);
18129
18129
  }
18130
- paintChar(mt, ot, Xn, It) {
18131
- const Kn = this.ctx, Gn = this.current, me = Gn.font, kt = Gn.textRenderingMode, St = Gn.fontSize / Gn.fontSizeScale, zt = kt & s.TextRenderingMode.FILL_STROKE_MASK, Un = !!(kt & s.TextRenderingMode.ADD_TO_PATH_FLAG), nr = Gn.patternFill && !me.missingFile;
18130
+ paintChar(mt, ot, Gn, It) {
18131
+ const Xn = this.ctx, Kn = this.current, me = Kn.font, kt = Kn.textRenderingMode, St = Kn.fontSize / Kn.fontSizeScale, zt = kt & s.TextRenderingMode.FILL_STROKE_MASK, Un = !!(kt & s.TextRenderingMode.ADD_TO_PATH_FLAG), nr = Kn.patternFill && !me.missingFile;
18132
18132
  let Yn;
18133
- (me.disableFontFace || Un || nr) && (Yn = me.getPathGenerator(this.commonObjs, mt)), me.disableFontFace || nr ? (Kn.save(), Kn.translate(ot, Xn), Kn.beginPath(), Yn(Kn, St), It && Kn.setTransform(...It), (zt === s.TextRenderingMode.FILL || zt === s.TextRenderingMode.FILL_STROKE) && Kn.fill(), (zt === s.TextRenderingMode.STROKE || zt === s.TextRenderingMode.FILL_STROKE) && Kn.stroke(), Kn.restore()) : ((zt === s.TextRenderingMode.FILL || zt === s.TextRenderingMode.FILL_STROKE) && Kn.fillText(mt, ot, Xn), (zt === s.TextRenderingMode.STROKE || zt === s.TextRenderingMode.FILL_STROKE) && Kn.strokeText(mt, ot, Xn)), Un && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
18134
- transform: (0, r.getCurrentTransform)(Kn),
18133
+ (me.disableFontFace || Un || nr) && (Yn = me.getPathGenerator(this.commonObjs, mt)), me.disableFontFace || nr ? (Xn.save(), Xn.translate(ot, Gn), Xn.beginPath(), Yn(Xn, St), It && Xn.setTransform(...It), (zt === s.TextRenderingMode.FILL || zt === s.TextRenderingMode.FILL_STROKE) && Xn.fill(), (zt === s.TextRenderingMode.STROKE || zt === s.TextRenderingMode.FILL_STROKE) && Xn.stroke(), Xn.restore()) : ((zt === s.TextRenderingMode.FILL || zt === s.TextRenderingMode.FILL_STROKE) && Xn.fillText(mt, ot, Gn), (zt === s.TextRenderingMode.STROKE || zt === s.TextRenderingMode.FILL_STROKE) && Xn.strokeText(mt, ot, Gn)), Un && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
18134
+ transform: (0, r.getCurrentTransform)(Xn),
18135
18135
  x: ot,
18136
- y: Xn,
18136
+ y: Gn,
18137
18137
  fontSize: St,
18138
18138
  addToPath: Yn
18139
18139
  });
@@ -18144,28 +18144,28 @@ function requirePdf() {
18144
18144
  } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
18145
18145
  mt.scale(1.5, 1), mt.fillText("I", 0, 10);
18146
18146
  const ot = mt.getImageData(0, 0, 10, 10).data;
18147
- let Xn = !1;
18147
+ let Gn = !1;
18148
18148
  for (let It = 3; It < ot.length; It += 4)
18149
18149
  if (ot[It] > 0 && ot[It] < 255) {
18150
- Xn = !0;
18150
+ Gn = !0;
18151
18151
  break;
18152
18152
  }
18153
- return (0, s.shadow)(this, "isFontSubpixelAAEnabled", Xn);
18153
+ return (0, s.shadow)(this, "isFontSubpixelAAEnabled", Gn);
18154
18154
  }
18155
18155
  showText(mt) {
18156
- const ot = this.current, Xn = ot.font;
18157
- if (Xn.isType3Font)
18156
+ const ot = this.current, Gn = ot.font;
18157
+ if (Gn.isType3Font)
18158
18158
  return this.showType3Text(mt);
18159
18159
  const It = ot.fontSize;
18160
18160
  if (It === 0)
18161
18161
  return;
18162
- const Kn = this.ctx, Gn = ot.fontSizeScale, me = ot.charSpacing, kt = ot.wordSpacing, St = ot.fontDirection, zt = ot.textHScale * St, Un = mt.length, nr = Xn.vertical, Yn = nr ? 1 : -1, un = Xn.defaultVMetrics, Fr = It * ot.fontMatrix[0], Ni = ot.textRenderingMode === s.TextRenderingMode.FILL && !Xn.disableFontFace && !ot.patternFill;
18163
- Kn.save(), Kn.transform(...ot.textMatrix), Kn.translate(ot.x, ot.y + ot.textRise), St > 0 ? Kn.scale(zt, -1) : Kn.scale(zt, 1);
18162
+ const Xn = this.ctx, Kn = ot.fontSizeScale, me = ot.charSpacing, kt = ot.wordSpacing, St = ot.fontDirection, zt = ot.textHScale * St, Un = mt.length, nr = Gn.vertical, Yn = nr ? 1 : -1, un = Gn.defaultVMetrics, Fr = It * ot.fontMatrix[0], Ni = ot.textRenderingMode === s.TextRenderingMode.FILL && !Gn.disableFontFace && !ot.patternFill;
18163
+ Xn.save(), Xn.transform(...ot.textMatrix), Xn.translate(ot.x, ot.y + ot.textRise), St > 0 ? Xn.scale(zt, -1) : Xn.scale(zt, 1);
18164
18164
  let Si;
18165
18165
  if (ot.patternFill) {
18166
- Kn.save();
18167
- const dl = ot.fillColor.getPattern(Kn, this, (0, r.getCurrentTransformInverse)(Kn), i.PathType.FILL);
18168
- Si = (0, r.getCurrentTransform)(Kn), Kn.restore(), Kn.fillStyle = dl;
18166
+ Xn.save();
18167
+ const dl = ot.fillColor.getPattern(Xn, this, (0, r.getCurrentTransformInverse)(Xn), i.PathType.FILL);
18168
+ Si = (0, r.getCurrentTransform)(Xn), Xn.restore(), Xn.fillStyle = dl;
18169
18169
  }
18170
18170
  let Ti = ot.lineWidth;
18171
18171
  const ji = ot.textMatrixScale;
@@ -18174,7 +18174,7 @@ function requirePdf() {
18174
18174
  (dl === s.TextRenderingMode.STROKE || dl === s.TextRenderingMode.FILL_STROKE) && (Ti = this.getSinglePixelWidth());
18175
18175
  } else
18176
18176
  Ti /= ji;
18177
- Gn !== 1 && (Kn.scale(Gn, Gn), Ti /= Gn), Kn.lineWidth = Ti;
18177
+ Kn !== 1 && (Xn.scale(Kn, Kn), Ti /= Kn), Xn.lineWidth = Ti;
18178
18178
  let Ha = 0, ml;
18179
18179
  for (ml = 0; ml < Un; ++ml) {
18180
18180
  const dl = mt[ml];
@@ -18182,41 +18182,41 @@ function requirePdf() {
18182
18182
  Ha += Yn * dl * It / 1e3;
18183
18183
  continue;
18184
18184
  }
18185
- let Fl = !1;
18186
- const Al = (dl.isSpace ? kt : 0) + me, Dl = dl.fontChar, xl = dl.accent;
18185
+ let wl = !1;
18186
+ const Dl = (dl.isSpace ? kt : 0) + me, Fl = dl.fontChar, Bl = dl.accent;
18187
18187
  let Pl, Ol, Rl = dl.width;
18188
18188
  if (nr) {
18189
18189
  const cg = dl.vmetric || un, lg = -(dl.vmetric ? cg[1] : Rl * 0.5) * Fr, s0 = cg[2] * Fr;
18190
- Rl = cg ? -cg[0] : Rl, Pl = lg / Gn, Ol = (Ha + s0) / Gn;
18190
+ Rl = cg ? -cg[0] : Rl, Pl = lg / Kn, Ol = (Ha + s0) / Kn;
18191
18191
  } else
18192
- Pl = Ha / Gn, Ol = 0;
18193
- if (Xn.remeasure && Rl > 0) {
18194
- const cg = Kn.measureText(Dl).width * 1e3 / It * Gn;
18192
+ Pl = Ha / Kn, Ol = 0;
18193
+ if (Gn.remeasure && Rl > 0) {
18194
+ const cg = Xn.measureText(Fl).width * 1e3 / It * Kn;
18195
18195
  if (Rl < cg && this.isFontSubpixelAAEnabled) {
18196
18196
  const lg = Rl / cg;
18197
- Fl = !0, Kn.save(), Kn.scale(lg, 1), Pl /= lg;
18198
- } else Rl !== cg && (Pl += (Rl - cg) / 2e3 * It / Gn);
18197
+ wl = !0, Xn.save(), Xn.scale(lg, 1), Pl /= lg;
18198
+ } else Rl !== cg && (Pl += (Rl - cg) / 2e3 * It / Kn);
18199
18199
  }
18200
- if (this.contentVisible && (dl.isInFont || Xn.missingFile)) {
18201
- if (Ni && !xl)
18202
- Kn.fillText(Dl, Pl, Ol);
18203
- else if (this.paintChar(Dl, Pl, Ol, Si), xl) {
18204
- const cg = Pl + It * xl.offset.x / Gn, lg = Ol - It * xl.offset.y / Gn;
18205
- this.paintChar(xl.fontChar, cg, lg, Si);
18200
+ if (this.contentVisible && (dl.isInFont || Gn.missingFile)) {
18201
+ if (Ni && !Bl)
18202
+ Xn.fillText(Fl, Pl, Ol);
18203
+ else if (this.paintChar(Fl, Pl, Ol, Si), Bl) {
18204
+ const cg = Pl + It * Bl.offset.x / Kn, lg = Ol - It * Bl.offset.y / Kn;
18205
+ this.paintChar(Bl.fontChar, cg, lg, Si);
18206
18206
  }
18207
18207
  }
18208
18208
  let fg;
18209
- nr ? fg = Rl * Fr - Al * St : fg = Rl * Fr + Al * St, Ha += fg, Fl && Kn.restore();
18209
+ nr ? fg = Rl * Fr - Dl * St : fg = Rl * Fr + Dl * St, Ha += fg, wl && Xn.restore();
18210
18210
  }
18211
- nr ? ot.y -= Ha : ot.x += Ha * zt, Kn.restore(), this.compose();
18211
+ nr ? ot.y -= Ha : ot.x += Ha * zt, Xn.restore(), this.compose();
18212
18212
  }
18213
18213
  showType3Text(mt) {
18214
- const ot = this.ctx, Xn = this.current, It = Xn.font, Kn = Xn.fontSize, Gn = Xn.fontDirection, me = It.vertical ? 1 : -1, kt = Xn.charSpacing, St = Xn.wordSpacing, zt = Xn.textHScale * Gn, Un = Xn.fontMatrix || s.FONT_IDENTITY_MATRIX, nr = mt.length, Yn = Xn.textRenderingMode === s.TextRenderingMode.INVISIBLE;
18214
+ const ot = this.ctx, Gn = this.current, It = Gn.font, Xn = Gn.fontSize, Kn = Gn.fontDirection, me = It.vertical ? 1 : -1, kt = Gn.charSpacing, St = Gn.wordSpacing, zt = Gn.textHScale * Kn, Un = Gn.fontMatrix || s.FONT_IDENTITY_MATRIX, nr = mt.length, Yn = Gn.textRenderingMode === s.TextRenderingMode.INVISIBLE;
18215
18215
  let un, Fr, Ni, Si;
18216
- if (!(Yn || Kn === 0)) {
18217
- for (this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, ot.save(), ot.transform(...Xn.textMatrix), ot.translate(Xn.x, Xn.y), ot.scale(zt, Gn), un = 0; un < nr; ++un) {
18216
+ if (!(Yn || Xn === 0)) {
18217
+ for (this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, ot.save(), ot.transform(...Gn.textMatrix), ot.translate(Gn.x, Gn.y), ot.scale(zt, Kn), un = 0; un < nr; ++un) {
18218
18218
  if (Fr = mt[un], typeof Fr == "number") {
18219
- Si = me * Fr * Kn / 1e3, this.ctx.translate(Si, 0), Xn.x += Si * zt;
18219
+ Si = me * Fr * Xn / 1e3, this.ctx.translate(Si, 0), Gn.x += Si * zt;
18220
18220
  continue;
18221
18221
  }
18222
18222
  const Ti = (Fr.isSpace ? St : 0) + kt, ji = It.charProcOperatorList[Fr.operatorListId];
@@ -18224,23 +18224,23 @@ function requirePdf() {
18224
18224
  (0, s.warn)(`Type3 character "${Fr.operatorListId}" is not available.`);
18225
18225
  continue;
18226
18226
  }
18227
- this.contentVisible && (this.processingType3 = Fr, this.save(), ot.scale(Kn, Kn), ot.transform(...Un), this.executeOperatorList(ji), this.restore()), Ni = s.Util.applyTransform([Fr.width, 0], Un)[0] * Kn + Ti, ot.translate(Ni, 0), Xn.x += Ni * zt;
18227
+ this.contentVisible && (this.processingType3 = Fr, this.save(), ot.scale(Xn, Xn), ot.transform(...Un), this.executeOperatorList(ji), this.restore()), Ni = s.Util.applyTransform([Fr.width, 0], Un)[0] * Xn + Ti, ot.translate(Ni, 0), Gn.x += Ni * zt;
18228
18228
  }
18229
18229
  ot.restore(), this.processingType3 = null;
18230
18230
  }
18231
18231
  }
18232
18232
  setCharWidth(mt, ot) {
18233
18233
  }
18234
- setCharWidthAndBounds(mt, ot, Xn, It, Kn, Gn) {
18235
- this.ctx.rect(Xn, It, Kn - Xn, Gn - It), this.ctx.clip(), this.endPath();
18234
+ setCharWidthAndBounds(mt, ot, Gn, It, Xn, Kn) {
18235
+ this.ctx.rect(Gn, It, Xn - Gn, Kn - It), this.ctx.clip(), this.endPath();
18236
18236
  }
18237
18237
  getColorN_Pattern(mt) {
18238
18238
  let ot;
18239
18239
  if (mt[0] === "TilingPattern") {
18240
- const Xn = mt[1], It = this.baseTransform || (0, r.getCurrentTransform)(this.ctx), Kn = {
18241
- createCanvasGraphics: (Gn) => new hl(Gn, this.commonObjs, this.objs, this.canvasFactory)
18240
+ const Gn = mt[1], It = this.baseTransform || (0, r.getCurrentTransform)(this.ctx), Xn = {
18241
+ createCanvasGraphics: (Kn) => new hl(Kn, this.commonObjs, this.objs, this.canvasFactory)
18242
18242
  };
18243
- ot = new i.TilingPattern(mt, Xn, this.ctx, Kn, It);
18243
+ ot = new i.TilingPattern(mt, Gn, this.ctx, Xn, It);
18244
18244
  } else
18245
18245
  ot = this._getPattern(mt[1], mt[2]);
18246
18246
  return ot;
@@ -18251,30 +18251,30 @@ function requirePdf() {
18251
18251
  setFillColorN() {
18252
18252
  this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
18253
18253
  }
18254
- setStrokeRGBColor(mt, ot, Xn) {
18255
- var Kn;
18256
- const It = ((Kn = this.selectColor) == null ? void 0 : Kn.call(this, mt, ot, Xn)) || s.Util.makeHexColor(mt, ot, Xn);
18254
+ setStrokeRGBColor(mt, ot, Gn) {
18255
+ var Xn;
18256
+ const It = ((Xn = this.selectColor) == null ? void 0 : Xn.call(this, mt, ot, Gn)) || s.Util.makeHexColor(mt, ot, Gn);
18257
18257
  this.ctx.strokeStyle = It, this.current.strokeColor = It;
18258
18258
  }
18259
- setFillRGBColor(mt, ot, Xn) {
18260
- var Kn;
18261
- const It = ((Kn = this.selectColor) == null ? void 0 : Kn.call(this, mt, ot, Xn)) || s.Util.makeHexColor(mt, ot, Xn);
18259
+ setFillRGBColor(mt, ot, Gn) {
18260
+ var Xn;
18261
+ const It = ((Xn = this.selectColor) == null ? void 0 : Xn.call(this, mt, ot, Gn)) || s.Util.makeHexColor(mt, ot, Gn);
18262
18262
  this.ctx.fillStyle = It, this.current.fillColor = It, this.current.patternFill = !1;
18263
18263
  }
18264
18264
  _getPattern(mt, ot = null) {
18265
- let Xn;
18266
- return this.cachedPatterns.has(mt) ? Xn = this.cachedPatterns.get(mt) : (Xn = (0, i.getShadingPattern)(this.objs.get(mt)), this.cachedPatterns.set(mt, Xn)), ot && (Xn.matrix = ot), Xn;
18265
+ let Gn;
18266
+ return this.cachedPatterns.has(mt) ? Gn = this.cachedPatterns.get(mt) : (Gn = (0, i.getShadingPattern)(this.objs.get(mt)), this.cachedPatterns.set(mt, Gn)), ot && (Gn.matrix = ot), Gn;
18267
18267
  }
18268
18268
  shadingFill(mt) {
18269
18269
  if (!this.contentVisible)
18270
18270
  return;
18271
18271
  const ot = this.ctx;
18272
18272
  this.save();
18273
- const Xn = this._getPattern(mt);
18274
- ot.fillStyle = Xn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.SHADING);
18273
+ const Gn = this._getPattern(mt);
18274
+ ot.fillStyle = Gn.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.SHADING);
18275
18275
  const It = (0, r.getCurrentTransformInverse)(ot);
18276
18276
  if (It) {
18277
- const Kn = ot.canvas, Gn = Kn.width, me = Kn.height, kt = s.Util.applyTransform([0, 0], It), St = s.Util.applyTransform([0, me], It), zt = s.Util.applyTransform([Gn, 0], It), Un = s.Util.applyTransform([Gn, me], It), nr = Math.min(kt[0], St[0], zt[0], Un[0]), Yn = Math.min(kt[1], St[1], zt[1], Un[1]), un = Math.max(kt[0], St[0], zt[0], Un[0]), Fr = Math.max(kt[1], St[1], zt[1], Un[1]);
18277
+ const Xn = ot.canvas, Kn = Xn.width, me = Xn.height, kt = s.Util.applyTransform([0, 0], It), St = s.Util.applyTransform([0, me], It), zt = s.Util.applyTransform([Kn, 0], It), Un = s.Util.applyTransform([Kn, me], It), nr = Math.min(kt[0], St[0], zt[0], Un[0]), Yn = Math.min(kt[1], St[1], zt[1], Un[1]), un = Math.max(kt[0], St[0], zt[0], Un[0]), Fr = Math.max(kt[1], St[1], zt[1], Un[1]);
18278
18278
  this.ctx.fillRect(nr, Yn, un - nr, Fr - Yn);
18279
18279
  } else
18280
18280
  this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
@@ -18288,8 +18288,8 @@ function requirePdf() {
18288
18288
  }
18289
18289
  paintFormXObjectBegin(mt, ot) {
18290
18290
  if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(mt) && mt.length === 6 && this.transform(...mt), this.baseTransform = (0, r.getCurrentTransform)(this.ctx), ot)) {
18291
- const Xn = ot[2] - ot[0], It = ot[3] - ot[1];
18292
- this.ctx.rect(ot[0], ot[1], Xn, It), this.current.updateRectMinMax((0, r.getCurrentTransform)(this.ctx), ot), this.clip(), this.endPath();
18291
+ const Gn = ot[2] - ot[0], It = ot[3] - ot[1];
18292
+ this.ctx.rect(ot[0], ot[1], Gn, It), this.current.updateRectMinMax((0, r.getCurrentTransform)(this.ctx), ot), this.clip(), this.endPath();
18293
18293
  }
18294
18294
  }
18295
18295
  paintFormXObjectEnd() {
@@ -18301,22 +18301,22 @@ function requirePdf() {
18301
18301
  this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
18302
18302
  const ot = this.ctx;
18303
18303
  mt.isolated || (0, s.info)("TODO: Support non-isolated groups."), mt.knockout && (0, s.warn)("Knockout groups not supported.");
18304
- const Xn = (0, r.getCurrentTransform)(ot);
18304
+ const Gn = (0, r.getCurrentTransform)(ot);
18305
18305
  if (mt.matrix && ot.transform(...mt.matrix), !mt.bbox)
18306
18306
  throw new Error("Bounding box is required.");
18307
18307
  let It = s.Util.getAxialAlignedBoundingBox(mt.bbox, (0, r.getCurrentTransform)(ot));
18308
- const Kn = [0, 0, ot.canvas.width, ot.canvas.height];
18309
- It = s.Util.intersect(It, Kn) || [0, 0, 0, 0];
18310
- const Gn = Math.floor(It[0]), me = Math.floor(It[1]);
18311
- let kt = Math.max(Math.ceil(It[2]) - Gn, 1), St = Math.max(Math.ceil(It[3]) - me, 1), zt = 1, Un = 1;
18308
+ const Xn = [0, 0, ot.canvas.width, ot.canvas.height];
18309
+ It = s.Util.intersect(It, Xn) || [0, 0, 0, 0];
18310
+ const Kn = Math.floor(It[0]), me = Math.floor(It[1]);
18311
+ let kt = Math.max(Math.ceil(It[2]) - Kn, 1), St = Math.max(Math.ceil(It[3]) - me, 1), zt = 1, Un = 1;
18312
18312
  kt > b && (zt = kt / b, kt = b), St > b && (Un = St / b, St = b), this.current.startNewPathAndClipBox([0, 0, kt, St]);
18313
18313
  let nr = "groupAt" + this.groupLevel;
18314
18314
  mt.smask && (nr += "_smask_" + this.smaskCounter++ % 2);
18315
18315
  const Yn = this.cachedCanvases.getCanvas(nr, kt, St), un = Yn.context;
18316
- un.scale(1 / zt, 1 / Un), un.translate(-Gn, -me), un.transform(...Xn), mt.smask ? this.smaskStack.push({
18316
+ un.scale(1 / zt, 1 / Un), un.translate(-Kn, -me), un.transform(...Gn), mt.smask ? this.smaskStack.push({
18317
18317
  canvas: Yn.canvas,
18318
18318
  context: un,
18319
- offsetX: Gn,
18319
+ offsetX: Kn,
18320
18320
  offsetY: me,
18321
18321
  scaleX: zt,
18322
18322
  scaleY: Un,
@@ -18324,31 +18324,31 @@ function requirePdf() {
18324
18324
  backdrop: mt.smask.backdrop,
18325
18325
  transferMap: mt.smask.transferMap || null,
18326
18326
  startTransformInverse: null
18327
- }) : (ot.setTransform(1, 0, 0, 1, 0, 0), ot.translate(Gn, me), ot.scale(zt, Un), ot.save()), P(ot, un), this.ctx = un, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(ot), this.groupLevel++;
18327
+ }) : (ot.setTransform(1, 0, 0, 1, 0, 0), ot.translate(Kn, me), ot.scale(zt, Un), ot.save()), P(ot, un), this.ctx = un, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(ot), this.groupLevel++;
18328
18328
  }
18329
18329
  endGroup(mt) {
18330
18330
  if (!this.contentVisible)
18331
18331
  return;
18332
18332
  this.groupLevel--;
18333
- const ot = this.ctx, Xn = this.groupStack.pop();
18334
- if (this.ctx = Xn, this.ctx.imageSmoothingEnabled = !1, mt.smask)
18333
+ const ot = this.ctx, Gn = this.groupStack.pop();
18334
+ if (this.ctx = Gn, this.ctx.imageSmoothingEnabled = !1, mt.smask)
18335
18335
  this.tempSMask = this.smaskStack.pop(), this.restore();
18336
18336
  else {
18337
18337
  this.ctx.restore();
18338
18338
  const It = (0, r.getCurrentTransform)(this.ctx);
18339
18339
  this.restore(), this.ctx.save(), this.ctx.setTransform(...It);
18340
- const Kn = s.Util.getAxialAlignedBoundingBox([0, 0, ot.canvas.width, ot.canvas.height], It);
18341
- this.ctx.drawImage(ot.canvas, 0, 0), this.ctx.restore(), this.compose(Kn);
18340
+ const Xn = s.Util.getAxialAlignedBoundingBox([0, 0, ot.canvas.width, ot.canvas.height], It);
18341
+ this.ctx.drawImage(ot.canvas, 0, 0), this.ctx.restore(), this.compose(Xn);
18342
18342
  }
18343
18343
  }
18344
- beginAnnotation(mt, ot, Xn, It, Kn) {
18344
+ beginAnnotation(mt, ot, Gn, It, Xn) {
18345
18345
  if (gl(this, Pi, O0).call(this), p(this.ctx, this.foregroundColor), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(ot) && ot.length === 4) {
18346
- const Gn = ot[2] - ot[0], me = ot[3] - ot[1];
18347
- if (Kn && this.annotationCanvasMap) {
18348
- Xn = Xn.slice(), Xn[4] -= ot[0], Xn[5] -= ot[1], ot = ot.slice(), ot[0] = ot[1] = 0, ot[2] = Gn, ot[3] = me;
18346
+ const Kn = ot[2] - ot[0], me = ot[3] - ot[1];
18347
+ if (Xn && this.annotationCanvasMap) {
18348
+ Gn = Gn.slice(), Gn[4] -= ot[0], Gn[5] -= ot[1], ot = ot.slice(), ot[0] = ot[1] = 0, ot[2] = Kn, ot[3] = me;
18349
18349
  const [kt, St] = s.Util.singularValueDecompose2dScale((0, r.getCurrentTransform)(this.ctx)), {
18350
18350
  viewportScale: zt
18351
- } = this, Un = Math.ceil(Gn * this.outputScaleX * zt), nr = Math.ceil(me * this.outputScaleY * zt);
18351
+ } = this, Un = Math.ceil(Kn * this.outputScaleX * zt), nr = Math.ceil(me * this.outputScaleY * zt);
18352
18352
  this.annotationCanvas = this.canvasFactory.create(Un, nr);
18353
18353
  const {
18354
18354
  canvas: Yn,
@@ -18356,9 +18356,9 @@ function requirePdf() {
18356
18356
  } = this.annotationCanvas;
18357
18357
  this.annotationCanvasMap.set(mt, Yn), this.annotationCanvas.savedCtx = this.ctx, this.ctx = un, this.ctx.setTransform(kt, 0, 0, -St, 0, me * St), p(this.ctx, this.foregroundColor);
18358
18358
  } else
18359
- p(this.ctx, this.foregroundColor), this.ctx.rect(ot[0], ot[1], Gn, me), this.ctx.clip(), this.endPath();
18359
+ p(this.ctx, this.foregroundColor), this.ctx.rect(ot[0], ot[1], Kn, me), this.ctx.clip(), this.endPath();
18360
18360
  }
18361
- this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...Xn), this.transform(...It);
18361
+ this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...Gn), this.transform(...It);
18362
18362
  }
18363
18363
  endAnnotation() {
18364
18364
  this.annotationCanvas && (this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
@@ -18368,26 +18368,26 @@ function requirePdf() {
18368
18368
  return;
18369
18369
  const ot = mt.count;
18370
18370
  mt = this.getObject(mt.data, mt), mt.count = ot;
18371
- const Xn = this.ctx, It = this.processingType3;
18371
+ const Gn = this.ctx, It = this.processingType3;
18372
18372
  if (It && (It.compiled === void 0 && (It.compiled = st(mt)), It.compiled)) {
18373
- It.compiled(Xn);
18373
+ It.compiled(Gn);
18374
18374
  return;
18375
18375
  }
18376
- const Kn = this._createMaskCanvas(mt), Gn = Kn.canvas;
18377
- Xn.save(), Xn.setTransform(1, 0, 0, 1, 0, 0), Xn.drawImage(Gn, Kn.offsetX, Kn.offsetY), Xn.restore(), this.compose();
18376
+ const Xn = this._createMaskCanvas(mt), Kn = Xn.canvas;
18377
+ Gn.save(), Gn.setTransform(1, 0, 0, 1, 0, 0), Gn.drawImage(Kn, Xn.offsetX, Xn.offsetY), Gn.restore(), this.compose();
18378
18378
  }
18379
- paintImageMaskXObjectRepeat(mt, ot, Xn = 0, It = 0, Kn, Gn) {
18379
+ paintImageMaskXObjectRepeat(mt, ot, Gn = 0, It = 0, Xn, Kn) {
18380
18380
  if (!this.contentVisible)
18381
18381
  return;
18382
18382
  mt = this.getObject(mt.data, mt);
18383
18383
  const me = this.ctx;
18384
18384
  me.save();
18385
18385
  const kt = (0, r.getCurrentTransform)(me);
18386
- me.transform(ot, Xn, It, Kn, 0, 0);
18386
+ me.transform(ot, Gn, It, Xn, 0, 0);
18387
18387
  const St = this._createMaskCanvas(mt);
18388
18388
  me.setTransform(1, 0, 0, 1, 0, 0);
18389
- for (let zt = 0, Un = Gn.length; zt < Un; zt += 2) {
18390
- const nr = s.Util.transform(kt, [ot, Xn, It, Kn, Gn[zt], Gn[zt + 1]]), [Yn, un] = s.Util.applyTransform([0, 0], nr);
18389
+ for (let zt = 0, Un = Kn.length; zt < Un; zt += 2) {
18390
+ const nr = s.Util.transform(kt, [ot, Gn, It, Xn, Kn[zt], Kn[zt + 1]]), [Yn, un] = s.Util.applyTransform([0, 0], nr);
18391
18391
  me.drawImage(St.canvas, Yn, un);
18392
18392
  }
18393
18393
  me.restore(), this.compose();
@@ -18395,17 +18395,17 @@ function requirePdf() {
18395
18395
  paintImageMaskXObjectGroup(mt) {
18396
18396
  if (!this.contentVisible)
18397
18397
  return;
18398
- const ot = this.ctx, Xn = this.current.fillColor, It = this.current.patternFill;
18399
- for (const Kn of mt) {
18398
+ const ot = this.ctx, Gn = this.current.fillColor, It = this.current.patternFill;
18399
+ for (const Xn of mt) {
18400
18400
  const {
18401
- data: Gn,
18401
+ data: Kn,
18402
18402
  width: me,
18403
18403
  height: kt,
18404
18404
  transform: St
18405
- } = Kn, zt = this.cachedCanvases.getCanvas("maskCanvas", me, kt), Un = zt.context;
18405
+ } = Xn, zt = this.cachedCanvases.getCanvas("maskCanvas", me, kt), Un = zt.context;
18406
18406
  Un.save();
18407
- const nr = this.getObject(Gn, Kn);
18408
- N(Un, nr), Un.globalCompositeOperation = "source-in", Un.fillStyle = It ? Xn.getPattern(Un, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.FILL) : Xn, Un.fillRect(0, 0, me, kt), Un.restore(), ot.save(), ot.transform(...St), ot.scale(1, -1), pe(ot, zt.canvas, 0, 0, me, kt, 0, -1, 1, 1), ot.restore();
18407
+ const nr = this.getObject(Kn, Xn);
18408
+ N(Un, nr), Un.globalCompositeOperation = "source-in", Un.fillStyle = It ? Gn.getPattern(Un, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.FILL) : Gn, Un.fillRect(0, 0, me, kt), Un.restore(), ot.save(), ot.transform(...St), ot.scale(1, -1), pe(ot, zt.canvas, 0, 0, me, kt, 0, -1, 1, 1), ot.restore();
18409
18409
  }
18410
18410
  this.compose();
18411
18411
  }
@@ -18419,42 +18419,42 @@ function requirePdf() {
18419
18419
  }
18420
18420
  this.paintInlineImageXObject(ot);
18421
18421
  }
18422
- paintImageXObjectRepeat(mt, ot, Xn, It) {
18422
+ paintImageXObjectRepeat(mt, ot, Gn, It) {
18423
18423
  if (!this.contentVisible)
18424
18424
  return;
18425
- const Kn = this.getObject(mt);
18426
- if (!Kn) {
18425
+ const Xn = this.getObject(mt);
18426
+ if (!Xn) {
18427
18427
  (0, s.warn)("Dependent image isn't ready yet");
18428
18428
  return;
18429
18429
  }
18430
- const Gn = Kn.width, me = Kn.height, kt = [];
18430
+ const Kn = Xn.width, me = Xn.height, kt = [];
18431
18431
  for (let St = 0, zt = It.length; St < zt; St += 2)
18432
18432
  kt.push({
18433
- transform: [ot, 0, 0, Xn, It[St], It[St + 1]],
18433
+ transform: [ot, 0, 0, Gn, It[St], It[St + 1]],
18434
18434
  x: 0,
18435
18435
  y: 0,
18436
- w: Gn,
18436
+ w: Kn,
18437
18437
  h: me
18438
18438
  });
18439
- this.paintInlineImageXObjectGroup(Kn, kt);
18439
+ this.paintInlineImageXObjectGroup(Xn, kt);
18440
18440
  }
18441
18441
  paintInlineImageXObject(mt) {
18442
18442
  if (!this.contentVisible)
18443
18443
  return;
18444
- const ot = mt.width, Xn = mt.height, It = this.ctx;
18445
- this.save(), It.scale(1 / ot, -1 / Xn);
18446
- let Kn;
18444
+ const ot = mt.width, Gn = mt.height, It = this.ctx;
18445
+ this.save(), It.scale(1 / ot, -1 / Gn);
18446
+ let Xn;
18447
18447
  if (typeof HTMLElement == "function" && mt instanceof HTMLElement || !mt.data)
18448
- Kn = mt;
18448
+ Xn = mt;
18449
18449
  else {
18450
- const St = this.cachedCanvases.getCanvas("inlineImage", ot, Xn), zt = St.context;
18451
- Le(zt, mt, this.current.transferMaps), Kn = St.canvas;
18450
+ const St = this.cachedCanvases.getCanvas("inlineImage", ot, Gn), zt = St.context;
18451
+ Le(zt, mt, this.current.transferMaps), Xn = St.canvas;
18452
18452
  }
18453
- const Gn = this._scaleImage(Kn, (0, r.getCurrentTransformInverse)(It));
18453
+ const Kn = this._scaleImage(Xn, (0, r.getCurrentTransformInverse)(It));
18454
18454
  It.imageSmoothingEnabled = ki((0, r.getCurrentTransform)(It), mt.interpolate);
18455
- const [me, kt] = pe(It, Gn.img, 0, 0, Gn.paintWidth, Gn.paintHeight, 0, -Xn, ot, Xn);
18455
+ const [me, kt] = pe(It, Kn.img, 0, 0, Kn.paintWidth, Kn.paintHeight, 0, -Gn, ot, Gn);
18456
18456
  if (this.imageLayer) {
18457
- const [St, zt] = s.Util.applyTransform([0, -Xn], (0, r.getCurrentTransform)(this.ctx));
18457
+ const [St, zt] = s.Util.applyTransform([0, -Gn], (0, r.getCurrentTransform)(this.ctx));
18458
18458
  this.imageLayer.appendImage({
18459
18459
  imgData: mt,
18460
18460
  left: St,
@@ -18468,20 +18468,20 @@ function requirePdf() {
18468
18468
  paintInlineImageXObjectGroup(mt, ot) {
18469
18469
  if (!this.contentVisible)
18470
18470
  return;
18471
- const Xn = this.ctx, It = mt.width, Kn = mt.height, Gn = this.cachedCanvases.getCanvas("inlineImage", It, Kn), me = Gn.context;
18471
+ const Gn = this.ctx, It = mt.width, Xn = mt.height, Kn = this.cachedCanvases.getCanvas("inlineImage", It, Xn), me = Kn.context;
18472
18472
  Le(me, mt, this.current.transferMaps);
18473
18473
  for (const kt of ot) {
18474
- if (Xn.save(), Xn.transform(...kt.transform), Xn.scale(1, -1), pe(Xn, Gn.canvas, kt.x, kt.y, kt.w, kt.h, 0, -1, 1, 1), this.imageLayer) {
18474
+ if (Gn.save(), Gn.transform(...kt.transform), Gn.scale(1, -1), pe(Gn, Kn.canvas, kt.x, kt.y, kt.w, kt.h, 0, -1, 1, 1), this.imageLayer) {
18475
18475
  const [St, zt] = s.Util.applyTransform([kt.x, kt.y], (0, r.getCurrentTransform)(this.ctx));
18476
18476
  this.imageLayer.appendImage({
18477
18477
  imgData: mt,
18478
18478
  left: St,
18479
18479
  top: zt,
18480
18480
  width: It,
18481
- height: Kn
18481
+ height: Xn
18482
18482
  });
18483
18483
  }
18484
- Xn.restore();
18484
+ Gn.restore();
18485
18485
  }
18486
18486
  this.compose();
18487
18487
  }
@@ -18514,8 +18514,8 @@ function requirePdf() {
18514
18514
  consumePath(mt) {
18515
18515
  const ot = this.current.isEmptyClip();
18516
18516
  this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(mt);
18517
- const Xn = this.ctx;
18518
- this.pendingClip && (ot || (this.pendingClip === Ar ? Xn.clip("evenodd") : Xn.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), Xn.beginPath();
18517
+ const Gn = this.ctx;
18518
+ this.pendingClip && (ot || (this.pendingClip === Ar ? Gn.clip("evenodd") : Gn.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), Gn.beginPath();
18519
18519
  }
18520
18520
  getSinglePixelWidth() {
18521
18521
  if (!this._cachedGetSinglePixelWidth) {
@@ -18523,8 +18523,8 @@ function requirePdf() {
18523
18523
  if (mt[1] === 0 && mt[2] === 0)
18524
18524
  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(mt[0]), Math.abs(mt[3]));
18525
18525
  else {
18526
- const ot = Math.abs(mt[0] * mt[3] - mt[2] * mt[1]), Xn = Math.hypot(mt[0], mt[2]), It = Math.hypot(mt[1], mt[3]);
18527
- this._cachedGetSinglePixelWidth = Math.max(Xn, It) / ot;
18526
+ const ot = Math.abs(mt[0] * mt[3] - mt[2] * mt[1]), Gn = Math.hypot(mt[0], mt[2]), It = Math.hypot(mt[1], mt[3]);
18527
+ this._cachedGetSinglePixelWidth = Math.max(Gn, It) / ot;
18528
18528
  }
18529
18529
  }
18530
18530
  return this._cachedGetSinglePixelWidth;
@@ -18534,25 +18534,25 @@ function requirePdf() {
18534
18534
  const {
18535
18535
  lineWidth: mt
18536
18536
  } = this.current, ot = (0, r.getCurrentTransform)(this.ctx);
18537
- let Xn, It;
18537
+ let Gn, It;
18538
18538
  if (ot[1] === 0 && ot[2] === 0) {
18539
- const Kn = Math.abs(ot[0]), Gn = Math.abs(ot[3]);
18539
+ const Xn = Math.abs(ot[0]), Kn = Math.abs(ot[3]);
18540
18540
  if (mt === 0)
18541
- Xn = 1 / Kn, It = 1 / Gn;
18541
+ Gn = 1 / Xn, It = 1 / Kn;
18542
18542
  else {
18543
- const me = Kn * mt, kt = Gn * mt;
18544
- Xn = me < 1 ? 1 / me : 1, It = kt < 1 ? 1 / kt : 1;
18543
+ const me = Xn * mt, kt = Kn * mt;
18544
+ Gn = me < 1 ? 1 / me : 1, It = kt < 1 ? 1 / kt : 1;
18545
18545
  }
18546
18546
  } else {
18547
- const Kn = Math.abs(ot[0] * ot[3] - ot[2] * ot[1]), Gn = Math.hypot(ot[0], ot[1]), me = Math.hypot(ot[2], ot[3]);
18547
+ const Xn = Math.abs(ot[0] * ot[3] - ot[2] * ot[1]), Kn = Math.hypot(ot[0], ot[1]), me = Math.hypot(ot[2], ot[3]);
18548
18548
  if (mt === 0)
18549
- Xn = me / Kn, It = Gn / Kn;
18549
+ Gn = me / Xn, It = Kn / Xn;
18550
18550
  else {
18551
- const kt = mt * Kn;
18552
- Xn = me > kt ? me / kt : 1, It = Gn > kt ? Gn / kt : 1;
18551
+ const kt = mt * Xn;
18552
+ Gn = me > kt ? me / kt : 1, It = Kn > kt ? Kn / kt : 1;
18553
18553
  }
18554
18554
  }
18555
- this._cachedScaleForStroking = [Xn, It];
18555
+ this._cachedScaleForStroking = [Gn, It];
18556
18556
  }
18557
18557
  return this._cachedScaleForStroking;
18558
18558
  }
@@ -18560,16 +18560,16 @@ function requirePdf() {
18560
18560
  const {
18561
18561
  ctx: ot
18562
18562
  } = this, {
18563
- lineWidth: Xn
18564
- } = this.current, [It, Kn] = this.getScaleForStroking();
18565
- if (ot.lineWidth = Xn || 1, It === 1 && Kn === 1) {
18563
+ lineWidth: Gn
18564
+ } = this.current, [It, Xn] = this.getScaleForStroking();
18565
+ if (ot.lineWidth = Gn || 1, It === 1 && Xn === 1) {
18566
18566
  ot.stroke();
18567
18567
  return;
18568
18568
  }
18569
- let Gn, me, kt;
18570
- mt && (Gn = (0, r.getCurrentTransform)(ot), me = ot.getLineDash().slice(), kt = ot.lineDashOffset), ot.scale(It, Kn);
18571
- const St = Math.max(It, Kn);
18572
- ot.setLineDash(ot.getLineDash().map((zt) => zt / St)), ot.lineDashOffset /= St, ot.stroke(), mt && (ot.setTransform(...Gn), ot.setLineDash(me), ot.lineDashOffset = kt);
18569
+ let Kn, me, kt;
18570
+ mt && (Kn = (0, r.getCurrentTransform)(ot), me = ot.getLineDash().slice(), kt = ot.lineDashOffset), ot.scale(It, Xn);
18571
+ const St = Math.max(It, Xn);
18572
+ ot.setLineDash(ot.getLineDash().map((zt) => zt / St)), ot.lineDashOffset /= St, ot.stroke(), mt && (ot.setTransform(...Kn), ot.setLineDash(me), ot.lineDashOffset = kt);
18573
18573
  }
18574
18574
  isContentVisible() {
18575
18575
  for (let mt = this.markedContentStack.length - 1; mt >= 0; mt--)
@@ -18649,18 +18649,18 @@ function requirePdf() {
18649
18649
  const As = (Lt[nt] + st.offsetX) * st.scaleX, Ur = (Lt[nt + 1] + st.offsetY) * st.scaleY, Br = (Lt[Le] + st.offsetX) * st.scaleX, Ar = (Lt[Le + 1] + st.offsetY) * st.scaleY, Is = (Lt[N] + st.offsetX) * st.scaleX, Pi = (Lt[N + 1] + st.offsetY) * st.scaleY;
18650
18650
  if (Ur >= Pi)
18651
18651
  return;
18652
- const Oi = Zn[P], hl = Zn[P + 1], ur = Zn[P + 2], mt = Zn[p], ot = Zn[p + 1], Xn = Zn[p + 2], It = Zn[Dt], Kn = Zn[Dt + 1], Gn = Zn[Dt + 2], me = Math.round(Ur), kt = Math.round(Pi);
18652
+ const Oi = Zn[P], hl = Zn[P + 1], ur = Zn[P + 2], mt = Zn[p], ot = Zn[p + 1], Gn = Zn[p + 2], It = Zn[Dt], Xn = Zn[Dt + 1], Kn = Zn[Dt + 2], me = Math.round(Ur), kt = Math.round(Pi);
18653
18653
  let St, zt, Un, nr, Yn, un, Fr, Ni;
18654
18654
  for (let Si = me; Si <= kt; Si++) {
18655
18655
  if (Si < Ar) {
18656
18656
  let dl;
18657
- Si < Ur ? dl = 0 : dl = (Ur - Si) / (Ur - Ar), St = As - (As - Br) * dl, zt = Oi - (Oi - mt) * dl, Un = hl - (hl - ot) * dl, nr = ur - (ur - Xn) * dl;
18657
+ Si < Ur ? dl = 0 : dl = (Ur - Si) / (Ur - Ar), St = As - (As - Br) * dl, zt = Oi - (Oi - mt) * dl, Un = hl - (hl - ot) * dl, nr = ur - (ur - Gn) * dl;
18658
18658
  } else {
18659
18659
  let dl;
18660
- Si > Pi ? dl = 1 : Ar === Pi ? dl = 0 : dl = (Ar - Si) / (Ar - Pi), St = Br - (Br - Is) * dl, zt = mt - (mt - It) * dl, Un = ot - (ot - Kn) * dl, nr = Xn - (Xn - Gn) * dl;
18660
+ Si > Pi ? dl = 1 : Ar === Pi ? dl = 0 : dl = (Ar - Si) / (Ar - Pi), St = Br - (Br - Is) * dl, zt = mt - (mt - It) * dl, Un = ot - (ot - Xn) * dl, nr = Gn - (Gn - Kn) * dl;
18661
18661
  }
18662
18662
  let Ti;
18663
- Si < Ur ? Ti = 0 : Si > Pi ? Ti = 1 : Ti = (Ur - Si) / (Ur - Pi), Yn = As - (As - Is) * Ti, un = Oi - (Oi - It) * Ti, Fr = hl - (hl - Kn) * Ti, Ni = ur - (ur - Gn) * Ti;
18663
+ Si < Ur ? Ti = 0 : Si > Pi ? Ti = 1 : Ti = (Ur - Si) / (Ur - Pi), Yn = As - (As - Is) * Ti, un = Oi - (Oi - It) * Ti, Fr = hl - (hl - Xn) * Ti, Ni = ur - (ur - Kn) * Ti;
18664
18664
  const ji = Math.round(Math.min(St, Yn)), Ha = Math.round(Math.max(St, Yn));
18665
18665
  let ml = qs * Si + ji * 4;
18666
18666
  for (let dl = ji; dl <= Ha; dl++)
@@ -18702,7 +18702,7 @@ function requirePdf() {
18702
18702
  }, Ar = qs + 4, Is = ki + 4, Pi = Le.getCanvas("mesh", Ar, Is, !1), Oi = Pi.context, hl = Oi.createImageData(qs, ki);
18703
18703
  if (nt) {
18704
18704
  const mt = hl.data;
18705
- for (let ot = 0, Xn = mt.length; ot < Xn; ot += 4)
18705
+ for (let ot = 0, Gn = mt.length; ot < Gn; ot += 4)
18706
18706
  mt[ot] = nt[0], mt[ot + 1] = nt[1], mt[ot + 2] = nt[2], mt[ot + 3] = 255;
18707
18707
  }
18708
18708
  for (const mt of this._figures)
@@ -18760,8 +18760,8 @@ function requirePdf() {
18760
18760
  (0, r.info)("TilingType: " + Dt);
18761
18761
  const ln = Le[0], qs = Le[1], ki = Le[2], As = Le[3], Ur = r.Util.singularValueDecompose2dScale(this.matrix), Br = r.Util.singularValueDecompose2dScale(this.baseTransform), Ar = [Ur[0] * Br[0], Ur[1] * Br[1]], Is = this.getSizeAndScale(N, this.ctx.canvas.width, Ar[0]), Pi = this.getSizeAndScale(P, this.ctx.canvas.height, Ar[1]), Oi = st.cachedCanvases.getCanvas("pattern", Is.size, Pi.size, !0), hl = Oi.context, ur = Zn.createCanvasGraphics(hl);
18762
18762
  ur.groupLevel = st.groupLevel, this.setFillAndStrokeStyleToContext(ur, p, Lt);
18763
- let mt = ln, ot = qs, Xn = ki, It = As;
18764
- return ln < 0 && (mt = 0, Xn += Math.abs(ln)), qs < 0 && (ot = 0, It += Math.abs(qs)), hl.translate(-(Is.scale * mt), -(Pi.scale * ot)), ur.transform(Is.scale, 0, 0, Pi.scale, 0, 0), hl.save(), this.clipBbox(ur, mt, ot, Xn, It), ur.baseTransform = (0, s.getCurrentTransform)(ur.ctx), ur.executeOperatorList(nt), ur.endDrawing(), {
18763
+ let mt = ln, ot = qs, Gn = ki, It = As;
18764
+ return ln < 0 && (mt = 0, Gn += Math.abs(ln)), qs < 0 && (ot = 0, It += Math.abs(qs)), hl.translate(-(Is.scale * mt), -(Pi.scale * ot)), ur.transform(Is.scale, 0, 0, Pi.scale, 0, 0), hl.save(), this.clipBbox(ur, mt, ot, Gn, It), ur.baseTransform = (0, s.getCurrentTransform)(ur.ctx), ur.executeOperatorList(nt), ur.endDrawing(), {
18765
18765
  canvas: Oi.canvas,
18766
18766
  scaleX: Is.scale,
18767
18767
  scaleY: Pi.scale,
@@ -20075,7 +20075,7 @@ function requirePdf() {
20075
20075
  /* 24 */
20076
20076
  /***/
20077
20077
  (e, t, n) => {
20078
- var l, b, tt, de, Ye, E, u, o, pe, st, nt, Le, N, P, p, im, om, am, um, $0, lm, cm, dm, l0, j0, y0, A0, c0, U0, E0, mt, z0, hm, fm, pm, W0, D0, d0, q0;
20078
+ var l, b, tt, de, Ye, E, u, o, pe, st, nt, Le, N, P, p, im, om, am, um, $0, lm, cm, dm, u0, j0, y0, A0, d0, U0, E0, mt, z0, hm, fm, pm, W0, D0, h0, q0;
20079
20079
  Object.defineProperty(t, "__esModule", {
20080
20080
  value: !0
20081
20081
  }), t.InkEditor = void 0, Object.defineProperty(t, "fitCurve", {
@@ -20144,7 +20144,7 @@ function requirePdf() {
20144
20144
  return [[r.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || zt._defaultThickness], [r.AnnotationEditorParamsType.INK_COLOR, this.color || zt._defaultColor || s.AnnotationEditor._defaultLineColor], [r.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? zt._defaultOpacity))]];
20145
20145
  }
20146
20146
  rebuild() {
20147
- super.rebuild(), this.div !== null && (this.canvas || (gl(this, p, y0).call(this), gl(this, p, A0).call(this)), this.isAttachedToDOM || (this.parent.add(this), gl(this, p, c0).call(this)), gl(this, p, d0).call(this));
20147
+ super.rebuild(), this.div !== null && (this.canvas || (gl(this, p, y0).call(this), gl(this, p, A0).call(this)), this.isAttachedToDOM || (this.parent.add(this), gl(this, p, d0).call(this)), gl(this, p, h0).call(this));
20148
20148
  }
20149
20149
  remove() {
20150
20150
  this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, Gr(this, nt).disconnect(), Cl(this, nt, null), super.remove());
@@ -20162,7 +20162,7 @@ function requirePdf() {
20162
20162
  return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
20163
20163
  }
20164
20164
  commit() {
20165
- Gr(this, o) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), Cl(this, o, !0), this.div.classList.add("disabled"), gl(this, p, d0).call(this, !0), this.parent.addInkEditorIfNeeded(!0), this.parent.moveEditorInDOM(this), this.div.focus());
20165
+ Gr(this, o) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), Cl(this, o, !0), this.div.classList.add("disabled"), gl(this, p, h0).call(this, !0), this.parent.addInkEditorIfNeeded(!0), this.parent.moveEditorInDOM(this), this.div.focus());
20166
20166
  }
20167
20167
  focusin(Yn) {
20168
20168
  super.focusin(Yn), this.enableEditMode();
@@ -20190,7 +20190,7 @@ function requirePdf() {
20190
20190
  const [Fr, Ni, Si, Ti] = gl(this, p, um).call(this);
20191
20191
  if (this.setAt(Fr, Ni, 0, 0), this.setDims(Si, Ti), gl(this, p, y0).call(this), this.width) {
20192
20192
  const [ji, Ha] = this.parent.viewportBaseDimensions;
20193
- this.setAt(Yn * ji, un * Ha, this.width * ji, this.height * Ha), Cl(this, pe, !0), gl(this, p, c0).call(this), this.setDims(this.width * ji, this.height * Ha), gl(this, p, l0).call(this), gl(this, p, q0).call(this), this.div.classList.add("disabled");
20193
+ this.setAt(Yn * ji, un * Ha, this.width * ji, this.height * Ha), Cl(this, pe, !0), gl(this, p, d0).call(this), this.setDims(this.width * ji, this.height * Ha), gl(this, p, u0).call(this), gl(this, p, q0).call(this), this.div.classList.add("disabled");
20194
20194
  } else
20195
20195
  this.div.classList.add("editing"), this.enableEditMode();
20196
20196
  return gl(this, p, A0).call(this), this.div;
@@ -20201,29 +20201,29 @@ function requirePdf() {
20201
20201
  return;
20202
20202
  Cl(this, Le, Fr), Cl(this, N, Ni), this.canvas.style.visibility = "hidden", Gr(this, l) && Math.abs(Gr(this, l) - Yn / un) > 0.01 && (un = Math.ceil(Yn / Gr(this, l)), this.setDims(Yn, un));
20203
20203
  const [Si, Ti] = this.parent.viewportBaseDimensions;
20204
- this.width = Yn / Si, this.height = un / Ti, Gr(this, o) && gl(this, p, U0).call(this, Yn, un), gl(this, p, c0).call(this), gl(this, p, l0).call(this), this.canvas.style.visibility = "visible";
20204
+ this.width = Yn / Si, this.height = un / Ti, Gr(this, o) && gl(this, p, U0).call(this, Yn, un), gl(this, p, d0).call(this), gl(this, p, u0).call(this), this.canvas.style.visibility = "visible";
20205
20205
  }
20206
20206
  static deserialize(Yn, un) {
20207
- var Fl, Al;
20207
+ var wl, Dl;
20208
20208
  const Fr = super.deserialize(Yn, un);
20209
20209
  Fr.thickness = Yn.thickness, Fr.color = r.Util.makeHexColor(...Yn.color), Fr.opacity = Yn.opacity;
20210
20210
  const [Ni, Si] = un.pageDimensions, Ti = Fr.width * Ni, ji = Fr.height * Si, Ha = un.scaleFactor, ml = Yn.thickness / 2;
20211
20211
  Cl(Fr, l, Ti / ji), Cl(Fr, o, !0), Cl(Fr, Le, Math.round(Ti)), Cl(Fr, N, Math.round(ji));
20212
20212
  for (const {
20213
- bezier: Dl
20213
+ bezier: Fl
20214
20214
  } of Yn.paths) {
20215
- const xl = [];
20216
- Fr.paths.push(xl);
20217
- let Pl = Ha * (Dl[0] - ml), Ol = Ha * (ji - Dl[1] - ml);
20218
- for (let fg = 2, cg = Dl.length; fg < cg; fg += 6) {
20219
- const lg = Ha * (Dl[fg] - ml), s0 = Ha * (ji - Dl[fg + 1] - ml), i0 = Ha * (Dl[fg + 2] - ml), o0 = Ha * (ji - Dl[fg + 3] - ml), pl = Ha * (Dl[fg + 4] - ml), Ri = Ha * (ji - Dl[fg + 5] - ml);
20220
- xl.push([[Pl, Ol], [lg, s0], [i0, o0], [pl, Ri]]), Pl = pl, Ol = Ri;
20215
+ const Bl = [];
20216
+ Fr.paths.push(Bl);
20217
+ let Pl = Ha * (Fl[0] - ml), Ol = Ha * (ji - Fl[1] - ml);
20218
+ for (let fg = 2, cg = Fl.length; fg < cg; fg += 6) {
20219
+ const lg = Ha * (Fl[fg] - ml), s0 = Ha * (ji - Fl[fg + 1] - ml), o0 = Ha * (Fl[fg + 2] - ml), a0 = Ha * (ji - Fl[fg + 3] - ml), pl = Ha * (Fl[fg + 4] - ml), Ri = Ha * (ji - Fl[fg + 5] - ml);
20220
+ Bl.push([[Pl, Ol], [lg, s0], [o0, a0], [pl, Ri]]), Pl = pl, Ol = Ri;
20221
20221
  }
20222
- const Rl = gl(this, mt, z0).call(this, xl);
20222
+ const Rl = gl(this, mt, z0).call(this, Bl);
20223
20223
  Fr.bezierPath2D.push(Rl);
20224
20224
  }
20225
- const dl = gl(Fl = Fr, p, W0).call(Fl);
20226
- return Cl(Fr, tt, Math.max(c, dl[2] - dl[0])), Cl(Fr, b, Math.max(c, dl[3] - dl[1])), gl(Al = Fr, p, U0).call(Al, Ti, ji), Fr;
20225
+ const dl = gl(wl = Fr, p, W0).call(wl);
20226
+ return Cl(Fr, tt, Math.max(c, dl[2] - dl[0])), Cl(Fr, b, Math.max(c, dl[3] - dl[1])), gl(Dl = Fr, p, U0).call(Dl, Ti, ji), Fr;
20227
20227
  }
20228
20228
  serialize() {
20229
20229
  if (this.isEmpty())
@@ -20245,10 +20245,10 @@ function requirePdf() {
20245
20245
  const un = this.thickness;
20246
20246
  this.parent.addCommands({
20247
20247
  cmd: () => {
20248
- this.thickness = Yn, gl(this, p, d0).call(this);
20248
+ this.thickness = Yn, gl(this, p, h0).call(this);
20249
20249
  },
20250
20250
  undo: () => {
20251
- this.thickness = un, gl(this, p, d0).call(this);
20251
+ this.thickness = un, gl(this, p, h0).call(this);
20252
20252
  },
20253
20253
  mustExec: !0,
20254
20254
  type: r.AnnotationEditorParamsType.INK_THICKNESS,
@@ -20259,10 +20259,10 @@ function requirePdf() {
20259
20259
  const un = this.color;
20260
20260
  this.parent.addCommands({
20261
20261
  cmd: () => {
20262
- this.color = Yn, gl(this, p, l0).call(this);
20262
+ this.color = Yn, gl(this, p, u0).call(this);
20263
20263
  },
20264
20264
  undo: () => {
20265
- this.color = un, gl(this, p, l0).call(this);
20265
+ this.color = un, gl(this, p, u0).call(this);
20266
20266
  },
20267
20267
  mustExec: !0,
20268
20268
  type: r.AnnotationEditorParamsType.INK_COLOR,
@@ -20274,10 +20274,10 @@ function requirePdf() {
20274
20274
  const un = this.opacity;
20275
20275
  this.parent.addCommands({
20276
20276
  cmd: () => {
20277
- this.opacity = Yn, gl(this, p, l0).call(this);
20277
+ this.opacity = Yn, gl(this, p, u0).call(this);
20278
20278
  },
20279
20279
  undo: () => {
20280
- this.opacity = un, gl(this, p, l0).call(this);
20280
+ this.opacity = un, gl(this, p, u0).call(this);
20281
20281
  },
20282
20282
  mustExec: !0,
20283
20283
  type: r.AnnotationEditorParamsType.INK_OPACITY,
@@ -20303,8 +20303,8 @@ function requirePdf() {
20303
20303
  }, $0 = function() {
20304
20304
  this.ctx.lineWidth = this.thickness * this.parent.scaleFactor / this.scaleFactor, this.ctx.lineCap = "round", this.ctx.lineJoin = "round", this.ctx.miterLimit = 10, this.ctx.strokeStyle = `${this.color}${(0, a.opacityToHex)(this.opacity)}`;
20305
20305
  }, lm = function(Yn, un) {
20306
- this.isEditing = !0, Gr(this, pe) || (Cl(this, pe, !0), gl(this, p, c0).call(this), this.thickness || (this.thickness = zt._defaultThickness), this.color || (this.color = zt._defaultColor || s.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = zt._defaultOpacity)), this.currentPath.push([Yn, un]), Cl(this, st, null), gl(this, p, $0).call(this), this.ctx.beginPath(), this.ctx.moveTo(Yn, un), Cl(this, P, () => {
20307
- Gr(this, P) && (Gr(this, st) && (this.isEmpty() ? (this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)) : gl(this, p, l0).call(this), this.ctx.lineTo(...Gr(this, st)), Cl(this, st, null), this.ctx.stroke()), window.requestAnimationFrame(Gr(this, P)));
20306
+ this.isEditing = !0, Gr(this, pe) || (Cl(this, pe, !0), gl(this, p, d0).call(this), this.thickness || (this.thickness = zt._defaultThickness), this.color || (this.color = zt._defaultColor || s.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = zt._defaultOpacity)), this.currentPath.push([Yn, un]), Cl(this, st, null), gl(this, p, $0).call(this), this.ctx.beginPath(), this.ctx.moveTo(Yn, un), Cl(this, P, () => {
20307
+ Gr(this, P) && (Gr(this, st) && (this.isEmpty() ? (this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)) : gl(this, p, u0).call(this), this.ctx.lineTo(...Gr(this, st)), Cl(this, st, null), this.ctx.stroke()), window.requestAnimationFrame(Gr(this, P)));
20308
20308
  }), window.requestAnimationFrame(Gr(this, P));
20309
20309
  }, cm = function(Yn, un) {
20310
20310
  const [Fr, Ni] = this.currentPath.at(-1);
@@ -20326,14 +20326,14 @@ function requirePdf() {
20326
20326
  const ji = () => {
20327
20327
  this.paths.push(Si), this.bezierPath2D.push(Ti), this.rebuild();
20328
20328
  }, Ha = () => {
20329
- this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (gl(this, p, y0).call(this), gl(this, p, A0).call(this)), gl(this, p, d0).call(this));
20329
+ this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (gl(this, p, y0).call(this), gl(this, p, A0).call(this)), gl(this, p, h0).call(this));
20330
20330
  };
20331
20331
  this.parent.addCommands({
20332
20332
  cmd: ji,
20333
20333
  undo: Ha,
20334
20334
  mustExec: !0
20335
20335
  });
20336
- }, l0 = function() {
20336
+ }, u0 = function() {
20337
20337
  if (this.isEmpty()) {
20338
20338
  gl(this, p, E0).call(this);
20339
20339
  return;
@@ -20358,7 +20358,7 @@ function requirePdf() {
20358
20358
  const un = Yn[0].contentRect;
20359
20359
  un.width && un.height && this.setDimensions(un.width, un.height);
20360
20360
  })), Gr(this, nt).observe(this.div);
20361
- }, c0 = function() {
20361
+ }, d0 = function() {
20362
20362
  if (!Gr(this, pe))
20363
20363
  return;
20364
20364
  const [Yn, un] = this.parent.viewportBaseDimensions;
@@ -20381,9 +20381,9 @@ function requirePdf() {
20381
20381
  let Ha, ml;
20382
20382
  for (const dl of this.paths) {
20383
20383
  Ha = [], ml = [];
20384
- for (let Fl = 0, Al = dl.length; Fl < Al; Fl++) {
20385
- const [Dl, xl, Pl, Ol] = dl[Fl], Rl = Yn * (Dl[0] + un) + ji, fg = Ni - Yn * (Dl[1] + Fr) - ji, cg = Yn * (xl[0] + un) + ji, lg = Ni - Yn * (xl[1] + Fr) - ji, s0 = Yn * (Pl[0] + un) + ji, i0 = Ni - Yn * (Pl[1] + Fr) - ji, o0 = Yn * (Ol[0] + un) + ji, pl = Ni - Yn * (Ol[1] + Fr) - ji;
20386
- Fl === 0 && (Ha.push(Rl, fg), ml.push(Rl, fg)), Ha.push(cg, lg, s0, i0, o0, pl), gl(this, p, fm).call(this, Rl, fg, cg, lg, s0, i0, o0, pl, 4, ml);
20384
+ for (let wl = 0, Dl = dl.length; wl < Dl; wl++) {
20385
+ const [Fl, Bl, Pl, Ol] = dl[wl], Rl = Yn * (Fl[0] + un) + ji, fg = Ni - Yn * (Fl[1] + Fr) - ji, cg = Yn * (Bl[0] + un) + ji, lg = Ni - Yn * (Bl[1] + Fr) - ji, s0 = Yn * (Pl[0] + un) + ji, o0 = Ni - Yn * (Pl[1] + Fr) - ji, a0 = Yn * (Ol[0] + un) + ji, pl = Ni - Yn * (Ol[1] + Fr) - ji;
20386
+ wl === 0 && (Ha.push(Rl, fg), ml.push(Rl, fg)), Ha.push(cg, lg, s0, o0, a0, pl), gl(this, p, fm).call(this, Rl, fg, cg, lg, s0, o0, a0, pl, 4, ml);
20387
20387
  }
20388
20388
  Ti.push({
20389
20389
  bezier: Ha,
@@ -20396,16 +20396,16 @@ function requirePdf() {
20396
20396
  dl.push(ji, Ha);
20397
20397
  return;
20398
20398
  }
20399
- for (let Fl = 1; Fl < ml - 1; Fl++) {
20400
- const Al = Fl / ml, Dl = 1 - Al;
20401
- let xl = Al * Yn + Dl * Fr, Pl = Al * un + Dl * Ni, Ol = Al * Fr + Dl * Si, Rl = Al * Ni + Dl * Ti;
20402
- const fg = Al * Si + Dl * ji, cg = Al * Ti + Dl * Ha;
20403
- xl = Al * xl + Dl * Ol, Pl = Al * Pl + Dl * Rl, Ol = Al * Ol + Dl * fg, Rl = Al * Rl + Dl * cg, xl = Al * xl + Dl * Ol, Pl = Al * Pl + Dl * Rl, dl.push(xl, Pl);
20399
+ for (let wl = 1; wl < ml - 1; wl++) {
20400
+ const Dl = wl / ml, Fl = 1 - Dl;
20401
+ let Bl = Dl * Yn + Fl * Fr, Pl = Dl * un + Fl * Ni, Ol = Dl * Fr + Fl * Si, Rl = Dl * Ni + Fl * Ti;
20402
+ const fg = Dl * Si + Fl * ji, cg = Dl * Ti + Fl * Ha;
20403
+ Bl = Dl * Bl + Fl * Ol, Pl = Dl * Pl + Fl * Rl, Ol = Dl * Ol + Fl * fg, Rl = Dl * Rl + Fl * cg, Bl = Dl * Bl + Fl * Ol, Pl = Dl * Pl + Fl * Rl, dl.push(Bl, Pl);
20404
20404
  }
20405
20405
  dl.push(ji, Ha);
20406
20406
  }, pm = function(Yn, un, Fr, Ni, Si, Ti, ji, Ha) {
20407
- const dl = (3 * Fr - 2 * Yn - ji) ** 2, Fl = (3 * Ni - 2 * un - Ha) ** 2, Al = (3 * Si - Yn - 2 * ji) ** 2, Dl = (3 * Ti - un - 2 * Ha) ** 2;
20408
- return Math.max(dl, Al) + Math.max(Fl, Dl) <= 10;
20407
+ const dl = (3 * Fr - 2 * Yn - ji) ** 2, wl = (3 * Ni - 2 * un - Ha) ** 2, Dl = (3 * Si - Yn - 2 * ji) ** 2, Fl = (3 * Ti - un - 2 * Ha) ** 2;
20408
+ return Math.max(dl, Dl) + Math.max(wl, Fl) <= 10;
20409
20409
  }, W0 = function() {
20410
20410
  let Yn = 1 / 0, un = -1 / 0, Fr = 1 / 0, Ni = -1 / 0;
20411
20411
  for (const Si of this.paths)
@@ -20416,11 +20416,11 @@ function requirePdf() {
20416
20416
  return [Yn, Fr, un, Ni];
20417
20417
  }, D0 = function() {
20418
20418
  return Gr(this, o) ? Math.ceil(this.thickness * this.parent.scaleFactor) : 0;
20419
- }, d0 = function(Yn = !1) {
20419
+ }, h0 = function(Yn = !1) {
20420
20420
  if (this.isEmpty())
20421
20421
  return;
20422
20422
  if (!Gr(this, o)) {
20423
- gl(this, p, l0).call(this);
20423
+ gl(this, p, u0).call(this);
20424
20424
  return;
20425
20425
  }
20426
20426
  const un = gl(this, p, W0).call(this), Fr = gl(this, p, D0).call(this);
@@ -20428,7 +20428,7 @@ function requirePdf() {
20428
20428
  const Ni = Math.ceil(Fr + Gr(this, tt) * this.scaleFactor), Si = Math.ceil(Fr + Gr(this, b) * this.scaleFactor), [Ti, ji] = this.parent.viewportBaseDimensions;
20429
20429
  this.width = Ni / Ti, this.height = Si / ji, Cl(this, l, Ni / Si), gl(this, p, q0).call(this);
20430
20430
  const Ha = this.translationX, ml = this.translationY;
20431
- this.translationX = -un[0], this.translationY = -un[1], gl(this, p, c0).call(this), gl(this, p, l0).call(this), Cl(this, Le, Ni), Cl(this, N, Si), this.setDims(Ni, Si);
20431
+ this.translationX = -un[0], this.translationY = -un[1], gl(this, p, d0).call(this), gl(this, p, u0).call(this), Cl(this, Le, Ni), Cl(this, N, Si), this.setDims(Ni, Si);
20432
20432
  const dl = Yn ? Fr / this.scaleFactor / 2 : 0;
20433
20433
  this.translate(Ha - this.translationX - dl, ml - this.translationY - dl);
20434
20434
  }, q0 = function() {
@@ -20599,16 +20599,16 @@ function requirePdf() {
20599
20599
  /* 27 */
20600
20600
  /***/
20601
20601
  (e, t, n) => {
20602
- var mt, H0, V0, G0;
20602
+ var mt, H0, V0, K0;
20603
20603
  Object.defineProperty(t, "__esModule", {
20604
20604
  value: !0
20605
20605
  }), t.AnnotationLayer = void 0;
20606
20606
  var r = n(1), s = n(8), i = n(5), a = n(28), c = n(29);
20607
20607
  const h = 1e3, l = 9, b = /* @__PURE__ */ new WeakSet();
20608
- function tt(Gn) {
20608
+ function tt(Kn) {
20609
20609
  return {
20610
- width: Gn[2] - Gn[0],
20611
- height: Gn[3] - Gn[1]
20610
+ width: Kn[2] - Kn[0],
20611
+ height: Kn[3] - Kn[1]
20612
20612
  };
20613
20613
  }
20614
20614
  class de {
@@ -20680,13 +20680,13 @@ function requirePdf() {
20680
20680
  const Ha = r.Util.normalizeRect([kt.rect[0], St.view[3] - kt.rect[1] + St.view[1], kt.rect[2], St.view[3] - kt.rect[3] + St.view[1]]);
20681
20681
  if (!me && kt.borderStyle.width > 0) {
20682
20682
  Un.style.borderWidth = `${kt.borderStyle.width}px`;
20683
- const dl = kt.borderStyle.horizontalCornerRadius, Fl = kt.borderStyle.verticalCornerRadius;
20684
- if (dl > 0 || Fl > 0) {
20685
- const Dl = `calc(${dl}px * var(--scale-factor)) / calc(${Fl}px * var(--scale-factor))`;
20686
- Un.style.borderRadius = Dl;
20683
+ const dl = kt.borderStyle.horizontalCornerRadius, wl = kt.borderStyle.verticalCornerRadius;
20684
+ if (dl > 0 || wl > 0) {
20685
+ const Fl = `calc(${dl}px * var(--scale-factor)) / calc(${wl}px * var(--scale-factor))`;
20686
+ Un.style.borderRadius = Fl;
20687
20687
  } else if (this instanceof nt) {
20688
- const Dl = `calc(${nr}px * var(--scale-factor)) / calc(${Yn}px * var(--scale-factor))`;
20689
- Un.style.borderRadius = Dl;
20688
+ const Fl = `calc(${nr}px * var(--scale-factor)) / calc(${Yn}px * var(--scale-factor))`;
20689
+ Un.style.borderRadius = Fl;
20690
20690
  }
20691
20691
  switch (kt.borderStyle.style) {
20692
20692
  case r.AnnotationBorderStyleType.SOLID:
@@ -20705,8 +20705,8 @@ function requirePdf() {
20705
20705
  Un.style.borderBottomStyle = "solid";
20706
20706
  break;
20707
20707
  }
20708
- const Al = kt.borderColor || null;
20709
- Al ? Un.style.borderColor = r.Util.makeHexColor(Al[0] | 0, Al[1] | 0, Al[2] | 0) : Un.style.borderWidth = 0;
20708
+ const Dl = kt.borderColor || null;
20709
+ Dl ? Un.style.borderColor = r.Util.makeHexColor(Dl[0] | 0, Dl[1] | 0, Dl[2] | 0) : Un.style.borderWidth = 0;
20710
20710
  }
20711
20711
  Un.style.left = `${100 * (Ha[0] - un) / Ti}%`, Un.style.top = `${100 * (Ha[1] - Fr) / ji}%`;
20712
20712
  const {
@@ -21162,7 +21162,7 @@ function requirePdf() {
21162
21162
  ji.target.setSelectionRange(...ji.detail.selRange);
21163
21163
  },
21164
21164
  charLimit: (ji) => {
21165
- var Fl;
21165
+ var wl;
21166
21166
  const {
21167
21167
  charLimit: Ha
21168
21168
  } = ji.detail, {
@@ -21176,7 +21176,7 @@ function requirePdf() {
21176
21176
  let dl = un.userValue;
21177
21177
  !dl || dl.length <= Ha || (dl = dl.slice(0, Ha), ml.value = un.userValue = dl, me.setValue(kt, {
21178
21178
  value: dl
21179
- }), (Fl = this.linkService.eventBus) == null || Fl.dispatch("dispatcheventinsandbox", {
21179
+ }), (wl = this.linkService.eventBus) == null || wl.dispatch("dispatcheventinsandbox", {
21180
21180
  source: this,
21181
21181
  detail: {
21182
21182
  id: kt,
@@ -21231,7 +21231,7 @@ function requirePdf() {
21231
21231
  }
21232
21232
  })), Ni(Si);
21233
21233
  }), (zt = this.data.actions) != null && zt.Keystroke && St.addEventListener("beforeinput", (Si) => {
21234
- var Dl;
21234
+ var Fl;
21235
21235
  const {
21236
21236
  data: Ti,
21237
21237
  target: ji
@@ -21240,26 +21240,26 @@ function requirePdf() {
21240
21240
  selectionStart: ml,
21241
21241
  selectionEnd: dl
21242
21242
  } = ji;
21243
- let Fl = ml, Al = dl;
21243
+ let wl = ml, Dl = dl;
21244
21244
  switch (Si.inputType) {
21245
21245
  case "deleteWordBackward": {
21246
- const xl = Ha.substring(0, ml).match(/\w*[^\w]*$/);
21247
- xl && (Fl -= xl[0].length);
21246
+ const Bl = Ha.substring(0, ml).match(/\w*[^\w]*$/);
21247
+ Bl && (wl -= Bl[0].length);
21248
21248
  break;
21249
21249
  }
21250
21250
  case "deleteWordForward": {
21251
- const xl = Ha.substring(ml).match(/^[^\w]*\w*/);
21252
- xl && (Al += xl[0].length);
21251
+ const Bl = Ha.substring(ml).match(/^[^\w]*\w*/);
21252
+ Bl && (Dl += Bl[0].length);
21253
21253
  break;
21254
21254
  }
21255
21255
  case "deleteContentBackward":
21256
- ml === dl && (Fl -= 1);
21256
+ ml === dl && (wl -= 1);
21257
21257
  break;
21258
21258
  case "deleteContentForward":
21259
- ml === dl && (Al += 1);
21259
+ ml === dl && (Dl += 1);
21260
21260
  break;
21261
21261
  }
21262
- Si.preventDefault(), (Dl = this.linkService.eventBus) == null || Dl.dispatch("dispatcheventinsandbox", {
21262
+ Si.preventDefault(), (Fl = this.linkService.eventBus) == null || Fl.dispatch("dispatcheventinsandbox", {
21263
21263
  source: this,
21264
21264
  detail: {
21265
21265
  id: kt,
@@ -21267,8 +21267,8 @@ function requirePdf() {
21267
21267
  value: Ha,
21268
21268
  change: Ti || "",
21269
21269
  willCommit: !1,
21270
- selStart: Fl,
21271
- selEnd: Al
21270
+ selStart: wl,
21271
+ selEnd: Dl
21272
21272
  }
21273
21273
  });
21274
21274
  }), this._setEventListeners(St, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Si) => Si.target.value);
@@ -21859,7 +21859,7 @@ function requirePdf() {
21859
21859
  (me = this.downloadManager) == null || me.openOrDownloadData(this.container, this.content, this.filename);
21860
21860
  }
21861
21861
  }
21862
- const Kn = class Kn {
21862
+ const Xn = class Xn {
21863
21863
  static render(me) {
21864
21864
  var Yn, un;
21865
21865
  const {
@@ -21901,12 +21901,12 @@ function requirePdf() {
21901
21901
  const Si = Ni.render();
21902
21902
  if (Fr.hidden && (Si.style.visibility = "hidden"), Array.isArray(Si))
21903
21903
  for (const Ti of Si)
21904
- Ti.style.zIndex = nr++, gl(Yn = Kn, mt, H0).call(Yn, Ti, Fr.id, St, Un);
21904
+ Ti.style.zIndex = nr++, gl(Yn = Xn, mt, H0).call(Yn, Ti, Fr.id, St, Un);
21905
21905
  else
21906
- Si.style.zIndex = nr++, Ni instanceof P ? St.prepend(Si) : gl(un = Kn, mt, H0).call(un, Si, Fr.id, St, Un);
21906
+ Si.style.zIndex = nr++, Ni instanceof P ? St.prepend(Si) : gl(un = Xn, mt, H0).call(un, Si, Fr.id, St, Un);
21907
21907
  }
21908
21908
  }
21909
- gl(this, mt, G0).call(this, St, me.annotationCanvasMap);
21909
+ gl(this, mt, K0).call(this, St, me.annotationCanvasMap);
21910
21910
  }
21911
21911
  static update(me) {
21912
21912
  const {
@@ -21914,7 +21914,7 @@ function requirePdf() {
21914
21914
  div: St,
21915
21915
  viewport: zt
21916
21916
  } = me;
21917
- gl(this, mt, V0).call(this, St, zt), gl(this, mt, G0).call(this, St, kt), St.hidden = !1;
21917
+ gl(this, mt, V0).call(this, St, zt), gl(this, mt, K0).call(this, St, kt), St.hidden = !1;
21918
21918
  }
21919
21919
  };
21920
21920
  mt = new WeakSet(), H0 = function(me, kt, St, zt) {
@@ -21929,7 +21929,7 @@ function requirePdf() {
21929
21929
  style: Un
21930
21930
  } = me, nr = zt % 180 !== 0, Yn = Math.floor(kt) + "px", un = Math.floor(St) + "px";
21931
21931
  Un.width = nr ? un : Yn, Un.height = nr ? Yn : un, me.setAttribute("data-main-rotation", zt);
21932
- }, G0 = function(me, kt) {
21932
+ }, K0 = function(me, kt) {
21933
21933
  if (kt) {
21934
21934
  for (const [St, zt] of kt) {
21935
21935
  const Un = me.querySelector(`[data-annotation-id="${St}"]`);
@@ -21942,8 +21942,8 @@ function requirePdf() {
21942
21942
  }
21943
21943
  kt.clear();
21944
21944
  }
21945
- }, bl(Kn, mt);
21946
- let ur = Kn;
21945
+ }, bl(Xn, mt);
21946
+ let ur = Xn;
21947
21947
  t.AnnotationLayer = ur;
21948
21948
  },
21949
21949
  /* 28 */
@@ -22628,20 +22628,20 @@ function requirePdf() {
22628
22628
  throw new Error("invalid format");
22629
22629
  }
22630
22630
  const ot = new Uint8Array((1 + ur) * Pi);
22631
- let Xn = 0, It = 0;
22631
+ let Gn = 0, It = 0;
22632
22632
  for (let zt = 0; zt < Pi; ++zt)
22633
- ot[Xn++] = 0, ot.set(mt.subarray(It, It + ur), Xn), It += ur, Xn += ur;
22633
+ ot[Gn++] = 0, ot.set(mt.subarray(It, It + ur), Gn), It += ur, Gn += ur;
22634
22634
  if (Ur === s.ImageKind.GRAYSCALE_1BPP && Ar) {
22635
- Xn = 0;
22635
+ Gn = 0;
22636
22636
  for (let zt = 0; zt < Pi; zt++) {
22637
- Xn++;
22637
+ Gn++;
22638
22638
  for (let Un = 0; Un < ur; Un++)
22639
- ot[Xn++] ^= 255;
22639
+ ot[Gn++] ^= 255;
22640
22640
  }
22641
22641
  }
22642
- const Kn = new Uint8Array([Is >> 24 & 255, Is >> 16 & 255, Is >> 8 & 255, Is & 255, Pi >> 24 & 255, Pi >> 16 & 255, Pi >> 8 & 255, Pi & 255, Oi, hl, 0, 0, 0]), Gn = ln(ot), me = N.length + P * 3 + Kn.length + Gn.length, kt = new Uint8Array(me);
22642
+ const Xn = new Uint8Array([Is >> 24 & 255, Is >> 16 & 255, Is >> 8 & 255, Is & 255, Pi >> 24 & 255, Pi >> 16 & 255, Pi >> 8 & 255, Pi & 255, Oi, hl, 0, 0, 0]), Kn = ln(ot), me = N.length + P * 3 + Xn.length + Kn.length, kt = new Uint8Array(me);
22643
22643
  let St = 0;
22644
- return kt.set(N, St), St += N.length, Lt("IHDR", Kn, kt, St), St += P + Kn.length, Lt("IDATA", Gn, kt, St), St += P + Gn.length, Lt("IEND", new Uint8Array(0), kt, St), de(kt, "image/png", Br);
22644
+ return kt.set(N, St), St += N.length, Lt("IHDR", Xn, kt, St), St += P + Xn.length, Lt("IDATA", Kn, kt, St), St += P + Kn.length, Lt("IEND", new Uint8Array(0), kt, St), de(kt, "image/png", Br);
22645
22645
  }
22646
22646
  return function(Ur, Br, Ar) {
22647
22647
  const Is = Ur.kind === void 0 ? s.ImageKind.GRAYSCALE_1BPP : Ur.kind;
@@ -22905,18 +22905,18 @@ function requirePdf() {
22905
22905
  continue;
22906
22906
  }
22907
22907
  const ur = (hl.isSpace ? ln : 0) + Zn, mt = hl.fontChar;
22908
- let ot, Xn, It = hl.width;
22908
+ let ot, Gn, It = hl.width;
22909
22909
  if (As) {
22910
- let Gn;
22910
+ let Kn;
22911
22911
  const me = hl.vmetric || Br;
22912
- Gn = hl.vmetric ? me[1] : It * 0.5, Gn = -Gn * Ar;
22912
+ Kn = hl.vmetric ? me[1] : It * 0.5, Kn = -Kn * Ar;
22913
22913
  const kt = me[2] * Ar;
22914
- It = me ? -me[0] : It, ot = Gn / Lt, Xn = (Is + kt) / Lt;
22914
+ It = me ? -me[0] : It, ot = Kn / Lt, Gn = (Is + kt) / Lt;
22915
22915
  } else
22916
- ot = Is / Lt, Xn = 0;
22917
- (hl.isInFont || p.missingFile) && (P.xcoords.push(P.x + ot), As && P.ycoords.push(-P.y + Xn), P.tspan.textContent += mt);
22918
- let Kn;
22919
- As ? Kn = It * Ar - ur * qs : Kn = It * Ar + ur * qs, Is += Kn;
22916
+ ot = Is / Lt, Gn = 0;
22917
+ (hl.isInFont || p.missingFile) && (P.xcoords.push(P.x + ot), As && P.ycoords.push(-P.y + Gn), P.tspan.textContent += mt);
22918
+ let Xn;
22919
+ As ? Xn = It * Ar - ur * qs : Xn = It * Ar + ur * qs, Is += Xn;
22920
22920
  }
22921
22921
  P.tspan.setAttributeNS(null, "x", P.xcoords.map(o).join(" ")), As ? P.tspan.setAttributeNS(null, "y", P.ycoords.map(o).join(" ")) : P.tspan.setAttributeNS(null, "y", o(-P.y)), As ? P.y -= Is : P.x += Is * ki, P.tspan.setAttributeNS(null, "font-family", P.fontFamily), P.tspan.setAttributeNS(null, "font-size", `${o(P.fontSize)}px`), P.fontStyle !== c.fontStyle && P.tspan.setAttributeNS(null, "font-style", P.fontStyle), P.fontWeight !== c.fontWeight && P.tspan.setAttributeNS(null, "font-weight", P.fontWeight);
22922
22922
  const Pi = P.textRenderingMode & s.TextRenderingMode.FILL_STROKE_MASK;
@@ -22990,14 +22990,14 @@ function requirePdf() {
22990
22990
  return N[0] === "TilingPattern" ? this._makeTilingPattern(N) : this._makeShadingPattern(N);
22991
22991
  }
22992
22992
  _makeTilingPattern(N) {
22993
- const P = N[1], p = N[2], Dt = N[3] || s.IDENTITY_MATRIX, [Lt, Zn, ln, qs] = N[4], ki = N[5], As = N[6], Ur = N[7], Br = `shading${Le++}`, [Ar, Is, Pi, Oi] = s.Util.normalizeRect([...s.Util.applyTransform([Lt, Zn], Dt), ...s.Util.applyTransform([ln, qs], Dt)]), [hl, ur] = s.Util.singularValueDecompose2dScale(Dt), mt = ki * hl, ot = As * ur, Xn = this.svgFactory.createElement("svg:pattern");
22994
- Xn.setAttributeNS(null, "id", Br), Xn.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), Xn.setAttributeNS(null, "width", mt), Xn.setAttributeNS(null, "height", ot), Xn.setAttributeNS(null, "x", `${Ar}`), Xn.setAttributeNS(null, "y", `${Is}`);
22995
- const It = this.svg, Kn = this.transformMatrix, Gn = this.current.fillColor, me = this.current.strokeColor, kt = this.svgFactory.create(Pi - Ar, Oi - Is);
22993
+ const P = N[1], p = N[2], Dt = N[3] || s.IDENTITY_MATRIX, [Lt, Zn, ln, qs] = N[4], ki = N[5], As = N[6], Ur = N[7], Br = `shading${Le++}`, [Ar, Is, Pi, Oi] = s.Util.normalizeRect([...s.Util.applyTransform([Lt, Zn], Dt), ...s.Util.applyTransform([ln, qs], Dt)]), [hl, ur] = s.Util.singularValueDecompose2dScale(Dt), mt = ki * hl, ot = As * ur, Gn = this.svgFactory.createElement("svg:pattern");
22994
+ Gn.setAttributeNS(null, "id", Br), Gn.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), Gn.setAttributeNS(null, "width", mt), Gn.setAttributeNS(null, "height", ot), Gn.setAttributeNS(null, "x", `${Ar}`), Gn.setAttributeNS(null, "y", `${Is}`);
22995
+ const It = this.svg, Xn = this.transformMatrix, Kn = this.current.fillColor, me = this.current.strokeColor, kt = this.svgFactory.create(Pi - Ar, Oi - Is);
22996
22996
  if (this.svg = kt, this.transformMatrix = Dt, Ur === 2) {
22997
22997
  const St = s.Util.makeHexColor(...P);
22998
22998
  this.current.fillColor = St, this.current.strokeColor = St;
22999
22999
  }
23000
- return this.executeOpTree(this.convertOpList(p)), this.svg = It, this.transformMatrix = Kn, this.current.fillColor = Gn, this.current.strokeColor = me, Xn.append(kt.childNodes[0]), this.defs.append(Xn), `url(#${Br})`;
23000
+ return this.executeOpTree(this.convertOpList(p)), this.svg = It, this.transformMatrix = Xn, this.current.fillColor = Kn, this.current.strokeColor = me, Gn.append(kt.childNodes[0]), this.defs.append(Gn), `url(#${Br})`;
23001
23001
  }
23002
23002
  _makeShadingPattern(N) {
23003
23003
  switch (typeof N == "string" && (N = this.objs.get(N)), N[0]) {
@@ -24691,13 +24691,13 @@ const ErrorContainer$1 = dt.div`
24691
24691
  Ur(St), Is("annotation:toggle", { isAnnotating: St });
24692
24692
  }, [As, Is]), ot = useCallback(() => {
24693
24693
  Is("download:start", { fileUrl: e, fileName: r });
24694
- }, [Is, e, r]), Xn = useCallback(() => {
24694
+ }, [Is, e, r]), Gn = useCallback(() => {
24695
24695
  ki((St) => (St - 90) % 360), Is("rotate:left", { rotation: (qs - 90) % 360 });
24696
24696
  }, [qs, Is]), It = useCallback(() => {
24697
24697
  ki((St) => (St + 90) % 360), Is("rotate:right", { rotation: (qs + 90) % 360 });
24698
- }, [qs, Is]), Kn = useCallback(() => {
24698
+ }, [qs, Is]), Xn = useCallback(() => {
24699
24699
  Is("viewer:close");
24700
- }, [Is]), Gn = useCallback((St, zt) => {
24700
+ }, [Is]), Kn = useCallback((St, zt) => {
24701
24701
  const Un = St === "pdf", nr = St === "text" || St === "markdown" || St === "markdown_table" || St === "html";
24702
24702
  return {
24703
24703
  ...zt,
@@ -24716,7 +24716,7 @@ const ErrorContainer$1 = dt.div`
24716
24716
  };
24717
24717
  }, []);
24718
24718
  if (o) {
24719
- const St = Gn(t || "unknown", {
24719
+ const St = Kn(t || "unknown", {
24720
24720
  ...l,
24721
24721
  navigation: !1
24722
24722
  });
@@ -24740,7 +24740,7 @@ const ErrorContainer$1 = dt.div`
24740
24740
  },
24741
24741
  onDownload: () => {
24742
24742
  },
24743
- onClose: Kn,
24743
+ onClose: Xn,
24744
24744
  scale: 1,
24745
24745
  isAnnotating: !1,
24746
24746
  className: de
@@ -24760,7 +24760,7 @@ const ErrorContainer$1 = dt.div`
24760
24760
  ));
24761
24761
  }
24762
24762
  if (Le) {
24763
- const St = Gn(t || "unknown", {
24763
+ const St = Kn(t || "unknown", {
24764
24764
  ...l,
24765
24765
  navigation: !1
24766
24766
  });
@@ -24784,7 +24784,7 @@ const ErrorContainer$1 = dt.div`
24784
24784
  },
24785
24785
  onDownload: () => {
24786
24786
  },
24787
- onClose: Kn,
24787
+ onClose: Xn,
24788
24788
  scale: 1,
24789
24789
  isAnnotating: !1,
24790
24790
  className: de
@@ -24792,7 +24792,7 @@ const ErrorContainer$1 = dt.div`
24792
24792
  ), /* @__PURE__ */ React.createElement(ErrorContainer$1, { $theme: u }, /* @__PURE__ */ React.createElement("div", null, "\u6587\u4EF6\u52A0\u8F7D\u5931\u8D25"), /* @__PURE__ */ React.createElement("div", { style: { fontSize: "12px", marginTop: "8px" } }, Le)));
24793
24793
  }
24794
24794
  if (!P) {
24795
- const St = Gn(t || "unknown", {
24795
+ const St = Kn(t || "unknown", {
24796
24796
  ...l,
24797
24797
  navigation: !1
24798
24798
  });
@@ -24816,7 +24816,7 @@ const ErrorContainer$1 = dt.div`
24816
24816
  },
24817
24817
  onDownload: () => {
24818
24818
  },
24819
- onClose: Kn,
24819
+ onClose: Xn,
24820
24820
  scale: 1,
24821
24821
  isAnnotating: !1,
24822
24822
  className: de
@@ -24828,7 +24828,7 @@ const ErrorContainer$1 = dt.div`
24828
24828
  ...(P.fileName || r) && { fileName: P.fileName || r },
24829
24829
  ...(P.fileType || t) && { fileType: P.fileType || t },
24830
24830
  ...P.totalPages && { totalPages: P.totalPages }
24831
- }, kt = Gn(P.type, l);
24831
+ }, kt = Kn(P.type, l);
24832
24832
  return console.log("=== viewerData \u51C6\u5907 ==="), console.log("viewerData:", me), console.log("viewerData.content:", me.content), console.log("viewerData.content.document:", (E = me.content) == null ? void 0 : E.document), console.log("\u6587\u4EF6\u7C7B\u578B:", P.type), console.log("\u52A8\u6001\u5DE5\u5177\u914D\u7F6E:", kt), console.log("=== \u6807\u6CE8\u6570\u636E\u4F20\u9012 ==="), console.log("annotations prop:", n), console.log("annotations \u957F\u5EA6:", (n == null ? void 0 : n.length) || 0), /* @__PURE__ */ React.createElement(ReaderContainer$1, { $theme: u, className: tt }, /* @__PURE__ */ React.createElement(
24833
24833
  Header,
24834
24834
  {
@@ -24849,11 +24849,11 @@ const ErrorContainer$1 = dt.div`
24849
24849
  },
24850
24850
  onDownload: kt.download ? ot : () => {
24851
24851
  },
24852
- onRotateLeft: kt.rotate ? Xn : () => {
24852
+ onRotateLeft: kt.rotate ? Gn : () => {
24853
24853
  },
24854
24854
  onRotateRight: kt.rotate ? It : () => {
24855
24855
  },
24856
- onClose: Kn,
24856
+ onClose: Xn,
24857
24857
  scale: Zn,
24858
24858
  isAnnotating: As,
24859
24859
  className: de
@@ -26744,9 +26744,9 @@ const {
26744
26744
  headerClass: u,
26745
26745
  contentClass: o
26746
26746
  }) => {
26747
- const [pe, st] = useState(!0), [nt, Le] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [N, P] = useState(null), [p, Dt] = useState(s), [Lt, Zn] = useState(i || 0), [ln, qs] = useState(1), [ki, As] = useState(0), [Ur, Br] = useState(null), [Ar, Is] = useState(null), [Pi, Oi] = useState(""), [hl, ur] = useState(null), [mt, ot] = useState(null), [Xn, It] = useState({}), Kn = useRef(!1), Gn = useRef(!1), me = useRef({}), kt = useRef({}), St = useRef(null), zt = useRef(null), Un = useRef(s), nr = (de == null ? void 0 : de.theme) || defaultTheme;
26747
+ const [pe, st] = useState(!0), [nt, Le] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [N, P] = useState(null), [p, Dt] = useState(s), [Lt, Zn] = useState(i || 0), [ln, qs] = useState(1), [ki, As] = useState(0), [Ur, Br] = useState(null), [Ar, Is] = useState(null), [Pi, Oi] = useState(""), [hl, ur] = useState(null), [mt, ot] = useState(null), [Gn, It] = useState({}), Xn = useRef(!1), Kn = useRef(!1), me = useRef({}), kt = useRef({}), St = useRef(null), zt = useRef(null), Un = useRef(s), nr = (de == null ? void 0 : de.theme) || defaultTheme;
26748
26748
  useEffect(() => {
26749
- Kn.current = !1, Gn.current = !1;
26749
+ Xn.current = !1, Kn.current = !1;
26750
26750
  }, [n, e]);
26751
26751
  const un = useCallback(() => {
26752
26752
  const sr = {
@@ -26835,14 +26835,14 @@ const {
26835
26835
  if (!(n === "pdf" || n === "pdf_slides"))
26836
26836
  return console.log(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7\u7F13\u5B58\u68C0\u67E5`), null;
26837
26837
  console.log(`\u68C0\u67E5\u9875\u9762 ${sr} \u662F\u5426\u5728\u7F13\u5B58\u4E2D`);
26838
- const wl = me.current[sr];
26839
- if (wl && Date.now() - wl.timestamp < CACHE_EXPIRY_TIME)
26840
- return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${sr}`), wl.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), wl.pdfDocument) : null;
26841
- const Bl = Fr(sr, c), Tg = kt.current[Bl];
26842
- if (console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${Bl}, \u5B58\u5728: ${!!Tg}, \u5305\u542B\u9875\u9762: ${((_a = Tg == null ? void 0 : Tg.pages) == null ? void 0 : _a.join(", ")) || "\u65E0"}`), Tg && Date.now() - Tg.timestamp < CACHE_EXPIRY_TIME) {
26838
+ const Al = me.current[sr];
26839
+ if (Al && Date.now() - Al.timestamp < CACHE_EXPIRY_TIME)
26840
+ return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${sr}`), Al.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), Al.pdfDocument) : null;
26841
+ const xl = Fr(sr, c), Tg = kt.current[xl];
26842
+ if (console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${xl}, \u5B58\u5728: ${!!Tg}, \u5305\u542B\u9875\u9762: ${((_a = Tg == null ? void 0 : Tg.pages) == null ? void 0 : _a.join(", ")) || "\u65E0"}`), Tg && Date.now() - Tg.timestamp < CACHE_EXPIRY_TIME) {
26843
26843
  if (Tg.pages.includes(sr))
26844
- return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${sr} (chunk: ${Bl})`), Tg.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), Tg.pdfDocument) : null;
26845
- console.log(`\u9875\u9762 ${sr} \u4E0D\u5728chunk ${Bl} \u4E2D\uFF0Cchunk\u5305\u542B: ${Tg.pages.join(", ")}`);
26844
+ return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${sr} (chunk: ${xl})`), Tg.pdfDocument ? (console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), Tg.pdfDocument) : null;
26845
+ console.log(`\u9875\u9762 ${sr} \u4E0D\u5728chunk ${xl} \u4E2D\uFF0Cchunk\u5305\u542B: ${Tg.pages.join(", ")}`);
26846
26846
  }
26847
26847
  return console.log(`\u9875\u9762 ${sr} \u4E0D\u5728\u4EFB\u4F55\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42`), null;
26848
26848
  }, [c, Fr, n]), Si = useCallback(async (sr) => {
@@ -26850,15 +26850,15 @@ const {
26850
26850
  try {
26851
26851
  if (!(n === "pdf" || n === "pdf_slides"))
26852
26852
  throw console.log(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u9700\u8981\u5206\u9875\u53C2\u6570\uFF0C\u83B7\u53D6\u5B8C\u6574\u5185\u5BB9`), new Error(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u652F\u6301\u5206\u9875\u52A0\u8F7D`);
26853
- const wl = Math.floor((sr - 1) / c) * c + 1, Bl = Fr(sr, c);
26854
- console.log(`\u8BF7\u6C42PDF chunk\u6570\u636E: ${wl} (\u5305\u542B\u9875\u9762 ${wl}-${wl + c - 1})`);
26853
+ const Al = Math.floor((sr - 1) / c) * c + 1, xl = Fr(sr, c);
26854
+ console.log(`\u8BF7\u6C42PDF chunk\u6570\u636E: ${Al} (\u5305\u542B\u9875\u9762 ${Al}-${Al + c - 1})`);
26855
26855
  const Tg = {
26856
26856
  "Content-Type": "application/json"
26857
26857
  };
26858
26858
  l && (Tg.Authorization = l), r && (Tg["X-CSRF-TOKEN-IN"] = r);
26859
26859
  const e0 = {
26860
26860
  convertedFilePath: e,
26861
- pageNo: wl,
26861
+ pageNo: Al,
26862
26862
  // 使用chunk的起始页
26863
26863
  pageSize: c
26864
26864
  }, Ug = await axios.post(
@@ -26868,27 +26868,29 @@ const {
26868
26868
  headers: Tg,
26869
26869
  responseType: "arraybuffer"
26870
26870
  }
26871
- ), Kg = Array.from({ length: c }, (a0, u0) => wl + u0);
26872
- return kt.current[Bl] = {
26871
+ ), Kg = Ug.headers["x-csrf-token-out"] || Ug.headers["X-CSRF-TOKEN-OUT"];
26872
+ Kg && (console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:", Kg), b("request_finish", Kg));
26873
+ const i0 = Array.from({ length: c }, (l0, c0) => Al + c0);
26874
+ return kt.current[xl] = {
26873
26875
  data: Ug.data,
26874
- pages: Kg,
26876
+ pages: i0,
26875
26877
  timestamp: Date.now(),
26876
26878
  totalPages: i
26877
26879
  // 始终使用用户传入的总页数,不覆盖
26878
- }, console.log(`\u7F13\u5B58PDF chunk\u6570\u636E: ${Bl}, \u5305\u542B\u9875\u9762: ${Kg.join(", ")}, \u8BF7\u6C42\u7684\u9875\u9762: ${sr}`), console.log("\u5F53\u524D\u6240\u6709\u7F13\u5B58:", Object.keys(kt.current)), Ug.data;
26880
+ }, console.log(`\u7F13\u5B58PDF chunk\u6570\u636E: ${xl}, \u5305\u542B\u9875\u9762: ${i0.join(", ")}, \u8BF7\u6C42\u7684\u9875\u9762: ${sr}`), console.log("\u5F53\u524D\u6240\u6709\u7F13\u5B58:", Object.keys(kt.current)), Ug.data;
26879
26881
  } catch (vl) {
26880
26882
  throw console.error("\u83B7\u53D6PDF stream\u6570\u636E\u5931\u8D25:", vl), new Error(`PDF\u8BF7\u6C42\u5931\u8D25: ${((_a = vl.response) == null ? void 0 : _a.status) || "\u7F51\u7EDC\u9519\u8BEF"}`);
26881
26883
  }
26882
- }, [h, e, c, l, Fr, i, Lt, n]), Ti = useCallback(async (sr, _a = !1) => {
26884
+ }, [h, e, c, l, Fr, i, Lt, n, b]), Ti = useCallback(async (sr, _a = !1) => {
26883
26885
  var vl;
26884
26886
  if (!sr) return;
26885
26887
  if (!(n === "pdf" || n === "pdf_slides"))
26886
26888
  return console.log(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7PDF\u52A0\u8F7D\u903B\u8F91`), null;
26887
26889
  try {
26888
26890
  _a ? (st(!0), Le("\u6B63\u5728\u52A0\u8F7DPDF\u6587\u6863...")) : (st(!0), Le(`\u6B63\u5728\u52A0\u8F7D\u7B2C ${sr} \u9875...`)), P(null), console.log(`\u5F00\u59CB\u52A0\u8F7DPDF\u9875\u9762: ${sr}, \u521D\u59CB\u52A0\u8F7D: ${_a}`);
26889
- const Bl = await Ni(sr);
26890
- if (Bl)
26891
- return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), Br(Bl), st(!1), Le(""), console.log(`\u9875\u9762 ${sr} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`), Bl;
26891
+ const xl = await Ni(sr);
26892
+ if (xl)
26893
+ return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${sr}`), Br(xl), st(!1), Le(""), console.log(`\u9875\u9762 ${sr} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`), xl;
26892
26894
  const Tg = await Si(sr), e0 = await parseFile(Tg, {
26893
26895
  fileName: t || "Stream\u6587\u6863",
26894
26896
  fileType: "pdf",
@@ -26904,12 +26906,12 @@ const {
26904
26906
  if (kt.current[Kg] && (kt.current[Kg].pdfDocument = Ug, console.log(`\u7F13\u5B58PDF\u6587\u6863\u5230chunk: ${Kg}`)), i)
26905
26907
  console.log(`\u4F7F\u7528\u7528\u6237\u4F20\u5165\u7684\u603B\u9875\u6570: ${i}`), Zn(i);
26906
26908
  else if (Ug && Ug.numPages) {
26907
- const a0 = Ug.numPages;
26908
- console.log(`\u7528\u6237\u672A\u4F20\u5165\u603B\u9875\u6570\uFF0C\u4ECEPDF\u6587\u6863\u83B7\u53D6\u5B9E\u9645\u603B\u9875\u6570: ${a0}`), Zn(a0);
26909
+ const i0 = Ug.numPages;
26910
+ console.log(`\u7528\u6237\u672A\u4F20\u5165\u603B\u9875\u6570\uFF0C\u4ECEPDF\u6587\u6863\u83B7\u53D6\u5B9E\u9645\u603B\u9875\u6570: ${i0}`), Zn(i0);
26909
26911
  }
26910
26912
  return st(!1), Le(""), console.log(`\u9875\u9762 ${sr} \u52A0\u8F7D\u5B8C\u6210`), Ug;
26911
- } catch (Bl) {
26912
- throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:", Bl), P(Bl.message || "PDF\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), Bl;
26913
+ } catch (xl) {
26914
+ throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:", xl), P(xl.message || "PDF\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), xl;
26913
26915
  }
26914
26916
  }, [Si, t, l, Lt, Ni, Fr, c, n]), ji = useCallback((sr) => {
26915
26917
  if (!(n === "pdf" || n === "pdf_slides"))
@@ -26917,8 +26919,8 @@ const {
26917
26919
  const vl = me.current[sr];
26918
26920
  if (vl && Date.now() - vl.timestamp < CACHE_EXPIRY_TIME)
26919
26921
  return !!vl.pdfDocument;
26920
- const wl = Fr(sr, c), Bl = kt.current[wl];
26921
- return Bl && Date.now() - Bl.timestamp < CACHE_EXPIRY_TIME ? Bl.pages.includes(sr) && !!Bl.pdfDocument : !1;
26922
+ const Al = Fr(sr, c), xl = kt.current[Al];
26923
+ return xl && Date.now() - xl.timestamp < CACHE_EXPIRY_TIME ? xl.pages.includes(sr) && !!xl.pdfDocument : !1;
26922
26924
  }, [c, Fr, n]), Ha = useCallback(() => {
26923
26925
  console.log("\u68C0\u67E5markdown\u5185\u5BB9\u662F\u5426\u5728\u7F13\u5B58\u4E2D");
26924
26926
  const sr = St.current;
@@ -26936,16 +26938,16 @@ const {
26936
26938
  // 不传pageNo和pageSize,获取完整文章
26937
26939
  };
26938
26940
  console.log("\u53D1\u9001markdown\u8BF7\u6C42:", vl);
26939
- const wl = await axios.post(h, vl, {
26941
+ const Al = await axios.post(h, vl, {
26940
26942
  headers: _a,
26941
26943
  responseType: "text"
26942
26944
  // markdown返回文本
26943
- });
26944
- return console.log("markdown\u54CD\u5E94\u72B6\u6001:", wl.status), console.log("markdown\u54CD\u5E94\u6570\u636E\u957F\u5EA6:", ((sr = wl.data) == null ? void 0 : sr.length) || 0), wl.data;
26945
+ }), xl = Al.headers["x-csrf-token-out"] || Al.headers["X-CSRF-TOKEN-OUT"];
26946
+ return xl && (console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:", xl), b("request_finish", xl)), console.log("markdown\u54CD\u5E94\u72B6\u6001:", Al.status), console.log("markdown\u54CD\u5E94\u6570\u636E\u957F\u5EA6:", ((sr = Al.data) == null ? void 0 : sr.length) || 0), Al.data;
26945
26947
  } catch (_a) {
26946
26948
  throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:", _a), new Error(`\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25: ${_a.message}`);
26947
26949
  }
26948
- }, [e, l, h]), dl = useCallback(async () => {
26950
+ }, [e, l, h, b]), dl = useCallback(async () => {
26949
26951
  try {
26950
26952
  st(!0), Le("\u6B63\u5728\u52A0\u8F7Dmarkdown\u6587\u6863..."), P(null), console.log("\u5F00\u59CB\u52A0\u8F7D\u5B8C\u6574markdown\u6587\u6863");
26951
26953
  const sr = Ha();
@@ -26959,7 +26961,7 @@ const {
26959
26961
  } catch (sr) {
26960
26962
  throw console.error("markdown\u52A0\u8F7D\u5931\u8D25:", sr), P(sr.message || "markdown\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), sr;
26961
26963
  }
26962
- }, [ml, Ha]), Fl = useCallback(async () => {
26964
+ }, [ml, Ha]), wl = useCallback(async () => {
26963
26965
  try {
26964
26966
  const sr = {
26965
26967
  "Content-Type": "application/json"
@@ -26968,22 +26970,22 @@ const {
26968
26970
  const _a = {
26969
26971
  convertedFilePath: e
26970
26972
  // 不传 pageNo/pageSize,获取完整图片二进制
26971
- };
26972
- return (await axios.post(
26973
+ }, vl = await axios.post(
26973
26974
  h,
26974
26975
  _a,
26975
26976
  {
26976
26977
  headers: sr,
26977
26978
  responseType: "arraybuffer"
26978
26979
  }
26979
- )).data;
26980
+ ), Al = vl.headers["x-csrf-token-out"] || vl.headers["X-CSRF-TOKEN-OUT"];
26981
+ return Al && (console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:", Al), b("request_finish", Al)), vl.data;
26980
26982
  } catch (sr) {
26981
26983
  throw console.error("\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25:", sr), new Error(`\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25: ${sr.message}`);
26982
26984
  }
26983
- }, [e, l, h]), Al = useCallback(async () => {
26985
+ }, [e, l, h, b]), Dl = useCallback(async () => {
26984
26986
  try {
26985
26987
  st(!0), Le("\u6B63\u5728\u52A0\u8F7D\u56FE\u7247..."), P(null);
26986
- const sr = await Fl(), _a = await parseFile(sr, {
26988
+ const sr = await wl(), _a = await parseFile(sr, {
26987
26989
  fileName: t || "\u56FE\u7247",
26988
26990
  fileType: "image",
26989
26991
  token: l
@@ -26996,7 +26998,7 @@ const {
26996
26998
  } catch (sr) {
26997
26999
  throw console.error("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:", sr), P(sr.message || "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), sr;
26998
27000
  }
26999
- }, [l, t, Fl]), Dl = useCallback(async () => {
27001
+ }, [l, t, wl]), Fl = useCallback(async () => {
27000
27002
  var sr;
27001
27003
  try {
27002
27004
  console.log(`\u8BF7\u6C42\u901A\u7528\u6587\u4EF6\u6570\u636E\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`);
@@ -27009,66 +27011,66 @@ const {
27009
27011
  // 非PDF文件类型不传pageNo和pageSize,获取完整文件内容
27010
27012
  };
27011
27013
  console.log("\u53D1\u9001\u901A\u7528\u6587\u4EF6\u8BF7\u6C42:", vl);
27012
- const wl = await axios.post(
27014
+ const Al = await axios.post(
27013
27015
  h,
27014
27016
  vl,
27015
27017
  {
27016
27018
  headers: _a,
27017
27019
  responseType: "arraybuffer"
27018
27020
  }
27019
- );
27020
- return console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u72B6\u6001:", wl.status), console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u6570\u636E\u957F\u5EA6:", ((sr = wl.data) == null ? void 0 : sr.byteLength) || 0), wl.data;
27021
+ ), xl = Al.headers["x-csrf-token-out"] || Al.headers["X-CSRF-TOKEN-OUT"];
27022
+ return xl && (console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:", xl), b("request_finish", xl)), console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u72B6\u6001:", Al.status), console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u6570\u636E\u957F\u5EA6:", ((sr = Al.data) == null ? void 0 : sr.byteLength) || 0), Al.data;
27021
27023
  } catch (_a) {
27022
27024
  throw console.error("\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25:", _a), new Error(`\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25: ${_a.message}`);
27023
27025
  }
27024
- }, [e, l, h]), xl = useCallback(async () => {
27026
+ }, [e, l, h, b]), Bl = useCallback(async () => {
27025
27027
  try {
27026
- if (console.log("=== loadGenericDocument \u88AB\u8C03\u7528 ==="), console.log("\u8C03\u7528\u6808:", new Error().stack), console.log("\u5F53\u524D\u65F6\u95F4:", (/* @__PURE__ */ new Date()).toISOString()), Kn.current) {
27028
+ if (console.log("=== loadGenericDocument \u88AB\u8C03\u7528 ==="), console.log("\u8C03\u7528\u6808:", new Error().stack), console.log("\u5F53\u524D\u65F6\u95F4:", (/* @__PURE__ */ new Date()).toISOString()), Xn.current) {
27027
27029
  console.log(`\u901A\u7528\u6587\u6863\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`);
27028
27030
  return;
27029
27031
  }
27030
- if (Gn.current) {
27032
+ if (Kn.current) {
27031
27033
  console.log(`\u901A\u7528\u6587\u6863\u5DF2\u7ECF\u52A0\u8F7D\u8FC7\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`);
27032
27034
  return;
27033
27035
  }
27034
- const sr = `${n}_${e}`, _a = Xn[sr];
27036
+ const sr = `${n}_${e}`, _a = Gn[sr];
27035
27037
  if (console.log(`\u68C0\u67E5\u901A\u7528\u6587\u6863\u7F13\u5B58\uFF0Ckey: ${sr}, \u7F13\u5B58\u5B58\u5728: ${!!_a}, \u7F13\u5B58\u65F6\u95F4: ${_a ? Date.now() - _a.timestamp : "N/A"}ms`), _a && Date.now() - _a.timestamp < CACHE_EXPIRY_TIME)
27036
27038
  return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684\u901A\u7528\u6587\u6863\u5185\u5BB9\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`), n === "text" && _a.content ? ur(_a.content) : n === "html" && _a.content && ot(_a.content), Dt(1), Zn(i || 1), st(!1), Le(""), _a.content;
27037
- Kn.current = !0, st(!0), Le(`\u6B63\u5728\u52A0\u8F7D${n}\u6587\u6863...`), P(null), console.log(`\u5F00\u59CB\u52A0\u8F7D\u901A\u7528\u6587\u6863\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`);
27038
- const vl = await Dl(), wl = await parseFile(vl, {
27039
+ Xn.current = !0, st(!0), Le(`\u6B63\u5728\u52A0\u8F7D${n}\u6587\u6863...`), P(null), console.log(`\u5F00\u59CB\u52A0\u8F7D\u901A\u7528\u6587\u6863\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`);
27040
+ const vl = await Fl(), Al = await parseFile(vl, {
27039
27041
  fileName: t || `${n}\u6587\u6863`,
27040
27042
  fileType: n,
27041
27043
  // 传递实际的文件类型
27042
27044
  token: l
27043
27045
  });
27044
- if (wl.error)
27045
- throw new Error(wl.error);
27046
- let Bl = null;
27047
- if (wl.type === "text" && wl.content)
27048
- ur(wl.content), Bl = wl.content;
27049
- else if (wl.type === "html" && wl.content)
27050
- ot(wl.content), Bl = wl.content;
27051
- else if (wl.type === "image" && wl.content)
27052
- Is(wl.content), Bl = wl.content;
27046
+ if (Al.error)
27047
+ throw new Error(Al.error);
27048
+ let xl = null;
27049
+ if (Al.type === "text" && Al.content)
27050
+ ur(Al.content), xl = Al.content;
27051
+ else if (Al.type === "html" && Al.content)
27052
+ ot(Al.content), xl = Al.content;
27053
+ else if (Al.type === "image" && Al.content)
27054
+ Is(Al.content), xl = Al.content;
27053
27055
  else {
27054
27056
  const e0 = new TextDecoder("utf-8").decode(vl);
27055
- ur({ type: "text", content: e0 }), Bl = { type: "text", content: e0 };
27057
+ ur({ type: "text", content: e0 }), xl = { type: "text", content: e0 };
27056
27058
  }
27057
- if (Bl) {
27059
+ if (xl) {
27058
27060
  const Tg = `${n}_${e}`, e0 = {
27059
- ...Xn,
27061
+ ...Gn,
27060
27062
  [Tg]: {
27061
- content: Bl,
27063
+ content: xl,
27062
27064
  timestamp: Date.now()
27063
27065
  }
27064
27066
  };
27065
27067
  It(e0), console.log(`\u901A\u7528\u6587\u6863\u5185\u5BB9\u5DF2\u7F13\u5B58\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}, \u7F13\u5B58\u952E: ${Tg}`), console.log("\u5F53\u524D\u7F13\u5B58\u72B6\u6001:", e0);
27066
27068
  }
27067
- return st(!1), Le(""), Kn.current = !1, Gn.current = !0, console.log(`\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5B8C\u6210\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`), wl;
27069
+ return st(!1), Le(""), Xn.current = !1, Kn.current = !0, console.log(`\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5B8C\u6210\uFF0C\u6587\u4EF6\u7C7B\u578B: ${n}`), Al;
27068
27070
  } catch (sr) {
27069
- throw console.error("\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25:", sr), P(sr.message || "\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), Kn.current = !1, Gn.current = !0, sr;
27071
+ throw console.error("\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25:", sr), P(sr.message || "\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"), st(!1), Le(""), Xn.current = !1, Kn.current = !0, sr;
27070
27072
  }
27071
- }, [Dl, t, l]), Pl = useCallback(async (sr) => {
27073
+ }, [Fl, t, l]), Pl = useCallback(async (sr) => {
27072
27074
  if (sr === Un.current) return;
27073
27075
  if (pe) {
27074
27076
  console.log("\u9875\u9762\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42");
@@ -27083,8 +27085,8 @@ const {
27083
27085
  await Ti(sr, !1), b("pageChange", { pageNumber: sr, totalPages: i || Lt });
27084
27086
  } catch (vl) {
27085
27087
  console.error("PDF\u9875\u9762\u52A0\u8F7D\u5931\u8D25:", vl);
27086
- const wl = Un.current;
27087
- Dt(wl);
27088
+ const Al = Un.current;
27089
+ Dt(Al);
27088
27090
  }
27089
27091
  }, [Ti, Lt, b, ji, pe, n]);
27090
27092
  useEffect(() => {
@@ -27106,14 +27108,14 @@ const {
27106
27108
  }, [ki, b]), s0 = useCallback(() => {
27107
27109
  const sr = (ki + 90) % 360;
27108
27110
  As(sr), b("rotateChange", { rotation: sr });
27109
- }, [ki, b]), i0 = useCallback(() => {
27111
+ }, [ki, b]), o0 = useCallback(() => {
27110
27112
  if (!(n === "pdf" || n === "pdf_slides")) {
27111
27113
  console.log(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);
27112
27114
  return;
27113
27115
  }
27114
27116
  const _a = Un.current - 1;
27115
27117
  _a >= 1 && Pl(_a);
27116
- }, [Pl, n]), o0 = useCallback(() => {
27118
+ }, [Pl, n]), a0 = useCallback(() => {
27117
27119
  if (!(n === "pdf" || n === "pdf_slides")) {
27118
27120
  console.log(`\u6587\u4EF6\u7C7B\u578B ${n} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);
27119
27121
  return;
@@ -27130,8 +27132,8 @@ const {
27130
27132
  sr - vl.timestamp > CACHE_EXPIRY_TIME && (delete kt.current[_a], console.log(`\u6E05\u7406\u8FC7\u671Fchunk\u7F13\u5B58: ${_a}`));
27131
27133
  }), St.current && sr - St.current.timestamp > CACHE_EXPIRY_TIME && (St.current = null, console.log("\u6E05\u7406\u8FC7\u671Fmarkdown\u5185\u5BB9\u7F13\u5B58")), It((_a) => {
27132
27134
  const vl = { ..._a };
27133
- return Object.keys(vl).forEach((wl) => {
27134
- sr - vl[wl].timestamp > CACHE_EXPIRY_TIME && (delete vl[wl], console.log(`\u6E05\u7406\u8FC7\u671F\u901A\u7528\u6587\u4EF6\u7F13\u5B58: ${wl}`));
27135
+ return Object.keys(vl).forEach((Al) => {
27136
+ sr - vl[Al].timestamp > CACHE_EXPIRY_TIME && (delete vl[Al], console.log(`\u6E05\u7406\u8FC7\u671F\u901A\u7528\u6587\u4EF6\u7F13\u5B58: ${Al}`));
27135
27137
  }), vl;
27136
27138
  });
27137
27139
  }, []), Ri = useCallback(() => {
@@ -27153,14 +27155,14 @@ const {
27153
27155
  console.log("=== useEffect \u88AB\u89E6\u53D1 ==="), console.log("\u89E6\u53D1\u65F6\u95F4:", (/* @__PURE__ */ new Date()).toISOString()), console.log("\u89E6\u53D1\u539F\u56E0:", { initialPage: s, fileType: n }), (async () => {
27154
27156
  try {
27155
27157
  const _a = n === "pdf" || n === "pdf_slides", vl = _a && s || 1;
27156
- console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", n, "\u6709\u6548\u9875\u7801:", vl, "\u662F\u5426PDF:", _a), n === "markdown" || n === "markdown_table" ? (await dl(), Dt(1), Zn(i || 1), b("pageChange", { pageNumber: 1, totalPages: i || 1 })) : n === "image" ? (await Al(), Dt(1), Zn(i || 1), As(0), b("pageChange", { pageNumber: 1, totalPages: i || 1 })) : _a ? (await Ti(vl, !0), Dt(vl), setTimeout(() => {
27158
+ console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", n, "\u6709\u6548\u9875\u7801:", vl, "\u662F\u5426PDF:", _a), n === "markdown" || n === "markdown_table" ? (await dl(), Dt(1), Zn(i || 1), b("pageChange", { pageNumber: 1, totalPages: i || 1 })) : n === "image" ? (await Dl(), Dt(1), Zn(i || 1), As(0), b("pageChange", { pageNumber: 1, totalPages: i || 1 })) : _a ? (await Ti(vl, !0), Dt(vl), setTimeout(() => {
27157
27159
  b("pageChange", { pageNumber: vl, totalPages: i || Lt });
27158
- }, 0)) : (console.log("=== \u521D\u59CB\u52A0\u8F7D\uFF1A\u4F7F\u7528\u901A\u7528\u52A0\u8F7D\u51FD\u6570\u5904\u7406\u6587\u4EF6\u7C7B\u578B ===", n), await xl(), Dt(1), Zn(i || 1), b("pageChange", { pageNumber: 1, totalPages: i || 1 }));
27160
+ }, 0)) : (console.log("=== \u521D\u59CB\u52A0\u8F7D\uFF1A\u4F7F\u7528\u901A\u7528\u52A0\u8F7D\u51FD\u6570\u5904\u7406\u6587\u4EF6\u7C7B\u578B ===", n), await Bl(), Dt(1), Zn(i || 1), b("pageChange", { pageNumber: 1, totalPages: i || 1 }));
27159
27161
  } catch (_a) {
27160
27162
  console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:", _a);
27161
27163
  }
27162
27164
  })();
27163
- }, [s, n, Ti, dl, Al, b]), N ? /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: nr, className: E }, Ye != null && Ye.ErrorComponent ? /* @__PURE__ */ React.createElement(
27165
+ }, [s, n, Ti, dl, Dl, b]), N ? /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: nr, className: E }, Ye != null && Ye.ErrorComponent ? /* @__PURE__ */ React.createElement(
27164
27166
  Ye.ErrorComponent,
27165
27167
  {
27166
27168
  error: N,
@@ -27219,8 +27221,8 @@ const {
27219
27221
  rotate: n === "image"
27220
27222
  },
27221
27223
  styles: de,
27222
- onPrevPage: i0,
27223
- onNextPage: o0,
27224
+ onPrevPage: o0,
27225
+ onNextPage: a0,
27224
27226
  onZoomIn: fg,
27225
27227
  onZoomOut: cg,
27226
27228
  onRotateLeft: n === "image" ? lg : void 0,