@shznet/pdf-sign-react 0.2.3 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as an } from "react/jsx-runtime";
2
2
  import { forwardRef as on, useRef as rs, useImperativeHandle as hn, useEffect as Vt } from "react";
3
3
  var vi = (c) => {
4
4
  throw TypeError(c);
5
- }, Ds = (c, t, e) => t.has(c) || vi("Cannot " + e), Y = (c, t, e) => (Ds(c, t, "read from private field"), e ? e.call(c) : t.get(c)), Ft = (c, t, e) => t.has(c) ? vi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, e), mt = (c, t, e, s) => (Ds(c, t, "write to private field"), t.set(c, e), e), It = (c, t, e) => (Ds(c, t, "access private method"), e), ln = (c, t, e, s) => ({
5
+ }, Ds = (c, t, e) => t.has(c) || vi("Cannot " + e), Y = (c, t, e) => (Ds(c, t, "read from private field"), e ? e.call(c) : t.get(c)), Ft = (c, t, e) => t.has(c) ? vi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, e), mt = (c, t, e, s) => (Ds(c, t, "write to private field"), t.set(c, e), e), Rt = (c, t, e) => (Ds(c, t, "access private method"), e), ln = (c, t, e, s) => ({
6
6
  set _(i) {
7
7
  mt(c, t, i);
8
8
  },
@@ -116,12 +116,12 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
116
116
  ANNOTATIONS_DISABLE: 64,
117
117
  IS_EDITING: 128,
118
118
  OPLIST: 256
119
- }, Bt = {
119
+ }, Ot = {
120
120
  DISABLE: 0,
121
121
  ENABLE: 1,
122
122
  ENABLE_FORMS: 2,
123
123
  ENABLE_STORAGE: 3
124
- }, Se = "pdfjs_internal_editor_", F = {
124
+ }, Ee = "pdfjs_internal_editor_", F = {
125
125
  DISABLE: -1,
126
126
  NONE: 0,
127
127
  FREETEXT: 3,
@@ -131,7 +131,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
131
131
  POPUP: 16,
132
132
  SIGNATURE: 101,
133
133
  COMMENT: 102
134
- }, O = {
134
+ }, B = {
135
135
  RESIZE: 1,
136
136
  CREATE: 2,
137
137
  FREETEXT_SIZE: 11,
@@ -205,7 +205,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
205
205
  ERRORS: 0,
206
206
  WARNINGS: 1,
207
207
  INFOS: 5
208
- }, Ee = {
208
+ }, Se = {
209
209
  dependency: 1,
210
210
  setLineWidth: 2,
211
211
  setLineCap: 3,
@@ -317,13 +317,13 @@ function fn() {
317
317
  function Je(c) {
318
318
  Qe >= Ke.INFOS && console.info(`Info: ${c}`);
319
319
  }
320
- function I(c) {
320
+ function R(c) {
321
321
  Qe >= Ke.WARNINGS && console.warn(`Warning: ${c}`);
322
322
  }
323
323
  function j(c) {
324
324
  throw new Error(c);
325
325
  }
326
- function B(c, t) {
326
+ function O(c, t) {
327
327
  c || j(t);
328
328
  }
329
329
  function mn(c) {
@@ -409,7 +409,7 @@ function _i(c) {
409
409
  }
410
410
  return s.join("");
411
411
  }
412
- function Me(c) {
412
+ function Pe(c) {
413
413
  typeof c != "string" && j("Invalid argument for stringToBytes");
414
414
  const t = c.length, e = new Uint8Array(t);
415
415
  for (let s = 0; s < t; ++s)
@@ -503,8 +503,8 @@ class T {
503
503
  const i = e[0], n = e[1], r = e[2], a = e[3], o = e[4], h = e[5], l = t[0], d = t[1], u = t[2], p = t[3];
504
504
  let f = i * l + o, g = f, b = i * u + o, m = b, w = a * d + h, y = w, v = a * p + h, A = v;
505
505
  if (n !== 0 || r !== 0) {
506
- const x = n * l, _ = n * u, S = r * d, E = r * p;
507
- f += S, m += S, b += E, g += E, w += x, A += x, v += _, y += _;
506
+ const x = n * l, _ = n * u, E = r * d, S = r * p;
507
+ f += E, m += E, b += S, g += S, w += x, A += x, v += _, y += _;
508
508
  }
509
509
  s[0] = Math.min(s[0], f, b, g, m), s[1] = Math.min(s[1], w, v, y, A), s[2] = Math.max(s[2], f, b, g, m), s[3] = Math.max(s[3], w, v, y, A);
510
510
  }
@@ -561,7 +561,7 @@ let ls = null, Ys = null;
561
561
  function xn(c) {
562
562
  return ls || (ls = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, Ys = /* @__PURE__ */ new Map([["ſt", "ſt"]])), c.replaceAll(ls, (t, e, s) => e ? e.normalize("NFKC") : Ys.get(s));
563
563
  }
564
- function Si() {
564
+ function Ei() {
565
565
  if (typeof crypto.randomUUID == "function")
566
566
  return crypto.randomUUID();
567
567
  const c = new Uint8Array(32);
@@ -607,11 +607,11 @@ function _n(c, t, e) {
607
607
  function ut(c, t, e) {
608
608
  return Math.min(Math.max(c, t), e);
609
609
  }
610
- function Ei(c) {
610
+ function Si(c) {
611
611
  return Uint8Array.prototype.toBase64 ? c.toBase64() : btoa(_i(c));
612
612
  }
613
- function Sn(c) {
614
- return Uint8Array.fromBase64 ? Uint8Array.fromBase64(c) : Me(atob(c));
613
+ function En(c) {
614
+ return Uint8Array.fromBase64 ? Uint8Array.fromBase64(c) : Pe(atob(c));
615
615
  }
616
616
  typeof Promise.try != "function" && (Promise.try = function(c, ...t) {
617
617
  return new Promise((e) => {
@@ -798,13 +798,13 @@ class Ci {
798
798
  t.div.style.transform = e, t.div.hidden = !1;
799
799
  }
800
800
  }
801
- const Rt = "http://www.w3.org/2000/svg";
801
+ const It = "http://www.w3.org/2000/svg";
802
802
  class ce {
803
803
  static CSS = 96;
804
804
  static PDF = 72;
805
805
  static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
806
806
  }
807
- async function Pe(c, t = "text") {
807
+ async function Me(c, t = "text") {
808
808
  if (we(c, document.baseURI)) {
809
809
  const e = await fetch(c);
810
810
  if (!e.ok)
@@ -913,7 +913,7 @@ class ke {
913
913
  return T.applyInverseTransform(s, this.transform), s;
914
914
  }
915
915
  }
916
- class Rs extends Yt {
916
+ class Is extends Yt {
917
917
  constructor(t, e = 0) {
918
918
  super(t, "RenderingCancelledException"), this.extraDelay = e;
919
919
  }
@@ -925,17 +925,17 @@ function Ze(c) {
925
925
  e++;
926
926
  return c.substring(e, e + 5).toLowerCase() === "data:";
927
927
  }
928
- function Is(c) {
928
+ function Rs(c) {
929
929
  return typeof c == "string" && /\.pdf$/i.test(c);
930
930
  }
931
- function En(c) {
931
+ function Sn(c) {
932
932
  return [c] = c.split(/[#?]/, 1), c.substring(c.lastIndexOf("/") + 1);
933
933
  }
934
934
  function Cn(c, t = "document.pdf") {
935
935
  if (typeof c != "string")
936
936
  return t;
937
937
  if (Ze(c))
938
- return I('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), t;
938
+ return R('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), t;
939
939
  const e = ((r) => {
940
940
  try {
941
941
  return new URL(r);
@@ -988,10 +988,10 @@ class Ks {
988
988
  started = /* @__PURE__ */ Object.create(null);
989
989
  times = [];
990
990
  time(t) {
991
- t in this.started && I(`Timer is already running for ${t}`), this.started[t] = Date.now();
991
+ t in this.started && R(`Timer is already running for ${t}`), this.started[t] = Date.now();
992
992
  }
993
993
  timeEnd(t) {
994
- t in this.started || I(`Timer has not been started for ${t}`), this.times.push({
994
+ t in this.started || R(`Timer has not been started for ${t}`), this.times.push({
995
995
  name: t,
996
996
  start: this.started[t],
997
997
  end: Date.now()
@@ -1056,7 +1056,7 @@ class ws {
1056
1056
  return d = d >= 0 && d <= 59 ? d : 0, h === "-" ? (r += l, a += d) : h === "+" && (r -= l, a -= d), new Date(Date.UTC(s, i, n, r, a, o));
1057
1057
  }
1058
1058
  }
1059
- function Mn(c, {
1059
+ function Pn(c, {
1060
1060
  scale: t = 1,
1061
1061
  rotation: e = 0
1062
1062
  }) {
@@ -1076,9 +1076,9 @@ function De(c) {
1076
1076
  const t = parseInt(c.slice(1), 16);
1077
1077
  return [(t & 16711680) >> 16, (t & 65280) >> 8, t & 255];
1078
1078
  }
1079
- return c.startsWith("rgb(") ? c.slice(4, -1).split(",").map((t) => parseInt(t)) : c.startsWith("rgba(") ? c.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (I(`Not a valid color format: "${c}"`), [0, 0, 0]);
1079
+ return c.startsWith("rgb(") ? c.slice(4, -1).split(",").map((t) => parseInt(t)) : c.startsWith("rgba(") ? c.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (R(`Not a valid color format: "${c}"`), [0, 0, 0]);
1080
1080
  }
1081
- function Pn(c) {
1081
+ function Mn(c) {
1082
1082
  const t = document.createElement("span");
1083
1083
  t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
1084
1084
  for (const e of c.keys()) {
@@ -1099,7 +1099,7 @@ function X(c) {
1099
1099
  } = c.getTransform();
1100
1100
  return [t, e, s, i, n, r];
1101
1101
  }
1102
- function Et(c) {
1102
+ function St(c) {
1103
1103
  const {
1104
1104
  a: t,
1105
1105
  b: e,
@@ -1172,7 +1172,7 @@ class Dn {
1172
1172
  return t.remove(), L(this, "commentForegroundColor", De(s));
1173
1173
  }
1174
1174
  }
1175
- function Rn(c, t, e, s) {
1175
+ function In(c, t, e, s) {
1176
1176
  s = Math.min(Math.max(s ?? 1, 0), 1);
1177
1177
  const i = 255 * (1 - s);
1178
1178
  return c = Math.round(c * s + i), t = Math.round(t * s + i), e = Math.round(e * s + i), [c, t, e];
@@ -1232,7 +1232,7 @@ function Zs(c, t, e) {
1232
1232
  return s > i ? (s + 0.05) / (i + 0.05) : (i + 0.05) / (s + 0.05);
1233
1233
  }
1234
1234
  const ti = /* @__PURE__ */ new Map();
1235
- function In(c, t) {
1235
+ function Rn(c, t) {
1236
1236
  const e = c[0] + c[1] * 256 + c[2] * 65536 + t[0] * 16777216 + t[1] * 4294967296 + t[2] * 1099511627776;
1237
1237
  let s = ti.get(e);
1238
1238
  if (s)
@@ -1277,7 +1277,7 @@ function Ti({
1277
1277
  });
1278
1278
  i.firstElementChild.classList.add("richText", e), s.append(i);
1279
1279
  }
1280
- function Mi(c) {
1280
+ function Pi(c) {
1281
1281
  const t = new Path2D();
1282
1282
  if (!c)
1283
1283
  return t;
@@ -1299,7 +1299,7 @@ function Mi(c) {
1299
1299
  t.closePath();
1300
1300
  break;
1301
1301
  default:
1302
- I(`Unrecognized drawing path operator: ${c[e - 1]}`);
1302
+ R(`Unrecognized drawing path operator: ${c[e - 1]}`);
1303
1303
  break;
1304
1304
  }
1305
1305
  return t;
@@ -1506,7 +1506,7 @@ class Ln {
1506
1506
  })), this.#t.append(n);
1507
1507
  }
1508
1508
  }
1509
- function Pi(c, t, e) {
1509
+ function Mi(c, t, e) {
1510
1510
  for (const s of e)
1511
1511
  t.addEventListener(s, c[s].bind(c));
1512
1512
  }
@@ -1555,11 +1555,11 @@ class z {
1555
1555
  class Fn {
1556
1556
  #t = 0;
1557
1557
  get id() {
1558
- return `${Se}${this.#t++}`;
1558
+ return `${Ee}${this.#t++}`;
1559
1559
  }
1560
1560
  }
1561
1561
  class Ls {
1562
- #t = Si();
1562
+ #t = Ei();
1563
1563
  #e = 0;
1564
1564
  #i = null;
1565
1565
  static get _isSVGFittingCanvas() {
@@ -1585,7 +1585,7 @@ class Ls {
1585
1585
  isSvg: !1
1586
1586
  };
1587
1587
  let i;
1588
- if (typeof e == "string" ? (s.url = e, i = await Pe(e, "blob")) : e instanceof File ? i = s.file = e : e instanceof Blob && (i = e), i.type === "image/svg+xml") {
1588
+ if (typeof e == "string" ? (s.url = e, i = await Me(e, "blob")) : e instanceof File ? i = s.file = e : e instanceof Blob && (i = e), i.type === "image/svg+xml") {
1589
1589
  const n = Ls._isSVGFittingCanvas, r = new FileReader(), a = new Image(), o = new Promise((h, l) => {
1590
1590
  a.onload = () => {
1591
1591
  s.bitmap = a, s.isSvg = !0, h();
@@ -1599,7 +1599,7 @@ class Ls {
1599
1599
  s.bitmap = await createImageBitmap(i);
1600
1600
  s.refCounter = 1;
1601
1601
  } catch (i) {
1602
- I(i), s = null;
1602
+ R(i), s = null;
1603
1603
  }
1604
1604
  return this.#i.set(t, s), s && this.#i.set(s.id, s), s;
1605
1605
  }
@@ -1747,7 +1747,7 @@ class Nn {
1747
1747
  this.#t = null;
1748
1748
  }
1749
1749
  }
1750
- class Re {
1750
+ class Ie {
1751
1751
  constructor(t) {
1752
1752
  this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
1753
1753
  const {
@@ -1791,7 +1791,7 @@ class Fs {
1791
1791
  static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
1792
1792
  get _colors() {
1793
1793
  const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
1794
- return Pn(t), L(this, "_colors", t);
1794
+ return Mn(t), L(this, "_colors", t);
1795
1795
  }
1796
1796
  convert(t) {
1797
1797
  const e = De(t);
@@ -1829,24 +1829,24 @@ class zt {
1829
1829
  #b = !1;
1830
1830
  #w = !1;
1831
1831
  #y = !1;
1832
- #E = null;
1832
+ #S = null;
1833
1833
  #_ = null;
1834
1834
  #A = null;
1835
1835
  #T = null;
1836
1836
  #v = !1;
1837
- #S = null;
1837
+ #E = null;
1838
1838
  #k = new Fn();
1839
- #M = !1;
1840
1839
  #P = !1;
1841
- #O = !1;
1842
- #R = null;
1840
+ #M = !1;
1841
+ #B = !1;
1842
+ #I = null;
1843
1843
  #L = null;
1844
- #B = null;
1844
+ #O = null;
1845
1845
  #F = null;
1846
1846
  #G = null;
1847
1847
  #C = F.NONE;
1848
1848
  #x = /* @__PURE__ */ new Set();
1849
- #I = null;
1849
+ #R = null;
1850
1850
  #H = null;
1851
1851
  #z = null;
1852
1852
  #q = null;
@@ -1879,7 +1879,7 @@ class zt {
1879
1879
  }
1880
1880
  return !0;
1881
1881
  }, i = this.TRANSLATE_SMALL, n = this.TRANSLATE_BIG;
1882
- return L(this, "_keyboardManager", new Re([[["ctrl+a", "mac+meta+a"], t.selectAll, {
1882
+ return L(this, "_keyboardManager", new Ie([[["ctrl+a", "mac+meta+a"], t.selectAll, {
1883
1883
  checker: s
1884
1884
  }], [["ctrl+z", "mac+meta+z"], t.undo, {
1885
1885
  checker: s
@@ -1936,16 +1936,16 @@ class zt {
1936
1936
  }), a._on("switchannotationeditorparams", (w) => this.updateParams(w.type, w.value), {
1937
1937
  signal: m
1938
1938
  }), window.addEventListener("pointerdown", () => {
1939
- this.#P = !0;
1939
+ this.#M = !0;
1940
1940
  }, {
1941
1941
  capture: !0,
1942
1942
  signal: m
1943
1943
  }), window.addEventListener("pointerup", () => {
1944
- this.#P = !1;
1944
+ this.#M = !1;
1945
1945
  }, {
1946
1946
  capture: !0,
1947
1947
  signal: m
1948
- }), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#E = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
1948
+ }), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#S = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
1949
1949
  realScale: ce.PDF_TO_CSS_UNITS,
1950
1950
  rotation: 0
1951
1951
  }, this.isShiftKeyDown = !1, this._editorUndoBar = g || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
@@ -1954,7 +1954,7 @@ class zt {
1954
1954
  this.#$?.resolve(), this.#$ = null, this.#t?.abort(), this.#t = null, this._signal = null;
1955
1955
  for (const t of this.#a.values())
1956
1956
  t.destroy();
1957
- this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#S?.hide(), this.#S = null, this.#B?.destroy(), this.#B = null, this.#i = null, this.#_ && (clearTimeout(this.#_), this.#_ = null), this.#N && (clearTimeout(this.#N), this.#N = null), this._editorUndoBar?.destroy(), this.#W = null;
1957
+ this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#E?.hide(), this.#E = null, this.#O?.destroy(), this.#O = null, this.#i = null, this.#_ && (clearTimeout(this.#_), this.#_ = null), this.#N && (clearTimeout(this.#N), this.#N = null), this._editorUndoBar?.destroy(), this.#W = null;
1958
1958
  }
1959
1959
  combinedSignal(t) {
1960
1960
  return AbortSignal.any([this._signal, t.signal]);
@@ -1969,7 +1969,7 @@ class zt {
1969
1969
  return this.#y;
1970
1970
  }
1971
1971
  get hcmFilter() {
1972
- return L(this, "hcmFilter", this.#z ? this.#E.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
1972
+ return L(this, "hcmFilter", this.#z ? this.#S.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
1973
1973
  }
1974
1974
  get direction() {
1975
1975
  return L(this, "direction", getComputedStyle(this.#j).direction);
@@ -2010,7 +2010,7 @@ class zt {
2010
2010
  t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), this.#d = t;
2011
2011
  }
2012
2012
  setMainHighlightColorPicker(t) {
2013
- this.#B = t;
2013
+ this.#O = t;
2014
2014
  }
2015
2015
  editAltText(t, e = !1) {
2016
2016
  this.#r?.editAltText(this, t, e);
@@ -2185,12 +2185,12 @@ class zt {
2185
2185
  if (!t || t.isCollapsed)
2186
2186
  return;
2187
2187
  const e = this.#Q(t).closest(".textLayer"), s = this.getSelectionBoxes(e);
2188
- s && (this.#S ||= new Ln(this), this.#S.show(e, s, this.direction === "ltr"));
2188
+ s && (this.#E ||= new Ln(this), this.#E.show(e, s, this.direction === "ltr"));
2189
2189
  }
2190
2190
  getAndRemoveDataFromAnnotationStorage(t) {
2191
2191
  if (!this.#n)
2192
2192
  return null;
2193
- const e = `${Se}${t}`, s = this.#n.getRawValue(e);
2193
+ const e = `${Ee}${t}`, s = this.#n.getRawValue(e);
2194
2194
  return s && this.#n.remove(e), s;
2195
2195
  }
2196
2196
  addToAnnotationStorage(t) {
@@ -2203,7 +2203,7 @@ class zt {
2203
2203
  #rt() {
2204
2204
  const t = document.getSelection();
2205
2205
  if (!t || t.isCollapsed) {
2206
- this.#I && (this.#S?.hide(), this.#I = null, this.#D({
2206
+ this.#R && (this.#E?.hide(), this.#R = null, this.#D({
2207
2207
  hasSelectedText: !1
2208
2208
  }));
2209
2209
  return;
@@ -2211,20 +2211,20 @@ class zt {
2211
2211
  const {
2212
2212
  anchorNode: e
2213
2213
  } = t;
2214
- if (e === this.#I)
2214
+ if (e === this.#R)
2215
2215
  return;
2216
2216
  const s = this.#Q(t).closest(".textLayer");
2217
2217
  if (!s) {
2218
- this.#I && (this.#S?.hide(), this.#I = null, this.#D({
2218
+ this.#R && (this.#E?.hide(), this.#R = null, this.#D({
2219
2219
  hasSelectedText: !1
2220
2220
  }));
2221
2221
  return;
2222
2222
  }
2223
- if (this.#S?.hide(), this.#I = e, this.#D({
2223
+ if (this.#E?.hide(), this.#R = e, this.#D({
2224
2224
  hasSelectedText: !0
2225
2225
  }), !(this.#C !== F.HIGHLIGHT && this.#C !== F.NONE) && (this.#C === F.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
2226
2226
  const i = this.#C === F.HIGHLIGHT ? this.#tt(s) : null;
2227
- if (i?.toggleDrawing(), this.#P) {
2227
+ if (i?.toggleDrawing(), this.#M) {
2228
2228
  const n = new AbortController(), r = this.combinedSignal(n), a = (o) => {
2229
2229
  o.type === "pointerup" && o.button !== 0 || (n.abort(), i?.toggleDrawing(!0), o.type === "pointerup" && this.#Y("main_toolbar"));
2230
2230
  };
@@ -2283,10 +2283,10 @@ class zt {
2283
2283
  }), e.focus();
2284
2284
  }
2285
2285
  #et() {
2286
- if (this.#R)
2286
+ if (this.#I)
2287
2287
  return;
2288
- this.#R = new AbortController();
2289
- const t = this.combinedSignal(this.#R);
2288
+ this.#I = new AbortController();
2289
+ const t = this.combinedSignal(this.#I);
2290
2290
  window.addEventListener("keydown", this.keydown.bind(this), {
2291
2291
  signal: t
2292
2292
  }), window.addEventListener("keyup", this.keyup.bind(this), {
@@ -2294,7 +2294,7 @@ class zt {
2294
2294
  });
2295
2295
  }
2296
2296
  #lt() {
2297
- this.#R?.abort(), this.#R = null;
2297
+ this.#I?.abort(), this.#I = null;
2298
2298
  }
2299
2299
  #ct() {
2300
2300
  if (this.#u)
@@ -2374,7 +2374,7 @@ class zt {
2374
2374
  try {
2375
2375
  s = JSON.parse(s);
2376
2376
  } catch (n) {
2377
- I(`paste: "${n.message}".`);
2377
+ R(`paste: "${n.message}".`);
2378
2378
  return;
2379
2379
  }
2380
2380
  if (!Array.isArray(s))
@@ -2403,7 +2403,7 @@ class zt {
2403
2403
  mustExec: !0
2404
2404
  });
2405
2405
  } catch (n) {
2406
- I(`paste: "${n.message}".`);
2406
+ R(`paste: "${n.message}".`);
2407
2407
  }
2408
2408
  }
2409
2409
  keydown(t) {
@@ -2434,7 +2434,7 @@ class zt {
2434
2434
  Object.entries(t).some(([e, s]) => this.#X[e] !== s) && (this._eventBus.dispatch("annotationeditorstateschanged", {
2435
2435
  source: this,
2436
2436
  details: Object.assign(this.#X, t)
2437
- }), this.#C === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[O.HIGHLIGHT_FREE, !0]]));
2437
+ }), this.#C === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[B.HIGHLIGHT_FREE, !0]]));
2438
2438
  }
2439
2439
  #V(t) {
2440
2440
  this._eventBus.dispatch("annotationeditorparamschanged", {
@@ -2473,7 +2473,7 @@ class zt {
2473
2473
  return this.#p;
2474
2474
  }
2475
2475
  addLayer(t) {
2476
- this.#a.set(t.pageIndex, t), this.#M ? t.enable() : t.disable();
2476
+ this.#a.set(t.pageIndex, t), this.#P ? t.enable() : t.disable();
2477
2477
  }
2478
2478
  removeLayer(t) {
2479
2479
  this.#a.delete(t.pageIndex);
@@ -2534,10 +2534,10 @@ class zt {
2534
2534
  updateParams(t, e) {
2535
2535
  if (this.#c) {
2536
2536
  switch (t) {
2537
- case O.CREATE:
2537
+ case B.CREATE:
2538
2538
  this.currentLayer.addNewEditor(e);
2539
2539
  return;
2540
- case O.HIGHLIGHT_SHOW_ALL:
2540
+ case B.HIGHLIGHT_SHOW_ALL:
2541
2541
  this._eventBus.dispatch("reporttelemetry", {
2542
2542
  source: this,
2543
2543
  details: {
@@ -2561,18 +2561,18 @@ class zt {
2561
2561
  showAllEditors(t, e, s = !1) {
2562
2562
  for (const i of this.#s.values())
2563
2563
  i.editorType === t && i.show(e);
2564
- (this.#q?.get(O.HIGHLIGHT_SHOW_ALL) ?? !0) !== e && this.#V([[O.HIGHLIGHT_SHOW_ALL, e]]);
2564
+ (this.#q?.get(B.HIGHLIGHT_SHOW_ALL) ?? !0) !== e && this.#V([[B.HIGHLIGHT_SHOW_ALL, e]]);
2565
2565
  }
2566
2566
  enableWaiting(t = !1) {
2567
- if (this.#O !== t) {
2568
- this.#O = t;
2567
+ if (this.#B !== t) {
2568
+ this.#B = t;
2569
2569
  for (const e of this.#a.values())
2570
2570
  t ? e.disableClick() : e.enableClick(), e.div.classList.toggle("waiting", t);
2571
2571
  }
2572
2572
  }
2573
2573
  async #pt() {
2574
- if (!this.#M) {
2575
- this.#M = !0;
2574
+ if (!this.#P) {
2575
+ this.#P = !0;
2576
2576
  const t = [];
2577
2577
  for (const e of this.#a.values())
2578
2578
  t.push(e.enable());
@@ -2582,8 +2582,8 @@ class zt {
2582
2582
  }
2583
2583
  }
2584
2584
  #gt() {
2585
- if (this.unselectAll(), this.#M) {
2586
- this.#M = !1;
2585
+ if (this.unselectAll(), this.#P) {
2586
+ this.#P = !1;
2587
2587
  for (const t of this.#a.values())
2588
2588
  t.disable();
2589
2589
  for (const t of this.#s.values())
@@ -2947,7 +2947,7 @@ class zt {
2947
2947
  (this.#F ||= /* @__PURE__ */ new Map()).set(t, e);
2948
2948
  }
2949
2949
  }
2950
- class Mt {
2950
+ class Pt {
2951
2951
  #t = null;
2952
2952
  #e = !1;
2953
2953
  #i = null;
@@ -2963,7 +2963,7 @@ class Mt {
2963
2963
  static #p = null;
2964
2964
  static _l10n = null;
2965
2965
  constructor(t) {
2966
- this.#l = t, this.#d = t._uiManager.useNewAltTextFlow, Mt.#p ||= Object.freeze({
2966
+ this.#l = t, this.#d = t._uiManager.useNewAltTextFlow, Pt.#p ||= Object.freeze({
2967
2967
  added: "pdfjs-editor-new-alt-text-added-button",
2968
2968
  "added-label": "pdfjs-editor-new-alt-text-added-button-label",
2969
2969
  missing: "pdfjs-editor-new-alt-text-missing-button",
@@ -2973,13 +2973,13 @@ class Mt {
2973
2973
  });
2974
2974
  }
2975
2975
  static initialize(t) {
2976
- Mt._l10n ??= t;
2976
+ Pt._l10n ??= t;
2977
2977
  }
2978
2978
  async render() {
2979
2979
  const t = this.#i = document.createElement("button");
2980
2980
  t.className = "altText", t.tabIndex = "0";
2981
2981
  const e = this.#s = document.createElement("span");
2982
- t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Mt.#p.missing), e.setAttribute("data-l10n-id", Mt.#p["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
2982
+ t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Pt.#p.missing), e.setAttribute("data-l10n-id", Pt.#p["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
2983
2983
  const s = this.#l._uiManager._signal;
2984
2984
  t.addEventListener("contextmenu", _t, {
2985
2985
  signal: s
@@ -3021,7 +3021,7 @@ class Mt {
3021
3021
  return this.#h;
3022
3022
  }
3023
3023
  async setGuessedText(t) {
3024
- this.#t === null && (this.#h = t, this.#u = await Mt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
3024
+ this.#t === null && (this.#h = t, this.#u = await Pt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
3025
3025
  generatedAltText: t
3026
3026
  }), this.#f());
3027
3027
  }
@@ -3079,7 +3079,7 @@ class Mt {
3079
3079
  if (!t)
3080
3080
  return;
3081
3081
  if (this.#d) {
3082
- if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id", Mt.#p[this.#m]), this.#s?.setAttribute("data-l10n-id", Mt.#p[`${this.#m}-label`]), !this.#t) {
3082
+ if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id", Pt.#p[this.#m]), this.#s?.setAttribute("data-l10n-id", Pt.#p[`${this.#m}-label`]), !this.#t) {
3083
3083
  this.#a?.remove();
3084
3084
  return;
3085
3085
  }
@@ -3431,7 +3431,7 @@ class D {
3431
3431
  #b = !1;
3432
3432
  #w = !1;
3433
3433
  #y = null;
3434
- #E = 0;
3434
+ #S = 0;
3435
3435
  #_ = 0;
3436
3436
  #A = null;
3437
3437
  #T = null;
@@ -3446,14 +3446,14 @@ class D {
3446
3446
  static _l10n = null;
3447
3447
  static _l10nResizer = null;
3448
3448
  #v = !1;
3449
- #S = D._zIndex++;
3449
+ #E = D._zIndex++;
3450
3450
  static _borderLineWidth = -1;
3451
3451
  static _colorManager = new Fs();
3452
3452
  static _zIndex = 1;
3453
3453
  static _telemetryTimeout = 1e3;
3454
3454
  static get _resizerKeyboardManager() {
3455
3455
  const t = D.prototype._resizeWithKeyboard, e = zt.TRANSLATE_SMALL, s = zt.TRANSLATE_BIG;
3456
- return L(this, "_resizerKeyboardManager", new Re([[["ArrowLeft", "mac+ArrowLeft"], t, {
3456
+ return L(this, "_resizerKeyboardManager", new Ie([[["ArrowLeft", "mac+ArrowLeft"], t, {
3457
3457
  args: [-e, 0]
3458
3458
  }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t, {
3459
3459
  args: [-s, 0]
@@ -3499,7 +3499,7 @@ class D {
3499
3499
  return L(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
3500
3500
  }
3501
3501
  static deleteAnnotationElement(t) {
3502
- const e = new On({
3502
+ const e = new Bn({
3503
3503
  id: t.parent.getNextId(),
3504
3504
  parent: t.parent,
3505
3505
  uiManager: t._uiManager
@@ -3575,7 +3575,7 @@ class D {
3575
3575
  this.div.style.zIndex = 0;
3576
3576
  }
3577
3577
  setInForeground() {
3578
- this.div.style.zIndex = this.#S;
3578
+ this.div.style.zIndex = this.#E;
3579
3579
  }
3580
3580
  setParent(t) {
3581
3581
  t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#N(), this.#d?.remove(), this.#d = null), this.parent = t;
@@ -3703,7 +3703,7 @@ class D {
3703
3703
  const [h, l] = this.getBaseTranslation();
3704
3704
  n += h, r += l, e.left = `${(100 * n).toFixed(2)}%`, e.top = `${(100 * r).toFixed(2)}%`, this.moveInDOM();
3705
3705
  }
3706
- static #M(t, e, s) {
3706
+ static #P(t, e, s) {
3707
3707
  switch (s) {
3708
3708
  case 90:
3709
3709
  return [e, -t];
@@ -3716,12 +3716,12 @@ class D {
3716
3716
  }
3717
3717
  }
3718
3718
  screenToPageTranslation(t, e) {
3719
- return D.#M(t, e, this.parentRotation);
3719
+ return D.#P(t, e, this.parentRotation);
3720
3720
  }
3721
3721
  pageTranslationToScreen(t, e) {
3722
- return D.#M(t, e, 360 - this.parentRotation);
3722
+ return D.#P(t, e, 360 - this.parentRotation);
3723
3723
  }
3724
- #P(t) {
3724
+ #M(t) {
3725
3725
  switch (t) {
3726
3726
  case 90: {
3727
3727
  const [e, s] = this.pageDimensions;
@@ -3763,14 +3763,14 @@ class D {
3763
3763
  getInitialTranslation() {
3764
3764
  return [0, 0];
3765
3765
  }
3766
- #O() {
3766
+ #B() {
3767
3767
  if (this.#l)
3768
3768
  return;
3769
3769
  this.#l = document.createElement("div"), this.#l.classList.add("resizers");
3770
3770
  const t = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"], e = this._uiManager._signal;
3771
3771
  for (const s of t) {
3772
3772
  const i = document.createElement("div");
3773
- this.#l.append(i), i.classList.add("resizer", s), i.setAttribute("data-resizer-name", s), i.addEventListener("pointerdown", this.#R.bind(this, s), {
3773
+ this.#l.append(i), i.classList.add("resizer", s), i.setAttribute("data-resizer-name", s), i.addEventListener("pointerdown", this.#I.bind(this, s), {
3774
3774
  signal: e
3775
3775
  }), i.addEventListener("contextmenu", _t, {
3776
3776
  signal: e
@@ -3778,7 +3778,7 @@ class D {
3778
3778
  }
3779
3779
  this.div.prepend(this.#l);
3780
3780
  }
3781
- #R(t, e) {
3781
+ #I(t, e) {
3782
3782
  e.preventDefault();
3783
3783
  const {
3784
3784
  isMac: s
@@ -3807,7 +3807,7 @@ class D {
3807
3807
  const a = this.parent.div.style.cursor, o = this.div.style.cursor;
3808
3808
  this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(e.target).cursor;
3809
3809
  const h = () => {
3810
- n.abort(), this.parent.togglePointerEvents(!0), this.#i?.toggle(!0), this._isDraggable = i, this.parent.div.style.cursor = a, this.div.style.cursor = o, this.#B();
3810
+ n.abort(), this.parent.togglePointerEvents(!0), this.#i?.toggle(!0), this._isDraggable = i, this.parent.div.style.cursor = a, this.div.style.cursor = o, this.#O();
3811
3811
  };
3812
3812
  window.addEventListener("pointerup", h, {
3813
3813
  signal: r
@@ -3820,7 +3820,7 @@ class D {
3820
3820
  }
3821
3821
  _onResized() {
3822
3822
  }
3823
- #B() {
3823
+ #O() {
3824
3824
  if (!this.#u)
3825
3825
  return;
3826
3826
  const {
@@ -3841,55 +3841,55 @@ class D {
3841
3841
  return Math.round(t * 1e4) / 1e4;
3842
3842
  }
3843
3843
  #F(t, e) {
3844
- const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, d = this.#P(this.rotation), u = (k, R) => [d[0] * k + d[2] * R, d[1] * k + d[3] * R], p = this.#P(360 - this.rotation), f = (k, R) => [p[0] * k + p[2] * R, p[1] * k + p[3] * R];
3844
+ const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, d = this.#M(this.rotation), u = (k, I) => [d[0] * k + d[2] * I, d[1] * k + d[3] * I], p = this.#M(360 - this.rotation), f = (k, I) => [p[0] * k + p[2] * I, p[1] * k + p[3] * I];
3845
3845
  let g, b, m = !1, w = !1;
3846
3846
  switch (t) {
3847
3847
  case "topLeft":
3848
- m = !0, g = (k, R) => [0, 0], b = (k, R) => [k, R];
3848
+ m = !0, g = (k, I) => [0, 0], b = (k, I) => [k, I];
3849
3849
  break;
3850
3850
  case "topMiddle":
3851
- g = (k, R) => [k / 2, 0], b = (k, R) => [k / 2, R];
3851
+ g = (k, I) => [k / 2, 0], b = (k, I) => [k / 2, I];
3852
3852
  break;
3853
3853
  case "topRight":
3854
- m = !0, g = (k, R) => [k, 0], b = (k, R) => [0, R];
3854
+ m = !0, g = (k, I) => [k, 0], b = (k, I) => [0, I];
3855
3855
  break;
3856
3856
  case "middleRight":
3857
- w = !0, g = (k, R) => [k, R / 2], b = (k, R) => [0, R / 2];
3857
+ w = !0, g = (k, I) => [k, I / 2], b = (k, I) => [0, I / 2];
3858
3858
  break;
3859
3859
  case "bottomRight":
3860
- m = !0, g = (k, R) => [k, R], b = (k, R) => [0, 0];
3860
+ m = !0, g = (k, I) => [k, I], b = (k, I) => [0, 0];
3861
3861
  break;
3862
3862
  case "bottomMiddle":
3863
- g = (k, R) => [k / 2, R], b = (k, R) => [k / 2, 0];
3863
+ g = (k, I) => [k / 2, I], b = (k, I) => [k / 2, 0];
3864
3864
  break;
3865
3865
  case "bottomLeft":
3866
- m = !0, g = (k, R) => [0, R], b = (k, R) => [k, 0];
3866
+ m = !0, g = (k, I) => [0, I], b = (k, I) => [k, 0];
3867
3867
  break;
3868
3868
  case "middleLeft":
3869
- w = !0, g = (k, R) => [0, R / 2], b = (k, R) => [k, R / 2];
3869
+ w = !0, g = (k, I) => [0, I / 2], b = (k, I) => [k, I / 2];
3870
3870
  break;
3871
3871
  }
3872
3872
  const y = g(a, o), v = b(a, o);
3873
3873
  let A = u(...v);
3874
3874
  const x = D._round(n + A[0]), _ = D._round(r + A[1]);
3875
- let S = 1, E = 1, P, C;
3875
+ let E = 1, S = 1, M, C;
3876
3876
  if (e.fromKeyboard)
3877
3877
  ({
3878
- deltaX: P,
3878
+ deltaX: M,
3879
3879
  deltaY: C
3880
3880
  } = e);
3881
3881
  else {
3882
3882
  const {
3883
3883
  screenX: k,
3884
- screenY: R
3884
+ screenY: I
3885
3885
  } = e, [U, ft] = this.#h;
3886
- [P, C] = this.screenToPageTranslation(k - U, R - ft), this.#h[0] = k, this.#h[1] = R;
3886
+ [M, C] = this.screenToPageTranslation(k - U, I - ft), this.#h[0] = k, this.#h[1] = I;
3887
3887
  }
3888
- if ([P, C] = f(P / s, C / i), m) {
3888
+ if ([M, C] = f(M / s, C / i), m) {
3889
3889
  const k = Math.hypot(a, o);
3890
- S = E = Math.max(Math.min(Math.hypot(v[0] - y[0] - P, v[1] - y[1] - C) / k, 1 / a, 1 / o), h / a, l / o);
3891
- } else w ? S = ut(Math.abs(v[0] - y[0] - P), h, 1) / a : E = ut(Math.abs(v[1] - y[1] - C), l, 1) / o;
3892
- const H = D._round(a * S), V = D._round(o * E);
3890
+ E = S = Math.max(Math.min(Math.hypot(v[0] - y[0] - M, v[1] - y[1] - C) / k, 1 / a, 1 / o), h / a, l / o);
3891
+ } else w ? E = ut(Math.abs(v[0] - y[0] - M), h, 1) / a : S = ut(Math.abs(v[1] - y[1] - C), l, 1) / o;
3892
+ const H = D._round(a * E), V = D._round(o * S);
3893
3893
  A = u(...b(H, V));
3894
3894
  const N = x - A[0], Z = _ - A[1];
3895
3895
  this.#c ||= [this.x, this.y, this.width, this.height], this.width = H, this.height = V, this.x = N, this.y = Z, this.setDims(), this.fixAndSetPosition(), this._onResizing();
@@ -3931,7 +3931,7 @@ class D {
3931
3931
  return this.div.getBoundingClientRect();
3932
3932
  }
3933
3933
  createAltText() {
3934
- return this.#i || (Mt.initialize(D._l10n), this.#i = new Mt(this), this.#t && (this.#i.data = this.#t, this.#t = null)), this.#i;
3934
+ return this.#i || (Pt.initialize(D._l10n), this.#i = new Pt(this), this.#t && (this.#i.data = this.#t, this.#t = null)), this.#i;
3935
3935
  }
3936
3936
  get altTextData() {
3937
3937
  return this.#i?.data;
@@ -4051,7 +4051,7 @@ class D {
4051
4051
  const [e, s] = this.parentDimensions;
4052
4052
  this.parentRotation % 180 !== 0 && (t.style.maxWidth = `${(100 * s / e).toFixed(2)}%`, t.style.maxHeight = `${(100 * e / s).toFixed(2)}%`);
4053
4053
  const [i, n] = this.getInitialTranslation();
4054
- return this.translate(i, n), Pi(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
4054
+ return this.translate(i, n), Mi(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
4055
4055
  container: t,
4056
4056
  isPinchingDisabled: () => !this.isSelected,
4057
4057
  onPinchStart: this.#G.bind(this),
@@ -4072,7 +4072,7 @@ class D {
4072
4072
  let i = 0.7 * (s / e) + 1 - 0.7;
4073
4073
  if (i === 1)
4074
4074
  return;
4075
- const n = this.#P(this.rotation), r = (A, x) => [n[0] * A + n[2] * x, n[1] * A + n[3] * x], [a, o] = this.parentDimensions, h = this.x, l = this.y, d = this.width, u = this.height, p = D.MIN_SIZE / a, f = D.MIN_SIZE / o;
4075
+ const n = this.#M(this.rotation), r = (A, x) => [n[0] * A + n[2] * x, n[1] * A + n[3] * x], [a, o] = this.parentDimensions, h = this.x, l = this.y, d = this.width, u = this.height, p = D.MIN_SIZE / a, f = D.MIN_SIZE / o;
4076
4076
  i = Math.max(Math.min(i, 1 / d, 1 / u), p / d, f / u);
4077
4077
  const g = D._round(d * i), b = D._round(u * i);
4078
4078
  if (g === d && b === u)
@@ -4082,7 +4082,7 @@ class D {
4082
4082
  this.x = w - v[0], this.y = y - v[1], this.width = g, this.height = b, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4083
4083
  }
4084
4084
  #x() {
4085
- this.#i?.toggle(!0), this.parent.togglePointerEvents(!0), this.#B();
4085
+ this.#i?.toggle(!0), this.parent.togglePointerEvents(!0), this.#O();
4086
4086
  }
4087
4087
  pointerdown(t) {
4088
4088
  const {
@@ -4096,9 +4096,9 @@ class D {
4096
4096
  this.#H(t);
4097
4097
  return;
4098
4098
  }
4099
- this.#I(t);
4099
+ this.#R(t);
4100
4100
  }
4101
- #I(t) {
4101
+ #R(t) {
4102
4102
  const {
4103
4103
  isMac: e
4104
4104
  } = at.platform;
@@ -4115,9 +4115,9 @@ class D {
4115
4115
  passive: !1,
4116
4116
  signal: n
4117
4117
  }, a = (h) => {
4118
- i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#I(h), s && this._onStopDragging();
4118
+ i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#R(h), s && this._onStopDragging();
4119
4119
  };
4120
- e && (this.#E = t.clientX, this.#_ = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (h) => {
4120
+ e && (this.#S = t.clientX, this.#_ = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (h) => {
4121
4121
  s || (s = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
4122
4122
  const {
4123
4123
  clientX: l,
@@ -4128,8 +4128,8 @@ class D {
4128
4128
  Q(h);
4129
4129
  return;
4130
4130
  }
4131
- const [p, f] = this.screenToPageTranslation(l - this.#E, d - this.#_);
4132
- this.#E = l, this.#_ = d, this._uiManager.dragSelectedEditors(p, f);
4131
+ const [p, f] = this.screenToPageTranslation(l - this.#S, d - this.#_);
4132
+ this.#S = l, this.#_ = d, this._uiManager.dragSelectedEditors(p, f);
4133
4133
  }, r), window.addEventListener("touchmove", Q, r), window.addEventListener("pointerdown", (h) => {
4134
4134
  h.pointerType === this.#o && (this.#T || h.isPrimary) && a(h), Q(h);
4135
4135
  }, r));
@@ -4323,7 +4323,7 @@ class D {
4323
4323
  return !1;
4324
4324
  }
4325
4325
  makeResizable() {
4326
- this.isResizable && (this.#O(), this.#l.classList.remove("hidden"));
4326
+ this.isResizable && (this.#B(), this.#l.classList.remove("hidden"));
4327
4327
  }
4328
4328
  get toolbarPosition() {
4329
4329
  return null;
@@ -4429,7 +4429,7 @@ class D {
4429
4429
  });
4430
4430
  }
4431
4431
  #N() {
4432
- this.#w = !1, this.#U(-1), this.#B();
4432
+ this.#w = !1, this.#U(-1), this.#O();
4433
4433
  }
4434
4434
  _stopResizingWithKeyboard() {
4435
4435
  this.#N(), this.div.focus();
@@ -4566,7 +4566,7 @@ class D {
4566
4566
  e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
4567
4567
  }
4568
4568
  }
4569
- class On extends D {
4569
+ class Bn extends D {
4570
4570
  constructor(t) {
4571
4571
  super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
4572
4572
  }
@@ -4775,7 +4775,7 @@ class Di extends Ns {
4775
4775
  });
4776
4776
  }
4777
4777
  }
4778
- class Bn {
4778
+ class On {
4779
4779
  #t = /* @__PURE__ */ new Set();
4780
4780
  constructor({
4781
4781
  ownerDocument: t = globalThis.document,
@@ -4805,7 +4805,7 @@ class Bn {
4805
4805
  _inspectFont: s
4806
4806
  }) {
4807
4807
  if (!(!t || this.#t.has(t.loadedName))) {
4808
- if (B(!e, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
4808
+ if (O(!e, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
4809
4809
  const {
4810
4810
  loadedName: i,
4811
4811
  src: n,
@@ -4815,7 +4815,7 @@ class Bn {
4815
4815
  try {
4816
4816
  await a.load(), this.#t.add(i), s?.(t);
4817
4817
  } catch {
4818
- I(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(a);
4818
+ R(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(a);
4819
4819
  }
4820
4820
  return;
4821
4821
  }
@@ -4836,7 +4836,7 @@ class Bn {
4836
4836
  try {
4837
4837
  await s.loaded;
4838
4838
  } catch (i) {
4839
- throw I(`Failed to load font '${s.family}': '${i}'.`), t.disableFontFace = !0, i;
4839
+ throw R(`Failed to load font '${s.family}': '${i}'.`), t.disableFontFace = !0, i;
4840
4840
  }
4841
4841
  }
4842
4842
  return;
@@ -4860,7 +4860,7 @@ class Bn {
4860
4860
  }
4861
4861
  _queueLoadingCallback(t) {
4862
4862
  function e() {
4863
- for (B(!i.done, "completeRequest() cannot be called twice."), i.done = !0; s.length > 0 && s[0].done; ) {
4863
+ for (O(!i.done, "completeRequest() cannot be called twice."), i.done = !0; s.length > 0 && s[0].done; ) {
4864
4864
  const n = s.shift();
4865
4865
  setTimeout(n.callback, 0);
4866
4866
  }
@@ -4883,8 +4883,8 @@ class Bn {
4883
4883
  return y.charCodeAt(v) << 24 | y.charCodeAt(v + 1) << 16 | y.charCodeAt(v + 2) << 8 | y.charCodeAt(v + 3) & 255;
4884
4884
  }
4885
4885
  function i(y, v, A, x) {
4886
- const _ = y.substring(0, v), S = y.substring(v + A);
4887
- return _ + x + S;
4886
+ const _ = y.substring(0, v), E = y.substring(v + A);
4887
+ return _ + x + E;
4888
4888
  }
4889
4889
  let n, r;
4890
4890
  const a = this._document.createElement("canvas");
@@ -4893,7 +4893,7 @@ class Bn {
4893
4893
  let h = 0;
4894
4894
  function l(y, v) {
4895
4895
  if (++h > 30) {
4896
- I("Load test font never loaded."), v();
4896
+ R("Load test font never loaded."), v();
4897
4897
  return;
4898
4898
  }
4899
4899
  if (o.font = "30px " + y, o.fillText(".", 0, 20), o.getImageData(0, 0, 1, 1).data[3] > 0) {
@@ -4945,7 +4945,7 @@ class Hn {
4945
4945
  createFontFaceRule() {
4946
4946
  if (!this.data || this.disableFontFace)
4947
4947
  return null;
4948
- const t = `url(data:${this.mimetype};base64,${Ei(this.data)});`;
4948
+ const t = `url(data:${this.mimetype};base64,${Si(this.data)});`;
4949
4949
  let e;
4950
4950
  if (!this.cssFontInfo)
4951
4951
  e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
@@ -4963,9 +4963,9 @@ class Hn {
4963
4963
  try {
4964
4964
  i = t.get(s);
4965
4965
  } catch (r) {
4966
- I(`getPathGenerator - ignoring character: "${r}".`);
4966
+ R(`getPathGenerator - ignoring character: "${r}".`);
4967
4967
  }
4968
- const n = Mi(i?.path);
4968
+ const n = Pi(i?.path);
4969
4969
  return this.fontExtraProperties || t.delete(s), this.compiledGlyphs[e] = n;
4970
4970
  }
4971
4971
  get black() {
@@ -5065,13 +5065,13 @@ class ae {
5065
5065
  const l = s[h], d = l.length;
5066
5066
  a.setUint32(o, d), r.set(l, o + 4), o += 4 + d;
5067
5067
  }
5068
- return B(o === n.byteLength, "CssFontInfo.write: Buffer overflow"), n;
5068
+ return O(o === n.byteLength, "CssFontInfo.write: Buffer overflow"), n;
5069
5069
  }
5070
5070
  constructor(t) {
5071
5071
  this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
5072
5072
  }
5073
5073
  #s(t) {
5074
- B(t < ae.strings.length, "Invalid string index");
5074
+ O(t < ae.strings.length, "Invalid string index");
5075
5075
  let e = 0;
5076
5076
  for (let i = 0; i < t; i++)
5077
5077
  e += this.#e.getUint32(e) + 4;
@@ -5110,7 +5110,7 @@ class oe {
5110
5110
  const p = s[u], f = p.length;
5111
5111
  i += 4 + f, l.setUint32(d, f), h.set(p, d + 4), d += 4 + f;
5112
5112
  }
5113
- return l.setUint32(d - i - 4, i), t.style && (l.setUint32(d, n.length), h.set(n, d + 4), d += 4 + n.length, l.setUint32(d, r.length), h.set(r, d + 4), d += 4 + r.length), B(d <= o.byteLength, "SubstitionInfo.write: Buffer overflow"), o.transferToFixedLength(d);
5113
+ return l.setUint32(d - i - 4, i), t.style && (l.setUint32(d, n.length), h.set(n, d + 4), d += 4 + n.length, l.setUint32(d, r.length), h.set(r, d + 4), d += 4 + r.length), O(d <= o.byteLength, "SubstitionInfo.write: Buffer overflow"), o.transferToFixedLength(d);
5114
5114
  }
5115
5115
  constructor(t) {
5116
5116
  this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
@@ -5119,7 +5119,7 @@ class oe {
5119
5119
  return this.#e.getUint8(0) !== 0;
5120
5120
  }
5121
5121
  #s(t) {
5122
- B(t < oe.strings.length, "Invalid string index");
5122
+ O(t < oe.strings.length, "Invalid string index");
5123
5123
  let e = 5;
5124
5124
  for (let i = 0; i < t; i++)
5125
5125
  e += this.#e.getUint32(e) + 4;
@@ -5169,7 +5169,7 @@ class G {
5169
5169
  this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
5170
5170
  }
5171
5171
  #l(t) {
5172
- B(t < G.bools.length, "Invalid boolean index");
5172
+ O(t < G.bools.length, "Invalid boolean index");
5173
5173
  const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
5174
5174
  return i === 0 ? void 0 : i === 2;
5175
5175
  }
@@ -5204,7 +5204,7 @@ class G {
5204
5204
  return this.#l(9);
5205
5205
  }
5206
5206
  #h(t) {
5207
- return B(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
5207
+ return O(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
5208
5208
  }
5209
5209
  get ascent() {
5210
5210
  return this.#h(0);
@@ -5246,7 +5246,7 @@ class G {
5246
5246
  return e;
5247
5247
  }
5248
5248
  #u(t) {
5249
- B(t < G.strings.length, "Invalid string index");
5249
+ O(t < G.strings.length, "Invalid string index");
5250
5250
  let e = G.#a + 4;
5251
5251
  for (let n = 0; n < t; n++)
5252
5252
  e += this.#o.getUint32(e) + 4;
@@ -5323,28 +5323,28 @@ class G {
5323
5323
  const b = t[G.bools[g]];
5324
5324
  p |= (b === void 0 ? 0 : b ? 2 : 1) << f, f += 2, (f === 8 || g === u - 1) && (l.setUint8(d++, p), p = 0, f = 0);
5325
5325
  }
5326
- B(d === G.#t, "FontInfo.write: Boolean properties offset mismatch");
5326
+ O(d === G.#t, "FontInfo.write: Boolean properties offset mismatch");
5327
5327
  for (const g of G.numbers)
5328
5328
  l.setFloat64(d, t[g]), d += 8;
5329
- if (B(d === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
5329
+ if (O(d === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
5330
5330
  l.setUint8(d++, 4);
5331
5331
  for (const g of t.bbox)
5332
5332
  l.setInt16(d, g, !0), d += 2;
5333
5333
  } else
5334
5334
  l.setUint8(d++, 0), d += 8;
5335
- if (B(d === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
5335
+ if (O(d === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
5336
5336
  l.setUint8(d++, 6);
5337
5337
  for (const g of t.fontMatrix)
5338
5338
  l.setFloat64(d, g, !0), d += 8;
5339
5339
  } else
5340
5340
  l.setUint8(d++, 0), d += 48;
5341
- if (B(d === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
5341
+ if (O(d === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
5342
5342
  l.setUint8(d++, 1);
5343
5343
  for (const g of t.defaultVMetrics)
5344
5344
  l.setInt16(d, g, !0), d += 2;
5345
5345
  } else
5346
5346
  l.setUint8(d++, 0), d += 6;
5347
- B(d === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), d += 4;
5347
+ O(d === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), d += 4;
5348
5348
  for (const g of G.strings) {
5349
5349
  const b = n[g], m = b.length;
5350
5350
  l.setUint32(d, m), h.set(b, d + 4), d += 4 + m;
@@ -5353,15 +5353,15 @@ class G {
5353
5353
  l.setUint32(d, 0), d += 4;
5354
5354
  else {
5355
5355
  const g = e.byteLength;
5356
- l.setUint32(d, g), B(d + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at systemFontInfo"), h.set(new Uint8Array(e), d + 4), d += 4 + g;
5356
+ l.setUint32(d, g), O(d + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at systemFontInfo"), h.set(new Uint8Array(e), d + 4), d += 4 + g;
5357
5357
  }
5358
5358
  if (!s)
5359
5359
  l.setUint32(d, 0), d += 4;
5360
5360
  else {
5361
5361
  const g = s.byteLength;
5362
- l.setUint32(d, g), B(d + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at cssFontInfo"), h.set(new Uint8Array(s), d + 4), d += 4 + g;
5362
+ l.setUint32(d, g), O(d + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at cssFontInfo"), h.set(new Uint8Array(s), d + 4), d += 4 + g;
5363
5363
  }
5364
- return t.data === void 0 ? (l.setUint32(d, 0), d += 4) : (l.setUint32(d, t.data.length), h.set(t.data, d + 4), d += 4 + t.data.length), B(d <= o.byteLength, "FontInfo.write: Buffer overflow"), o.transferToFixedLength(d);
5364
+ return t.data === void 0 ? (l.setUint32(d, 0), d += 4) : (l.setUint32(d, t.data.length), h.set(t.data, d + 4), d += 4 + t.data.length), O(d <= o.byteLength, "FontInfo.write: Buffer overflow"), o.transferToFixedLength(d);
5365
5365
  }
5366
5366
  }
5367
5367
  class ot {
@@ -5459,8 +5459,8 @@ class ot {
5459
5459
  if (l.length > 0) {
5460
5460
  let w = l[0], y = l[0], v = l[1], A = l[1];
5461
5461
  for (let x = 0; x < l.length; x += 2) {
5462
- const _ = l[x], S = l[x + 1];
5463
- w = w > _ ? _ : w, v = v > S ? S : v, y = y < _ ? _ : y, A = A < S ? S : A;
5462
+ const _ = l[x], E = l[x + 1];
5463
+ w = w > _ ? _ : w, v = v > E ? E : v, y = y < _ ? _ : y, A = A < E ? E : A;
5464
5464
  }
5465
5465
  m = [w, v, y, A];
5466
5466
  }
@@ -5500,7 +5500,7 @@ function Un(c) {
5500
5500
  if (c instanceof Uint8Array && c.byteLength === c.buffer.byteLength)
5501
5501
  return c;
5502
5502
  if (typeof c == "string")
5503
- return Me(c);
5503
+ return Pe(c);
5504
5504
  if (c instanceof ArrayBuffer || ArrayBuffer.isView(c) || typeof c == "object" && !isNaN(c?.length))
5505
5505
  return new Uint8Array(c);
5506
5506
  throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
@@ -5534,7 +5534,7 @@ class jn {
5534
5534
  signal: n
5535
5535
  } = s;
5536
5536
  if (n.aborted) {
5537
- I("LoopbackPort - cannot use an `aborted` signal.");
5537
+ R("LoopbackPort - cannot use an `aborted` signal.");
5538
5538
  return;
5539
5539
  }
5540
5540
  const r = () => this.removeEventListener(t, e);
@@ -5551,7 +5551,7 @@ class jn {
5551
5551
  this.#t.clear();
5552
5552
  }
5553
5553
  }
5554
- const Oe = {
5554
+ const Be = {
5555
5555
  DATA: 1,
5556
5556
  ERROR: 2
5557
5557
  }, st = {
@@ -5603,9 +5603,9 @@ class ve {
5603
5603
  const s = t.callbackId, i = this.callbackCapabilities[s];
5604
5604
  if (!i)
5605
5605
  throw new Error(`Cannot resolve callback ${s}`);
5606
- if (delete this.callbackCapabilities[s], t.callback === Oe.DATA)
5606
+ if (delete this.callbackCapabilities[s], t.callback === Be.DATA)
5607
5607
  i.resolve(t.data);
5608
- else if (t.callback === Oe.ERROR)
5608
+ else if (t.callback === Be.ERROR)
5609
5609
  i.reject(pt(t.reason));
5610
5610
  else
5611
5611
  throw new Error("Unexpected callback case");
@@ -5620,7 +5620,7 @@ class ve {
5620
5620
  n.postMessage({
5621
5621
  sourceName: s,
5622
5622
  targetName: i,
5623
- callback: Oe.DATA,
5623
+ callback: Be.DATA,
5624
5624
  callbackId: t.callbackId,
5625
5625
  data: r
5626
5626
  });
@@ -5628,7 +5628,7 @@ class ve {
5628
5628
  n.postMessage({
5629
5629
  sourceName: s,
5630
5630
  targetName: i,
5631
- callback: Oe.ERROR,
5631
+ callback: Be.ERROR,
5632
5632
  callbackId: t.callbackId,
5633
5633
  reason: pt(r)
5634
5634
  });
@@ -5702,7 +5702,7 @@ class ve {
5702
5702
  }), l.promise;
5703
5703
  },
5704
5704
  cancel: (h) => {
5705
- B(h instanceof Error, "cancel must have a valid reason");
5705
+ O(h instanceof Error, "cancel must have a valid reason");
5706
5706
  const l = Promise.withResolvers();
5707
5707
  return this.streamControllers[n].cancelCall = l, this.streamControllers[n].isClosed = !0, o.postMessage({
5708
5708
  sourceName: r,
@@ -5737,7 +5737,7 @@ class ve {
5737
5737
  }), delete r.streamSinks[e]);
5738
5738
  },
5739
5739
  error(h) {
5740
- B(h instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, n.postMessage({
5740
+ O(h instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, n.postMessage({
5741
5741
  sourceName: s,
5742
5742
  targetName: i,
5743
5743
  stream: st.ERROR,
@@ -5809,17 +5809,17 @@ class ve {
5809
5809
  });
5810
5810
  break;
5811
5811
  case st.ENQUEUE:
5812
- if (B(r, "enqueue should have stream controller"), r.isClosed)
5812
+ if (O(r, "enqueue should have stream controller"), r.isClosed)
5813
5813
  break;
5814
5814
  r.controller.enqueue(t.chunk);
5815
5815
  break;
5816
5816
  case st.CLOSE:
5817
- if (B(r, "close should have stream controller"), r.isClosed)
5817
+ if (O(r, "close should have stream controller"), r.isClosed)
5818
5818
  break;
5819
5819
  r.isClosed = !0, r.controller.close(), this.#a(r, e);
5820
5820
  break;
5821
5821
  case st.ERROR:
5822
- B(r, "error should have stream controller"), r.controller.error(pt(t.reason)), this.#a(r, e);
5822
+ O(r, "error should have stream controller"), r.controller.error(pt(t.reason)), this.#a(r, e);
5823
5823
  break;
5824
5824
  case st.CANCEL_COMPLETE:
5825
5825
  t.success ? r.cancelCall.resolve() : r.cancelCall.reject(pt(t.reason)), this.#a(r, e);
@@ -5857,7 +5857,7 @@ class ve {
5857
5857
  this.#t?.abort(), this.#t = null;
5858
5858
  }
5859
5859
  }
5860
- class Ri {
5860
+ class Ii {
5861
5861
  #t = !1;
5862
5862
  constructor({
5863
5863
  enableHWA: t = !1
@@ -5891,7 +5891,7 @@ class Ri {
5891
5891
  j("Abstract method `_createCanvas` called.");
5892
5892
  }
5893
5893
  }
5894
- class Wn extends Ri {
5894
+ class Wn extends Ii {
5895
5895
  constructor({
5896
5896
  ownerDocument: t = globalThis.document,
5897
5897
  enableHWA: e = !1
@@ -5905,7 +5905,7 @@ class Wn extends Ri {
5905
5905
  return s.width = t, s.height = e, s;
5906
5906
  }
5907
5907
  }
5908
- class Ii {
5908
+ class Ri {
5909
5909
  constructor({
5910
5910
  baseUrl: t = null,
5911
5911
  isCompressed: e = !0
@@ -5931,10 +5931,10 @@ class Ii {
5931
5931
  j("Abstract method `_fetch` called.");
5932
5932
  }
5933
5933
  }
5934
- class ii extends Ii {
5934
+ class ii extends Ri {
5935
5935
  async _fetch(t) {
5936
- const e = await Pe(t, this.isCompressed ? "arraybuffer" : "text");
5937
- return e instanceof ArrayBuffer ? new Uint8Array(e) : Me(e);
5936
+ const e = await Me(t, this.isCompressed ? "arraybuffer" : "text");
5937
+ return e instanceof ArrayBuffer ? new Uint8Array(e) : Pe(e);
5938
5938
  }
5939
5939
  }
5940
5940
  class Li {
@@ -5982,8 +5982,8 @@ class qn extends Li {
5982
5982
  style: e
5983
5983
  } = t;
5984
5984
  e.visibility = "hidden", e.contain = "strict", e.width = e.height = 0, e.position = "absolute", e.top = e.left = 0, e.zIndex = -1;
5985
- const s = this.#a.createElementNS(Rt, "svg");
5986
- s.setAttribute("width", 0), s.setAttribute("height", 0), this.#i = this.#a.createElementNS(Rt, "defs"), t.append(s), s.append(this.#i), this.#a.body.append(t);
5985
+ const s = this.#a.createElementNS(It, "svg");
5986
+ s.setAttribute("width", 0), s.setAttribute("height", 0), this.#i = this.#a.createElementNS(It, "defs"), t.append(s), s.append(this.#i), this.#a.body.append(t);
5987
5987
  }
5988
5988
  return this.#i;
5989
5989
  }
@@ -6004,7 +6004,7 @@ class qn extends Li {
6004
6004
  if (this.#t === void 0) {
6005
6005
  this.#t = "";
6006
6006
  const e = this.#a.URL;
6007
- e !== this.#a.baseURI && (Ze(e) ? I('#createUrl: ignore "data:"-URL for performance reasons.') : this.#t = xi(e, ""));
6007
+ e !== this.#a.baseURI && (Ze(e) ? R('#createUrl: ignore "data:"-URL for performance reasons.') : this.#t = xi(e, ""));
6008
6008
  }
6009
6009
  return `url(${this.#t}#${t})`;
6010
6010
  }
@@ -6089,15 +6089,15 @@ class qn extends Li {
6089
6089
  d < l && ([l, d, u, p] = [d, l, p, u]), this.#h.style.color = "";
6090
6090
  const f = (m, w, y) => {
6091
6091
  const v = new Array(256), A = (d - l) / y, x = m / 255, _ = (w - m) / (255 * y);
6092
- let S = 0;
6093
- for (let E = 0; E <= y; E++) {
6094
- const P = Math.round(l + E * A), C = x + E * _;
6095
- for (let H = S; H <= P; H++)
6092
+ let E = 0;
6093
+ for (let S = 0; S <= y; S++) {
6094
+ const M = Math.round(l + S * A), C = x + S * _;
6095
+ for (let H = E; H <= M; H++)
6096
6096
  v[H] = C;
6097
- S = P + 1;
6097
+ E = M + 1;
6098
6098
  }
6099
- for (let E = S; E < 256; E++)
6100
- v[E] = v[S - 1];
6099
+ for (let S = E; S < 256; S++)
6100
+ v[S] = v[E - 1];
6101
6101
  return v.join(",");
6102
6102
  }, g = `g_${this.#s}_hcm_${t}_filter`, b = a.filter = this.#f(g);
6103
6103
  return this.#m(b), this.#g(f(u[0], p[0], 5), f(u[1], p[1], 5), f(u[2], p[2], 5), b), a.url = this.#d(g), a.url;
@@ -6106,27 +6106,27 @@ class qn extends Li {
6106
6106
  t && this.#r?.size || (this.#i?.parentNode.parentNode.remove(), this.#i = null, this.#e?.clear(), this.#e = null, this.#r?.clear(), this.#r = null, this.#n = 0);
6107
6107
  }
6108
6108
  #p(t) {
6109
- const e = this.#a.createElementNS(Rt, "feColorMatrix");
6109
+ const e = this.#a.createElementNS(It, "feColorMatrix");
6110
6110
  e.setAttribute("type", "matrix"), e.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"), t.append(e);
6111
6111
  }
6112
6112
  #m(t) {
6113
- const e = this.#a.createElementNS(Rt, "feColorMatrix");
6113
+ const e = this.#a.createElementNS(It, "feColorMatrix");
6114
6114
  e.setAttribute("type", "matrix"), e.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), t.append(e);
6115
6115
  }
6116
6116
  #f(t) {
6117
- const e = this.#a.createElementNS(Rt, "filter");
6117
+ const e = this.#a.createElementNS(It, "filter");
6118
6118
  return e.setAttribute("color-interpolation-filters", "sRGB"), e.setAttribute("id", t), this.#h.append(e), e;
6119
6119
  }
6120
6120
  #c(t, e, s) {
6121
- const i = this.#a.createElementNS(Rt, e);
6121
+ const i = this.#a.createElementNS(It, e);
6122
6122
  i.setAttribute("type", "discrete"), i.setAttribute("tableValues", s), t.append(i);
6123
6123
  }
6124
6124
  #g(t, e, s, i) {
6125
- const n = this.#a.createElementNS(Rt, "feComponentTransfer");
6125
+ const n = this.#a.createElementNS(It, "feComponentTransfer");
6126
6126
  i.append(n), this.#c(n, "feFuncR", t), this.#c(n, "feFuncG", e), this.#c(n, "feFuncB", s);
6127
6127
  }
6128
6128
  #b(t, e) {
6129
- const s = this.#a.createElementNS(Rt, "feComponentTransfer");
6129
+ const s = this.#a.createElementNS(It, "feComponentTransfer");
6130
6130
  e.append(s), this.#c(s, "feFuncA", t);
6131
6131
  }
6132
6132
  #w(t) {
@@ -6157,7 +6157,7 @@ class Fi {
6157
6157
  }
6158
6158
  class ni extends Fi {
6159
6159
  async _fetch(t) {
6160
- const e = await Pe(t, "arraybuffer");
6160
+ const e = await Me(t, "arraybuffer");
6161
6161
  return new Uint8Array(e);
6162
6162
  }
6163
6163
  }
@@ -6185,45 +6185,45 @@ class Ni {
6185
6185
  }
6186
6186
  class ri extends Ni {
6187
6187
  async _fetch(t) {
6188
- const e = await Pe(t, "arraybuffer");
6188
+ const e = await Me(t, "arraybuffer");
6189
6189
  return new Uint8Array(e);
6190
6190
  }
6191
6191
  }
6192
- dt && I("Please use the `legacy` build in Node.js environments.");
6193
- async function Os(c) {
6192
+ dt && R("Please use the `legacy` build in Node.js environments.");
6193
+ async function Bs(c) {
6194
6194
  const t = await process.getBuiltinModule("fs").promises.readFile(c);
6195
6195
  return new Uint8Array(t);
6196
6196
  }
6197
6197
  class Xn extends Li {
6198
6198
  }
6199
- class Yn extends Ri {
6199
+ class Yn extends Ii {
6200
6200
  _createCanvas(t, e) {
6201
6201
  return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
6202
6202
  }
6203
6203
  }
6204
- class Kn extends Ii {
6204
+ class Kn extends Ri {
6205
6205
  async _fetch(t) {
6206
- return Os(t);
6206
+ return Bs(t);
6207
6207
  }
6208
6208
  }
6209
6209
  class Qn extends Fi {
6210
6210
  async _fetch(t) {
6211
- return Os(t);
6211
+ return Bs(t);
6212
6212
  }
6213
6213
  }
6214
6214
  class Jn extends Ni {
6215
6215
  async _fetch(t) {
6216
- return Os(t);
6216
+ return Bs(t);
6217
6217
  }
6218
6218
  }
6219
6219
  const Qt = "__forcedDependency", {
6220
6220
  floor: ai,
6221
6221
  ceil: oi
6222
6222
  } = Math;
6223
- function Be(c, t, e, s, i, n) {
6223
+ function Oe(c, t, e, s, i, n) {
6224
6224
  c[t * 4 + 0] = Math.min(c[t * 4 + 0], e), c[t * 4 + 1] = Math.min(c[t * 4 + 1], s), c[t * 4 + 2] = Math.max(c[t * 4 + 2], i), c[t * 4 + 3] = Math.max(c[t * 4 + 3], n);
6225
6225
  }
6226
- const Ss = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
6226
+ const Es = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
6227
6227
  class Zn {
6228
6228
  #t;
6229
6229
  #e;
@@ -6234,7 +6234,7 @@ class Zn {
6234
6234
  return this.#t.length;
6235
6235
  }
6236
6236
  isEmpty(t) {
6237
- return this.#t[t] === Ss;
6237
+ return this.#t[t] === Es;
6238
6238
  }
6239
6239
  minX(t) {
6240
6240
  return this.#e[t * 4 + 0] / 256;
@@ -6292,7 +6292,7 @@ class tr {
6292
6292
  }
6293
6293
  #b(t, e) {
6294
6294
  const s = new ArrayBuffer(t * 4);
6295
- this.#f = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(Ss, e.length)) : this.#c.fill(Ss);
6295
+ this.#f = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(Es, e.length)) : this.#c.fill(Es);
6296
6296
  }
6297
6297
  save(t) {
6298
6298
  return this.#t = {
@@ -6427,13 +6427,13 @@ class tr {
6427
6427
  }
6428
6428
  if (this.#l === t) {
6429
6429
  const s = ai(this.#o[0] * 256 / this.#p), i = ai(this.#o[1] * 256 / this.#m), n = oi(this.#o[2] * 256 / this.#p), r = oi(this.#o[3] * 256 / this.#m);
6430
- Be(this.#f, t, s, i, n, r);
6430
+ Oe(this.#f, t, s, i, n, r);
6431
6431
  for (const a of this.#h)
6432
- a !== t && Be(this.#f, a, s, i, n, r);
6432
+ a !== t && Oe(this.#f, a, s, i, n, r);
6433
6433
  for (const a of this.#s)
6434
- a !== t && Be(this.#f, a, s, i, n, r);
6434
+ a !== t && Oe(this.#f, a, s, i, n, r);
6435
6435
  for (const a of this.#a)
6436
- a !== t && Be(this.#f, a, s, i, n, r);
6436
+ a !== t && Oe(this.#f, a, s, i, n, r);
6437
6437
  e || (this.#h.clear(), this.#l = -1);
6438
6438
  }
6439
6439
  return this;
@@ -6585,13 +6585,13 @@ const At = {
6585
6585
  STROKE: "Stroke",
6586
6586
  SHADING: "Shading"
6587
6587
  };
6588
- function Es(c, t) {
6588
+ function Ss(c, t) {
6589
6589
  if (!t)
6590
6590
  return;
6591
6591
  const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
6592
6592
  i.rect(t[0], t[1], e, s), c.clip(i);
6593
6593
  }
6594
- class Bs {
6594
+ class Os {
6595
6595
  isModifyingCurrentTransform() {
6596
6596
  return !1;
6597
6597
  }
@@ -6599,7 +6599,7 @@ class Bs {
6599
6599
  j("Abstract method `getPattern` called.");
6600
6600
  }
6601
6601
  }
6602
- class er extends Bs {
6602
+ class er extends Os {
6603
6603
  constructor(t) {
6604
6604
  super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
6605
6605
  }
@@ -6640,11 +6640,11 @@ class er extends Bs {
6640
6640
  return this._createGradient(t, u);
6641
6641
  }
6642
6642
  const r = e.current.getClippedPathBoundingBox(i, X(t)) || [0, 0, 0, 0], a = Math.ceil(r[2] - r[0]) || 1, o = Math.ceil(r[3] - r[1]) || 1, h = e.cachedCanvases.getCanvas("pattern", a, o), l = h.context;
6643
- l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), l.transform(...e.baseTransform), this.matrix && l.transform(...this.matrix), Es(l, this._bbox), l.fillStyle = this._createGradient(l), l.fill(), n = t.createPattern(h.canvas, "no-repeat");
6643
+ l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), l.transform(...e.baseTransform), this.matrix && l.transform(...this.matrix), Ss(l, this._bbox), l.fillStyle = this._createGradient(l), l.fill(), n = t.createPattern(h.canvas, "no-repeat");
6644
6644
  const d = new DOMMatrix(s);
6645
6645
  n.setTransform(d);
6646
6646
  } else
6647
- Es(t, this._bbox), n = this._createGradient(t);
6647
+ Ss(t, this._bbox), n = this._createGradient(t);
6648
6648
  return n;
6649
6649
  }
6650
6650
  }
@@ -6655,22 +6655,22 @@ function cs(c, t, e, s, i, n, r, a) {
6655
6655
  const p = (o[e] + t.offsetX) * t.scaleX, f = (o[e + 1] + t.offsetY) * t.scaleY, g = (o[s] + t.offsetX) * t.scaleX, b = (o[s + 1] + t.offsetY) * t.scaleY, m = (o[i] + t.offsetX) * t.scaleX, w = (o[i + 1] + t.offsetY) * t.scaleY;
6656
6656
  if (f >= w)
6657
6657
  return;
6658
- const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1], S = h[r + 2], E = h[a], P = h[a + 1], C = h[a + 2], H = Math.round(f), V = Math.round(w);
6659
- let N, Z, k, R, U, ft, Dt, tt;
6658
+ const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1], E = h[r + 2], S = h[a], M = h[a + 1], C = h[a + 2], H = Math.round(f), V = Math.round(w);
6659
+ let N, Z, k, I, U, ft, Dt, tt;
6660
6660
  for (let W = H; W <= V; W++) {
6661
6661
  if (W < b) {
6662
6662
  const et = W < f ? 0 : (f - W) / (f - b);
6663
- N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, R = A - (A - S) * et;
6663
+ N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, I = A - (A - E) * et;
6664
6664
  } else {
6665
6665
  let et;
6666
- W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - E) * et, k = _ - (_ - P) * et, R = S - (S - C) * et;
6666
+ W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - S) * et, k = _ - (_ - M) * et, I = E - (E - C) * et;
6667
6667
  }
6668
6668
  let q;
6669
- W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y - E) * q, Dt = v - (v - P) * q, tt = A - (A - C) * q;
6669
+ W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y - S) * q, Dt = v - (v - M) * q, tt = A - (A - C) * q;
6670
6670
  const Ut = Math.round(Math.min(N, U)), Nt = Math.round(Math.max(N, U));
6671
- let Ot = d * W + Ut * 4;
6671
+ let Bt = d * W + Ut * 4;
6672
6672
  for (let et = Ut; et <= Nt; et++)
6673
- q = (N - et) / (N - U), q < 0 ? q = 0 : q > 1 && (q = 1), l[Ot++] = Z - (Z - ft) * q | 0, l[Ot++] = k - (k - Dt) * q | 0, l[Ot++] = R - (R - tt) * q | 0, l[Ot++] = 255;
6673
+ q = (N - et) / (N - U), q < 0 ? q = 0 : q > 1 && (q = 1), l[Bt++] = Z - (Z - ft) * q | 0, l[Bt++] = k - (k - Dt) * q | 0, l[Bt++] = I - (I - tt) * q | 0, l[Bt++] = 255;
6674
6674
  }
6675
6675
  }
6676
6676
  function sr(c, t, e) {
@@ -6693,7 +6693,7 @@ function sr(c, t, e) {
6693
6693
  throw new Error("illegal figure");
6694
6694
  }
6695
6695
  }
6696
- class ir extends Bs {
6696
+ class ir extends Os {
6697
6697
  constructor(t) {
6698
6698
  super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[6], this._background = t[7], this.matrix = null;
6699
6699
  }
@@ -6725,7 +6725,7 @@ class ir extends Bs {
6725
6725
  return !0;
6726
6726
  }
6727
6727
  getPattern(t, e, s, i) {
6728
- Es(t, this._bbox);
6728
+ Ss(t, this._bbox);
6729
6729
  const n = new Float32Array(2);
6730
6730
  if (i === ct.SHADING)
6731
6731
  T.singularValueDecompose2dScale(X(t), n);
@@ -6739,7 +6739,7 @@ class ir extends Bs {
6739
6739
  return i !== ct.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(r.offsetX, r.offsetY), t.scale(r.scaleX, r.scaleY), t.createPattern(r.canvas, "no-repeat");
6740
6740
  }
6741
6741
  }
6742
- class nr extends Bs {
6742
+ class nr extends Os {
6743
6743
  getPattern() {
6744
6744
  return "hotpink";
6745
6745
  }
@@ -6783,15 +6783,15 @@ class Hs {
6783
6783
  const [w, y] = m;
6784
6784
  T.singularValueDecompose2dScale(this.baseTransform, m);
6785
6785
  const v = w * m[0], A = y * m[1];
6786
- let x = g, _ = b, S = !1, E = !1;
6787
- const P = Math.ceil(h * v), C = Math.ceil(l * A), H = Math.ceil(g * v), V = Math.ceil(b * A);
6788
- P >= H ? x = h : S = !0, C >= V ? _ = l : E = !0;
6789
- const N = this.getSizeAndScale(x, this.ctx.canvas.width, v), Z = this.getSizeAndScale(_, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, Z.size), R = k.context, U = o.createCanvasGraphics(R, e);
6790
- if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), R.translate(-N.scale * d, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), R.save(), U.dependencyTracker?.save(), this.clipBbox(U, d, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), R.restore(), S || E) {
6786
+ let x = g, _ = b, E = !1, S = !1;
6787
+ const M = Math.ceil(h * v), C = Math.ceil(l * A), H = Math.ceil(g * v), V = Math.ceil(b * A);
6788
+ M >= H ? x = h : E = !0, C >= V ? _ = l : S = !0;
6789
+ const N = this.getSizeAndScale(x, this.ctx.canvas.width, v), Z = this.getSizeAndScale(_, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, Z.size), I = k.context, U = o.createCanvasGraphics(I, e);
6790
+ if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), I.translate(-N.scale * d, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), I.save(), U.dependencyTracker?.save(), this.clipBbox(U, d, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), I.restore(), E || S) {
6791
6791
  const ft = k.canvas;
6792
- S && (x = h), E && (_ = l);
6793
- const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Ot = S ? Math.floor(g / h) : 0, et = E ? Math.floor(b / l) : 0;
6794
- for (let de = 0; de <= Ot; de++)
6792
+ E && (x = h), S && (_ = l);
6793
+ const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Bt = E ? Math.floor(g / h) : 0, et = S ? Math.floor(b / l) : 0;
6794
+ for (let de = 0; de <= Bt; de++)
6795
6795
  for (let ue = 0; ue <= et; ue++)
6796
6796
  Nt.drawImage(ft, W * de, q * ue, W, q, 0, 0, W, q);
6797
6797
  return {
@@ -6939,12 +6939,12 @@ class lr {
6939
6939
  function $e(c, t, e, s, i, n, r, a, o, h) {
6940
6940
  const [l, d, u, p, f, g] = X(c);
6941
6941
  if (d === 0 && u === 0) {
6942
- const w = r * l + f, y = Math.round(w), v = a * p + g, A = Math.round(v), x = (r + o) * l + f, _ = Math.abs(Math.round(x) - y) || 1, S = (a + h) * p + g, E = Math.abs(Math.round(S) - A) || 1;
6943
- return c.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), c.drawImage(t, e, s, i, n, 0, 0, _, E), c.setTransform(l, d, u, p, f, g), [_, E];
6942
+ const w = r * l + f, y = Math.round(w), v = a * p + g, A = Math.round(v), x = (r + o) * l + f, _ = Math.abs(Math.round(x) - y) || 1, E = (a + h) * p + g, S = Math.abs(Math.round(E) - A) || 1;
6943
+ return c.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), c.drawImage(t, e, s, i, n, 0, 0, _, S), c.setTransform(l, d, u, p, f, g), [_, S];
6944
6944
  }
6945
6945
  if (l === 0 && p === 0) {
6946
- const w = a * u + f, y = Math.round(w), v = r * d + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1, S = (r + o) * d + g, E = Math.abs(Math.round(S) - A) || 1;
6947
- return c.setTransform(0, Math.sign(d), Math.sign(u), 0, y, A), c.drawImage(t, e, s, i, n, 0, 0, E, _), c.setTransform(l, d, u, p, f, g), [E, _];
6946
+ const w = a * u + f, y = Math.round(w), v = r * d + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1, E = (r + o) * d + g, S = Math.abs(Math.round(E) - A) || 1;
6947
+ return c.setTransform(0, Math.sign(d), Math.sign(u), 0, y, A), c.drawImage(t, e, s, i, n, 0, 0, S, _), c.setTransform(l, d, u, p, f, g), [S, _];
6948
6948
  }
6949
6949
  c.drawImage(t, e, s, i, n, r, a, o, h);
6950
6950
  const b = Math.hypot(l, d), m = Math.hypot(u, p);
@@ -7021,12 +7021,12 @@ function pi(c, t) {
7021
7021
  for (f = u < n ? gt : i, h = 0, p = 0; p < f; p++) {
7022
7022
  const x = b - o;
7023
7023
  let _ = 0;
7024
- const S = x > y ? s : x * 8 - 7, E = S & -8;
7025
- let P = 0, C = 0;
7026
- for (; _ < E; _ += 8)
7024
+ const E = x > y ? s : x * 8 - 7, S = E & -8;
7025
+ let M = 0, C = 0;
7026
+ for (; _ < S; _ += 8)
7027
7027
  C = l[o++], m[h++] = C & 128 ? v : A, m[h++] = C & 64 ? v : A, m[h++] = C & 32 ? v : A, m[h++] = C & 16 ? v : A, m[h++] = C & 8 ? v : A, m[h++] = C & 4 ? v : A, m[h++] = C & 2 ? v : A, m[h++] = C & 1 ? v : A;
7028
- for (; _ < S; _++)
7029
- P === 0 && (C = l[o++], P = 128), m[h++] = C & P ? v : A, P >>= 1;
7028
+ for (; _ < E; _++)
7029
+ M === 0 && (C = l[o++], M = 128), m[h++] = C & M ? v : A, M >>= 1;
7030
7030
  }
7031
7031
  for (; h < w; )
7032
7032
  m[h++] = 0;
@@ -7125,7 +7125,7 @@ class he {
7125
7125
  if (i !== void 0 && o === i.nextBreakPoint)
7126
7126
  return i.breakIt(o, s), o;
7127
7127
  if (!n || n(o))
7128
- if (g = a[o], b = r[o] ?? null, g !== Ee.dependency)
7128
+ if (g = a[o], b = r[o] ?? null, g !== Se.dependency)
7129
7129
  b === null ? this[g](o) : this[g](o, ...b);
7130
7130
  else
7131
7131
  for (const m of b) {
@@ -7186,8 +7186,8 @@ class he {
7186
7186
  } = e, r = this.current.fillColor, a = this.current.patternFill, o = X(s);
7187
7187
  let h, l, d, u;
7188
7188
  if ((e.bitmap || e.data) && e.count > 1) {
7189
- const P = e.bitmap || e.data.buffer;
7190
- l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(P), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(P, h));
7189
+ const M = e.bitmap || e.data.buffer;
7190
+ l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(M), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(M, h));
7191
7191
  const C = h.get(l);
7192
7192
  if (C && !a) {
7193
7193
  const H = Math.round(Math.min(o[0], o[2]) + o[4]), V = Math.round(Math.min(o[1], o[3]) + o[5]);
@@ -7204,13 +7204,13 @@ class he {
7204
7204
  p = T.transform(p, [1, 0, 0, 1, 0, -n]);
7205
7205
  const f = ie.slice();
7206
7206
  T.axialAlignedBoundingBox([0, 0, i, n], p, f);
7207
- const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g, S = b;
7208
- x.translate(-_, -S), x.transform(...p), d || (d = this._scaleImage(u.canvas, Et(x)), d = d.img, h && a && h.set(l, d)), x.imageSmoothingEnabled = fi(X(x), e.interpolate), $e(x, d, 0, 0, d.width, d.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
7209
- const E = T.transform(Et(x), [1, 0, 0, 1, -_, -S]);
7210
- return x.fillStyle = a ? r.getPattern(s, this, E, ct.FILL, t) : r, x.fillRect(0, 0, i, n), h && !a && (this.cachedCanvases.delete("fillCanvas"), h.set(l, A.canvas)), this.dependencyTracker?.recordDependencies(t, At.transformAndFill), {
7207
+ const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g, E = b;
7208
+ x.translate(-_, -E), x.transform(...p), d || (d = this._scaleImage(u.canvas, St(x)), d = d.img, h && a && h.set(l, d)), x.imageSmoothingEnabled = fi(X(x), e.interpolate), $e(x, d, 0, 0, d.width, d.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
7209
+ const S = T.transform(St(x), [1, 0, 0, 1, -_, -E]);
7210
+ return x.fillStyle = a ? r.getPattern(s, this, S, ct.FILL, t) : r, x.fillRect(0, 0, i, n), h && !a && (this.cachedCanvases.delete("fillCanvas"), h.set(l, A.canvas)), this.dependencyTracker?.recordDependencies(t, At.transformAndFill), {
7211
7211
  canvas: A.canvas,
7212
7212
  offsetX: Math.round(_),
7213
- offsetY: Math.round(S)
7213
+ offsetY: Math.round(E)
7214
7214
  };
7215
7215
  }
7216
7216
  setLineWidth(t, e) {
@@ -7346,10 +7346,10 @@ class he {
7346
7346
  return;
7347
7347
  }
7348
7348
  if (this.dependencyTracker !== null) {
7349
- const r = e === Ee.stroke ? this.current.lineWidth / 2 : 0;
7349
+ const r = e === Se.stroke ? this.current.lineWidth / 2 : 0;
7350
7350
  this.dependencyTracker.resetBBox(t).recordBBox(t, this.ctx, i[0] - r, i[2] + r, i[1] - r, i[3] + r).recordDependencies(t, ["transform"]);
7351
7351
  }
7352
- n instanceof Path2D || (n = s[0] = Mi(n)), T.axialAlignedBoundingBox(i, X(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
7352
+ n instanceof Path2D || (n = s[0] = Pi(n)), T.axialAlignedBoundingBox(i, X(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
7353
7353
  }
7354
7354
  closePath(t) {
7355
7355
  this.ctx.closePath();
@@ -7359,7 +7359,7 @@ class he {
7359
7359
  if (i.globalAlpha = this.current.strokeAlpha, this.contentVisible)
7360
7360
  if (typeof n == "object" && n?.getPattern) {
7361
7361
  const r = n.isModifyingCurrentTransform() ? i.getTransform() : null;
7362
- if (i.save(), i.strokeStyle = n.getPattern(i, this, Et(i), ct.STROKE, t), r) {
7362
+ if (i.save(), i.strokeStyle = n.getPattern(i, this, St(i), ct.STROKE, t), r) {
7363
7363
  const a = new Path2D();
7364
7364
  a.addPath(e, i.getTransform().invertSelf().multiplySelf(r)), e = a;
7365
7365
  }
@@ -7376,7 +7376,7 @@ class he {
7376
7376
  let a = !1;
7377
7377
  if (r) {
7378
7378
  const h = n.isModifyingCurrentTransform() ? i.getTransform() : null;
7379
- if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this, Et(i), ct.FILL, t), h) {
7379
+ if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this, St(i), ct.FILL, t), h) {
7380
7380
  const l = new Path2D();
7381
7381
  l.addPath(e, i.getTransform().invertSelf().multiplySelf(h)), e = l;
7382
7382
  }
@@ -7454,7 +7454,7 @@ class he {
7454
7454
  const i = this.commonObjs.get(e), n = this.current;
7455
7455
  if (!i)
7456
7456
  throw new Error(`Can't find font for ${e}`);
7457
- if (n.fontMatrix = i.fontMatrix || ms, (n.fontMatrix[0] === 0 || n.fontMatrix[3] === 0) && I("Invalid font matrix for font " + e), s < 0 ? (s = -s, n.fontDirection = -1) : n.fontDirection = 1, this.current.font = i, this.current.fontSize = s, i.isType3Font)
7457
+ if (n.fontMatrix = i.fontMatrix || ms, (n.fontMatrix[0] === 0 || n.fontMatrix[3] === 0) && R("Invalid font matrix for font " + e), s < 0 ? (s = -s, n.fontDirection = -1) : n.fontDirection = 1, this.current.font = i, this.current.fontSize = s, i.isType3Font)
7458
7458
  return;
7459
7459
  const r = i.loadedName || "sans-serif", a = i.systemFontInfo?.css || `"${r}", ${i.fallbackName}`;
7460
7460
  let o = "normal";
@@ -7557,17 +7557,17 @@ class he {
7557
7557
  const v = s.textRenderingMode & nt.FILL_STROKE_MASK, A = v === nt.FILL || v === nt.FILL_STROKE, x = v === nt.STROKE || v === nt.FILL_STROKE;
7558
7558
  if (A && s.patternFill) {
7559
7559
  r.save();
7560
- const C = s.fillColor.getPattern(r, this, Et(r), ct.FILL, t);
7560
+ const C = s.fillColor.getPattern(r, this, St(r), ct.FILL, t);
7561
7561
  w = X(r), r.restore(), r.fillStyle = C;
7562
7562
  }
7563
7563
  if (x && s.patternStroke) {
7564
7564
  r.save();
7565
- const C = s.strokeColor.getPattern(r, this, Et(r), ct.STROKE, t);
7565
+ const C = s.strokeColor.getPattern(r, this, St(r), ct.STROKE, t);
7566
7566
  y = X(r), r.restore(), r.strokeStyle = C;
7567
7567
  }
7568
7568
  let _ = s.lineWidth;
7569
- const S = s.textMatrixScale;
7570
- if (S === 0 || _ === 0 ? x && (_ = this.getSinglePixelWidth()) : _ /= S, a !== 1 && (r.scale(a, a), _ /= a), r.lineWidth = _, i.isInvalidPDFjsFont) {
7569
+ const E = s.textMatrixScale;
7570
+ if (E === 0 || _ === 0 ? x && (_ = this.getSinglePixelWidth()) : _ /= E, a !== 1 && (r.scale(a, a), _ /= a), r.lineWidth = _, i.isInvalidPDFjsFont) {
7571
7571
  const C = [];
7572
7572
  let H = 0;
7573
7573
  for (const N of e)
@@ -7580,21 +7580,21 @@ class he {
7580
7580
  s.x += H * b * d, r.restore(), this.compose();
7581
7581
  return;
7582
7582
  }
7583
- let E = 0, P;
7584
- for (P = 0; P < u; ++P) {
7585
- const C = e[P];
7583
+ let S = 0, M;
7584
+ for (M = 0; M < u; ++M) {
7585
+ const C = e[M];
7586
7586
  if (typeof C == "number") {
7587
- E += f * C * n / 1e3;
7587
+ S += f * C * n / 1e3;
7588
7588
  continue;
7589
7589
  }
7590
7590
  let H = !1;
7591
7591
  const V = (C.isSpace ? h : 0) + o, N = C.fontChar, Z = C.accent;
7592
- let k, R, U = C.width;
7592
+ let k, I, U = C.width;
7593
7593
  if (p) {
7594
7594
  const tt = C.vmetric || g, W = -(C.vmetric ? tt[1] : U * 0.5) * b, q = tt[2] * b;
7595
- U = tt ? -tt[0] : U, k = W / a, R = (E + q) / a;
7595
+ U = tt ? -tt[0] : U, k = W / a, I = (S + q) / a;
7596
7596
  } else
7597
- k = E / a, R = 0;
7597
+ k = S / a, I = 0;
7598
7598
  let ft;
7599
7599
  if (i.remeasure && U > 0) {
7600
7600
  ft = r.measureText(N);
@@ -7606,18 +7606,18 @@ class he {
7606
7606
  }
7607
7607
  if (this.contentVisible && (C.isInFont || i.missingFile)) {
7608
7608
  if (m && !Z)
7609
- r.fillText(N, k, R), this.dependencyTracker?.recordCharacterBBox(t, r, ft ? {
7609
+ r.fillText(N, k, I), this.dependencyTracker?.recordCharacterBBox(t, r, ft ? {
7610
7610
  bbox: null
7611
- } : i, n / a, k, R, () => ft ?? r.measureText(N));
7612
- else if (this.paintChar(t, N, k, R, w, y), Z) {
7613
- const tt = k + n * Z.offset.x / a, W = R - n * Z.offset.y / a;
7611
+ } : i, n / a, k, I, () => ft ?? r.measureText(N));
7612
+ else if (this.paintChar(t, N, k, I, w, y), Z) {
7613
+ const tt = k + n * Z.offset.x / a, W = I - n * Z.offset.y / a;
7614
7614
  this.paintChar(t, Z.fontChar, tt, W, w, y);
7615
7615
  }
7616
7616
  }
7617
7617
  const Dt = p ? U * b - V * l : U * b + V * l;
7618
- E += Dt, H && r.restore();
7618
+ S += Dt, H && r.restore();
7619
7619
  }
7620
- p ? s.y -= E : s.x += E * d, r.restore(), this.compose(), this.dependencyTracker?.recordShowTextOperation(t);
7620
+ p ? s.y -= S : s.x += S * d, r.restore(), this.compose(), this.dependencyTracker?.recordShowTextOperation(t);
7621
7621
  }
7622
7622
  showType3Text(t, e) {
7623
7623
  const s = this.ctx, i = this.current, n = i.font, r = i.fontSize, a = i.fontDirection, o = n.vertical ? 1 : -1, h = i.charSpacing, l = i.wordSpacing, d = i.textHScale * a, u = i.fontMatrix || ms, p = e.length, f = i.textRenderingMode === nt.INVISIBLE;
@@ -7632,7 +7632,7 @@ class he {
7632
7632
  continue;
7633
7633
  }
7634
7634
  const v = (b.isSpace ? l : 0) + h, A = n.charProcOperatorList[b.operatorListId];
7635
- A ? this.contentVisible && (this.save(), s.scale(r, r), s.transform(...u), this.executeOperatorList(A), this.restore()) : I(`Type3 character "${b.operatorListId}" is not available.`);
7635
+ A ? this.contentVisible && (this.save(), s.scale(r, r), s.transform(...u), this.executeOperatorList(A), this.restore()) : R(`Type3 character "${b.operatorListId}" is not available.`);
7636
7636
  const x = [b.width, 0];
7637
7637
  T.applyTransform(x, u), m = x[0] * r + v, s.translate(m, 0), i.x += m * d;
7638
7638
  }
@@ -7686,8 +7686,8 @@ class he {
7686
7686
  const s = this.ctx;
7687
7687
  this.save(t);
7688
7688
  const i = this._getPattern(t, e);
7689
- s.fillStyle = i.getPattern(s, this, Et(s), ct.SHADING, t);
7690
- const n = Et(s);
7689
+ s.fillStyle = i.getPattern(s, this, St(s), ct.SHADING, t);
7690
+ const n = St(s);
7691
7691
  if (n) {
7692
7692
  const {
7693
7693
  width: r,
@@ -7721,7 +7721,7 @@ class he {
7721
7721
  return;
7722
7722
  this.save(t), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
7723
7723
  const s = this.ctx;
7724
- e.isolated || Je("TODO: Support non-isolated groups."), e.knockout && I("Knockout groups not supported.");
7724
+ e.isolated || Je("TODO: Support non-isolated groups."), e.knockout && R("Knockout groups not supported.");
7725
7725
  const i = X(s);
7726
7726
  if (e.matrix && s.transform(...e.matrix), !e.bbox)
7727
7727
  throw new Error("Bounding box is required.");
@@ -7830,7 +7830,7 @@ class he {
7830
7830
  } = r, d = this.cachedCanvases.getCanvas("maskCanvas", o, h), u = d.context;
7831
7831
  u.save();
7832
7832
  const p = this.getObject(t, a, r);
7833
- gi(u, p), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this, Et(s), ct.FILL, t) : i, u.fillRect(0, 0, o, h), u.restore(), s.save(), s.transform(...l), s.scale(1, -1), $e(s, d.canvas, 0, 0, o, h, 0, -1, 1, 1), this.dependencyTracker?.recordBBox(t, s, 0, o, 0, h), s.restore();
7833
+ gi(u, p), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this, St(s), ct.FILL, t) : i, u.fillRect(0, 0, o, h), u.restore(), s.save(), s.transform(...l), s.scale(1, -1), $e(s, d.canvas, 0, 0, o, h, 0, -1, 1, 1), this.dependencyTracker?.recordBBox(t, s, 0, o, 0, h), s.restore();
7834
7834
  }
7835
7835
  this.compose(), this.dependencyTracker?.recordOperation(t);
7836
7836
  }
@@ -7839,7 +7839,7 @@ class he {
7839
7839
  return;
7840
7840
  const s = this.getObject(t, e);
7841
7841
  if (!s) {
7842
- I("Dependent image isn't ready yet");
7842
+ R("Dependent image isn't ready yet");
7843
7843
  return;
7844
7844
  }
7845
7845
  this.paintInlineImageXObject(t, s);
@@ -7849,7 +7849,7 @@ class he {
7849
7849
  return;
7850
7850
  const r = this.getObject(t, e);
7851
7851
  if (!r) {
7852
- I("Dependent image isn't ready yet");
7852
+ R("Dependent image isn't ready yet");
7853
7853
  return;
7854
7854
  }
7855
7855
  const a = r.width, o = r.height, h = [];
@@ -7894,7 +7894,7 @@ class he {
7894
7894
  const h = this.cachedCanvases.getCanvas("inlineImage", s, i).context;
7895
7895
  pi(h, e), a = this.applyTransferMapsToCanvas(h);
7896
7896
  }
7897
- const o = this._scaleImage(a, Et(n));
7897
+ const o = this._scaleImage(a, St(n));
7898
7898
  n.imageSmoothingEnabled = fi(X(n), e.interpolate), this.dependencyTracker?.resetBBox(t).recordBBox(t, n, 0, s, -i, 0).recordDependencies(t, At.imageXObject).recordOperation(t), $e(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, s, i), this.compose(), this.restore(t);
7899
7899
  }
7900
7900
  paintInlineImageXObjectGroup(t, e, s) {
@@ -8023,8 +8023,8 @@ class he {
8023
8023
  return !0;
8024
8024
  }
8025
8025
  }
8026
- for (const c in Ee)
8027
- he.prototype[c] !== void 0 && (he.prototype[Ee[c]] = he.prototype[c]);
8026
+ for (const c in Se)
8027
+ he.prototype[c] !== void 0 && (he.prototype[Se[c]] = he.prototype[c]);
8028
8028
  class qt {
8029
8029
  static #t = null;
8030
8030
  static #e = "";
@@ -8126,7 +8126,7 @@ class fr {
8126
8126
  else if (this.#e.has(n))
8127
8127
  r = this.#e.get(n).visible;
8128
8128
  else
8129
- return I(`Optional content group not found: ${n}`), !0;
8129
+ return R(`Optional content group not found: ${n}`), !0;
8130
8130
  switch (s) {
8131
8131
  case "And":
8132
8132
  if (!r)
@@ -8150,14 +8150,14 @@ class fr {
8150
8150
  if (!t)
8151
8151
  return Je("Optional content group not defined."), !0;
8152
8152
  if (t.type === "OCG")
8153
- return this.#e.has(t.id) ? this.#e.get(t.id).visible : (I(`Optional content group not found: ${t.id}`), !0);
8153
+ return this.#e.has(t.id) ? this.#e.get(t.id).visible : (R(`Optional content group not found: ${t.id}`), !0);
8154
8154
  if (t.type === "OCMD") {
8155
8155
  if (t.expression)
8156
8156
  return this.#a(t.expression);
8157
8157
  if (!t.policy || t.policy === "AnyOn") {
8158
8158
  for (const e of t.ids) {
8159
8159
  if (!this.#e.has(e))
8160
- return I(`Optional content group not found: ${e}`), !0;
8160
+ return R(`Optional content group not found: ${e}`), !0;
8161
8161
  if (this.#e.get(e).visible)
8162
8162
  return !0;
8163
8163
  }
@@ -8165,7 +8165,7 @@ class fr {
8165
8165
  } else if (t.policy === "AllOn") {
8166
8166
  for (const e of t.ids) {
8167
8167
  if (!this.#e.has(e))
8168
- return I(`Optional content group not found: ${e}`), !0;
8168
+ return R(`Optional content group not found: ${e}`), !0;
8169
8169
  if (!this.#e.get(e).visible)
8170
8170
  return !1;
8171
8171
  }
@@ -8173,7 +8173,7 @@ class fr {
8173
8173
  } else if (t.policy === "AnyOff") {
8174
8174
  for (const e of t.ids) {
8175
8175
  if (!this.#e.has(e))
8176
- return I(`Optional content group not found: ${e}`), !0;
8176
+ return R(`Optional content group not found: ${e}`), !0;
8177
8177
  if (!this.#e.get(e).visible)
8178
8178
  return !0;
8179
8179
  }
@@ -8181,20 +8181,20 @@ class fr {
8181
8181
  } else if (t.policy === "AllOff") {
8182
8182
  for (const e of t.ids) {
8183
8183
  if (!this.#e.has(e))
8184
- return I(`Optional content group not found: ${e}`), !0;
8184
+ return R(`Optional content group not found: ${e}`), !0;
8185
8185
  if (this.#e.get(e).visible)
8186
8186
  return !1;
8187
8187
  }
8188
8188
  return !0;
8189
8189
  }
8190
- return I(`Unknown optional content policy ${t.policy}.`), !0;
8190
+ return R(`Unknown optional content policy ${t.policy}.`), !0;
8191
8191
  }
8192
- return I(`Unknown group type ${t.type}.`), !0;
8192
+ return R(`Unknown group type ${t.type}.`), !0;
8193
8193
  }
8194
8194
  setVisibility(t, e = !0, s = !0) {
8195
8195
  const i = this.#e.get(t);
8196
8196
  if (!i) {
8197
- I(`Optional content group not found: ${t}`);
8197
+ R(`Optional content group not found: ${t}`);
8198
8198
  return;
8199
8199
  }
8200
8200
  if (s && e && i.rbGroups.length)
@@ -8258,7 +8258,7 @@ class mr {
8258
8258
  disableRange: e = !1,
8259
8259
  disableStream: s = !1
8260
8260
  }) {
8261
- B(t, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
8261
+ O(t, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
8262
8262
  const {
8263
8263
  length: i,
8264
8264
  initialData: n,
@@ -8298,7 +8298,7 @@ class mr {
8298
8298
  const i = this._rangeReaders.some(function(n) {
8299
8299
  return n._begin !== t ? !1 : (n._enqueue(s), !0);
8300
8300
  });
8301
- B(i, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
8301
+ O(i, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
8302
8302
  }
8303
8303
  }
8304
8304
  get _progressiveDataLength() {
@@ -8320,7 +8320,7 @@ class mr {
8320
8320
  e >= 0 && this._rangeReaders.splice(e, 1);
8321
8321
  }
8322
8322
  getFullReader() {
8323
- B(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
8323
+ O(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
8324
8324
  const t = this._queuedChunks;
8325
8325
  return this._queuedChunks = null, new br(this, t, this._progressiveDone, this._contentDispositionFilename);
8326
8326
  }
@@ -8339,7 +8339,7 @@ class mr {
8339
8339
  }
8340
8340
  class br {
8341
8341
  constructor(t, e, s = !1, i = null) {
8342
- this._stream = t, this._done = s || !1, this._filename = Is(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
8342
+ this._stream = t, this._done = s || !1, this._filename = Rs(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
8343
8343
  for (const n of this._queuedChunks)
8344
8344
  this._loaded += n.byteLength;
8345
8345
  this._requests = [], this._headersReady = Promise.resolve(), t._fullRequestReader = this, this.onProgress = null;
@@ -8470,7 +8470,7 @@ function wr(c) {
8470
8470
  try {
8471
8471
  const u = new TextDecoder(l, {
8472
8472
  fatal: !0
8473
- }), p = Me(d);
8473
+ }), p = Pe(d);
8474
8474
  d = u.decode(p), t = !1;
8475
8475
  } catch {
8476
8476
  }
@@ -8533,7 +8533,7 @@ function wr(c) {
8533
8533
  }
8534
8534
  return "";
8535
8535
  }
8536
- function Oi(c, t) {
8536
+ function Bi(c, t) {
8537
8537
  const e = new Headers();
8538
8538
  if (!c || !t || typeof t != "object")
8539
8539
  return e;
@@ -8546,7 +8546,7 @@ function Oi(c, t) {
8546
8546
  function es(c) {
8547
8547
  return URL.parse(c)?.origin ?? null;
8548
8548
  }
8549
- function Bi({
8549
+ function Oi({
8550
8550
  responseHeaders: c,
8551
8551
  isHttp: t,
8552
8552
  rangeChunkSize: e,
@@ -8567,12 +8567,12 @@ function Hi(c) {
8567
8567
  e = decodeURIComponent(e);
8568
8568
  } catch {
8569
8569
  }
8570
- if (Is(e))
8570
+ if (Rs(e))
8571
8571
  return e;
8572
8572
  }
8573
8573
  return null;
8574
8574
  }
8575
- function Ie(c, t) {
8575
+ function Re(c, t) {
8576
8576
  return new We(`Unexpected server response (${c}) while retrieving PDF "${t}".`, c, c === 404 || c === 0 && t.startsWith("file:"));
8577
8577
  }
8578
8578
  function $i(c) {
@@ -8589,18 +8589,18 @@ function zi(c, t, e) {
8589
8589
  };
8590
8590
  }
8591
8591
  function Ui(c) {
8592
- return c instanceof Uint8Array ? c.buffer : c instanceof ArrayBuffer ? c : (I(`getArrayBuffer - unexpected data format: ${c}`), new Uint8Array(c).buffer);
8592
+ return c instanceof Uint8Array ? c.buffer : c instanceof ArrayBuffer ? c : (R(`getArrayBuffer - unexpected data format: ${c}`), new Uint8Array(c).buffer);
8593
8593
  }
8594
8594
  class vr {
8595
8595
  _responseOrigin = null;
8596
8596
  constructor(t) {
8597
- this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = Oi(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
8597
+ this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = Bi(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
8598
8598
  }
8599
8599
  get _progressiveDataLength() {
8600
8600
  return this._fullRequestReader?._loaded ?? 0;
8601
8601
  }
8602
8602
  getFullReader() {
8603
- return B(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Ar(this), this._fullRequestReader;
8603
+ return O(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Ar(this), this._fullRequestReader;
8604
8604
  }
8605
8605
  getRangeReader(t, e) {
8606
8606
  if (e <= this._progressiveDataLength)
@@ -8622,12 +8622,12 @@ class Ar {
8622
8622
  const s = new Headers(t.headers), i = e.url;
8623
8623
  fetch(i, zi(s, this._withCredentials, this._abortController)).then((n) => {
8624
8624
  if (t._responseOrigin = es(n.url), !$i(n.status))
8625
- throw Ie(n.status, i);
8625
+ throw Re(n.status, i);
8626
8626
  this._reader = n.body.getReader(), this._headersCapability.resolve();
8627
8627
  const r = n.headers, {
8628
8628
  allowRangeRequests: a,
8629
8629
  suggestedLength: o
8630
- } = Bi({
8630
+ } = Oi({
8631
8631
  responseHeaders: r,
8632
8632
  isHttp: t.isHttp,
8633
8633
  rangeChunkSize: this._rangeChunkSize,
@@ -8685,7 +8685,7 @@ class xr {
8685
8685
  if (o !== t._responseOrigin)
8686
8686
  throw new Error(`Expected range response-origin "${o}" to match "${t._responseOrigin}".`);
8687
8687
  if (!$i(a.status))
8688
- throw Ie(a.status, r);
8688
+ throw Re(a.status, r);
8689
8689
  this._readCapability.resolve(), this._reader = a.body.getReader();
8690
8690
  }).catch(this._readCapability.reject), this.onProgress = null;
8691
8691
  }
@@ -8715,16 +8715,16 @@ class xr {
8715
8715
  const us = 200, ps = 206;
8716
8716
  function _r(c) {
8717
8717
  const t = c.response;
8718
- return typeof t != "string" ? t : Me(t).buffer;
8718
+ return typeof t != "string" ? t : Pe(t).buffer;
8719
8719
  }
8720
- class Sr {
8720
+ class Er {
8721
8721
  _responseOrigin = null;
8722
8722
  constructor({
8723
8723
  url: t,
8724
8724
  httpHeaders: e,
8725
8725
  withCredentials: s
8726
8726
  }) {
8727
- this.url = t, this.isHttp = /^https?:/i.test(t), this.headers = Oi(this.isHttp, e), this.withCredentials = s || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
8727
+ this.url = t, this.isHttp = /^https?:/i.test(t), this.headers = Bi(this.isHttp, e), this.withCredentials = s || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
8728
8728
  }
8729
8729
  request(t) {
8730
8730
  const e = new XMLHttpRequest(), s = this.currXhrId++, i = this.pendingRequests[s] = {
@@ -8733,7 +8733,7 @@ class Sr {
8733
8733
  e.open("GET", this.url), e.withCredentials = this.withCredentials;
8734
8734
  for (const [n, r] of this.headers)
8735
8735
  e.setRequestHeader(n, r);
8736
- return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), i.expectedStatus = ps) : i.expectedStatus = us, e.responseType = "arraybuffer", B(t.onError, "Expected `onError` callback to be provided."), e.onerror = () => {
8736
+ return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), i.expectedStatus = ps) : i.expectedStatus = us, e.responseType = "arraybuffer", O(t.onError, "Expected `onError` callback to be provided."), e.onerror = () => {
8737
8737
  t.onError(e.status);
8738
8738
  }, e.onreadystatechange = this.onStateChange.bind(this, s), e.onprogress = this.onProgress.bind(this, s), i.onHeadersReceived = t.onHeadersReceived, i.onDone = t.onDone, i.onError = t.onError, i.onProgress = t.onProgress, e.send(null), s;
8739
8739
  }
@@ -8763,7 +8763,7 @@ class Sr {
8763
8763
  o ? s.onDone({
8764
8764
  begin: parseInt(o[1], 10),
8765
8765
  chunk: r
8766
- }) : (I('Missing or invalid "Content-Range" header.'), s.onError(0));
8766
+ }) : (R('Missing or invalid "Content-Range" header.'), s.onError(0));
8767
8767
  } else r ? s.onDone({
8768
8768
  begin: 0,
8769
8769
  chunk: r
@@ -8780,16 +8780,16 @@ class Sr {
8780
8780
  delete this.pendingRequests[t], e.abort();
8781
8781
  }
8782
8782
  }
8783
- class Er {
8783
+ class Sr {
8784
8784
  constructor(t) {
8785
- this._source = t, this._manager = new Sr(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
8785
+ this._source = t, this._manager = new Er(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
8786
8786
  }
8787
8787
  _onRangeRequestReaderClosed(t) {
8788
8788
  const e = this._rangeRequestReaders.indexOf(t);
8789
8789
  e >= 0 && this._rangeRequestReaders.splice(e, 1);
8790
8790
  }
8791
8791
  getFullReader() {
8792
- return B(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Cr(this._manager, this._source), this._fullRequestReader;
8792
+ return O(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Cr(this._manager, this._source), this._fullRequestReader;
8793
8793
  }
8794
8794
  getRangeReader(t, e) {
8795
8795
  const s = new Tr(this._manager, t, e);
@@ -8819,7 +8819,7 @@ class Cr {
8819
8819
  }) : []), {
8820
8820
  allowRangeRequests: n,
8821
8821
  suggestedLength: r
8822
- } = Bi({
8822
+ } = Oi({
8823
8823
  responseHeaders: i,
8824
8824
  isHttp: this._manager.isHttp,
8825
8825
  rangeChunkSize: this._rangeChunkSize,
@@ -8841,7 +8841,7 @@ class Cr {
8841
8841
  }
8842
8842
  }
8843
8843
  _onError(t) {
8844
- this._storedError = Ie(t, this._url), this._headersCapability.reject(this._storedError);
8844
+ this._storedError = Re(t, this._url), this._headersCapability.reject(this._storedError);
8845
8845
  for (const e of this._requests)
8846
8846
  e.reject(this._storedError);
8847
8847
  this._requests.length = 0, this._cachedChunks.length = 0;
@@ -8925,7 +8925,7 @@ class Tr {
8925
8925
  this._requests.length = 0, this._close();
8926
8926
  }
8927
8927
  _onError(t) {
8928
- this._storedError ??= Ie(t, this._url);
8928
+ this._storedError ??= Re(t, this._url);
8929
8929
  for (const e of this._requests)
8930
8930
  e.reject(this._storedError);
8931
8931
  this._requests.length = 0, this._queuedChunk = null;
@@ -8966,27 +8966,27 @@ class Tr {
8966
8966
  this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
8967
8967
  }
8968
8968
  }
8969
- const Mr = /^[a-z][a-z0-9\-+.]+:/i;
8970
- function Pr(c) {
8971
- if (Mr.test(c))
8969
+ const Pr = /^[a-z][a-z0-9\-+.]+:/i;
8970
+ function Mr(c) {
8971
+ if (Pr.test(c))
8972
8972
  return new URL(c);
8973
8973
  const t = process.getBuiltinModule("url");
8974
8974
  return new URL(t.pathToFileURL(c));
8975
8975
  }
8976
8976
  class kr {
8977
8977
  constructor(t) {
8978
- this.source = t, this.url = Pr(t.url), B(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
8978
+ this.source = t, this.url = Mr(t.url), O(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
8979
8979
  }
8980
8980
  get _progressiveDataLength() {
8981
8981
  return this._fullRequestReader?._loaded ?? 0;
8982
8982
  }
8983
8983
  getFullReader() {
8984
- return B(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Dr(this), this._fullRequestReader;
8984
+ return O(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Dr(this), this._fullRequestReader;
8985
8985
  }
8986
8986
  getRangeReader(t, e) {
8987
8987
  if (e <= this._progressiveDataLength)
8988
8988
  return null;
8989
- const s = new Rr(this, t, e);
8989
+ const s = new Ir(this, t, e);
8990
8990
  return this._rangeRequestReaders.push(s), s;
8991
8991
  }
8992
8992
  cancelAllRequests(t) {
@@ -9004,7 +9004,7 @@ class Dr {
9004
9004
  s.promises.lstat(this._url).then((i) => {
9005
9005
  this._contentLength = i.size, this._setReadableStream(s.createReadStream(this._url)), this._headersCapability.resolve();
9006
9006
  }, (i) => {
9007
- i.code === "ENOENT" && (i = Ie(0, this._url.href)), this._storedError = i, this._headersCapability.reject(i);
9007
+ i.code === "ENOENT" && (i = Re(0, this._url.href)), this._storedError = i, this._headersCapability.reject(i);
9008
9008
  });
9009
9009
  }
9010
9010
  get headersReady() {
@@ -9059,7 +9059,7 @@ class Dr {
9059
9059
  }), !this._isStreamingSupported && this._isRangeSupported && this._error(new $t("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
9060
9060
  }
9061
9061
  }
9062
- class Rr {
9062
+ class Ir {
9063
9063
  constructor(t, e, s) {
9064
9064
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
9065
9065
  const i = t.source;
@@ -9158,7 +9158,7 @@ class Vi {
9158
9158
  }
9159
9159
  }
9160
9160
  }
9161
- const Ir = 1e5, bi = 30;
9161
+ const Rr = 1e5, bi = 30;
9162
9162
  class yt {
9163
9163
  #t = Promise.withResolvers();
9164
9164
  #e = null;
@@ -9180,7 +9180,7 @@ class yt {
9180
9180
  #b = null;
9181
9181
  static #w = /* @__PURE__ */ new Map();
9182
9182
  static #y = /* @__PURE__ */ new Map();
9183
- static #E = /* @__PURE__ */ new WeakMap();
9183
+ static #S = /* @__PURE__ */ new WeakMap();
9184
9184
  static #_ = null;
9185
9185
  static #A = /* @__PURE__ */ new Set();
9186
9186
  constructor({
@@ -9209,7 +9209,7 @@ class yt {
9209
9209
  pageX: r,
9210
9210
  pageY: a
9211
9211
  } = s.rawDims;
9212
- this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_), Wt(e, s), this.#t.promise.finally(() => {
9212
+ this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#M(), e.style.setProperty("--min-font-size", yt.#_), Wt(e, s), this.#t.promise.finally(() => {
9213
9213
  yt.#A.delete(this), this.#r = null, this.#p = null;
9214
9214
  }).catch(() => {
9215
9215
  });
@@ -9251,7 +9251,7 @@ class yt {
9251
9251
  ctx: yt.#k(this.#a)
9252
9252
  };
9253
9253
  for (const r of this.#c)
9254
- n.properties = this.#g.get(r), n.div = r, this.#S(n);
9254
+ n.properties = this.#g.get(r), n.div = r, this.#E(n);
9255
9255
  }
9256
9256
  }
9257
9257
  cancel() {
@@ -9271,8 +9271,8 @@ class yt {
9271
9271
  this.#r.ctx ??= yt.#k(this.#a);
9272
9272
  const e = this.#c, s = this.#m;
9273
9273
  for (const i of t) {
9274
- if (e.length > Ir) {
9275
- I("Ignoring additional textDivs for performance reasons."), this.#i = !0;
9274
+ if (e.length > Rr) {
9275
+ R("Ignoring additional textDivs for performance reasons."), this.#i = !0;
9276
9276
  return;
9277
9277
  }
9278
9278
  if (i.str === void 0) {
@@ -9300,7 +9300,7 @@ class yt {
9300
9300
  r.vertical && (n += Math.PI / 2);
9301
9301
  let a = this.#s && r.fontSubstitution || r.fontFamily;
9302
9302
  a = yt.fontFamilyMap.get(a) || a;
9303
- const o = Math.hypot(i[2], i[3]), h = o * yt.#O(a, r, this.#a);
9303
+ const o = Math.hypot(i[2], i[3]), h = o * yt.#B(a, r, this.#a);
9304
9304
  let l, d;
9305
9305
  n === 0 ? (l = i[4], d = i[5] - h) : (l = i[4] + h * Math.sin(n), d = i[5] - h * Math.cos(n));
9306
9306
  const u = e.style;
@@ -9312,12 +9312,12 @@ class yt {
9312
9312
  const f = Math.abs(t.transform[0]), g = Math.abs(t.transform[3]);
9313
9313
  f !== g && Math.max(f, g) / Math.min(f, g) > 1.5 && (p = !0);
9314
9314
  }
9315
- if (p && (s.canvasWidth = r.vertical ? t.height : t.width), this.#g.set(e, s), this.#r.div = e, this.#r.properties = s, this.#S(this.#r), s.hasText && this.#e.append(e), s.hasEOL) {
9315
+ if (p && (s.canvasWidth = r.vertical ? t.height : t.width), this.#g.set(e, s), this.#r.div = e, this.#r.properties = s, this.#E(this.#r), s.hasText && this.#e.append(e), s.hasEOL) {
9316
9316
  const f = document.createElement("br");
9317
9317
  f.setAttribute("role", "presentation"), this.#e.append(f);
9318
9318
  }
9319
9319
  }
9320
- #S(t) {
9320
+ #E(t) {
9321
9321
  const {
9322
9322
  div: e,
9323
9323
  properties: s,
@@ -9332,7 +9332,7 @@ class yt {
9332
9332
  canvasWidth: a,
9333
9333
  fontSize: o
9334
9334
  } = s;
9335
- yt.#M(i, o * this.#d, r);
9335
+ yt.#P(i, o * this.#d, r);
9336
9336
  const {
9337
9337
  width: h
9338
9338
  } = i.measureText(e.textContent);
@@ -9357,33 +9357,33 @@ class yt {
9357
9357
  s.className = "hiddenCanvasElement", s.lang = t, document.body.append(s), e = s.getContext("2d", {
9358
9358
  alpha: !1,
9359
9359
  willReadFrequently: !0
9360
- }), this.#y.set(t, e), this.#E.set(e, {
9360
+ }), this.#y.set(t, e), this.#S.set(e, {
9361
9361
  size: 0,
9362
9362
  family: ""
9363
9363
  });
9364
9364
  }
9365
9365
  return e;
9366
9366
  }
9367
- static #M(t, e, s) {
9368
- const i = this.#E.get(t);
9367
+ static #P(t, e, s) {
9368
+ const i = this.#S.get(t);
9369
9369
  e === i.size && s === i.family || (t.font = `${e}px ${s}`, i.size = e, i.family = s);
9370
9370
  }
9371
- static #P() {
9371
+ static #M() {
9372
9372
  if (this.#_ !== null)
9373
9373
  return;
9374
9374
  const t = document.createElement("div");
9375
9375
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#_ = t.getBoundingClientRect().height, t.remove();
9376
9376
  }
9377
- static #O(t, e, s) {
9377
+ static #B(t, e, s) {
9378
9378
  const i = this.#w.get(t);
9379
9379
  if (i)
9380
9380
  return i;
9381
9381
  const n = this.#k(s);
9382
- n.canvas.width = n.canvas.height = bi, this.#M(n, bi, t);
9382
+ n.canvas.width = n.canvas.height = bi, this.#P(n, bi, t);
9383
9383
  const r = n.measureText(""), a = r.fontBoundingBoxAscent, o = Math.abs(r.fontBoundingBoxDescent);
9384
9384
  n.canvas.width = n.canvas.height = 0;
9385
9385
  let h = 0.8;
9386
- return a ? h = a / (a + o) : (at.platform.isFirefox && I("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), e.ascent ? h = e.ascent : e.descent && (h = 1 + e.descent)), this.#w.set(t, h), h;
9386
+ return a ? h = a / (a + o) : (at.platform.isFirefox && R("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), e.ascent ? h = e.ascent : e.descent && (h = 1 + e.descent)), this.#w.set(t, h), h;
9387
9387
  }
9388
9388
  }
9389
9389
  const Lr = 100;
@@ -9397,7 +9397,7 @@ function Gi(c = {}) {
9397
9397
  docId: e
9398
9398
  } = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof ji ? c.range : null, h = Number.isInteger(c.rangeChunkSize) && c.rangeChunkSize > 0 ? c.rangeChunkSize : 2 ** 16;
9399
9399
  let l = c.worker instanceof Cs ? c.worker : null;
9400
- const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1, S = typeof c.isOffscreenCanvasSupported == "boolean" ? c.isOffscreenCanvasSupported : !dt, E = typeof c.isImageDecoderSupported == "boolean" ? c.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), P = Number.isInteger(c.canvasMaxAreaInBytes) ? c.canvasMaxAreaInBytes : -1, C = typeof c.disableFontFace == "boolean" ? c.disableFontFace : dt, H = c.fontExtraProperties === !0, V = c.enableXfa === !0, N = c.ownerDocument || globalThis.document, Z = c.disableRange === !0, k = c.disableStream === !0, R = c.disableAutoFetch === !0, U = c.pdfBug === !0, ft = c.CanvasFactory || (dt ? Yn : Wn), Dt = c.FilterFactory || (dt ? Xn : qn), tt = c.enableHWA === !0, W = c.useWasm !== !1, q = o ? o.length : c.length ?? NaN, Ut = typeof c.useSystemFonts == "boolean" ? c.useSystemFonts : !dt && !C, Nt = typeof c.useWorkerFetch == "boolean" ? c.useWorkerFetch : !!(g === ii && w === ni && v === ri && p && m && y && we(p, document.baseURI) && we(m, document.baseURI) && we(y, document.baseURI)), Ot = null;
9400
+ const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1, E = typeof c.isOffscreenCanvasSupported == "boolean" ? c.isOffscreenCanvasSupported : !dt, S = typeof c.isImageDecoderSupported == "boolean" ? c.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(c.canvasMaxAreaInBytes) ? c.canvasMaxAreaInBytes : -1, C = typeof c.disableFontFace == "boolean" ? c.disableFontFace : dt, H = c.fontExtraProperties === !0, V = c.enableXfa === !0, N = c.ownerDocument || globalThis.document, Z = c.disableRange === !0, k = c.disableStream === !0, I = c.disableAutoFetch === !0, U = c.pdfBug === !0, ft = c.CanvasFactory || (dt ? Yn : Wn), Dt = c.FilterFactory || (dt ? Xn : qn), tt = c.enableHWA === !0, W = c.useWasm !== !1, q = o ? o.length : c.length ?? NaN, Ut = typeof c.useSystemFonts == "boolean" ? c.useSystemFonts : !dt && !C, Nt = typeof c.useWorkerFetch == "boolean" ? c.useWorkerFetch : !!(g === ii && w === ni && v === ri && p && m && y && we(p, document.baseURI) && we(m, document.baseURI) && we(y, document.baseURI)), Bt = null;
9401
9401
  gn(d);
9402
9402
  const et = {
9403
9403
  canvasFactory: new ft({
@@ -9428,7 +9428,7 @@ function Gi(c = {}) {
9428
9428
  apiVersion: "5.4.530",
9429
9429
  data: i,
9430
9430
  password: a,
9431
- disableAutoFetch: R,
9431
+ disableAutoFetch: I,
9432
9432
  rangeChunkSize: h,
9433
9433
  length: q,
9434
9434
  docBaseUrl: u,
@@ -9438,9 +9438,9 @@ function Gi(c = {}) {
9438
9438
  disableFontFace: C,
9439
9439
  ignoreErrors: A,
9440
9440
  isEvalSupported: _,
9441
- isOffscreenCanvasSupported: S,
9442
- isImageDecoderSupported: E,
9443
- canvasMaxAreaInBytes: P,
9441
+ isOffscreenCanvasSupported: E,
9442
+ isImageDecoderSupported: S,
9443
+ canvasMaxAreaInBytes: M,
9444
9444
  fontExtraProperties: H,
9445
9445
  useSystemFonts: Ut,
9446
9446
  useWasm: W,
@@ -9453,9 +9453,9 @@ function Gi(c = {}) {
9453
9453
  }, ue = {
9454
9454
  ownerDocument: N,
9455
9455
  pdfBug: U,
9456
- styleElement: Ot,
9456
+ styleElement: Bt,
9457
9457
  loadingParams: {
9458
- disableAutoFetch: R,
9458
+ disableAutoFetch: I,
9459
9459
  enableXfa: V
9460
9460
  }
9461
9461
  };
@@ -9474,7 +9474,7 @@ function Gi(c = {}) {
9474
9474
  else if (!i) {
9475
9475
  if (!s)
9476
9476
  throw new Error("getDocument - no `url` parameter provided.");
9477
- const ns = we(s) ? vr : dt ? kr : Er;
9477
+ const ns = we(s) ? vr : dt ? kr : Sr;
9478
9478
  is = new ns({
9479
9479
  url: s,
9480
9480
  length: q,
@@ -9490,7 +9490,7 @@ function Gi(c = {}) {
9490
9490
  throw new Error("Loading aborted");
9491
9491
  if (l.destroyed)
9492
9492
  throw new Error("Worker was destroyed");
9493
- const qs = new ve(e, ns, l.port), rn = new Or(qs, t, is, ue, et, tt);
9493
+ const qs = new ve(e, ns, l.port), rn = new Br(qs, t, is, ue, et, tt);
9494
9494
  t._transport = rn, qs.send("Ready", null);
9495
9495
  });
9496
9496
  }).catch(t._capability.reject), t;
@@ -9752,7 +9752,7 @@ class Nr {
9752
9752
  canvas: e = t.canvas,
9753
9753
  viewport: s,
9754
9754
  intent: i = "display",
9755
- annotationMode: n = Bt.ENABLE,
9755
+ annotationMode: n = Ot.ENABLE,
9756
9756
  transform: r = null,
9757
9757
  background: a = null,
9758
9758
  optionalContentConfigPromise: o = null,
@@ -9778,14 +9778,14 @@ class Nr {
9778
9778
  lastChunk: !1,
9779
9779
  separateAnnots: null
9780
9780
  }, this._stats?.time("Page Request"), this._pumpOperatorList(g));
9781
- const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (E) => {
9781
+ const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (S) => {
9782
9782
  if (w.renderTasks.delete(_), A) {
9783
- const P = _.gfx?.dependencyTracker.take();
9784
- P && (_.stepper && _.stepper.setOperatorBBoxes(P, _.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = P));
9783
+ const M = _.gfx?.dependencyTracker.take();
9784
+ M && (_.stepper && _.stepper.setOperatorBBoxes(M, _.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = M));
9785
9785
  }
9786
- y && (this.#t = !0), this.#e(), E ? (_.capability.reject(E), this._abortOperatorList({
9786
+ y && (this.#t = !0), this.#e(), S ? (_.capability.reject(S), this._abortOperatorList({
9787
9787
  intentState: w,
9788
- reason: E instanceof Error ? E : new Error(E)
9788
+ reason: S instanceof Error ? S : new Error(S)
9789
9789
  })) : _.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
9790
9790
  }, _ = new re({
9791
9791
  callback: x,
@@ -9811,23 +9811,23 @@ class Nr {
9811
9811
  operationsFilter: f
9812
9812
  });
9813
9813
  (w.renderTasks ||= /* @__PURE__ */ new Set()).add(_);
9814
- const S = _.task;
9815
- return Promise.all([w.displayReadyCapability.promise, o]).then(([E, P]) => {
9814
+ const E = _.task;
9815
+ return Promise.all([w.displayReadyCapability.promise, o]).then(([S, M]) => {
9816
9816
  if (this.destroyed) {
9817
9817
  x();
9818
9818
  return;
9819
9819
  }
9820
- if (this._stats?.time("Rendering"), !(P.renderingIntent & b))
9820
+ if (this._stats?.time("Rendering"), !(M.renderingIntent & b))
9821
9821
  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
9822
9822
  _.initializeGraphics({
9823
- transparency: E,
9824
- optionalContentConfig: P
9823
+ transparency: S,
9824
+ optionalContentConfig: M
9825
9825
  }), _.operatorListChanged();
9826
- }).catch(x), S;
9826
+ }).catch(x), E;
9827
9827
  }
9828
9828
  getOperatorList({
9829
9829
  intent: t = "display",
9830
- annotationMode: e = Bt.ENABLE,
9830
+ annotationMode: e = Ot.ENABLE,
9831
9831
  printAnnotationStorage: s = null,
9832
9832
  isEditing: i = !1
9833
9833
  } = {}) {
@@ -9984,7 +9984,7 @@ class Nr {
9984
9984
  if (t.streamReaderCancelTimeout && (clearTimeout(t.streamReaderCancelTimeout), t.streamReaderCancelTimeout = null), !s) {
9985
9985
  if (t.renderTasks.size > 0)
9986
9986
  return;
9987
- if (e instanceof Rs) {
9987
+ if (e instanceof Is) {
9988
9988
  let i = Lr;
9989
9989
  e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
9990
9990
  t.streamReaderCancelTimeout = null, this._abortOperatorList({
@@ -10011,19 +10011,19 @@ class Nr {
10011
10011
  return this._stats;
10012
10012
  }
10013
10013
  }
10014
- var Gt, Pt, Ht, le, gs, Jt, ne, St, Ue, Wi, qi, me, _e, Xe;
10014
+ var Gt, Mt, Ht, le, gs, Jt, ne, Et, Ue, Wi, qi, me, _e, Xe;
10015
10015
  const rt = class Ae {
10016
10016
  constructor({
10017
10017
  name: t = null,
10018
10018
  port: e = null,
10019
10019
  verbosity: s = fn()
10020
10020
  } = {}) {
10021
- if (Ft(this, St), Ft(this, Gt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this, le, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
10021
+ if (Ft(this, Et), Ft(this, Gt, Promise.withResolvers()), Ft(this, Mt, null), Ft(this, Ht, null), Ft(this, le, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
10022
10022
  if (Y(Ae, ne).has(e))
10023
10023
  throw new Error("Cannot use more than one PDFWorker per port.");
10024
- Y(Ae, ne).set(e, this), It(this, St, Wi).call(this, e);
10024
+ Y(Ae, ne).set(e, this), Rt(this, Et, Wi).call(this, e);
10025
10025
  } else
10026
- It(this, St, qi).call(this);
10026
+ Rt(this, Et, qi).call(this);
10027
10027
  }
10028
10028
  get promise() {
10029
10029
  return Y(this, Gt).promise;
@@ -10032,10 +10032,10 @@ const rt = class Ae {
10032
10032
  return Y(this, Ht);
10033
10033
  }
10034
10034
  get messageHandler() {
10035
- return Y(this, Pt);
10035
+ return Y(this, Mt);
10036
10036
  }
10037
10037
  destroy() {
10038
- this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Pt)?.destroy(), mt(this, Pt, null);
10038
+ this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Mt)?.destroy(), mt(this, Mt, null);
10039
10039
  }
10040
10040
  static create(t) {
10041
10041
  const e = Y(this, ne).get(t?.port);
@@ -10059,16 +10059,16 @@ const rt = class Ae {
10059
10059
  )).WorkerMessageHandler)());
10060
10060
  }
10061
10061
  };
10062
- Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), Ue = function() {
10063
- Y(this, Gt).resolve(), Y(this, Pt).send("configure", {
10062
+ Gt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), Ue = function() {
10063
+ Y(this, Gt).resolve(), Y(this, Mt).send("configure", {
10064
10064
  verbosity: this.verbosity
10065
10065
  });
10066
10066
  }, Wi = function(c) {
10067
- mt(this, Ht, c), mt(this, Pt, new ve("main", "worker", c)), Y(this, Pt).on("ready", () => {
10068
- }), It(this, St, Ue).call(this);
10067
+ mt(this, Ht, c), mt(this, Mt, new ve("main", "worker", c)), Y(this, Mt).on("ready", () => {
10068
+ }), Rt(this, Et, Ue).call(this);
10069
10069
  }, qi = function() {
10070
10070
  if (Y(rt, Jt) || Y(rt, _e, Xe)) {
10071
- It(this, St, me).call(this);
10071
+ Rt(this, Et, me).call(this);
10072
10072
  return;
10073
10073
  }
10074
10074
  let {
@@ -10079,7 +10079,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10079
10079
  const t = new Worker(c, {
10080
10080
  type: "module"
10081
10081
  }), e = new ve("main", "worker", t), s = () => {
10082
- i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Gt).reject(new Error("Worker was destroyed")) : It(this, St, me).call(this);
10082
+ i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Gt).reject(new Error("Worker was destroyed")) : Rt(this, Et, me).call(this);
10083
10083
  }, i = new AbortController();
10084
10084
  t.addEventListener("error", () => {
10085
10085
  Y(this, le) || s();
@@ -10090,7 +10090,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10090
10090
  s();
10091
10091
  return;
10092
10092
  }
10093
- mt(this, Pt, e), mt(this, Ht, t), mt(this, le, t), It(this, St, Ue).call(this);
10093
+ mt(this, Mt, e), mt(this, Ht, t), mt(this, le, t), Rt(this, Et, Ue).call(this);
10094
10094
  }), e.on("ready", (r) => {
10095
10095
  if (i.abort(), this.destroyed) {
10096
10096
  s();
@@ -10099,7 +10099,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10099
10099
  try {
10100
10100
  n();
10101
10101
  } catch {
10102
- It(this, St, me).call(this);
10102
+ Rt(this, Et, me).call(this);
10103
10103
  }
10104
10104
  });
10105
10105
  const n = () => {
@@ -10111,9 +10111,9 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10111
10111
  } catch {
10112
10112
  Je("The worker has been disabled.");
10113
10113
  }
10114
- It(this, St, me).call(this);
10114
+ Rt(this, Et, me).call(this);
10115
10115
  }, me = function() {
10116
- Y(rt, Jt) || (I("Setting up fake worker."), mt(rt, Jt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
10116
+ Y(rt, Jt) || (R("Setting up fake worker."), mt(rt, Jt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
10117
10117
  if (this.destroyed) {
10118
10118
  Y(this, Gt).reject(new Error("Worker was destroyed"));
10119
10119
  return;
@@ -10121,7 +10121,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10121
10121
  const t = new jn();
10122
10122
  mt(this, Ht, t);
10123
10123
  const e = `fake${ln(rt, gs)._++}`, s = new ve(e + "_worker", e, t);
10124
- c.setup(s, t), mt(this, Pt, new ve(e, e + "_worker", t)), It(this, St, Ue).call(this);
10124
+ c.setup(s, t), mt(this, Mt, new ve(e, e + "_worker", t)), Rt(this, Et, Ue).call(this);
10125
10125
  }).catch((c) => {
10126
10126
  Y(this, Gt).reject(new Error(`Setting up fake worker failed: "${c.message}".`));
10127
10127
  });
@@ -10148,14 +10148,14 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10148
10148
  return rt.create(c);
10149
10149
  };
10150
10150
  let Cs = rt;
10151
- class Or {
10151
+ class Br {
10152
10152
  #t = /* @__PURE__ */ new Map();
10153
10153
  #e = /* @__PURE__ */ new Map();
10154
10154
  #i = /* @__PURE__ */ new Map();
10155
10155
  #s = /* @__PURE__ */ new Map();
10156
10156
  #a = null;
10157
10157
  constructor(t, e, s, i, n, r) {
10158
- this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Vi(), this.fontLoader = new Bn({
10158
+ this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Vi(), this.fontLoader = new On({
10159
10159
  ownerDocument: i.ownerDocument,
10160
10160
  styleElement: i.styleElement
10161
10161
  }), this.loadingParams = i.loadingParams, this._params = i, this.canvasFactory = n.canvasFactory, this.filterFactory = n.filterFactory, this.cMapReaderFactory = n.cMapReaderFactory, this.standardFontDataFactory = n.standardFontDataFactory, this.wasmFactory = n.wasmFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = s, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.enableHWA = r, this.setupMessageHandler();
@@ -10170,7 +10170,7 @@ class Or {
10170
10170
  get annotationStorage() {
10171
10171
  return L(this, "annotationStorage", new Ns());
10172
10172
  }
10173
- getRenderingIntent(t, e = Bt.ENABLE, s = null, i = !1, n = !1) {
10173
+ getRenderingIntent(t, e = Ot.ENABLE, s = null, i = !1, n = !1) {
10174
10174
  let r = bt.DISPLAY, a = xs;
10175
10175
  switch (t) {
10176
10176
  case "any":
@@ -10182,23 +10182,23 @@ class Or {
10182
10182
  r = bt.PRINT;
10183
10183
  break;
10184
10184
  default:
10185
- I(`getRenderingIntent - invalid intent: ${t}`);
10185
+ R(`getRenderingIntent - invalid intent: ${t}`);
10186
10186
  }
10187
10187
  const o = r & bt.PRINT && s instanceof Di ? s : this.annotationStorage;
10188
10188
  switch (e) {
10189
- case Bt.DISABLE:
10189
+ case Ot.DISABLE:
10190
10190
  r += bt.ANNOTATIONS_DISABLE;
10191
10191
  break;
10192
- case Bt.ENABLE:
10192
+ case Ot.ENABLE:
10193
10193
  break;
10194
- case Bt.ENABLE_FORMS:
10194
+ case Ot.ENABLE_FORMS:
10195
10195
  r += bt.ANNOTATIONS_FORMS;
10196
10196
  break;
10197
- case Bt.ENABLE_STORAGE:
10197
+ case Ot.ENABLE_STORAGE:
10198
10198
  r += bt.ANNOTATIONS_STORAGE, a = o.serializable;
10199
10199
  break;
10200
10200
  default:
10201
- I(`getRenderingIntent - invalid annotationMode: ${e}`);
10201
+ R(`getRenderingIntent - invalid annotationMode: ${e}`);
10202
10202
  }
10203
10203
  i && (r += bt.IS_EDITING), n && (r += bt.OPLIST);
10204
10204
  const {
@@ -10231,7 +10231,7 @@ class Or {
10231
10231
  loadingTask: e
10232
10232
  } = this;
10233
10233
  t.on("GetReader", (s, i) => {
10234
- B(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (n) => {
10234
+ O(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (n) => {
10235
10235
  this._lastProgress = {
10236
10236
  loaded: n.loaded,
10237
10237
  total: n.total
@@ -10245,7 +10245,7 @@ class Or {
10245
10245
  i.close();
10246
10246
  return;
10247
10247
  }
10248
- B(n instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(n), 1, [n]);
10248
+ O(n instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(n), 1, [n]);
10249
10249
  }).catch((n) => {
10250
10250
  i.error(n);
10251
10251
  });
@@ -10273,7 +10273,7 @@ class Or {
10273
10273
  contentLength: r
10274
10274
  };
10275
10275
  }), t.on("GetRangeReader", (s, i) => {
10276
- B(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
10276
+ O(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
10277
10277
  const n = this._networkStream.getRangeReader(s.begin, s.end);
10278
10278
  if (!n) {
10279
10279
  i.close();
@@ -10288,7 +10288,7 @@ class Or {
10288
10288
  i.close();
10289
10289
  return;
10290
10290
  }
10291
- B(r instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(r), 1, [r]);
10291
+ O(r instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(r), 1, [r]);
10292
10292
  }).catch((r) => {
10293
10293
  i.error(r);
10294
10294
  });
@@ -10333,7 +10333,7 @@ class Or {
10333
10333
  case "Font":
10334
10334
  if ("error" in n) {
10335
10335
  const d = n.error;
10336
- I(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
10336
+ R(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
10337
10337
  break;
10338
10338
  }
10339
10339
  const r = new G(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (d, u) => globalThis.FontInspector.fontAdded(d, u) : null, o = new Hn(r, a, n.extra, n.charProcOperatorList);
@@ -10347,7 +10347,7 @@ class Or {
10347
10347
  const {
10348
10348
  imageRef: h
10349
10349
  } = n;
10350
- B(h, "The imageRef must be defined.");
10350
+ O(h, "The imageRef must be defined.");
10351
10351
  for (const d of this.#e.values())
10352
10352
  for (const [, u] of d.objs)
10353
10353
  if (u?.ref === h)
@@ -10403,7 +10403,7 @@ class Or {
10403
10403
  return this.messageHandler.sendWithPromise("GetData", null);
10404
10404
  }
10405
10405
  saveDocument() {
10406
- this.annotationStorage.size <= 0 && I("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
10406
+ this.annotationStorage.size <= 0 && R("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
10407
10407
  const {
10408
10408
  map: t,
10409
10409
  transfer: e
@@ -10546,7 +10546,7 @@ class Or {
10546
10546
  return this.#s.get(e) ?? null;
10547
10547
  }
10548
10548
  }
10549
- class Br {
10549
+ class Or {
10550
10550
  #t = null;
10551
10551
  onContinue = null;
10552
10552
  onError = null;
@@ -10590,7 +10590,7 @@ class re {
10590
10590
  enableHWA: p = !1,
10591
10591
  operationsFilter: f = null
10592
10592
  }) {
10593
- this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = a, this.canvasFactory = o, this.filterFactory = h, this._pdfBug = d, this.pageColors = u, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = l === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new Br(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvas, this._canvasContext = e.canvas ? null : e.canvasContext, this._enableHWA = p, this._dependencyTracker = e.dependencyTracker, this._operationsFilter = f;
10593
+ this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = a, this.canvasFactory = o, this.filterFactory = h, this._pdfBug = d, this.pageColors = u, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = l === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new Or(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvas, this._canvasContext = e.canvas ? null : e.canvasContext, this._enableHWA = p, this._dependencyTracker = e.dependencyTracker, this._operationsFilter = f;
10594
10594
  }
10595
10595
  get completed() {
10596
10596
  return this.capability.promise.catch(function() {
@@ -10627,7 +10627,7 @@ class re {
10627
10627
  }), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
10628
10628
  }
10629
10629
  cancel(t = null, e = 0) {
10630
- this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null), re.#e.delete(this._canvas), t ||= new Rs(`Rendering cancelled, page ${this._pageIndex + 1}`, e), this.callback(t), this.task.onError?.(t);
10630
+ this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null), re.#e.delete(this._canvas), t ||= new Is(`Rendering cancelled, page ${this._pageIndex + 1}`, e), this.callback(t), this.task.onError?.(t);
10631
10631
  }
10632
10632
  operatorListChanged() {
10633
10633
  if (!this.graphicsReady) {
@@ -10662,7 +10662,7 @@ class xt {
10662
10662
  #h = null;
10663
10663
  static #u = null;
10664
10664
  static get _keyboardManager() {
10665
- return L(this, "_keyboardManager", new Re([[["Escape", "mac+Escape"], xt.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], xt.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], xt.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], xt.prototype._moveToPrevious], [["Home", "mac+Home"], xt.prototype._moveToBeginning], [["End", "mac+End"], xt.prototype._moveToEnd]]));
10665
+ return L(this, "_keyboardManager", new Ie([[["Escape", "mac+Escape"], xt.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], xt.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], xt.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], xt.prototype._moveToPrevious], [["Home", "mac+Home"], xt.prototype._moveToBeginning], [["End", "mac+End"], xt.prototype._moveToEnd]]));
10666
10666
  }
10667
10667
  constructor({
10668
10668
  editor: t = null,
@@ -10712,7 +10712,7 @@ class xt {
10712
10712
  #p(t, e) {
10713
10713
  e.stopPropagation(), this.#o.dispatch("switchannotationeditorparams", {
10714
10714
  source: this,
10715
- type: O.HIGHLIGHT_COLOR,
10715
+ type: B.HIGHLIGHT_COLOR,
10716
10716
  value: t
10717
10717
  }), this.updateColor(t);
10718
10718
  }
@@ -10910,7 +10910,7 @@ class $r {
10910
10910
  }
10911
10911
  class Ye extends $r {
10912
10912
  _createSVG(t) {
10913
- return document.createElementNS(Rt, t);
10913
+ return document.createElementNS(It, t);
10914
10914
  }
10915
10915
  }
10916
10916
  const zr = 9, Xt = /* @__PURE__ */ new WeakSet(), Ur = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
@@ -11044,7 +11044,7 @@ class K {
11044
11044
  const {
11045
11045
  data: t
11046
11046
  } = this;
11047
- return this.annotationStorage.getRawValue(`${Se}${t.id}`)?.popup?.contents || t.contentsObj?.str || "";
11047
+ return this.annotationStorage.getRawValue(`${Ee}${t.id}`)?.popup?.contents || t.contentsObj?.str || "";
11048
11048
  }
11049
11049
  set commentText(t) {
11050
11050
  const {
@@ -11055,7 +11055,7 @@ class K {
11055
11055
  };
11056
11056
  this.annotationStorage.updateEditor(e.id, {
11057
11057
  popup: s
11058
- }) || this.annotationStorage.setValue(`${Se}${e.id}`, {
11058
+ }) || this.annotationStorage.setValue(`${Ee}${e.id}`, {
11059
11059
  id: e.id,
11060
11060
  annotationType: e.annotationType,
11061
11061
  pageIndex: this.parent.page._pageIndex,
@@ -11146,10 +11146,10 @@ class K {
11146
11146
  r.borderStyle = "dashed";
11147
11147
  break;
11148
11148
  case Zt.BEVELED:
11149
- I("Unimplemented border style: beveled");
11149
+ R("Unimplemented border style: beveled");
11150
11150
  break;
11151
11151
  case Zt.INSET:
11152
- I("Unimplemented border style: inset");
11152
+ R("Unimplemented border style: inset");
11153
11153
  break;
11154
11154
  case Zt.UNDERLINE:
11155
11155
  r.borderBottomStyle = "solid";
@@ -11313,8 +11313,8 @@ class K {
11313
11313
  const p = l.createElement("clipPath"), f = `clippath_${this.data.id}`;
11314
11314
  p.setAttribute("id", f), p.setAttribute("clipPathUnits", "objectBoundingBox"), u.append(p);
11315
11315
  for (let g = 2, b = t.length; g < b; g += 8) {
11316
- const m = t[g], w = t[g + 1], y = t[g + 2], v = t[g + 3], A = l.createElement("rect"), x = (y - e) / o, _ = (n - w) / h, S = (m - y) / o, E = (w - v) / h;
11317
- A.setAttribute("x", x), A.setAttribute("y", _), A.setAttribute("width", S), A.setAttribute("height", E), p.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${x}" y="${_}" width="${S}" height="${E}"/>`);
11316
+ const m = t[g], w = t[g + 1], y = t[g + 2], v = t[g + 3], A = l.createElement("rect"), x = (y - e) / o, _ = (n - w) / h, E = (m - y) / o, S = (w - v) / h;
11317
+ A.setAttribute("x", x), A.setAttribute("y", _), A.setAttribute("width", E), A.setAttribute("height", S), p.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${x}" y="${_}" width="${E}" height="${S}"/>`);
11318
11318
  }
11319
11319
  this.#e && (a.push("</g></svg>')"), r.backgroundImage = a.join("")), this.container.append(d), this.container.style.clipPath = `url(#${f})`;
11320
11320
  }
@@ -11366,7 +11366,7 @@ class K {
11366
11366
  continue;
11367
11367
  const o = typeof a == "string" ? a : null, h = document.querySelector(`[data-element-id="${r}"]`);
11368
11368
  if (h && !Xt.has(h)) {
11369
- I(`_getElementsByName - element not allowed: ${r}`);
11369
+ R(`_getElementsByName - element not allowed: ${r}`);
11370
11370
  continue;
11371
11371
  }
11372
11372
  s.push({
@@ -11516,7 +11516,7 @@ class zs extends K {
11516
11516
  _bindResetFormAction(t, e) {
11517
11517
  const s = t.onclick;
11518
11518
  if (s || (t.href = this.linkService.getAnchorUrl("")), this.#t(), !this._fieldObjects) {
11519
- I('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), s || (t.onclick = () => !1);
11519
+ R('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), s || (t.onclick = () => !1);
11520
11520
  return;
11521
11521
  }
11522
11522
  t.onclick = () => {
@@ -11576,7 +11576,7 @@ class zs extends K {
11576
11576
  const u = document.querySelector(`[data-element-id="${d}"]`);
11577
11577
  if (u) {
11578
11578
  if (!Xt.has(u)) {
11579
- I(`_bindResetFormAction - element not allowed: ${d}`);
11579
+ R(`_bindResetFormAction - element not allowed: ${d}`);
11580
11580
  continue;
11581
11581
  }
11582
11582
  } else continue;
@@ -12215,7 +12215,7 @@ class Kr {
12215
12215
  #t = null;
12216
12216
  #e = this.#G.bind(this);
12217
12217
  #i = this.#H.bind(this);
12218
- #s = this.#I.bind(this);
12218
+ #s = this.#R.bind(this);
12219
12219
  #a = this.#x.bind(this);
12220
12220
  #r = null;
12221
12221
  #n = null;
@@ -12232,12 +12232,12 @@ class Kr {
12232
12232
  #b = null;
12233
12233
  #w = null;
12234
12234
  #y = null;
12235
- #E = null;
12235
+ #S = null;
12236
12236
  #_ = null;
12237
12237
  #A = null;
12238
12238
  #T = !1;
12239
12239
  #v = null;
12240
- #S = null;
12240
+ #E = null;
12241
12241
  constructor({
12242
12242
  container: t,
12243
12243
  color: e,
@@ -12252,7 +12252,7 @@ class Kr {
12252
12252
  open: d,
12253
12253
  commentManager: u = null
12254
12254
  }) {
12255
- this.#n = t, this.#_ = i, this.#o = r, this.#E = a, this.#u = o, this.#r = e, this.#y = h, this.#d = l, this.#h = s, this.#t = u, this.#v = s[0], this.#l = ws.toDateObject(n), this.trigger = s.flatMap((p) => p.getElementsToTriggerPopup()), u || (this.#k(), this.#n.hidden = !0, d && this.#x());
12255
+ this.#n = t, this.#_ = i, this.#o = r, this.#S = a, this.#u = o, this.#r = e, this.#y = h, this.#d = l, this.#h = s, this.#t = u, this.#v = s[0], this.#l = ws.toDateObject(n), this.trigger = s.flatMap((p) => p.getElementsToTriggerPopup()), u || (this.#k(), this.#n.hidden = !0, d && this.#x());
12256
12256
  }
12257
12257
  #k() {
12258
12258
  if (this.#f)
@@ -12274,7 +12274,7 @@ class Kr {
12274
12274
  signal: t
12275
12275
  });
12276
12276
  }
12277
- #M() {
12277
+ #P() {
12278
12278
  const t = this.#h.find((e) => e.hasCommentButton);
12279
12279
  t && (this.#b = t._normalizePoint(t.commentButtonPosition));
12280
12280
  }
@@ -12283,7 +12283,7 @@ class Kr {
12283
12283
  this.#g.parentNode || this.#v.container.after(this.#g);
12284
12284
  return;
12285
12285
  }
12286
- if (this.#b || this.#M(), !this.#b)
12286
+ if (this.#b || this.#P(), !this.#b)
12287
12287
  return;
12288
12288
  const {
12289
12289
  signal: t
@@ -12310,7 +12310,7 @@ class Kr {
12310
12310
  const r = this.#g = document.createElement("button");
12311
12311
  r.className = "annotationCommentButton";
12312
12312
  const a = this.#v.container;
12313
- r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#O(), this.#P(), r.addEventListener("keydown", this.#e, {
12313
+ r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#B(), this.#M(), r.addEventListener("keydown", this.#e, {
12314
12314
  signal: t
12315
12315
  }), r.addEventListener("click", s, {
12316
12316
  signal: t
@@ -12321,7 +12321,7 @@ class Kr {
12321
12321
  }), a.after(r);
12322
12322
  }
12323
12323
  }
12324
- #P() {
12324
+ #M() {
12325
12325
  if (this.#v.extraPopupElement && !this.#v.editor)
12326
12326
  return;
12327
12327
  this.#g || this.renderCommentButton();
@@ -12330,7 +12330,7 @@ class Kr {
12330
12330
  } = this.#g;
12331
12331
  s.left = `calc(${t}%)`, s.top = `calc(${e}% - var(--comment-button-dim))`;
12332
12332
  }
12333
- #O() {
12333
+ #B() {
12334
12334
  this.#v.extraPopupElement || (this.#g || this.renderCommentButton(), this.#g.style.backgroundColor = this.commentButtonColor || "");
12335
12335
  }
12336
12336
  get commentButtonColor() {
@@ -12368,10 +12368,10 @@ class Kr {
12368
12368
  return this.#g;
12369
12369
  }
12370
12370
  get comment() {
12371
- return this.#S ||= this.#v.commentText, this.#S;
12371
+ return this.#E ||= this.#v.commentText, this.#E;
12372
12372
  }
12373
12373
  set comment(t) {
12374
- t !== this.comment && (this.#v.commentText = this.#S = t);
12374
+ t !== this.comment && (this.#v.commentText = this.#E = t);
12375
12375
  }
12376
12376
  focus() {
12377
12377
  this.#v.container?.focus();
@@ -12450,20 +12450,20 @@ class Kr {
12450
12450
  })), s.dateTime = this.#l.toISOString(), e.append(s);
12451
12451
  }
12452
12452
  Ti({
12453
- html: this.#R || this.#o.str,
12453
+ html: this.#I || this.#o.str,
12454
12454
  dir: this.#o?.dir,
12455
12455
  className: "popupContent"
12456
12456
  }, t), this.#n.append(t);
12457
12457
  }
12458
- get #R() {
12459
- const t = this.#E, e = this.#o;
12460
- return t?.str && (!e?.str || e.str === t.str) && this.#E.html || null;
12458
+ get #I() {
12459
+ const t = this.#S, e = this.#o;
12460
+ return t?.str && (!e?.str || e.str === t.str) && this.#S.html || null;
12461
12461
  }
12462
12462
  get #L() {
12463
- return this.#R?.attributes?.style?.fontSize || 0;
12463
+ return this.#I?.attributes?.style?.fontSize || 0;
12464
12464
  }
12465
- get #B() {
12466
- return this.#R?.attributes?.style?.color || null;
12465
+ get #O() {
12466
+ return this.#I?.attributes?.style?.color || null;
12467
12467
  }
12468
12468
  #F(t) {
12469
12469
  const e = [], s = {
@@ -12480,7 +12480,7 @@ class Kr {
12480
12480
  }
12481
12481
  }, i = {
12482
12482
  style: {
12483
- color: this.#B,
12483
+ color: this.#O,
12484
12484
  fontSize: this.#L ? `calc(${this.#L}px * var(--total-scale-factor))` : ""
12485
12485
  }
12486
12486
  };
@@ -12502,7 +12502,7 @@ class Kr {
12502
12502
  deleted: s
12503
12503
  }) {
12504
12504
  if (this.#t) {
12505
- s ? (this.remove(), this.#S = null) : e && (e.deleted ? this.remove() : (this.#O(), this.#S = e.text)), t && (this.#b = null, this.#M(), this.#P());
12505
+ s ? (this.remove(), this.#E = null) : e && (e.deleted ? this.remove() : (this.#B(), this.#E = e.text)), t && (this.#b = null, this.#P(), this.#M());
12506
12506
  return;
12507
12507
  }
12508
12508
  if (s || e?.deleted) {
@@ -12511,13 +12511,13 @@ class Kr {
12511
12511
  }
12512
12512
  this.#k(), this.#A ||= {
12513
12513
  contentsObj: this.#o,
12514
- richText: this.#E
12515
- }, t && (this.#c = null), e && e.text && (this.#E = this.#F(e.text), this.#l = ws.toDateObject(e.date), this.#o = null), this.#m?.remove(), this.#m = null;
12514
+ richText: this.#S
12515
+ }, t && (this.#c = null), e && e.text && (this.#S = this.#F(e.text), this.#l = ws.toDateObject(e.date), this.#o = null), this.#m?.remove(), this.#m = null;
12516
12516
  }
12517
12517
  resetEdited() {
12518
12518
  this.#A && ({
12519
12519
  contentsObj: this.#o,
12520
- richText: this.#E
12520
+ richText: this.#S
12521
12521
  } = this.#A, this.#A = null, this.#m?.remove(), this.#m = null, this.#c = null);
12522
12522
  }
12523
12523
  remove() {
@@ -12559,9 +12559,9 @@ class Kr {
12559
12559
  this.#t.toggleCommentPopup(this, !1);
12560
12560
  return;
12561
12561
  }
12562
- this.#p = !this.#p, this.#p ? (this.#I(), this.#n.addEventListener("click", this.#a), this.#n.addEventListener("keydown", this.#e)) : (this.#H(), this.#n.removeEventListener("click", this.#a), this.#n.removeEventListener("keydown", this.#e));
12562
+ this.#p = !this.#p, this.#p ? (this.#R(), this.#n.addEventListener("click", this.#a), this.#n.addEventListener("keydown", this.#e)) : (this.#H(), this.#n.removeEventListener("click", this.#a), this.#n.removeEventListener("keydown", this.#e));
12563
12563
  }
12564
- #I() {
12564
+ #R() {
12565
12565
  this.#m || this.render(), this.isVisible ? this.#p && this.#n.classList.add("focused") : (this.#C(), this.#n.hidden = !1, this.#n.style.zIndex = parseInt(this.#n.style.zIndex) + 1e3);
12566
12566
  }
12567
12567
  #H() {
@@ -12571,7 +12571,7 @@ class Kr {
12571
12571
  this.#T = this.isVisible, this.#T && (this.#n.hidden = !0);
12572
12572
  }
12573
12573
  maybeShow() {
12574
- this.#t || (this.#k(), this.#T && (this.#m || this.#I(), this.#T = !1, this.#n.hidden = !1));
12574
+ this.#t || (this.#k(), this.#T && (this.#m || this.#R(), this.#T = !1, this.#n.hidden = !1));
12575
12575
  }
12576
12576
  get isVisible() {
12577
12577
  return this.#t ? !1 : this.#n.hidden === !1;
@@ -13190,7 +13190,7 @@ class ht extends D {
13190
13190
  static _defaultFontSize = 10;
13191
13191
  static get _keyboardManager() {
13192
13192
  const t = ht.prototype, e = (n) => n.isEmpty(), s = zt.TRANSLATE_SMALL, i = zt.TRANSLATE_BIG;
13193
- return L(this, "_keyboardManager", new Re([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], t.commitOrRemove, {
13193
+ return L(this, "_keyboardManager", new Ie([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], t.commitOrRemove, {
13194
13194
  bubbles: !0
13195
13195
  }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], t.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], t._translateEmpty, {
13196
13196
  args: [-s, 0],
@@ -13233,35 +13233,35 @@ class ht extends D {
13233
13233
  }
13234
13234
  static updateDefaultParams(t, e) {
13235
13235
  switch (t) {
13236
- case O.FREETEXT_SIZE:
13236
+ case B.FREETEXT_SIZE:
13237
13237
  ht._defaultFontSize = e;
13238
13238
  break;
13239
- case O.FREETEXT_COLOR:
13239
+ case B.FREETEXT_COLOR:
13240
13240
  ht._defaultColor = e;
13241
13241
  break;
13242
13242
  }
13243
13243
  }
13244
13244
  updateParams(t, e) {
13245
13245
  switch (t) {
13246
- case O.FREETEXT_SIZE:
13246
+ case B.FREETEXT_SIZE:
13247
13247
  this.#a(e);
13248
13248
  break;
13249
- case O.FREETEXT_COLOR:
13249
+ case B.FREETEXT_COLOR:
13250
13250
  this.#r(e);
13251
13251
  break;
13252
13252
  }
13253
13253
  }
13254
13254
  static get defaultPropertiesToUpdate() {
13255
- return [[O.FREETEXT_SIZE, ht._defaultFontSize], [O.FREETEXT_COLOR, ht._defaultColor || D._defaultLineColor]];
13255
+ return [[B.FREETEXT_SIZE, ht._defaultFontSize], [B.FREETEXT_COLOR, ht._defaultColor || D._defaultLineColor]];
13256
13256
  }
13257
13257
  get propertiesToUpdate() {
13258
- return [[O.FREETEXT_SIZE, this.#s], [O.FREETEXT_COLOR, this.color]];
13258
+ return [[B.FREETEXT_SIZE, this.#s], [B.FREETEXT_COLOR, this.color]];
13259
13259
  }
13260
13260
  get toolbarButtons() {
13261
13261
  return this._colorPicker ||= new Te(this), [["colorPicker", this._colorPicker]];
13262
13262
  }
13263
13263
  get colorType() {
13264
- return O.FREETEXT_COLOR;
13264
+ return B.FREETEXT_COLOR;
13265
13265
  }
13266
13266
  #a(t) {
13267
13267
  const e = (i) => {
@@ -13272,7 +13272,7 @@ class ht extends D {
13272
13272
  undo: e.bind(this, s),
13273
13273
  post: this._uiManager.updateUI.bind(this._uiManager, this),
13274
13274
  mustExec: !0,
13275
- type: O.FREETEXT_SIZE,
13275
+ type: B.FREETEXT_SIZE,
13276
13276
  overwriteIfSameType: !0,
13277
13277
  keepUndo: !0
13278
13278
  });
@@ -13289,7 +13289,7 @@ class ht extends D {
13289
13289
  undo: e.bind(this, s),
13290
13290
  post: this._uiManager.updateUI.bind(this._uiManager, this),
13291
13291
  mustExec: !0,
13292
- type: O.FREETEXT_COLOR,
13292
+ type: B.FREETEXT_COLOR,
13293
13293
  overwriteIfSameType: !0,
13294
13294
  keepUndo: !0
13295
13295
  });
@@ -13636,7 +13636,7 @@ class ht extends D {
13636
13636
  super.resetAnnotationElement(t), t.resetEdited();
13637
13637
  }
13638
13638
  }
13639
- class M {
13639
+ class P {
13640
13640
  static PRECISION = 1e-4;
13641
13641
  toSVGPath() {
13642
13642
  j("Abstract method `toSVGPath` must be implemented.");
@@ -13777,7 +13777,7 @@ class jt {
13777
13777
  for (let d = 0, u = o.length - 2; d < u; d += 2)
13778
13778
  o[d] = (this.#p[d] - i) / r, o[d + 1] = (this.#p[d + 1] - n) / a;
13779
13779
  if (o[o.length - 2] = (this.#n - i) / r, o[o.length - 1] = (this.#o - n) / a, isNaN(s[6]) && !this.isEmpty())
13780
- return this.#E(o);
13780
+ return this.#S(o);
13781
13781
  const h = new Float32Array(this.#a.length + 24 + this.#e.length);
13782
13782
  let l = t.length;
13783
13783
  for (let d = 0; d < l; d += 2) {
@@ -13798,7 +13798,7 @@ class jt {
13798
13798
  }
13799
13799
  return this.#_(h, l), this.newFreeDrawOutline(h, o, this.#t, this.#u, this.#i, this.#s);
13800
13800
  }
13801
- #E(t) {
13801
+ #S(t) {
13802
13802
  const e = this.#r, [s, i, n, r] = this.#t, [a, o, h, l] = this.#g(), d = new Float32Array(36);
13803
13803
  return d.set([NaN, NaN, NaN, NaN, (e[2] - s) / n, (e[3] - i) / r, NaN, NaN, NaN, NaN, (e[4] - s) / n, (e[5] - i) / r, NaN, NaN, NaN, NaN, a, o, NaN, NaN, NaN, NaN, h, l, NaN, NaN, NaN, NaN, (e[16] - s) / n, (e[17] - i) / r, NaN, NaN, NaN, NaN, (e[14] - s) / n, (e[15] - i) / r], 0), this.newFreeDrawOutline(d, t, this.#t, this.#u, this.#i, this.#s);
13804
13804
  }
@@ -13811,7 +13811,7 @@ class jt {
13811
13811
  return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / a, (s[1] - r) / o, NaN, NaN, NaN, NaN, h, l, NaN, NaN, NaN, NaN, d, u, NaN, NaN, NaN, NaN, (i[0] - n) / a, (i[1] - r) / o], e), e += 24;
13812
13812
  }
13813
13813
  }
13814
- class tn extends M {
13814
+ class tn extends P {
13815
13815
  #t;
13816
13816
  #e = new Float32Array(4);
13817
13817
  #i;
@@ -13843,16 +13843,16 @@ class tn extends M {
13843
13843
  let o, h;
13844
13844
  switch (n) {
13845
13845
  case 0:
13846
- o = M._rescale(this.#n, t, i, r, -a), h = M._rescale(this.#a, t, i, r, -a);
13846
+ o = P._rescale(this.#n, t, i, r, -a), h = P._rescale(this.#a, t, i, r, -a);
13847
13847
  break;
13848
13848
  case 90:
13849
- o = M._rescaleAndSwap(this.#n, t, e, r, a), h = M._rescaleAndSwap(this.#a, t, e, r, a);
13849
+ o = P._rescaleAndSwap(this.#n, t, e, r, a), h = P._rescaleAndSwap(this.#a, t, e, r, a);
13850
13850
  break;
13851
13851
  case 180:
13852
- o = M._rescale(this.#n, s, e, -r, a), h = M._rescale(this.#a, s, e, -r, a);
13852
+ o = P._rescale(this.#n, s, e, -r, a), h = P._rescale(this.#a, s, e, -r, a);
13853
13853
  break;
13854
13854
  case 270:
13855
- o = M._rescaleAndSwap(this.#n, s, i, -r, -a), h = M._rescaleAndSwap(this.#a, s, i, -r, -a);
13855
+ o = P._rescaleAndSwap(this.#n, s, i, -r, -a), h = P._rescaleAndSwap(this.#a, s, i, -r, -a);
13856
13856
  break;
13857
13857
  }
13858
13858
  return {
@@ -13892,7 +13892,7 @@ class tn extends M {
13892
13892
  return g.getOutlines();
13893
13893
  }
13894
13894
  }
13895
- class Ms {
13895
+ class Ps {
13896
13896
  #t;
13897
13897
  #e;
13898
13898
  #i;
@@ -13906,8 +13906,8 @@ class Ms {
13906
13906
  width: m,
13907
13907
  height: w
13908
13908
  } of t) {
13909
- const y = Math.floor((g - e) / r) * r, v = Math.ceil((g + m + e) / r) * r, A = Math.floor((b - e) / r) * r, x = Math.ceil((b + w + e) / r) * r, _ = [y, A, x, !0], S = [v, A, x, !1];
13910
- this.#s.push(_, S), T.rectBoundingBox(y, A, v, x, n);
13909
+ const y = Math.floor((g - e) / r) * r, v = Math.ceil((g + m + e) / r) * r, A = Math.floor((b - e) / r) * r, x = Math.ceil((b + w + e) / r) * r, _ = [y, A, x, !0], E = [v, A, x, !1];
13910
+ this.#s.push(_, E), T.rectBoundingBox(y, A, v, x, n);
13911
13911
  }
13912
13912
  const a = n[2] - n[0] + 2 * s, o = n[3] - n[1] + 2 * s, h = n[0] - s, l = n[1] - s;
13913
13913
  let d = i ? -1 / 0 : 1 / 0, u = 1 / 0;
@@ -14017,7 +14017,7 @@ class Ms {
14017
14017
  return n;
14018
14018
  }
14019
14019
  }
14020
- class aa extends M {
14020
+ class aa extends P {
14021
14021
  #t;
14022
14022
  #e;
14023
14023
  constructor(t, e, s, i) {
@@ -14053,14 +14053,14 @@ class aa extends M {
14053
14053
  return ["highlightOutline"];
14054
14054
  }
14055
14055
  }
14056
- class Ps extends jt {
14056
+ class Ms extends jt {
14057
14057
  newFreeDrawOutline(t, e, s, i, n, r) {
14058
14058
  return new oa(t, e, s, i, n, r);
14059
14059
  }
14060
14060
  }
14061
14061
  class oa extends tn {
14062
14062
  newOutliner(t, e, s, i, n, r = 0) {
14063
- return new Ps(t, e, s, i, n, r);
14063
+ return new Ms(t, e, s, i, n, r);
14064
14064
  }
14065
14065
  }
14066
14066
  class J extends D {
@@ -14092,7 +14092,7 @@ class J extends D {
14092
14092
  static _freeHighlightClipId = "";
14093
14093
  static get _keyboardManager() {
14094
14094
  const t = J.prototype;
14095
- return L(this, "_keyboardManager", new Re([[["ArrowLeft", "mac+ArrowLeft"], t._moveCaret, {
14095
+ return L(this, "_keyboardManager", new Ie([[["ArrowLeft", "mac+ArrowLeft"], t._moveCaret, {
14096
14096
  args: [0]
14097
14097
  }], [["ArrowRight", "mac+ArrowRight"], t._moveCaret, {
14098
14098
  args: [1]
@@ -14129,9 +14129,9 @@ class J extends D {
14129
14129
  };
14130
14130
  }
14131
14131
  #w() {
14132
- const t = new Ms(this.#i, 1e-3);
14132
+ const t = new Ps(this.#i, 1e-3);
14133
14133
  this.#h = t.getOutlines(), [this.x, this.y, this.width, this.height] = this.#h.box;
14134
- const e = new Ms(this.#i, 25e-4, 1e-3, this._uiManager.direction === "ltr");
14134
+ const e = new Ps(this.#i, 25e-4, 1e-3, this._uiManager.direction === "ltr");
14135
14135
  this.#r = e.getOutlines();
14136
14136
  const {
14137
14137
  firstPoint: s
@@ -14168,12 +14168,12 @@ class J extends D {
14168
14168
  else if (this.parent) {
14169
14169
  const d = this.parent.viewport.rotation;
14170
14170
  this.parent.drawLayer.updateProperties(this.#u, {
14171
- bbox: J.#S(this.#h.box, (d - this.rotation + 360) % 360),
14171
+ bbox: J.#E(this.#h.box, (d - this.rotation + 360) % 360),
14172
14172
  path: {
14173
14173
  d: t.toSVGPath()
14174
14174
  }
14175
14175
  }), this.parent.drawLayer.updateProperties(this.#f, {
14176
- bbox: J.#S(this.#r.box, d),
14176
+ bbox: J.#E(this.#r.box, d),
14177
14177
  path: {
14178
14178
  d: this.#r.toSVGPath()
14179
14179
  }
@@ -14212,10 +14212,10 @@ class J extends D {
14212
14212
  }
14213
14213
  static updateDefaultParams(t, e) {
14214
14214
  switch (t) {
14215
- case O.HIGHLIGHT_COLOR:
14215
+ case B.HIGHLIGHT_COLOR:
14216
14216
  J._defaultColor = e;
14217
14217
  break;
14218
- case O.HIGHLIGHT_THICKNESS:
14218
+ case B.HIGHLIGHT_THICKNESS:
14219
14219
  J._defaultThickness = e;
14220
14220
  break;
14221
14221
  }
@@ -14230,19 +14230,19 @@ class J extends D {
14230
14230
  }
14231
14231
  updateParams(t, e) {
14232
14232
  switch (t) {
14233
- case O.HIGHLIGHT_COLOR:
14234
- this.#E(e);
14233
+ case B.HIGHLIGHT_COLOR:
14234
+ this.#S(e);
14235
14235
  break;
14236
- case O.HIGHLIGHT_THICKNESS:
14236
+ case B.HIGHLIGHT_THICKNESS:
14237
14237
  this.#_(e);
14238
14238
  break;
14239
14239
  }
14240
14240
  }
14241
14241
  static get defaultPropertiesToUpdate() {
14242
- return [[O.HIGHLIGHT_COLOR, J._defaultColor], [O.HIGHLIGHT_THICKNESS, J._defaultThickness]];
14242
+ return [[B.HIGHLIGHT_COLOR, J._defaultColor], [B.HIGHLIGHT_THICKNESS, J._defaultThickness]];
14243
14243
  }
14244
14244
  get propertiesToUpdate() {
14245
- return [[O.HIGHLIGHT_COLOR, this.color || J._defaultColor], [O.HIGHLIGHT_THICKNESS, this.#g || J._defaultThickness], [O.HIGHLIGHT_FREE, this.#d]];
14245
+ return [[B.HIGHLIGHT_COLOR, this.color || J._defaultColor], [B.HIGHLIGHT_THICKNESS, this.#g || J._defaultThickness], [B.HIGHLIGHT_FREE, this.#d]];
14246
14246
  }
14247
14247
  onUpdatedColor() {
14248
14248
  this.parent?.drawLayer.updateProperties(this.#u, {
@@ -14252,7 +14252,7 @@ class J extends D {
14252
14252
  }
14253
14253
  }), this.#a?.updateColor(this.color), super.onUpdatedColor();
14254
14254
  }
14255
- #E(t) {
14255
+ #S(t) {
14256
14256
  const e = (n, r) => {
14257
14257
  this.color = n, this.opacity = r, this.onUpdatedColor();
14258
14258
  }, s = this.color, i = this.opacity;
@@ -14261,7 +14261,7 @@ class J extends D {
14261
14261
  undo: e.bind(this, s, i),
14262
14262
  post: this._uiManager.updateUI.bind(this._uiManager, this),
14263
14263
  mustExec: !0,
14264
- type: O.HIGHLIGHT_COLOR,
14264
+ type: B.HIGHLIGHT_COLOR,
14265
14265
  overwriteIfSameType: !0,
14266
14266
  keepUndo: !0
14267
14267
  }), this._reportTelemetry({
@@ -14278,7 +14278,7 @@ class J extends D {
14278
14278
  undo: s.bind(this, e),
14279
14279
  post: this._uiManager.updateUI.bind(this._uiManager, this),
14280
14280
  mustExec: !0,
14281
- type: O.INK_THICKNESS,
14281
+ type: B.INK_THICKNESS,
14282
14282
  overwriteIfSameType: !0,
14283
14283
  keepUndo: !0
14284
14284
  }), this._reportTelemetry({
@@ -14298,13 +14298,13 @@ class J extends D {
14298
14298
  super.enableEditing(), this.div.classList.toggle("disabled", !1);
14299
14299
  }
14300
14300
  fixAndSetPosition() {
14301
- return super.fixAndSetPosition(this.#P());
14301
+ return super.fixAndSetPosition(this.#M());
14302
14302
  }
14303
14303
  getBaseTranslation() {
14304
14304
  return [0, 0];
14305
14305
  }
14306
14306
  getRect(t, e) {
14307
- return super.getRect(t, e, this.#P());
14307
+ return super.getRect(t, e, this.#M());
14308
14308
  }
14309
14309
  onceAdded(t) {
14310
14310
  this.annotationElementId || this.parent.addUndoableEditor(this), t && this.div.focus();
@@ -14358,7 +14358,7 @@ class J extends D {
14358
14358
  }
14359
14359
  }, this.#d), this.#l && (this.#l.style.clipPath = this.#s));
14360
14360
  }
14361
- static #S([t, e, s, i], n) {
14361
+ static #E([t, e, s, i], n) {
14362
14362
  switch (n) {
14363
14363
  case 90:
14364
14364
  return [1 - e - i, t, i, s];
@@ -14374,13 +14374,13 @@ class J extends D {
14374
14374
  drawLayer: e
14375
14375
  } = this.parent;
14376
14376
  let s;
14377
- this.#d ? (t = (t - this.rotation + 360) % 360, s = J.#S(this.#h.box, t)) : s = J.#S([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
14377
+ this.#d ? (t = (t - this.rotation + 360) % 360, s = J.#E(this.#h.box, t)) : s = J.#E([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
14378
14378
  bbox: s,
14379
14379
  root: {
14380
14380
  "data-main-rotation": t
14381
14381
  }
14382
14382
  }), e.updateProperties(this.#f, {
14383
- bbox: J.#S(this.#r.box, t),
14383
+ bbox: J.#E(this.#r.box, t),
14384
14384
  root: {
14385
14385
  "data-main-rotation": t
14386
14386
  }
@@ -14394,7 +14394,7 @@ class J extends D {
14394
14394
  signal: this._uiManager._signal
14395
14395
  });
14396
14396
  const e = this.#l = document.createElement("div");
14397
- return t.append(e), e.setAttribute("aria-hidden", "true"), e.className = "internal", e.style.clipPath = this.#s, this.setDims(), Pi(this, this.#l, ["pointerover", "pointerleave"]), this.enableEditing(), t;
14397
+ return t.append(e), e.setAttribute("aria-hidden", "true"), e.className = "internal", e.style.clipPath = this.#s, this.setDims(), Mi(this, this.#l, ["pointerover", "pointerleave"]), this.enableEditing(), t;
14398
14398
  }
14399
14399
  pointerover() {
14400
14400
  this.isSelected || this.parent?.drawLayer.updateProperties(this.#f, {
@@ -14417,15 +14417,15 @@ class J extends D {
14417
14417
  switch (this.parent.unselect(this), t) {
14418
14418
  case 0:
14419
14419
  case 2:
14420
- this.#M(!0);
14420
+ this.#P(!0);
14421
14421
  break;
14422
14422
  case 1:
14423
14423
  case 3:
14424
- this.#M(!1);
14424
+ this.#P(!1);
14425
14425
  break;
14426
14426
  }
14427
14427
  }
14428
- #M(t) {
14428
+ #P(t) {
14429
14429
  if (!this.#t)
14430
14430
  return;
14431
14431
  const e = window.getSelection();
@@ -14444,7 +14444,7 @@ class J extends D {
14444
14444
  rootClass: {
14445
14445
  selected: !1
14446
14446
  }
14447
- }), this.#d || this.#M(!1));
14447
+ }), this.#d || this.#P(!1));
14448
14448
  }
14449
14449
  get _mustFixPosition() {
14450
14450
  return !this.#d;
@@ -14460,10 +14460,10 @@ class J extends D {
14460
14460
  }
14461
14461
  }));
14462
14462
  }
14463
- #P() {
14463
+ #M() {
14464
14464
  return this.#d ? this.rotation : 0;
14465
14465
  }
14466
- #O() {
14466
+ #B() {
14467
14467
  if (this.#d)
14468
14468
  return null;
14469
14469
  const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#i, r = new Float32Array(n.length * 8);
@@ -14479,8 +14479,8 @@ class J extends D {
14479
14479
  }
14480
14480
  return r;
14481
14481
  }
14482
- #R(t) {
14483
- return this.#h.serialize(t, this.#P());
14482
+ #I(t) {
14483
+ return this.#h.serialize(t, this.#M());
14484
14484
  }
14485
14485
  static startHighlighting(t, e, {
14486
14486
  target: s,
@@ -14493,7 +14493,7 @@ class J extends D {
14493
14493
  width: o,
14494
14494
  height: h
14495
14495
  } = s.getBoundingClientRect(), l = new AbortController(), d = t.combinedSignal(l), u = (p) => {
14496
- l.abort(), this.#B(t, p);
14496
+ l.abort(), this.#O(t, p);
14497
14497
  };
14498
14498
  window.addEventListener("blur", u, {
14499
14499
  signal: d
@@ -14507,7 +14507,7 @@ class J extends D {
14507
14507
  signal: d
14508
14508
  }), s.addEventListener("pointermove", this.#L.bind(this, t), {
14509
14509
  signal: d
14510
- }), this._freeHighlight = new Ps({
14510
+ }), this._freeHighlight = new Ms({
14511
14511
  x: i,
14512
14512
  y: n
14513
14513
  }, [r, a, o, h], t.scale, this._defaultThickness / 2, e, 1e-3), {
@@ -14536,7 +14536,7 @@ class J extends D {
14536
14536
  }
14537
14537
  });
14538
14538
  }
14539
- static #B(t, e) {
14539
+ static #O(t, e) {
14540
14540
  this._freeHighlight.isEmpty() ? t.drawLayer.remove(this._freeHighlightId) : t.createAndAddNewEditor(e, !1, {
14541
14541
  highlightId: this._freeHighlightId,
14542
14542
  highlightOutlines: this._freeHighlight.getOutlines(),
@@ -14559,11 +14559,11 @@ class J extends D {
14559
14559
  richText: A,
14560
14560
  contentsObj: x,
14561
14561
  creationDate: _,
14562
- modificationDate: S
14562
+ modificationDate: E
14563
14563
  },
14564
14564
  parent: {
14565
14565
  page: {
14566
- pageNumber: E
14566
+ pageNumber: S
14567
14567
  }
14568
14568
  }
14569
14569
  } = t;
@@ -14573,7 +14573,7 @@ class J extends D {
14573
14573
  opacity: y,
14574
14574
  quadPoints: f,
14575
14575
  boxes: null,
14576
- pageIndex: E - 1,
14576
+ pageIndex: S - 1,
14577
14577
  rect: g.slice(0),
14578
14578
  rotation: b,
14579
14579
  annotationElementId: m,
@@ -14583,7 +14583,7 @@ class J extends D {
14583
14583
  richText: A,
14584
14584
  comment: x?.str || null,
14585
14585
  creationDate: _,
14586
- modificationDate: S
14586
+ modificationDate: E
14587
14587
  };
14588
14588
  } else if (t instanceof Us) {
14589
14589
  const {
@@ -14600,11 +14600,11 @@ class J extends D {
14600
14600
  richText: A,
14601
14601
  contentsObj: x,
14602
14602
  creationDate: _,
14603
- modificationDate: S
14603
+ modificationDate: E
14604
14604
  },
14605
14605
  parent: {
14606
14606
  page: {
14607
- pageNumber: E
14607
+ pageNumber: S
14608
14608
  }
14609
14609
  }
14610
14610
  } = t;
@@ -14614,7 +14614,7 @@ class J extends D {
14614
14614
  thickness: y,
14615
14615
  inkLists: f,
14616
14616
  boxes: null,
14617
- pageIndex: E - 1,
14617
+ pageIndex: S - 1,
14618
14618
  rect: g.slice(0),
14619
14619
  rotation: b,
14620
14620
  annotationElementId: m,
@@ -14624,7 +14624,7 @@ class J extends D {
14624
14624
  richText: A,
14625
14625
  comment: x?.str || null,
14626
14626
  creationDate: _,
14627
- modificationDate: S
14627
+ modificationDate: E
14628
14628
  };
14629
14629
  }
14630
14630
  const {
@@ -14650,7 +14650,7 @@ class J extends D {
14650
14650
  const f = a[0], g = {
14651
14651
  x: f[0] - u,
14652
14652
  y: d - (f[1] - p)
14653
- }, b = new Ps(g, [0, 0, l, d], 1, h.#g / 2, !0, 1e-3);
14653
+ }, b = new Ms(g, [0, 0, l, d], 1, h.#g / 2, !0, 1e-3);
14654
14654
  for (let y = 0, v = f.length; y < v; y += 2)
14655
14655
  g.x = f[y] - u, g.y = d - (f[y + 1] - p), b.add(g);
14656
14656
  const {
@@ -14689,8 +14689,8 @@ class J extends D {
14689
14689
  color: e,
14690
14690
  opacity: this.opacity,
14691
14691
  thickness: this.#g,
14692
- quadPoints: this.#O(),
14693
- outlines: this.#R(s.rect)
14692
+ quadPoints: this.#B(),
14693
+ outlines: this.#I(s.rect)
14694
14694
  }), this.addComment(s), this.annotationElementId && !this.#F(s) ? null : (s.id = this.annotationElementId, s);
14695
14695
  }
14696
14696
  #F(t) {
@@ -15088,7 +15088,7 @@ class $ extends D {
15088
15088
  e.drawLayer.updateProperties(i, s.removeLastElement());
15089
15089
  },
15090
15090
  mustExec: !1,
15091
- type: O.DRAW_STEP
15091
+ type: B.DRAW_STEP
15092
15092
  });
15093
15093
  return;
15094
15094
  }
@@ -15099,7 +15099,7 @@ class $ extends D {
15099
15099
  const e = this._currentParent;
15100
15100
  if (!e)
15101
15101
  return null;
15102
- if (e.toggleDrawing(!0), e.cleanUndoStack(O.DRAW_STEP), !$.#i.isEmpty()) {
15102
+ if (e.toggleDrawing(!0), e.cleanUndoStack(B.DRAW_STEP), !$.#i.isEmpty()) {
15103
15103
  const {
15104
15104
  pageDimensions: [s, i],
15105
15105
  scale: n
@@ -15171,7 +15171,7 @@ class ha {
15171
15171
  t === "stroke-width" && (this.#a = e);
15172
15172
  }
15173
15173
  #d(t, e) {
15174
- return M._normalizePoint(t, e, this.#h, this.#u, this.#s);
15174
+ return P._normalizePoint(t, e, this.#h, this.#u, this.#s);
15175
15175
  }
15176
15176
  isEmpty() {
15177
15177
  return !this.#i || this.#i.length === 0;
@@ -15186,7 +15186,7 @@ class ha {
15186
15186
  path: {
15187
15187
  d: this.toSVGPath()
15188
15188
  }
15189
- }) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...M.createBezierPoints(s, i, n, r, t, e)), {
15189
+ }) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...P.createBezierPoints(s, i, n, r, t, e)), {
15190
15190
  path: {
15191
15191
  d: this.toSVGPath()
15192
15192
  }
@@ -15237,7 +15237,7 @@ class ha {
15237
15237
  };
15238
15238
  }
15239
15239
  toSVGPath() {
15240
- const t = M.svgRound(this.#e[4]), e = M.svgRound(this.#e[5]);
15240
+ const t = P.svgRound(this.#e[4]), e = P.svgRound(this.#e[5]);
15241
15241
  if (this.#r.length === 2)
15242
15242
  return this.#n = `${this.#n} M ${t} ${e} Z`, this.#n;
15243
15243
  if (this.#r.length <= 6) {
@@ -15245,13 +15245,13 @@ class ha {
15245
15245
  this.#n = `${this.#n.slice(0, i)} M ${t} ${e}`, this.#o = 6;
15246
15246
  }
15247
15247
  if (this.#r.length === 4) {
15248
- const i = M.svgRound(this.#e[10]), n = M.svgRound(this.#e[11]);
15248
+ const i = P.svgRound(this.#e[10]), n = P.svgRound(this.#e[11]);
15249
15249
  return this.#n = `${this.#n} L ${i} ${n}`, this.#o = 12, this.#n;
15250
15250
  }
15251
15251
  const s = [];
15252
15252
  this.#o === 0 && (s.push(`M ${t} ${e}`), this.#o = 6);
15253
15253
  for (let i = this.#o, n = this.#e.length; i < n; i += 6) {
15254
- const [r, a, o, h, l, d] = this.#e.slice(i, i + 6).map(M.svgRound);
15254
+ const [r, a, o, h, l, d] = this.#e.slice(i, i + 6).map(P.svgRound);
15255
15255
  s.push(`C${r} ${a} ${o} ${h} ${l} ${d}`);
15256
15256
  }
15257
15257
  return this.#n += s.join(" "), this.#o = this.#e.length, this.#n;
@@ -15272,7 +15272,7 @@ class ha {
15272
15272
  };
15273
15273
  }
15274
15274
  }
15275
- class Le extends M {
15275
+ class Le extends P {
15276
15276
  #t;
15277
15277
  #e = 0;
15278
15278
  #i;
@@ -15307,16 +15307,16 @@ class Le extends M {
15307
15307
  for (const {
15308
15308
  line: e
15309
15309
  } of this.#s) {
15310
- if (t.push(`M${M.svgRound(e[4])} ${M.svgRound(e[5])}`), e.length === 6) {
15310
+ if (t.push(`M${P.svgRound(e[4])} ${P.svgRound(e[5])}`), e.length === 6) {
15311
15311
  t.push("Z");
15312
15312
  continue;
15313
15313
  }
15314
15314
  if (e.length === 12 && isNaN(e[6])) {
15315
- t.push(`L${M.svgRound(e[10])} ${M.svgRound(e[11])}`);
15315
+ t.push(`L${P.svgRound(e[10])} ${P.svgRound(e[11])}`);
15316
15316
  continue;
15317
15317
  }
15318
15318
  for (let s = 6, i = e.length; s < i; s += 6) {
15319
- const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(M.svgRound);
15319
+ const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(P.svgRound);
15320
15320
  t.push(`C${n} ${r} ${a} ${o} ${h} ${l}`);
15321
15321
  }
15322
15322
  }
@@ -15327,16 +15327,16 @@ class Le extends M {
15327
15327
  let u, p, f, g, b, m, w, y, v;
15328
15328
  switch (this.#o) {
15329
15329
  case 0:
15330
- v = M._rescale, u = t, p = e + i, f = s, g = -i, b = t + o * s, m = e + (1 - h - d) * i, w = t + (o + l) * s, y = e + (1 - h) * i;
15330
+ v = P._rescale, u = t, p = e + i, f = s, g = -i, b = t + o * s, m = e + (1 - h - d) * i, w = t + (o + l) * s, y = e + (1 - h) * i;
15331
15331
  break;
15332
15332
  case 90:
15333
- v = M._rescaleAndSwap, u = t, p = e, f = s, g = i, b = t + h * s, m = e + o * i, w = t + (h + d) * s, y = e + (o + l) * i;
15333
+ v = P._rescaleAndSwap, u = t, p = e, f = s, g = i, b = t + h * s, m = e + o * i, w = t + (h + d) * s, y = e + (o + l) * i;
15334
15334
  break;
15335
15335
  case 180:
15336
- v = M._rescale, u = t + s, p = e, f = -s, g = i, b = t + (1 - o - l) * s, m = e + h * i, w = t + (1 - o) * s, y = e + (h + d) * i;
15336
+ v = P._rescale, u = t + s, p = e, f = -s, g = i, b = t + (1 - o - l) * s, m = e + h * i, w = t + (1 - o) * s, y = e + (h + d) * i;
15337
15337
  break;
15338
15338
  case 270:
15339
- v = M._rescaleAndSwap, u = t + s, p = e + i, f = -s, g = -i, b = t + (1 - h - d) * s, m = e + (1 - o - l) * i, w = t + (1 - h) * s, y = e + (1 - o) * i;
15339
+ v = P._rescaleAndSwap, u = t + s, p = e + i, f = -s, g = -i, b = t + (1 - h - d) * s, m = e + (1 - o - l) * i, w = t + (1 - h) * s, y = e + (1 - o) * i;
15340
15340
  break;
15341
15341
  }
15342
15342
  for (const {
@@ -15362,16 +15362,16 @@ class Le extends M {
15362
15362
  let d, u, p, f, g;
15363
15363
  switch (o) {
15364
15364
  case 0:
15365
- g = M._rescale, d = -t / s, u = e / i + 1, p = 1 / s, f = -1 / i;
15365
+ g = P._rescale, d = -t / s, u = e / i + 1, p = 1 / s, f = -1 / i;
15366
15366
  break;
15367
15367
  case 90:
15368
- g = M._rescaleAndSwap, d = -e / i, u = -t / s, p = 1 / i, f = 1 / s;
15368
+ g = P._rescaleAndSwap, d = -e / i, u = -t / s, p = 1 / i, f = 1 / s;
15369
15369
  break;
15370
15370
  case 180:
15371
- g = M._rescale, d = t / s + 1, u = -e / i, p = -1 / s, f = 1 / i;
15371
+ g = P._rescale, d = t / s + 1, u = -e / i, p = -1 / s, f = 1 / i;
15372
15372
  break;
15373
15373
  case 270:
15374
- g = M._rescaleAndSwap, d = e / i + 1, u = t / s + 1, p = -1 / i, f = -1 / s;
15374
+ g = P._rescaleAndSwap, d = e / i + 1, u = t / s + 1, p = -1 / i, f = -1 / s;
15375
15375
  break;
15376
15376
  }
15377
15377
  if (!r) {
@@ -15390,9 +15390,9 @@ class Le extends M {
15390
15390
  r.push(y);
15391
15391
  let [v, A, x, _] = m.subarray(0, 4);
15392
15392
  y.set([NaN, NaN, NaN, NaN, v, A], 0);
15393
- for (let S = 4; S < w; S += 2) {
15394
- const E = m[S], P = m[S + 1];
15395
- y.set(M.createBezierPoints(v, A, x, _, E, P), (S - 2) * 3), [v, A, x, _] = [x, _, E, P];
15393
+ for (let E = 4; E < w; E += 2) {
15394
+ const S = m[E], M = m[E + 1];
15395
+ y.set(P.createBezierPoints(v, A, x, _, S, M), (E - 2) * 3), [v, A, x, _] = [x, _, S, M];
15396
15396
  }
15397
15397
  }
15398
15398
  }
@@ -15457,7 +15457,7 @@ class Le extends M {
15457
15457
  };
15458
15458
  }
15459
15459
  get viewBox() {
15460
- return this.#t.map(M.svgRound).join(" ");
15460
+ return this.#t.map(P.svgRound).join(" ");
15461
15461
  }
15462
15462
  get defaultProperties() {
15463
15463
  const [t, e] = this.#t;
@@ -15466,7 +15466,7 @@ class Le extends M {
15466
15466
  viewBox: this.viewBox
15467
15467
  },
15468
15468
  path: {
15469
- "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`
15469
+ "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
15470
15470
  }
15471
15471
  };
15472
15472
  }
@@ -15486,15 +15486,15 @@ class Le extends M {
15486
15486
  default:
15487
15487
  return "";
15488
15488
  }
15489
- return `matrix(${s} ${i} ${n} ${r} ${M.svgRound(a)} ${M.svgRound(o)})`;
15489
+ return `matrix(${s} ${i} ${n} ${r} ${P.svgRound(a)} ${P.svgRound(o)})`;
15490
15490
  }
15491
15491
  getPathResizingSVGProperties([t, e, s, i]) {
15492
15492
  const [n, r] = this.#h(), [a, o, h, l] = this.#t;
15493
- if (Math.abs(h - n) <= M.PRECISION || Math.abs(l - r) <= M.PRECISION) {
15493
+ if (Math.abs(h - n) <= P.PRECISION || Math.abs(l - r) <= P.PRECISION) {
15494
15494
  const g = t + s / 2 - (a + h / 2), b = e + i / 2 - (o + l / 2);
15495
15495
  return {
15496
15496
  path: {
15497
- "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15497
+ "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15498
15498
  transform: `${this.rotationTransform} translate(${g} ${b})`
15499
15499
  }
15500
15500
  };
@@ -15502,26 +15502,26 @@ class Le extends M {
15502
15502
  const d = (s - 2 * n) / (h - 2 * n), u = (i - 2 * r) / (l - 2 * r), p = h / s, f = l / i;
15503
15503
  return {
15504
15504
  path: {
15505
- "transform-origin": `${M.svgRound(a)} ${M.svgRound(o)}`,
15506
- transform: `${this.rotationTransform} scale(${p} ${f}) translate(${M.svgRound(n)} ${M.svgRound(r)}) scale(${d} ${u}) translate(${M.svgRound(-n)} ${M.svgRound(-r)})`
15505
+ "transform-origin": `${P.svgRound(a)} ${P.svgRound(o)}`,
15506
+ transform: `${this.rotationTransform} scale(${p} ${f}) translate(${P.svgRound(n)} ${P.svgRound(r)}) scale(${d} ${u}) translate(${P.svgRound(-n)} ${P.svgRound(-r)})`
15507
15507
  }
15508
15508
  };
15509
15509
  }
15510
15510
  getPathResizedSVGProperties([t, e, s, i]) {
15511
15511
  const [n, r] = this.#h(), a = this.#t, [o, h, l, d] = a;
15512
- if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <= M.PRECISION || Math.abs(d - r) <= M.PRECISION) {
15512
+ if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <= P.PRECISION || Math.abs(d - r) <= P.PRECISION) {
15513
15513
  const b = t + s / 2 - (o + l / 2), m = e + i / 2 - (h + d / 2);
15514
15514
  for (const {
15515
15515
  line: w,
15516
15516
  points: y
15517
15517
  } of this.#s)
15518
- M._translate(w, b, m, w), M._translate(y, b, m, y);
15518
+ P._translate(w, b, m, w), P._translate(y, b, m, y);
15519
15519
  return {
15520
15520
  root: {
15521
15521
  viewBox: this.viewBox
15522
15522
  },
15523
15523
  path: {
15524
- "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15524
+ "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15525
15525
  transform: this.rotationTransform || null,
15526
15526
  d: this.toSVGPath()
15527
15527
  }
@@ -15533,13 +15533,13 @@ class Le extends M {
15533
15533
  line: b,
15534
15534
  points: m
15535
15535
  } of this.#s)
15536
- M._rescale(b, f, g, u, p, b), M._rescale(m, f, g, u, p, m);
15536
+ P._rescale(b, f, g, u, p, b), P._rescale(m, f, g, u, p, m);
15537
15537
  return {
15538
15538
  root: {
15539
15539
  viewBox: this.viewBox
15540
15540
  },
15541
15541
  path: {
15542
- "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15542
+ "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15543
15543
  transform: this.rotationTransform || null,
15544
15544
  d: this.toSVGPath()
15545
15545
  }
@@ -15552,7 +15552,7 @@ class Le extends M {
15552
15552
  line: h,
15553
15553
  points: l
15554
15554
  } of this.#s)
15555
- M._translate(h, a, o, h), M._translate(l, a, o, l);
15555
+ P._translate(h, a, o, h), P._translate(l, a, o, l);
15556
15556
  else {
15557
15557
  const h = this.#a / i, l = this.#r / n;
15558
15558
  this.#a = i, this.#r = n;
@@ -15560,7 +15560,7 @@ class Le extends M {
15560
15560
  line: d,
15561
15561
  points: u
15562
15562
  } of this.#s)
15563
- M._rescale(d, a, o, h, l, d), M._rescale(u, a, o, h, l, u);
15563
+ P._rescale(d, a, o, h, l, d), P._rescale(u, a, o, h, l, u);
15564
15564
  r[2] *= h, r[3] *= l;
15565
15565
  }
15566
15566
  return r[0] = t, r[1] = e, {
@@ -15569,7 +15569,7 @@ class Le extends M {
15569
15569
  },
15570
15570
  path: {
15571
15571
  d: this.toSVGPath(),
15572
- "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`
15572
+ "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
15573
15573
  }
15574
15574
  };
15575
15575
  }
@@ -15584,7 +15584,7 @@ class Le extends M {
15584
15584
  },
15585
15585
  path: {
15586
15586
  d: this.toSVGPath(),
15587
- "transform-origin": `${M.svgRound(t[0])} ${M.svgRound(t[1])}`,
15587
+ "transform-origin": `${P.svgRound(t[0])} ${P.svgRound(t[1])}`,
15588
15588
  transform: this.rotationTransform || null
15589
15589
  },
15590
15590
  bbox: t
@@ -15632,7 +15632,7 @@ class Gs extends $ {
15632
15632
  return !0;
15633
15633
  }
15634
15634
  static get typesMap() {
15635
- return L(this, "typesMap", /* @__PURE__ */ new Map([[O.INK_THICKNESS, "stroke-width"], [O.INK_COLOR, "stroke"], [O.INK_OPACITY, "stroke-opacity"]]));
15635
+ return L(this, "typesMap", /* @__PURE__ */ new Map([[B.INK_THICKNESS, "stroke-width"], [B.INK_COLOR, "stroke"], [B.INK_OPACITY, "stroke-opacity"]]));
15636
15636
  }
15637
15637
  static createDrawerInstance(t, e, s, i, n) {
15638
15638
  return new ha(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
@@ -15695,7 +15695,7 @@ class Gs extends $ {
15695
15695
  return this._colorPicker ||= new Te(this), [["colorPicker", this._colorPicker]];
15696
15696
  }
15697
15697
  get colorType() {
15698
- return O.INK_COLOR;
15698
+ return B.INK_COLOR;
15699
15699
  }
15700
15700
  get color() {
15701
15701
  return this._drawingOptions.stroke;
@@ -15859,20 +15859,20 @@ class ee {
15859
15859
  continue;
15860
15860
  }
15861
15861
  let A = this.#i[2 * v], x = this.#i[2 * v + 1];
15862
- const _ = l + A, S = d + x;
15863
- f = _, g = S;
15864
- let E = l, P = d;
15862
+ const _ = l + A, E = d + x;
15863
+ f = _, g = E;
15864
+ let S = l, M = d;
15865
15865
  for (; ; ) {
15866
- const C = this.#a(r, e, E, P, f, g, 1);
15866
+ const C = this.#a(r, e, S, M, f, g, 1);
15867
15867
  A = this.#i[2 * C], x = this.#i[2 * C + 1];
15868
- const H = E + A, V = P + x;
15868
+ const H = S + A, V = M + x;
15869
15869
  b.push(V, H);
15870
- const N = E * e + P;
15871
- if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === d && E === _ && P === S) {
15870
+ const N = S * e + M;
15871
+ if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === d && S === _ && M === E) {
15872
15872
  r[u] !== 1 && (o = Math.abs(r[u]));
15873
15873
  break;
15874
15874
  } else
15875
- f = E, g = P, E = H, P = V;
15875
+ f = S, g = M, S = H, M = V;
15876
15876
  }
15877
15877
  }
15878
15878
  }
@@ -15887,8 +15887,8 @@ class ee {
15887
15887
  const n = t[e], r = t[e + 1], a = t[s - 4] - n, o = t[s - 3] - r, h = Math.hypot(a, o), l = a / h, d = o / h, u = l * r - d * n, p = o / a, f = 1 / h, g = Math.atan(p), b = Math.cos(g), m = Math.sin(g), w = f * (Math.abs(b) + Math.abs(m)), y = f * (1 - w + w ** 2), v = Math.max(Math.atan(Math.abs(m + b) * y), Math.atan(Math.abs(m - b) * y));
15888
15888
  let A = 0, x = e;
15889
15889
  for (let _ = e + 2; _ < s - 2; _ += 2) {
15890
- const S = Math.abs(u - l * t[_ + 1] + d * t[_]);
15891
- S > A && (x = _, A = S);
15890
+ const E = Math.abs(u - l * t[_ + 1] + d * t[_]);
15891
+ E > A && (x = _, A = E);
15892
15892
  }
15893
15893
  A > (h * v) ** 2 ? (this.#n(t, e, x + 2, i), this.#n(t, x, s, i)) : i.push(n, r);
15894
15894
  }
@@ -15914,12 +15914,12 @@ class ee {
15914
15914
  for (let x = 0; x < r; x++) {
15915
15915
  const _ = g + x - h;
15916
15916
  if (!(_ < 0 || _ >= s))
15917
- for (let S = 0; S < r; S++) {
15918
- const E = b + S - h;
15919
- if (E < 0 || E >= e)
15917
+ for (let E = 0; E < r; E++) {
15918
+ const S = b + E - h;
15919
+ if (S < 0 || S >= e)
15920
15920
  continue;
15921
- const P = t[_ * e + E], C = a[x * r + S] * l[Math.abs(P - w)];
15922
- y += P * C, v += C;
15921
+ const M = t[_ * e + S], C = a[x * r + E] * l[Math.abs(M - w)];
15922
+ y += M * C, v += C;
15923
15923
  }
15924
15924
  }
15925
15925
  const A = p[m] = Math.round(y / v);
@@ -16005,10 +16005,10 @@ class ee {
16005
16005
  alpha: !0,
16006
16006
  willReadFrequently: !0
16007
16007
  }), l.font = u, l.filter = "grayscale(1)", l.fillStyle = "white", l.fillRect(0, 0, A, x), l.fillStyle = "black", l.fillText(t, A * (v - 1) / 2, x * (3 - v) / 2);
16008
- const _ = this.#u(l.getImageData(0, 0, A, x).data), S = this.#h(_), E = this.#d(S), P = this.#r(_, A, x, E);
16008
+ const _ = this.#u(l.getImageData(0, 0, A, x).data), E = this.#h(_), S = this.#d(E), M = this.#r(_, A, x, S);
16009
16009
  return this.processDrawnLines({
16010
16010
  lines: {
16011
- curves: P,
16011
+ curves: M,
16012
16012
  width: A,
16013
16013
  height: x
16014
16014
  },
@@ -16066,11 +16066,11 @@ class ee {
16066
16066
  A[0] = y[0] * f, A[1] = y[1] * g, x.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
16067
16067
  continue;
16068
16068
  }
16069
- let [_, S, E, P] = y;
16070
- _ *= f, S *= g, E *= f, P *= g, A.set([_, S, E, P], 0), x.set([NaN, NaN, NaN, NaN, _, S], 0);
16069
+ let [_, E, S, M] = y;
16070
+ _ *= f, E *= g, S *= f, M *= g, A.set([_, E, S, M], 0), x.set([NaN, NaN, NaN, NaN, _, E], 0);
16071
16071
  for (let C = 4; C < v; C += 2) {
16072
16072
  const H = A[C] = y[C] * f, V = A[C + 1] = y[C + 1] * g;
16073
- x.set(M.createBezierPoints(_, S, E, P, H, V), (C - 2) * 3), [_, S, E, P] = [E, P, H, V];
16073
+ x.set(P.createBezierPoints(_, E, S, M, H, V), (C - 2) * 3), [_, E, S, M] = [S, M, H, V];
16074
16074
  }
16075
16075
  }
16076
16076
  if (u.length === 0)
@@ -16118,11 +16118,11 @@ class ee {
16118
16118
  }
16119
16119
  g.close();
16120
16120
  const m = await new Response(f.readable).arrayBuffer(), w = new Uint8Array(m);
16121
- return Ei(w);
16121
+ return Si(w);
16122
16122
  }
16123
16123
  static async decompressSignature(t) {
16124
16124
  try {
16125
- const e = Sn(t), {
16125
+ const e = En(t), {
16126
16126
  readable: s,
16127
16127
  writable: i
16128
16128
  } = new DecompressionStream("deflate-raw"), n = i.getWriter();
@@ -16166,7 +16166,7 @@ class ee {
16166
16166
  height: d
16167
16167
  };
16168
16168
  } catch (e) {
16169
- return I(`decompressSignature: ${e}`), null;
16169
+ return R(`decompressSignature: ${e}`), null;
16170
16170
  }
16171
16171
  }
16172
16172
  }
@@ -16769,25 +16769,25 @@ class la extends D {
16769
16769
  creationDate: x,
16770
16770
  modificationDate: _
16771
16771
  },
16772
- container: S,
16772
+ container: E,
16773
16773
  parent: {
16774
16774
  page: {
16775
- pageNumber: E
16775
+ pageNumber: S
16776
16776
  }
16777
16777
  },
16778
- canvas: P
16778
+ canvas: M
16779
16779
  } = t;
16780
16780
  let C, H;
16781
- P ? (delete t.canvas, {
16781
+ M ? (delete t.canvas, {
16782
16782
  id: C,
16783
16783
  bitmap: H
16784
- } = s.imageManager.getFromCanvas(S.id, P), P.remove()) : (n = !0, t._hasNoCanvas = !0);
16784
+ } = s.imageManager.getFromCanvas(E.id, M), M.remove()) : (n = !0, t._hasNoCanvas = !0);
16785
16785
  const V = (await e._structTree.getAriaAttributes(`${se}${m}`))?.get("aria-label") || "";
16786
16786
  i = t = {
16787
16787
  annotationType: F.STAMP,
16788
16788
  bitmapId: C,
16789
16789
  bitmap: H,
16790
- pageIndex: E - 1,
16790
+ pageIndex: S - 1,
16791
16791
  rect: g.slice(0),
16792
16792
  rotation: b,
16793
16793
  annotationElementId: m,
@@ -17014,7 +17014,7 @@ class Lt {
17014
17014
  if (l.toggle("getElements", !1), !this.div.contains(d[0]))
17015
17015
  return;
17016
17016
  let u;
17017
- const p = new RegExp(`^${Se}[0-9]+$`);
17017
+ const p = new RegExp(`^${Ee}[0-9]+$`);
17018
17018
  for (const g of d)
17019
17019
  if (p.test(g.id)) {
17020
17020
  u = g.id;
@@ -17198,7 +17198,7 @@ class Lt {
17198
17198
  combinedSignal(t) {
17199
17199
  return this.#c.combinedSignal(t);
17200
17200
  }
17201
- #E(t) {
17201
+ #S(t) {
17202
17202
  const e = this.#y;
17203
17203
  return e ? new e.prototype.constructor(t) : null;
17204
17204
  }
@@ -17210,7 +17210,7 @@ class Lt {
17210
17210
  const {
17211
17211
  offsetX: s,
17212
17212
  offsetY: i
17213
- } = this.#_(), n = this.getNextId(), r = this.#E({
17213
+ } = this.#_(), n = this.getNextId(), r = this.#S({
17214
17214
  parent: this,
17215
17215
  id: n,
17216
17216
  x: s,
@@ -17225,7 +17225,7 @@ class Lt {
17225
17225
  return await Lt.#g.get(t.annotationType ?? t.annotationEditorType)?.deserialize(t, this, this.#c) || null;
17226
17226
  }
17227
17227
  createAndAddNewEditor(t, e, s = {}) {
17228
- const i = this.getNextId(), n = this.#E({
17228
+ const i = this.getNextId(), n = this.#S({
17229
17229
  parent: this,
17230
17230
  id: i,
17231
17231
  x: t.offsetX,
@@ -17503,18 +17503,18 @@ class lt {
17503
17503
  }
17504
17504
  }
17505
17505
  globalThis._pdfjsTestingUtils = {
17506
- HighlightOutliner: Ms
17506
+ HighlightOutliner: Ps
17507
17507
  };
17508
17508
  globalThis.pdfjsLib = {
17509
17509
  AbortException: $t,
17510
17510
  AnnotationEditorLayer: Lt,
17511
- AnnotationEditorParamsType: O,
17511
+ AnnotationEditorParamsType: B,
17512
17512
  AnnotationEditorType: F,
17513
17513
  AnnotationEditorUIManager: zt,
17514
17514
  AnnotationLayer: Vs,
17515
- AnnotationMode: Bt,
17515
+ AnnotationMode: Ot,
17516
17516
  AnnotationType: it,
17517
- applyOpacity: Rn,
17517
+ applyOpacity: In,
17518
17518
  build: Hr,
17519
17519
  ColorPicker: xt,
17520
17520
  createValidAbsoluteUrl: Ai,
@@ -17522,24 +17522,24 @@ globalThis.pdfjsLib = {
17522
17522
  DOMSVGFactory: Ye,
17523
17523
  DrawLayer: lt,
17524
17524
  FeatureTest: at,
17525
- fetchData: Pe,
17526
- findContrastColor: In,
17525
+ fetchData: Me,
17526
+ findContrastColor: Rn,
17527
17527
  getDocument: Gi,
17528
- getFilenameFromUrl: En,
17528
+ getFilenameFromUrl: Sn,
17529
17529
  getPdfFilenameFromUrl: Cn,
17530
17530
  getRGB: De,
17531
- getUuid: Si,
17532
- getXfaPageViewport: Mn,
17531
+ getUuid: Ei,
17532
+ getXfaPageViewport: Pn,
17533
17533
  GlobalWorkerOptions: qt,
17534
17534
  ImageKind: je,
17535
17535
  InvalidPDFException: ys,
17536
17536
  isDataScheme: Ze,
17537
- isPdfFile: Is,
17537
+ isPdfFile: Rs,
17538
17538
  isValidExplicitDest: Gn,
17539
17539
  MathClamp: ut,
17540
17540
  noContextMenu: _t,
17541
17541
  normalizeUnicode: xn,
17542
- OPS: Ee,
17542
+ OPS: Se,
17543
17543
  OutputScale: kt,
17544
17544
  PasswordResponses: pn,
17545
17545
  PDFDataRangeTransport: ji,
@@ -17547,7 +17547,7 @@ globalThis.pdfjsLib = {
17547
17547
  PDFWorker: Cs,
17548
17548
  PermissionFlag: un,
17549
17549
  PixelsPerInch: ce,
17550
- RenderingCancelledException: Rs,
17550
+ RenderingCancelledException: Is,
17551
17551
  renderRichText: Ti,
17552
17552
  ResponseException: We,
17553
17553
  setLayerDimensions: Wt,
@@ -17878,9 +17878,10 @@ class fa {
17878
17878
  this.element.appendChild(e), this.fieldElements.set(t.id, e);
17879
17879
  });
17880
17880
  }
17881
+ selectedFieldId = null;
17881
17882
  createFieldElement(t) {
17882
17883
  const e = document.createElement("div");
17883
- e.className = "sc-signature-field", e.dataset.id = t.id, e.dataset.moveable = String(t.draggable !== !1), e.style.position = "absolute", e.style.pointerEvents = "auto", e.style.boxSizing = "border-box", e.style.border = "1px solid #0056b3", e.style.backgroundColor = "rgba(0, 86, 179, 0.1)", e.style.cursor = t.draggable !== !1 ? "move" : "default", t.style && Object.assign(e.style, t.style);
17884
+ e.className = "sc-signature-field", e.dataset.id = t.id, e.dataset.moveable = String(t.draggable !== !1), e.style.position = "absolute", e.style.pointerEvents = "auto", e.style.boxSizing = "border-box", e.style.border = "1px solid #7FA1C3", e.style.backgroundColor = "rgba(127, 161, 195, 0.1)", e.style.cursor = t.draggable !== !1 ? "move" : "default", t.style && Object.assign(e.style, t.style);
17884
17885
  const s = document.createElement("div");
17885
17886
  if (s.className = "sc-field-content", s.style.overflow = "hidden", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", t.type === "text")
17886
17887
  s.textContent = t.content || "", s.style.whiteSpace = "pre-wrap", s.style.fontSize = "7pt", s.style.fontFamily = "sans-serif", s.style.lineHeight = "1.2", s.style.textAlign = "center";
@@ -17893,12 +17894,20 @@ class fa {
17893
17894
  const i = document.createElement("img");
17894
17895
  i.src = t.content || "", i.style.maxWidth = "100%", i.style.maxHeight = "100%", i.style.pointerEvents = "none", s.appendChild(i);
17895
17896
  }
17896
- return e.appendChild(s), t.resizable !== !1 && this.addResizeHandles(e), t.deletable !== !1 && this.addDeleteButton(e, t.id), this.updateElementPosition(e, t), e;
17897
+ return e.addEventListener("mousedown", (i) => {
17898
+ this.eventBus.emit("field:focus", { fieldId: t.id });
17899
+ }), e.addEventListener("touchstart", (i) => {
17900
+ this.eventBus.emit("field:focus", { fieldId: t.id });
17901
+ }, { passive: !1 }), e.appendChild(s), t.resizable !== !1 && this.addResizeHandles(e), t.deletable !== !1 && this.addDeleteButton(e, t.id), e.addEventListener("mouseenter", () => {
17902
+ this.selectedFieldId !== t.id && this.updateVisuals(e, t, !0, !1);
17903
+ }), e.addEventListener("mouseleave", () => {
17904
+ this.selectedFieldId !== t.id && this.updateVisuals(e, t, !1, !1);
17905
+ }), this.updateElementPosition(e, t), this.selectedFieldId === t.id && this.updateVisuals(e, t, !0, !0), e;
17897
17906
  }
17898
17907
  addResizeHandles(t) {
17899
17908
  ["nw", "ne", "sw", "se", "n", "e", "s", "w"].forEach((e) => {
17900
17909
  const s = document.createElement("div");
17901
- s.className = `sc-resize-handle sc-resize-${e}`, s.dataset.handle = e, s.style.position = "absolute", s.style.backgroundColor = "white", s.style.border = "1px solid #0056b3", s.style.zIndex = "2", s.style.boxSizing = "border-box";
17910
+ s.className = `sc-resize-handle sc-resize-${e}`, s.dataset.handle = e, s.style.position = "absolute", s.style.backgroundColor = "white", s.style.border = "1px solid #0056b3", s.style.zIndex = "2", s.style.boxSizing = "border-box", s.style.display = "none";
17902
17911
  const i = "8px", n = "6px", r = "14px";
17903
17912
  switch (e) {
17904
17913
  // Corners
@@ -17933,12 +17942,25 @@ class fa {
17933
17942
  }
17934
17943
  addDeleteButton(t, e) {
17935
17944
  const s = document.createElement("div");
17936
- s.className = "sc-delete-btn", s.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>', s.title = "Delete Field", s.style.position = "absolute", s.style.top = "0", s.style.right = "0", s.style.transform = "translate(50%, -50%)", s.style.width = "20px", s.style.height = "20px", s.style.borderRadius = "50%", s.style.backgroundColor = "#ff4d4f", s.style.color = "white", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", s.style.cursor = "pointer", s.style.zIndex = "20", s.style.boxShadow = "0 2px 4px rgba(0,0,0,0.2)", s.style.opacity = "0", s.style.transition = "opacity 0.2s", t.addEventListener("mouseenter", () => s.style.opacity = "1"), t.addEventListener("mouseleave", () => s.style.opacity = "0"), s.addEventListener("click", (i) => {
17945
+ s.className = "sc-delete-btn", s.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>', s.title = "Delete Field", s.style.position = "absolute", s.style.top = "0", s.style.right = "0", s.style.transform = "translate(50%, -50%)", s.style.width = "20px", s.style.height = "20px", s.style.borderRadius = "50%", s.style.backgroundColor = "#ff4d4f", s.style.color = "white", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", s.style.cursor = "pointer", s.style.zIndex = "20", s.style.boxShadow = "0 2px 4px rgba(0,0,0,0.2)", s.style.display = "none", s.addEventListener("click", (i) => {
17937
17946
  i.preventDefault(), i.stopPropagation(), this.eventBus.emit("field:delete", { fieldId: e });
17938
17947
  }), s.addEventListener("touchstart", (i) => {
17939
17948
  i.preventDefault(), i.stopPropagation(), this.eventBus.emit("field:delete", { fieldId: e });
17940
17949
  }, { passive: !1 }), t.appendChild(s);
17941
17950
  }
17951
+ select(t) {
17952
+ this.selectedFieldId = t, this.fields.forEach((e) => {
17953
+ const s = this.fieldElements.get(e.id);
17954
+ if (!s) return;
17955
+ const i = e.id === t;
17956
+ this.updateVisuals(s, e, i, i);
17957
+ });
17958
+ }
17959
+ updateVisuals(t, e, s, i) {
17960
+ t.querySelectorAll(".sc-resize-handle").forEach((r) => r.style.display = s ? "block" : "none");
17961
+ const n = t.querySelector(".sc-delete-btn");
17962
+ n && (n.style.display = s ? "flex" : "none"), i ? (t.style.border = "1px solid #0056b3", t.style.backgroundColor = "rgba(0, 86, 179, 0.1)") : s ? (t.style.border = "1px solid #0056b3", t.style.backgroundColor = "rgba(0, 86, 179, 0.05)") : (t.style.border = e.style?.border || "1px solid #7FA1C3", t.style.backgroundColor = e.style?.backgroundColor || "rgba(127, 161, 195, 0.1)");
17963
+ }
17942
17964
  updatePositions() {
17943
17965
  this.pageHeight !== 0 && this.fields.forEach((t) => {
17944
17966
  const e = this.fieldElements.get(t.id);
@@ -17973,7 +17995,7 @@ class sn {
17973
17995
  eventBus;
17974
17996
  element;
17975
17997
  constructor(t) {
17976
- this.container = t.container, this.pageIndex = t.pageIndex, this.scale = t.scale, this.eventBus = t.eventBus, this.element = document.createElement("div"), this.element.className = "page-view", this.element.dataset.pageIndex = this.pageIndex.toString(), this.element.style.position = "relative", this.element.style.flexShrink = "0", this.element.style.boxShadow = "0 2px 8px rgba(0,0,0,0.15)", this.canvasLayer = new da(), this.element.appendChild(this.canvasLayer.getElement()), this.signatureLayer = new fa(this.eventBus), this.element.appendChild(this.signatureLayer.getElement()), t.pageDimensions && this.signatureLayer.setPageDimensions(
17998
+ this.container = t.container, this.pageIndex = t.pageIndex, this.scale = t.scale, this.eventBus = t.eventBus, this.element = document.createElement("div"), this.element.className = "page-view", this.element.dataset.pageIndex = this.pageIndex.toString(), this.element.style.position = "relative", this.element.style.flexShrink = "0", this.element.style.boxShadow = "0 2px 8px rgba(0,0,0,0.15)", this.element.style.margin = "0 auto", this.canvasLayer = new da(), this.element.appendChild(this.canvasLayer.getElement()), this.signatureLayer = new fa(this.eventBus), this.element.appendChild(this.signatureLayer.getElement()), t.pageDimensions && this.signatureLayer.setPageDimensions(
17977
17999
  t.pageDimensions.width,
17978
18000
  t.pageDimensions.height,
17979
18001
  this.scale
@@ -17987,6 +18009,9 @@ class sn {
17987
18009
  setFields(t) {
17988
18010
  this.signatureLayer.setFields(t);
17989
18011
  }
18012
+ selectField(t) {
18013
+ this.signatureLayer.select(t);
18014
+ }
17990
18015
  async render() {
17991
18016
  if (!this.pdfPage) return;
17992
18017
  const t = this.pdfPage.getViewport({ scale: this.scale });
@@ -18049,7 +18074,7 @@ class ma {
18049
18074
  this.container = t, this.pdfDocument = e, this.eventBus = s, this.totalPages = e.numPages, this.scale = i ?? 1, this.pageInfo = n ?? /* @__PURE__ */ new Map(), this.initContainer(), await this.renderCurrentPage();
18050
18075
  }
18051
18076
  initContainer() {
18052
- this.container.innerHTML = "", this.container.style.position = "relative", this.container.style.overflow = "auto", this.container.style.display = "flex", this.container.style.flexDirection = "column", this.container.style.alignItems = "center", this.container.style.padding = "20px", this.pageContainer = document.createElement("div"), this.pageContainer.className = "single-page-container", this.container.appendChild(this.pageContainer);
18077
+ this.container.innerHTML = "", this.container.style.position = "relative", this.container.style.overflow = "auto", this.container.style.display = "flex", this.container.style.flexDirection = "column", this.container.style.alignItems = "", this.container.style.padding = "20px", this.pageContainer = document.createElement("div"), this.pageContainer.className = "single-page-container", this.container.appendChild(this.pageContainer);
18053
18078
  }
18054
18079
  async renderCurrentPage() {
18055
18080
  this.pageView && (this.pageView.destroy(), this.pageView = null), this.pageContainer.innerHTML = "";
@@ -18061,7 +18086,7 @@ class ma {
18061
18086
  eventBus: this.eventBus,
18062
18087
  pageDimensions: e
18063
18088
  });
18064
- const s = this.fields.filter((i) => i.pageIndex === t);
18089
+ const s = this.fields.filter((i) => i.pageNumber === t + 1);
18065
18090
  this.pageView.setFields(s), this.pdfDocument.getPage(this.currentPage).then((i) => {
18066
18091
  this.pageView && this.pageView.pageIndex === i.pageNumber - 1 && this.pageView.setPdfPage(i);
18067
18092
  }).catch((i) => {
@@ -18087,7 +18112,10 @@ class ma {
18087
18112
  return this.totalPages;
18088
18113
  }
18089
18114
  setScale(t) {
18090
- this.scale = t, this.pageView && this.pageView.updateScalePreview(t), this.eventBus.emit("scale:change", { scale: t }), this.zoomTimeout && clearTimeout(this.zoomTimeout), this.zoomTimeout = setTimeout(() => {
18115
+ const e = this.scale, s = t, i = this.container, n = i.clientWidth, r = i.clientHeight, a = i.scrollLeft, o = i.scrollTop, h = a + n / 2, l = o + r / 2, d = s / e;
18116
+ this.scale = t, this.pageView && this.pageView.updateScalePreview(t), this.eventBus.emit("scale:change", { scale: t });
18117
+ const u = h * d - n / 2, p = l * d - r / 2;
18118
+ i.scrollLeft = u, i.scrollTop = p, this.zoomTimeout && clearTimeout(this.zoomTimeout), this.zoomTimeout = setTimeout(() => {
18091
18119
  this.pageView && this.pageView.updateScaleFull(t), this.zoomTimeout = null;
18092
18120
  }, 150);
18093
18121
  }
@@ -18096,10 +18124,13 @@ class ma {
18096
18124
  }
18097
18125
  setFields(t) {
18098
18126
  if (this.fields = t, this.pageView) {
18099
- const e = this.fields.filter((s) => s.pageIndex === this.currentPage - 1);
18127
+ const e = this.fields.filter((s) => s.pageNumber === this.currentPage);
18100
18128
  this.pageView.setFields(e);
18101
18129
  }
18102
18130
  }
18131
+ selectField(t) {
18132
+ this.pageView?.selectField(t);
18133
+ }
18103
18134
  destroy() {
18104
18135
  this.zoomTimeout && (clearTimeout(this.zoomTimeout), this.zoomTimeout = null), this.pageView && (this.pageView.destroy(), this.pageView = null), this.container.innerHTML = "";
18105
18136
  }
@@ -18121,7 +18152,7 @@ class ba {
18121
18152
  this.isDestroyed = !1, this.container = t, this.pdfDocument = e, this.eventBus = s, this.totalPages = e.numPages, this.scale = i ?? 1, this.pageInfo = n ?? /* @__PURE__ */ new Map(), this.initContainer(), await this.renderAllPages(), this.isDestroyed || this.setupIntersectionObserver();
18122
18153
  }
18123
18154
  initContainer() {
18124
- this.container.innerHTML = "", this.container.style.position = "relative", this.container.style.overflow = "auto", this.container.style.display = "flex", this.container.style.flexDirection = "column", this.container.style.gap = "20px", this.container.style.alignItems = "center", this.container.style.padding = "20px", this.container.scrollTop = 0;
18155
+ this.container.innerHTML = "", this.container.style.position = "relative", this.container.style.overflow = "auto", this.container.style.display = "flex", this.container.style.flexDirection = "column", this.container.style.gap = "20px", this.container.style.alignItems = "", this.container.style.padding = "20px", this.container.scrollTop = 0;
18125
18156
  }
18126
18157
  async renderAllPages() {
18127
18158
  this.pageViews.forEach((t) => t.destroy()), this.pageViews = [];
@@ -18133,7 +18164,7 @@ class ba {
18133
18164
  eventBus: this.eventBus,
18134
18165
  pageDimensions: e
18135
18166
  // Pass dimensions immediately
18136
- }), i = this.fields.filter((n) => n.pageIndex === t - 1);
18167
+ }), i = this.fields.filter((n) => n.pageNumber === t);
18137
18168
  s.setFields(i), this.pageViews.push(s);
18138
18169
  }
18139
18170
  this.pageViews.forEach(async (t, e) => {
@@ -18197,8 +18228,28 @@ class ba {
18197
18228
  return this.totalPages;
18198
18229
  }
18199
18230
  setScale(t) {
18200
- this.scale = t, this.pageViews.forEach((e) => e.updateScalePreview(t)), this.eventBus.emit("scale:change", { scale: t }), this.zoomTimeout && clearTimeout(this.zoomTimeout), this.zoomTimeout = setTimeout(() => {
18201
- this.pageViews.forEach((e) => e.updateScaleFull(t)), this.zoomTimeout = null;
18231
+ const e = this.scale, s = this.container, i = s.clientHeight, n = s.scrollTop + i / 2;
18232
+ let r = -1, a = 0;
18233
+ for (let o = 0; o < this.pageViews.length; o++) {
18234
+ const h = this.pageViews[o], l = h.element.offsetTop, d = h.element.offsetHeight, u = l + d;
18235
+ if (n < u) {
18236
+ r = o, a = (n - l) / d;
18237
+ break;
18238
+ }
18239
+ }
18240
+ if (r === -1 && this.pageViews.length > 0) {
18241
+ r = this.pageViews.length - 1;
18242
+ const o = this.pageViews[r];
18243
+ a = (n - o.element.offsetTop) / o.element.offsetHeight;
18244
+ }
18245
+ if (this.scale = t, this.pageViews.forEach((o) => o.updateScalePreview(t)), this.eventBus.emit("scale:change", { scale: t }), r !== -1) {
18246
+ const o = this.pageViews[r], h = o.element.offsetTop, l = o.element.offsetHeight, d = h + a * l;
18247
+ s.scrollTop = d - i / 2;
18248
+ const u = s.clientWidth, p = s.scrollLeft + u / 2, f = t / e;
18249
+ s.scrollLeft = p * f - u / 2;
18250
+ }
18251
+ this.zoomTimeout && clearTimeout(this.zoomTimeout), this.zoomTimeout = setTimeout(() => {
18252
+ this.pageViews.forEach((o) => o.updateScaleFull(t)), this.zoomTimeout = null;
18202
18253
  }, 150);
18203
18254
  }
18204
18255
  getScale() {
@@ -18206,10 +18257,13 @@ class ba {
18206
18257
  }
18207
18258
  setFields(t) {
18208
18259
  this.fields = t, this.pageViews.forEach((e) => {
18209
- const s = this.fields.filter((i) => i.pageIndex === e.pageIndex);
18260
+ const s = this.fields.filter((i) => i.pageNumber === e.pageIndex + 1);
18210
18261
  e.setFields(s);
18211
18262
  });
18212
18263
  }
18264
+ selectField(t) {
18265
+ this.pageViews.forEach((e) => e.selectField(t));
18266
+ }
18213
18267
  destroy() {
18214
18268
  this.isDestroyed = !0, this.zoomTimeout && (clearTimeout(this.zoomTimeout), this.zoomTimeout = null), this.observer && (this.observer.disconnect(), this.observer = null), this.pageViews.forEach((t) => t.destroy()), this.pageViews = [], this.container.innerHTML = "";
18215
18269
  }
@@ -18226,6 +18280,7 @@ class ya {
18226
18280
  readyPromise = null;
18227
18281
  currentScale = 1;
18228
18282
  isDestroyed = !1;
18283
+ selectedFieldId = null;
18229
18284
  constructor(t) {
18230
18285
  this.container = t.container, this.eventBus = new cn(), this.loader = new ca(t.pdfLoaderOptions), this.currentViewMode = t.viewMode ?? "scroll", t.fields && (this.fields = [...t.fields]), this.zoomHandler = new dn({
18231
18286
  container: this.container,
@@ -18237,6 +18292,11 @@ class ya {
18237
18292
  this.handleFieldDrop(e.fieldId, e.clientX, e.clientY, e.elementX, e.elementY);
18238
18293
  }), this.eventBus.on("field:ui:resize", (e) => {
18239
18294
  this.updateField(e.fieldId, e.updates);
18295
+ }), this.eventBus.on("field:focus", (e) => {
18296
+ this.selectField(e.fieldId);
18297
+ }), this.container.addEventListener("mousedown", (e) => {
18298
+ const s = e.target;
18299
+ s.closest(".sc-signature-field") || s.closest(".sc-resize-handle") || s.closest(".sc-delete-btn") || this.selectField(null);
18240
18300
  });
18241
18301
  }
18242
18302
  async load(t) {
@@ -18263,7 +18323,7 @@ class ya {
18263
18323
  this.strategy.destroy();
18264
18324
  return;
18265
18325
  }
18266
- this.fields.length > 0 && this.strategy.setFields(this.fields);
18326
+ this.fields.length > 0 && this.strategy.setFields(this.fields), this.selectedFieldId && this.strategy.selectField(this.selectedFieldId);
18267
18327
  }
18268
18328
  }
18269
18329
  createStrategy(t) {
@@ -18332,15 +18392,15 @@ class ya {
18332
18392
  throw new Error("PDF document not loaded");
18333
18393
  if (!this.strategy)
18334
18394
  throw new Error("PDF viewer not ready. Please wait for PDF to fully load.");
18335
- if (this.readyPromise && await this.readyPromise, t.pageIndex < 0 || t.pageIndex >= this.pdfDocument.numPages)
18336
- throw new Error(`Invalid page index: ${t.pageIndex}. Document has ${this.pdfDocument.numPages} pages.`);
18395
+ if (this.readyPromise && await this.readyPromise, typeof t.pageNumber != "number" || isNaN(t.pageNumber) || t.pageNumber < 1 || t.pageNumber > this.pdfDocument.numPages)
18396
+ throw new Error(`Invalid page number: ${t.pageNumber}. Document has ${this.pdfDocument.numPages} pages.`);
18337
18397
  if (t.rect.width <= 0 || t.rect.height <= 0)
18338
18398
  throw new Error("Field width and height must be greater than 0");
18339
18399
  try {
18340
- let e = this.pageInfo.get(t.pageIndex);
18400
+ let e = this.pageInfo.get(t.pageNumber - 1);
18341
18401
  if (!e) {
18342
- const s = (await this.pdfDocument.getPage(t.pageIndex + 1)).getViewport({ scale: 1 });
18343
- this.pageInfo.set(t.pageIndex, { width: s.width, height: s.height }), e = { width: s.width, height: s.height };
18402
+ const s = (await this.pdfDocument.getPage(t.pageNumber)).getViewport({ scale: 1 });
18403
+ this.pageInfo.set(t.pageNumber - 1, { width: s.width, height: s.height }), e = { width: s.width, height: s.height };
18344
18404
  }
18345
18405
  if (t.rect.x < 0 || t.rect.y < 0)
18346
18406
  throw new Error("Field position out of bounds (negative coordinates).");
@@ -18354,12 +18414,22 @@ class ya {
18354
18414
  this.fields.push(t), this.strategy?.setFields(this.fields), this.eventBus.emit("field:add", t), this.eventBus.emit("fields:change", this.fields);
18355
18415
  }
18356
18416
  removeField(t) {
18357
- this.fields = this.fields.filter((e) => e.id !== t), this.strategy?.setFields(this.fields), this.eventBus.emit("field:remove", { fieldId: t }), this.eventBus.emit("fields:change", this.fields);
18417
+ this.selectedFieldId === t && this.selectField(null), this.fields = this.fields.filter((e) => e.id !== t), this.strategy?.setFields(this.fields), this.eventBus.emit("field:remove", { fieldId: t }), this.eventBus.emit("fields:change", this.fields);
18358
18418
  }
18359
18419
  updateField(t, e) {
18360
18420
  const s = this.fields.findIndex((i) => i.id === t);
18361
18421
  s !== -1 && (this.fields[s] = { ...this.fields[s], ...e }, this.strategy?.setFields(this.fields), this.eventBus.emit("field:update", { fieldId: t, updates: e }), this.eventBus.emit("fields:change", this.fields));
18362
18422
  }
18423
+ selectField(t) {
18424
+ if (this.selectedFieldId === t)
18425
+ return;
18426
+ this.selectedFieldId = t, this.strategy?.selectField(t);
18427
+ let e = null;
18428
+ t && (e = this.fields.find((s) => String(s.id) === String(t)) || null, e || console.warn(`[PdfSignControl] Selection warning: Field with ID "${t}" not found in local state. Available IDs:`, this.fields.map((s) => s.id))), this.eventBus.emit("field:selection-change", { field: e });
18429
+ }
18430
+ clearFields() {
18431
+ this.selectField(null), this.fields = [], this.strategy?.setFields(this.fields), this.eventBus.emit("fields:change", this.fields);
18432
+ }
18363
18433
  handleFieldDrop(t, e, s, i, n) {
18364
18434
  const r = this.fields.find((v) => v.id === t);
18365
18435
  if (!r) return;
@@ -18368,7 +18438,7 @@ class ya {
18368
18438
  const v = Array.from(this.container.querySelectorAll(".page-view"));
18369
18439
  let A = 1 / 0, x = null;
18370
18440
  if (v.forEach((_) => {
18371
- const S = _.getBoundingClientRect(), E = Math.max(S.left, Math.min(i, S.right)), P = Math.max(S.top, Math.min(n, S.bottom)), C = i - E, H = n - P, V = Math.sqrt(C * C + H * H);
18441
+ const E = _.getBoundingClientRect(), S = Math.max(E.left, Math.min(i, E.right)), M = Math.max(E.top, Math.min(n, E.bottom)), C = i - S, H = n - M, V = Math.sqrt(C * C + H * H);
18372
18442
  V < A && (A = V, x = _);
18373
18443
  }), x)
18374
18444
  a = x;
@@ -18382,10 +18452,10 @@ class ya {
18382
18452
  this.strategy?.setFields(this.fields);
18383
18453
  return;
18384
18454
  }
18385
- const h = parseInt(o, 10), l = a.getBoundingClientRect(), d = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / d, g = l.width / d, b = r.rect.width, m = r.rect.height;
18455
+ const h = parseInt(o, 10) + 1, l = a.getBoundingClientRect(), d = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / d, g = l.width / d, b = r.rect.width, m = r.rect.height;
18386
18456
  let w = u / d, y = f - p / d - m;
18387
18457
  w = Math.max(0, Math.min(w, g - b)), y = Math.max(0, Math.min(y, f - m)), this.updateField(t, {
18388
- pageIndex: h,
18458
+ pageNumber: h,
18389
18459
  rect: {
18390
18460
  ...r.rect,
18391
18461
  x: w,
@@ -18469,7 +18539,7 @@ class ya {
18469
18539
  const u = document.createElement("div");
18470
18540
  u.className = "print-page";
18471
18541
  const p = document.createElement("img");
18472
- p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageIndex === a - 1).forEach((f) => {
18542
+ p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageNumber === a).forEach((f) => {
18473
18543
  const g = document.createElement("div");
18474
18544
  g.className = "print-field select-none";
18475
18545
  const b = o.getViewport({ scale: 1 }), m = f.rect.x / b.width * 100, w = (b.height - f.rect.y - f.rect.height) / b.height * 100, y = f.rect.width / b.width * 100, v = f.rect.height / b.height * 100;
@@ -18540,7 +18610,7 @@ class wa {
18540
18610
  return this.viewer.getScale();
18541
18611
  }
18542
18612
  async getPageDimensions(t) {
18543
- return this.viewer.getPageDimensions(t);
18613
+ return this.viewer.getPageDimensions(t - 1);
18544
18614
  }
18545
18615
  // Event handling
18546
18616
  on(t, e) {
@@ -18565,6 +18635,9 @@ class wa {
18565
18635
  updateField(t, e) {
18566
18636
  this.viewer.updateField(t, e);
18567
18637
  }
18638
+ clearFields() {
18639
+ this.viewer.clearFields();
18640
+ }
18568
18641
  async print(t) {
18569
18642
  return this.viewer.print(t);
18570
18643
  }
@@ -18603,7 +18676,10 @@ const xa = on((c, t) => {
18603
18676
  updateField: (n, r) => {
18604
18677
  s.current?.updateField(n, r);
18605
18678
  },
18606
- getFields: () => s.current?.getFields() ?? []
18679
+ getFields: () => s.current?.getFields() ?? [],
18680
+ clearFields: () => {
18681
+ s.current?.clearFields();
18682
+ }
18607
18683
  }));
18608
18684
  const i = rs(c);
18609
18685
  return Vt(() => {
@@ -18619,7 +18695,7 @@ const xa = on((c, t) => {
18619
18695
  i.current.onPageChange?.(n.page, n.total);
18620
18696
  }), s.current.on("scale:change", (n) => {
18621
18697
  i.current.onScaleChange?.(n.scale);
18622
- }), s.current.on("field:add", (n) => i.current.onFieldAdd?.(n)), s.current.on("field:remove", (n) => i.current.onFieldRemove?.(n)), s.current.on("field:update", (n) => i.current.onFieldUpdate?.(n)), s.current.on("fields:change", (n) => i.current.onFieldsChange?.(n)), c.onReady && c.onReady(s.current), () => {
18698
+ }), s.current.on("field:add", (n) => i.current.onFieldAdd?.(n)), s.current.on("field:remove", (n) => i.current.onFieldRemove?.(n)), s.current.on("field:update", (n) => i.current.onFieldUpdate?.(n)), s.current.on("fields:change", (n) => i.current.onFieldsChange?.(n)), s.current.on("field:selection-change", (n) => i.current.onSelectionChange?.(n)), c.onReady && c.onReady(s.current), () => {
18623
18699
  s.current?.destroy(), s.current = null;
18624
18700
  };
18625
18701
  }, []), Vt(() => {