@shznet/pdf-sign-control 0.2.3 → 1.0.0

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
@@ -132,7 +132,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
132
132
  POPUP: 16,
133
133
  SIGNATURE: 101,
134
134
  COMMENT: 102
135
- }, N = {
135
+ }, O = {
136
136
  RESIZE: 1,
137
137
  CREATE: 2,
138
138
  FREETEXT_SIZE: 11,
@@ -502,12 +502,12 @@ class T {
502
502
  }
503
503
  static axialAlignedBoundingBox(t, e, s) {
504
504
  const i = e[0], n = e[1], r = e[2], a = e[3], o = e[4], l = e[5], h = t[0], c = t[1], u = t[2], f = t[3];
505
- let g = i * h + o, p = g, b = i * u + o, m = b, w = a * c + l, y = w, v = a * f + l, A = v;
505
+ let g = i * h + o, p = g, b = i * u + o, m = b, w = a * c + l, y = w, S = a * f + l, A = S;
506
506
  if (n !== 0 || r !== 0) {
507
- const S = n * h, E = n * u, _ = r * c, C = r * f;
508
- g += _, m += _, b += C, p += C, w += S, A += S, v += E, y += E;
507
+ const v = n * h, E = n * u, _ = r * c, C = r * f;
508
+ g += _, m += _, b += C, p += C, w += v, A += v, S += E, y += E;
509
509
  }
510
- s[0] = Math.min(s[0], g, b, p, m), s[1] = Math.min(s[1], w, v, y, A), s[2] = Math.max(s[2], g, b, p, m), s[3] = Math.max(s[3], w, v, y, A);
510
+ s[0] = Math.min(s[0], g, b, p, m), s[1] = Math.min(s[1], w, S, y, A), s[2] = Math.max(s[2], g, b, p, m), s[3] = Math.max(s[3], w, S, y, A);
511
511
  }
512
512
  static inverseTransform(t) {
513
513
  const e = t[0] * t[3] - t[1] * t[2];
@@ -1022,7 +1022,7 @@ function ye(d, t) {
1022
1022
  function _t(d) {
1023
1023
  d.preventDefault();
1024
1024
  }
1025
- function J(d) {
1025
+ function Z(d) {
1026
1026
  d.preventDefault(), d.stopPropagation();
1027
1027
  }
1028
1028
  function vn(d) {
@@ -1089,7 +1089,7 @@ function En(d) {
1089
1089
  }
1090
1090
  t.remove();
1091
1091
  }
1092
- function K(d) {
1092
+ function Q(d) {
1093
1093
  const {
1094
1094
  a: t,
1095
1095
  b: e,
@@ -1351,10 +1351,10 @@ class ve {
1351
1351
  t.stopPropagation();
1352
1352
  }
1353
1353
  #u(t) {
1354
- this.#i._focusEventsAllowed = !1, J(t);
1354
+ this.#i._focusEventsAllowed = !1, Z(t);
1355
1355
  }
1356
1356
  #d(t) {
1357
- this.#i._focusEventsAllowed = !0, J(t);
1357
+ this.#i._focusEventsAllowed = !0, Z(t);
1358
1358
  }
1359
1359
  #f(t) {
1360
1360
  const e = this.#i._uiManager._signal;
@@ -1785,7 +1785,7 @@ class De {
1785
1785
  checker: a = null
1786
1786
  }
1787
1787
  } = s;
1788
- a && !a(t, e) || (i.bind(t, ...r, e)(), n || J(e));
1788
+ a && !a(t, e) || (i.bind(t, ...r, e)(), n || Z(e));
1789
1789
  }
1790
1790
  }
1791
1791
  class Rs {
@@ -1839,7 +1839,7 @@ class $t {
1839
1839
  #k = new Mn();
1840
1840
  #P = !1;
1841
1841
  #M = !1;
1842
- #N = !1;
1842
+ #O = !1;
1843
1843
  #R = null;
1844
1844
  #I = null;
1845
1845
  #B = null;
@@ -1861,7 +1861,7 @@ class $t {
1861
1861
  hasSelectedText: !1
1862
1862
  };
1863
1863
  #$ = [0, 0];
1864
- #O = null;
1864
+ #N = null;
1865
1865
  #G = null;
1866
1866
  #J = null;
1867
1867
  #Z = null;
@@ -1955,7 +1955,7 @@ class $t {
1955
1955
  this.#U?.resolve(), this.#U = null, this.#t?.abort(), this.#t = null, this._signal = null;
1956
1956
  for (const t of this.#a.values())
1957
1957
  t.destroy();
1958
- this.#a.clear(), this.#s.clear(), this.#p.clear(), this.#F?.clear(), this.#e = null, this.#S.clear(), this.#h.destroy(), this.#r?.destroy(), this.#l?.destroy(), this.#H?.destroy(), this.#_?.hide(), this.#_ = null, this.#B?.destroy(), this.#B = null, this.#i = null, this.#E && (clearTimeout(this.#E), this.#E = null), this.#O && (clearTimeout(this.#O), this.#O = null), this._editorUndoBar?.destroy(), this.#W = null;
1958
+ this.#a.clear(), this.#s.clear(), this.#p.clear(), this.#F?.clear(), this.#e = null, this.#S.clear(), this.#h.destroy(), this.#r?.destroy(), this.#l?.destroy(), this.#H?.destroy(), this.#_?.hide(), this.#_ = null, this.#B?.destroy(), this.#B = null, this.#i = null, this.#E && (clearTimeout(this.#E), this.#E = null), this.#N && (clearTimeout(this.#N), this.#N = null), this._editorUndoBar?.destroy(), this.#W = null;
1959
1959
  }
1960
1960
  combinedSignal(t) {
1961
1961
  return AbortSignal.any([this._signal, t.signal]);
@@ -2435,7 +2435,7 @@ class $t {
2435
2435
  Object.entries(t).some(([s, i]) => this.#q[s] !== i) && (this._eventBus.dispatch("annotationeditorstateschanged", {
2436
2436
  source: this,
2437
2437
  details: Object.assign(this.#q, t)
2438
- }), this.#x === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[N.HIGHLIGHT_FREE, !0]]));
2438
+ }), this.#x === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[O.HIGHLIGHT_FREE, !0]]));
2439
2439
  }
2440
2440
  #V(t) {
2441
2441
  this._eventBus.dispatch("annotationeditorparamschanged", {
@@ -2535,10 +2535,10 @@ class $t {
2535
2535
  updateParams(t, e) {
2536
2536
  if (this.#c) {
2537
2537
  switch (t) {
2538
- case N.CREATE:
2538
+ case O.CREATE:
2539
2539
  this.currentLayer.addNewEditor(e);
2540
2540
  return;
2541
- case N.HIGHLIGHT_SHOW_ALL:
2541
+ case O.HIGHLIGHT_SHOW_ALL:
2542
2542
  this._eventBus.dispatch("reporttelemetry", {
2543
2543
  source: this,
2544
2544
  details: {
@@ -2562,11 +2562,11 @@ class $t {
2562
2562
  showAllEditors(t, e, s = !1) {
2563
2563
  for (const n of this.#s.values())
2564
2564
  n.editorType === t && n.show(e);
2565
- (this.#X?.get(N.HIGHLIGHT_SHOW_ALL) ?? !0) !== e && this.#V([[N.HIGHLIGHT_SHOW_ALL, e]]);
2565
+ (this.#X?.get(O.HIGHLIGHT_SHOW_ALL) ?? !0) !== e && this.#V([[O.HIGHLIGHT_SHOW_ALL, e]]);
2566
2566
  }
2567
2567
  enableWaiting(t = !1) {
2568
- if (this.#N !== t) {
2569
- this.#N = t;
2568
+ if (this.#O !== t) {
2569
+ this.#O = t;
2570
2570
  for (const e of this.#a.values())
2571
2571
  t ? e.disableClick() : e.enableClick(), e.div.classList.toggle("waiting", t);
2572
2572
  }
@@ -2759,8 +2759,8 @@ class $t {
2759
2759
  return;
2760
2760
  this.#$[0] += t, this.#$[1] += e;
2761
2761
  const [i, n] = this.#$, r = [...this.#S], a = 1e3;
2762
- this.#O && clearTimeout(this.#O), this.#O = setTimeout(() => {
2763
- this.#O = null, this.#$[0] = this.#$[1] = 0, this.addCommands({
2762
+ this.#N && clearTimeout(this.#N), this.#N = setTimeout(() => {
2763
+ this.#N = null, this.#$[0] = this.#$[1] = 0, this.addCommands({
2764
2764
  cmd: () => {
2765
2765
  for (const o of r)
2766
2766
  this.#s.has(o.id) && (o.translateInPage(i, n), o.translationDone());
@@ -3207,12 +3207,12 @@ class Ie {
3207
3207
  t.addEventListener("contextmenu", _t, {
3208
3208
  signal: s
3209
3209
  }), e && (t.addEventListener("focusin", (n) => {
3210
- this.#s._focusEventsAllowed = !1, J(n);
3210
+ this.#s._focusEventsAllowed = !1, Z(n);
3211
3211
  }, {
3212
3212
  capture: !0,
3213
3213
  signal: s
3214
3214
  }), t.addEventListener("focusout", (n) => {
3215
- this.#s._focusEventsAllowed = !0, J(n);
3215
+ this.#s._focusEventsAllowed = !0, Z(n);
3216
3216
  }, {
3217
3217
  capture: !0,
3218
3218
  signal: s
@@ -3350,7 +3350,7 @@ class ts {
3350
3350
  l.pointerType === "touch" && (this.#o?.abort(), this.#o = null);
3351
3351
  };
3352
3352
  r.addEventListener("pointerdown", (l) => {
3353
- l.pointerType === "touch" && (J(l), o(l));
3353
+ l.pointerType === "touch" && (Z(l), o(l));
3354
3354
  }, a), r.addEventListener("pointerup", o, a), r.addEventListener("pointercancel", o, a);
3355
3355
  return;
3356
3356
  }
@@ -3363,9 +3363,9 @@ class ts {
3363
3363
  };
3364
3364
  n.addEventListener("touchmove", this.#m.bind(this), r);
3365
3365
  const a = this.#g.bind(this);
3366
- n.addEventListener("touchend", a, r), n.addEventListener("touchcancel", a, r), r.capture = !0, n.addEventListener("pointerdown", J, r), n.addEventListener("pointermove", J, r), n.addEventListener("pointercancel", J, r), n.addEventListener("pointerup", J, r), this.#a?.();
3366
+ n.addEventListener("touchend", a, r), n.addEventListener("touchcancel", a, r), r.capture = !0, n.addEventListener("pointerdown", Z, r), n.addEventListener("pointermove", Z, r), n.addEventListener("pointercancel", Z, r), n.addEventListener("pointerup", Z, r), this.#a?.();
3367
3367
  }
3368
- if (J(t), t.touches.length !== 2 || this.#i?.()) {
3368
+ if (Z(t), t.touches.length !== 2 || this.#i?.()) {
3369
3369
  this.#l = null;
3370
3370
  return;
3371
3371
  }
@@ -3380,7 +3380,7 @@ class ts {
3380
3380
  #m(t) {
3381
3381
  if (!this.#l || t.touches.length !== 2)
3382
3382
  return;
3383
- J(t);
3383
+ Z(t);
3384
3384
  let [e, s] = t.touches;
3385
3385
  e.identifier > s.identifier && ([e, s] = [s, e]);
3386
3386
  const {
@@ -3405,7 +3405,7 @@ class ts {
3405
3405
  this.#r?.(y, w, m);
3406
3406
  }
3407
3407
  #g(t) {
3408
- t.touches.length >= 2 || (this.#d && (this.#d.abort(), this.#d = null, this.#n?.()), this.#l && (J(t), this.#l = null, this.#e = !1));
3408
+ t.touches.length >= 2 || (this.#d && (this.#d.abort(), this.#d = null, this.#n?.()), this.#l && (Z(t), this.#l = null, this.#e = !1));
3409
3409
  }
3410
3410
  destroy() {
3411
3411
  this.#u?.abort(), this.#u = null, this.#o?.abort(), this.#o = null;
@@ -3579,7 +3579,7 @@ class D {
3579
3579
  this.div.style.zIndex = this.#_;
3580
3580
  }
3581
3581
  setParent(t) {
3582
- t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#O(), this.#d?.remove(), this.#d = null), this.parent = t;
3582
+ t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#N(), this.#d?.remove(), this.#d = null), this.parent = t;
3583
3583
  }
3584
3584
  focusin(t) {
3585
3585
  this._focusEventsAllowed && (this.#g ? this.#g = !1 : this.parent.setSelected(this));
@@ -3764,7 +3764,7 @@ class D {
3764
3764
  getInitialTranslation() {
3765
3765
  return [0, 0];
3766
3766
  }
3767
- #N() {
3767
+ #O() {
3768
3768
  if (this.#h)
3769
3769
  return;
3770
3770
  this.#h = document.createElement("div"), this.#h.classList.add("resizers");
@@ -3794,7 +3794,7 @@ class D {
3794
3794
  passive: !0,
3795
3795
  capture: !0,
3796
3796
  signal: r
3797
- }), window.addEventListener("touchmove", J, {
3797
+ }), window.addEventListener("touchmove", Z, {
3798
3798
  passive: !1,
3799
3799
  signal: r
3800
3800
  }), window.addEventListener("contextmenu", _t, {
@@ -3870,13 +3870,13 @@ class D {
3870
3870
  w = !0, p = (k, R) => [0, R / 2], b = (k, R) => [k, R / 2];
3871
3871
  break;
3872
3872
  }
3873
- const y = p(a, o), v = b(a, o);
3874
- let A = u(...v);
3875
- const S = D._round(n + A[0]), E = D._round(r + A[1]);
3876
- let _ = 1, C = 1, M, x;
3873
+ const y = p(a, o), S = b(a, o);
3874
+ let A = u(...S);
3875
+ const v = D._round(n + A[0]), E = D._round(r + A[1]);
3876
+ let _ = 1, C = 1, P, x;
3877
3877
  if (e.fromKeyboard)
3878
3878
  ({
3879
- deltaX: M,
3879
+ deltaX: P,
3880
3880
  deltaY: x
3881
3881
  } = e);
3882
3882
  else {
@@ -3884,16 +3884,16 @@ class D {
3884
3884
  screenX: k,
3885
3885
  screenY: R
3886
3886
  } = e, [$, bt] = this.#l;
3887
- [M, x] = this.screenToPageTranslation(k - $, R - bt), this.#l[0] = k, this.#l[1] = R;
3887
+ [P, x] = this.screenToPageTranslation(k - $, R - bt), this.#l[0] = k, this.#l[1] = R;
3888
3888
  }
3889
- if ([M, x] = g(M / s, x / i), m) {
3889
+ if ([P, x] = g(P / s, x / i), m) {
3890
3890
  const k = Math.hypot(a, o);
3891
- _ = C = Math.max(Math.min(Math.hypot(v[0] - y[0] - M, v[1] - y[1] - x) / k, 1 / a, 1 / o), l / a, h / o);
3892
- } else w ? _ = ut(Math.abs(v[0] - y[0] - M), l, 1) / a : C = ut(Math.abs(v[1] - y[1] - x), h, 1) / o;
3891
+ _ = C = Math.max(Math.min(Math.hypot(S[0] - y[0] - P, S[1] - y[1] - x) / k, 1 / a, 1 / o), l / a, h / o);
3892
+ } else w ? _ = ut(Math.abs(S[0] - y[0] - P), l, 1) / a : C = ut(Math.abs(S[1] - y[1] - x), h, 1) / o;
3893
3893
  const H = D._round(a * _), V = D._round(o * C);
3894
3894
  A = u(...b(H, V));
3895
- const O = S - A[0], tt = E - A[1];
3896
- this.#c ||= [this.x, this.y, this.width, this.height], this.width = H, this.height = V, this.x = O, this.y = tt, this.setDims(), this.fixAndSetPosition(), this._onResizing();
3895
+ const N = v - A[0], K = E - A[1];
3896
+ this.#c ||= [this.x, this.y, this.width, this.height], this.width = H, this.height = V, this.x = N, this.y = K, this.setDims(), this.fixAndSetPosition(), this._onResizing();
3897
3897
  }
3898
3898
  _onResizing() {
3899
3899
  }
@@ -4073,14 +4073,14 @@ class D {
4073
4073
  let n = 0.7 * (s / e) + 1 - 0.7;
4074
4074
  if (n === 1)
4075
4075
  return;
4076
- const r = this.#M(this.rotation), a = (S, E) => [r[0] * S + r[2] * E, r[1] * S + r[3] * E], [o, l] = this.parentDimensions, h = this.x, c = this.y, u = this.width, f = this.height, g = D.MIN_SIZE / o, p = D.MIN_SIZE / l;
4076
+ const r = this.#M(this.rotation), a = (v, E) => [r[0] * v + r[2] * E, r[1] * v + r[3] * E], [o, l] = this.parentDimensions, h = this.x, c = this.y, u = this.width, f = this.height, g = D.MIN_SIZE / o, p = D.MIN_SIZE / l;
4077
4077
  n = Math.max(Math.min(n, 1 / u, 1 / f), g / u, p / f);
4078
4078
  const b = D._round(u * n), m = D._round(f * n);
4079
4079
  if (b === u && m === f)
4080
4080
  return;
4081
4081
  this.#c ||= [h, c, u, f];
4082
- const w = a(u / 2, f / 2), y = D._round(h + w[0]), v = D._round(c + w[1]), A = a(b / 2, m / 2);
4083
- this.x = y - A[0], this.y = v - A[1], this.width = b, this.height = m, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4082
+ const w = a(u / 2, f / 2), y = D._round(h + w[0]), S = D._round(c + w[1]), A = a(b / 2, m / 2);
4083
+ this.x = y - A[0], this.y = S - A[1], this.width = b, this.height = m, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4084
4084
  }
4085
4085
  #S() {
4086
4086
  this.#i?.toggle(!0), this.parent.togglePointerEvents(!0), this.#B();
@@ -4126,20 +4126,20 @@ class D {
4126
4126
  pointerId: u
4127
4127
  } = l;
4128
4128
  if (u !== this.#n) {
4129
- J(l);
4129
+ Z(l);
4130
4130
  return;
4131
4131
  }
4132
4132
  const [f, g] = this.screenToPageTranslation(h - this.#C, c - this.#E);
4133
4133
  this.#C = h, this.#E = c, this._uiManager.dragSelectedEditors(f, g);
4134
- }, r), window.addEventListener("touchmove", J, r), window.addEventListener("pointerdown", (l) => {
4135
- l.pointerType === this.#o && (this.#T || l.isPrimary) && a(l), J(l);
4134
+ }, r), window.addEventListener("touchmove", Z, r), window.addEventListener("pointerdown", (l) => {
4135
+ l.pointerType === this.#o && (this.#T || l.isPrimary) && a(l), Z(l);
4136
4136
  }, r));
4137
4137
  const o = (l) => {
4138
4138
  if (!this.#n || this.#n === l.pointerId) {
4139
4139
  a(l);
4140
4140
  return;
4141
4141
  }
4142
- J(l);
4142
+ Z(l);
4143
4143
  };
4144
4144
  window.addEventListener("pointerup", o, {
4145
4145
  signal: n
@@ -4313,7 +4313,7 @@ class D {
4313
4313
  return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
4314
4314
  }
4315
4315
  remove() {
4316
- if (this.#f?.abort(), this.#f = null, this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), this.hideCommentPopup(), this.#y && (clearTimeout(this.#y), this.#y = null), this.#O(), this.removeEditToolbar(), this.#v) {
4316
+ if (this.#f?.abort(), this.#f = null, this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), this.hideCommentPopup(), this.#y && (clearTimeout(this.#y), this.#y = null), this.#N(), this.removeEditToolbar(), this.#v) {
4317
4317
  for (const t of this.#v.values())
4318
4318
  clearTimeout(t);
4319
4319
  this.#v = null;
@@ -4324,7 +4324,7 @@ class D {
4324
4324
  return !1;
4325
4325
  }
4326
4326
  makeResizable() {
4327
- this.isResizable && (this.#N(), this.#h.classList.remove("hidden"));
4327
+ this.isResizable && (this.#O(), this.#h.classList.remove("hidden"));
4328
4328
  }
4329
4329
  get toolbarPosition() {
4330
4330
  return null;
@@ -4412,7 +4412,7 @@ class D {
4412
4412
  D._resizerKeyboardManager.exec(this, t);
4413
4413
  }
4414
4414
  #W(t) {
4415
- this.#w && t.relatedTarget?.parentNode !== this.#h && this.#O();
4415
+ this.#w && t.relatedTarget?.parentNode !== this.#h && this.#N();
4416
4416
  }
4417
4417
  #q(t) {
4418
4418
  this.#m = this.#w ? t : "";
@@ -4429,11 +4429,11 @@ class D {
4429
4429
  fromKeyboard: !0
4430
4430
  });
4431
4431
  }
4432
- #O() {
4432
+ #N() {
4433
4433
  this.#w = !1, this.#$(-1), this.#B();
4434
4434
  }
4435
4435
  _stopResizingWithKeyboard() {
4436
- this.#O(), this.div.focus();
4436
+ this.#N(), this.div.focus();
4437
4437
  }
4438
4438
  select() {
4439
4439
  if (this.isSelected && this._editToolbar) {
@@ -4880,11 +4880,11 @@ class Rn {
4880
4880
  return I(this, "_loadTestFont", t);
4881
4881
  }
4882
4882
  _prepareFontLoadEvent(t, e) {
4883
- function s(v, A) {
4884
- return v.charCodeAt(A) << 24 | v.charCodeAt(A + 1) << 16 | v.charCodeAt(A + 2) << 8 | v.charCodeAt(A + 3) & 255;
4883
+ function s(S, A) {
4884
+ return S.charCodeAt(A) << 24 | S.charCodeAt(A + 1) << 16 | S.charCodeAt(A + 2) << 8 | S.charCodeAt(A + 3) & 255;
4885
4885
  }
4886
- function i(v, A, S, E) {
4887
- const _ = v.substring(0, A), C = v.substring(A + S);
4886
+ function i(S, A, v, E) {
4887
+ const _ = S.substring(0, A), C = S.substring(A + v);
4888
4888
  return _ + E + C;
4889
4889
  }
4890
4890
  let n, r;
@@ -4892,16 +4892,16 @@ class Rn {
4892
4892
  a.width = 1, a.height = 1;
4893
4893
  const o = a.getContext("2d");
4894
4894
  let l = 0;
4895
- function h(v, A) {
4895
+ function h(S, A) {
4896
4896
  if (++l > 30) {
4897
4897
  L("Load test font never loaded."), A();
4898
4898
  return;
4899
4899
  }
4900
- if (o.font = "30px " + v, o.fillText(".", 0, 20), o.getImageData(0, 0, 1, 1).data[3] > 0) {
4900
+ if (o.font = "30px " + S, o.fillText(".", 0, 20), o.getImageData(0, 0, 1, 1).data[3] > 0) {
4901
4901
  A();
4902
4902
  return;
4903
4903
  }
4904
- setTimeout(h.bind(null, v, A));
4904
+ setTimeout(h.bind(null, S, A));
4905
4905
  }
4906
4906
  const c = `lt${Date.now()}${this.loadTestFontId++}`;
4907
4907
  let u = this._loadTestFont;
@@ -4915,9 +4915,9 @@ class Rn {
4915
4915
  this.insertRule(w);
4916
4916
  const y = this._document.createElement("div");
4917
4917
  y.style.visibility = "hidden", y.style.width = y.style.height = "10px", y.style.position = "absolute", y.style.top = y.style.left = "0px";
4918
- for (const v of [t.loadedName, c]) {
4918
+ for (const S of [t.loadedName, c]) {
4919
4919
  const A = this._document.createElement("span");
4920
- A.textContent = "Hi", A.style.fontFamily = v, y.append(A);
4920
+ A.textContent = "Hi", A.style.fontFamily = S, y.append(A);
4921
4921
  }
4922
4922
  this._document.body.append(y), h(c, () => {
4923
4923
  y.remove(), e.complete();
@@ -5397,15 +5397,15 @@ class ot {
5397
5397
  m.setUint8(ot.#t, e), m.setUint8(ot.#e, s ? 1 : 0), m.setUint8(ot.#i, l ? 1 : 0), m.setUint8(ot.#s, o), m.setUint32(ot.#a, h, !0), m.setUint32(ot.#r, c, !0), m.setUint32(ot.#n, u, !0), m.setUint32(ot.#o, f, !0);
5398
5398
  let y = 20;
5399
5399
  new Float32Array(b, y, h * 2).set(i), y += h * 8, w.set(n, y), y += c * 3;
5400
- for (const [A, S] of r)
5401
- m.setFloat32(y, A, !0), y += 4, m.setUint32(y, parseInt(S.slice(1), 16), !0), y += 4;
5400
+ for (const [A, v] of r)
5401
+ m.setFloat32(y, A, !0), y += 4, m.setUint32(y, parseInt(v.slice(1), 16), !0), y += 4;
5402
5402
  if (s)
5403
5403
  for (const A of s)
5404
5404
  m.setFloat32(y, A, !0), y += 4;
5405
5405
  l && (w.set(l, y), y += 3);
5406
5406
  for (let A = 0; A < a.length; A++) {
5407
- const S = a[A];
5408
- m.setUint8(y, S.type), y += 1, y = Math.ceil(y / 4) * 4, m.setUint32(y, S.coords.length, !0), y += 4, new Int32Array(b, y, S.coords.length).set(S.coords), y += S.coords.length * 4, m.setUint32(y, S.colors.length, !0), y += 4, new Int32Array(b, y, S.colors.length).set(S.colors), y += S.colors.length * 4, S.verticesPerRow !== void 0 && (m.setUint32(y, S.verticesPerRow, !0), y += 4);
5407
+ const v = a[A];
5408
+ m.setUint8(y, v.type), y += 1, y = Math.ceil(y / 4) * 4, m.setUint32(y, v.coords.length, !0), y += 4, new Int32Array(b, y, v.coords.length).set(v.coords), y += v.coords.length * 4, m.setUint32(y, v.colors.length, !0), y += 4, new Int32Array(b, y, v.colors.length).set(v.colors), y += v.colors.length * 4, v.verticesPerRow !== void 0 && (m.setUint32(y, v.verticesPerRow, !0), y += 4);
5409
5409
  }
5410
5410
  return b;
5411
5411
  }
@@ -5439,16 +5439,16 @@ class ot {
5439
5439
  l += 4;
5440
5440
  const y = new Int32Array(this.buffer, l, w);
5441
5441
  l += w * 4;
5442
- const v = t.getUint32(l, !0);
5442
+ const S = t.getUint32(l, !0);
5443
5443
  l += 4;
5444
- const A = new Int32Array(this.buffer, l, v);
5445
- l += v * 4;
5446
- const S = {
5444
+ const A = new Int32Array(this.buffer, l, S);
5445
+ l += S * 4;
5446
+ const v = {
5447
5447
  type: m,
5448
5448
  coords: y,
5449
5449
  colors: A
5450
5450
  };
5451
- m === ms.LATTICE && (S.verticesPerRow = t.getUint32(l, !0), l += 4), p.push(S);
5451
+ m === ms.LATTICE && (v.verticesPerRow = t.getUint32(l, !0), l += 4), p.push(v);
5452
5452
  }
5453
5453
  if (e === 1)
5454
5454
  return ["RadialAxial", "axial", f, u, Array.from(h.slice(0, 2)), Array.from(h.slice(2, 4)), null, null];
@@ -5458,12 +5458,12 @@ class ot {
5458
5458
  const b = this.data[ot.#s];
5459
5459
  let m = null;
5460
5460
  if (h.length > 0) {
5461
- let w = h[0], y = h[0], v = h[1], A = h[1];
5462
- for (let S = 0; S < h.length; S += 2) {
5463
- const E = h[S], _ = h[S + 1];
5464
- w = w > E ? E : w, v = v > _ ? _ : v, y = y < E ? E : y, A = A < _ ? _ : A;
5461
+ let w = h[0], y = h[0], S = h[1], A = h[1];
5462
+ for (let v = 0; v < h.length; v += 2) {
5463
+ const E = h[v], _ = h[v + 1];
5464
+ w = w > E ? E : w, S = S > _ ? _ : S, y = y < E ? E : y, A = A < _ ? _ : A;
5465
5465
  }
5466
- m = [w, v, y, A];
5466
+ m = [w, S, y, A];
5467
5467
  }
5468
5468
  return ["Mesh", b, h, c, p, m, f, g];
5469
5469
  }
@@ -5495,7 +5495,7 @@ function Fn(d) {
5495
5495
  }
5496
5496
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
5497
5497
  }
5498
- function On(d) {
5498
+ function Nn(d) {
5499
5499
  if (dt && typeof Buffer < "u" && d instanceof Buffer)
5500
5500
  throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
5501
5501
  if (d instanceof Uint8Array && d.byteLength === d.buffer.byteLength)
@@ -5513,7 +5513,7 @@ function Fe(d) {
5513
5513
  return d;
5514
5514
  throw new Error(`Invalid factory url: "${d}" must include trailing slash.`);
5515
5515
  }
5516
- const Ss = (d) => typeof d == "object" && Number.isInteger(d?.num) && d.num >= 0 && Number.isInteger(d?.gen) && d.gen >= 0, Nn = (d) => typeof d == "object" && typeof d?.name == "string", Bn = bn.bind(null, Ss, Nn);
5516
+ const Ss = (d) => typeof d == "object" && Number.isInteger(d?.num) && d.num >= 0 && Number.isInteger(d?.gen) && d.gen >= 0, On = (d) => typeof d == "object" && typeof d?.name == "string", Bn = bn.bind(null, Ss, On);
5517
5517
  class Hn {
5518
5518
  #t = /* @__PURE__ */ new Map();
5519
5519
  #e = Promise.resolve();
@@ -5552,7 +5552,7 @@ class Hn {
5552
5552
  this.#t.clear();
5553
5553
  }
5554
5554
  }
5555
- const Oe = {
5555
+ const Ne = {
5556
5556
  DATA: 1,
5557
5557
  ERROR: 2
5558
5558
  }, it = {
@@ -5604,9 +5604,9 @@ class we {
5604
5604
  const s = t.callbackId, i = this.callbackCapabilities[s];
5605
5605
  if (!i)
5606
5606
  throw new Error(`Cannot resolve callback ${s}`);
5607
- if (delete this.callbackCapabilities[s], t.callback === Oe.DATA)
5607
+ if (delete this.callbackCapabilities[s], t.callback === Ne.DATA)
5608
5608
  i.resolve(t.data);
5609
- else if (t.callback === Oe.ERROR)
5609
+ else if (t.callback === Ne.ERROR)
5610
5610
  i.reject(gt(t.reason));
5611
5611
  else
5612
5612
  throw new Error("Unexpected callback case");
@@ -5621,7 +5621,7 @@ class we {
5621
5621
  n.postMessage({
5622
5622
  sourceName: s,
5623
5623
  targetName: i,
5624
- callback: Oe.DATA,
5624
+ callback: Ne.DATA,
5625
5625
  callbackId: t.callbackId,
5626
5626
  data: r
5627
5627
  });
@@ -5629,7 +5629,7 @@ class we {
5629
5629
  n.postMessage({
5630
5630
  sourceName: s,
5631
5631
  targetName: i,
5632
- callback: Oe.ERROR,
5632
+ callback: Ne.ERROR,
5633
5633
  callbackId: t.callbackId,
5634
5634
  reason: gt(r)
5635
5635
  });
@@ -6089,17 +6089,17 @@ class zn extends Ri {
6089
6089
  let h = Math.round(0.2126 * o[0] + 0.7152 * o[1] + 0.0722 * o[2]), c = Math.round(0.2126 * l[0] + 0.7152 * l[1] + 0.0722 * l[2]), [u, f] = [i, n].map(this.#w.bind(this));
6090
6090
  c < h && ([h, c, u, f] = [c, h, f, u]), this.#l.style.color = "";
6091
6091
  const g = (m, w, y) => {
6092
- const v = new Array(256), A = (c - h) / y, S = m / 255, E = (w - m) / (255 * y);
6092
+ const S = new Array(256), A = (c - h) / y, v = m / 255, E = (w - m) / (255 * y);
6093
6093
  let _ = 0;
6094
6094
  for (let C = 0; C <= y; C++) {
6095
- const M = Math.round(h + C * A), x = S + C * E;
6096
- for (let H = _; H <= M; H++)
6097
- v[H] = x;
6098
- _ = M + 1;
6095
+ const P = Math.round(h + C * A), x = v + C * E;
6096
+ for (let H = _; H <= P; H++)
6097
+ S[H] = x;
6098
+ _ = P + 1;
6099
6099
  }
6100
6100
  for (let C = _; C < 256; C++)
6101
- v[C] = v[_ - 1];
6102
- return v.join(",");
6101
+ S[C] = S[_ - 1];
6102
+ return S.join(",");
6103
6103
  }, p = `g_${this.#s}_hcm_${t}_filter`, b = a.filter = this.#g(p);
6104
6104
  return this.#m(b), this.#p(g(u[0], f[0], 5), g(u[1], f[1], 5), g(u[2], f[2], 5), b), a.url = this.#d(p), a.url;
6105
6105
  }
@@ -6221,7 +6221,7 @@ const Zt = "__forcedDependency", {
6221
6221
  floor: ri,
6222
6222
  ceil: ai
6223
6223
  } = Math;
6224
- function Ne(d, t, e, s, i, n) {
6224
+ function Oe(d, t, e, s, i, n) {
6225
6225
  d[t * 4 + 0] = Math.min(d[t * 4 + 0], e), d[t * 4 + 1] = Math.min(d[t * 4 + 1], s), d[t * 4 + 2] = Math.max(d[t * 4 + 2], i), d[t * 4 + 3] = Math.max(d[t * 4 + 3], n);
6226
6226
  }
6227
6227
  const Es = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
@@ -6428,13 +6428,13 @@ class qn {
6428
6428
  }
6429
6429
  if (this.#h === t) {
6430
6430
  const s = ri(this.#o[0] * 256 / this.#f), i = ri(this.#o[1] * 256 / this.#m), n = ai(this.#o[2] * 256 / this.#f), r = ai(this.#o[3] * 256 / this.#m);
6431
- Ne(this.#g, t, s, i, n, r);
6431
+ Oe(this.#g, t, s, i, n, r);
6432
6432
  for (const a of this.#l)
6433
- a !== t && Ne(this.#g, a, s, i, n, r);
6433
+ a !== t && Oe(this.#g, a, s, i, n, r);
6434
6434
  for (const a of this.#s)
6435
- a !== t && Ne(this.#g, a, s, i, n, r);
6435
+ a !== t && Oe(this.#g, a, s, i, n, r);
6436
6436
  for (const a of this.#a)
6437
- a !== t && Ne(this.#g, a, s, i, n, r);
6437
+ a !== t && Oe(this.#g, a, s, i, n, r);
6438
6438
  e || (this.#l.clear(), this.#h = -1);
6439
6439
  }
6440
6440
  return this;
@@ -6640,7 +6640,7 @@ class Yn extends Fs {
6640
6640
  } else
6641
6641
  return this._createGradient(t, u);
6642
6642
  }
6643
- const r = e.current.getClippedPathBoundingBox(i, K(t)) || [0, 0, 0, 0], a = Math.ceil(r[2] - r[0]) || 1, o = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", a, o), h = l.context;
6643
+ const r = e.current.getClippedPathBoundingBox(i, Q(t)) || [0, 0, 0, 0], a = Math.ceil(r[2] - r[0]) || 1, o = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", a, o), h = l.context;
6644
6644
  h.clearRect(0, 0, h.canvas.width, h.canvas.height), h.beginPath(), h.rect(0, 0, h.canvas.width, h.canvas.height), h.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), h.transform(...e.baseTransform), this.matrix && h.transform(...this.matrix), _s(h, this._bbox), h.fillStyle = this._createGradient(h), h.fill(), n = t.createPattern(l.canvas, "no-repeat");
6645
6645
  const c = new DOMMatrix(s);
6646
6646
  n.setTransform(c);
@@ -6656,22 +6656,22 @@ function cs(d, t, e, s, i, n, r, a) {
6656
6656
  const f = (o[e] + t.offsetX) * t.scaleX, g = (o[e + 1] + t.offsetY) * t.scaleY, p = (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;
6657
6657
  if (g >= w)
6658
6658
  return;
6659
- const y = l[n], v = l[n + 1], A = l[n + 2], S = l[r], E = l[r + 1], _ = l[r + 2], C = l[a], M = l[a + 1], x = l[a + 2], H = Math.round(g), V = Math.round(w);
6660
- let O, tt, k, R, $, bt, Lt, et;
6659
+ const y = l[n], S = l[n + 1], A = l[n + 2], v = l[r], E = l[r + 1], _ = l[r + 2], C = l[a], P = l[a + 1], x = l[a + 2], H = Math.round(g), V = Math.round(w);
6660
+ let N, K, k, R, $, bt, Lt, et;
6661
6661
  for (let W = H; W <= V; W++) {
6662
6662
  if (W < b) {
6663
6663
  const st = W < g ? 0 : (g - W) / (g - b);
6664
- O = f - (f - p) * st, tt = y - (y - S) * st, k = v - (v - E) * st, R = A - (A - _) * st;
6664
+ N = f - (f - p) * st, K = y - (y - v) * st, k = S - (S - E) * st, R = A - (A - _) * st;
6665
6665
  } else {
6666
6666
  let st;
6667
- W > w ? st = 1 : b === w ? st = 0 : st = (b - W) / (b - w), O = p - (p - m) * st, tt = S - (S - C) * st, k = E - (E - M) * st, R = _ - (_ - x) * st;
6667
+ W > w ? st = 1 : b === w ? st = 0 : st = (b - W) / (b - w), N = p - (p - m) * st, K = v - (v - C) * st, k = E - (E - P) * st, R = _ - (_ - x) * st;
6668
6668
  }
6669
6669
  let X;
6670
- W < g ? X = 0 : W > w ? X = 1 : X = (g - W) / (g - w), $ = f - (f - m) * X, bt = y - (y - C) * X, Lt = v - (v - M) * X, et = A - (A - x) * X;
6671
- const Vt = Math.round(Math.min(O, $)), Nt = Math.round(Math.max(O, $));
6670
+ W < g ? X = 0 : W > w ? X = 1 : X = (g - W) / (g - w), $ = f - (f - m) * X, bt = y - (y - C) * X, Lt = S - (S - P) * X, et = A - (A - x) * X;
6671
+ const Vt = Math.round(Math.min(N, $)), Ot = Math.round(Math.max(N, $));
6672
6672
  let Bt = c * W + Vt * 4;
6673
- for (let st = Vt; st <= Nt; st++)
6674
- X = (O - st) / (O - $), X < 0 ? X = 0 : X > 1 && (X = 1), h[Bt++] = tt - (tt - bt) * X | 0, h[Bt++] = k - (k - Lt) * X | 0, h[Bt++] = R - (R - et) * X | 0, h[Bt++] = 255;
6673
+ for (let st = Vt; st <= Ot; st++)
6674
+ X = (N - st) / (N - $), X < 0 ? X = 0 : X > 1 && (X = 1), h[Bt++] = K - (K - bt) * X | 0, h[Bt++] = k - (k - Lt) * X | 0, h[Bt++] = R - (R - et) * X | 0, h[Bt++] = 255;
6675
6675
  }
6676
6676
  }
6677
6677
  function Kn(d, t, e) {
@@ -6706,15 +6706,15 @@ class Qn extends Fs {
6706
6706
  offsetY: -o,
6707
6707
  scaleX: 1 / f,
6708
6708
  scaleY: 1 / g
6709
- }, b = c + 4, m = u + 4, w = s.getCanvas("mesh", b, m), y = w.context, v = y.createImageData(c, u);
6709
+ }, b = c + 4, m = u + 4, w = s.getCanvas("mesh", b, m), y = w.context, S = y.createImageData(c, u);
6710
6710
  if (e) {
6711
- const S = v.data;
6712
- for (let E = 0, _ = S.length; E < _; E += 4)
6713
- S[E] = e[0], S[E + 1] = e[1], S[E + 2] = e[2], S[E + 3] = 255;
6711
+ const v = S.data;
6712
+ for (let E = 0, _ = v.length; E < _; E += 4)
6713
+ v[E] = e[0], v[E + 1] = e[1], v[E + 2] = e[2], v[E + 3] = 255;
6714
6714
  }
6715
- for (const S of this._figures)
6716
- Kn(v, S, p);
6717
- return y.putImageData(v, 2, 2), {
6715
+ for (const v of this._figures)
6716
+ Kn(S, v, p);
6717
+ return y.putImageData(S, 2, 2), {
6718
6718
  canvas: w.canvas,
6719
6719
  offsetX: a - 2 * f,
6720
6720
  offsetY: o - 2 * g,
@@ -6729,7 +6729,7 @@ class Qn extends Fs {
6729
6729
  _s(t, this._bbox);
6730
6730
  const n = new Float32Array(2);
6731
6731
  if (i === ct.SHADING)
6732
- T.singularValueDecompose2dScale(K(t), n);
6732
+ T.singularValueDecompose2dScale(Q(t), n);
6733
6733
  else if (this.matrix) {
6734
6734
  T.singularValueDecompose2dScale(this.matrix, n);
6735
6735
  const [a, o] = n;
@@ -6760,7 +6760,7 @@ const oi = {
6760
6760
  COLORED: 1,
6761
6761
  UNCOLORED: 2
6762
6762
  };
6763
- class Os {
6763
+ class Ns {
6764
6764
  static MAX_PATTERN_SIZE = 3e3;
6765
6765
  constructor(t, e, s, i) {
6766
6766
  this.color = t[1], this.operatorList = t[2], this.matrix = t[3], this.bbox = t[4], this.xstep = t[5], this.ystep = t[6], this.paintType = t[7], this.tilingType = t[8], this.ctx = e, this.canvasGraphicsFactory = s, this.baseTransform = i;
@@ -6783,18 +6783,18 @@ class Os {
6783
6783
  T.singularValueDecompose2dScale(this.matrix, m);
6784
6784
  const [w, y] = m;
6785
6785
  T.singularValueDecompose2dScale(this.baseTransform, m);
6786
- const v = w * m[0], A = y * m[1];
6787
- let S = p, E = b, _ = !1, C = !1;
6788
- const M = Math.ceil(l * v), x = Math.ceil(h * A), H = Math.ceil(p * v), V = Math.ceil(b * A);
6789
- M >= H ? S = l : _ = !0, x >= V ? E = h : C = !0;
6790
- const O = this.getSizeAndScale(S, this.ctx.canvas.width, v), tt = this.getSizeAndScale(E, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", O.size, tt.size), R = k.context, $ = o.createCanvasGraphics(R, e);
6791
- if ($.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext($, n, a), R.translate(-O.scale * c, -tt.scale * u), $.transform(0, O.scale, 0, 0, tt.scale, 0, 0), R.save(), $.dependencyTracker?.save(), this.clipBbox($, c, u, f, g), $.baseTransform = K($.ctx), $.executeOperatorList(i), $.endDrawing(), $.dependencyTracker?.restore(), R.restore(), _ || C) {
6786
+ const S = w * m[0], A = y * m[1];
6787
+ let v = p, E = b, _ = !1, C = !1;
6788
+ const P = Math.ceil(l * S), x = Math.ceil(h * A), H = Math.ceil(p * S), V = Math.ceil(b * A);
6789
+ P >= H ? v = l : _ = !0, x >= V ? E = h : C = !0;
6790
+ const N = this.getSizeAndScale(v, this.ctx.canvas.width, S), K = this.getSizeAndScale(E, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, K.size), R = k.context, $ = o.createCanvasGraphics(R, e);
6791
+ if ($.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext($, n, a), R.translate(-N.scale * c, -K.scale * u), $.transform(0, N.scale, 0, 0, K.scale, 0, 0), R.save(), $.dependencyTracker?.save(), this.clipBbox($, c, u, f, g), $.baseTransform = Q($.ctx), $.executeOperatorList(i), $.endDrawing(), $.dependencyTracker?.restore(), R.restore(), _ || C) {
6792
6792
  const bt = k.canvas;
6793
- _ && (S = l), C && (E = h);
6794
- const Lt = this.getSizeAndScale(S, this.ctx.canvas.width, v), et = this.getSizeAndScale(E, this.ctx.canvas.height, A), W = Lt.size, X = et.size, Vt = t.cachedCanvases.getCanvas("pattern-workaround", W, X), Nt = Vt.context, Bt = _ ? Math.floor(p / l) : 0, st = C ? Math.floor(b / h) : 0;
6793
+ _ && (v = l), C && (E = h);
6794
+ const Lt = this.getSizeAndScale(v, this.ctx.canvas.width, S), et = this.getSizeAndScale(E, this.ctx.canvas.height, A), W = Lt.size, X = et.size, Vt = t.cachedCanvases.getCanvas("pattern-workaround", W, X), Ot = Vt.context, Bt = _ ? Math.floor(p / l) : 0, st = C ? Math.floor(b / h) : 0;
6795
6795
  for (let de = 0; de <= Bt; de++)
6796
6796
  for (let ue = 0; ue <= st; ue++)
6797
- Nt.drawImage(bt, W * de, X * ue, W, X, 0, 0, W, X);
6797
+ Ot.drawImage(bt, W * de, X * ue, W, X, 0, 0, W, X);
6798
6798
  return {
6799
6799
  canvas: Vt.canvas,
6800
6800
  scaleX: Lt.scale,
@@ -6805,14 +6805,14 @@ class Os {
6805
6805
  }
6806
6806
  return {
6807
6807
  canvas: k.canvas,
6808
- scaleX: O.scale,
6809
- scaleY: tt.scale,
6808
+ scaleX: N.scale,
6809
+ scaleY: K.scale,
6810
6810
  offsetX: c,
6811
6811
  offsetY: u
6812
6812
  };
6813
6813
  }
6814
6814
  getSizeAndScale(t, e, s) {
6815
- const i = Math.max(Os.MAX_PATTERN_SIZE, e);
6815
+ const i = Math.max(Ns.MAX_PATTERN_SIZE, e);
6816
6816
  let n = Math.ceil(t * s);
6817
6817
  return n >= i ? n = i : s = n / t, {
6818
6818
  scale: s,
@@ -6821,7 +6821,7 @@ class Os {
6821
6821
  }
6822
6822
  clipBbox(t, e, s, i, n) {
6823
6823
  const r = i - e, a = n - s;
6824
- t.ctx.rect(e, s, r, a), T.axialAlignedBoundingBox([e, s, i, n], K(t.ctx), t.current.minMax), t.clip(), t.endPath();
6824
+ t.ctx.rect(e, s, r, a), T.axialAlignedBoundingBox([e, s, i, n], Q(t.ctx), t.current.minMax), t.clip(), t.endPath();
6825
6825
  }
6826
6826
  setFillAndStrokeStyleToContext(t, e, s) {
6827
6827
  const i = t.ctx, n = t.current;
@@ -6938,13 +6938,13 @@ class ir {
6938
6938
  }
6939
6939
  }
6940
6940
  function He(d, t, e, s, i, n, r, a, o, l) {
6941
- const [h, c, u, f, g, p] = K(d);
6941
+ const [h, c, u, f, g, p] = Q(d);
6942
6942
  if (c === 0 && u === 0) {
6943
- const w = r * h + g, y = Math.round(w), v = a * f + p, A = Math.round(v), S = (r + o) * h + g, E = Math.abs(Math.round(S) - y) || 1, _ = (a + l) * f + p, C = Math.abs(Math.round(_) - A) || 1;
6943
+ const w = r * h + g, y = Math.round(w), S = a * f + p, A = Math.round(S), v = (r + o) * h + g, E = Math.abs(Math.round(v) - y) || 1, _ = (a + l) * f + p, C = Math.abs(Math.round(_) - A) || 1;
6944
6944
  return d.setTransform(Math.sign(h), 0, 0, Math.sign(f), y, A), d.drawImage(t, e, s, i, n, 0, 0, E, C), d.setTransform(h, c, u, f, g, p), [E, C];
6945
6945
  }
6946
6946
  if (h === 0 && f === 0) {
6947
- const w = a * u + g, y = Math.round(w), v = r * c + p, A = Math.round(v), S = (a + l) * u + g, E = Math.abs(Math.round(S) - y) || 1, _ = (r + o) * c + p, C = Math.abs(Math.round(_) - A) || 1;
6947
+ const w = a * u + g, y = Math.round(w), S = r * c + p, A = Math.round(S), v = (a + l) * u + g, E = Math.abs(Math.round(v) - y) || 1, _ = (r + o) * c + p, C = Math.abs(Math.round(_) - A) || 1;
6948
6948
  return d.setTransform(0, Math.sign(c), Math.sign(u), 0, y, A), d.drawImage(t, e, s, i, n, 0, 0, C, E), d.setTransform(h, c, u, f, g, p), [C, E];
6949
6949
  }
6950
6950
  d.drawImage(t, e, s, i, n, r, a, o, l);
@@ -7017,17 +7017,17 @@ function ui(d, t) {
7017
7017
  const h = t.data, c = a.data;
7018
7018
  let u, f, g, p;
7019
7019
  if (t.kind === Ve.GRAYSCALE_1BPP) {
7020
- const b = h.byteLength, m = new Uint32Array(c.buffer, 0, c.byteLength >> 2), w = m.length, y = s + 7 >> 3, v = 4294967295, A = at.isLittleEndian ? 4278190080 : 255;
7020
+ const b = h.byteLength, m = new Uint32Array(c.buffer, 0, c.byteLength >> 2), w = m.length, y = s + 7 >> 3, S = 4294967295, A = at.isLittleEndian ? 4278190080 : 255;
7021
7021
  for (u = 0; u < r; u++) {
7022
7022
  for (g = u < n ? mt : i, l = 0, f = 0; f < g; f++) {
7023
- const S = b - o;
7023
+ const v = b - o;
7024
7024
  let E = 0;
7025
- const _ = S > y ? s : S * 8 - 7, C = _ & -8;
7026
- let M = 0, x = 0;
7025
+ const _ = v > y ? s : v * 8 - 7, C = _ & -8;
7026
+ let P = 0, x = 0;
7027
7027
  for (; E < C; E += 8)
7028
- x = h[o++], m[l++] = x & 128 ? v : A, m[l++] = x & 64 ? v : A, m[l++] = x & 32 ? v : A, m[l++] = x & 16 ? v : A, m[l++] = x & 8 ? v : A, m[l++] = x & 4 ? v : A, m[l++] = x & 2 ? v : A, m[l++] = x & 1 ? v : A;
7028
+ x = h[o++], m[l++] = x & 128 ? S : A, m[l++] = x & 64 ? S : A, m[l++] = x & 32 ? S : A, m[l++] = x & 16 ? S : A, m[l++] = x & 8 ? S : A, m[l++] = x & 4 ? S : A, m[l++] = x & 2 ? S : A, m[l++] = x & 1 ? S : A;
7029
7029
  for (; E < _; E++)
7030
- M === 0 && (x = h[o++], M = 128), m[l++] = x & M ? v : A, M >>= 1;
7030
+ P === 0 && (x = h[o++], P = 128), m[l++] = x & P ? S : A, P >>= 1;
7031
7031
  }
7032
7032
  for (; l < w; )
7033
7033
  m[l++] = 0;
@@ -7108,9 +7108,9 @@ class le {
7108
7108
  const n = this.ctx.canvas.width, r = this.ctx.canvas.height, a = this.ctx.fillStyle;
7109
7109
  if (this.ctx.fillStyle = i || "#ffffff", this.ctx.fillRect(0, 0, n, r), this.ctx.fillStyle = a, s) {
7110
7110
  const o = this.cachedCanvases.getCanvas("transparent", n, r);
7111
- this.compositeCtx = this.ctx, this.transparentCanvas = o.canvas, this.ctx = o.context, this.ctx.save(), this.ctx.transform(...K(this.compositeCtx));
7111
+ this.compositeCtx = this.ctx, this.transparentCanvas = o.canvas, this.ctx = o.context, this.ctx.save(), this.ctx.transform(...Q(this.compositeCtx));
7112
7112
  }
7113
- this.ctx.save(), Ue(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = K(this.ctx);
7113
+ this.ctx.save(), Ue(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = Q(this.ctx);
7114
7114
  }
7115
7115
  executeOperatorList(t, e, s, i, n) {
7116
7116
  const r = t.argsArray, a = t.fnArray;
@@ -7184,11 +7184,11 @@ class le {
7184
7184
  const s = this.ctx, {
7185
7185
  width: i,
7186
7186
  height: n
7187
- } = e, r = this.current.fillColor, a = this.current.patternFill, o = K(s);
7187
+ } = e, r = this.current.fillColor, a = this.current.patternFill, o = Q(s);
7188
7188
  let l, h, c, u;
7189
7189
  if ((e.bitmap || e.data) && e.count > 1) {
7190
- const M = e.bitmap || e.data.buffer;
7191
- h = JSON.stringify(a ? o : [o.slice(0, 4), r]), l = this._cachedBitmapsMap.get(M), l || (l = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(M, l));
7190
+ const P = e.bitmap || e.data.buffer;
7191
+ h = JSON.stringify(a ? o : [o.slice(0, 4), r]), l = this._cachedBitmapsMap.get(P), l || (l = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(P, l));
7192
7192
  const x = l.get(h);
7193
7193
  if (x && !a) {
7194
7194
  const H = Math.round(Math.min(o[0], o[2]) + o[4]), V = Math.round(Math.min(o[1], o[3]) + o[5]);
@@ -7205,10 +7205,10 @@ class le {
7205
7205
  f = T.transform(f, [1, 0, 0, 1, 0, -n]);
7206
7206
  const g = ne.slice();
7207
7207
  T.axialAlignedBoundingBox([0, 0, i, n], f, g);
7208
- const [p, b, m, w] = g, y = Math.round(m - p) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), S = A.context, E = p, _ = b;
7209
- S.translate(-E, -_), S.transform(...f), c || (c = this._scaleImage(u.canvas, Pt(S)), c = c.img, l && a && l.set(h, c)), S.imageSmoothingEnabled = pi(K(S), e.interpolate), He(S, c, 0, 0, c.width, c.height, 0, 0, i, n), S.globalCompositeOperation = "source-in";
7210
- const C = T.transform(Pt(S), [1, 0, 0, 1, -E, -_]);
7211
- return S.fillStyle = a ? r.getPattern(s, this, C, ct.FILL, t) : r, S.fillRect(0, 0, i, n), l && !a && (this.cachedCanvases.delete("fillCanvas"), l.set(h, A.canvas)), this.dependencyTracker?.recordDependencies(t, St.transformAndFill), {
7208
+ const [p, b, m, w] = g, y = Math.round(m - p) || 1, S = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, S), v = A.context, E = p, _ = b;
7209
+ v.translate(-E, -_), v.transform(...f), c || (c = this._scaleImage(u.canvas, Pt(v)), c = c.img, l && a && l.set(h, c)), v.imageSmoothingEnabled = pi(Q(v), e.interpolate), He(v, c, 0, 0, c.width, c.height, 0, 0, i, n), v.globalCompositeOperation = "source-in";
7210
+ const C = T.transform(Pt(v), [1, 0, 0, 1, -E, -_]);
7211
+ return v.fillStyle = a ? r.getPattern(s, this, C, ct.FILL, t) : r, v.fillRect(0, 0, i, n), l && !a && (this.cachedCanvases.delete("fillCanvas"), l.set(h, A.canvas)), this.dependencyTracker?.recordDependencies(t, St.transformAndFill), {
7212
7212
  canvas: A.canvas,
7213
7213
  offsetX: Math.round(E),
7214
7214
  offsetY: Math.round(_)
@@ -7350,7 +7350,7 @@ class le {
7350
7350
  const r = e === Ee.stroke ? this.current.lineWidth / 2 : 0;
7351
7351
  this.dependencyTracker.resetBBox(t).recordBBox(t, this.ctx, i[0] - r, i[2] + r, i[1] - r, i[3] + r).recordDependencies(t, ["transform"]);
7352
7352
  }
7353
- n instanceof Path2D || (n = s[0] = xi(n)), T.axialAlignedBoundingBox(i, K(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
7353
+ n instanceof Path2D || (n = s[0] = xi(n)), T.axialAlignedBoundingBox(i, Q(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
7354
7354
  }
7355
7355
  closePath(t) {
7356
7356
  this.ctx.closePath();
@@ -7367,7 +7367,7 @@ class le {
7367
7367
  this.rescaleAndStroke(e, !1), i.restore();
7368
7368
  } else
7369
7369
  this.rescaleAndStroke(e, !0);
7370
- this.dependencyTracker?.recordDependencies(t, St.stroke), s && this.consumePath(t, e, this.current.getClippedPathBoundingBox(ct.STROKE, K(this.ctx))), i.globalAlpha = this.current.fillAlpha;
7370
+ this.dependencyTracker?.recordDependencies(t, St.stroke), s && this.consumePath(t, e, this.current.getClippedPathBoundingBox(ct.STROKE, Q(this.ctx))), i.globalAlpha = this.current.fillAlpha;
7371
7371
  }
7372
7372
  closeStroke(t, e) {
7373
7373
  this.stroke(t, e);
@@ -7509,9 +7509,9 @@ class le {
7509
7509
  const {
7510
7510
  a: w,
7511
7511
  b: y,
7512
- c: v,
7512
+ c: S,
7513
7513
  d: A
7514
- } = m, S = T.inverseTransform(r), E = T.transform([w, y, v, A, 0, 0], S);
7514
+ } = m, v = T.inverseTransform(r), E = T.transform([w, y, S, A, 0, 0], v);
7515
7515
  T.singularValueDecompose2dScale(E, At), a.lineWidth *= Math.max(At[0], At[1]) / c, a.stroke(this.#i(b, m, r));
7516
7516
  } else
7517
7517
  a.lineWidth /= c, a.stroke(b);
@@ -7519,7 +7519,7 @@ class le {
7519
7519
  } else
7520
7520
  (u === rt.FILL || u === rt.FILL_STROKE) && (a.fillText(e, s, i), this.dependencyTracker?.recordCharacterBBox(t, a, l, c, s, i, () => a.measureText(e))), (u === rt.STROKE || u === rt.FILL_STROKE) && (this.dependencyTracker && this.dependencyTracker?.recordCharacterBBox(t, a, l, c, s, i, () => a.measureText(e)).recordDependencies(t, St.stroke), a.strokeText(e, s, i));
7521
7521
  f && ((this.pendingTextPaths ||= []).push({
7522
- transform: K(a),
7522
+ transform: Q(a),
7523
7523
  x: s,
7524
7524
  y: i,
7525
7525
  fontSize: c,
@@ -7555,41 +7555,41 @@ class le {
7555
7555
  const r = this.ctx, a = s.fontSizeScale, o = s.charSpacing, l = s.wordSpacing, h = s.fontDirection, c = s.textHScale * h, u = e.length, f = i.vertical, g = f ? 1 : -1, p = i.defaultVMetrics, b = n * s.fontMatrix[0], m = s.textRenderingMode === rt.FILL && !i.disableFontFace && !s.patternFill;
7556
7556
  r.save(), s.textMatrix && r.transform(...s.textMatrix), r.translate(s.x, s.y + s.textRise), h > 0 ? r.scale(c, -1) : r.scale(c, 1);
7557
7557
  let w, y;
7558
- const v = s.textRenderingMode & rt.FILL_STROKE_MASK, A = v === rt.FILL || v === rt.FILL_STROKE, S = v === rt.STROKE || v === rt.FILL_STROKE;
7558
+ const S = s.textRenderingMode & rt.FILL_STROKE_MASK, A = S === rt.FILL || S === rt.FILL_STROKE, v = S === rt.STROKE || S === rt.FILL_STROKE;
7559
7559
  if (A && s.patternFill) {
7560
7560
  r.save();
7561
7561
  const x = s.fillColor.getPattern(r, this, Pt(r), ct.FILL, t);
7562
- w = K(r), r.restore(), r.fillStyle = x;
7562
+ w = Q(r), r.restore(), r.fillStyle = x;
7563
7563
  }
7564
- if (S && s.patternStroke) {
7564
+ if (v && s.patternStroke) {
7565
7565
  r.save();
7566
7566
  const x = s.strokeColor.getPattern(r, this, Pt(r), ct.STROKE, t);
7567
- y = K(r), r.restore(), r.strokeStyle = x;
7567
+ y = Q(r), r.restore(), r.strokeStyle = x;
7568
7568
  }
7569
7569
  let E = s.lineWidth;
7570
7570
  const _ = s.textMatrixScale;
7571
- if (_ === 0 || E === 0 ? S && (E = this.getSinglePixelWidth()) : E /= _, a !== 1 && (r.scale(a, a), E /= a), r.lineWidth = E, i.isInvalidPDFjsFont) {
7571
+ if (_ === 0 || E === 0 ? v && (E = this.getSinglePixelWidth()) : E /= _, a !== 1 && (r.scale(a, a), E /= a), r.lineWidth = E, i.isInvalidPDFjsFont) {
7572
7572
  const x = [];
7573
7573
  let H = 0;
7574
- for (const O of e)
7575
- x.push(O.unicode), H += O.width;
7574
+ for (const N of e)
7575
+ x.push(N.unicode), H += N.width;
7576
7576
  const V = x.join("");
7577
7577
  if (r.fillText(V, 0, 0), this.dependencyTracker !== null) {
7578
- const O = r.measureText(V);
7579
- this.dependencyTracker.recordBBox(t, this.ctx, -O.actualBoundingBoxLeft, O.actualBoundingBoxRight, -O.actualBoundingBoxAscent, O.actualBoundingBoxDescent).recordShowTextOperation(t);
7578
+ const N = r.measureText(V);
7579
+ this.dependencyTracker.recordBBox(t, this.ctx, -N.actualBoundingBoxLeft, N.actualBoundingBoxRight, -N.actualBoundingBoxAscent, N.actualBoundingBoxDescent).recordShowTextOperation(t);
7580
7580
  }
7581
7581
  s.x += H * b * c, r.restore(), this.compose();
7582
7582
  return;
7583
7583
  }
7584
- let C = 0, M;
7585
- for (M = 0; M < u; ++M) {
7586
- const x = e[M];
7584
+ let C = 0, P;
7585
+ for (P = 0; P < u; ++P) {
7586
+ const x = e[P];
7587
7587
  if (typeof x == "number") {
7588
7588
  C += g * x * n / 1e3;
7589
7589
  continue;
7590
7590
  }
7591
7591
  let H = !1;
7592
- const V = (x.isSpace ? l : 0) + o, O = x.fontChar, tt = x.accent;
7592
+ const V = (x.isSpace ? l : 0) + o, N = x.fontChar, K = x.accent;
7593
7593
  let k, R, $ = x.width;
7594
7594
  if (f) {
7595
7595
  const et = x.vmetric || p, W = -(x.vmetric ? et[1] : $ * 0.5) * b, X = et[2] * b;
@@ -7598,7 +7598,7 @@ class le {
7598
7598
  k = C / a, R = 0;
7599
7599
  let bt;
7600
7600
  if (i.remeasure && $ > 0) {
7601
- bt = r.measureText(O);
7601
+ bt = r.measureText(N);
7602
7602
  const et = bt.width * 1e3 / n * a;
7603
7603
  if ($ < et && this.isFontSubpixelAAEnabled) {
7604
7604
  const W = $ / et;
@@ -7606,13 +7606,13 @@ class le {
7606
7606
  } else $ !== et && (k += ($ - et) / 2e3 * n / a);
7607
7607
  }
7608
7608
  if (this.contentVisible && (x.isInFont || i.missingFile)) {
7609
- if (m && !tt)
7610
- r.fillText(O, k, R), this.dependencyTracker?.recordCharacterBBox(t, r, bt ? {
7609
+ if (m && !K)
7610
+ r.fillText(N, k, R), this.dependencyTracker?.recordCharacterBBox(t, r, bt ? {
7611
7611
  bbox: null
7612
- } : i, n / a, k, R, () => bt ?? r.measureText(O));
7613
- else if (this.paintChar(t, O, k, R, w, y), tt) {
7614
- const et = k + n * tt.offset.x / a, W = R - n * tt.offset.y / a;
7615
- this.paintChar(t, tt.fontChar, et, W, w, y);
7612
+ } : i, n / a, k, R, () => bt ?? r.measureText(N));
7613
+ else if (this.paintChar(t, N, k, R, w, y), K) {
7614
+ const et = k + n * K.offset.x / a, W = R - n * K.offset.y / a;
7615
+ this.paintChar(t, K.fontChar, et, W, w, y);
7616
7616
  }
7617
7617
  }
7618
7618
  const Lt = f ? $ * b - V * h : $ * b + V * h;
@@ -7632,10 +7632,10 @@ class le {
7632
7632
  w = o * b * r / 1e3, this.ctx.translate(w, 0), i.x += w * c;
7633
7633
  continue;
7634
7634
  }
7635
- const v = (b.isSpace ? h : 0) + l, A = n.charProcOperatorList[b.operatorListId];
7635
+ const S = (b.isSpace ? h : 0) + l, A = n.charProcOperatorList[b.operatorListId];
7636
7636
  A ? this.contentVisible && (this.save(), s.scale(r, r), s.transform(...u), this.executeOperatorList(A), this.restore()) : L(`Type3 character "${b.operatorListId}" is not available.`);
7637
- const S = [b.width, 0];
7638
- T.applyTransform(S, u), m = S[0] * r + v, s.translate(m, 0), i.x += m * c;
7637
+ const v = [b.width, 0];
7638
+ T.applyTransform(v, u), m = v[0] * r + S, s.translate(m, 0), i.x += m * c;
7639
7639
  }
7640
7640
  s.restore(), y && (this.dependencyTracker = y);
7641
7641
  }
@@ -7648,13 +7648,13 @@ class le {
7648
7648
  getColorN_Pattern(t, e) {
7649
7649
  let s;
7650
7650
  if (e[0] === "TilingPattern") {
7651
- const i = this.baseTransform || K(this.ctx), n = {
7651
+ const i = this.baseTransform || Q(this.ctx), n = {
7652
7652
  createCanvasGraphics: (r, a) => new le(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
7653
7653
  optionalContentConfig: this.optionalContentConfig,
7654
7654
  markedContentStack: this.markedContentStack
7655
7655
  }, void 0, void 0, this.dependencyTracker ? new Xe(this.dependencyTracker, a, !0) : null)
7656
7656
  };
7657
- s = new Os(e, this.ctx, n, i);
7657
+ s = new Ns(e, this.ctx, n, i);
7658
7658
  } else
7659
7659
  s = this._getPattern(t, e[1], e[2]);
7660
7660
  return s;
@@ -7708,7 +7708,7 @@ class le {
7708
7708
  G("Should not call beginImageData");
7709
7709
  }
7710
7710
  paintFormXObjectBegin(t, e, s) {
7711
- if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = K(this.ctx), s)) {
7711
+ if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = Q(this.ctx), s)) {
7712
7712
  T.axialAlignedBoundingBox(s, this.baseTransform, this.current.minMax);
7713
7713
  const [i, n, r, a] = s, o = new Path2D();
7714
7714
  o.rect(i, n, r - i, a - n), this.ctx.clip(o), this.dependencyTracker?.recordClipBox(t, this.ctx, i, r, n, a), this.endPath(t);
@@ -7723,11 +7723,11 @@ class le {
7723
7723
  this.save(t), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
7724
7724
  const s = this.ctx;
7725
7725
  e.isolated || Je("TODO: Support non-isolated groups."), e.knockout && L("Knockout groups not supported.");
7726
- const i = K(s);
7726
+ const i = Q(s);
7727
7727
  if (e.matrix && s.transform(...e.matrix), !e.bbox)
7728
7728
  throw new Error("Bounding box is required.");
7729
7729
  let n = ne.slice();
7730
- T.axialAlignedBoundingBox(e.bbox, K(s), n);
7730
+ T.axialAlignedBoundingBox(e.bbox, Q(s), n);
7731
7731
  const r = [0, 0, s.canvas.width, s.canvas.height];
7732
7732
  n = T.intersect(n, r) || [0, 0, 0, 0];
7733
7733
  const a = Math.floor(n[0]), o = Math.floor(n[1]), l = Math.max(Math.ceil(n[2]) - a, 1), h = Math.max(Math.ceil(n[3]) - o, 1);
@@ -7762,7 +7762,7 @@ class le {
7762
7762
  this.tempSMask = this.smaskStack.pop(), this.restore(t), this.dependencyTracker && this.ctx.restore();
7763
7763
  else {
7764
7764
  this.ctx.restore();
7765
- const n = K(this.ctx);
7765
+ const n = Q(this.ctx);
7766
7766
  this.restore(t), this.ctx.save(), this.ctx.setTransform(...n);
7767
7767
  const r = ne.slice();
7768
7768
  T.axialAlignedBoundingBox([0, 0, s.canvas.width, s.canvas.height], n, r), this.ctx.drawImage(s.canvas, 0, 0), this.ctx.restore(), this.compose(r);
@@ -7772,7 +7772,7 @@ class le {
7772
7772
  if (this.#t(), Ue(this.ctx), this.ctx.save(), this.save(t), this.baseTransform && this.ctx.setTransform(...this.baseTransform), s) {
7773
7773
  const a = s[2] - s[0], o = s[3] - s[1];
7774
7774
  if (r && this.annotationCanvasMap) {
7775
- i = i.slice(), i[4] -= s[0], i[5] -= s[1], s = s.slice(), s[0] = s[1] = 0, s[2] = a, s[3] = o, T.singularValueDecompose2dScale(K(this.ctx), At);
7775
+ i = i.slice(), i[4] -= s[0], i[5] -= s[1], s = s.slice(), s[0] = s[1] = 0, s[2] = a, s[3] = o, T.singularValueDecompose2dScale(Q(this.ctx), At);
7776
7776
  const {
7777
7777
  viewportScale: l
7778
7778
  } = this, h = Math.ceil(a * this.outputScaleX * l), c = Math.ceil(o * this.outputScaleY * l);
@@ -7807,7 +7807,7 @@ class le {
7807
7807
  e = this.getObject(t, e.data, e);
7808
7808
  const o = this.ctx;
7809
7809
  o.save();
7810
- const l = K(o);
7810
+ const l = Q(o);
7811
7811
  o.transform(s, i, n, r, 0, 0);
7812
7812
  const h = this._createMaskCanvas(t, e);
7813
7813
  o.setTransform(1, 0, 0, 1, h.offsetX - l[4], h.offsetY - l[5]), this.dependencyTracker?.resetBBox(t);
@@ -7896,7 +7896,7 @@ class le {
7896
7896
  ui(h, e), a = this.applyTransferMapsToCanvas(h);
7897
7897
  }
7898
7898
  const o = this._scaleImage(a, Pt(n));
7899
- n.imageSmoothingEnabled = pi(K(n), e.interpolate), this.dependencyTracker?.resetBBox(t).recordBBox(t, n, 0, s, -i, 0).recordDependencies(t, St.imageXObject).recordOperation(t), He(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, s, i), this.compose(), this.restore(t);
7899
+ n.imageSmoothingEnabled = pi(Q(n), e.interpolate), this.dependencyTracker?.resetBBox(t).recordBBox(t, n, 0, s, -i, 0).recordDependencies(t, St.imageXObject).recordOperation(t), He(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, s, i), this.compose(), this.restore(t);
7900
7900
  }
7901
7901
  paintInlineImageXObjectGroup(t, e, s) {
7902
7902
  if (!this.contentVisible)
@@ -7948,7 +7948,7 @@ class le {
7948
7948
  }
7949
7949
  getSinglePixelWidth() {
7950
7950
  if (!this._cachedGetSinglePixelWidth) {
7951
- const t = K(this.ctx);
7951
+ const t = Q(this.ctx);
7952
7952
  if (t[1] === 0 && t[2] === 0)
7953
7953
  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(t[0]), Math.abs(t[3]));
7954
7954
  else {
@@ -8547,7 +8547,7 @@ function Fi(d, t) {
8547
8547
  function es(d) {
8548
8548
  return URL.parse(d)?.origin ?? null;
8549
8549
  }
8550
- function Oi({
8550
+ function Ni({
8551
8551
  responseHeaders: d,
8552
8552
  isHttp: t,
8553
8553
  rangeChunkSize: e,
@@ -8559,7 +8559,7 @@ function Oi({
8559
8559
  }, n = parseInt(d.get("Content-Length"), 10);
8560
8560
  return !Number.isInteger(n) || (i.suggestedLength = n, n <= 2 * e) || s || !t || d.get("Accept-Ranges") !== "bytes" || (d.get("Content-Encoding") || "identity") !== "identity" || (i.allowRangeRequests = !0), i;
8561
8561
  }
8562
- function Ni(d) {
8562
+ function Oi(d) {
8563
8563
  const t = d.get("Content-Disposition");
8564
8564
  if (t) {
8565
8565
  let e = fr(t);
@@ -8628,13 +8628,13 @@ class gr {
8628
8628
  const r = n.headers, {
8629
8629
  allowRangeRequests: a,
8630
8630
  suggestedLength: o
8631
- } = Oi({
8631
+ } = Ni({
8632
8632
  responseHeaders: r,
8633
8633
  isHttp: t.isHttp,
8634
8634
  rangeChunkSize: this._rangeChunkSize,
8635
8635
  disableRange: this._disableRange
8636
8636
  });
8637
- this._isRangeSupported = a, this._contentLength = o || this._contentLength, this._filename = Ni(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new zt("Streaming is disabled."));
8637
+ this._isRangeSupported = a, this._contentLength = o || this._contentLength, this._filename = Oi(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new zt("Streaming is disabled."));
8638
8638
  }).catch(this._headersCapability.reject), this.onProgress = null;
8639
8639
  }
8640
8640
  get headersReady() {
@@ -8820,13 +8820,13 @@ class Ar {
8820
8820
  }) : []), {
8821
8821
  allowRangeRequests: n,
8822
8822
  suggestedLength: r
8823
- } = Oi({
8823
+ } = Ni({
8824
8824
  responseHeaders: i,
8825
8825
  isHttp: this._manager.isHttp,
8826
8826
  rangeChunkSize: this._rangeChunkSize,
8827
8827
  disableRange: this._disableRange
8828
8828
  });
8829
- n && (this._isRangeSupported = !0), this._contentLength = r || this._contentLength, this._filename = Ni(i), this._isRangeSupported && this._manager.abortRequest(t), this._headersCapability.resolve();
8829
+ n && (this._isRangeSupported = !0), this._contentLength = r || this._contentLength, this._filename = Oi(i), this._isRangeSupported && this._manager.abortRequest(t), this._headersCapability.resolve();
8830
8830
  }
8831
8831
  _onDone(t) {
8832
8832
  if (t && (this._requests.length > 0 ? this._requests.shift().resolve({
@@ -9301,7 +9301,7 @@ class wt {
9301
9301
  r.vertical && (n += Math.PI / 2);
9302
9302
  let a = this.#s && r.fontSubstitution || r.fontFamily;
9303
9303
  a = wt.fontFamilyMap.get(a) || a;
9304
- const o = Math.hypot(i[2], i[3]), l = o * wt.#N(a, r, this.#a);
9304
+ const o = Math.hypot(i[2], i[3]), l = o * wt.#O(a, r, this.#a);
9305
9305
  let h, c;
9306
9306
  n === 0 ? (h = i[4], c = i[5] - l) : (h = i[4] + l * Math.sin(n), c = i[5] - l * Math.cos(n));
9307
9307
  const u = e.style;
@@ -9375,7 +9375,7 @@ class wt {
9375
9375
  const t = document.createElement("div");
9376
9376
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#E = t.getBoundingClientRect().height, t.remove();
9377
9377
  }
9378
- static #N(t, e, s) {
9378
+ static #O(t, e, s) {
9379
9379
  const i = this.#w.get(t);
9380
9380
  if (i)
9381
9381
  return i;
@@ -9394,29 +9394,29 @@ function $i(d = {}) {
9394
9394
  } : (d instanceof ArrayBuffer || ArrayBuffer.isView(d)) && (d = {
9395
9395
  data: d
9396
9396
  });
9397
- const t = new Ns(), {
9397
+ const t = new Os(), {
9398
9398
  docId: e
9399
- } = t, s = d.url ? Fn(d.url) : null, i = d.data ? On(d.data) : null, n = d.httpHeaders || null, r = d.withCredentials === !0, a = d.password ?? null, o = d.range instanceof Vi ? d.range : null, l = Number.isInteger(d.rangeChunkSize) && d.rangeChunkSize > 0 ? d.rangeChunkSize : 2 ** 16;
9399
+ } = t, s = d.url ? Fn(d.url) : null, i = d.data ? Nn(d.data) : null, n = d.httpHeaders || null, r = d.withCredentials === !0, a = d.password ?? null, o = d.range instanceof Vi ? d.range : null, l = Number.isInteger(d.rangeChunkSize) && d.rangeChunkSize > 0 ? d.rangeChunkSize : 2 ** 16;
9400
9400
  let h = d.worker instanceof Ce ? d.worker : null;
9401
- const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Ze(d.docBaseUrl) ? d.docBaseUrl : null, f = Fe(d.cMapUrl), g = d.cMapPacked !== !1, p = d.CMapReaderFactory || (dt ? jn : si), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Gn : ii), y = Fe(d.wasmUrl), v = d.WasmFactory || (dt ? Wn : ni), A = d.stopAtErrors !== !0, S = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, E = d.isEvalSupported !== !1, _ = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, C = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(d.canvasMaxAreaInBytes) ? d.canvasMaxAreaInBytes : -1, x = typeof d.disableFontFace == "boolean" ? d.disableFontFace : dt, H = d.fontExtraProperties === !0, V = d.enableXfa === !0, O = d.ownerDocument || globalThis.document, tt = d.disableRange === !0, k = d.disableStream === !0, R = d.disableAutoFetch === !0, $ = d.pdfBug === !0, bt = d.CanvasFactory || (dt ? Vn : Un), Lt = d.FilterFactory || (dt ? $n : zn), et = d.enableHWA === !0, W = d.useWasm !== !1, X = o ? o.length : d.length ?? NaN, Vt = typeof d.useSystemFonts == "boolean" ? d.useSystemFonts : !dt && !x, Nt = typeof d.useWorkerFetch == "boolean" ? d.useWorkerFetch : !!(p === si && w === ii && v === ni && f && m && y && ye(f, document.baseURI) && ye(m, document.baseURI) && ye(y, document.baseURI)), Bt = null;
9401
+ const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Ze(d.docBaseUrl) ? d.docBaseUrl : null, f = Fe(d.cMapUrl), g = d.cMapPacked !== !1, p = d.CMapReaderFactory || (dt ? jn : si), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Gn : ii), y = Fe(d.wasmUrl), S = d.WasmFactory || (dt ? Wn : ni), A = d.stopAtErrors !== !0, v = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, E = d.isEvalSupported !== !1, _ = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, C = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), P = Number.isInteger(d.canvasMaxAreaInBytes) ? d.canvasMaxAreaInBytes : -1, x = typeof d.disableFontFace == "boolean" ? d.disableFontFace : dt, H = d.fontExtraProperties === !0, V = d.enableXfa === !0, N = d.ownerDocument || globalThis.document, K = d.disableRange === !0, k = d.disableStream === !0, R = d.disableAutoFetch === !0, $ = d.pdfBug === !0, bt = d.CanvasFactory || (dt ? Vn : Un), Lt = d.FilterFactory || (dt ? $n : zn), et = d.enableHWA === !0, W = d.useWasm !== !1, X = o ? o.length : d.length ?? NaN, Vt = typeof d.useSystemFonts == "boolean" ? d.useSystemFonts : !dt && !x, Ot = typeof d.useWorkerFetch == "boolean" ? d.useWorkerFetch : !!(p === si && w === ii && S === ni && f && m && y && ye(f, document.baseURI) && ye(m, document.baseURI) && ye(y, document.baseURI)), Bt = null;
9402
9402
  ln(c);
9403
9403
  const st = {
9404
9404
  canvasFactory: new bt({
9405
- ownerDocument: O,
9405
+ ownerDocument: N,
9406
9406
  enableHWA: et
9407
9407
  }),
9408
9408
  filterFactory: new Lt({
9409
9409
  docId: e,
9410
- ownerDocument: O
9410
+ ownerDocument: N
9411
9411
  }),
9412
- cMapReaderFactory: Nt ? null : new p({
9412
+ cMapReaderFactory: Ot ? null : new p({
9413
9413
  baseUrl: f,
9414
9414
  isCompressed: g
9415
9415
  }),
9416
- standardFontDataFactory: Nt ? null : new w({
9416
+ standardFontDataFactory: Ot ? null : new w({
9417
9417
  baseUrl: m
9418
9418
  }),
9419
- wasmFactory: Nt ? null : new v({
9419
+ wasmFactory: Ot ? null : new S({
9420
9420
  baseUrl: y
9421
9421
  })
9422
9422
  };
@@ -9435,24 +9435,24 @@ function $i(d = {}) {
9435
9435
  docBaseUrl: u,
9436
9436
  enableXfa: V,
9437
9437
  evaluatorOptions: {
9438
- maxImageSize: S,
9438
+ maxImageSize: v,
9439
9439
  disableFontFace: x,
9440
9440
  ignoreErrors: A,
9441
9441
  isEvalSupported: E,
9442
9442
  isOffscreenCanvasSupported: _,
9443
9443
  isImageDecoderSupported: C,
9444
- canvasMaxAreaInBytes: M,
9444
+ canvasMaxAreaInBytes: P,
9445
9445
  fontExtraProperties: H,
9446
9446
  useSystemFonts: Vt,
9447
9447
  useWasm: W,
9448
- useWorkerFetch: Nt,
9448
+ useWorkerFetch: Ot,
9449
9449
  cMapUrl: f,
9450
9450
  iccUrl: b,
9451
9451
  standardFontDataUrl: m,
9452
9452
  wasmUrl: y
9453
9453
  }
9454
9454
  }, ue = {
9455
- ownerDocument: O,
9455
+ ownerDocument: N,
9456
9456
  pdfBug: $,
9457
9457
  styleElement: Bt,
9458
9458
  loadingParams: {
@@ -9469,7 +9469,7 @@ function $i(d = {}) {
9469
9469
  let is;
9470
9470
  if (o)
9471
9471
  is = new cr(o, {
9472
- disableRange: tt,
9472
+ disableRange: K,
9473
9473
  disableStream: k
9474
9474
  });
9475
9475
  else if (!i) {
@@ -9482,7 +9482,7 @@ function $i(d = {}) {
9482
9482
  httpHeaders: n,
9483
9483
  withCredentials: r,
9484
9484
  rangeChunkSize: l,
9485
- disableRange: tt,
9485
+ disableRange: K,
9486
9486
  disableStream: k
9487
9487
  });
9488
9488
  }
@@ -9496,12 +9496,12 @@ function $i(d = {}) {
9496
9496
  });
9497
9497
  }).catch(t._capability.reject), t;
9498
9498
  }
9499
- class Ns {
9499
+ class Os {
9500
9500
  static #t = 0;
9501
9501
  _capability = Promise.withResolvers();
9502
9502
  _transport = null;
9503
9503
  _worker = null;
9504
- docId = `d${Ns.#t++}`;
9504
+ docId = `d${Os.#t++}`;
9505
9505
  destroyed = !1;
9506
9506
  onPassword = null;
9507
9507
  onProgress = null;
@@ -9779,21 +9779,21 @@ class kr {
9779
9779
  lastChunk: !1,
9780
9780
  separateAnnots: null
9781
9781
  }, this._stats?.time("Page Request"), this._pumpOperatorList(p));
9782
- const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (f || v), S = (C) => {
9782
+ const S = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (f || S), v = (C) => {
9783
9783
  if (w.renderTasks.delete(E), A) {
9784
- const M = E.gfx?.dependencyTracker.take();
9785
- M && (E.stepper && E.stepper.setOperatorBBoxes(M, E.gfx.dependencyTracker.takeDebugMetadata()), f && (this.recordedBBoxes = M));
9784
+ const P = E.gfx?.dependencyTracker.take();
9785
+ P && (E.stepper && E.stepper.setOperatorBBoxes(P, E.gfx.dependencyTracker.takeDebugMetadata()), f && (this.recordedBBoxes = P));
9786
9786
  }
9787
9787
  y && (this.#t = !0), this.#e(), C ? (E.capability.reject(C), this._abortOperatorList({
9788
9788
  intentState: w,
9789
9789
  reason: C instanceof Error ? C : new Error(C)
9790
9790
  })) : E.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
9791
9791
  }, E = new re({
9792
- callback: S,
9792
+ callback: v,
9793
9793
  params: {
9794
9794
  canvas: e,
9795
9795
  canvasContext: t,
9796
- dependencyTracker: A ? new qn(e, w.operatorList.length, v) : null,
9796
+ dependencyTracker: A ? new qn(e, w.operatorList.length, S) : null,
9797
9797
  viewport: s,
9798
9798
  transform: r,
9799
9799
  background: a
@@ -9813,18 +9813,18 @@ class kr {
9813
9813
  });
9814
9814
  (w.renderTasks ||= /* @__PURE__ */ new Set()).add(E);
9815
9815
  const _ = E.task;
9816
- return Promise.all([w.displayReadyCapability.promise, o]).then(([C, M]) => {
9816
+ return Promise.all([w.displayReadyCapability.promise, o]).then(([C, P]) => {
9817
9817
  if (this.destroyed) {
9818
- S();
9818
+ v();
9819
9819
  return;
9820
9820
  }
9821
- if (this._stats?.time("Rendering"), !(M.renderingIntent & b))
9821
+ if (this._stats?.time("Rendering"), !(P.renderingIntent & b))
9822
9822
  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
9823
9823
  E.initializeGraphics({
9824
9824
  transparency: C,
9825
- optionalContentConfig: M
9825
+ optionalContentConfig: P
9826
9826
  }), E.operatorListChanged();
9827
- }).catch(S), _;
9827
+ }).catch(v), _;
9828
9828
  }
9829
9829
  getOperatorList({
9830
9830
  intent: t = "display",
@@ -10012,7 +10012,7 @@ class kr {
10012
10012
  return this._stats;
10013
10013
  }
10014
10014
  }
10015
- var Ut, Ct, Ot, Gt, Ye, Wt, Xt, ft, je, ji, Gi, Ae, he, Ge;
10015
+ var Ut, Ct, Nt, Gt, Ye, Wt, Xt, ft, je, ji, Gi, Ae, he, Ge;
10016
10016
  const Y = class Y {
10017
10017
  constructor({
10018
10018
  name: t = null,
@@ -10022,7 +10022,7 @@ const Y = class Y {
10022
10022
  xt(this, ft);
10023
10023
  xt(this, Ut, Promise.withResolvers());
10024
10024
  xt(this, Ct, null);
10025
- xt(this, Ot, null);
10025
+ xt(this, Nt, null);
10026
10026
  xt(this, Gt, null);
10027
10027
  if (this.name = t, this.destroyed = !1, this.verbosity = s, e) {
10028
10028
  if (q(Y, Xt).has(e))
@@ -10035,13 +10035,13 @@ const Y = class Y {
10035
10035
  return q(this, Ut).promise;
10036
10036
  }
10037
10037
  get port() {
10038
- return q(this, Ot);
10038
+ return q(this, Nt);
10039
10039
  }
10040
10040
  get messageHandler() {
10041
10041
  return q(this, Ct);
10042
10042
  }
10043
10043
  destroy() {
10044
- this.destroyed = !0, q(this, Gt)?.terminate(), pt(this, Gt, null), q(Y, Xt).delete(q(this, Ot)), pt(this, Ot, null), q(this, Ct)?.destroy(), pt(this, Ct, null);
10044
+ this.destroyed = !0, q(this, Gt)?.terminate(), pt(this, Gt, null), q(Y, Xt).delete(q(this, Nt)), pt(this, Nt, null), q(this, Ct)?.destroy(), pt(this, Ct, null);
10045
10045
  }
10046
10046
  static create(t) {
10047
10047
  const e = q(this, Xt).get(t?.port);
@@ -10065,12 +10065,12 @@ const Y = class Y {
10065
10065
  )).WorkerMessageHandler)());
10066
10066
  }
10067
10067
  };
10068
- Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), Gt = new WeakMap(), Ye = new WeakMap(), Wt = new WeakMap(), Xt = new WeakMap(), ft = new WeakSet(), je = function() {
10068
+ Ut = new WeakMap(), Ct = new WeakMap(), Nt = new WeakMap(), Gt = new WeakMap(), Ye = new WeakMap(), Wt = new WeakMap(), Xt = new WeakMap(), ft = new WeakSet(), je = function() {
10069
10069
  q(this, Ut).resolve(), q(this, Ct).send("configure", {
10070
10070
  verbosity: this.verbosity
10071
10071
  });
10072
10072
  }, ji = function(t) {
10073
- pt(this, Ot, t), pt(this, Ct, new we("main", "worker", t)), q(this, Ct).on("ready", () => {
10073
+ pt(this, Nt, t), pt(this, Ct, new we("main", "worker", t)), q(this, Ct).on("ready", () => {
10074
10074
  }), Tt(this, ft, je).call(this);
10075
10075
  }, Gi = function() {
10076
10076
  if (q(Y, Wt) || q(Y, he, Ge)) {
@@ -10096,7 +10096,7 @@ Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), Gt = new WeakMap(),
10096
10096
  i();
10097
10097
  return;
10098
10098
  }
10099
- pt(this, Ct, s), pt(this, Ot, e), pt(this, Gt, e), Tt(this, ft, je).call(this);
10099
+ pt(this, Ct, s), pt(this, Nt, e), pt(this, Gt, e), Tt(this, ft, je).call(this);
10100
10100
  }), s.on("ready", (a) => {
10101
10101
  if (n.abort(), this.destroyed) {
10102
10102
  i();
@@ -10125,7 +10125,7 @@ Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), Gt = new WeakMap(),
10125
10125
  return;
10126
10126
  }
10127
10127
  const e = new Hn();
10128
- pt(this, Ot, e);
10128
+ pt(this, Nt, e);
10129
10129
  const s = `fake${Ws(Y, Ye)._++}`, i = new we(s + "_worker", s, e);
10130
10130
  t.setup(i, e), pt(this, Ct, new we(s, s + "_worker", e)), Tt(this, ft, je).call(this);
10131
10131
  }).catch((t) => {
@@ -10720,7 +10720,7 @@ class Et {
10720
10720
  #f(t, e) {
10721
10721
  e.stopPropagation(), this.#o.dispatch("switchannotationeditorparams", {
10722
10722
  source: this,
10723
- type: N.HIGHLIGHT_COLOR,
10723
+ type: O.HIGHLIGHT_COLOR,
10724
10724
  value: t
10725
10725
  }), this.updateColor(t);
10726
10726
  }
@@ -10921,7 +10921,7 @@ class qe extends Ir {
10921
10921
  return document.createElementNS(It, t);
10922
10922
  }
10923
10923
  }
10924
- const Fr = 9, Kt = /* @__PURE__ */ new WeakSet(), Or = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
10924
+ const Fr = 9, Kt = /* @__PURE__ */ new WeakSet(), Nr = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
10925
10925
  class ps {
10926
10926
  static create(t) {
10927
10927
  switch (t.data.annotationType) {
@@ -10972,11 +10972,11 @@ class ps {
10972
10972
  case nt.FILEATTACHMENT:
10973
10973
  return new Zr(t);
10974
10974
  default:
10975
- return new Q(t);
10975
+ return new J(t);
10976
10976
  }
10977
10977
  }
10978
10978
  }
10979
- class Q {
10979
+ class J {
10980
10980
  #t = null;
10981
10981
  #e = !1;
10982
10982
  #i = null;
@@ -10997,7 +10997,7 @@ class Q {
10997
10997
  return this.data.isEditable;
10998
10998
  }
10999
10999
  get hasPopupData() {
11000
- return Q._hasPopupData(this.data) || this.enableComment && !!this.commentText;
11000
+ return J._hasPopupData(this.data) || this.enableComment && !!this.commentText;
11001
11001
  }
11002
11002
  get commentData() {
11003
11003
  const {
@@ -11321,8 +11321,8 @@ class Q {
11321
11321
  const f = h.createElement("clipPath"), g = `clippath_${this.data.id}`;
11322
11322
  f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), u.append(f);
11323
11323
  for (let p = 2, b = t.length; p < b; p += 8) {
11324
- const m = t[p], w = t[p + 1], y = t[p + 2], v = t[p + 3], A = h.createElement("rect"), S = (y - e) / o, E = (n - w) / l, _ = (m - y) / o, C = (w - v) / l;
11325
- A.setAttribute("x", S), A.setAttribute("y", E), A.setAttribute("width", _), A.setAttribute("height", C), f.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${S}" y="${E}" width="${_}" height="${C}"/>`);
11324
+ const m = t[p], w = t[p + 1], y = t[p + 2], S = t[p + 3], A = h.createElement("rect"), v = (y - e) / o, E = (n - w) / l, _ = (m - y) / o, C = (w - S) / l;
11325
+ A.setAttribute("x", v), A.setAttribute("y", E), A.setAttribute("width", _), A.setAttribute("height", C), f.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${v}" y="${E}" width="${_}" height="${C}"/>`);
11326
11326
  }
11327
11327
  this.#e && (a.push("</g></svg>')"), r.backgroundImage = a.join("")), this.container.append(c), this.container.style.clipPath = `url(#${g})`;
11328
11328
  }
@@ -11439,7 +11439,7 @@ class Q {
11439
11439
  return this.data.rect[3] - this.data.rect[1];
11440
11440
  }
11441
11441
  }
11442
- class Nr extends Q {
11442
+ class Or extends J {
11443
11443
  constructor(t) {
11444
11444
  super(t, {
11445
11445
  isRenderable: !0,
@@ -11474,7 +11474,7 @@ class Nr extends Q {
11474
11474
  this.parent.removeAnnotation(this.data.id), this.container.remove(), this.container = null, this.removePopup();
11475
11475
  }
11476
11476
  }
11477
- class Bs extends Q {
11477
+ class Bs extends J {
11478
11478
  constructor(t, e = null) {
11479
11479
  super(t, {
11480
11480
  isRenderable: !0,
@@ -11601,7 +11601,7 @@ class Bs extends Q {
11601
11601
  };
11602
11602
  }
11603
11603
  }
11604
- class Br extends Q {
11604
+ class Br extends J {
11605
11605
  constructor(t) {
11606
11606
  super(t, {
11607
11607
  isRenderable: !0
@@ -11615,7 +11615,7 @@ class Br extends Q {
11615
11615
  })), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container.append(t), this.container;
11616
11616
  }
11617
11617
  }
11618
- class Jt extends Q {
11618
+ class Jt extends J {
11619
11619
  render() {
11620
11620
  return this.container;
11621
11621
  }
@@ -11755,9 +11755,9 @@ class Hr extends Jt {
11755
11755
  if (u)
11756
11756
  if (h === "time") {
11757
11757
  const w = new Date(m), y = [w.getHours(), w.getMinutes(), w.getSeconds()];
11758
- b.value = y.map((v) => v.toString().padStart(2, "0")).join(":");
11758
+ b.value = y.map((S) => S.toString().padStart(2, "0")).join(":");
11759
11759
  } else
11760
- b.value = new Date(m - Or).toISOString().split(h === "date" ? "T" : ".", 1)[0];
11760
+ b.value = new Date(m - Nr).toISOString().split(h === "date" ? "T" : ".", 1)[0];
11761
11761
  else
11762
11762
  b.value = m;
11763
11763
  }
@@ -11794,15 +11794,15 @@ class Hr extends Jt {
11794
11794
  return;
11795
11795
  }
11796
11796
  y.setAttribute("maxLength", w);
11797
- let v = o.userValue;
11798
- !v || v.length <= w || (v = v.slice(0, w), y.value = o.userValue = v, t.setValue(e, {
11799
- value: v
11797
+ let S = o.userValue;
11798
+ !S || S.length <= w || (S = S.slice(0, w), y.value = o.userValue = S, t.setValue(e, {
11799
+ value: S
11800
11800
  }), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
11801
11801
  source: this,
11802
11802
  detail: {
11803
11803
  id: e,
11804
11804
  name: "Keystroke",
11805
- value: v,
11805
+ value: S,
11806
11806
  willCommit: !0,
11807
11807
  commitKey: 1,
11808
11808
  selStart: y.selectionStart,
@@ -11872,9 +11872,9 @@ class Hr extends Jt {
11872
11872
  } = p, {
11873
11873
  value: w,
11874
11874
  selectionStart: y,
11875
- selectionEnd: v
11875
+ selectionEnd: S
11876
11876
  } = m;
11877
- let A = y, S = v;
11877
+ let A = y, v = S;
11878
11878
  switch (p.inputType) {
11879
11879
  case "deleteWordBackward": {
11880
11880
  const E = w.substring(0, y).match(/\w*[^\w]*$/);
@@ -11883,14 +11883,14 @@ class Hr extends Jt {
11883
11883
  }
11884
11884
  case "deleteWordForward": {
11885
11885
  const E = w.substring(y).match(/^[^\w]*\w*/);
11886
- E && (S += E[0].length);
11886
+ E && (v += E[0].length);
11887
11887
  break;
11888
11888
  }
11889
11889
  case "deleteContentBackward":
11890
- y === v && (A -= 1);
11890
+ y === S && (A -= 1);
11891
11891
  break;
11892
11892
  case "deleteContentForward":
11893
- y === v && (S += 1);
11893
+ y === S && (v += 1);
11894
11894
  break;
11895
11895
  }
11896
11896
  p.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
@@ -11902,7 +11902,7 @@ class Hr extends Jt {
11902
11902
  change: b || "",
11903
11903
  willCommit: !1,
11904
11904
  selStart: A,
11905
- selEnd: S
11905
+ selEnd: v
11906
11906
  }
11907
11907
  });
11908
11908
  }), this._setEventListeners(s, o, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (p) => p.target.value);
@@ -12176,7 +12176,7 @@ class Vr extends Jt {
12176
12176
  }), this.data.combo && this._setTextStyle(i), this._setBackgroundColor(i), this._setDefaultPropertiesFromJS(i), this.container.append(i), this.container;
12177
12177
  }
12178
12178
  }
12179
- class Cs extends Q {
12179
+ class Cs extends J {
12180
12180
  constructor(t) {
12181
12181
  const {
12182
12182
  data: e,
@@ -12184,8 +12184,8 @@ class Cs extends Q {
12184
12184
  parent: i
12185
12185
  } = t, n = !!i._commentManager;
12186
12186
  if (super(t, {
12187
- isRenderable: !n && Q._hasPopupData(e)
12188
- }), this.elements = s, n && Q._hasPopupData(e)) {
12187
+ isRenderable: !n && J._hasPopupData(e)
12188
+ }), this.elements = s, n && J._hasPopupData(e)) {
12189
12189
  const r = this.popup = this.#t();
12190
12190
  for (const a of s)
12191
12191
  a.popup = r;
@@ -12318,7 +12318,7 @@ class jr {
12318
12318
  const r = this.#p = document.createElement("button");
12319
12319
  r.className = "annotationCommentButton";
12320
12320
  const a = this.#A.container;
12321
- 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.#N(), this.#M(), r.addEventListener("keydown", this.#e, {
12321
+ 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.#M(), r.addEventListener("keydown", this.#e, {
12322
12322
  signal: t
12323
12323
  }), r.addEventListener("click", s, {
12324
12324
  signal: t
@@ -12338,7 +12338,7 @@ class jr {
12338
12338
  } = this.#p;
12339
12339
  s.left = `calc(${t}%)`, s.top = `calc(${e}% - var(--comment-button-dim))`;
12340
12340
  }
12341
- #N() {
12341
+ #O() {
12342
12342
  this.#A.extraPopupElement || (this.#p || this.renderCommentButton(), this.#p.style.backgroundColor = this.commentButtonColor || "");
12343
12343
  }
12344
12344
  get commentButtonColor() {
@@ -12510,7 +12510,7 @@ class jr {
12510
12510
  deleted: s
12511
12511
  }) {
12512
12512
  if (this.#t) {
12513
- s ? (this.remove(), this.#_ = null) : e && (e.deleted ? this.remove() : (this.#N(), this.#_ = e.text)), t && (this.#b = null, this.#P(), this.#M());
12513
+ s ? (this.remove(), this.#_ = null) : e && (e.deleted ? this.remove() : (this.#O(), this.#_ = e.text)), t && (this.#b = null, this.#P(), this.#M());
12514
12514
  return;
12515
12515
  }
12516
12516
  if (s || e?.deleted) {
@@ -12585,7 +12585,7 @@ class jr {
12585
12585
  return this.#t ? !1 : this.#n.hidden === !1;
12586
12586
  }
12587
12587
  }
12588
- class qi extends Q {
12588
+ class qi extends J {
12589
12589
  constructor(t) {
12590
12590
  super(t, {
12591
12591
  isRenderable: !0,
@@ -12605,7 +12605,7 @@ class qi extends Q {
12605
12605
  return !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
12606
12606
  }
12607
12607
  }
12608
- class Gr extends Q {
12608
+ class Gr extends J {
12609
12609
  #t = null;
12610
12610
  constructor(t) {
12611
12611
  super(t, {
@@ -12629,7 +12629,7 @@ class Gr extends Q {
12629
12629
  this.container.classList.add("highlightArea");
12630
12630
  }
12631
12631
  }
12632
- class Wr extends Q {
12632
+ class Wr extends J {
12633
12633
  #t = null;
12634
12634
  constructor(t) {
12635
12635
  super(t, {
@@ -12653,7 +12653,7 @@ class Wr extends Q {
12653
12653
  this.container.classList.add("highlightArea");
12654
12654
  }
12655
12655
  }
12656
- class Xr extends Q {
12656
+ class Xr extends J {
12657
12657
  #t = null;
12658
12658
  constructor(t) {
12659
12659
  super(t, {
@@ -12677,7 +12677,7 @@ class Xr extends Q {
12677
12677
  this.container.classList.add("highlightArea");
12678
12678
  }
12679
12679
  }
12680
- class Yi extends Q {
12680
+ class Yi extends J {
12681
12681
  #t = null;
12682
12682
  constructor(t) {
12683
12683
  super(t, {
@@ -12721,7 +12721,7 @@ class qr extends Yi {
12721
12721
  super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
12722
12722
  }
12723
12723
  }
12724
- class Yr extends Q {
12724
+ class Yr extends J {
12725
12725
  constructor(t) {
12726
12726
  super(t, {
12727
12727
  isRenderable: !0,
@@ -12732,7 +12732,7 @@ class Yr extends Q {
12732
12732
  return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12733
12733
  }
12734
12734
  }
12735
- class Hs extends Q {
12735
+ class Hs extends J {
12736
12736
  #t = null;
12737
12737
  #e = [];
12738
12738
  constructor(t) {
@@ -12817,7 +12817,7 @@ class Hs extends Q {
12817
12817
  this.container.classList.add("highlightArea");
12818
12818
  }
12819
12819
  }
12820
- class Ki extends Q {
12820
+ class Ki extends J {
12821
12821
  constructor(t) {
12822
12822
  super(t, {
12823
12823
  isRenderable: !0,
@@ -12839,7 +12839,7 @@ class Ki extends Q {
12839
12839
  return this.container;
12840
12840
  }
12841
12841
  }
12842
- class Kr extends Q {
12842
+ class Kr extends J {
12843
12843
  constructor(t) {
12844
12844
  super(t, {
12845
12845
  isRenderable: !0,
@@ -12861,7 +12861,7 @@ class Kr extends Q {
12861
12861
  return this.container;
12862
12862
  }
12863
12863
  }
12864
- class Qr extends Q {
12864
+ class Qr extends J {
12865
12865
  constructor(t) {
12866
12866
  super(t, {
12867
12867
  isRenderable: !0,
@@ -12883,7 +12883,7 @@ class Qr extends Q {
12883
12883
  return this.container;
12884
12884
  }
12885
12885
  }
12886
- class Jr extends Q {
12886
+ class Jr extends J {
12887
12887
  constructor(t) {
12888
12888
  super(t, {
12889
12889
  isRenderable: !0,
@@ -12905,7 +12905,7 @@ class Jr extends Q {
12905
12905
  return this.container;
12906
12906
  }
12907
12907
  }
12908
- class Qi extends Q {
12908
+ class Qi extends J {
12909
12909
  constructor(t) {
12910
12910
  super(t, {
12911
12911
  isRenderable: !0,
@@ -12916,7 +12916,7 @@ class Qi extends Q {
12916
12916
  return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
12917
12917
  }
12918
12918
  }
12919
- class Zr extends Q {
12919
+ class Zr extends J {
12920
12920
  #t = null;
12921
12921
  constructor(t) {
12922
12922
  super(t, {
@@ -13142,7 +13142,7 @@ class Us {
13142
13142
  } = this, {
13143
13143
  id: s,
13144
13144
  rotation: i
13145
- } = t, n = new Nr({
13145
+ } = t, n = new Or({
13146
13146
  data: {
13147
13147
  id: s,
13148
13148
  rect: t.getPDFRect(),
@@ -13241,35 +13241,35 @@ class lt extends D {
13241
13241
  }
13242
13242
  static updateDefaultParams(t, e) {
13243
13243
  switch (t) {
13244
- case N.FREETEXT_SIZE:
13244
+ case O.FREETEXT_SIZE:
13245
13245
  lt._defaultFontSize = e;
13246
13246
  break;
13247
- case N.FREETEXT_COLOR:
13247
+ case O.FREETEXT_COLOR:
13248
13248
  lt._defaultColor = e;
13249
13249
  break;
13250
13250
  }
13251
13251
  }
13252
13252
  updateParams(t, e) {
13253
13253
  switch (t) {
13254
- case N.FREETEXT_SIZE:
13254
+ case O.FREETEXT_SIZE:
13255
13255
  this.#a(e);
13256
13256
  break;
13257
- case N.FREETEXT_COLOR:
13257
+ case O.FREETEXT_COLOR:
13258
13258
  this.#r(e);
13259
13259
  break;
13260
13260
  }
13261
13261
  }
13262
13262
  static get defaultPropertiesToUpdate() {
13263
- return [[N.FREETEXT_SIZE, lt._defaultFontSize], [N.FREETEXT_COLOR, lt._defaultColor || D._defaultLineColor]];
13263
+ return [[O.FREETEXT_SIZE, lt._defaultFontSize], [O.FREETEXT_COLOR, lt._defaultColor || D._defaultLineColor]];
13264
13264
  }
13265
13265
  get propertiesToUpdate() {
13266
- return [[N.FREETEXT_SIZE, this.#s], [N.FREETEXT_COLOR, this.color]];
13266
+ return [[O.FREETEXT_SIZE, this.#s], [O.FREETEXT_COLOR, this.color]];
13267
13267
  }
13268
13268
  get toolbarButtons() {
13269
13269
  return this._colorPicker ||= new xe(this), [["colorPicker", this._colorPicker]];
13270
13270
  }
13271
13271
  get colorType() {
13272
- return N.FREETEXT_COLOR;
13272
+ return O.FREETEXT_COLOR;
13273
13273
  }
13274
13274
  #a(t) {
13275
13275
  const e = (i) => {
@@ -13280,7 +13280,7 @@ class lt extends D {
13280
13280
  undo: e.bind(this, s),
13281
13281
  post: this._uiManager.updateUI.bind(this._uiManager, this),
13282
13282
  mustExec: !0,
13283
- type: N.FREETEXT_SIZE,
13283
+ type: O.FREETEXT_SIZE,
13284
13284
  overwriteIfSameType: !0,
13285
13285
  keepUndo: !0
13286
13286
  });
@@ -13297,7 +13297,7 @@ class lt extends D {
13297
13297
  undo: e.bind(this, s),
13298
13298
  post: this._uiManager.updateUI.bind(this._uiManager, this),
13299
13299
  mustExec: !0,
13300
- type: N.FREETEXT_COLOR,
13300
+ type: O.FREETEXT_COLOR,
13301
13301
  overwriteIfSameType: !0,
13302
13302
  keepUndo: !0
13303
13303
  });
@@ -13644,7 +13644,7 @@ class lt extends D {
13644
13644
  super.resetAnnotationElement(t), t.resetEdited();
13645
13645
  }
13646
13646
  }
13647
- class P {
13647
+ class M {
13648
13648
  static PRECISION = 1e-4;
13649
13649
  toSVGPath() {
13650
13650
  G("Abstract method `toSVGPath` must be implemented.");
@@ -13747,8 +13747,8 @@ class jt {
13747
13747
  const g = f - this.#l, p = g / f, b = p * c, m = p * u;
13748
13748
  let w = a, y = o;
13749
13749
  a = l, o = h, l += b, h += m, this.#f?.push(t, e);
13750
- const v = -m / g, A = b / g, S = v * this.#d, E = A * this.#d;
13751
- return this.#r.set(this.#r.subarray(2, 8), 0), this.#r.set([l + S, h + E], 4), this.#r.set(this.#r.subarray(14, 18), 12), this.#r.set([l - S, h - E], 16), isNaN(this.#r[6]) ? (this.#a.length === 0 && (this.#r.set([a + S, o + E], 2), this.#a.push(NaN, NaN, NaN, NaN, (a + S - s) / n, (o + E - i) / r), this.#r.set([a - S, o - E], 14), this.#e.push(NaN, NaN, NaN, NaN, (a - S - s) / n, (o - E - i) / r)), this.#r.set([w, y, a, o, l, h], 6), !this.isEmpty()) : (this.#r.set([w, y, a, o, l, h], 6), Math.abs(Math.atan2(y - o, w - a) - Math.atan2(m, b)) < Math.PI / 2 ? ([a, o, l, h] = this.#r.subarray(2, 6), this.#a.push(NaN, NaN, NaN, NaN, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [a, o, w, y] = this.#r.subarray(14, 18), this.#e.push(NaN, NaN, NaN, NaN, ((w + a) / 2 - s) / n, ((y + o) / 2 - i) / r), !0) : ([w, y, a, o, l, h] = this.#r.subarray(0, 6), this.#a.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [l, h, a, o, w, y] = this.#r.subarray(12, 18), this.#e.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), !0));
13750
+ const S = -m / g, A = b / g, v = S * this.#d, E = A * this.#d;
13751
+ return this.#r.set(this.#r.subarray(2, 8), 0), this.#r.set([l + v, h + E], 4), this.#r.set(this.#r.subarray(14, 18), 12), this.#r.set([l - v, h - E], 16), isNaN(this.#r[6]) ? (this.#a.length === 0 && (this.#r.set([a + v, o + E], 2), this.#a.push(NaN, NaN, NaN, NaN, (a + v - s) / n, (o + E - i) / r), this.#r.set([a - v, o - E], 14), this.#e.push(NaN, NaN, NaN, NaN, (a - v - s) / n, (o - E - i) / r)), this.#r.set([w, y, a, o, l, h], 6), !this.isEmpty()) : (this.#r.set([w, y, a, o, l, h], 6), Math.abs(Math.atan2(y - o, w - a) - Math.atan2(m, b)) < Math.PI / 2 ? ([a, o, l, h] = this.#r.subarray(2, 6), this.#a.push(NaN, NaN, NaN, NaN, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [a, o, w, y] = this.#r.subarray(14, 18), this.#e.push(NaN, NaN, NaN, NaN, ((w + a) / 2 - s) / n, ((y + o) / 2 - i) / r), !0) : ([w, y, a, o, l, h] = this.#r.subarray(0, 6), this.#a.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [l, h, a, o, w, y] = this.#r.subarray(12, 18), this.#e.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), !0));
13752
13752
  }
13753
13753
  toSVGPath() {
13754
13754
  if (this.isEmpty())
@@ -13819,7 +13819,7 @@ class jt {
13819
13819
  return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / a, (s[1] - r) / o, NaN, NaN, NaN, NaN, l, h, NaN, NaN, NaN, NaN, c, u, NaN, NaN, NaN, NaN, (i[0] - n) / a, (i[1] - r) / o], e), e += 24;
13820
13820
  }
13821
13821
  }
13822
- class Ji extends P {
13822
+ class Ji extends M {
13823
13823
  #t;
13824
13824
  #e = new Float32Array(4);
13825
13825
  #i;
@@ -13851,16 +13851,16 @@ class Ji extends P {
13851
13851
  let o, l;
13852
13852
  switch (n) {
13853
13853
  case 0:
13854
- o = P._rescale(this.#n, t, i, r, -a), l = P._rescale(this.#a, t, i, r, -a);
13854
+ o = M._rescale(this.#n, t, i, r, -a), l = M._rescale(this.#a, t, i, r, -a);
13855
13855
  break;
13856
13856
  case 90:
13857
- o = P._rescaleAndSwap(this.#n, t, e, r, a), l = P._rescaleAndSwap(this.#a, t, e, r, a);
13857
+ o = M._rescaleAndSwap(this.#n, t, e, r, a), l = M._rescaleAndSwap(this.#a, t, e, r, a);
13858
13858
  break;
13859
13859
  case 180:
13860
- o = P._rescale(this.#n, s, e, -r, a), l = P._rescale(this.#a, s, e, -r, a);
13860
+ o = M._rescale(this.#n, s, e, -r, a), l = M._rescale(this.#a, s, e, -r, a);
13861
13861
  break;
13862
13862
  case 270:
13863
- o = P._rescaleAndSwap(this.#n, s, i, -r, -a), l = P._rescaleAndSwap(this.#a, s, i, -r, -a);
13863
+ o = M._rescaleAndSwap(this.#n, s, i, -r, -a), l = M._rescaleAndSwap(this.#a, s, i, -r, -a);
13864
13864
  break;
13865
13865
  }
13866
13866
  return {
@@ -13914,8 +13914,8 @@ class xs {
13914
13914
  width: m,
13915
13915
  height: w
13916
13916
  } of t) {
13917
- const y = Math.floor((p - e) / r) * r, v = Math.ceil((p + m + e) / r) * r, A = Math.floor((b - e) / r) * r, S = Math.ceil((b + w + e) / r) * r, E = [y, A, S, !0], _ = [v, A, S, !1];
13918
- this.#s.push(E, _), T.rectBoundingBox(y, A, v, S, n);
13917
+ const y = Math.floor((p - e) / r) * r, S = Math.ceil((p + m + e) / r) * r, A = Math.floor((b - e) / r) * r, v = Math.ceil((b + w + e) / r) * r, E = [y, A, v, !0], _ = [S, A, v, !1];
13918
+ this.#s.push(E, _), T.rectBoundingBox(y, A, S, v, n);
13919
13919
  }
13920
13920
  const a = n[2] - n[0] + 2 * s, o = n[3] - n[1] + 2 * s, l = n[0] - s, h = n[1] - s;
13921
13921
  let c = i ? -1 / 0 : 1 / 0, u = 1 / 0;
@@ -14025,7 +14025,7 @@ class xs {
14025
14025
  return n;
14026
14026
  }
14027
14027
  }
14028
- class ta extends P {
14028
+ class ta extends M {
14029
14029
  #t;
14030
14030
  #e;
14031
14031
  constructor(t, e, s, i) {
@@ -14071,7 +14071,7 @@ class ea extends Ji {
14071
14071
  return new Ts(t, e, s, i, n, r);
14072
14072
  }
14073
14073
  }
14074
- class Z extends D {
14074
+ class tt extends D {
14075
14075
  #t = null;
14076
14076
  #e = 0;
14077
14077
  #i;
@@ -14099,7 +14099,7 @@ class Z extends D {
14099
14099
  static _freeHighlight = null;
14100
14100
  static _freeHighlightClipId = "";
14101
14101
  static get _keyboardManager() {
14102
- const t = Z.prototype;
14102
+ const t = tt.prototype;
14103
14103
  return I(this, "_keyboardManager", new De([[["ArrowLeft", "mac+ArrowLeft"], t._moveCaret, {
14104
14104
  args: [0]
14105
14105
  }], [["ArrowRight", "mac+ArrowRight"], t._moveCaret, {
@@ -14114,7 +14114,7 @@ class Z extends D {
14114
14114
  super({
14115
14115
  ...t,
14116
14116
  name: "highlightEditor"
14117
- }), this.color = t.color || Z._defaultColor, this.#p = t.thickness || Z._defaultThickness, this.opacity = t.opacity || Z._defaultOpacity, this.#i = t.boxes || null, this.#b = t.methodOfCreation || "", this.#c = t.text || "", this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", t.highlightId > -1 ? (this.#d = !0, this.#y(t), this.#A()) : this.#i && (this.#t = t.anchorNode, this.#e = t.anchorOffset, this.#n = t.focusNode, this.#o = t.focusOffset, this.#w(), this.#A(), this.rotate(this.rotation)), this.annotationElementId || this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert");
14117
+ }), this.color = t.color || tt._defaultColor, this.#p = t.thickness || tt._defaultThickness, this.opacity = t.opacity || tt._defaultOpacity, this.#i = t.boxes || null, this.#b = t.methodOfCreation || "", this.#c = t.text || "", this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", t.highlightId > -1 ? (this.#d = !0, this.#y(t), this.#A()) : this.#i && (this.#t = t.anchorNode, this.#e = t.anchorOffset, this.#n = t.focusNode, this.#o = t.focusOffset, this.#w(), this.#A(), this.rotate(this.rotation)), this.annotationElementId || this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert");
14118
14118
  }
14119
14119
  get telemetryInitialData() {
14120
14120
  return {
@@ -14176,12 +14176,12 @@ class Z extends D {
14176
14176
  else if (this.parent) {
14177
14177
  const c = this.parent.viewport.rotation;
14178
14178
  this.parent.drawLayer.updateProperties(this.#u, {
14179
- bbox: Z.#_(this.#l.box, (c - this.rotation + 360) % 360),
14179
+ bbox: tt.#_(this.#l.box, (c - this.rotation + 360) % 360),
14180
14180
  path: {
14181
14181
  d: t.toSVGPath()
14182
14182
  }
14183
14183
  }), this.parent.drawLayer.updateProperties(this.#g, {
14184
- bbox: Z.#_(this.#r.box, c),
14184
+ bbox: tt.#_(this.#r.box, c),
14185
14185
  path: {
14186
14186
  d: this.#r.toSVGPath()
14187
14187
  }
@@ -14216,15 +14216,15 @@ class Z extends D {
14216
14216
  this.#m = [(h[0] - n) / a, (h[1] - r) / o];
14217
14217
  }
14218
14218
  static initialize(t, e) {
14219
- D.initialize(t, e), Z._defaultColor ||= e.highlightColors?.values().next().value || "#fff066";
14219
+ D.initialize(t, e), tt._defaultColor ||= e.highlightColors?.values().next().value || "#fff066";
14220
14220
  }
14221
14221
  static updateDefaultParams(t, e) {
14222
14222
  switch (t) {
14223
- case N.HIGHLIGHT_COLOR:
14224
- Z._defaultColor = e;
14223
+ case O.HIGHLIGHT_COLOR:
14224
+ tt._defaultColor = e;
14225
14225
  break;
14226
- case N.HIGHLIGHT_THICKNESS:
14227
- Z._defaultThickness = e;
14226
+ case O.HIGHLIGHT_THICKNESS:
14227
+ tt._defaultThickness = e;
14228
14228
  break;
14229
14229
  }
14230
14230
  }
@@ -14238,19 +14238,19 @@ class Z extends D {
14238
14238
  }
14239
14239
  updateParams(t, e) {
14240
14240
  switch (t) {
14241
- case N.HIGHLIGHT_COLOR:
14241
+ case O.HIGHLIGHT_COLOR:
14242
14242
  this.#C(e);
14243
14243
  break;
14244
- case N.HIGHLIGHT_THICKNESS:
14244
+ case O.HIGHLIGHT_THICKNESS:
14245
14245
  this.#E(e);
14246
14246
  break;
14247
14247
  }
14248
14248
  }
14249
14249
  static get defaultPropertiesToUpdate() {
14250
- return [[N.HIGHLIGHT_COLOR, Z._defaultColor], [N.HIGHLIGHT_THICKNESS, Z._defaultThickness]];
14250
+ return [[O.HIGHLIGHT_COLOR, tt._defaultColor], [O.HIGHLIGHT_THICKNESS, tt._defaultThickness]];
14251
14251
  }
14252
14252
  get propertiesToUpdate() {
14253
- return [[N.HIGHLIGHT_COLOR, this.color || Z._defaultColor], [N.HIGHLIGHT_THICKNESS, this.#p || Z._defaultThickness], [N.HIGHLIGHT_FREE, this.#d]];
14253
+ return [[O.HIGHLIGHT_COLOR, this.color || tt._defaultColor], [O.HIGHLIGHT_THICKNESS, this.#p || tt._defaultThickness], [O.HIGHLIGHT_FREE, this.#d]];
14254
14254
  }
14255
14255
  onUpdatedColor() {
14256
14256
  this.parent?.drawLayer.updateProperties(this.#u, {
@@ -14265,11 +14265,11 @@ class Z extends D {
14265
14265
  this.color = n, this.opacity = r, this.onUpdatedColor();
14266
14266
  }, s = this.color, i = this.opacity;
14267
14267
  this.addCommands({
14268
- cmd: e.bind(this, t, Z._defaultOpacity),
14268
+ cmd: e.bind(this, t, tt._defaultOpacity),
14269
14269
  undo: e.bind(this, s, i),
14270
14270
  post: this._uiManager.updateUI.bind(this._uiManager, this),
14271
14271
  mustExec: !0,
14272
- type: N.HIGHLIGHT_COLOR,
14272
+ type: O.HIGHLIGHT_COLOR,
14273
14273
  overwriteIfSameType: !0,
14274
14274
  keepUndo: !0
14275
14275
  }), this._reportTelemetry({
@@ -14286,7 +14286,7 @@ class Z extends D {
14286
14286
  undo: s.bind(this, e),
14287
14287
  post: this._uiManager.updateUI.bind(this._uiManager, this),
14288
14288
  mustExec: !0,
14289
- type: N.INK_THICKNESS,
14289
+ type: O.INK_THICKNESS,
14290
14290
  overwriteIfSameType: !0,
14291
14291
  keepUndo: !0
14292
14292
  }), this._reportTelemetry({
@@ -14382,13 +14382,13 @@ class Z extends D {
14382
14382
  drawLayer: e
14383
14383
  } = this.parent;
14384
14384
  let s;
14385
- this.#d ? (t = (t - this.rotation + 360) % 360, s = Z.#_(this.#l.box, t)) : s = Z.#_([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
14385
+ this.#d ? (t = (t - this.rotation + 360) % 360, s = tt.#_(this.#l.box, t)) : s = tt.#_([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
14386
14386
  bbox: s,
14387
14387
  root: {
14388
14388
  "data-main-rotation": t
14389
14389
  }
14390
14390
  }), e.updateProperties(this.#g, {
14391
- bbox: Z.#_(this.#r.box, t),
14391
+ bbox: tt.#_(this.#r.box, t),
14392
14392
  root: {
14393
14393
  "data-main-rotation": t
14394
14394
  }
@@ -14419,7 +14419,7 @@ class Z extends D {
14419
14419
  });
14420
14420
  }
14421
14421
  #k(t) {
14422
- Z._keyboardManager.exec(this, t);
14422
+ tt._keyboardManager.exec(this, t);
14423
14423
  }
14424
14424
  _moveCaret(t) {
14425
14425
  switch (this.parent.unselect(this), t) {
@@ -14471,7 +14471,7 @@ class Z extends D {
14471
14471
  #M() {
14472
14472
  return this.#d ? this.rotation : 0;
14473
14473
  }
14474
- #N() {
14474
+ #O() {
14475
14475
  if (this.#d)
14476
14476
  return null;
14477
14477
  const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#i, r = new Float32Array(n.length * 8);
@@ -14507,7 +14507,7 @@ class Z extends D {
14507
14507
  signal: c
14508
14508
  }), window.addEventListener("pointerup", u, {
14509
14509
  signal: c
14510
- }), window.addEventListener("pointerdown", J, {
14510
+ }), window.addEventListener("pointerdown", Z, {
14511
14511
  capture: !0,
14512
14512
  passive: !1,
14513
14513
  signal: c
@@ -14563,9 +14563,9 @@ class Z extends D {
14563
14563
  id: m,
14564
14564
  color: w,
14565
14565
  opacity: y,
14566
- popupRef: v,
14566
+ popupRef: S,
14567
14567
  richText: A,
14568
- contentsObj: S,
14568
+ contentsObj: v,
14569
14569
  creationDate: E,
14570
14570
  modificationDate: _
14571
14571
  },
@@ -14587,9 +14587,9 @@ class Z extends D {
14587
14587
  annotationElementId: m,
14588
14588
  id: m,
14589
14589
  deleted: !1,
14590
- popupRef: v,
14590
+ popupRef: S,
14591
14591
  richText: A,
14592
- comment: S?.str || null,
14592
+ comment: v?.str || null,
14593
14593
  creationDate: E,
14594
14594
  modificationDate: _
14595
14595
  };
@@ -14604,9 +14604,9 @@ class Z extends D {
14604
14604
  borderStyle: {
14605
14605
  rawWidth: y
14606
14606
  },
14607
- popupRef: v,
14607
+ popupRef: S,
14608
14608
  richText: A,
14609
- contentsObj: S,
14609
+ contentsObj: v,
14610
14610
  creationDate: E,
14611
14611
  modificationDate: _
14612
14612
  },
@@ -14628,9 +14628,9 @@ class Z extends D {
14628
14628
  annotationElementId: m,
14629
14629
  id: m,
14630
14630
  deleted: !1,
14631
- popupRef: v,
14631
+ popupRef: S,
14632
14632
  richText: A,
14633
- comment: S?.str || null,
14633
+ comment: v?.str || null,
14634
14634
  creationDate: E,
14635
14635
  modificationDate: _
14636
14636
  };
@@ -14659,7 +14659,7 @@ class Z extends D {
14659
14659
  x: g[0] - u,
14660
14660
  y: c - (g[1] - f)
14661
14661
  }, b = new Ts(p, [0, 0, h, c], 1, l.#p / 2, !0, 1e-3);
14662
- for (let y = 0, v = g.length; y < v; y += 2)
14662
+ for (let y = 0, S = g.length; y < S; y += 2)
14663
14663
  p.x = g[y] - u, p.y = c - (g[y + 1] - f), b.add(p);
14664
14664
  const {
14665
14665
  id: m,
@@ -14697,7 +14697,7 @@ class Z extends D {
14697
14697
  color: e,
14698
14698
  opacity: this.opacity,
14699
14699
  thickness: this.#p,
14700
- quadPoints: this.#N(),
14700
+ quadPoints: this.#O(),
14701
14701
  outlines: this.#R(s.rect)
14702
14702
  }), this.addComment(s), this.annotationElementId && !this.#F(s) ? null : (s.id = this.annotationElementId, s);
14703
14703
  }
@@ -15053,7 +15053,7 @@ class U extends D {
15053
15053
  }), n.addEventListener("pointermove", this._drawMove.bind(this), {
15054
15054
  signal: g
15055
15055
  }), n.addEventListener("touchmove", (p) => {
15056
- z.isSameTimeStamp(p.timeStamp) && J(p);
15056
+ z.isSameTimeStamp(p.timeStamp) && Z(p);
15057
15057
  }, {
15058
15058
  signal: g
15059
15059
  }), t.toggleDrawing(), e._editorUndoBar?.hide(), U.#i) {
@@ -15077,7 +15077,7 @@ class U extends D {
15077
15077
  this._endDraw(t);
15078
15078
  return;
15079
15079
  }
15080
- this._currentParent.drawLayer.updateProperties(this._currentDrawId, U.#i.add(e, s)), z.setTimeStamp(t.timeStamp), J(t);
15080
+ this._currentParent.drawLayer.updateProperties(this._currentDrawId, U.#i.add(e, s)), z.setTimeStamp(t.timeStamp), Z(t);
15081
15081
  }
15082
15082
  }
15083
15083
  static _cleanup(t) {
@@ -15096,7 +15096,7 @@ class U extends D {
15096
15096
  e.drawLayer.updateProperties(i, s.removeLastElement());
15097
15097
  },
15098
15098
  mustExec: !1,
15099
- type: N.DRAW_STEP
15099
+ type: O.DRAW_STEP
15100
15100
  });
15101
15101
  return;
15102
15102
  }
@@ -15107,7 +15107,7 @@ class U extends D {
15107
15107
  const e = this._currentParent;
15108
15108
  if (!e)
15109
15109
  return null;
15110
- if (e.toggleDrawing(!0), e.cleanUndoStack(N.DRAW_STEP), !U.#i.isEmpty()) {
15110
+ if (e.toggleDrawing(!0), e.cleanUndoStack(O.DRAW_STEP), !U.#i.isEmpty()) {
15111
15111
  const {
15112
15112
  pageDimensions: [s, i],
15113
15113
  scale: n
@@ -15179,7 +15179,7 @@ class sa {
15179
15179
  t === "stroke-width" && (this.#a = e);
15180
15180
  }
15181
15181
  #d(t, e) {
15182
- return P._normalizePoint(t, e, this.#l, this.#u, this.#s);
15182
+ return M._normalizePoint(t, e, this.#l, this.#u, this.#s);
15183
15183
  }
15184
15184
  isEmpty() {
15185
15185
  return !this.#i || this.#i.length === 0;
@@ -15194,7 +15194,7 @@ class sa {
15194
15194
  path: {
15195
15195
  d: this.toSVGPath()
15196
15196
  }
15197
- }) : (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)), {
15197
+ }) : (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)), {
15198
15198
  path: {
15199
15199
  d: this.toSVGPath()
15200
15200
  }
@@ -15246,7 +15246,7 @@ class sa {
15246
15246
  };
15247
15247
  }
15248
15248
  toSVGPath() {
15249
- const t = P.svgRound(this.#e[4]), e = P.svgRound(this.#e[5]);
15249
+ const t = M.svgRound(this.#e[4]), e = M.svgRound(this.#e[5]);
15250
15250
  if (this.#r.length === 2)
15251
15251
  return this.#n = `${this.#n} M ${t} ${e} Z`, this.#n;
15252
15252
  if (this.#r.length <= 6) {
@@ -15254,13 +15254,13 @@ class sa {
15254
15254
  this.#n = `${this.#n.slice(0, i)} M ${t} ${e}`, this.#o = 6;
15255
15255
  }
15256
15256
  if (this.#r.length === 4) {
15257
- const i = P.svgRound(this.#e[10]), n = P.svgRound(this.#e[11]);
15257
+ const i = M.svgRound(this.#e[10]), n = M.svgRound(this.#e[11]);
15258
15258
  return this.#n = `${this.#n} L ${i} ${n}`, this.#o = 12, this.#n;
15259
15259
  }
15260
15260
  const s = [];
15261
15261
  this.#o === 0 && (s.push(`M ${t} ${e}`), this.#o = 6);
15262
15262
  for (let i = this.#o, n = this.#e.length; i < n; i += 6) {
15263
- const [r, a, o, l, h, c] = this.#e.slice(i, i + 6).map(P.svgRound);
15263
+ const [r, a, o, l, h, c] = this.#e.slice(i, i + 6).map(M.svgRound);
15264
15264
  s.push(`C${r} ${a} ${o} ${l} ${h} ${c}`);
15265
15265
  }
15266
15266
  return this.#n += s.join(" "), this.#o = this.#e.length, this.#n;
@@ -15281,7 +15281,7 @@ class sa {
15281
15281
  };
15282
15282
  }
15283
15283
  }
15284
- class Le extends P {
15284
+ class Le extends M {
15285
15285
  #t;
15286
15286
  #e = 0;
15287
15287
  #i;
@@ -15316,16 +15316,16 @@ class Le extends P {
15316
15316
  for (const {
15317
15317
  line: e
15318
15318
  } of this.#s) {
15319
- if (t.push(`M${P.svgRound(e[4])} ${P.svgRound(e[5])}`), e.length === 6) {
15319
+ if (t.push(`M${M.svgRound(e[4])} ${M.svgRound(e[5])}`), e.length === 6) {
15320
15320
  t.push("Z");
15321
15321
  continue;
15322
15322
  }
15323
15323
  if (e.length === 12 && isNaN(e[6])) {
15324
- t.push(`L${P.svgRound(e[10])} ${P.svgRound(e[11])}`);
15324
+ t.push(`L${M.svgRound(e[10])} ${M.svgRound(e[11])}`);
15325
15325
  continue;
15326
15326
  }
15327
15327
  for (let s = 6, i = e.length; s < i; s += 6) {
15328
- const [n, r, a, o, l, h] = e.subarray(s, s + 6).map(P.svgRound);
15328
+ const [n, r, a, o, l, h] = e.subarray(s, s + 6).map(M.svgRound);
15329
15329
  t.push(`C${n} ${r} ${a} ${o} ${l} ${h}`);
15330
15330
  }
15331
15331
  }
@@ -15333,26 +15333,26 @@ class Le extends P {
15333
15333
  }
15334
15334
  serialize([t, e, s, i], n) {
15335
15335
  const r = [], a = [], [o, l, h, c] = this.#u();
15336
- let u, f, g, p, b, m, w, y, v;
15336
+ let u, f, g, p, b, m, w, y, S;
15337
15337
  switch (this.#o) {
15338
15338
  case 0:
15339
- v = P._rescale, u = t, f = e + i, g = s, p = -i, b = t + o * s, m = e + (1 - l - c) * i, w = t + (o + h) * s, y = e + (1 - l) * i;
15339
+ S = M._rescale, u = t, f = e + i, g = s, p = -i, b = t + o * s, m = e + (1 - l - c) * i, w = t + (o + h) * s, y = e + (1 - l) * i;
15340
15340
  break;
15341
15341
  case 90:
15342
- v = P._rescaleAndSwap, u = t, f = e, g = s, p = i, b = t + l * s, m = e + o * i, w = t + (l + c) * s, y = e + (o + h) * i;
15342
+ S = M._rescaleAndSwap, u = t, f = e, g = s, p = i, b = t + l * s, m = e + o * i, w = t + (l + c) * s, y = e + (o + h) * i;
15343
15343
  break;
15344
15344
  case 180:
15345
- v = P._rescale, u = t + s, f = e, g = -s, p = i, b = t + (1 - o - h) * s, m = e + l * i, w = t + (1 - o) * s, y = e + (l + c) * i;
15345
+ S = M._rescale, u = t + s, f = e, g = -s, p = i, b = t + (1 - o - h) * s, m = e + l * i, w = t + (1 - o) * s, y = e + (l + c) * i;
15346
15346
  break;
15347
15347
  case 270:
15348
- v = P._rescaleAndSwap, u = t + s, f = e + i, g = -s, p = -i, b = t + (1 - l - c) * s, m = e + (1 - o - h) * i, w = t + (1 - l) * s, y = e + (1 - o) * i;
15348
+ S = M._rescaleAndSwap, u = t + s, f = e + i, g = -s, p = -i, b = t + (1 - l - c) * s, m = e + (1 - o - h) * i, w = t + (1 - l) * s, y = e + (1 - o) * i;
15349
15349
  break;
15350
15350
  }
15351
15351
  for (const {
15352
15352
  line: A,
15353
- points: S
15353
+ points: v
15354
15354
  } of this.#s)
15355
- r.push(v(A, u, f, g, p, n ? new Array(A.length) : null)), a.push(v(S, u, f, g, p, n ? new Array(S.length) : null));
15355
+ r.push(S(A, u, f, g, p, n ? new Array(A.length) : null)), a.push(S(v, u, f, g, p, n ? new Array(v.length) : null));
15356
15356
  return {
15357
15357
  lines: r,
15358
15358
  points: a,
@@ -15371,16 +15371,16 @@ class Le extends P {
15371
15371
  let c, u, f, g, p;
15372
15372
  switch (o) {
15373
15373
  case 0:
15374
- p = P._rescale, c = -t / s, u = e / i + 1, f = 1 / s, g = -1 / i;
15374
+ p = M._rescale, c = -t / s, u = e / i + 1, f = 1 / s, g = -1 / i;
15375
15375
  break;
15376
15376
  case 90:
15377
- p = P._rescaleAndSwap, c = -e / i, u = -t / s, f = 1 / i, g = 1 / s;
15377
+ p = M._rescaleAndSwap, c = -e / i, u = -t / s, f = 1 / i, g = 1 / s;
15378
15378
  break;
15379
15379
  case 180:
15380
- p = P._rescale, c = t / s + 1, u = -e / i, f = -1 / s, g = 1 / i;
15380
+ p = M._rescale, c = t / s + 1, u = -e / i, f = -1 / s, g = 1 / i;
15381
15381
  break;
15382
15382
  case 270:
15383
- p = P._rescaleAndSwap, c = e / i + 1, u = t / s + 1, f = -1 / i, g = -1 / s;
15383
+ p = M._rescaleAndSwap, c = e / i + 1, u = t / s + 1, f = -1 / i, g = -1 / s;
15384
15384
  break;
15385
15385
  }
15386
15386
  if (!r) {
@@ -15397,11 +15397,11 @@ class Le extends P {
15397
15397
  }
15398
15398
  const y = new Float32Array(3 * (w - 2));
15399
15399
  r.push(y);
15400
- let [v, A, S, E] = m.subarray(0, 4);
15401
- y.set([NaN, NaN, NaN, NaN, v, A], 0);
15400
+ let [S, A, v, E] = m.subarray(0, 4);
15401
+ y.set([NaN, NaN, NaN, NaN, S, A], 0);
15402
15402
  for (let _ = 4; _ < w; _ += 2) {
15403
- const C = m[_], M = m[_ + 1];
15404
- y.set(P.createBezierPoints(v, A, S, E, C, M), (_ - 2) * 3), [v, A, S, E] = [S, E, C, M];
15403
+ const C = m[_], P = m[_ + 1];
15404
+ y.set(M.createBezierPoints(S, A, v, E, C, P), (_ - 2) * 3), [S, A, v, E] = [v, E, C, P];
15405
15405
  }
15406
15406
  }
15407
15407
  }
@@ -15466,7 +15466,7 @@ class Le extends P {
15466
15466
  };
15467
15467
  }
15468
15468
  get viewBox() {
15469
- return this.#t.map(P.svgRound).join(" ");
15469
+ return this.#t.map(M.svgRound).join(" ");
15470
15470
  }
15471
15471
  get defaultProperties() {
15472
15472
  const [t, e] = this.#t;
@@ -15475,7 +15475,7 @@ class Le extends P {
15475
15475
  viewBox: this.viewBox
15476
15476
  },
15477
15477
  path: {
15478
- "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
15478
+ "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`
15479
15479
  }
15480
15480
  };
15481
15481
  }
@@ -15495,15 +15495,15 @@ class Le extends P {
15495
15495
  default:
15496
15496
  return "";
15497
15497
  }
15498
- return `matrix(${s} ${i} ${n} ${r} ${P.svgRound(a)} ${P.svgRound(o)})`;
15498
+ return `matrix(${s} ${i} ${n} ${r} ${M.svgRound(a)} ${M.svgRound(o)})`;
15499
15499
  }
15500
15500
  getPathResizingSVGProperties([t, e, s, i]) {
15501
15501
  const [n, r] = this.#l(), [a, o, l, h] = this.#t;
15502
- if (Math.abs(l - n) <= P.PRECISION || Math.abs(h - r) <= P.PRECISION) {
15502
+ if (Math.abs(l - n) <= M.PRECISION || Math.abs(h - r) <= M.PRECISION) {
15503
15503
  const p = t + s / 2 - (a + l / 2), b = e + i / 2 - (o + h / 2);
15504
15504
  return {
15505
15505
  path: {
15506
- "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15506
+ "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15507
15507
  transform: `${this.rotationTransform} translate(${p} ${b})`
15508
15508
  }
15509
15509
  };
@@ -15511,26 +15511,26 @@ class Le extends P {
15511
15511
  const c = (s - 2 * n) / (l - 2 * n), u = (i - 2 * r) / (h - 2 * r), f = l / s, g = h / i;
15512
15512
  return {
15513
15513
  path: {
15514
- "transform-origin": `${P.svgRound(a)} ${P.svgRound(o)}`,
15515
- transform: `${this.rotationTransform} scale(${f} ${g}) translate(${P.svgRound(n)} ${P.svgRound(r)}) scale(${c} ${u}) translate(${P.svgRound(-n)} ${P.svgRound(-r)})`
15514
+ "transform-origin": `${M.svgRound(a)} ${M.svgRound(o)}`,
15515
+ transform: `${this.rotationTransform} scale(${f} ${g}) translate(${M.svgRound(n)} ${M.svgRound(r)}) scale(${c} ${u}) translate(${M.svgRound(-n)} ${M.svgRound(-r)})`
15516
15516
  }
15517
15517
  };
15518
15518
  }
15519
15519
  getPathResizedSVGProperties([t, e, s, i]) {
15520
15520
  const [n, r] = this.#l(), a = this.#t, [o, l, h, c] = a;
15521
- if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(h - n) <= P.PRECISION || Math.abs(c - r) <= P.PRECISION) {
15521
+ if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(h - n) <= M.PRECISION || Math.abs(c - r) <= M.PRECISION) {
15522
15522
  const b = t + s / 2 - (o + h / 2), m = e + i / 2 - (l + c / 2);
15523
15523
  for (const {
15524
15524
  line: w,
15525
15525
  points: y
15526
15526
  } of this.#s)
15527
- P._translate(w, b, m, w), P._translate(y, b, m, y);
15527
+ M._translate(w, b, m, w), M._translate(y, b, m, y);
15528
15528
  return {
15529
15529
  root: {
15530
15530
  viewBox: this.viewBox
15531
15531
  },
15532
15532
  path: {
15533
- "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15533
+ "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15534
15534
  transform: this.rotationTransform || null,
15535
15535
  d: this.toSVGPath()
15536
15536
  }
@@ -15542,13 +15542,13 @@ class Le extends P {
15542
15542
  line: b,
15543
15543
  points: m
15544
15544
  } of this.#s)
15545
- P._rescale(b, g, p, u, f, b), P._rescale(m, g, p, u, f, m);
15545
+ M._rescale(b, g, p, u, f, b), M._rescale(m, g, p, u, f, m);
15546
15546
  return {
15547
15547
  root: {
15548
15548
  viewBox: this.viewBox
15549
15549
  },
15550
15550
  path: {
15551
- "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
15551
+ "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`,
15552
15552
  transform: this.rotationTransform || null,
15553
15553
  d: this.toSVGPath()
15554
15554
  }
@@ -15561,7 +15561,7 @@ class Le extends P {
15561
15561
  line: l,
15562
15562
  points: h
15563
15563
  } of this.#s)
15564
- P._translate(l, a, o, l), P._translate(h, a, o, h);
15564
+ M._translate(l, a, o, l), M._translate(h, a, o, h);
15565
15565
  else {
15566
15566
  const l = this.#a / i, h = this.#r / n;
15567
15567
  this.#a = i, this.#r = n;
@@ -15569,7 +15569,7 @@ class Le extends P {
15569
15569
  line: c,
15570
15570
  points: u
15571
15571
  } of this.#s)
15572
- P._rescale(c, a, o, l, h, c), P._rescale(u, a, o, l, h, u);
15572
+ M._rescale(c, a, o, l, h, c), M._rescale(u, a, o, l, h, u);
15573
15573
  r[2] *= l, r[3] *= h;
15574
15574
  }
15575
15575
  return r[0] = t, r[1] = e, {
@@ -15578,7 +15578,7 @@ class Le extends P {
15578
15578
  },
15579
15579
  path: {
15580
15580
  d: this.toSVGPath(),
15581
- "transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
15581
+ "transform-origin": `${M.svgRound(t)} ${M.svgRound(e)}`
15582
15582
  }
15583
15583
  };
15584
15584
  }
@@ -15593,7 +15593,7 @@ class Le extends P {
15593
15593
  },
15594
15594
  path: {
15595
15595
  d: this.toSVGPath(),
15596
- "transform-origin": `${P.svgRound(t[0])} ${P.svgRound(t[1])}`,
15596
+ "transform-origin": `${M.svgRound(t[0])} ${M.svgRound(t[1])}`,
15597
15597
  transform: this.rotationTransform || null
15598
15598
  },
15599
15599
  bbox: t
@@ -15641,7 +15641,7 @@ class zs extends U {
15641
15641
  return !0;
15642
15642
  }
15643
15643
  static get typesMap() {
15644
- return I(this, "typesMap", /* @__PURE__ */ new Map([[N.INK_THICKNESS, "stroke-width"], [N.INK_COLOR, "stroke"], [N.INK_OPACITY, "stroke-opacity"]]));
15644
+ return I(this, "typesMap", /* @__PURE__ */ new Map([[O.INK_THICKNESS, "stroke-width"], [O.INK_COLOR, "stroke"], [O.INK_OPACITY, "stroke-opacity"]]));
15645
15645
  }
15646
15646
  static createDrawerInstance(t, e, s, i, n) {
15647
15647
  return new sa(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
@@ -15704,7 +15704,7 @@ class zs extends U {
15704
15704
  return this._colorPicker ||= new xe(this), [["colorPicker", this._colorPicker]];
15705
15705
  }
15706
15706
  get colorType() {
15707
- return N.INK_COLOR;
15707
+ return O.INK_COLOR;
15708
15708
  }
15709
15709
  get color() {
15710
15710
  return this._drawingOptions.stroke;
@@ -15862,26 +15862,26 @@ class se {
15862
15862
  break;
15863
15863
  }
15864
15864
  y ? y.isHole ? w.parent = m ? y.parent : o : w.parent = m ? o : y.parent : w.parent = m ? o : 0;
15865
- const v = this.#s(r, e, h, c, g, p, 0);
15866
- if (v === -1) {
15865
+ const S = this.#s(r, e, h, c, g, p, 0);
15866
+ if (S === -1) {
15867
15867
  r[u] = -a, r[u] !== 1 && (o = Math.abs(r[u]));
15868
15868
  continue;
15869
15869
  }
15870
- let A = this.#i[2 * v], S = this.#i[2 * v + 1];
15871
- const E = h + A, _ = c + S;
15870
+ let A = this.#i[2 * S], v = this.#i[2 * S + 1];
15871
+ const E = h + A, _ = c + v;
15872
15872
  g = E, p = _;
15873
- let C = h, M = c;
15873
+ let C = h, P = c;
15874
15874
  for (; ; ) {
15875
- const x = this.#a(r, e, C, M, g, p, 1);
15876
- A = this.#i[2 * x], S = this.#i[2 * x + 1];
15877
- const H = C + A, V = M + S;
15875
+ const x = this.#a(r, e, C, P, g, p, 1);
15876
+ A = this.#i[2 * x], v = this.#i[2 * x + 1];
15877
+ const H = C + A, V = P + v;
15878
15878
  b.push(V, H);
15879
- const O = C * e + M;
15880
- if (r[O + 1] === 0 ? r[O] = -a : r[O] === 1 && (r[O] = a), H === h && V === c && C === E && M === _) {
15879
+ const N = C * e + P;
15880
+ if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === h && V === c && C === E && P === _) {
15881
15881
  r[u] !== 1 && (o = Math.abs(r[u]));
15882
15882
  break;
15883
15883
  } else
15884
- g = C, p = M, C = H, M = V;
15884
+ g = C, p = P, C = H, P = V;
15885
15885
  }
15886
15886
  }
15887
15887
  }
@@ -15893,13 +15893,13 @@ class se {
15893
15893
  i.push(t[E], t[E + 1]);
15894
15894
  return;
15895
15895
  }
15896
- const n = t[e], r = t[e + 1], a = t[s - 4] - n, o = t[s - 3] - r, l = Math.hypot(a, o), h = a / l, c = o / l, u = h * r - c * n, f = o / a, g = 1 / l, p = Math.atan(f), b = Math.cos(p), m = Math.sin(p), w = g * (Math.abs(b) + Math.abs(m)), y = g * (1 - w + w ** 2), v = Math.max(Math.atan(Math.abs(m + b) * y), Math.atan(Math.abs(m - b) * y));
15897
- let A = 0, S = e;
15896
+ const n = t[e], r = t[e + 1], a = t[s - 4] - n, o = t[s - 3] - r, l = Math.hypot(a, o), h = a / l, c = o / l, u = h * r - c * n, f = o / a, g = 1 / l, p = Math.atan(f), b = Math.cos(p), m = Math.sin(p), w = g * (Math.abs(b) + Math.abs(m)), y = g * (1 - w + w ** 2), S = Math.max(Math.atan(Math.abs(m + b) * y), Math.atan(Math.abs(m - b) * y));
15897
+ let A = 0, v = e;
15898
15898
  for (let E = e + 2; E < s - 2; E += 2) {
15899
15899
  const _ = Math.abs(u - h * t[E + 1] + c * t[E]);
15900
- _ > A && (S = E, A = _);
15900
+ _ > A && (v = E, A = _);
15901
15901
  }
15902
- A > (l * v) ** 2 ? (this.#n(t, e, S + 2, i), this.#n(t, S, s, i)) : i.push(n, r);
15902
+ A > (l * S) ** 2 ? (this.#n(t, e, v + 2, i), this.#n(t, v, s, i)) : i.push(n, r);
15903
15903
  }
15904
15904
  static #o(t) {
15905
15905
  const e = [], s = t.length;
@@ -15919,19 +15919,19 @@ class se {
15919
15919
  for (let p = 0; p < s; p++)
15920
15920
  for (let b = 0; b < e; b++) {
15921
15921
  const m = p * e + b, w = t[m];
15922
- let y = 0, v = 0;
15923
- for (let S = 0; S < r; S++) {
15924
- const E = p + S - l;
15922
+ let y = 0, S = 0;
15923
+ for (let v = 0; v < r; v++) {
15924
+ const E = p + v - l;
15925
15925
  if (!(E < 0 || E >= s))
15926
15926
  for (let _ = 0; _ < r; _++) {
15927
15927
  const C = b + _ - l;
15928
15928
  if (C < 0 || C >= e)
15929
15929
  continue;
15930
- const M = t[E * e + C], x = a[S * r + _] * h[Math.abs(M - w)];
15931
- y += M * x, v += x;
15930
+ const P = t[E * e + C], x = a[v * r + _] * h[Math.abs(P - w)];
15931
+ y += P * x, S += x;
15932
15932
  }
15933
15933
  }
15934
- const A = f[m] = Math.round(y / v);
15934
+ const A = f[m] = Math.round(y / S);
15935
15935
  g[A]++;
15936
15936
  }
15937
15937
  return [f, g];
@@ -16009,17 +16009,17 @@ class se {
16009
16009
  fontBoundingBoxAscent: m,
16010
16010
  fontBoundingBoxDescent: w,
16011
16011
  width: y
16012
- } = h.measureText(t), v = 1.5, A = Math.ceil(Math.max(Math.abs(f) + Math.abs(g) || 0, y) * v), S = Math.ceil(Math.max(Math.abs(p) + Math.abs(b) || c, Math.abs(m) + Math.abs(w) || c) * v);
16013
- l = new OffscreenCanvas(A, S), h = l.getContext("2d", {
16012
+ } = h.measureText(t), S = 1.5, A = Math.ceil(Math.max(Math.abs(f) + Math.abs(g) || 0, y) * S), v = Math.ceil(Math.max(Math.abs(p) + Math.abs(b) || c, Math.abs(m) + Math.abs(w) || c) * S);
16013
+ l = new OffscreenCanvas(A, v), h = l.getContext("2d", {
16014
16014
  alpha: !0,
16015
16015
  willReadFrequently: !0
16016
- }), h.font = u, h.filter = "grayscale(1)", h.fillStyle = "white", h.fillRect(0, 0, A, S), h.fillStyle = "black", h.fillText(t, A * (v - 1) / 2, S * (3 - v) / 2);
16017
- const E = this.#u(h.getImageData(0, 0, A, S).data), _ = this.#l(E), C = this.#d(_), M = this.#r(E, A, S, C);
16016
+ }), h.font = u, h.filter = "grayscale(1)", h.fillStyle = "white", h.fillRect(0, 0, A, v), h.fillStyle = "black", h.fillText(t, A * (S - 1) / 2, v * (3 - S) / 2);
16017
+ const E = this.#u(h.getImageData(0, 0, A, v).data), _ = this.#l(E), C = this.#d(_), P = this.#r(E, A, v, C);
16018
16018
  return this.processDrawnLines({
16019
16019
  lines: {
16020
- curves: M,
16020
+ curves: P,
16021
16021
  width: A,
16022
- height: S
16022
+ height: v
16023
16023
  },
16024
16024
  pageWidth: n,
16025
16025
  pageHeight: r,
@@ -16067,19 +16067,19 @@ class se {
16067
16067
  if (!y)
16068
16068
  continue;
16069
16069
  b.push(y);
16070
- const v = y.length, A = new Float32Array(v), S = new Float32Array(3 * (v === 2 ? 2 : v - 2));
16070
+ const S = y.length, A = new Float32Array(S), v = new Float32Array(3 * (S === 2 ? 2 : S - 2));
16071
16071
  if (u.push({
16072
- line: S,
16072
+ line: v,
16073
16073
  points: A
16074
- }), v === 2) {
16075
- A[0] = y[0] * g, A[1] = y[1] * p, S.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
16074
+ }), S === 2) {
16075
+ A[0] = y[0] * g, A[1] = y[1] * p, v.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
16076
16076
  continue;
16077
16077
  }
16078
- let [E, _, C, M] = y;
16079
- E *= g, _ *= p, C *= g, M *= p, A.set([E, _, C, M], 0), S.set([NaN, NaN, NaN, NaN, E, _], 0);
16080
- for (let x = 4; x < v; x += 2) {
16078
+ let [E, _, C, P] = y;
16079
+ E *= g, _ *= p, C *= g, P *= p, A.set([E, _, C, P], 0), v.set([NaN, NaN, NaN, NaN, E, _], 0);
16080
+ for (let x = 4; x < S; x += 2) {
16081
16081
  const H = A[x] = y[x] * g, V = A[x + 1] = y[x + 1] * p;
16082
- S.set(P.createBezierPoints(E, _, C, M, H, V), (x - 2) * 3), [E, _, C, M] = [C, M, H, V];
16082
+ v.set(M.createBezierPoints(E, _, C, P, H, V), (x - 2) * 3), [E, _, C, P] = [C, P, H, V];
16083
16083
  }
16084
16084
  }
16085
16085
  if (u.length === 0)
@@ -16104,9 +16104,9 @@ class se {
16104
16104
  let r = 1 / 0, a = -1 / 0, o = 0;
16105
16105
  for (const y of t) {
16106
16106
  o += y.length;
16107
- for (let v = 2, A = y.length; v < A; v++) {
16108
- const S = y[v] - y[v - 2];
16109
- r = Math.min(r, S), a = Math.max(a, S);
16107
+ for (let S = 2, A = y.length; S < A; S++) {
16108
+ const v = y[S] - y[S - 2];
16109
+ r = Math.min(r, v), a = Math.max(a, v);
16110
16110
  }
16111
16111
  }
16112
16112
  let l;
@@ -16120,10 +16120,10 @@ class se {
16120
16120
  await p.ready, p.write(u);
16121
16121
  const b = l.prototype.constructor;
16122
16122
  for (const y of t) {
16123
- const v = new b(y.length - 2);
16124
- for (let A = 2, S = y.length; A < S; A++)
16125
- v[A - 2] = y[A] - y[A - 2];
16126
- p.write(v);
16123
+ const S = new b(y.length - 2);
16124
+ for (let A = 2, v = y.length; A < v; A++)
16125
+ S[A - 2] = y[A] - y[A - 2];
16126
+ p.write(S);
16127
16127
  }
16128
16128
  p.close();
16129
16129
  const m = await new Response(g.readable).arrayBuffer(), w = new Uint8Array(m);
@@ -16160,12 +16160,12 @@ class se {
16160
16160
  }
16161
16161
  a = 0;
16162
16162
  for (let y = 0; y < g; y++) {
16163
- const v = o[be * y + $e], A = new Float32Array(v + 2);
16163
+ const S = o[be * y + $e], A = new Float32Array(S + 2);
16164
16164
  b.push(A);
16165
- for (let S = 0; S < be - 1; S++)
16166
- A[S] = o[be * y + $e + S + 1];
16167
- for (let S = 0; S < v; S++)
16168
- A[S + 2] = A[S] + w[a++];
16165
+ for (let v = 0; v < be - 1; v++)
16166
+ A[v] = o[be * y + $e + v + 1];
16167
+ for (let v = 0; v < S; v++)
16168
+ A[v + 2] = A[v] + w[a++];
16169
16169
  }
16170
16170
  return {
16171
16171
  areContours: u,
@@ -16681,8 +16681,8 @@ class ia extends D {
16681
16681
  let a = this.#t, o = i, l = n, h = null;
16682
16682
  if (e) {
16683
16683
  if (i > e || n > e) {
16684
- const S = Math.min(e / i, e / n);
16685
- o = Math.floor(i * S), l = Math.floor(n * S);
16684
+ const v = Math.min(e / i, e / n);
16685
+ o = Math.floor(i * v), l = Math.floor(n * v);
16686
16686
  }
16687
16687
  h = document.createElement("canvas");
16688
16688
  const u = h.width = Math.ceil(o * r.sx), f = h.height = Math.ceil(l * r.sy);
@@ -16691,8 +16691,8 @@ class ia extends D {
16691
16691
  g.filter = this._uiManager.hcmFilter;
16692
16692
  let p = "white", b = "#cfcfd8";
16693
16693
  this._uiManager.hcmFilter !== "none" ? b = "black" : _n.isDarkMode && (p = "#8f8f9d", b = "#42414d");
16694
- const m = 15, w = m * r.sx, y = m * r.sy, v = new OffscreenCanvas(w * 2, y * 2), A = v.getContext("2d");
16695
- A.fillStyle = p, A.fillRect(0, 0, w * 2, y * 2), A.fillStyle = b, A.fillRect(0, 0, w, y), A.fillRect(w, y, w, y), g.fillStyle = g.createPattern(v, "repeat"), g.fillRect(0, 0, u, f), g.drawImage(a, 0, 0, a.width, a.height, 0, 0, u, f);
16694
+ const m = 15, w = m * r.sx, y = m * r.sy, S = new OffscreenCanvas(w * 2, y * 2), A = S.getContext("2d");
16695
+ A.fillStyle = p, A.fillRect(0, 0, w * 2, y * 2), A.fillStyle = b, A.fillRect(0, 0, w, y), A.fillRect(w, y, w, y), g.fillStyle = g.createPattern(S, "repeat"), g.fillRect(0, 0, u, f), g.drawImage(a, 0, 0, a.width, a.height, 0, 0, u, f);
16696
16696
  }
16697
16697
  let c = null;
16698
16698
  if (s) {
@@ -16773,9 +16773,9 @@ class ia extends D {
16773
16773
  id: m,
16774
16774
  structParent: w,
16775
16775
  popupRef: y,
16776
- richText: v,
16776
+ richText: S,
16777
16777
  contentsObj: A,
16778
- creationDate: S,
16778
+ creationDate: v,
16779
16779
  modificationDate: E
16780
16780
  },
16781
16781
  container: _,
@@ -16784,13 +16784,13 @@ class ia extends D {
16784
16784
  pageNumber: C
16785
16785
  }
16786
16786
  },
16787
- canvas: M
16787
+ canvas: P
16788
16788
  } = t;
16789
16789
  let x, H;
16790
- M ? (delete t.canvas, {
16790
+ P ? (delete t.canvas, {
16791
16791
  id: x,
16792
16792
  bitmap: H
16793
- } = s.imageManager.getFromCanvas(_.id, M), M.remove()) : (n = !0, t._hasNoCanvas = !0);
16793
+ } = s.imageManager.getFromCanvas(_.id, P), P.remove()) : (n = !0, t._hasNoCanvas = !0);
16794
16794
  const V = (await e._structTree.getAriaAttributes(`${ie}${m}`))?.get("aria-label") || "";
16795
16795
  i = t = {
16796
16796
  annotationType: F.STAMP,
@@ -16809,9 +16809,9 @@ class ia extends D {
16809
16809
  isSvg: !1,
16810
16810
  structParent: w,
16811
16811
  popupRef: y,
16812
- richText: v,
16812
+ richText: S,
16813
16813
  comment: A?.str || null,
16814
- creationDate: S,
16814
+ creationDate: v,
16815
16815
  modificationDate: E
16816
16816
  };
16817
16817
  }
@@ -16901,7 +16901,7 @@ class Ft {
16901
16901
  #g = -1;
16902
16902
  #c;
16903
16903
  static _initialized = !1;
16904
- static #p = new Map([lt, zs, ia, Z, kt].map((t) => [t._editorType, t]));
16904
+ static #p = new Map([lt, zs, ia, tt, kt].map((t) => [t._editorType, t]));
16905
16905
  constructor({
16906
16906
  uiManager: t,
16907
16907
  pageIndex: e,
@@ -17109,7 +17109,7 @@ class Ft {
17109
17109
  } = at.platform;
17110
17110
  if (t.button !== 0 || t.ctrlKey && s)
17111
17111
  return;
17112
- this.#c.showAllEditors("highlight", !0, !0), this.#d.div.classList.add("free"), this.toggleDrawing(), Z.startHighlighting(this, this.#c.direction === "ltr", {
17112
+ this.#c.showAllEditors("highlight", !0, !0), this.#d.div.classList.add("free"), this.toggleDrawing(), tt.startHighlighting(this, this.#c.direction === "ltr", {
17113
17113
  target: this.#d.div,
17114
17114
  x: t.x,
17115
17115
  y: t.y
@@ -17517,7 +17517,7 @@ globalThis._pdfjsTestingUtils = {
17517
17517
  globalThis.pdfjsLib = {
17518
17518
  AbortException: zt,
17519
17519
  AnnotationEditorLayer: Ft,
17520
- AnnotationEditorParamsType: N,
17520
+ AnnotationEditorParamsType: O,
17521
17521
  AnnotationEditorType: F,
17522
17522
  AnnotationEditorUIManager: $t,
17523
17523
  AnnotationLayer: Us,
@@ -17562,7 +17562,7 @@ globalThis.pdfjsLib = {
17562
17562
  setLayerDimensions: Yt,
17563
17563
  shadow: I,
17564
17564
  SignatureExtractor: se,
17565
- stopEvent: J,
17565
+ stopEvent: Z,
17566
17566
  SupportedImageMimeTypes: ws,
17567
17567
  TextLayer: wt,
17568
17568
  TouchManager: ts,
@@ -18070,7 +18070,7 @@ class ca {
18070
18070
  eventBus: this.eventBus,
18071
18071
  pageDimensions: e
18072
18072
  });
18073
- const s = this.fields.filter((i) => i.pageIndex === t);
18073
+ const s = this.fields.filter((i) => i.pageNumber === t + 1);
18074
18074
  this.pageView.setFields(s), this.pdfDocument.getPage(this.currentPage).then((i) => {
18075
18075
  this.pageView && this.pageView.pageIndex === i.pageNumber - 1 && this.pageView.setPdfPage(i);
18076
18076
  }).catch((i) => {
@@ -18105,7 +18105,7 @@ class ca {
18105
18105
  }
18106
18106
  setFields(t) {
18107
18107
  if (this.fields = t, this.pageView) {
18108
- const e = this.fields.filter((s) => s.pageIndex === this.currentPage - 1);
18108
+ const e = this.fields.filter((s) => s.pageNumber === this.currentPage);
18109
18109
  this.pageView.setFields(e);
18110
18110
  }
18111
18111
  }
@@ -18142,7 +18142,7 @@ class da {
18142
18142
  eventBus: this.eventBus,
18143
18143
  pageDimensions: e
18144
18144
  // Pass dimensions immediately
18145
- }), i = this.fields.filter((n) => n.pageIndex === t - 1);
18145
+ }), i = this.fields.filter((n) => n.pageNumber === t);
18146
18146
  s.setFields(i), this.pageViews.push(s);
18147
18147
  }
18148
18148
  this.pageViews.forEach(async (t, e) => {
@@ -18215,7 +18215,7 @@ class da {
18215
18215
  }
18216
18216
  setFields(t) {
18217
18217
  this.fields = t, this.pageViews.forEach((e) => {
18218
- const s = this.fields.filter((i) => i.pageIndex === e.pageIndex);
18218
+ const s = this.fields.filter((i) => i.pageNumber === e.pageIndex + 1);
18219
18219
  e.setFields(s);
18220
18220
  });
18221
18221
  }
@@ -18341,15 +18341,15 @@ class ua {
18341
18341
  throw new Error("PDF document not loaded");
18342
18342
  if (!this.strategy)
18343
18343
  throw new Error("PDF viewer not ready. Please wait for PDF to fully load.");
18344
- if (this.readyPromise && await this.readyPromise, t.pageIndex < 0 || t.pageIndex >= this.pdfDocument.numPages)
18345
- throw new Error(`Invalid page index: ${t.pageIndex}. Document has ${this.pdfDocument.numPages} pages.`);
18344
+ if (this.readyPromise && await this.readyPromise, t.pageNumber < 1 || t.pageNumber > this.pdfDocument.numPages)
18345
+ throw new Error(`Invalid page number: ${t.pageNumber}. Document has ${this.pdfDocument.numPages} pages.`);
18346
18346
  if (t.rect.width <= 0 || t.rect.height <= 0)
18347
18347
  throw new Error("Field width and height must be greater than 0");
18348
18348
  try {
18349
- let e = this.pageInfo.get(t.pageIndex);
18349
+ let e = this.pageInfo.get(t.pageNumber - 1);
18350
18350
  if (!e) {
18351
- const i = (await this.pdfDocument.getPage(t.pageIndex + 1)).getViewport({ scale: 1 });
18352
- this.pageInfo.set(t.pageIndex, { width: i.width, height: i.height }), e = { width: i.width, height: i.height };
18351
+ const i = (await this.pdfDocument.getPage(t.pageNumber)).getViewport({ scale: 1 });
18352
+ this.pageInfo.set(t.pageNumber - 1, { width: i.width, height: i.height }), e = { width: i.width, height: i.height };
18353
18353
  }
18354
18354
  if (t.rect.x < 0 || t.rect.y < 0)
18355
18355
  throw new Error("Field position out of bounds (negative coordinates).");
@@ -18370,17 +18370,17 @@ class ua {
18370
18370
  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));
18371
18371
  }
18372
18372
  handleFieldDrop(t, e, s, i, n) {
18373
- const r = this.fields.find((A) => A.id === t);
18373
+ const r = this.fields.find((v) => v.id === t);
18374
18374
  if (!r) return;
18375
- let o = document.elementsFromPoint(e, s).find((A) => A.classList && A.classList.contains("page-view"));
18375
+ let o = document.elementsFromPoint(e, s).find((v) => v.classList && v.classList.contains("page-view"));
18376
18376
  if (!o || !o.dataset.pageIndex) {
18377
- const A = Array.from(this.container.querySelectorAll(".page-view"));
18378
- let S = 1 / 0, E = null;
18379
- if (A.forEach((_) => {
18380
- const C = _.getBoundingClientRect(), M = Math.max(C.left, Math.min(i, C.right)), x = Math.max(C.top, Math.min(n, C.bottom)), H = i - M, V = n - x, O = Math.sqrt(H * H + V * V);
18381
- O < S && (S = O, E = _);
18382
- }), E)
18383
- o = E;
18377
+ const v = Array.from(this.container.querySelectorAll(".page-view"));
18378
+ let E = 1 / 0, _ = null;
18379
+ if (v.forEach((C) => {
18380
+ const P = C.getBoundingClientRect(), x = Math.max(P.left, Math.min(i, P.right)), H = Math.max(P.top, Math.min(n, P.bottom)), V = i - x, N = n - H, K = Math.sqrt(V * V + N * N);
18381
+ K < E && (E = K, _ = C);
18382
+ }), _)
18383
+ o = _;
18384
18384
  else {
18385
18385
  console.warn("No pages found to snap to."), this.strategy?.setFields(this.fields);
18386
18386
  return;
@@ -18391,14 +18391,14 @@ class ua {
18391
18391
  this.strategy?.setFields(this.fields);
18392
18392
  return;
18393
18393
  }
18394
- const h = parseInt(l, 10), c = o.getBoundingClientRect(), u = this.currentScale, f = i - c.left, g = n - c.top, p = c.height / u, b = c.width / u, m = r.rect.width, w = r.rect.height;
18395
- let y = f / u, v = p - g / u - w;
18396
- y = Math.max(0, Math.min(y, b - m)), v = Math.max(0, Math.min(v, p - w)), this.updateField(t, {
18397
- pageIndex: h,
18394
+ const c = parseInt(l, 10) + 1, u = o.getBoundingClientRect(), f = this.currentScale, g = i - u.left, p = n - u.top, b = u.height / f, m = u.width / f, w = r.rect.width, y = r.rect.height;
18395
+ let S = g / f, A = b - p / f - y;
18396
+ S = Math.max(0, Math.min(S, m - w)), A = Math.max(0, Math.min(A, b - y)), this.updateField(t, {
18397
+ pageNumber: c,
18398
18398
  rect: {
18399
18399
  ...r.rect,
18400
- x: y,
18401
- y: v
18400
+ x: S,
18401
+ y: A
18402
18402
  }
18403
18403
  });
18404
18404
  }
@@ -18478,11 +18478,11 @@ class ua {
18478
18478
  const f = document.createElement("div");
18479
18479
  f.className = "print-page";
18480
18480
  const g = document.createElement("img");
18481
- g.src = c.toDataURL("image/jpeg", 0.8), f.appendChild(g), t?.withSignatures && this.fields.filter((b) => b.pageIndex === o - 1).forEach((b) => {
18481
+ g.src = c.toDataURL("image/jpeg", 0.8), f.appendChild(g), t?.withSignatures && this.fields.filter((b) => b.pageNumber === o).forEach((b) => {
18482
18482
  const m = document.createElement("div");
18483
18483
  m.className = "print-field select-none";
18484
- const w = l.getViewport({ scale: 1 }), y = b.rect.x / w.width * 100, A = (w.height - b.rect.y - b.rect.height) / w.height * 100, S = b.rect.width / w.width * 100, E = b.rect.height / w.height * 100;
18485
- if (m.style.left = `${y}%`, m.style.top = `${A}%`, m.style.width = `${S}%`, m.style.height = `${E}%`, m.style.display = "flex", m.style.alignItems = "center", m.style.justifyContent = "center", m.style.overflow = "hidden", b.style && Object.assign(m.style, b.style), b.type === "text")
18484
+ const w = l.getViewport({ scale: 1 }), y = b.rect.x / w.width * 100, A = (w.height - b.rect.y - b.rect.height) / w.height * 100, v = b.rect.width / w.width * 100, E = b.rect.height / w.height * 100;
18485
+ if (m.style.left = `${y}%`, m.style.top = `${A}%`, m.style.width = `${v}%`, m.style.height = `${E}%`, m.style.display = "flex", m.style.alignItems = "center", m.style.justifyContent = "center", m.style.overflow = "hidden", b.style && Object.assign(m.style, b.style), b.type === "text")
18486
18486
  m.textContent = b.content || "", m.style.fontFamily = "sans-serif", m.style.fontSize = "2cqw", m.style.whiteSpace = "pre-wrap", m.style.textAlign = "center";
18487
18487
  else if (b.type === "image") {
18488
18488
  const _ = document.createElement("img");
@@ -18549,7 +18549,7 @@ class pa {
18549
18549
  return this.viewer.getScale();
18550
18550
  }
18551
18551
  async getPageDimensions(t) {
18552
- return this.viewer.getPageDimensions(t);
18552
+ return this.viewer.getPageDimensions(t - 1);
18553
18553
  }
18554
18554
  // Event handling
18555
18555
  on(t, e) {