@shznet/pdf-sign-react 0.2.1 → 0.2.3

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
@@ -1,5 +1,5 @@
1
1
  import { jsx as an } from "react/jsx-runtime";
2
- import { forwardRef as on, useRef as rs, useImperativeHandle as hn, useEffect as ue } from "react";
2
+ import { forwardRef as on, useRef as rs, useImperativeHandle as hn, useEffect as Vt } from "react";
3
3
  var vi = (c) => {
4
4
  throw TypeError(c);
5
5
  }, Ds = (c, t, e) => t.has(c) || vi("Cannot " + e), Y = (c, t, e) => (Ds(c, t, "read from private field"), e ? e.call(c) : t.get(c)), Ft = (c, t, e) => t.has(c) ? vi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, e), mt = (c, t, e, s) => (Ds(c, t, "write to private field"), t.set(c, e), e), It = (c, t, e) => (Ds(c, t, "access private method"), e), ln = (c, t, e, s) => ({
@@ -164,7 +164,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
164
164
  INVISIBLE: 3,
165
165
  FILL_STROKE_MASK: 3,
166
166
  ADD_TO_PATH_FLAG: 4
167
- }, Ge = {
167
+ }, je = {
168
168
  GRAYSCALE_1BPP: 1,
169
169
  RGB_24BPP: 2,
170
170
  RGBA_32BPP: 3
@@ -195,7 +195,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
195
195
  WATERMARK: 24,
196
196
  THREED: 25,
197
197
  REDACT: 26
198
- }, Jt = {
198
+ }, Zt = {
199
199
  SOLID: 1,
200
200
  DASHED: 2,
201
201
  BEVELED: 3,
@@ -320,11 +320,11 @@ function Je(c) {
320
320
  function I(c) {
321
321
  Qe >= Ke.WARNINGS && console.warn(`Warning: ${c}`);
322
322
  }
323
- function G(c) {
323
+ function j(c) {
324
324
  throw new Error(c);
325
325
  }
326
326
  function B(c, t) {
327
- c || G(t);
327
+ c || j(t);
328
328
  }
329
329
  function mn(c) {
330
330
  switch (c?.protocol) {
@@ -361,44 +361,44 @@ function L(c, t, e, s = !1) {
361
361
  writable: !1
362
362
  }), e;
363
363
  }
364
- const Xt = (function() {
364
+ const Yt = (function() {
365
365
  function c(t, e) {
366
366
  this.message = t, this.name = e;
367
367
  }
368
368
  return c.prototype = new Error(), c.constructor = c, c;
369
369
  })();
370
- class Xs extends Xt {
370
+ class Xs extends Yt {
371
371
  constructor(t, e) {
372
372
  super(t, "PasswordException"), this.code = e;
373
373
  }
374
374
  }
375
- class os extends Xt {
375
+ class os extends Yt {
376
376
  constructor(t, e) {
377
377
  super(t, "UnknownErrorException"), this.details = e;
378
378
  }
379
379
  }
380
- class ys extends Xt {
380
+ class ys extends Yt {
381
381
  constructor(t) {
382
382
  super(t, "InvalidPDFException");
383
383
  }
384
384
  }
385
- class We extends Xt {
385
+ class We extends Yt {
386
386
  constructor(t, e, s) {
387
387
  super(t, "ResponseException"), this.status = e, this.missing = s;
388
388
  }
389
389
  }
390
- class bn extends Xt {
390
+ class bn extends Yt {
391
391
  constructor(t) {
392
392
  super(t, "FormatError");
393
393
  }
394
394
  }
395
- class $t extends Xt {
395
+ class $t extends Yt {
396
396
  constructor(t) {
397
397
  super(t, "AbortException");
398
398
  }
399
399
  }
400
400
  function _i(c) {
401
- (typeof c != "object" || c?.length === void 0) && G("Invalid argument for bytesToString");
401
+ (typeof c != "object" || c?.length === void 0) && j("Invalid argument for bytesToString");
402
402
  const t = c.length, e = 8192;
403
403
  if (t < e)
404
404
  return String.fromCharCode.apply(null, c);
@@ -410,7 +410,7 @@ function _i(c) {
410
410
  return s.join("");
411
411
  }
412
412
  function Me(c) {
413
- typeof c != "string" && G("Invalid argument for stringToBytes");
413
+ typeof c != "string" && j("Invalid argument for stringToBytes");
414
414
  const t = c.length, e = new Uint8Array(t);
415
415
  for (let s = 0; s < t; ++s)
416
416
  e[s] = c.charCodeAt(s) & 255;
@@ -567,7 +567,7 @@ function Si() {
567
567
  const c = new Uint8Array(32);
568
568
  return crypto.getRandomValues(c), _i(c);
569
569
  }
570
- const ee = "pdfjs_internal_id_";
570
+ const se = "pdfjs_internal_id_";
571
571
  function _n(c, t, e) {
572
572
  if (!Array.isArray(e) || e.length < 2)
573
573
  return !1;
@@ -799,7 +799,7 @@ class Ci {
799
799
  }
800
800
  }
801
801
  const Rt = "http://www.w3.org/2000/svg";
802
- class le {
802
+ class ce {
803
803
  static CSS = 96;
804
804
  static PDF = 72;
805
805
  static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
@@ -913,7 +913,7 @@ class ke {
913
913
  return T.applyInverseTransform(s, this.transform), s;
914
914
  }
915
915
  }
916
- class Rs extends Xt {
916
+ class Rs extends Yt {
917
917
  constructor(t, e = 0) {
918
918
  super(t, "RenderingCancelledException"), this.extraDelay = e;
919
919
  }
@@ -1110,7 +1110,7 @@ function Et(c) {
1110
1110
  } = c.getTransform().invertSelf();
1111
1111
  return [t, e, s, i, n, r];
1112
1112
  }
1113
- function Gt(c, t, e = !1, s = !0) {
1113
+ function Wt(c, t, e = !1, s = !0) {
1114
1114
  if (t instanceof ke) {
1115
1115
  const {
1116
1116
  pageWidth: i,
@@ -1843,7 +1843,7 @@ class zt {
1843
1843
  #L = null;
1844
1844
  #B = null;
1845
1845
  #F = null;
1846
- #j = null;
1846
+ #G = null;
1847
1847
  #C = F.NONE;
1848
1848
  #x = /* @__PURE__ */ new Set();
1849
1849
  #I = null;
@@ -1861,14 +1861,14 @@ class zt {
1861
1861
  };
1862
1862
  #U = [0, 0];
1863
1863
  #N = null;
1864
- #G = null;
1864
+ #j = null;
1865
1865
  #J = null;
1866
1866
  #Z = null;
1867
1867
  #$ = null;
1868
1868
  static TRANSLATE_SMALL = 1;
1869
1869
  static TRANSLATE_BIG = 10;
1870
1870
  static get _keyboardManager() {
1871
- const t = zt.prototype, e = (r) => r.#G.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), s = (r, {
1871
+ const t = zt.prototype, e = (r) => r.#j.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), s = (r, {
1872
1872
  target: a
1873
1873
  }) => {
1874
1874
  if (a instanceof HTMLInputElement) {
@@ -1890,11 +1890,11 @@ class zt {
1890
1890
  }], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
1891
1891
  checker: (r, {
1892
1892
  target: a
1893
- }) => !(a instanceof HTMLButtonElement) && r.#G.contains(a) && !r.isEnterHandled
1893
+ }) => !(a instanceof HTMLButtonElement) && r.#j.contains(a) && !r.isEnterHandled
1894
1894
  }], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
1895
1895
  checker: (r, {
1896
1896
  target: a
1897
- }) => !(a instanceof HTMLButtonElement) && r.#G.contains(document.activeElement)
1897
+ }) => !(a instanceof HTMLButtonElement) && r.#j.contains(document.activeElement)
1898
1898
  }], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
1899
1899
  args: [-i, 0],
1900
1900
  checker: e
@@ -1923,7 +1923,7 @@ class zt {
1923
1923
  }
1924
1924
  constructor(t, e, s, i, n, r, a, o, h, l, d, u, p, f, g, b) {
1925
1925
  const m = this._signal = this.#t.signal;
1926
- this.#G = t, this.#J = e, this.#Z = s, this.#r = i, this.#h = n, this.#H = r, this.#W = o, this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
1926
+ this.#j = t, this.#J = e, this.#Z = s, this.#r = i, this.#h = n, this.#H = r, this.#W = o, this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
1927
1927
  signal: m
1928
1928
  }), a._on("pagechanging", this.onPageChanging.bind(this), {
1929
1929
  signal: m
@@ -1945,8 +1945,8 @@ class zt {
1945
1945
  }, {
1946
1946
  capture: !0,
1947
1947
  signal: m
1948
- }), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#E = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#j = f || null, this.viewParameters = {
1949
- realScale: le.PDF_TO_CSS_UNITS,
1948
+ }), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#E = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
1949
+ realScale: ce.PDF_TO_CSS_UNITS,
1950
1950
  rotation: 0
1951
1951
  }, this.isShiftKeyDown = !1, this._editorUndoBar = g || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
1952
1952
  }
@@ -1960,7 +1960,7 @@ class zt {
1960
1960
  return AbortSignal.any([this._signal, t.signal]);
1961
1961
  }
1962
1962
  get mlManager() {
1963
- return this.#j;
1963
+ return this.#G;
1964
1964
  }
1965
1965
  get useNewAltTextFlow() {
1966
1966
  return this.#w;
@@ -1972,7 +1972,7 @@ class zt {
1972
1972
  return L(this, "hcmFilter", this.#z ? this.#E.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
1973
1973
  }
1974
1974
  get direction() {
1975
- return L(this, "direction", getComputedStyle(this.#G).direction);
1975
+ return L(this, "direction", getComputedStyle(this.#j).direction);
1976
1976
  }
1977
1977
  get _highlightColors() {
1978
1978
  return L(this, "_highlightColors", this.#T ? new Map(this.#T.split(",").map((t) => (t = t.split("=").map((e) => e.trim()), t[1] = t[1].toUpperCase(), t))) : null);
@@ -2090,7 +2090,7 @@ class zt {
2090
2090
  this.#p = t - 1;
2091
2091
  }
2092
2092
  focusMainContainer() {
2093
- this.#G.focus();
2093
+ this.#j.focus();
2094
2094
  }
2095
2095
  findParent(t, e) {
2096
2096
  for (const s of this.#a.values()) {
@@ -2117,7 +2117,7 @@ class zt {
2117
2117
  onScaleChanging({
2118
2118
  scale: t
2119
2119
  }) {
2120
- this.commitOrRemove(), this.viewParameters.realScale = t * le.PDF_TO_CSS_UNITS;
2120
+ this.commitOrRemove(), this.viewParameters.realScale = t * ce.PDF_TO_CSS_UNITS;
2121
2121
  for (const e of this.#g)
2122
2122
  e.onScaleChanging();
2123
2123
  this.#d?.onScaleChanging();
@@ -3530,7 +3530,7 @@ class D {
3530
3530
  return !1;
3531
3531
  }
3532
3532
  static paste(t, e) {
3533
- G("Not implemented");
3533
+ j("Not implemented");
3534
3534
  }
3535
3535
  get propertiesToUpdate() {
3536
3536
  return [];
@@ -4054,13 +4054,13 @@ class D {
4054
4054
  return this.translate(i, n), Pi(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
4055
4055
  container: t,
4056
4056
  isPinchingDisabled: () => !this.isSelected,
4057
- onPinchStart: this.#j.bind(this),
4057
+ onPinchStart: this.#G.bind(this),
4058
4058
  onPinching: this.#C.bind(this),
4059
4059
  onPinchEnd: this.#x.bind(this),
4060
4060
  signal: this._uiManager._signal
4061
4061
  })), this.addStandaloneCommentButton(), this._uiManager._editorUndoBar?.hide(), t;
4062
4062
  }
4063
- #j() {
4063
+ #G() {
4064
4064
  this.#u = {
4065
4065
  savedX: this.x,
4066
4066
  savedY: this.y,
@@ -4763,7 +4763,7 @@ class Di extends Ns {
4763
4763
  };
4764
4764
  }
4765
4765
  get print() {
4766
- G("Should not call PrintAnnotationStorage.print");
4766
+ j("Should not call PrintAnnotationStorage.print");
4767
4767
  }
4768
4768
  get serializable() {
4769
4769
  return this.#t;
@@ -4819,7 +4819,7 @@ class Bn {
4819
4819
  }
4820
4820
  return;
4821
4821
  }
4822
- G("Not implemented: loadSystemFont without the Font Loading API.");
4822
+ j("Not implemented: loadSystemFont without the Font Loading API.");
4823
4823
  }
4824
4824
  }
4825
4825
  async bind(t) {
@@ -5047,7 +5047,7 @@ class Hn {
5047
5047
  return this.#t.defaultVMetrics;
5048
5048
  }
5049
5049
  }
5050
- class re {
5050
+ class ae {
5051
5051
  #t;
5052
5052
  #e;
5053
5053
  #i;
@@ -5055,13 +5055,13 @@ class re {
5055
5055
  static write(t) {
5056
5056
  const e = new TextEncoder(), s = {};
5057
5057
  let i = 0;
5058
- for (const h of re.strings) {
5058
+ for (const h of ae.strings) {
5059
5059
  const l = e.encode(t[h]);
5060
5060
  s[h] = l, i += 4 + l.length;
5061
5061
  }
5062
5062
  const n = new ArrayBuffer(i), r = new Uint8Array(n), a = new DataView(n);
5063
5063
  let o = 0;
5064
- for (const h of re.strings) {
5064
+ for (const h of ae.strings) {
5065
5065
  const l = s[h], d = l.length;
5066
5066
  a.setUint32(o, d), r.set(l, o + 4), o += 4 + d;
5067
5067
  }
@@ -5071,7 +5071,7 @@ class re {
5071
5071
  this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
5072
5072
  }
5073
5073
  #s(t) {
5074
- B(t < re.strings.length, "Invalid string index");
5074
+ B(t < ae.strings.length, "Invalid string index");
5075
5075
  let e = 0;
5076
5076
  for (let i = 0; i < t; i++)
5077
5077
  e += this.#e.getUint32(e) + 4;
@@ -5088,7 +5088,7 @@ class re {
5088
5088
  return this.#s(2);
5089
5089
  }
5090
5090
  }
5091
- class ae {
5091
+ class oe {
5092
5092
  #t;
5093
5093
  #e;
5094
5094
  #i;
@@ -5096,7 +5096,7 @@ class ae {
5096
5096
  static write(t) {
5097
5097
  const e = new TextEncoder(), s = {};
5098
5098
  let i = 0;
5099
- for (const u of ae.strings) {
5099
+ for (const u of oe.strings) {
5100
5100
  const p = e.encode(t[u]);
5101
5101
  s[u] = p, i += 4 + p.length;
5102
5102
  }
@@ -5106,7 +5106,7 @@ class ae {
5106
5106
  const o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
5107
5107
  let d = 0;
5108
5108
  l.setUint8(d++, t.guessFallback ? 1 : 0), l.setUint32(d, 0), d += 4, i = 0;
5109
- for (const u of ae.strings) {
5109
+ for (const u of oe.strings) {
5110
5110
  const p = s[u], f = p.length;
5111
5111
  i += 4 + f, l.setUint32(d, f), h.set(p, d + 4), d += 4 + f;
5112
5112
  }
@@ -5119,7 +5119,7 @@ class ae {
5119
5119
  return this.#e.getUint8(0) !== 0;
5120
5120
  }
5121
5121
  #s(t) {
5122
- B(t < ae.strings.length, "Invalid string index");
5122
+ B(t < oe.strings.length, "Invalid string index");
5123
5123
  let e = 5;
5124
5124
  for (let i = 0; i < t; i++)
5125
5125
  e += this.#e.getUint32(e) + 4;
@@ -5150,7 +5150,7 @@ class ae {
5150
5150
  };
5151
5151
  }
5152
5152
  }
5153
- class j {
5153
+ class G {
5154
5154
  static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"];
5155
5155
  static numbers = ["ascent", "defaultWidth", "descent"];
5156
5156
  static strings = ["fallbackName", "loadedName", "mimetype", "name"];
@@ -5169,7 +5169,7 @@ class j {
5169
5169
  this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
5170
5170
  }
5171
5171
  #l(t) {
5172
- B(t < j.bools.length, "Invalid boolean index");
5172
+ B(t < G.bools.length, "Invalid boolean index");
5173
5173
  const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
5174
5174
  return i === 0 ? void 0 : i === 2;
5175
5175
  }
@@ -5204,7 +5204,7 @@ class j {
5204
5204
  return this.#l(9);
5205
5205
  }
5206
5206
  #h(t) {
5207
- return B(t < j.numbers.length, "Invalid number index"), this.#o.getFloat64(j.#t + t * 8);
5207
+ return B(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
5208
5208
  }
5209
5209
  get ascent() {
5210
5210
  return this.#h(0);
@@ -5216,7 +5216,7 @@ class j {
5216
5216
  return this.#h(2);
5217
5217
  }
5218
5218
  get bbox() {
5219
- let t = j.#e;
5219
+ let t = G.#e;
5220
5220
  if (this.#o.getUint8(t) === 0)
5221
5221
  return;
5222
5222
  t += 1;
@@ -5226,7 +5226,7 @@ class j {
5226
5226
  return e;
5227
5227
  }
5228
5228
  get fontMatrix() {
5229
- let t = j.#i;
5229
+ let t = G.#i;
5230
5230
  if (this.#o.getUint8(t) === 0)
5231
5231
  return;
5232
5232
  t += 1;
@@ -5236,7 +5236,7 @@ class j {
5236
5236
  return e;
5237
5237
  }
5238
5238
  get defaultVMetrics() {
5239
- let t = j.#s;
5239
+ let t = G.#s;
5240
5240
  if (this.#o.getUint8(t) === 0)
5241
5241
  return;
5242
5242
  t += 1;
@@ -5246,8 +5246,8 @@ class j {
5246
5246
  return e;
5247
5247
  }
5248
5248
  #u(t) {
5249
- B(t < j.strings.length, "Invalid string index");
5250
- let e = j.#a + 4;
5249
+ B(t < G.strings.length, "Invalid string index");
5250
+ let e = G.#a + 4;
5251
5251
  for (let n = 0; n < t; n++)
5252
5252
  e += this.#o.getUint32(e) + 4;
5253
5253
  const s = this.#o.getUint32(e), i = new Uint8Array(s);
@@ -5266,7 +5266,7 @@ class j {
5266
5266
  return this.#u(3);
5267
5267
  }
5268
5268
  get data() {
5269
- let t = j.#a;
5269
+ let t = G.#a;
5270
5270
  const e = this.#o.getUint32(t);
5271
5271
  t += 4 + e;
5272
5272
  const s = this.#o.getUint32(t);
@@ -5278,7 +5278,7 @@ class j {
5278
5278
  return new Uint8Array(this.#r, t + 4, n);
5279
5279
  }
5280
5280
  clearData() {
5281
- let t = j.#a;
5281
+ let t = G.#a;
5282
5282
  const e = this.#o.getUint32(t);
5283
5283
  t += 4 + e;
5284
5284
  const s = this.#o.getUint32(t);
@@ -5289,7 +5289,7 @@ class j {
5289
5289
  new Uint8Array(this.#r, t + 4, n).fill(0), this.#o.setUint32(t, 0);
5290
5290
  }
5291
5291
  get cssFontInfo() {
5292
- let t = j.#a;
5292
+ let t = G.#a;
5293
5293
  const e = this.#o.getUint32(t);
5294
5294
  t += 4 + e;
5295
5295
  const s = this.#o.getUint32(t);
@@ -5298,58 +5298,58 @@ class j {
5298
5298
  if (i === 0)
5299
5299
  return null;
5300
5300
  const n = new Uint8Array(i);
5301
- return n.set(new Uint8Array(this.#r, t + 4, i)), new re(n.buffer);
5301
+ return n.set(new Uint8Array(this.#r, t + 4, i)), new ae(n.buffer);
5302
5302
  }
5303
5303
  get systemFontInfo() {
5304
- let t = j.#a;
5304
+ let t = G.#a;
5305
5305
  const e = this.#o.getUint32(t);
5306
5306
  t += 4 + e;
5307
5307
  const s = this.#o.getUint32(t);
5308
5308
  if (s === 0)
5309
5309
  return null;
5310
5310
  const i = new Uint8Array(s);
5311
- return i.set(new Uint8Array(this.#r, t + 4, s)), new ae(i.buffer);
5311
+ return i.set(new Uint8Array(this.#r, t + 4, s)), new oe(i.buffer);
5312
5312
  }
5313
5313
  static write(t) {
5314
- const e = t.systemFontInfo ? ae.write(t.systemFontInfo) : null, s = t.cssFontInfo ? re.write(t.cssFontInfo) : null, i = new TextEncoder(), n = {};
5314
+ const e = t.systemFontInfo ? oe.write(t.systemFontInfo) : null, s = t.cssFontInfo ? ae.write(t.cssFontInfo) : null, i = new TextEncoder(), n = {};
5315
5315
  let r = 0;
5316
- for (const g of j.strings)
5316
+ for (const g of G.strings)
5317
5317
  n[g] = i.encode(t[g]), r += 4 + n[g].length;
5318
- const a = j.#a + 4 + r + 4 + (e ? e.byteLength : 0) + 4 + (s ? s.byteLength : 0) + 4 + (t.data ? t.data.length : 0), o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
5318
+ const a = G.#a + 4 + r + 4 + (e ? e.byteLength : 0) + 4 + (s ? s.byteLength : 0) + 4 + (t.data ? t.data.length : 0), o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
5319
5319
  let d = 0;
5320
- const u = j.bools.length;
5320
+ const u = G.bools.length;
5321
5321
  let p = 0, f = 0;
5322
5322
  for (let g = 0; g < u; g++) {
5323
- const b = t[j.bools[g]];
5323
+ const b = t[G.bools[g]];
5324
5324
  p |= (b === void 0 ? 0 : b ? 2 : 1) << f, f += 2, (f === 8 || g === u - 1) && (l.setUint8(d++, p), p = 0, f = 0);
5325
5325
  }
5326
- B(d === j.#t, "FontInfo.write: Boolean properties offset mismatch");
5327
- for (const g of j.numbers)
5326
+ B(d === G.#t, "FontInfo.write: Boolean properties offset mismatch");
5327
+ for (const g of G.numbers)
5328
5328
  l.setFloat64(d, t[g]), d += 8;
5329
- if (B(d === j.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
5329
+ if (B(d === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
5330
5330
  l.setUint8(d++, 4);
5331
5331
  for (const g of t.bbox)
5332
5332
  l.setInt16(d, g, !0), d += 2;
5333
5333
  } else
5334
5334
  l.setUint8(d++, 0), d += 8;
5335
- if (B(d === j.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
5335
+ if (B(d === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
5336
5336
  l.setUint8(d++, 6);
5337
5337
  for (const g of t.fontMatrix)
5338
5338
  l.setFloat64(d, g, !0), d += 8;
5339
5339
  } else
5340
5340
  l.setUint8(d++, 0), d += 48;
5341
- if (B(d === j.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
5341
+ if (B(d === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
5342
5342
  l.setUint8(d++, 1);
5343
5343
  for (const g of t.defaultVMetrics)
5344
5344
  l.setInt16(d, g, !0), d += 2;
5345
5345
  } else
5346
5346
  l.setUint8(d++, 0), d += 6;
5347
- B(d === j.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(j.#a, 0), d += 4;
5348
- for (const g of j.strings) {
5347
+ B(d === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), d += 4;
5348
+ for (const g of G.strings) {
5349
5349
  const b = n[g], m = b.length;
5350
5350
  l.setUint32(d, m), h.set(b, d + 4), d += 4 + m;
5351
5351
  }
5352
- if (l.setUint32(j.#a, d - j.#a - 4), !e)
5352
+ if (l.setUint32(G.#a, d - G.#a - 4), !e)
5353
5353
  l.setUint32(d, 0), d += 4;
5354
5354
  else {
5355
5355
  const g = e.byteLength;
@@ -5512,8 +5512,8 @@ function Ne(c) {
5512
5512
  return c;
5513
5513
  throw new Error(`Invalid factory url: "${c}" must include trailing slash.`);
5514
5514
  }
5515
- const _s = (c) => typeof c == "object" && Number.isInteger(c?.num) && c.num >= 0 && Number.isInteger(c?.gen) && c.gen >= 0, Vn = (c) => typeof c == "object" && typeof c?.name == "string", jn = _n.bind(null, _s, Vn);
5516
- class Gn {
5515
+ const _s = (c) => typeof c == "object" && Number.isInteger(c?.num) && c.num >= 0 && Number.isInteger(c?.gen) && c.gen >= 0, Vn = (c) => typeof c == "object" && typeof c?.name == "string", Gn = _n.bind(null, _s, Vn);
5516
+ class jn {
5517
5517
  #t = /* @__PURE__ */ new Map();
5518
5518
  #e = Promise.resolve();
5519
5519
  postMessage(t, e) {
@@ -5569,7 +5569,7 @@ function si() {
5569
5569
  function pt(c) {
5570
5570
  if (c instanceof $t || c instanceof ys || c instanceof Xs || c instanceof We || c instanceof os)
5571
5571
  return c;
5572
- switch (c instanceof Error || typeof c == "object" && c !== null || G('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), c.name) {
5572
+ switch (c instanceof Error || typeof c == "object" && c !== null || j('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), c.name) {
5573
5573
  case "AbortException":
5574
5574
  return new $t(c.message);
5575
5575
  case "InvalidPDFException":
@@ -5888,7 +5888,7 @@ class Ri {
5888
5888
  t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
5889
5889
  }
5890
5890
  _createCanvas(t, e) {
5891
- G("Abstract method `_createCanvas` called.");
5891
+ j("Abstract method `_createCanvas` called.");
5892
5892
  }
5893
5893
  }
5894
5894
  class Wn extends Ri {
@@ -5928,7 +5928,7 @@ class Ii {
5928
5928
  });
5929
5929
  }
5930
5930
  async _fetch(t) {
5931
- G("Abstract method `_fetch` called.");
5931
+ j("Abstract method `_fetch` called.");
5932
5932
  }
5933
5933
  }
5934
5934
  class ii extends Ii {
@@ -6152,7 +6152,7 @@ class Fi {
6152
6152
  });
6153
6153
  }
6154
6154
  async _fetch(t) {
6155
- G("Abstract method `_fetch` called.");
6155
+ j("Abstract method `_fetch` called.");
6156
6156
  }
6157
6157
  }
6158
6158
  class ni extends Fi {
@@ -6180,7 +6180,7 @@ class Ni {
6180
6180
  });
6181
6181
  }
6182
6182
  async _fetch(t) {
6183
- G("Abstract method `_fetch` called.");
6183
+ j("Abstract method `_fetch` called.");
6184
6184
  }
6185
6185
  }
6186
6186
  class ri extends Ni {
@@ -6216,7 +6216,7 @@ class Jn extends Ni {
6216
6216
  return Os(t);
6217
6217
  }
6218
6218
  }
6219
- const Kt = "__forcedDependency", {
6219
+ const Qt = "__forcedDependency", {
6220
6220
  floor: ai,
6221
6221
  ceil: oi
6222
6222
  } = Math;
@@ -6267,7 +6267,7 @@ class tr {
6267
6267
  transform: [],
6268
6268
  moveText: [],
6269
6269
  sameLineText: [],
6270
- [Kt]: []
6270
+ [Qt]: []
6271
6271
  };
6272
6272
  #i = /* @__PURE__ */ new Map();
6273
6273
  #s = [];
@@ -6308,8 +6308,8 @@ class tr {
6308
6308
  sameLineText: {
6309
6309
  __proto__: this.#e.sameLineText
6310
6310
  },
6311
- [Kt]: {
6312
- __proto__: this.#e[Kt]
6311
+ [Qt]: {
6312
+ __proto__: this.#e[Qt]
6313
6313
  }
6314
6314
  }, this.#n = {
6315
6315
  __proto__: this.#n
@@ -6362,7 +6362,7 @@ class tr {
6362
6362
  this.#t[t] = this.#i.get(e) ?? s;
6363
6363
  }
6364
6364
  recordFutureForcedDependency(t, e) {
6365
- return this.recordIncrementalData(Kt, e), this;
6365
+ return this.recordIncrementalData(Qt, e), this;
6366
6366
  }
6367
6367
  inheritSimpleDataAsFutureForcedDependencies(t) {
6368
6368
  for (const e of t)
@@ -6371,7 +6371,7 @@ class tr {
6371
6371
  }
6372
6372
  inheritPendingDependenciesAsFutureForcedDependencies() {
6373
6373
  for (const t of this.#h)
6374
- this.recordFutureForcedDependency(Kt, t);
6374
+ this.recordFutureForcedDependency(Qt, t);
6375
6375
  return this;
6376
6376
  }
6377
6377
  resetBBox(t) {
@@ -6419,7 +6419,7 @@ class tr {
6419
6419
  return this.#i.has(e) && this.#h.add(this.#i.get(e)), this;
6420
6420
  }
6421
6421
  recordOperation(t, e = !1) {
6422
- if (this.recordDependencies(t, [Kt]), this.#g) {
6422
+ if (this.recordDependencies(t, [Qt]), this.#g) {
6423
6423
  const s = He(this.#g, t), {
6424
6424
  dependencies: i
6425
6425
  } = s;
@@ -6596,7 +6596,7 @@ class Bs {
6596
6596
  return !1;
6597
6597
  }
6598
6598
  getPattern() {
6599
- G("Abstract method `getPattern` called.");
6599
+ j("Abstract method `getPattern` called.");
6600
6600
  }
6601
6601
  }
6602
6602
  class er extends Bs {
@@ -6791,9 +6791,9 @@ class Hs {
6791
6791
  const ft = k.canvas;
6792
6792
  S && (x = h), E && (_ = l);
6793
6793
  const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Ot = S ? Math.floor(g / h) : 0, et = E ? Math.floor(b / l) : 0;
6794
- for (let ce = 0; ce <= Ot; ce++)
6795
- for (let de = 0; de <= et; de++)
6796
- Nt.drawImage(ft, W * ce, q * de, W, q, 0, 0, W, q);
6794
+ for (let de = 0; de <= Ot; de++)
6795
+ for (let ue = 0; ue <= et; ue++)
6796
+ Nt.drawImage(ft, W * de, q * ue, W, q, 0, 0, W, q);
6797
6797
  return {
6798
6798
  canvas: Ut.canvas,
6799
6799
  scaleX: Dt.scale,
@@ -6880,7 +6880,7 @@ function ar({
6880
6880
  destPos: p
6881
6881
  };
6882
6882
  }
6883
- const li = 16, ci = 100, or = 15, di = 10, gt = 16, ds = new DOMMatrix(), wt = new Float32Array(2), se = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
6883
+ const li = 16, ci = 100, or = 15, di = 10, gt = 16, ds = new DOMMatrix(), wt = new Float32Array(2), ie = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
6884
6884
  function hr(c, t) {
6885
6885
  if (c._removeMirroring)
6886
6886
  throw new Error("Context is already forwarding operations.");
@@ -6977,7 +6977,7 @@ class ui {
6977
6977
  activeSMask = null;
6978
6978
  transferMaps = "none";
6979
6979
  constructor(t, e, s) {
6980
- s?.(this), this.clipBox = new Float32Array([0, 0, t, e]), this.minMax = se.slice();
6980
+ s?.(this), this.clipBox = new Float32Array([0, 0, t, e]), this.minMax = ie.slice();
6981
6981
  }
6982
6982
  clone() {
6983
6983
  const t = Object.create(this);
@@ -6986,7 +6986,7 @@ class ui {
6986
6986
  getPathBoundingBox(t = ct.FILL, e = null) {
6987
6987
  const s = this.minMax.slice();
6988
6988
  if (t === ct.STROKE) {
6989
- e || G("Stroke bounding box must include transform."), T.singularValueDecompose2dScale(e, wt);
6989
+ e || j("Stroke bounding box must include transform."), T.singularValueDecompose2dScale(e, wt);
6990
6990
  const i = wt[0] * this.lineWidth / 2, n = wt[1] * this.lineWidth / 2;
6991
6991
  s[0] -= i, s[1] -= n, s[2] += i, s[3] += n;
6992
6992
  }
@@ -7000,7 +7000,7 @@ class ui {
7000
7000
  return this.minMax[0] === 1 / 0;
7001
7001
  }
7002
7002
  startNewPathAndClipBox(t) {
7003
- this.clipBox.set(t, 0), this.minMax.set(se, 0);
7003
+ this.clipBox.set(t, 0), this.minMax.set(ie, 0);
7004
7004
  }
7005
7005
  getClippedPathBoundingBox(t = ct.FILL, e = null) {
7006
7006
  return T.intersect(this.clipBox, this.getPathBoundingBox(t, e));
@@ -7015,7 +7015,7 @@ function pi(c, t) {
7015
7015
  let o = 0, h;
7016
7016
  const l = t.data, d = a.data;
7017
7017
  let u, p, f, g;
7018
- if (t.kind === Ge.GRAYSCALE_1BPP) {
7018
+ if (t.kind === je.GRAYSCALE_1BPP) {
7019
7019
  const b = l.byteLength, m = new Uint32Array(d.buffer, 0, d.byteLength >> 2), w = m.length, y = s + 7 >> 3, v = 4294967295, A = at.isLittleEndian ? 4278190080 : 255;
7020
7020
  for (u = 0; u < r; u++) {
7021
7021
  for (f = u < n ? gt : i, h = 0, p = 0; p < f; p++) {
@@ -7032,11 +7032,11 @@ function pi(c, t) {
7032
7032
  m[h++] = 0;
7033
7033
  c.putImageData(a, 0, u * gt);
7034
7034
  }
7035
- } else if (t.kind === Ge.RGBA_32BPP) {
7035
+ } else if (t.kind === je.RGBA_32BPP) {
7036
7036
  for (p = 0, g = s * gt * 4, u = 0; u < n; u++)
7037
7037
  d.set(l.subarray(o, o + g)), o += g, c.putImageData(a, 0, p), p += gt;
7038
7038
  u < r && (g = s * i * 4, d.set(l.subarray(o, o + g)), c.putImageData(a, 0, p));
7039
- } else if (t.kind === Ge.RGB_24BPP)
7039
+ } else if (t.kind === je.RGB_24BPP)
7040
7040
  for (f = gt, g = s * f, u = 0; u < r; u++) {
7041
7041
  for (u >= n && (f = i, g = s * f), h = 0, p = g; p--; )
7042
7042
  d[h++] = l[o++], d[h++] = l[o++], d[h++] = l[o++], d[h++] = 255;
@@ -7084,11 +7084,11 @@ function fi(c, t) {
7084
7084
  if (t)
7085
7085
  return !0;
7086
7086
  T.singularValueDecompose2dScale(c, wt);
7087
- const e = Math.fround(kt.pixelRatio * le.PDF_TO_CSS_UNITS);
7087
+ const e = Math.fround(kt.pixelRatio * ce.PDF_TO_CSS_UNITS);
7088
7088
  return wt[0] <= e && wt[1] <= e;
7089
7089
  }
7090
7090
  const cr = ["butt", "round", "square"], dr = ["miter", "round", "bevel"], ur = {}, mi = {};
7091
- class oe {
7091
+ class he {
7092
7092
  constructor(t, e, s, i, n, {
7093
7093
  optionalContentConfig: r,
7094
7094
  markedContentStack: a = null
@@ -7202,7 +7202,7 @@ class oe {
7202
7202
  d || (u = this.cachedCanvases.getCanvas("maskCanvas", i, n), gi(u.context, e));
7203
7203
  let p = T.transform(o, [1 / i, 0, 0, -1 / n, 0, 0]);
7204
7204
  p = T.transform(p, [1, 0, 0, 1, 0, -n]);
7205
- const f = se.slice();
7205
+ const f = ie.slice();
7206
7206
  T.axialAlignedBoundingBox([0, 0, i, n], p, f);
7207
7207
  const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g, S = b;
7208
7208
  x.translate(-_, -S), x.transform(...p), d || (d = this._scaleImage(u.canvas, Et(x)), d = d.img, h && a && h.set(l, d)), x.imageSmoothingEnabled = fi(X(x), e.interpolate), $e(x, d, 0, 0, d.width, d.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
@@ -7648,7 +7648,7 @@ class oe {
7648
7648
  let s;
7649
7649
  if (e[0] === "TilingPattern") {
7650
7650
  const i = this.baseTransform || X(this.ctx), n = {
7651
- createCanvasGraphics: (r, a) => new oe(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
7651
+ createCanvasGraphics: (r, a) => new he(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
7652
7652
  optionalContentConfig: this.optionalContentConfig,
7653
7653
  markedContentStack: this.markedContentStack
7654
7654
  }, void 0, void 0, this.dependencyTracker ? new qe(this.dependencyTracker, a, !0) : null)
@@ -7692,7 +7692,7 @@ class oe {
7692
7692
  const {
7693
7693
  width: r,
7694
7694
  height: a
7695
- } = s.canvas, o = se.slice();
7695
+ } = s.canvas, o = ie.slice();
7696
7696
  T.axialAlignedBoundingBox([0, 0, r, a], n, o);
7697
7697
  const [h, l, d, u] = o;
7698
7698
  this.ctx.fillRect(h, l, d - h, u - l);
@@ -7701,10 +7701,10 @@ class oe {
7701
7701
  this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t, At.transform).recordDependencies(t, At.fill).recordOperation(t), this.compose(this.current.getClippedPathBoundingBox()), this.restore(t);
7702
7702
  }
7703
7703
  beginInlineImage() {
7704
- G("Should not call beginInlineImage");
7704
+ j("Should not call beginInlineImage");
7705
7705
  }
7706
7706
  beginImageData() {
7707
- G("Should not call beginImageData");
7707
+ j("Should not call beginImageData");
7708
7708
  }
7709
7709
  paintFormXObjectBegin(t, e, s) {
7710
7710
  if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = X(this.ctx), s)) {
@@ -7725,7 +7725,7 @@ class oe {
7725
7725
  const i = X(s);
7726
7726
  if (e.matrix && s.transform(...e.matrix), !e.bbox)
7727
7727
  throw new Error("Bounding box is required.");
7728
- let n = se.slice();
7728
+ let n = ie.slice();
7729
7729
  T.axialAlignedBoundingBox(e.bbox, X(s), n);
7730
7730
  const r = [0, 0, s.canvas.width, s.canvas.height];
7731
7731
  n = T.intersect(n, r) || [0, 0, 0, 0];
@@ -7763,7 +7763,7 @@ class oe {
7763
7763
  this.ctx.restore();
7764
7764
  const n = X(this.ctx);
7765
7765
  this.restore(t), this.ctx.save(), this.ctx.setTransform(...n);
7766
- const r = se.slice();
7766
+ const r = ie.slice();
7767
7767
  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);
7768
7768
  }
7769
7769
  }
@@ -8024,8 +8024,8 @@ class oe {
8024
8024
  }
8025
8025
  }
8026
8026
  for (const c in Ee)
8027
- oe.prototype[c] !== void 0 && (oe.prototype[Ee[c]] = oe.prototype[c]);
8028
- class Wt {
8027
+ he.prototype[c] !== void 0 && (he.prototype[Ee[c]] = he.prototype[c]);
8028
+ class qt {
8029
8029
  static #t = null;
8030
8030
  static #e = "";
8031
8031
  static get workerPort() {
@@ -8064,7 +8064,7 @@ class pr {
8064
8064
  return this.#t.entries();
8065
8065
  }
8066
8066
  }
8067
- const Zt = /* @__PURE__ */ Symbol("INTERNAL");
8067
+ const te = /* @__PURE__ */ Symbol("INTERNAL");
8068
8068
  class gr {
8069
8069
  #t = !1;
8070
8070
  #e = !1;
@@ -8090,7 +8090,7 @@ class gr {
8090
8090
  return this.#t ? e?.viewState !== "OFF" : this.#e ? t?.printState !== "OFF" : !0;
8091
8091
  }
8092
8092
  _setVisible(t, e, s = !1) {
8093
- t !== Zt && G("Internal method `_setVisible` called."), this.#i = s, this.#s = e;
8093
+ t !== te && j("Internal method `_setVisible` called."), this.#i = s, this.#s = e;
8094
8094
  }
8095
8095
  }
8096
8096
  class fr {
@@ -8105,11 +8105,11 @@ class fr {
8105
8105
  this.#e.set(s.id, new gr(e, s));
8106
8106
  if (t.baseState === "OFF")
8107
8107
  for (const s of this.#e.values())
8108
- s._setVisible(Zt, !1);
8108
+ s._setVisible(te, !1);
8109
8109
  for (const s of t.on)
8110
- this.#e.get(s)._setVisible(Zt, !0);
8110
+ this.#e.get(s)._setVisible(te, !0);
8111
8111
  for (const s of t.off)
8112
- this.#e.get(s)._setVisible(Zt, !1);
8112
+ this.#e.get(s)._setVisible(te, !1);
8113
8113
  this.#i = this.getHash();
8114
8114
  }
8115
8115
  }
@@ -8200,8 +8200,8 @@ class fr {
8200
8200
  if (s && e && i.rbGroups.length)
8201
8201
  for (const n of i.rbGroups)
8202
8202
  for (const r of n)
8203
- r !== t && this.#e.get(r)?._setVisible(Zt, !1, !0);
8204
- i._setVisible(Zt, !!e, !0), this.#t = null;
8203
+ r !== t && this.#e.get(r)?._setVisible(te, !1, !0);
8204
+ i._setVisible(te, !!e, !0), this.#t = null;
8205
8205
  }
8206
8206
  setOCGState({
8207
8207
  state: t,
@@ -9209,7 +9209,7 @@ class yt {
9209
9209
  pageX: r,
9210
9210
  pageY: a
9211
9211
  } = s.rawDims;
9212
- this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_), Gt(e, s), this.#t.promise.finally(() => {
9212
+ this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_), Wt(e, s), this.#t.promise.finally(() => {
9213
9213
  yt.#A.delete(this), this.#r = null, this.#p = null;
9214
9214
  }).catch(() => {
9215
9215
  });
@@ -9241,7 +9241,7 @@ class yt {
9241
9241
  onBefore: e = null
9242
9242
  }) {
9243
9243
  const s = t.scale * kt.pixelRatio, i = t.rotation;
9244
- if (i !== this.#u && (e?.(), this.#u = i, Gt(this.#h, {
9244
+ if (i !== this.#u && (e?.(), this.#u = i, Wt(this.#h, {
9245
9245
  rotation: i
9246
9246
  })), s !== this.#d) {
9247
9247
  e?.(), this.#d = s;
@@ -9387,7 +9387,7 @@ class yt {
9387
9387
  }
9388
9388
  }
9389
9389
  const Lr = 100;
9390
- function ji(c = {}) {
9390
+ function Gi(c = {}) {
9391
9391
  typeof c == "string" || c instanceof URL ? c = {
9392
9392
  url: c
9393
9393
  } : (c instanceof ArrayBuffer || ArrayBuffer.isView(c)) && (c = {
@@ -9395,7 +9395,7 @@ function ji(c = {}) {
9395
9395
  });
9396
9396
  const t = new $s(), {
9397
9397
  docId: e
9398
- } = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof Gi ? c.range : null, h = Number.isInteger(c.rangeChunkSize) && c.rangeChunkSize > 0 ? c.rangeChunkSize : 2 ** 16;
9398
+ } = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof ji ? c.range : null, h = Number.isInteger(c.rangeChunkSize) && c.rangeChunkSize > 0 ? c.rangeChunkSize : 2 ** 16;
9399
9399
  let l = c.worker instanceof Cs ? c.worker : null;
9400
9400
  const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1, S = typeof c.isOffscreenCanvasSupported == "boolean" ? c.isOffscreenCanvasSupported : !dt, E = typeof c.isImageDecoderSupported == "boolean" ? c.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), P = Number.isInteger(c.canvasMaxAreaInBytes) ? c.canvasMaxAreaInBytes : -1, C = typeof c.disableFontFace == "boolean" ? c.disableFontFace : dt, H = c.fontExtraProperties === !0, V = c.enableXfa === !0, N = c.ownerDocument || globalThis.document, Z = c.disableRange === !0, k = c.disableStream === !0, R = c.disableAutoFetch === !0, U = c.pdfBug === !0, ft = c.CanvasFactory || (dt ? Yn : Wn), Dt = c.FilterFactory || (dt ? Xn : qn), tt = c.enableHWA === !0, W = c.useWasm !== !1, q = o ? o.length : c.length ?? NaN, Ut = typeof c.useSystemFonts == "boolean" ? c.useSystemFonts : !dt && !C, Nt = typeof c.useWorkerFetch == "boolean" ? c.useWorkerFetch : !!(g === ii && w === ni && v === ri && p && m && y && we(p, document.baseURI) && we(m, document.baseURI) && we(y, document.baseURI)), Ot = null;
9401
9401
  gn(d);
@@ -9421,9 +9421,9 @@ function ji(c = {}) {
9421
9421
  };
9422
9422
  l || (l = Cs.create({
9423
9423
  verbosity: d,
9424
- port: Wt.workerPort
9424
+ port: qt.workerPort
9425
9425
  }), t._worker = l);
9426
- const ce = {
9426
+ const de = {
9427
9427
  docId: e,
9428
9428
  apiVersion: "5.4.530",
9429
9429
  data: i,
@@ -9450,7 +9450,7 @@ function ji(c = {}) {
9450
9450
  standardFontDataUrl: m,
9451
9451
  wasmUrl: y
9452
9452
  }
9453
- }, de = {
9453
+ }, ue = {
9454
9454
  ownerDocument: N,
9455
9455
  pdfBug: U,
9456
9456
  styleElement: Ot,
@@ -9464,7 +9464,7 @@ function ji(c = {}) {
9464
9464
  throw new Error("Loading aborted");
9465
9465
  if (l.destroyed)
9466
9466
  throw new Error("Worker was destroyed");
9467
- const nn = l.messageHandler.sendWithPromise("GetDocRequest", ce, i ? [i.buffer] : null);
9467
+ const nn = l.messageHandler.sendWithPromise("GetDocRequest", de, i ? [i.buffer] : null);
9468
9468
  let is;
9469
9469
  if (o)
9470
9470
  is = new mr(o, {
@@ -9490,7 +9490,7 @@ function ji(c = {}) {
9490
9490
  throw new Error("Loading aborted");
9491
9491
  if (l.destroyed)
9492
9492
  throw new Error("Worker was destroyed");
9493
- const qs = new ve(e, ns, l.port), rn = new Or(qs, t, is, de, et, tt);
9493
+ const qs = new ve(e, ns, l.port), rn = new Or(qs, t, is, ue, et, tt);
9494
9494
  t._transport = rn, qs.send("Ready", null);
9495
9495
  });
9496
9496
  }).catch(t._capability.reject), t;
@@ -9520,7 +9520,7 @@ class $s {
9520
9520
  return this._transport.getData();
9521
9521
  }
9522
9522
  }
9523
- class Gi {
9523
+ class ji {
9524
9524
  #t = Promise.withResolvers();
9525
9525
  #e = [];
9526
9526
  #i = [];
@@ -9567,7 +9567,7 @@ class Gi {
9567
9567
  this.#t.resolve();
9568
9568
  }
9569
9569
  requestDataRange(t, e) {
9570
- G("Abstract method PDFDataRangeTransport.requestDataRange");
9570
+ j("Abstract method PDFDataRangeTransport.requestDataRange");
9571
9571
  }
9572
9572
  abort() {
9573
9573
  }
@@ -9787,7 +9787,7 @@ class Nr {
9787
9787
  intentState: w,
9788
9788
  reason: E instanceof Error ? E : new Error(E)
9789
9789
  })) : _.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
9790
- }, _ = new ne({
9790
+ }, _ = new re({
9791
9791
  callback: x,
9792
9792
  params: {
9793
9793
  canvas: e,
@@ -10011,22 +10011,22 @@ class Nr {
10011
10011
  return this._stats;
10012
10012
  }
10013
10013
  }
10014
- var Vt, Pt, Ht, he, gs, Qt, ie, St, Ue, Wi, qi, me, _e, Xe;
10014
+ var Gt, Pt, Ht, le, gs, Jt, ne, St, Ue, Wi, qi, me, _e, Xe;
10015
10015
  const rt = class Ae {
10016
10016
  constructor({
10017
10017
  name: t = null,
10018
10018
  port: e = null,
10019
10019
  verbosity: s = fn()
10020
10020
  } = {}) {
10021
- if (Ft(this, St), Ft(this, Vt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this, he, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
10022
- if (Y(Ae, ie).has(e))
10021
+ if (Ft(this, St), Ft(this, Gt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this, le, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
10022
+ if (Y(Ae, ne).has(e))
10023
10023
  throw new Error("Cannot use more than one PDFWorker per port.");
10024
- Y(Ae, ie).set(e, this), It(this, St, Wi).call(this, e);
10024
+ Y(Ae, ne).set(e, this), It(this, St, Wi).call(this, e);
10025
10025
  } else
10026
10026
  It(this, St, qi).call(this);
10027
10027
  }
10028
10028
  get promise() {
10029
- return Y(this, Vt).promise;
10029
+ return Y(this, Gt).promise;
10030
10030
  }
10031
10031
  get port() {
10032
10032
  return Y(this, Ht);
@@ -10035,10 +10035,10 @@ const rt = class Ae {
10035
10035
  return Y(this, Pt);
10036
10036
  }
10037
10037
  destroy() {
10038
- this.destroyed = !0, Y(this, he)?.terminate(), mt(this, he, null), Y(Ae, ie).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Pt)?.destroy(), mt(this, Pt, null);
10038
+ this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Pt)?.destroy(), mt(this, Pt, null);
10039
10039
  }
10040
10040
  static create(t) {
10041
- const e = Y(this, ie).get(t?.port);
10041
+ const e = Y(this, ne).get(t?.port);
10042
10042
  if (e) {
10043
10043
  if (e._pendingDestroy)
10044
10044
  throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
@@ -10047,8 +10047,8 @@ const rt = class Ae {
10047
10047
  return new Ae(t);
10048
10048
  }
10049
10049
  static get workerSrc() {
10050
- if (Wt.workerSrc)
10051
- return Wt.workerSrc;
10050
+ if (qt.workerSrc)
10051
+ return qt.workerSrc;
10052
10052
  throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
10053
10053
  }
10054
10054
  static get _setupFakeWorkerGlobal() {
@@ -10059,15 +10059,15 @@ const rt = class Ae {
10059
10059
  )).WorkerMessageHandler)());
10060
10060
  }
10061
10061
  };
10062
- Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), Ue = function() {
10063
- Y(this, Vt).resolve(), Y(this, Pt).send("configure", {
10062
+ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), Ue = function() {
10063
+ Y(this, Gt).resolve(), Y(this, Pt).send("configure", {
10064
10064
  verbosity: this.verbosity
10065
10065
  });
10066
10066
  }, Wi = function(c) {
10067
10067
  mt(this, Ht, c), mt(this, Pt, new ve("main", "worker", c)), Y(this, Pt).on("ready", () => {
10068
10068
  }), It(this, St, Ue).call(this);
10069
10069
  }, qi = function() {
10070
- if (Y(rt, Qt) || Y(rt, _e, Xe)) {
10070
+ if (Y(rt, Jt) || Y(rt, _e, Xe)) {
10071
10071
  It(this, St, me).call(this);
10072
10072
  return;
10073
10073
  }
@@ -10079,10 +10079,10 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10079
10079
  const t = new Worker(c, {
10080
10080
  type: "module"
10081
10081
  }), e = new ve("main", "worker", t), s = () => {
10082
- i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) : It(this, St, me).call(this);
10082
+ i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Gt).reject(new Error("Worker was destroyed")) : It(this, St, me).call(this);
10083
10083
  }, i = new AbortController();
10084
10084
  t.addEventListener("error", () => {
10085
- Y(this, he) || s();
10085
+ Y(this, le) || s();
10086
10086
  }, {
10087
10087
  signal: i.signal
10088
10088
  }), e.on("test", (r) => {
@@ -10090,7 +10090,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10090
10090
  s();
10091
10091
  return;
10092
10092
  }
10093
- mt(this, Pt, e), mt(this, Ht, t), mt(this, he, t), It(this, St, Ue).call(this);
10093
+ mt(this, Pt, e), mt(this, Ht, t), mt(this, le, t), It(this, St, Ue).call(this);
10094
10094
  }), e.on("ready", (r) => {
10095
10095
  if (i.abort(), this.destroyed) {
10096
10096
  s();
@@ -10113,17 +10113,17 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10113
10113
  }
10114
10114
  It(this, St, me).call(this);
10115
10115
  }, me = function() {
10116
- Y(rt, Qt) || (I("Setting up fake worker."), mt(rt, Qt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
10116
+ Y(rt, Jt) || (I("Setting up fake worker."), mt(rt, Jt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
10117
10117
  if (this.destroyed) {
10118
- Y(this, Vt).reject(new Error("Worker was destroyed"));
10118
+ Y(this, Gt).reject(new Error("Worker was destroyed"));
10119
10119
  return;
10120
10120
  }
10121
- const t = new Gn();
10121
+ const t = new jn();
10122
10122
  mt(this, Ht, t);
10123
10123
  const e = `fake${ln(rt, gs)._++}`, s = new ve(e + "_worker", e, t);
10124
10124
  c.setup(s, t), mt(this, Pt, new ve(e, e + "_worker", t)), It(this, St, Ue).call(this);
10125
10125
  }).catch((c) => {
10126
- Y(this, Vt).reject(new Error(`Setting up fake worker failed: "${c.message}".`));
10126
+ Y(this, Gt).reject(new Error(`Setting up fake worker failed: "${c.message}".`));
10127
10127
  });
10128
10128
  }, _e = /* @__PURE__ */ new WeakSet(), Xe = function() {
10129
10129
  try {
@@ -10131,7 +10131,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
10131
10131
  } catch {
10132
10132
  return null;
10133
10133
  }
10134
- }, Ft(rt, _e), Ft(rt, gs, 0), Ft(rt, Qt, !1), Ft(rt, ie, /* @__PURE__ */ new WeakMap()), dt && (mt(rt, Qt, !0), Wt.workerSrc ||= "./pdf.worker.mjs"), rt._isSameOrigin = (c, t) => {
10134
+ }, Ft(rt, _e), Ft(rt, gs, 0), Ft(rt, Jt, !1), Ft(rt, ne, /* @__PURE__ */ new WeakMap()), dt && (mt(rt, Jt, !0), qt.workerSrc ||= "./pdf.worker.mjs"), rt._isSameOrigin = (c, t) => {
10135
10135
  const e = URL.parse(c);
10136
10136
  if (!e?.origin || e.origin === "null")
10137
10137
  return !1;
@@ -10336,7 +10336,7 @@ class Or {
10336
10336
  I(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
10337
10337
  break;
10338
10338
  }
10339
- const r = new j(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (d, u) => globalThis.FontInspector.fontAdded(d, u) : null, o = new Hn(r, a, n.extra, n.charProcOperatorList);
10339
+ const r = new G(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (d, u) => globalThis.FontInspector.fontAdded(d, u) : null, o = new Hn(r, a, n.extra, n.charProcOperatorList);
10340
10340
  this.fontLoader.bind(o).catch(() => t.sendWithPromise("FontFallback", {
10341
10341
  id: s
10342
10342
  })).finally(() => {
@@ -10571,7 +10571,7 @@ class Br {
10571
10571
  return t.form || t.canvas && e?.size > 0;
10572
10572
  }
10573
10573
  }
10574
- class ne {
10574
+ class re {
10575
10575
  #t = null;
10576
10576
  static #e = /* @__PURE__ */ new WeakSet();
10577
10577
  constructor({
@@ -10603,9 +10603,9 @@ class ne {
10603
10603
  if (this.cancelled)
10604
10604
  return;
10605
10605
  if (this._canvas) {
10606
- if (ne.#e.has(this._canvas))
10606
+ if (re.#e.has(this._canvas))
10607
10607
  throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
10608
- ne.#e.add(this._canvas);
10608
+ re.#e.add(this._canvas);
10609
10609
  }
10610
10610
  this._pdfBug && globalThis.StepperManager?.enabled && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
10611
10611
  const {
@@ -10617,7 +10617,7 @@ class ne {
10617
10617
  alpha: !1,
10618
10618
  willReadFrequently: !this._enableHWA
10619
10619
  });
10620
- this.gfx = new oe(a, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
10620
+ this.gfx = new he(a, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
10621
10621
  optionalContentConfig: e
10622
10622
  }, this.annotationCanvasMap, this.pageColors, r), this.gfx.beginDrawing({
10623
10623
  transform: i,
@@ -10627,7 +10627,7 @@ class ne {
10627
10627
  }), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
10628
10628
  }
10629
10629
  cancel(t = null, e = 0) {
10630
- this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null), ne.#e.delete(this._canvas), t ||= new Rs(`Rendering cancelled, page ${this._pageIndex + 1}`, e), this.callback(t), this.task.onError?.(t);
10630
+ this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null), re.#e.delete(this._canvas), t ||= new Rs(`Rendering cancelled, page ${this._pageIndex + 1}`, e), this.callback(t), this.task.onError?.(t);
10631
10631
  }
10632
10632
  operatorListChanged() {
10633
10633
  if (!this.graphicsReady) {
@@ -10645,7 +10645,7 @@ class ne {
10645
10645
  }) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
10646
10646
  }
10647
10647
  async _next() {
10648
- this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper, this._operationsFilter), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), ne.#e.delete(this._canvas), this.callback())));
10648
+ this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper, this._operationsFilter), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), re.#e.delete(this._canvas), this.callback())));
10649
10649
  }
10650
10650
  }
10651
10651
  const Xi = "5.4.530", Hr = "50cc4adac";
@@ -10905,7 +10905,7 @@ class $r {
10905
10905
  return this._createSVG(t);
10906
10906
  }
10907
10907
  _createSVG(t) {
10908
- G("Abstract method `_createSVG` called.");
10908
+ j("Abstract method `_createSVG` called.");
10909
10909
  }
10910
10910
  }
10911
10911
  class Ye extends $r {
@@ -10913,18 +10913,18 @@ class Ye extends $r {
10913
10913
  return document.createElementNS(Rt, t);
10914
10914
  }
10915
10915
  }
10916
- const zr = 9, qt = /* @__PURE__ */ new WeakSet(), Ur = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
10916
+ const zr = 9, Xt = /* @__PURE__ */ new WeakSet(), Ur = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
10917
10917
  class fs {
10918
10918
  static create(t) {
10919
10919
  switch (t.data.annotationType) {
10920
10920
  case it.LINK:
10921
10921
  return new zs(t);
10922
10922
  case it.TEXT:
10923
- return new jr(t);
10923
+ return new Gr(t);
10924
10924
  case it.WIDGET:
10925
10925
  switch (t.data.fieldType) {
10926
10926
  case "Tx":
10927
- return new Gr(t);
10927
+ return new jr(t);
10928
10928
  case "Btn":
10929
10929
  return t.data.radioButton ? new Yi(t) : t.data.checkBox ? new qr(t) : new Xr(t);
10930
10930
  case "Ch":
@@ -10932,7 +10932,7 @@ class fs {
10932
10932
  case "Sig":
10933
10933
  return new Wr(t);
10934
10934
  }
10935
- return new Yt(t);
10935
+ return new Kt(t);
10936
10936
  case it.POPUP:
10937
10937
  return new Ts(t);
10938
10938
  case it.FREETEXT:
@@ -11114,7 +11114,7 @@ class K {
11114
11114
  viewport: i
11115
11115
  }
11116
11116
  } = this, n = document.createElement("section");
11117
- n.setAttribute("data-annotation-id", e.id), !(this instanceof Yt) && !(this instanceof zs) && (n.tabIndex = 0);
11117
+ n.setAttribute("data-annotation-id", e.id), !(this instanceof Kt) && !(this instanceof zs) && (n.tabIndex = 0);
11118
11118
  const {
11119
11119
  style: r
11120
11120
  } = n;
@@ -11139,19 +11139,19 @@ class K {
11139
11139
  r.borderRadius = w;
11140
11140
  }
11141
11141
  switch (e.borderStyle.style) {
11142
- case Jt.SOLID:
11142
+ case Zt.SOLID:
11143
11143
  r.borderStyle = "solid";
11144
11144
  break;
11145
- case Jt.DASHED:
11145
+ case Zt.DASHED:
11146
11146
  r.borderStyle = "dashed";
11147
11147
  break;
11148
- case Jt.BEVELED:
11148
+ case Zt.BEVELED:
11149
11149
  I("Unimplemented border style: beveled");
11150
11150
  break;
11151
- case Jt.INSET:
11151
+ case Zt.INSET:
11152
11152
  I("Unimplemented border style: inset");
11153
11153
  break;
11154
- case Jt.UNDERLINE:
11154
+ case Zt.UNDERLINE:
11155
11155
  r.borderBottomStyle = "solid";
11156
11156
  break;
11157
11157
  }
@@ -11350,7 +11350,7 @@ class K {
11350
11350
  return this.#i;
11351
11351
  }
11352
11352
  render() {
11353
- G("Abstract method `AnnotationElement.render` called");
11353
+ j("Abstract method `AnnotationElement.render` called");
11354
11354
  }
11355
11355
  _getElementsByName(t, e = null) {
11356
11356
  const s = [];
@@ -11365,7 +11365,7 @@ class K {
11365
11365
  if (n === -1 || r === e)
11366
11366
  continue;
11367
11367
  const o = typeof a == "string" ? a : null, h = document.querySelector(`[data-element-id="${r}"]`);
11368
- if (h && !qt.has(h)) {
11368
+ if (h && !Xt.has(h)) {
11369
11369
  I(`_getElementsByName - element not allowed: ${r}`);
11370
11370
  continue;
11371
11371
  }
@@ -11381,7 +11381,7 @@ class K {
11381
11381
  const {
11382
11382
  exportValue: n
11383
11383
  } = i, r = i.getAttribute("data-element-id");
11384
- r !== e && qt.has(i) && s.push({
11384
+ r !== e && Xt.has(i) && s.push({
11385
11385
  id: r,
11386
11386
  exportValue: n,
11387
11387
  domElement: i
@@ -11575,7 +11575,7 @@ class zs extends K {
11575
11575
  }
11576
11576
  const u = document.querySelector(`[data-element-id="${d}"]`);
11577
11577
  if (u) {
11578
- if (!qt.has(u)) {
11578
+ if (!Xt.has(u)) {
11579
11579
  I(`_bindResetFormAction - element not allowed: ${d}`);
11580
11580
  continue;
11581
11581
  }
@@ -11593,7 +11593,7 @@ class zs extends K {
11593
11593
  };
11594
11594
  }
11595
11595
  }
11596
- class jr extends K {
11596
+ class Gr extends K {
11597
11597
  constructor(t) {
11598
11598
  super(t, {
11599
11599
  isRenderable: !0
@@ -11607,7 +11607,7 @@ class jr extends K {
11607
11607
  })), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container.append(t), this.container;
11608
11608
  }
11609
11609
  }
11610
- class Yt extends K {
11610
+ class Kt extends K {
11611
11611
  render() {
11612
11612
  return this.container;
11613
11613
  }
@@ -11678,7 +11678,7 @@ class Yt extends K {
11678
11678
  e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
11679
11679
  }
11680
11680
  }
11681
- class Gr extends Yt {
11681
+ class jr extends Kt {
11682
11682
  constructor(t) {
11683
11683
  const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
11684
11684
  super(t, {
@@ -11715,7 +11715,7 @@ class Gr extends Yt {
11715
11715
  commitKey: 1,
11716
11716
  focused: !1
11717
11717
  };
11718
- this.data.multiLine ? (s = document.createElement("textarea"), s.textContent = a ?? n, this.data.doNotScroll && (s.style.overflowY = "hidden")) : (s = document.createElement("input"), s.type = this.data.password ? "password" : "text", s.setAttribute("value", a ?? n), this.data.doNotScroll && (s.style.overflowX = "hidden")), this.data.hasOwnCanvas && (s.hidden = !0), qt.add(s), this.contentElement = s, s.setAttribute("data-element-id", e), s.disabled = this.data.readOnly, s.name = this.data.fieldName, s.tabIndex = 0;
11718
+ this.data.multiLine ? (s = document.createElement("textarea"), s.textContent = a ?? n, this.data.doNotScroll && (s.style.overflowY = "hidden")) : (s = document.createElement("input"), s.type = this.data.password ? "password" : "text", s.setAttribute("value", a ?? n), this.data.doNotScroll && (s.style.overflowX = "hidden")), this.data.hasOwnCanvas && (s.hidden = !0), Xt.add(s), this.contentElement = s, s.setAttribute("data-element-id", e), s.disabled = this.data.readOnly, s.name = this.data.fieldName, s.tabIndex = 0;
11719
11719
  const {
11720
11720
  datetimeFormat: h,
11721
11721
  datetimeType: l,
@@ -11908,14 +11908,14 @@ class Gr extends Yt {
11908
11908
  return this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
11909
11909
  }
11910
11910
  }
11911
- class Wr extends Yt {
11911
+ class Wr extends Kt {
11912
11912
  constructor(t) {
11913
11913
  super(t, {
11914
11914
  isRenderable: !!t.data.hasOwnCanvas
11915
11915
  });
11916
11916
  }
11917
11917
  }
11918
- class qr extends Yt {
11918
+ class qr extends Kt {
11919
11919
  constructor(t) {
11920
11920
  super(t, {
11921
11921
  isRenderable: t.renderForms
@@ -11930,7 +11930,7 @@ class qr extends Yt {
11930
11930
  value: i
11931
11931
  })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
11932
11932
  const n = document.createElement("input");
11933
- return qt.add(n), n.setAttribute("data-element-id", s), n.disabled = e.readOnly, this._setRequired(n, this.data.required), n.type = "checkbox", n.name = e.fieldName, i && n.setAttribute("checked", !0), n.setAttribute("exportValue", e.exportValue), n.tabIndex = 0, n.addEventListener("change", (r) => {
11933
+ return Xt.add(n), n.setAttribute("data-element-id", s), n.disabled = e.readOnly, this._setRequired(n, this.data.required), n.type = "checkbox", n.name = e.fieldName, i && n.setAttribute("checked", !0), n.setAttribute("exportValue", e.exportValue), n.tabIndex = 0, n.addEventListener("change", (r) => {
11934
11934
  const {
11935
11935
  name: a,
11936
11936
  checked: o
@@ -11959,7 +11959,7 @@ class qr extends Yt {
11959
11959
  }), this._setEventListeners(n, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (r) => r.target.checked)), this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
11960
11960
  }
11961
11961
  }
11962
- class Yi extends Yt {
11962
+ class Yi extends Kt {
11963
11963
  constructor(t) {
11964
11964
  super(t, {
11965
11965
  isRenderable: t.renderForms
@@ -11979,7 +11979,7 @@ class Yi extends Yt {
11979
11979
  value: !1
11980
11980
  });
11981
11981
  const n = document.createElement("input");
11982
- if (qt.add(n), n.setAttribute("data-element-id", s), n.disabled = e.readOnly, this._setRequired(n, this.data.required), n.type = "radio", n.name = e.fieldName, i && n.setAttribute("checked", !0), n.tabIndex = 0, n.addEventListener("change", (r) => {
11982
+ if (Xt.add(n), n.setAttribute("data-element-id", s), n.disabled = e.readOnly, this._setRequired(n, this.data.required), n.type = "radio", n.name = e.fieldName, i && n.setAttribute("checked", !0), n.tabIndex = 0, n.addEventListener("change", (r) => {
11983
11983
  const {
11984
11984
  name: a,
11985
11985
  checked: o
@@ -12029,7 +12029,7 @@ class Xr extends zs {
12029
12029
  })), t;
12030
12030
  }
12031
12031
  }
12032
- class Yr extends Yt {
12032
+ class Yr extends Kt {
12033
12033
  constructor(t) {
12034
12034
  super(t, {
12035
12035
  isRenderable: t.renderForms
@@ -12040,7 +12040,7 @@ class Yr extends Yt {
12040
12040
  const t = this.annotationStorage, e = this.data.id, s = t.getValue(e, {
12041
12041
  value: this.data.fieldValue
12042
12042
  }), i = document.createElement("select");
12043
- qt.add(i), i.setAttribute("data-element-id", e), i.disabled = this.data.readOnly, this._setRequired(i, this.data.required), i.name = this.data.fieldName, i.tabIndex = 0;
12043
+ Xt.add(i), i.setAttribute("data-element-id", e), i.disabled = this.data.readOnly, this._setRequired(i, this.data.required), i.name = this.data.fieldName, i.tabIndex = 0;
12044
12044
  let n = this.data.combo && this.data.options.length > 0;
12045
12045
  this.data.combo || (i.size = this.data.options.length, this.data.multiSelect && (i.multiple = !0)), i.addEventListener("resetform", (l) => {
12046
12046
  const d = this.data.defaultFieldValue;
@@ -12208,12 +12208,12 @@ class Ts extends K {
12208
12208
  const e = this.popup = this.#t(), s = [];
12209
12209
  for (const i of this.elements)
12210
12210
  i.popup = e, i.container.ariaHasPopup = "dialog", s.push(i.data.id), i.addHighlightArea();
12211
- return this.container.setAttribute("aria-controls", s.map((i) => `${ee}${i}`).join(",")), this.container;
12211
+ return this.container.setAttribute("aria-controls", s.map((i) => `${se}${i}`).join(",")), this.container;
12212
12212
  }
12213
12213
  }
12214
12214
  class Kr {
12215
12215
  #t = null;
12216
- #e = this.#j.bind(this);
12216
+ #e = this.#G.bind(this);
12217
12217
  #i = this.#H.bind(this);
12218
12218
  #s = this.#I.bind(this);
12219
12219
  #a = this.#x.bind(this);
@@ -12493,7 +12493,7 @@ class Kr {
12493
12493
  });
12494
12494
  return s;
12495
12495
  }
12496
- #j(t) {
12496
+ #G(t) {
12497
12497
  t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && this.#p) && this.#x();
12498
12498
  }
12499
12499
  updateEdited({
@@ -12977,7 +12977,7 @@ class Vs {
12977
12977
  const {
12978
12978
  annotations: e
12979
12979
  } = t, s = this.div;
12980
- Gt(s, this.viewport);
12980
+ Wt(s, this.viewport);
12981
12981
  const i = /* @__PURE__ */ new Map(), n = [], r = {
12982
12982
  data: null,
12983
12983
  layer: s,
@@ -13028,7 +13028,7 @@ class Vs {
13028
13028
  if (!h.isRenderable)
13029
13029
  continue;
13030
13030
  const l = h.render();
13031
- h.contentElement.id = `${ee}${a.id}`, a.hidden && (l.style.visibility = "hidden"), o.at(-1).container.after(l);
13031
+ h.contentElement.id = `${se}${a.id}`, a.hidden && (l.style.visibility = "hidden"), o.at(-1).container.after(l);
13032
13032
  }
13033
13033
  this.#h();
13034
13034
  }
@@ -13045,7 +13045,7 @@ class Vs {
13045
13045
  id: i
13046
13046
  }
13047
13047
  } of this.#n) {
13048
- const n = s.id = `${ee}${i}`;
13048
+ const n = s.id = `${se}${i}`;
13049
13049
  t.push(this.#a?.getAriaAttributes(n).then((r) => {
13050
13050
  if (r)
13051
13051
  for (const [a, o] of r)
@@ -13092,7 +13092,7 @@ class Vs {
13092
13092
  for (const s of t) {
13093
13093
  s.borderStyle ||= Vs._defaultBorderStyle, e.data = s;
13094
13094
  const i = fs.create(e);
13095
- i.isRenderable && (i.render(), i.contentElement.id = `${ee}${s.id}`, this.#n.push(i));
13095
+ i.isRenderable && (i.render(), i.contentElement.id = `${se}${s.id}`, this.#n.push(i));
13096
13096
  }
13097
13097
  await this.#l();
13098
13098
  }
@@ -13100,7 +13100,7 @@ class Vs {
13100
13100
  viewport: t
13101
13101
  }) {
13102
13102
  const e = this.div;
13103
- this.viewport = t, Gt(e, {
13103
+ this.viewport = t, Wt(e, {
13104
13104
  rotation: t.rotation
13105
13105
  }), this.#h(), e.hidden = !1;
13106
13106
  }
@@ -13147,7 +13147,7 @@ class Vs {
13147
13147
  linkService: this.#r,
13148
13148
  annotationStorage: this.#i
13149
13149
  });
13150
- return n.render(), n.contentElement.id = `${ee}${s}`, n.createOrUpdatePopup(), this.#n.push(n), n;
13150
+ return n.render(), n.contentElement.id = `${se}${s}`, n.createOrUpdatePopup(), this.#n.push(n), n;
13151
13151
  }
13152
13152
  removeAnnotation(t) {
13153
13153
  const e = this.#n.findIndex((i) => i.data.id === t);
@@ -13170,7 +13170,7 @@ class Vs {
13170
13170
  return L(this, "_defaultBorderStyle", Object.freeze({
13171
13171
  width: 1,
13172
13172
  rawWidth: 1,
13173
- style: Jt.SOLID,
13173
+ style: Zt.SOLID,
13174
13174
  dashArray: [3],
13175
13175
  horizontalCornerRadius: 0,
13176
13176
  verticalCornerRadius: 0
@@ -13639,13 +13639,13 @@ class ht extends D {
13639
13639
  class M {
13640
13640
  static PRECISION = 1e-4;
13641
13641
  toSVGPath() {
13642
- G("Abstract method `toSVGPath` must be implemented.");
13642
+ j("Abstract method `toSVGPath` must be implemented.");
13643
13643
  }
13644
13644
  get box() {
13645
- G("Abstract getter `box` must be implemented.");
13645
+ j("Abstract getter `box` must be implemented.");
13646
13646
  }
13647
13647
  serialize(t, e) {
13648
- G("Abstract method `serialize` must be implemented.");
13648
+ j("Abstract method `serialize` must be implemented.");
13649
13649
  }
13650
13650
  static _rescale(t, e, s, i, n, r) {
13651
13651
  r ||= new Float32Array(t.length);
@@ -14735,7 +14735,7 @@ class en {
14735
14735
  this.updateProperties(t);
14736
14736
  }
14737
14737
  clone() {
14738
- G("Not implemented");
14738
+ j("Not implemented");
14739
14739
  }
14740
14740
  }
14741
14741
  class $ extends D {
@@ -14778,10 +14778,10 @@ class $ extends D {
14778
14778
  return t;
14779
14779
  }
14780
14780
  static getDefaultDrawingOptions(t) {
14781
- G("Not implemented");
14781
+ j("Not implemented");
14782
14782
  }
14783
14783
  static get typesMap() {
14784
- G("Not implemented");
14784
+ j("Not implemented");
14785
14785
  }
14786
14786
  static get isDrawer() {
14787
14787
  return !0;
@@ -15006,7 +15006,7 @@ class $ extends D {
15006
15006
  return s.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", this.setDims(), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(t, e), s;
15007
15007
  }
15008
15008
  static createDrawerInstance(t, e, s, i, n) {
15009
- G("Not implemented");
15009
+ j("Not implemented");
15010
15010
  }
15011
15011
  static startDrawing(t, e, s, i) {
15012
15012
  const {
@@ -15119,7 +15119,7 @@ class $ extends D {
15119
15119
  createDrawingOptions(t) {
15120
15120
  }
15121
15121
  static deserializeDraw(t, e, s, i, n, r) {
15122
- G("Not implemented");
15122
+ j("Not implemented");
15123
15123
  }
15124
15124
  static async deserialize(t, e, s) {
15125
15125
  const {
@@ -15611,7 +15611,7 @@ class ss extends en {
15611
15611
  return t.updateAll(this), t;
15612
15612
  }
15613
15613
  }
15614
- class js extends $ {
15614
+ class Gs extends $ {
15615
15615
  static _type = "ink";
15616
15616
  static _editorType = F.INK;
15617
15617
  static _defaultDrawingOptions = null;
@@ -15723,7 +15723,7 @@ class js extends $ {
15723
15723
  thickness: e,
15724
15724
  opacity: s
15725
15725
  }) {
15726
- this._drawingOptions = js.getDefaultDrawingOptions({
15726
+ this._drawingOptions = Gs.getDefaultDrawingOptions({
15727
15727
  stroke: T.makeHexColor(...t),
15728
15728
  "stroke-width": e,
15729
15729
  "stroke-opacity": s
@@ -15784,8 +15784,8 @@ class ks extends Le {
15784
15784
  return t.endsWith("Z") || (t += "Z"), t;
15785
15785
  }
15786
15786
  }
15787
- const je = 8, ye = 3;
15788
- class te {
15787
+ const Ge = 8, ye = 3;
15788
+ class ee {
15789
15789
  static #t = {
15790
15790
  maxDim: 512,
15791
15791
  sigmaSFactor: 0.02,
@@ -16102,7 +16102,7 @@ class te {
16102
16102
  }
16103
16103
  let h;
16104
16104
  r >= -128 && a <= 127 ? h = Int8Array : r >= -32768 && a <= 32767 ? h = Int16Array : h = Int32Array;
16105
- const l = t.length, d = je + ye * l, u = new Uint32Array(d);
16105
+ const l = t.length, d = Ge + ye * l, u = new Uint32Array(d);
16106
16106
  let p = 0;
16107
16107
  u[p++] = d * Uint32Array.BYTES_PER_ELEMENT + (o - 2 * l) * h.BYTES_PER_ELEMENT, u[p++] = 0, u[p++] = i, u[p++] = n, u[p++] = e ? 0 : 1, u[p++] = Math.max(0, Math.floor(s ?? 0)), u[p++] = l, u[p++] = h.BYTES_PER_ELEMENT;
16108
16108
  for (const y of t)
@@ -16136,7 +16136,7 @@ class te {
16136
16136
  const o = new Uint32Array(r.buffer, 0, r.length >> 2), h = o[1];
16137
16137
  if (h !== 0)
16138
16138
  throw new Error(`Invalid version: ${h}`);
16139
- const l = o[2], d = o[3], u = o[4] === 0, p = o[5], f = o[6], g = o[7], b = [], m = (je + ye * f) * Uint32Array.BYTES_PER_ELEMENT;
16139
+ const l = o[2], d = o[3], u = o[4] === 0, p = o[5], f = o[6], g = o[7], b = [], m = (Ge + ye * f) * Uint32Array.BYTES_PER_ELEMENT;
16140
16140
  let w;
16141
16141
  switch (g) {
16142
16142
  case Int8Array.BYTES_PER_ELEMENT:
@@ -16151,10 +16151,10 @@ class te {
16151
16151
  }
16152
16152
  a = 0;
16153
16153
  for (let y = 0; y < f; y++) {
16154
- const v = o[ye * y + je], A = new Float32Array(v + 2);
16154
+ const v = o[ye * y + Ge], A = new Float32Array(v + 2);
16155
16155
  b.push(A);
16156
16156
  for (let x = 0; x < ye - 1; x++)
16157
- A[x] = o[ye * y + je + x + 1];
16157
+ A[x] = o[ye * y + Ge + x + 1];
16158
16158
  for (let x = 0; x < v; x++)
16159
16159
  A[x + 2] = A[x] + w[a++];
16160
16160
  }
@@ -16170,7 +16170,7 @@ class te {
16170
16170
  }
16171
16171
  }
16172
16172
  }
16173
- class Gs extends en {
16173
+ class js extends en {
16174
16174
  constructor() {
16175
16175
  super(), super.updateProperties({
16176
16176
  fill: D._defaultLineColor,
@@ -16178,7 +16178,7 @@ class Gs extends en {
16178
16178
  });
16179
16179
  }
16180
16180
  clone() {
16181
- const t = new Gs();
16181
+ const t = new js();
16182
16182
  return t.updateAll(this), t;
16183
16183
  }
16184
16184
  }
@@ -16210,7 +16210,7 @@ class Tt extends $ {
16210
16210
  }), this._willKeepAspectRatio = !0, this.#i = t.signatureData || null, this.#e = null, this.defaultL10nId = "pdfjs-editor-signature-editor1";
16211
16211
  }
16212
16212
  static initialize(t, e) {
16213
- D.initialize(t, e), this._defaultDrawingOptions = new Gs(), this._defaultDrawnSignatureOptions = new Ws(e.viewParameters);
16213
+ D.initialize(t, e), this._defaultDrawingOptions = new js(), this._defaultDrawnSignatureOptions = new Ws(e.viewParameters);
16214
16214
  }
16215
16215
  static getDefaultDrawingOptions(t) {
16216
16216
  const e = this._defaultDrawingOptions.clone();
@@ -16266,7 +16266,7 @@ class Tt extends $ {
16266
16266
  pageHeight: d
16267
16267
  },
16268
16268
  rotation: u
16269
- } = this.parent.viewport, p = te.processDrawnLines({
16269
+ } = this.parent.viewport, p = ee.processDrawnLines({
16270
16270
  lines: i,
16271
16271
  pageWidth: l,
16272
16272
  pageHeight: d,
@@ -16309,7 +16309,7 @@ class Tt extends $ {
16309
16309
  thickness: s,
16310
16310
  width: i,
16311
16311
  height: n
16312
- } = this.#i, r = Math.max(i, n), a = te.processDrawnLines({
16312
+ } = this.#i, r = Math.max(i, n), a = ee.processDrawnLines({
16313
16313
  lines: {
16314
16314
  curves: t.map((o) => ({
16315
16315
  points: o
@@ -16366,7 +16366,7 @@ class Tt extends $ {
16366
16366
  },
16367
16367
  rotation: i
16368
16368
  } = this.parent.viewport;
16369
- return te.process(t, e, s, i, Tt._INNER_MARGIN);
16369
+ return ee.process(t, e, s, i, Tt._INNER_MARGIN);
16370
16370
  }
16371
16371
  getFromText(t, e) {
16372
16372
  const {
@@ -16376,7 +16376,7 @@ class Tt extends $ {
16376
16376
  },
16377
16377
  rotation: n
16378
16378
  } = this.parent.viewport;
16379
- return te.extractContoursFromText(t, e, s, i, n, Tt._INNER_MARGIN);
16379
+ return ee.extractContoursFromText(t, e, s, i, n, Tt._INNER_MARGIN);
16380
16380
  }
16381
16381
  getDrawnSignature(t) {
16382
16382
  const {
@@ -16386,7 +16386,7 @@ class Tt extends $ {
16386
16386
  },
16387
16387
  rotation: i
16388
16388
  } = this.parent.viewport;
16389
- return te.processDrawnLines({
16389
+ return ee.processDrawnLines({
16390
16390
  lines: t,
16391
16391
  pageWidth: e,
16392
16392
  pageHeight: s,
@@ -16749,7 +16749,7 @@ class la extends D {
16749
16749
  } = this.#t, e.getContext("2d").drawImage(this.#t, 0, 0), e.toDataURL();
16750
16750
  }
16751
16751
  if (this.#h) {
16752
- const [e, s] = this.pageDimensions, i = Math.round(this.width * e * le.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * le.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
16752
+ const [e, s] = this.pageDimensions, i = Math.round(this.width * e * ce.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * ce.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
16753
16753
  return r.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, i, n), r.transferToImageBitmap();
16754
16754
  }
16755
16755
  return structuredClone(this.#t);
@@ -16782,7 +16782,7 @@ class la extends D {
16782
16782
  id: C,
16783
16783
  bitmap: H
16784
16784
  } = s.imageManager.getFromCanvas(S.id, P), P.remove()) : (n = !0, t._hasNoCanvas = !0);
16785
- const V = (await e._structTree.getAriaAttributes(`${ee}${m}`))?.get("aria-label") || "";
16785
+ const V = (await e._structTree.getAriaAttributes(`${se}${m}`))?.get("aria-label") || "";
16786
16786
  i = t = {
16787
16787
  annotationType: F.STAMP,
16788
16788
  bitmapId: C,
@@ -16892,7 +16892,7 @@ class Lt {
16892
16892
  #f = -1;
16893
16893
  #c;
16894
16894
  static _initialized = !1;
16895
- static #g = new Map([ht, js, la, J, Tt].map((t) => [t._editorType, t]));
16895
+ static #g = new Map([ht, Gs, la, J, Tt].map((t) => [t._editorType, t]));
16896
16896
  constructor({
16897
16897
  uiManager: t,
16898
16898
  pageIndex: e,
@@ -17352,7 +17352,7 @@ class Lt {
17352
17352
  render({
17353
17353
  viewport: t
17354
17354
  }) {
17355
- this.viewport = t, Gt(this.div, t);
17355
+ this.viewport = t, Wt(this.div, t);
17356
17356
  for (const e of this.#c.getEditors(this.pageIndex))
17357
17357
  this.add(e), e.rebuild();
17358
17358
  this.updateMode();
@@ -17362,7 +17362,7 @@ class Lt {
17362
17362
  }) {
17363
17363
  this.#c.commitOrRemove(), this.#A();
17364
17364
  const e = this.viewport.rotation, s = t.rotation;
17365
- if (this.viewport = t, Gt(this.div, {
17365
+ if (this.viewport = t, Wt(this.div, {
17366
17366
  rotation: s
17367
17367
  }), e !== s)
17368
17368
  for (const i of this.#r.values())
@@ -17524,35 +17524,35 @@ globalThis.pdfjsLib = {
17524
17524
  FeatureTest: at,
17525
17525
  fetchData: Pe,
17526
17526
  findContrastColor: In,
17527
- getDocument: ji,
17527
+ getDocument: Gi,
17528
17528
  getFilenameFromUrl: En,
17529
17529
  getPdfFilenameFromUrl: Cn,
17530
17530
  getRGB: De,
17531
17531
  getUuid: Si,
17532
17532
  getXfaPageViewport: Mn,
17533
- GlobalWorkerOptions: Wt,
17534
- ImageKind: Ge,
17533
+ GlobalWorkerOptions: qt,
17534
+ ImageKind: je,
17535
17535
  InvalidPDFException: ys,
17536
17536
  isDataScheme: Ze,
17537
17537
  isPdfFile: Is,
17538
- isValidExplicitDest: jn,
17538
+ isValidExplicitDest: Gn,
17539
17539
  MathClamp: ut,
17540
17540
  noContextMenu: _t,
17541
17541
  normalizeUnicode: xn,
17542
17542
  OPS: Ee,
17543
17543
  OutputScale: kt,
17544
17544
  PasswordResponses: pn,
17545
- PDFDataRangeTransport: Gi,
17545
+ PDFDataRangeTransport: ji,
17546
17546
  PDFDateString: ws,
17547
17547
  PDFWorker: Cs,
17548
17548
  PermissionFlag: un,
17549
- PixelsPerInch: le,
17549
+ PixelsPerInch: ce,
17550
17550
  RenderingCancelledException: Rs,
17551
17551
  renderRichText: Ti,
17552
17552
  ResponseException: We,
17553
- setLayerDimensions: Gt,
17553
+ setLayerDimensions: Wt,
17554
17554
  shadow: L,
17555
- SignatureExtractor: te,
17555
+ SignatureExtractor: ee,
17556
17556
  stopEvent: Q,
17557
17557
  SupportedImageMimeTypes: vs,
17558
17558
  TextLayer: yt,
@@ -17566,11 +17566,11 @@ globalThis.pdfjsLib = {
17566
17566
  class ca {
17567
17567
  document = null;
17568
17568
  constructor(t = {}) {
17569
- t.workerSrc ? Wt.workerSrc = t.workerSrc : Wt.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Xi}/pdf.worker.min.mjs`;
17569
+ t.workerSrc ? qt.workerSrc = t.workerSrc : qt.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Xi}/pdf.worker.min.mjs`;
17570
17570
  }
17571
17571
  async loadDocument(t) {
17572
17572
  try {
17573
- const e = ji(t);
17573
+ const e = Gi(t);
17574
17574
  return this.document = await e.promise, this.document;
17575
17575
  } catch (e) {
17576
17576
  throw console.error("Error loading PDF document:", e), e;
@@ -18296,6 +18296,29 @@ class ya {
18296
18296
  getScale() {
18297
18297
  return this.currentScale;
18298
18298
  }
18299
+ /**
18300
+ * Get dimensions of a specific page in PDF points
18301
+ * @param pageIndex - Zero-based page index
18302
+ * @returns Page dimensions { width: number, height: number } or null if page doesn't exist
18303
+ */
18304
+ async getPageDimensions(t) {
18305
+ if (!this.pdfDocument)
18306
+ throw new Error("PDF not loaded");
18307
+ if (t < 0 || t >= this.pdfDocument.numPages)
18308
+ return null;
18309
+ const e = this.pageInfo.get(t);
18310
+ if (e)
18311
+ return { width: e.width, height: e.height };
18312
+ try {
18313
+ const s = (await this.pdfDocument.getPage(t + 1)).getViewport({ scale: 1 }), i = {
18314
+ width: s.width,
18315
+ height: s.height
18316
+ };
18317
+ return this.pageInfo.set(t, i), i;
18318
+ } catch (s) {
18319
+ return console.error(`Failed to get dimensions for page ${t}:`, s), null;
18320
+ }
18321
+ }
18299
18322
  // Field Management
18300
18323
  fields = [];
18301
18324
  setFields(t) {
@@ -18376,6 +18399,104 @@ class ya {
18376
18399
  off(t, e) {
18377
18400
  this.eventBus.off(t, e);
18378
18401
  }
18402
+ async print(t) {
18403
+ if (!this.pdfDocument) return;
18404
+ const e = document.createElement("iframe");
18405
+ e.style.position = "fixed", e.style.top = "0", e.style.left = "-10000px", e.style.width = "0", e.style.height = "0", e.style.border = "none", e.style.visibility = "hidden", document.body.appendChild(e);
18406
+ const s = e.contentWindow?.document;
18407
+ if (!s)
18408
+ throw document.body.removeChild(e), new Error("Could not create print iframe");
18409
+ Array.from(document.styleSheets).forEach((r) => {
18410
+ try {
18411
+ if (r.href) {
18412
+ const a = document.createElement("link");
18413
+ a.rel = "stylesheet", a.href = r.href, s.head.appendChild(a);
18414
+ } else if (r.cssRules) {
18415
+ const a = document.createElement("style");
18416
+ Array.from(r.cssRules).forEach((o) => {
18417
+ a.appendChild(document.createTextNode(o.cssText));
18418
+ }), s.head.appendChild(a);
18419
+ }
18420
+ } catch (a) {
18421
+ console.warn("Could not copy stylesheet", a);
18422
+ }
18423
+ });
18424
+ const i = document.createElement("style");
18425
+ i.textContent = `
18426
+ @page { margin: 0; size: auto; }
18427
+ html, body {
18428
+ margin: 0 !important;
18429
+ padding: 0 !important;
18430
+ height: auto !important;
18431
+ overflow: visible !important;
18432
+ background-color: white !important;
18433
+ }
18434
+ /* Hide scrollbars */
18435
+ ::-webkit-scrollbar { display: none; }
18436
+ * { -ms-overflow-style: none; scrollbar-width: none; }
18437
+
18438
+ .print-page {
18439
+ position: relative;
18440
+ page-break-after: always;
18441
+ width: 100%;
18442
+ overflow: hidden;
18443
+ margin: 0;
18444
+ padding: 0;
18445
+ }
18446
+ .print-page img {
18447
+ display: block;
18448
+ width: 100%;
18449
+ height: auto;
18450
+ }
18451
+ .print-field {
18452
+ position: absolute;
18453
+ border: 1px solid transparent;
18454
+ }
18455
+ /* Hide UI controls in print */
18456
+ .sc-resize-handle, .sc-delete-btn { display: none !important; }
18457
+ `, s.head.appendChild(i);
18458
+ const n = document.createElement("div");
18459
+ s.body.appendChild(n);
18460
+ try {
18461
+ const r = this.pdfDocument.numPages;
18462
+ for (let a = 1; a <= r; a++) {
18463
+ const o = await this.pdfDocument.getPage(a), h = o.getViewport({ scale: 2 }), l = document.createElement("canvas"), d = l.getContext("2d");
18464
+ if (!d) continue;
18465
+ l.width = h.width, l.height = h.height, await o.render({
18466
+ canvasContext: d,
18467
+ viewport: h
18468
+ }).promise;
18469
+ const u = document.createElement("div");
18470
+ u.className = "print-page";
18471
+ const p = document.createElement("img");
18472
+ p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageIndex === a - 1).forEach((f) => {
18473
+ const g = document.createElement("div");
18474
+ g.className = "print-field select-none";
18475
+ const b = o.getViewport({ scale: 1 }), m = f.rect.x / b.width * 100, w = (b.height - f.rect.y - f.rect.height) / b.height * 100, y = f.rect.width / b.width * 100, v = f.rect.height / b.height * 100;
18476
+ if (g.style.left = `${m}%`, g.style.top = `${w}%`, g.style.width = `${y}%`, g.style.height = `${v}%`, g.style.display = "flex", g.style.alignItems = "center", g.style.justifyContent = "center", g.style.overflow = "hidden", f.style && Object.assign(g.style, f.style), f.type === "text")
18477
+ g.textContent = f.content || "", g.style.fontFamily = "sans-serif", g.style.fontSize = "2cqw", g.style.whiteSpace = "pre-wrap", g.style.textAlign = "center";
18478
+ else if (f.type === "image") {
18479
+ const A = document.createElement("img");
18480
+ A.src = f.content || "", A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", g.appendChild(A);
18481
+ } else if (f.type === "signature") {
18482
+ g.innerHTML = f.content || "";
18483
+ const A = g.querySelector("img");
18484
+ A && (A.style.width = "100%", A.style.height = "100%");
18485
+ const x = g.querySelector("svg");
18486
+ x && (x.style.width = "100%", x.style.height = "100%");
18487
+ }
18488
+ u.appendChild(g);
18489
+ }), n.appendChild(u);
18490
+ }
18491
+ await new Promise((a) => setTimeout(a, 500)), e.contentWindow?.focus(), e.contentWindow?.print();
18492
+ } catch (r) {
18493
+ throw console.error("Print failed", r), r;
18494
+ } finally {
18495
+ setTimeout(() => {
18496
+ document.body.contains(e) && document.body.removeChild(e);
18497
+ }, 3e5);
18498
+ }
18499
+ }
18379
18500
  destroy() {
18380
18501
  this.isDestroyed = !0, this.zoomHandler.destroy(), this.strategy?.destroy(), this.loader.destroy(), this.eventBus.clear(), this.container.innerHTML = "";
18381
18502
  }
@@ -18418,6 +18539,9 @@ class wa {
18418
18539
  getScale() {
18419
18540
  return this.viewer.getScale();
18420
18541
  }
18542
+ async getPageDimensions(t) {
18543
+ return this.viewer.getPageDimensions(t);
18544
+ }
18421
18545
  // Event handling
18422
18546
  on(t, e) {
18423
18547
  this.viewer.on(t, e);
@@ -18441,6 +18565,9 @@ class wa {
18441
18565
  updateField(t, e) {
18442
18566
  this.viewer.updateField(t, e);
18443
18567
  }
18568
+ async print(t) {
18569
+ return this.viewer.print(t);
18570
+ }
18444
18571
  destroy() {
18445
18572
  this.viewer.destroy();
18446
18573
  }
@@ -18462,12 +18589,26 @@ const xa = on((c, t) => {
18462
18589
  setViewMode: async (n) => {
18463
18590
  s.current && await s.current.setViewMode(n);
18464
18591
  },
18465
- getViewMode: () => s.current?.getViewMode() ?? "scroll"
18592
+ getViewMode: () => s.current?.getViewMode() ?? "scroll",
18593
+ print: async (n) => {
18594
+ s.current && await s.current.print(n);
18595
+ },
18596
+ getPageDimensions: async (n) => s.current ? await s.current.getPageDimensions(n) : null,
18597
+ addField: async (n) => {
18598
+ s.current && await s.current.addField(n);
18599
+ },
18600
+ removeField: (n) => {
18601
+ s.current?.removeField(n);
18602
+ },
18603
+ updateField: (n, r) => {
18604
+ s.current?.updateField(n, r);
18605
+ },
18606
+ getFields: () => s.current?.getFields() ?? []
18466
18607
  }));
18467
18608
  const i = rs(c);
18468
- return ue(() => {
18609
+ return Vt(() => {
18469
18610
  i.current = c;
18470
- }), ue(() => {
18611
+ }), Vt(() => {
18471
18612
  if (!(!e.current || s.current))
18472
18613
  return s.current = new wa({
18473
18614
  container: e.current,
@@ -18481,11 +18622,18 @@ const xa = on((c, t) => {
18481
18622
  }), s.current.on("field:add", (n) => i.current.onFieldAdd?.(n)), s.current.on("field:remove", (n) => i.current.onFieldRemove?.(n)), s.current.on("field:update", (n) => i.current.onFieldUpdate?.(n)), s.current.on("fields:change", (n) => i.current.onFieldsChange?.(n)), c.onReady && c.onReady(s.current), () => {
18482
18623
  s.current?.destroy(), s.current = null;
18483
18624
  };
18484
- }, []), ue(() => {
18625
+ }, []), Vt(() => {
18485
18626
  s.current && c.src && s.current.load(c.src).then(() => c.onLoad?.()).catch((n) => c.onError?.(n));
18486
- }, [c.src]), ue(() => {
18627
+ }, [c.src]), Vt(() => {
18628
+ s.current && c.page !== void 0 && s.current.getCurrentPage() !== c.page && s.current.goToPage(c.page);
18629
+ }, [c.page]), Vt(() => {
18487
18630
  s.current && c.viewMode && s.current.setViewMode(c.viewMode);
18488
- }, [c.viewMode]), ue(() => {
18631
+ }, [c.viewMode]), Vt(() => {
18632
+ if (s.current && c.scale !== void 0) {
18633
+ const n = s.current.getScale();
18634
+ Math.abs(n - c.scale) > 1e-3 && s.current.setScale(c.scale);
18635
+ }
18636
+ }, [c.scale]), Vt(() => {
18489
18637
  if (s.current && c.fields) {
18490
18638
  const n = s.current.getFields();
18491
18639
  if (JSON.stringify(n) === JSON.stringify(c.fields))