@component-hook/pdf-canvas 1.3.0-alpha.0 → 1.3.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,7 +132,7 @@ const q = new class extends Po {
132
132
  const t = new Po(), e = a?.reduce(((s, i) => (s[i] = t[i], s)), {}) || t;
133
133
  this.configure(e);
134
134
  }
135
- }(), Re = function(a) {
135
+ }(), Le = function(a) {
136
136
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) e[s - 1] = arguments[s];
137
137
  return console[a]("fabric", ...e);
138
138
  };
@@ -156,7 +156,7 @@ void main(){}`), i = t.createShader(t.FRAGMENT_SHADER);
156
156
  }
157
157
  queryWebGL(t) {
158
158
  const e = t.getContext("webgl");
159
- e && (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.GLPrecision = ["highp", "mediump", "lowp"].find(((s) => this.testPrecision(e, s))), e.getExtension("WEBGL_lose_context").loseContext(), Re("log", "WebGL: max texture size ".concat(this.maxTextureSize)));
159
+ e && (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.GLPrecision = ["highp", "mediump", "lowp"].find(((s) => this.testPrecision(e, s))), e.getExtension("WEBGL_lose_context").loseContext(), Le("log", "WebGL: max texture size ".concat(this.maxTextureSize)));
160
160
  }
161
161
  isSupported(t) {
162
162
  return !!this.maxTextureSize && this.maxTextureSize >= t;
@@ -648,7 +648,7 @@ const Cn = function(a) {
648
648
  }));
649
649
  }, fs = function(a) {
650
650
  return (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []).reduce(((t, e) => (e in a && (t[e] = a[e]), t)), {});
651
- }, qr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}), Q = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map(((t) => Q(t, q.NUM_FRACTION_DIGITS))).join(" ") + ")", ee = (a) => !!a && a.toLive !== void 0, Do = (a) => !!a && typeof a.toObject == "function", Lo = (a) => !!a && a.offsetX !== void 0 && "source" in a, Ke = (a) => !!a && "multiSelectionStacking" in a;
651
+ }, qr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}), Q = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map(((t) => Q(t, q.NUM_FRACTION_DIGITS))).join(" ") + ")", ee = (a) => !!a && a.toLive !== void 0, Do = (a) => !!a && typeof a.toObject == "function", Ro = (a) => !!a && a.offsetX !== void 0 && "source" in a, Ke = (a) => !!a && "multiSelectionStacking" in a;
652
652
  function Qa(a) {
653
653
  const t = a && ae(a);
654
654
  let e = 0, s = 0;
@@ -668,7 +668,7 @@ const ae = (a) => a.ownerDocument || null, th = (a) => {
668
668
  let { width: e, height: s } = t;
669
669
  e && (a.style.width = typeof e == "number" ? "".concat(e, "px") : e), s && (a.style.height = typeof s == "number" ? "".concat(s, "px") : s);
670
670
  };
671
- function Ro(a) {
671
+ function Lo(a) {
672
672
  return a.onselectstart !== void 0 && (a.onselectstart = () => !1), a.style.userSelect = It, a;
673
673
  }
674
674
  class sh {
@@ -747,7 +747,7 @@ class pi extends Wa(Ua) {
747
747
  return t.length > 0 && this.renderOnAddRemove && this.requestRenderAll(), t;
748
748
  }
749
749
  _onObjectAdded(t) {
750
- t.canvas && t.canvas !== this && (Re("warn", `Canvas is trying to add an object that belongs to a different canvas.
750
+ t.canvas && t.canvas !== this && (Le("warn", `Canvas is trying to add an object that belongs to a different canvas.
751
751
  Resulting to default behavior: removing object from previous canvas and adding to new canvas`), t.canvas.remove(t)), t._set("canvas", this), t.setCoords(), this.fire("object:added", { target: t }), t.fire("added", { target: this });
752
752
  }
753
753
  _onObjectRemoved(t) {
@@ -1011,7 +1011,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1011
1011
  const s = this["".concat(e, "Color")];
1012
1012
  if (s) if (ee(s)) {
1013
1013
  const i = s.repeat || "", n = this.width, r = this.height, o = this["".concat(e, "Vpt")] ? Ds(Xt(this.viewportTransform)) : "";
1014
- t.push('<rect transform="'.concat(o, " translate(").concat(n / 2, ",").concat(r / 2, ')" x="').concat(s.offsetX - n / 2, '" y="').concat(s.offsetY - r / 2, '" width="').concat(i !== "repeat-y" && i !== "no-repeat" || !Lo(s) ? n : s.source.width, '" height="').concat(i !== "repeat-x" && i !== "no-repeat" || !Lo(s) ? r : s.source.height, '" fill="url(#SVGID_').concat(s.id, `)"></rect>
1014
+ t.push('<rect transform="'.concat(o, " translate(").concat(n / 2, ",").concat(r / 2, ')" x="').concat(s.offsetX - n / 2, '" y="').concat(s.offsetY - r / 2, '" width="').concat(i !== "repeat-y" && i !== "no-repeat" || !Ro(s) ? n : s.source.width, '" height="').concat(i !== "repeat-x" && i !== "no-repeat" || !Ro(s) ? r : s.source.height, '" fill="url(#SVGID_').concat(s.id, `)"></rect>
1015
1015
  `));
1016
1016
  } else t.push('<rect x="0" y="0" width="100%" height="100%" ', 'fill="', s, '"', `></rect>
1017
1017
  `);
@@ -1079,7 +1079,7 @@ const lc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1079
1079
  (o > s || !n) && (s = o), (o < t || !n) && (t = o), (h > i || !n) && (i = h), (h < e || !n) && (e = h);
1080
1080
  }
1081
1081
  return { left: t, top: e, width: s - t, height: i - e };
1082
- }, cc = ["translateX", "translateY", "scaleX", "scaleY"], nh = (a, t) => Ls(a, dt(t, a.calcOwnMatrix())), Ls = (a, t) => {
1082
+ }, cc = ["translateX", "translateY", "scaleX", "scaleY"], nh = (a, t) => Rs(a, dt(t, a.calcOwnMatrix())), Rs = (a, t) => {
1083
1083
  const e = as(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = st(e, cc), h = new C(s, i);
1084
1084
  a.flipX = !1, a.flipY = !1, Object.assign(a, o), a.set({ scaleX: n, scaleY: r }), a.setPositionByOrigin(h, X, X);
1085
1085
  }, rh = (a) => {
@@ -1098,7 +1098,7 @@ const lc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1098
1098
  return a.transform(mi(t, e), !0);
1099
1099
  }, yr = (a, t, e) => {
1100
1100
  const s = mi(t, e);
1101
- return Ls(a, dt(s, a.calcOwnMatrix())), s;
1101
+ return Rs(a, dt(s, a.calcOwnMatrix())), s;
1102
1102
  }, ah = (a, t) => {
1103
1103
  var e;
1104
1104
  const { transform: { target: s } } = t;
@@ -1265,7 +1265,7 @@ class Z {
1265
1265
  return e.includes("rad") ? Ce(s) : e.includes("turn") ? 360 * s : s;
1266
1266
  }
1267
1267
  }
1268
- const Lt = function(a) {
1268
+ const Rt = function(a) {
1269
1269
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zr;
1270
1270
  const e = /\D{0,2}$/.exec(a), s = parseFloat(a), i = q.DPI;
1271
1271
  switch (e?.[0]) {
@@ -1359,10 +1359,10 @@ const he = String.raw(zo || (zo = Ae(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["
1359
1359
  const s = As(t, e), i = As(t, a), n = As(e, a);
1360
1360
  return s >= 0 ? i >= 0 && n <= 0 : !(i <= 0 && n >= 0);
1361
1361
  }, Uo = "(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?", Yo = new RegExp("(?:\\s|^)" + Uo + Uo + "(" + he + "?(?:px)?)?(?:\\s?|$)(?:$|\\s)");
1362
- class Le {
1362
+ class Re {
1363
1363
  constructor(t) {
1364
- const e = typeof t == "string" ? Le.parseShadow(t) : t;
1365
- Object.assign(this, Le.ownDefaults, e), this.id = Xe();
1364
+ const e = typeof t == "string" ? Re.parseShadow(t) : t;
1365
+ Object.assign(this, Re.ownDefaults, e), this.id = Xe();
1366
1366
  }
1367
1367
  static parseShadow(t) {
1368
1368
  const e = t.trim(), [, s = 0, i = 0, n = 0] = (Yo.exec(e) || []).map(((r) => parseFloat(r) || 0));
@@ -1387,14 +1387,14 @@ class Le {
1387
1387
  `);
1388
1388
  }
1389
1389
  toObject() {
1390
- const t = { color: this.color, blur: this.blur, offsetX: this.offsetX, offsetY: this.offsetY, affectStroke: this.affectStroke, nonScaling: this.nonScaling, type: this.constructor.type }, e = Le.ownDefaults;
1390
+ const t = { color: this.color, blur: this.blur, offsetX: this.offsetX, offsetY: this.offsetY, affectStroke: this.affectStroke, nonScaling: this.nonScaling, type: this.constructor.type }, e = Re.ownDefaults;
1391
1391
  return this.includeDefaultValues ? t : qr(t, ((s, i) => s !== e[i]));
1392
1392
  }
1393
1393
  static async fromObject(t) {
1394
1394
  return new this(t);
1395
1395
  }
1396
1396
  }
1397
- x(Le, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Le, "type", "shadow"), F.setClass(Le, "shadow");
1397
+ x(Re, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Re, "type", "shadow"), F.setClass(Re, "shadow");
1398
1398
  const ls = (a, t, e) => Math.max(a, Math.min(t, e)), _c = [Wt, J, Ht, Kt, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Is, Ns], Ie = [vt, Nt, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], wc = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: J, originY: Wt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: vt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, Zn = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Fe * Math.asin(1) : e / Fe * Math.asin(t / a), { a, c: t, p: e, s }), $o = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Fe / e), yh = (a, t, e, s) => -e * Math.cos(a / s * Ve) + e + t, xr = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, qo = (a, t, e, s) => e - xr(s - a, 0, e, s) + t;
1399
1399
  var xc = Object.freeze({ __proto__: null, defaultEasing: yh, easeInBack: function(a, t, e, s) {
1400
1400
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1.70158;
@@ -1766,7 +1766,7 @@ class Oc extends Ua {
1766
1766
  return this.translateToOriginPoint(this.getRelativeCenterPoint(), J, Wt);
1767
1767
  }
1768
1768
  }
1769
- const Dc = ["type"], Lc = ["extraParam"];
1769
+ const Dc = ["type"], Rc = ["extraParam"];
1770
1770
  let Te = class Ki extends Oc {
1771
1771
  static getDefaults() {
1772
1772
  return Ki.ownDefaults;
@@ -1776,7 +1776,7 @@ let Te = class Ki extends Oc {
1776
1776
  return t === "FabricObject" ? "object" : t.toLowerCase();
1777
1777
  }
1778
1778
  set type(t) {
1779
- Re("warn", "Setting type has no effect", t);
1779
+ Le("warn", "Setting type has no effect", t);
1780
1780
  }
1781
1781
  constructor(t) {
1782
1782
  super(), x(this, "_cacheContext", null), Object.assign(this, Ki.ownDefaults), this.setOptions(t);
@@ -1833,7 +1833,7 @@ let Te = class Ki extends Oc {
1833
1833
  return Math.abs(t) < this.minScaleLimit ? t < 0 ? -this.minScaleLimit : this.minScaleLimit : t === 0 ? 1e-4 : t;
1834
1834
  }
1835
1835
  _set(t, e) {
1836
- t !== Ht && t !== Kt || (e = this._constrainScale(e)), t === Ht && e < 0 ? (this.flipX = !this.flipX, e *= -1) : t === "scaleY" && e < 0 ? (this.flipY = !this.flipY, e *= -1) : t !== "shadow" || !e || e instanceof Le || (e = new Le(e));
1836
+ t !== Ht && t !== Kt || (e = this._constrainScale(e)), t === Ht && e < 0 ? (this.flipX = !this.flipX, e *= -1) : t === "scaleY" && e < 0 ? (this.flipY = !this.flipY, e *= -1) : t !== "shadow" || !e || e instanceof Re || (e = new Re(e));
1837
1837
  const s = this[t] !== e;
1838
1838
  return this[t] = e, s && this.constructor.cacheProperties.includes(t) && (this.dirty = !0), this.parent && (this.dirty || s && this.constructor.stateProperties.includes(t)) && this.parent._set("dirty", !0), this;
1839
1839
  }
@@ -2081,9 +2081,9 @@ let Te = class Ki extends Oc {
2081
2081
  toObject() {
2082
2082
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(Ki.customProperties, this.constructor.customProperties || []);
2083
2083
  let e;
2084
- const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: P, opacity: N, visible: D, backgroundColor: R, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: M, skewY: L } = this;
2084
+ const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: P, opacity: N, visible: D, backgroundColor: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: M, skewY: R } = this;
2085
2085
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2086
- const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: P, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: R, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: G(M), skewY: G(L) }, e ? { clipPath: e } : null);
2086
+ const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: P, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: G(M), skewY: G(R) }, e ? { clipPath: e } : null);
2087
2087
  return this.includeDefaultValues ? it : this._removeDefaultValues(it);
2088
2088
  }
2089
2089
  toDatalessObject(t) {
@@ -2101,7 +2101,7 @@ let Te = class Ki extends Oc {
2101
2101
  return "#<".concat(this.constructor.type, ">");
2102
2102
  }
2103
2103
  static _fromObject(t) {
2104
- let e = st(t, Dc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = st(s, Lc);
2104
+ let e = st(t, Dc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = st(s, Rc);
2105
2105
  return gi(e, n).then(((r) => i ? (delete r[i], new this(e[i], r)) : new this(r)));
2106
2106
  }
2107
2107
  static fromObject(t, e) {
@@ -2127,7 +2127,7 @@ const Ko = Bs(oi, Hs(((a, t, e, s) => {
2127
2127
  }
2128
2128
  return !1;
2129
2129
  })));
2130
- function Rc(a, t, e, s, i) {
2130
+ function Lc(a, t, e, s, i) {
2131
2131
  s = s || {};
2132
2132
  const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Nt : vt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor);
2133
2133
  let c, u = t, d = e;
@@ -2179,7 +2179,7 @@ class ne {
2179
2179
  return { tl: new C(-0.5, -0.5).transform(o), tr: new C(0.5, -0.5).transform(o), br: new C(0.5, 0.5).transform(o), bl: new C(-0.5, 0.5).transform(o) };
2180
2180
  }
2181
2181
  render(t, e, s, i, n) {
2182
- ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Rc.call(this, t, e, s, i, n) : Fc.call(this, t, e, s, i, n);
2182
+ ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Lc.call(this, t, e, s, i, n) : Fc.call(this, t, e, s, i, n);
2183
2183
  }
2184
2184
  }
2185
2185
  const Ic = (a, t, e) => e.lockRotation ? on : t.cursorStyle, Nc = Bs(Va, Hs(((a, t, e, s) => {
@@ -2239,8 +2239,8 @@ function Sh(a, t, e, s, i) {
2239
2239
  if (le(n, h)) return !1;
2240
2240
  const { origin: u, flip: d } = tr[r], f = mt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && Jr(e, X, X, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
2241
2241
  return Bs(Xa, Hs(((m, v, y, _) => (function(S, A, T) {
2242
- let { target: E, ex: P, ey: N, skewingSide: D } = A, R = st(A, zc);
2243
- const { skew: k } = tr[S], O = T.subtract(new C(P, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = R[k], L = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * O * D / Math.max(G, 1) + L, at = Ce(Math.atan(it));
2242
+ let { target: E, ex: P, ey: N, skewingSide: D } = A, L = st(A, zc);
2243
+ const { skew: k } = tr[S], O = T.subtract(new C(P, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = L[k], R = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * O * D / Math.max(G, 1) + R, at = Ce(Math.atan(it));
2244
2244
  E.set(k, at);
2245
2245
  const xt = j !== E[k];
2246
2246
  if (xt && S === "y") {
@@ -2644,7 +2644,7 @@ const Qc = (a) => {
2644
2644
  return (t = mc[a]) !== null && t !== void 0 ? t : a;
2645
2645
  }, tu = new RegExp("(".concat(he, ")"), "gi"), eu = (a) => an(a.replace(tu, " $1 ").replace(/,/gi, " "));
2646
2646
  var ea, sa, ia, na, ra, oa, aa;
2647
- const Rt = "(".concat(he, ")"), su = String.raw(ea || (ea = Ae(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Rt), iu = String.raw(sa || (sa = Ae(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Rt), nu = String.raw(ia || (ia = Ae(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Rt, Rt, Rt), ru = String.raw(na || (na = Ae(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Rt, Rt), ou = String.raw(ra || (ra = Ae(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Rt, Rt), au = String.raw(oa || (oa = Ae(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Rt, Rt, Rt, Rt, Rt, Rt), ro = "(?:".concat(au, "|").concat(ou, "|").concat(nu, "|").concat(ru, "|").concat(su, "|").concat(iu, ")"), hu = "(?:".concat(ro, "*)"), lu = String.raw(aa || (aa = Ae(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), hu), cu = new RegExp(lu), uu = new RegExp(ro), du = new RegExp(ro, "g");
2647
+ const Lt = "(".concat(he, ")"), su = String.raw(ea || (ea = Ae(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Lt), iu = String.raw(sa || (sa = Ae(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Lt), nu = String.raw(ia || (ia = Ae(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Lt, Lt, Lt), ru = String.raw(na || (na = Ae(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Lt, Lt), ou = String.raw(ra || (ra = Ae(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Lt, Lt), au = String.raw(oa || (oa = Ae(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Lt, Lt, Lt, Lt, Lt, Lt), ro = "(?:".concat(au, "|").concat(ou, "|").concat(nu, "|").concat(ru, "|").concat(su, "|").concat(iu, ")"), hu = "(?:".concat(ro, "*)"), lu = String.raw(aa || (aa = Ae(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), hu), cu = new RegExp(lu), uu = new RegExp(ro), du = new RegExp(ro, "g");
2648
2648
  function dn(a) {
2649
2649
  const t = [];
2650
2650
  if (!(a = eu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !cu.test(a)) return [...Bt];
@@ -2686,14 +2686,14 @@ function fu(a, t, e, s) {
2686
2686
  else if (a === "visible") r = t !== It && t !== "hidden", e && e.visible === !1 && (r = !1);
2687
2687
  else if (a === "opacity") r = parseFloat(t), e && e.opacity !== void 0 && (r *= e.opacity);
2688
2688
  else if (a === "textAnchor") r = t === "start" ? J : t === "end" ? ut : X;
2689
- else if (a === "charSpacing" || a === hs) n = Lt(t, s) / s * 1e3;
2689
+ else if (a === "charSpacing" || a === hs) n = Rt(t, s) / s * 1e3;
2690
2690
  else if (a === "paintFirst") {
2691
2691
  const o = t.indexOf(vt), h = t.indexOf(Nt);
2692
2692
  r = vt, (o > -1 && h > -1 && h < o || o === -1 && h > -1) && (r = Nt);
2693
2693
  } else {
2694
2694
  if (a === "href" || a === "xlink:href" || a === "font" || a === "id") return t;
2695
2695
  if (a === "imageSmoothing") return t === "optimizeQuality";
2696
- n = i ? t.map(Lt) : Lt(t, s);
2696
+ n = i ? t.map(Rt) : Rt(t, s);
2697
2697
  }
2698
2698
  } else r = "";
2699
2699
  return !i && isNaN(n) ? r : n;
@@ -2702,7 +2702,7 @@ function gu(a, t) {
2702
2702
  const e = a.match(pc);
2703
2703
  if (!e) return;
2704
2704
  const s = e[1], i = e[3], n = e[4], r = e[5], o = e[6];
2705
- s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = Lt(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
2705
+ s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = Rt(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
2706
2706
  }
2707
2707
  function Sr(a, t) {
2708
2708
  a.replace(/;\s*$/, "").split(";").forEach(((e) => {
@@ -2724,7 +2724,7 @@ const mu = { stroke: "strokeOpacity", fill: "fillOpacity" };
2724
2724
  function Ne(a, t, e) {
2725
2725
  if (!a) return {};
2726
2726
  let s, i = {}, n = zr;
2727
- a.parentNode && Xo.test(a.parentNode.nodeName) && (i = Ne(a.parentElement, t, e), i.fontSize && (s = n = Lt(i.fontSize)));
2727
+ a.parentNode && Xo.test(a.parentNode.nodeName) && (i = Ne(a.parentElement, t, e), i.fontSize && (s = n = Rt(i.fontSize)));
2728
2728
  const r = w(w(w({}, t.reduce(((l, c) => {
2729
2729
  const u = a.getAttribute(c);
2730
2730
  return u && (l[c] = u), l;
@@ -2733,7 +2733,7 @@ function Ne(a, t, e) {
2733
2733
  for (const d in c) Zc(l, d.split(" ")) && (u = w(w({}, u), c[d]));
2734
2734
  return u;
2735
2735
  })(a, e)), pu(a));
2736
- r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s = Lt(r[Kn], n), r[Kn] = "".concat(s));
2736
+ r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s = Rt(r[Kn], n), r[Kn] = "".concat(s));
2737
2737
  const o = {};
2738
2738
  for (const l in r) {
2739
2739
  const c = Qc(l), u = fu(c, r[l], i, s);
@@ -2787,7 +2787,7 @@ class ve extends Mt {
2787
2787
  }
2788
2788
  }
2789
2789
  x(ve, "type", "Rect"), x(ve, "cacheProperties", [...Ie, ...Dh]), x(ve, "ownDefaults", { rx: 0, ry: 0 }), x(ve, "ATTRIBUTE_NAMES", [...Ye, "x", "y", "rx", "ry", "width", "height"]), F.setClass(ve), F.setSVGClass(ve);
2790
- const Oe = "initialization", fn = "added", oo = "removed", gn = "imperative", Lh = (a, t) => {
2790
+ const Oe = "initialization", fn = "added", oo = "removed", gn = "imperative", Rh = (a, t) => {
2791
2791
  const { strokeUniform: e, strokeWidth: s, width: i, height: n, group: r } = t, o = r && r !== a ? mi(r.calcTransformMatrix(), a.calcTransformMatrix()) : null, h = o ? t.getRelativeCenterPoint().transform(o) : t.getRelativeCenterPoint(), l = !t.isStrokeAccountedForInDimensions(), c = e && l ? oh(new C(s, s), void 0, a.calcTransformMatrix()) : Xr, u = !e && l ? s : 0, d = An(i + u, n + u, Sn([o, t.calcOwnMatrix()], !0)).add(c).scalarDivide(2);
2792
2792
  return [h.subtract(d), h.add(d)];
2793
2793
  };
@@ -2810,7 +2810,7 @@ class On {
2810
2810
  const { type: s, target: i } = e;
2811
2811
  if (s === gn && e.overrides) return e.overrides;
2812
2812
  if (t.length === 0) return;
2813
- const { left: n, top: r, width: o, height: h } = we(t.map(((u) => Lh(i, u))).reduce(((u, d) => u.concat(d)), [])), l = new C(o, h), c = new C(n, r).add(l.scalarDivide(2));
2813
+ const { left: n, top: r, width: o, height: h } = we(t.map(((u) => Rh(i, u))).reduce(((u, d) => u.concat(d)), [])), l = new C(o, h), c = new C(n, r).add(l.scalarDivide(2));
2814
2814
  if (s === Oe) {
2815
2815
  const u = this.getInitialSize(e, { size: l, center: c });
2816
2816
  return { center: c, relativeCorrection: new C(0, 0), size: u };
@@ -2825,7 +2825,7 @@ class Cr extends On {
2825
2825
  }
2826
2826
  }
2827
2827
  x(Cr, "type", "fit-content"), F.setClass(Cr);
2828
- const vu = ["strategy"], yu = ["target", "strategy", "bubbles", "prevStrategy"], Rh = "layoutManager";
2828
+ const vu = ["strategy"], yu = ["target", "strategy", "bubbles", "prevStrategy"], Lh = "layoutManager";
2829
2829
  class li {
2830
2830
  constructor() {
2831
2831
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Cr();
@@ -2896,13 +2896,13 @@ class li {
2896
2896
  t.forEach(((e) => e.forEach(((s) => s())))), t.clear();
2897
2897
  }
2898
2898
  toObject() {
2899
- return { type: Rh, strategy: this.strategy.constructor.type };
2899
+ return { type: Lh, strategy: this.strategy.constructor.type };
2900
2900
  }
2901
2901
  toJSON() {
2902
2902
  return this.toObject();
2903
2903
  }
2904
2904
  }
2905
- F.setClass(li, Rh);
2905
+ F.setClass(li, Lh);
2906
2906
  const _u = ["type", "objects", "layoutManager"];
2907
2907
  class wu extends li {
2908
2908
  performLayout() {
@@ -2923,7 +2923,7 @@ class qt extends Wa(Mt) {
2923
2923
  })), this.layoutManager = (s = e.layoutManager) !== null && s !== void 0 ? s : new li(), this.layoutManager.performLayout({ type: Oe, target: this, targets: [...t], x: e.left, y: e.top });
2924
2924
  }
2925
2925
  canEnterGroup(t) {
2926
- return t === this || this.isDescendantOf(t) ? (Re("error", "Group: circular object trees are not supported, this call has no effect"), !1) : this._objects.indexOf(t) === -1 || (Re("error", "Group: duplicate objects are not supported inside group, this call has no effect"), !1);
2926
+ return t === this || this.isDescendantOf(t) ? (Le("error", "Group: circular object trees are not supported, this call has no effect"), !1) : this._objects.indexOf(t) === -1 || (Le("error", "Group: duplicate objects are not supported inside group, this call has no effect"), !1);
2927
2927
  }
2928
2928
  _filterObjectsBeforeEnteringGroup(t) {
2929
2929
  return t.filter(((e, s, i) => this.canEnterGroup(e) && i.indexOf(e) === s));
@@ -2982,7 +2982,7 @@ class qt extends Wa(Mt) {
2982
2982
  t.group && t.group.remove(t), t._set("parent", this), this._enterGroup(t, e);
2983
2983
  }
2984
2984
  _enterGroup(t, e) {
2985
- e && Ls(t, dt(Xt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2985
+ e && Rs(t, dt(Xt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2986
2986
  const s = this.canvas && this.canvas.getActiveObject && this.canvas.getActiveObject();
2987
2987
  s && (s === t || t.isDescendantOf(s)) && this._activeObjects.push(t);
2988
2988
  }
@@ -2990,7 +2990,7 @@ class qt extends Wa(Mt) {
2990
2990
  this._exitGroup(t, e), t._set("parent", void 0), t._set("canvas", void 0);
2991
2991
  }
2992
2992
  _exitGroup(t, e) {
2993
- t._set("group", void 0), e || (Ls(t, dt(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2993
+ t._set("group", void 0), e || (Rs(t, dt(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2994
2994
  const s = this._activeObjects.length > 0 ? this._activeObjects.indexOf(t) : -1;
2995
2995
  s > -1 && this._activeObjects.splice(s, 1);
2996
2996
  }
@@ -3132,18 +3132,18 @@ const Au = (a, t, e) => {
3132
3132
  const u = ((d, f, g, p, b, m, v) => {
3133
3133
  if (g === 0 || p === 0) return [];
3134
3134
  let y = 0, _ = 0, S = 0;
3135
- const A = Math.PI, T = v * Hr, E = ue(T), P = ce(T), N = 0.5 * (-P * d - E * f), D = 0.5 * (-P * f + E * d), R = g ** 2, k = p ** 2, O = D ** 2, j = N ** 2, M = R * k - R * O - k * j;
3136
- let L = Math.abs(g), G = Math.abs(p);
3135
+ const A = Math.PI, T = v * Hr, E = ue(T), P = ce(T), N = 0.5 * (-P * d - E * f), D = 0.5 * (-P * f + E * d), L = g ** 2, k = p ** 2, O = D ** 2, j = N ** 2, M = L * k - L * O - k * j;
3136
+ let R = Math.abs(g), G = Math.abs(p);
3137
3137
  if (M < 0) {
3138
- const ge = Math.sqrt(1 - M / (R * k));
3139
- L *= ge, G *= ge;
3140
- } else S = (b === m ? -1 : 1) * Math.sqrt(M / (R * O + k * j));
3141
- const it = S * L * D / G, at = -S * G * N / L, xt = P * it - E * at + 0.5 * d, gt = E * it + P * at + 0.5 * f;
3142
- let et = ha(1, 0, (N - it) / L, (D - at) / G), Pt = ha((N - it) / L, (D - at) / G, (-N - it) / L, (-D - at) / G);
3138
+ const ge = Math.sqrt(1 - M / (L * k));
3139
+ R *= ge, G *= ge;
3140
+ } else S = (b === m ? -1 : 1) * Math.sqrt(M / (L * O + k * j));
3141
+ const it = S * R * D / G, at = -S * G * N / R, xt = P * it - E * at + 0.5 * d, gt = E * it + P * at + 0.5 * f;
3142
+ let et = ha(1, 0, (N - it) / R, (D - at) / G), Pt = ha((N - it) / R, (D - at) / G, (-N - it) / R, (-D - at) / G);
3143
3143
  m === 0 && Pt > 0 ? Pt -= 2 * A : m === 1 && Pt < 0 && (Pt += 2 * A);
3144
3144
  const fe = Math.ceil(Math.abs(Pt / A * 2)), ht = [], K = Pt / fe, je = 8 / 3 * Math.sin(K / 4) * Math.sin(K / 4) / Math.sin(K / 2);
3145
3145
  let ms = et + K;
3146
- for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, P, E, L, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3146
+ for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, P, E, R, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3147
3147
  return ht;
3148
3148
  })(l - a, c - t, i, n, o, h, r);
3149
3149
  for (let d = 0, f = u.length; d < f; d++) u[d][1] += a, u[d][2] += t, u[d][3] += a, u[d][4] += t, u[d][5] += a, u[d][6] += t;
@@ -3294,7 +3294,7 @@ const Au = (a, t, e) => {
3294
3294
  }
3295
3295
  }
3296
3296
  return e;
3297
- }, Lu = function(a) {
3297
+ }, Ru = function(a) {
3298
3298
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, e = new C(a[0]), s = new C(a[1]), i = 1, n = 0;
3299
3299
  const r = [], o = a.length, h = o > 2;
3300
3300
  let l;
@@ -3314,7 +3314,7 @@ function mn(a, t) {
3314
3314
  return e.setProperty(i, n);
3315
3315
  })));
3316
3316
  }
3317
- const Ru = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a;
3317
+ const Lu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a;
3318
3318
  function Wh(a) {
3319
3319
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3320
3320
  const e = t.onComplete || rs, s = new (di()).XMLHttpRequest(), i = t.signal, n = function() {
@@ -3336,11 +3336,11 @@ const Ji = (a, t) => {
3336
3336
  }
3337
3337
  })(a), e = e.transform(a.transformMatrix)), delete a.transformMatrix, t && (a.scaleX *= t.scaleX, a.scaleY *= t.scaleY, a.cropX = t.cropX, a.cropY = t.cropY, e.x += t.offsetLeft, e.y += t.offsetTop, a.width = t.width, a.height = t.height), a.setPositionByOrigin(e, X, X);
3338
3338
  };
3339
- var Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so, animateColor: _h, applyTransformToObject: Ls, calcAngleBetweenVectors: un, calcDimensionsMatrix: fi, calcPlaneChangeMatrix: mi, calcVectorRotation: bh, cancelAnimFrame: Ya, capValue: ls, composeMatrix: Za, copyCanvasElement: (a) => {
3339
+ var Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so, animateColor: _h, applyTransformToObject: Rs, calcAngleBetweenVectors: un, calcDimensionsMatrix: fi, calcPlaneChangeMatrix: mi, calcVectorRotation: bh, cancelAnimFrame: Ya, capValue: ls, composeMatrix: Za, copyCanvasElement: (a) => {
3340
3340
  var t;
3341
3341
  const e = Jt(a);
3342
3342
  return (t = e.getContext("2d")) === null || t === void 0 || t.drawImage(a, 0, 0), e;
3343
- }, cos: ce, createCanvasElement: Se, createImage: $a, createRotateMatrix: ds, createScaleMatrix: Cn, createSkewXMatrix: Yr, createSkewYMatrix: $r, createTranslateMatrix: js, createVector: ln, crossProduct: As, degreesToRadians: lt, dotProduct: vh, ease: xc, enlivenObjectEnlivables: gi, enlivenObjects: Os, findScaleToCover: Ih, findScaleToFit: Fh, getBoundsOfCurve: Tr, getOrthonormalVector: to, getPathSegmentsInfo: ao, getPointOnPath: Gh, getPointer: ih, getRandomInt: Ru, getRegularPolygonPath: (a, t) => {
3343
+ }, cos: ce, createCanvasElement: Se, createImage: $a, createRotateMatrix: ds, createScaleMatrix: Cn, createSkewXMatrix: Yr, createSkewYMatrix: $r, createTranslateMatrix: js, createVector: ln, crossProduct: As, degreesToRadians: lt, dotProduct: vh, ease: xc, enlivenObjectEnlivables: gi, enlivenObjects: Os, findScaleToCover: Ih, findScaleToFit: Fh, getBoundsOfCurve: Tr, getOrthonormalVector: to, getPathSegmentsInfo: ao, getPointOnPath: Gh, getPointer: ih, getRandomInt: Lu, getRegularPolygonPath: (a, t) => {
3344
3344
  const e = 2 * Math.PI / a;
3345
3345
  let s = -Ve;
3346
3346
  a % 2 == 0 && (s += e / 2);
@@ -3350,7 +3350,7 @@ var Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
3350
3350
  i[n] = [n === 0 ? "M" : "L", o, h];
3351
3351
  }
3352
3352
  return i[a] = ["Z"], i;
3353
- }, getSmoothPathFromPoints: Lu, getSvgAttributes: (a) => {
3353
+ }, getSmoothPathFromPoints: Ru, getSvgAttributes: (a) => {
3354
3354
  const t = ["instantiated_by_use", "style", "id", "class"];
3355
3355
  switch (a) {
3356
3356
  case "linearGradient":
@@ -3367,9 +3367,9 @@ var Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
3367
3367
  s.inverted && !i.inverted && (s = t, i = a), yr(i, (e = i.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
3368
3368
  const n = s.inverted && i.inverted;
3369
3369
  return n && (s.inverted = i.inverted = !1), new qt([s], { clipPath: i, inverted: n });
3370
- }, multiplyTransformMatrices: dt, multiplyTransformMatrixArray: Sn, parsePath: Vh, parsePreserveAspectRatioAttribute: Zr, parseUnit: Lt, pick: fs, projectStrokeOnPoints: kh, qrDecompose: as, radiansToDegrees: Ce, removeFromArray: qe, removeTransformFromObject: (a, t) => {
3370
+ }, multiplyTransformMatrices: dt, multiplyTransformMatrixArray: Sn, parsePath: Vh, parsePreserveAspectRatioAttribute: Zr, parseUnit: Rt, pick: fs, projectStrokeOnPoints: kh, qrDecompose: as, radiansToDegrees: Ce, removeFromArray: qe, removeTransformFromObject: (a, t) => {
3371
3371
  const e = Xt(t), s = dt(e, a.calcOwnMatrix());
3372
- Ls(a, s);
3372
+ Rs(a, s);
3373
3373
  }, removeTransformMatrixForSvgParsing: Ji, request: Wh, requestAnimFrame: Qs, resetObjectTransform: rh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: Qr, saveObjectTransform: Kr, sendObjectToPlane: yr, sendPointToPlane: os, sendVectorToPlane: oh, setStyle: mn, sin: ue, sizeAfterTransform: An, string: Jc, stylesFromArray: Oh, stylesToArray: Ph, toBlob: Ur, toDataURL: Wr, toFixed: Q, transformPath: (a, t, e) => (e && (t = dt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
3374
3374
  const i = [...s];
3375
3375
  for (let n = 1; n < s.length - 1; n += 2) {
@@ -3393,11 +3393,11 @@ class Iu extends sh {
3393
3393
  }
3394
3394
  createContainerElement() {
3395
3395
  const t = Fs().createElement("div");
3396
- return t.setAttribute("data-fabric", "wrapper"), mn(t, { position: "relative" }), Ro(t), t;
3396
+ return t.setAttribute("data-fabric", "wrapper"), mn(t, { position: "relative" }), Lo(t), t;
3397
3397
  }
3398
3398
  applyCanvasStyle(t, e) {
3399
3399
  const { styles: s, allowTouchScrolling: i } = e;
3400
- mn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : It })), Ro(t);
3400
+ mn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : It })), Lo(t);
3401
3401
  }
3402
3402
  setDimensions(t, e) {
3403
3403
  super.setDimensions(t, e);
@@ -4155,7 +4155,7 @@ class er {
4155
4155
  return "pattern";
4156
4156
  }
4157
4157
  set type(t) {
4158
- Re("warn", "Setting type has no effect", t);
4158
+ Le("warn", "Setting type has no effect", t);
4159
4159
  }
4160
4160
  constructor(t) {
4161
4161
  x(this, "repeat", "repeat"), x(this, "offsetX", 0), x(this, "offsetY", 0), x(this, "crossOrigin", ""), this.id = Xe(), Object.assign(this, t);
@@ -4932,17 +4932,17 @@ class Ct extends tl {
4932
4932
  let p = 0, b = 0, m = this.getValueOfPropertyAt(l, 0, e), v = this.getValueOfPropertyAt(l, 0, vt), y = this.getValueOfPropertyAt(l, 0, hs), _ = m, S = v, A = y;
4933
4933
  const T = s + f * (1 - this._fontSizeFraction);
4934
4934
  let E = this.getHeightOfChar(l, 0), P = this.getValueOfPropertyAt(l, 0, "deltaY");
4935
- for (let R = 0, k = d.length; R < k; R++) {
4936
- const O = this.__charBounds[l][R];
4937
- _ = this.getValueOfPropertyAt(l, R, e), S = this.getValueOfPropertyAt(l, R, vt), A = this.getValueOfPropertyAt(l, R, hs);
4938
- const j = this.getHeightOfChar(l, R), M = this.getValueOfPropertyAt(l, R, "deltaY");
4935
+ for (let L = 0, k = d.length; L < k; L++) {
4936
+ const O = this.__charBounds[l][L];
4937
+ _ = this.getValueOfPropertyAt(l, L, e), S = this.getValueOfPropertyAt(l, L, vt), A = this.getValueOfPropertyAt(l, L, hs);
4938
+ const j = this.getHeightOfChar(l, L), M = this.getValueOfPropertyAt(l, L, "deltaY");
4939
4939
  if (n && _ && S) {
4940
- const L = this.fontSize * A / 1e3;
4941
- t.save(), t.fillStyle = v, t.translate(O.renderLeft, O.renderTop), t.rotate(O.angle), t.fillRect(-O.kernedWidth / 2, h * j + M - o * L, O.kernedWidth, L), t.restore();
4940
+ const R = this.fontSize * A / 1e3;
4941
+ t.save(), t.fillStyle = v, t.translate(O.renderLeft, O.renderTop), t.rotate(O.angle), t.fillRect(-O.kernedWidth / 2, h * j + M - o * R, O.kernedWidth, R), t.restore();
4942
4942
  } else if ((_ !== m || S !== v || j !== E || A !== y || M !== P) && b > 0) {
4943
- const L = this.fontSize * y / 1e3;
4943
+ const R = this.fontSize * y / 1e3;
4944
4944
  let G = i + g + p;
4945
- this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + P - o * L, b, L)), p = O.left, b = O.width, m = _, y = A, v = S, E = j, P = M;
4945
+ this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + P - o * R, b, R)), p = O.left, b = O.width, m = _, y = A, v = S, E = j, P = M;
4946
4946
  } else b += O.kernedWidth;
4947
4947
  }
4948
4948
  let N = i + g + p;
@@ -5919,7 +5919,7 @@ class ga extends On {
5919
5919
  calcLayoutResult(t, e) {
5920
5920
  const { target: s } = t, { clipPath: i, group: n } = s;
5921
5921
  if (!i || !this.shouldPerformLayout(t)) return;
5922
- const { width: r, height: o } = we(Lh(s, i)), h = new C(r, o);
5922
+ const { width: r, height: o } = we(Rh(s, i)), h = new C(r, o);
5923
5923
  if (i.absolutePositioned)
5924
5924
  return { center: os(i.getRelativeCenterPoint(), void 0, n ? n.calcTransformMatrix() : void 0), size: h };
5925
5925
  {
@@ -5977,7 +5977,7 @@ class es extends qt {
5977
5977
  }));
5978
5978
  }
5979
5979
  canEnterGroup(t) {
5980
- return this.getObjects().some(((e) => e.isDescendantOf(t) || t.isDescendantOf(e))) ? (Re("error", "ActiveSelection: circular object trees are not supported, this call has no effect"), !1) : super.canEnterGroup(t);
5980
+ return this.getObjects().some(((e) => e.isDescendantOf(t) || t.isDescendantOf(e))) ? (Le("error", "ActiveSelection: circular object trees are not supported, this call has no effect"), !1) : super.canEnterGroup(t);
5981
5981
  }
5982
5982
  enterGroup(t, e) {
5983
5983
  t.parent && t.parent === t.group ? t.parent._exitGroup(t) : t.group && t.parent !== t.group && t.group.remove(t), this._enterGroup(t, e);
@@ -6259,7 +6259,7 @@ class Tt extends Mt {
6259
6259
  static async fromElement(t) {
6260
6260
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0;
6261
6261
  const i = Ne(t, this.ATTRIBUTE_NAMES, s);
6262
- return this.fromURL(i["xlink:href"] || i.href, e, i).catch(((n) => (Re("log", "Unable to parse Image", n), null)));
6262
+ return this.fromURL(i["xlink:href"] || i.href, e, i).catch(((n) => (Le("log", "Unable to parse Image", n), null)));
6263
6263
  }
6264
6264
  }
6265
6265
  function or(a) {
@@ -6268,16 +6268,16 @@ function or(a) {
6268
6268
  let e, s, i = 1, n = 1, r = 0, o = 0;
6269
6269
  const h = a.getAttribute("width"), l = a.getAttribute("height"), c = a.getAttribute("x") || 0, u = a.getAttribute("y") || 0, d = !(t && Wo.test(t)), f = !h || !l || h === "100%" || l === "100%";
6270
6270
  let g = "", p = 0, b = 0;
6271
- if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" + Lt(c || "0") + " " + Lt(u || "0") + ") ", e = (a.getAttribute("transform") || "") + g, a.setAttribute("transform", e), a.removeAttribute("x"), a.removeAttribute("y")), d && f) return { width: 0, height: 0 };
6271
+ if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" + Rt(c || "0") + " " + Rt(u || "0") + ") ", e = (a.getAttribute("transform") || "") + g, a.setAttribute("transform", e), a.removeAttribute("x"), a.removeAttribute("y")), d && f) return { width: 0, height: 0 };
6272
6272
  const m = { width: 0, height: 0 };
6273
- if (d) return m.width = Lt(h), m.height = Lt(l), m;
6273
+ if (d) return m.width = Rt(h), m.height = Rt(l), m;
6274
6274
  const v = t.match(Wo);
6275
6275
  r = -parseFloat(v[1]), o = -parseFloat(v[2]);
6276
6276
  const y = parseFloat(v[3]), _ = parseFloat(v[4]);
6277
- m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width = Lt(h), m.height = Lt(l), i = m.width / y, n = m.height / _);
6277
+ m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width = Rt(h), m.height = Rt(l), i = m.width / y, n = m.height / _);
6278
6278
  const S = Zr(a.getAttribute("preserveAspectRatio") || "");
6279
6279
  if (S.alignX !== It && (S.meetOrSlice === "meet" && (n = i = i > n ? n : i), S.meetOrSlice === "slice" && (n = i = i > n ? i : n), p = m.width - y * i, b = m.height - _ * i, S.alignX === "Mid" && (p /= 2), S.alignY === "Mid" && (b /= 2), S.alignX === "Min" && (p = 0), S.alignY === "Min" && (b = 0)), i === 1 && n === 1 && r === 0 && o === 0 && c === 0 && u === 0) return m;
6280
- if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" + Lt(c || "0") + " " + Lt(u || "0") + ") "), e = g + " matrix(" + i + " 0 0 " + n + " " + (r * i + p) + " " + (o * n + b) + ") ", a.nodeName === "svg") {
6280
+ if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" + Rt(c || "0") + " " + Rt(u || "0") + ") "), e = g + " matrix(" + i + " 0 0 " + n + " " + (r * i + p) + " " + (o * n + b) + ") ", a.nodeName === "svg") {
6281
6281
  for (s = a.ownerDocument.createElementNS(_r, "g"); a.firstChild; ) s.appendChild(a.firstChild);
6282
6282
  a.appendChild(s);
6283
6283
  } else s = a, s.removeAttribute("x"), s.removeAttribute("y"), e = s.getAttribute("transform") + e;
@@ -6383,7 +6383,7 @@ class md {
6383
6383
  const ba = (a) => bc.test(bn(a)), Mr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
6384
6384
  async function bd(a, t) {
6385
6385
  let { crossOrigin: e, signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6386
- if (s && s.aborted) return Re("log", new Br("parseSVGDocument")), Mr();
6386
+ if (s && s.aborted) return Le("log", new Br("parseSVGDocument")), Mr();
6387
6387
  const i = a.documentElement;
6388
6388
  (function(c) {
6389
6389
  const u = il(c, ["use", "svg:use"]), d = ["x", "y", "xlink:href", "href", "transform"];
@@ -6401,20 +6401,20 @@ async function bd(a, t) {
6401
6401
  if (or(v), /^svg$/i.test(v.nodeName)) {
6402
6402
  const P = v.ownerDocument.createElementNS(_r, "g");
6403
6403
  Object.entries(_).forEach(((N) => {
6404
- let [D, R] = N;
6405
- return P.setAttributeNS(_r, D, R);
6404
+ let [D, L] = N;
6405
+ return P.setAttributeNS(_r, D, L);
6406
6406
  })), P.append(...v.childNodes), v = P;
6407
6407
  }
6408
6408
  for (const P of g) {
6409
6409
  if (!P) continue;
6410
6410
  const { name: N, value: D } = P;
6411
6411
  if (!d.includes(N)) if (N === "style") {
6412
- const R = {};
6413
- Sr(D, R), Object.entries(_).forEach(((O) => {
6412
+ const L = {};
6413
+ Sr(D, L), Object.entries(_).forEach(((O) => {
6414
6414
  let [j, M] = O;
6415
- R[j] = M;
6416
- })), Sr(_.style || "", R);
6417
- const k = Object.entries(R).map(((O) => O.join(":"))).join(";");
6415
+ L[j] = M;
6416
+ })), Sr(_.style || "", L);
6417
+ const k = Object.entries(L).map(((O) => O.join(":"))).join(";");
6418
6418
  v.setAttribute(N, k);
6419
6419
  } else !_[N] && v.setAttribute(N, D);
6420
6420
  }
@@ -6443,7 +6443,7 @@ function vd(a, t) {
6443
6443
  }, signal: e.signal });
6444
6444
  })).then(((s) => bd(s, t, e))).catch((() => Mr()));
6445
6445
  }
6446
- const Ln = (a) => a.webgl !== void 0, ho = "precision highp float", yd = `
6446
+ const Rn = (a) => a.webgl !== void 0, ho = "precision highp float", yd = `
6447
6447
  `.concat(ho, `;
6448
6448
  varying vec2 vTexCoord;
6449
6449
  uniform sampler2D uTexture;
@@ -6510,7 +6510,7 @@ class wt {
6510
6510
  return !1;
6511
6511
  }
6512
6512
  applyTo(t) {
6513
- Ln(t) ? (this._setupFrameBuffer(t), this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6513
+ Rn(t) ? (this._setupFrameBuffer(t), this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6514
6514
  }
6515
6515
  applyTo2d(t) {
6516
6516
  }
@@ -6767,7 +6767,7 @@ class Di extends wt {
6767
6767
  `;
6768
6768
  }
6769
6769
  applyTo(t) {
6770
- Ln(t) ? (this.aspectRatio = t.sourceWidth / t.sourceHeight, t.passes++, this._setupFrameBuffer(t), this.horizontal = !0, this.applyToWebGL(t), this._swapTextures(t), this._setupFrameBuffer(t), this.horizontal = !1, this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6770
+ Rn(t) ? (this.aspectRatio = t.sourceWidth / t.sourceHeight, t.passes++, this._setupFrameBuffer(t), this.horizontal = !0, this.applyToWebGL(t), this._swapTextures(t), this._setupFrameBuffer(t), this.horizontal = !1, this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6771
6771
  }
6772
6772
  applyTo2d(t) {
6773
6773
  let { imageData: { data: e, width: s, height: i } } = t;
@@ -6818,7 +6818,7 @@ class Di extends wt {
6818
6818
  }
6819
6819
  }
6820
6820
  x(Di, "type", "Blur"), x(Di, "defaults", { blur: 0 }), x(Di, "uniformLocations", ["uDelta"]), F.setClass(Di);
6821
- class Li extends wt {
6821
+ class Ri extends wt {
6822
6822
  getFragmentSource() {
6823
6823
  return `
6824
6824
  precision highp float;
@@ -6844,7 +6844,7 @@ class Li extends wt {
6844
6844
  t.uniform1f(e.uBrightness, this.brightness);
6845
6845
  }
6846
6846
  }
6847
- x(Li, "type", "Brightness"), x(Li, "defaults", { brightness: 0 }), x(Li, "uniformLocations", ["uBrightness"]), F.setClass(Li);
6847
+ x(Ri, "type", "Brightness"), x(Ri, "defaults", { brightness: 0 }), x(Ri, "uniformLocations", ["uBrightness"]), F.setClass(Ri);
6848
6848
  const rl = { matrix: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], colorsOnly: !0 };
6849
6849
  class Ss extends wt {
6850
6850
  getFragmentSource() {
@@ -6902,7 +6902,7 @@ class va extends wt {
6902
6902
  super(t), this.subFilters = t.subFilters || [];
6903
6903
  }
6904
6904
  applyTo(t) {
6905
- Ln(t) && (t.passes += this.subFilters.length - 1), this.subFilters.forEach(((e) => {
6905
+ Rn(t) && (t.passes += this.subFilters.length - 1), this.subFilters.forEach(((e) => {
6906
6906
  e.applyTo(t);
6907
6907
  }));
6908
6908
  }
@@ -6917,7 +6917,7 @@ class va extends wt {
6917
6917
  }
6918
6918
  }
6919
6919
  x(va, "type", "Composed"), F.setClass(va);
6920
- class Ri extends wt {
6920
+ class Li extends wt {
6921
6921
  getFragmentSource() {
6922
6922
  return `
6923
6923
  precision highp float;
@@ -6943,7 +6943,7 @@ class Ri extends wt {
6943
6943
  t.uniform1f(e.uContrast, this.contrast);
6944
6944
  }
6945
6945
  }
6946
- x(Ri, "type", "Contrast"), x(Ri, "defaults", { contrast: 0 }), x(Ri, "uniformLocations", ["uContrast"]), F.setClass(Ri);
6946
+ x(Li, "type", "Contrast"), x(Li, "defaults", { contrast: 0 }), x(Li, "uniformLocations", ["uContrast"]), F.setClass(Li);
6947
6947
  const Td = { Convolute_3_1: `
6948
6948
  precision highp float;
6949
6949
  uniform sampler2D uTexture;
@@ -7420,7 +7420,7 @@ class Gi extends wt {
7420
7420
  t.passes++, this.width = t.sourceWidth, this.horizontal = !0, this.dW = Math.round(this.width * this.scaleX), this.dH = t.sourceHeight, this.tempScale = this.dW / this.width, this.taps = this.getTaps(), t.destinationWidth = this.dW, super.applyTo(t), t.sourceWidth = t.destinationWidth, this.height = t.sourceHeight, this.horizontal = !1, this.dH = Math.round(this.height * this.scaleY), this.tempScale = this.dH / this.height, this.taps = this.getTaps(), t.destinationHeight = this.dH, super.applyTo(t), t.sourceHeight = t.destinationHeight;
7421
7421
  }
7422
7422
  applyTo(t) {
7423
- Ln(t) ? this.applyToForWebgl(t) : this.applyTo2d(t);
7423
+ Rn(t) ? this.applyToForWebgl(t) : this.applyTo2d(t);
7424
7424
  }
7425
7425
  isNeutralState() {
7426
7426
  return this.scaleX === 1 && this.scaleY === 1;
@@ -7457,13 +7457,13 @@ class Gi extends wt {
7457
7457
  lanczosResize(t, e, s, i, n) {
7458
7458
  const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, l = this.lanczosCreate(this.lanczosLobes), c = this.rcpScaleX, u = this.rcpScaleY, d = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, g = Math.ceil(c * this.lanczosLobes / 2), p = Math.ceil(u * this.lanczosLobes / 2), b = {}, m = { x: 0, y: 0 }, v = { x: 0, y: 0 };
7459
7459
  return (function y(_) {
7460
- let S, A, T, E, P, N, D, R, k, O, j;
7460
+ let S, A, T, E, P, N, D, L, k, O, j;
7461
7461
  for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
7462
- for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, D = 0, R = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7462
+ for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, D = 0, L = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7463
7463
  O = Math.floor(1e3 * Math.abs(A - m.x)), b[O] || (b[O] = {});
7464
- for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[O][j] || (b[O][j] = l(Math.sqrt(Math.pow(O * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[O][j], T > 0 && (E = 4 * (M * e + A), P += T, N += T * r[E], D += T * r[E + 1], R += T * r[E + 2], k += T * r[E + 3]));
7464
+ for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[O][j] || (b[O][j] = l(Math.sqrt(Math.pow(O * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[O][j], T > 0 && (E = 4 * (M * e + A), P += T, N += T * r[E], D += T * r[E + 1], L += T * r[E + 2], k += T * r[E + 3]));
7465
7465
  }
7466
- E = 4 * (S * i + _), h[E] = N / P, h[E + 1] = D / P, h[E + 2] = R / P, h[E + 3] = k / P;
7466
+ E = 4 * (S * i + _), h[E] = N / P, h[E + 1] = D / P, h[E + 2] = L / P, h[E + 3] = k / P;
7467
7467
  }
7468
7468
  return ++_ < i ? y(_) : o;
7469
7469
  })(0);
@@ -7482,10 +7482,10 @@ class Gi extends wt {
7482
7482
  const T = (f + 0.5) * o;
7483
7483
  for (let E = Math.floor(f * o); E < (f + 1) * o; E++) {
7484
7484
  const P = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = P * P;
7485
- for (let R = Math.floor(g * r); R < (g + 1) * r; R++) {
7486
- let k = Math.abs(N - (R + 0.5)) / h;
7485
+ for (let L = Math.floor(g * r); L < (g + 1) * r; L++) {
7486
+ let k = Math.abs(N - (L + 0.5)) / h;
7487
7487
  const O = Math.sqrt(D + k * k);
7488
- O > 1 && O < -1 || (b = 2 * O * O * O - 3 * O * O + 1, b > 0 && (k = 4 * (R + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7488
+ O > 1 && O < -1 || (b = 2 * O * O * O - 3 * O * O + 1, b > 0 && (k = 4 * (L + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7489
7489
  }
7490
7490
  }
7491
7491
  d[p] = y / m, d[p + 1] = _ / m, d[p + 2] = S / m, d[p + 3] = A / v;
@@ -7563,22 +7563,6 @@ class Xi extends wt {
7563
7563
  }
7564
7564
  }
7565
7565
  x(Xi, "type", "Vibrance"), x(Xi, "defaults", { vibrance: 0 }), x(Xi, "uniformLocations", ["uVibrance"]), F.setClass(Xi);
7566
- function Md(a) {
7567
- return new Promise((t, e) => {
7568
- const s = globalThis.URL.createObjectURL(a), i = new Image();
7569
- i.src = s, i.addEventListener("load", async () => {
7570
- globalThis.URL.revokeObjectURL(s), t(await Pd(i));
7571
- }), i.addEventListener("error", (n) => {
7572
- globalThis.URL.revokeObjectURL(s), e(n);
7573
- });
7574
- });
7575
- }
7576
- function Pd(a) {
7577
- return new Promise((t) => {
7578
- const e = document.createElement("canvas"), s = e.getContext("2d"), { naturalWidth: i, naturalHeight: n } = a;
7579
- e.width = i, e.height = n, s?.drawImage(a, 0, 0, i, n), t(e.toDataURL("image/jpeg", 0.8));
7580
- });
7581
- }
7582
7566
  var ii = {};
7583
7567
  ii.d = (a, t) => {
7584
7568
  for (var e in t)
@@ -7609,7 +7593,7 @@ ii.d(V, {
7609
7593
  ),
7610
7594
  AnnotationLayer: () => (
7611
7595
  /* reexport */
7612
- Tg
7596
+ Cg
7613
7597
  ),
7614
7598
  AnnotationMode: () => (
7615
7599
  /* reexport */
@@ -7669,15 +7653,15 @@ ii.d(V, {
7669
7653
  ),
7670
7654
  PasswordResponses: () => (
7671
7655
  /* reexport */
7672
- Rd
7656
+ Dd
7673
7657
  ),
7674
7658
  PermissionFlag: () => (
7675
7659
  /* reexport */
7676
- Ld
7660
+ Od
7677
7661
  ),
7678
7662
  PixelsPerInch: () => (
7679
7663
  /* reexport */
7680
- Rs
7664
+ Ls
7681
7665
  ),
7682
7666
  RenderingCancelledException: () => (
7683
7667
  /* reexport */
@@ -7701,7 +7685,7 @@ ii.d(V, {
7701
7685
  ),
7702
7686
  VerbosityLevel: () => (
7703
7687
  /* reexport */
7704
- Rn
7688
+ Ln
7705
7689
  ),
7706
7690
  XfaLayer: () => (
7707
7691
  /* reexport */
@@ -7709,11 +7693,11 @@ ii.d(V, {
7709
7693
  ),
7710
7694
  build: () => (
7711
7695
  /* reexport */
7712
- og
7696
+ ng
7713
7697
  ),
7714
7698
  createValidAbsoluteUrl: () => (
7715
7699
  /* reexport */
7716
- jd
7700
+ Id
7717
7701
  ),
7718
7702
  fetchData: () => (
7719
7703
  /* reexport */
@@ -7721,19 +7705,19 @@ ii.d(V, {
7721
7705
  ),
7722
7706
  getDocument: () => (
7723
7707
  /* reexport */
7724
- Jf
7708
+ qf
7725
7709
  ),
7726
7710
  getFilenameFromUrl: () => (
7727
7711
  /* reexport */
7728
- Yd
7712
+ Wd
7729
7713
  ),
7730
7714
  getPdfFilenameFromUrl: () => (
7731
7715
  /* reexport */
7732
- $d
7716
+ Ud
7733
7717
  ),
7734
7718
  getXfaPageViewport: () => (
7735
7719
  /* reexport */
7736
- qd
7720
+ Yd
7737
7721
  ),
7738
7722
  isDataScheme: () => (
7739
7723
  /* reexport */
@@ -7749,7 +7733,7 @@ ii.d(V, {
7749
7733
  ),
7750
7734
  normalizeUnicode: () => (
7751
7735
  /* reexport */
7752
- Xd
7736
+ Gd
7753
7737
  ),
7754
7738
  setLayerDimensions: () => (
7755
7739
  /* reexport */
@@ -7765,10 +7749,10 @@ ii.d(V, {
7765
7749
  ),
7766
7750
  version: () => (
7767
7751
  /* reexport */
7768
- rg
7752
+ ig
7769
7753
  )
7770
7754
  });
7771
- const kt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), al = [1, 0, 0, 1, 0, 0], Pr = [1e-3, 0, 0, 1e-3, 0, 0], Od = 1e7, lr = 1.35, Yt = {
7755
+ const kt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), al = [1, 0, 0, 1, 0, 0], Pr = [1e-3, 0, 0, 1e-3, 0, 0], Md = 1e7, lr = 1.35, Yt = {
7772
7756
  ANY: 1,
7773
7757
  DISPLAY: 2,
7774
7758
  PRINT: 4,
@@ -7782,7 +7766,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7782
7766
  ENABLE: 1,
7783
7767
  ENABLE_FORMS: 2,
7784
7768
  ENABLE_STORAGE: 3
7785
- }, Dd = "pdfjs_internal_editor_", W = {
7769
+ }, Pd = "pdfjs_internal_editor_", W = {
7786
7770
  DISABLE: -1,
7787
7771
  NONE: 0,
7788
7772
  FREETEXT: 3,
@@ -7804,7 +7788,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7804
7788
  HIGHLIGHT_FREE: 34,
7805
7789
  HIGHLIGHT_SHOW_ALL: 35,
7806
7790
  DRAW_STEP: 41
7807
- }, Ld = {
7791
+ }, Od = {
7808
7792
  PRINT: 4,
7809
7793
  MODIFY_CONTENTS: 8,
7810
7794
  COPY: 16,
@@ -7849,7 +7833,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7849
7833
  BEVELED: 3,
7850
7834
  INSET: 4,
7851
7835
  UNDERLINE: 5
7852
- }, Rn = {
7836
+ }, Ln = {
7853
7837
  ERRORS: 0,
7854
7838
  WARNINGS: 1,
7855
7839
  INFOS: 5
@@ -7944,22 +7928,22 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7944
7928
  constructPath: 91,
7945
7929
  setStrokeTransparent: 92,
7946
7930
  setFillTransparent: 93
7947
- }, Rd = {
7931
+ }, Dd = {
7948
7932
  NEED_PASSWORD: 1,
7949
7933
  INCORRECT_PASSWORD: 2
7950
7934
  };
7951
- let Fn = Rn.WARNINGS;
7952
- function Fd(a) {
7935
+ let Fn = Ln.WARNINGS;
7936
+ function Rd(a) {
7953
7937
  Number.isInteger(a) && (Fn = a);
7954
7938
  }
7955
- function Id() {
7939
+ function Ld() {
7956
7940
  return Fn;
7957
7941
  }
7958
7942
  function In(a) {
7959
- Fn >= Rn.INFOS && console.log(`Info: ${a}`);
7943
+ Fn >= Ln.INFOS && console.log(`Info: ${a}`);
7960
7944
  }
7961
7945
  function U(a) {
7962
- Fn >= Rn.WARNINGS && console.log(`Warning: ${a}`);
7946
+ Fn >= Ln.WARNINGS && console.log(`Warning: ${a}`);
7963
7947
  }
7964
7948
  function tt(a) {
7965
7949
  throw new Error(a);
@@ -7967,7 +7951,7 @@ function tt(a) {
7967
7951
  function bt(a, t) {
7968
7952
  a || tt(t);
7969
7953
  }
7970
- function Nd(a) {
7954
+ function Fd(a) {
7971
7955
  switch (a?.protocol) {
7972
7956
  case "http:":
7973
7957
  case "https:":
@@ -7979,17 +7963,17 @@ function Nd(a) {
7979
7963
  return !1;
7980
7964
  }
7981
7965
  }
7982
- function jd(a, t = null, e = null) {
7966
+ function Id(a, t = null, e = null) {
7983
7967
  if (!a)
7984
7968
  return null;
7985
7969
  try {
7986
7970
  if (e && typeof a == "string" && (e.addDefaultProtocol && a.startsWith("www.") && a.match(/\./g)?.length >= 2 && (a = `http://${a}`), e.tryConvertEncoding))
7987
7971
  try {
7988
- a = Vd(a);
7972
+ a = zd(a);
7989
7973
  } catch {
7990
7974
  }
7991
7975
  const s = t ? new URL(a, t) : new URL(a);
7992
- if (Nd(s))
7976
+ if (Fd(s))
7993
7977
  return s;
7994
7978
  } catch {
7995
7979
  }
@@ -8034,7 +8018,7 @@ class vn extends $e {
8034
8018
  super(t, "UnexpectedResponseException"), this.status = e;
8035
8019
  }
8036
8020
  }
8037
- class Bd extends $e {
8021
+ class Nd extends $e {
8038
8022
  constructor(t) {
8039
8023
  super(t, "FormatError");
8040
8024
  }
@@ -8063,7 +8047,7 @@ function Nn(a) {
8063
8047
  e[s] = a.charCodeAt(s) & 255;
8064
8048
  return e;
8065
8049
  }
8066
- function Hd(a) {
8050
+ function jd(a) {
8067
8051
  return String.fromCharCode(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, a & 255);
8068
8052
  }
8069
8053
  function lo(a) {
@@ -8072,11 +8056,11 @@ function lo(a) {
8072
8056
  t[e] = s;
8073
8057
  return t;
8074
8058
  }
8075
- function zd() {
8059
+ function Bd() {
8076
8060
  const a = new Uint8Array(4);
8077
8061
  return a[0] = 1, new Uint32Array(a.buffer, 0, 1)[0] === 1;
8078
8062
  }
8079
- function Gd() {
8063
+ function Hd() {
8080
8064
  try {
8081
8065
  return new Function(""), !0;
8082
8066
  } catch {
@@ -8085,10 +8069,10 @@ function Gd() {
8085
8069
  }
8086
8070
  class jt {
8087
8071
  static get isLittleEndian() {
8088
- return Y(this, "isLittleEndian", zd());
8072
+ return Y(this, "isLittleEndian", Bd());
8089
8073
  }
8090
8074
  static get isEvalSupported() {
8091
- return Y(this, "isEvalSupported", Gd());
8075
+ return Y(this, "isEvalSupported", Hd());
8092
8076
  }
8093
8077
  static get isOffscreenCanvasSupported() {
8094
8078
  return Y(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
@@ -8175,21 +8159,21 @@ class B {
8175
8159
  return l ? (l[0] = Math.min(l[0], t, o), l[1] = Math.min(l[1], e, h), l[2] = Math.max(l[2], t, o), l[3] = Math.max(l[3], e, h)) : l = [Math.min(t, o), Math.min(e, h), Math.max(t, o), Math.max(e, h)], this.#e(t, s, n, o, e, i, r, h, 3 * (-t + 3 * (s - n) + o), 6 * (t - 2 * s + n), 3 * (s - t), l), this.#e(t, s, n, o, e, i, r, h, 3 * (-e + 3 * (i - r) + h), 6 * (e - 2 * i + r), 3 * (i - e), l), l;
8176
8160
  }
8177
8161
  }
8178
- function Vd(a) {
8162
+ function zd(a) {
8179
8163
  return decodeURIComponent(escape(a));
8180
8164
  }
8181
8165
  let dr = null, _a = null;
8182
- function Xd(a) {
8166
+ function Gd(a) {
8183
8167
  return dr || (dr = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, _a = /* @__PURE__ */ new Map([["ſt", "ſt"]])), a.replaceAll(dr, (t, e, s) => e ? e.normalize("NFKC") : _a.get(s));
8184
8168
  }
8185
- function Wd() {
8169
+ function Vd() {
8186
8170
  if (typeof crypto.randomUUID == "function")
8187
8171
  return crypto.randomUUID();
8188
8172
  const a = new Uint8Array(32);
8189
8173
  return crypto.getRandomValues(a), hl(a);
8190
8174
  }
8191
8175
  const co = "pdfjs_internal_id_";
8192
- function Ud(a) {
8176
+ function Xd(a) {
8193
8177
  return Uint8Array.prototype.toBase64 ? a.toBase64() : btoa(hl(a));
8194
8178
  }
8195
8179
  typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
@@ -8198,7 +8182,7 @@ typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
8198
8182
  });
8199
8183
  });
8200
8184
  const Ee = "http://www.w3.org/2000/svg";
8201
- class Rs {
8185
+ class Ls {
8202
8186
  static CSS = 96;
8203
8187
  static PDF = 72;
8204
8188
  static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
@@ -8326,10 +8310,10 @@ function Bn(a) {
8326
8310
  function fo(a) {
8327
8311
  return typeof a == "string" && /\.pdf$/i.test(a);
8328
8312
  }
8329
- function Yd(a) {
8313
+ function Wd(a) {
8330
8314
  return [a] = a.split(/[#?]/, 1), a.substring(a.lastIndexOf("/") + 1);
8331
8315
  }
8332
- function $d(a, t = "document.pdf") {
8316
+ function Ud(a, t = "document.pdf") {
8333
8317
  if (typeof a != "string")
8334
8318
  return t;
8335
8319
  if (Bn(a))
@@ -8416,7 +8400,7 @@ class ll {
8416
8400
  return u = u >= 0 && u <= 59 ? u : 0, l === "-" ? (r += c, o += u) : l === "+" && (r -= c, o -= u), new Date(Date.UTC(s, i, n, r, o, h));
8417
8401
  }
8418
8402
  }
8419
- function qd(a, {
8403
+ function Yd(a, {
8420
8404
  scale: t = 1,
8421
8405
  rotation: e = 0
8422
8406
  }) {
@@ -8438,7 +8422,7 @@ function go(a) {
8438
8422
  }
8439
8423
  return a.startsWith("rgb(") ? a.slice(4, -1).split(",").map((t) => parseInt(t)) : a.startsWith("rgba(") ? a.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (U(`Not a valid color format: "${a}"`), [0, 0, 0]);
8440
8424
  }
8441
- function Kd(a) {
8425
+ function $d(a) {
8442
8426
  const t = document.createElement("span");
8443
8427
  t.style.visibility = "hidden", document.body.append(t);
8444
8428
  for (const e of a.keys()) {
@@ -8587,7 +8571,7 @@ class ni {
8587
8571
  this.#t.remove(), this.#e?.destroy(), this.#e = null;
8588
8572
  }
8589
8573
  }
8590
- class Jd {
8574
+ class qd {
8591
8575
  #t = null;
8592
8576
  #e = null;
8593
8577
  #s;
@@ -8645,14 +8629,14 @@ function yn(a, t, e) {
8645
8629
  for (const s of e)
8646
8630
  t.addEventListener(s, a[s].bind(a));
8647
8631
  }
8648
- class Zd {
8632
+ class Kd {
8649
8633
  #t = 0;
8650
8634
  get id() {
8651
- return `${Dd}${this.#t++}`;
8635
+ return `${Pd}${this.#t++}`;
8652
8636
  }
8653
8637
  }
8654
8638
  class po {
8655
- #t = Wd();
8639
+ #t = Vd();
8656
8640
  #e = 0;
8657
8641
  #s = null;
8658
8642
  static get _isSVGFittingCanvas() {
@@ -8764,7 +8748,7 @@ class po {
8764
8748
  return t.startsWith(`image_${this.#t}_`);
8765
8749
  }
8766
8750
  }
8767
- class Qd {
8751
+ class Jd {
8768
8752
  #t = [];
8769
8753
  #e = !1;
8770
8754
  #s;
@@ -8884,7 +8868,7 @@ class mo {
8884
8868
  static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
8885
8869
  get _colors() {
8886
8870
  const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
8887
- return Kd(t), Y(this, "_colors", t);
8871
+ return $d(t), Y(this, "_colors", t);
8888
8872
  }
8889
8873
  convert(t) {
8890
8874
  const e = go(t);
@@ -8908,7 +8892,7 @@ class Ue {
8908
8892
  #r = null;
8909
8893
  #n = null;
8910
8894
  #h = null;
8911
- #a = new Qd();
8895
+ #a = new Jd();
8912
8896
  #c = null;
8913
8897
  #l = null;
8914
8898
  #d = 0;
@@ -8926,16 +8910,16 @@ class Ue {
8926
8910
  #S = null;
8927
8911
  #A = !1;
8928
8912
  #E = null;
8929
- #M = new Zd();
8913
+ #M = new Kd();
8930
8914
  #x = !1;
8931
8915
  #k = !1;
8932
8916
  #T = null;
8933
8917
  #O = null;
8934
- #R = null;
8918
+ #L = null;
8935
8919
  #I = null;
8936
8920
  #C = W.NONE;
8937
8921
  #y = /* @__PURE__ */ new Set();
8938
- #L = null;
8922
+ #R = null;
8939
8923
  #z = null;
8940
8924
  #G = null;
8941
8925
  #V = {
@@ -9022,7 +9006,7 @@ class Ue {
9022
9006
  }), i._on("switchannotationeditorparams", (p) => this.updateParams(p.type, p.value), {
9023
9007
  signal: g
9024
9008
  }), this.#et(), this.#rt(), this.#$(), this.#n = n.annotationStorage, this.#_ = n.filterFactory, this.#z = r, this.#S = o || null, this.#m = h, this.#p = l, this.#b = c, this.#I = u || null, this.viewParameters = {
9025
- realScale: Rs.PDF_TO_CSS_UNITS,
9009
+ realScale: Ls.PDF_TO_CSS_UNITS,
9026
9010
  rotation: 0
9027
9011
  }, this.isShiftKeyDown = !1, this._editorUndoBar = d || null, this._supportsPinchToZoom = f !== !1;
9028
9012
  }
@@ -9060,7 +9044,7 @@ class Ue {
9060
9044
  t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), this.#l = t;
9061
9045
  }
9062
9046
  setMainHighlightColorPicker(t) {
9063
- this.#R = t;
9047
+ this.#L = t;
9064
9048
  }
9065
9049
  editAltText(t, e = !1) {
9066
9050
  this.#r?.editAltText(this, t, e);
@@ -9124,7 +9108,7 @@ class Ue {
9124
9108
  onScaleChanging({
9125
9109
  scale: t
9126
9110
  }) {
9127
- this.commitOrRemove(), this.viewParameters.realScale = t * Rs.PDF_TO_CSS_UNITS;
9111
+ this.commitOrRemove(), this.viewParameters.realScale = t * Ls.PDF_TO_CSS_UNITS;
9128
9112
  for (const e of this.#g)
9129
9113
  e.onScaleChanging();
9130
9114
  this.#l?.onScaleChanging();
@@ -9188,7 +9172,7 @@ class Ue {
9188
9172
  if (!t || t.isCollapsed)
9189
9173
  return;
9190
9174
  const s = this.#B(t).closest(".textLayer"), i = this.getSelectionBoxes(s);
9191
- i && (this.#E ||= new Jd(this), this.#E.show(s, i, this.direction === "ltr"));
9175
+ i && (this.#E ||= new qd(this), this.#E.show(s, i, this.direction === "ltr"));
9192
9176
  }
9193
9177
  addToAnnotationStorage(t) {
9194
9178
  !t.isEmpty() && this.#n && !this.#n.has(t.id) && this.#n.setValue(t.id, t);
@@ -9196,7 +9180,7 @@ class Ue {
9196
9180
  #tt() {
9197
9181
  const t = document.getSelection();
9198
9182
  if (!t || t.isCollapsed) {
9199
- this.#L && (this.#E?.hide(), this.#L = null, this.#P({
9183
+ this.#R && (this.#E?.hide(), this.#R = null, this.#P({
9200
9184
  hasSelectedText: !1
9201
9185
  }));
9202
9186
  return;
@@ -9204,16 +9188,16 @@ class Ue {
9204
9188
  const {
9205
9189
  anchorNode: e
9206
9190
  } = t;
9207
- if (e === this.#L)
9191
+ if (e === this.#R)
9208
9192
  return;
9209
9193
  const i = this.#B(t).closest(".textLayer");
9210
9194
  if (!i) {
9211
- this.#L && (this.#E?.hide(), this.#L = null, this.#P({
9195
+ this.#R && (this.#E?.hide(), this.#R = null, this.#P({
9212
9196
  hasSelectedText: !1
9213
9197
  }));
9214
9198
  return;
9215
9199
  }
9216
- if (this.#E?.hide(), this.#L = e, this.#P({
9200
+ if (this.#E?.hide(), this.#R = e, this.#P({
9217
9201
  hasSelectedText: !0
9218
9202
  }), !(this.#C !== W.HIGHLIGHT && this.#C !== W.NONE) && (this.#C === W.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#A = this.isShiftKeyDown, !this.isShiftKeyDown)) {
9219
9203
  const n = this.#C === W.HIGHLIGHT ? this.#Y(i) : null;
@@ -9500,7 +9484,7 @@ class Ue {
9500
9484
  this.currentLayer.addNewEditor();
9501
9485
  return;
9502
9486
  case $.HIGHLIGHT_DEFAULT_COLOR:
9503
- this.#R?.updateColor(e);
9487
+ this.#L?.updateColor(e);
9504
9488
  break;
9505
9489
  case $.HIGHLIGHT_SHOW_ALL:
9506
9490
  this._eventBus.dispatch("reporttelemetry", {
@@ -10234,7 +10218,7 @@ class z {
10234
10218
  return Y(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
10235
10219
  }
10236
10220
  static deleteAnnotationElement(t) {
10237
- const e = new tf({
10221
+ const e = new Zd({
10238
10222
  id: t.parent.getNextId(),
10239
10223
  parent: t.parent,
10240
10224
  uiManager: t._uiManager
@@ -10548,7 +10532,7 @@ class z {
10548
10532
  signal: r
10549
10533
  });
10550
10534
  }
10551
- #R(t, e, s, i) {
10535
+ #L(t, e, s, i) {
10552
10536
  this.width = s, this.height = i, this.x = t, this.y = e;
10553
10537
  const [n, r] = this.parentDimensions;
10554
10538
  this.setDims(n * s, r * i), this.fixAndSetPosition(), this._onResized();
@@ -10567,8 +10551,8 @@ class z {
10567
10551
  this.#l = null;
10568
10552
  const n = this.x, r = this.y, o = this.width, h = this.height;
10569
10553
  n === t && r === e && o === s && h === i || this.addCommands({
10570
- cmd: this.#R.bind(this, n, r, o, h),
10571
- undo: this.#R.bind(this, t, e, s, i),
10554
+ cmd: this.#L.bind(this, n, r, o, h),
10555
+ undo: this.#L.bind(this, t, e, s, i),
10572
10556
  mustExec: !0
10573
10557
  });
10574
10558
  }
@@ -10576,32 +10560,32 @@ class z {
10576
10560
  return Math.round(t * 1e4) / 1e4;
10577
10561
  }
10578
10562
  #C(t, e) {
10579
- const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, L) => [u[0] * M + u[2] * L, u[1] * M + u[3] * L], f = this.#k(360 - this.rotation), g = (M, L) => [f[0] * M + f[2] * L, f[1] * M + f[3] * L];
10563
+ const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, R) => [u[0] * M + u[2] * R, u[1] * M + u[3] * R], f = this.#k(360 - this.rotation), g = (M, R) => [f[0] * M + f[2] * R, f[1] * M + f[3] * R];
10580
10564
  let p, b, m = !1, v = !1;
10581
10565
  switch (t) {
10582
10566
  case "topLeft":
10583
- m = !0, p = (M, L) => [0, 0], b = (M, L) => [M, L];
10567
+ m = !0, p = (M, R) => [0, 0], b = (M, R) => [M, R];
10584
10568
  break;
10585
10569
  case "topMiddle":
10586
- p = (M, L) => [M / 2, 0], b = (M, L) => [M / 2, L];
10570
+ p = (M, R) => [M / 2, 0], b = (M, R) => [M / 2, R];
10587
10571
  break;
10588
10572
  case "topRight":
10589
- m = !0, p = (M, L) => [M, 0], b = (M, L) => [0, L];
10573
+ m = !0, p = (M, R) => [M, 0], b = (M, R) => [0, R];
10590
10574
  break;
10591
10575
  case "middleRight":
10592
- v = !0, p = (M, L) => [M, L / 2], b = (M, L) => [0, L / 2];
10576
+ v = !0, p = (M, R) => [M, R / 2], b = (M, R) => [0, R / 2];
10593
10577
  break;
10594
10578
  case "bottomRight":
10595
- m = !0, p = (M, L) => [M, L], b = (M, L) => [0, 0];
10579
+ m = !0, p = (M, R) => [M, R], b = (M, R) => [0, 0];
10596
10580
  break;
10597
10581
  case "bottomMiddle":
10598
- p = (M, L) => [M / 2, L], b = (M, L) => [M / 2, 0];
10582
+ p = (M, R) => [M / 2, R], b = (M, R) => [M / 2, 0];
10599
10583
  break;
10600
10584
  case "bottomLeft":
10601
- m = !0, p = (M, L) => [0, L], b = (M, L) => [M, 0];
10585
+ m = !0, p = (M, R) => [0, R], b = (M, R) => [M, 0];
10602
10586
  break;
10603
10587
  case "middleLeft":
10604
- v = !0, p = (M, L) => [0, L / 2], b = (M, L) => [M, L / 2];
10588
+ v = !0, p = (M, R) => [0, R / 2], b = (M, R) => [M, R / 2];
10605
10589
  break;
10606
10590
  }
10607
10591
  const y = p(o, h), _ = b(o, h);
@@ -10616,18 +10600,18 @@ class z {
10616
10600
  else {
10617
10601
  const {
10618
10602
  screenX: M,
10619
- screenY: L
10603
+ screenY: R
10620
10604
  } = e, [G, it] = this.#c;
10621
- [N, D] = this.screenToPageTranslation(M - G, L - it), this.#c[0] = M, this.#c[1] = L;
10605
+ [N, D] = this.screenToPageTranslation(M - G, R - it), this.#c[0] = M, this.#c[1] = R;
10622
10606
  }
10623
10607
  if ([N, D] = g(N / s, D / i), m) {
10624
10608
  const M = Math.hypot(o, h);
10625
10609
  E = P = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
10626
10610
  } else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : P = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
10627
- const R = z._round(o * E), k = z._round(h * P);
10628
- S = d(...b(R, k));
10611
+ const L = z._round(o * E), k = z._round(h * P);
10612
+ S = d(...b(L, k));
10629
10613
  const O = A - S[0], j = T - S[1];
10630
- this.#o ||= [this.x, this.y, this.width, this.height], this.width = R, this.height = k, this.x = O, this.y = j, this.setDims(s * R, i * k), this.fixAndSetPosition(), this._onResizing();
10614
+ this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x = O, this.y = j, this.setDims(s * L, i * k), this.fixAndSetPosition(), this._onResizing();
10631
10615
  }
10632
10616
  _onResizing() {
10633
10617
  }
@@ -10680,7 +10664,7 @@ class z {
10680
10664
  container: this.div,
10681
10665
  isPinchingDisabled: () => !this.isSelected,
10682
10666
  onPinchStart: this.#y.bind(this),
10683
- onPinching: this.#L.bind(this),
10667
+ onPinching: this.#R.bind(this),
10684
10668
  onPinchEnd: this.#z.bind(this),
10685
10669
  signal: this._uiManager._signal
10686
10670
  })), this._uiManager._editorUndoBar?.hide(), this.div;
@@ -10693,7 +10677,7 @@ class z {
10693
10677
  savedHeight: this.height
10694
10678
  }, this.#s?.toggle(!1), this.parent.togglePointerEvents(!1);
10695
10679
  }
10696
- #L(t, e, s) {
10680
+ #R(t, e, s) {
10697
10681
  let n = 0.7 * (s / e) + 1 - 0.7;
10698
10682
  if (n === 1)
10699
10683
  return;
@@ -11084,7 +11068,7 @@ class z {
11084
11068
  e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
11085
11069
  }
11086
11070
  }
11087
- class tf extends z {
11071
+ class Zd extends z {
11088
11072
  constructor(t) {
11089
11073
  super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
11090
11074
  }
@@ -11129,7 +11113,7 @@ class cl {
11129
11113
  return t ^= e >>> 1, t = t * 3981806797 & Qt | t * 36045 & me, e = e * 4283543511 & Qt | ((e << 16 | t >>> 16) * 2950163797 & Qt) >>> 16, t ^= e >>> 1, t = t * 444984403 & Qt | t * 60499 & me, e = e * 3301882366 & Qt | ((e << 16 | t >>> 16) * 3120437893 & Qt) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
11130
11114
  }
11131
11115
  }
11132
- const Lr = Object.freeze({
11116
+ const Rr = Object.freeze({
11133
11117
  map: null,
11134
11118
  hash: "",
11135
11119
  transfer: void 0
@@ -11190,7 +11174,7 @@ class bo {
11190
11174
  }
11191
11175
  get serializable() {
11192
11176
  if (this.#s.size === 0)
11193
- return Lr;
11177
+ return Rr;
11194
11178
  const t = /* @__PURE__ */ new Map(), e = new cl(), s = [], i = /* @__PURE__ */ Object.create(null);
11195
11179
  let n = !1;
11196
11180
  for (const [r, o] of this.#s) {
@@ -11204,7 +11188,7 @@ class bo {
11204
11188
  map: t,
11205
11189
  hash: e.hexdigest(),
11206
11190
  transfer: s
11207
- } : Lr;
11191
+ } : Rr;
11208
11192
  }
11209
11193
  get editorStats() {
11210
11194
  let t = null;
@@ -11278,7 +11262,7 @@ class ul extends bo {
11278
11262
  });
11279
11263
  }
11280
11264
  }
11281
- class ef {
11265
+ class Qd {
11282
11266
  #t = /* @__PURE__ */ new Set();
11283
11267
  constructor({
11284
11268
  ownerDocument: t = globalThis.document,
@@ -11412,7 +11396,7 @@ class ef {
11412
11396
  let b = s(d, g);
11413
11397
  for (n = 0, r = u.length - 3; n < r; n += 4)
11414
11398
  b = b - p + s(u, n) | 0;
11415
- n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, Hd(b));
11399
+ n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, jd(b));
11416
11400
  const m = `url(data:font/opentype;base64,${btoa(d)});`, v = `@font-face {font-family:"${u}";src:${m}}`;
11417
11401
  this.insertRule(v);
11418
11402
  const y = this._document.createElement("div");
@@ -11426,7 +11410,7 @@ class ef {
11426
11410
  });
11427
11411
  }
11428
11412
  }
11429
- class sf {
11413
+ class tf {
11430
11414
  constructor(t, {
11431
11415
  disableFontFace: e = !1,
11432
11416
  fontExtraProperties: s = !1,
@@ -11454,7 +11438,7 @@ class sf {
11454
11438
  createFontFaceRule() {
11455
11439
  if (!this.data || this.disableFontFace)
11456
11440
  return null;
11457
- const t = `url(data:${this.mimetype};base64,${Ud(this.data)});`;
11441
+ const t = `url(data:${this.mimetype};base64,${Xd(this.data)});`;
11458
11442
  let e;
11459
11443
  if (!this.cssFontInfo)
11460
11444
  e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
@@ -11820,7 +11804,7 @@ class dl {
11820
11804
  tt("Abstract method `_createCanvas` called.");
11821
11805
  }
11822
11806
  }
11823
- class nf extends dl {
11807
+ class ef extends dl {
11824
11808
  constructor({
11825
11809
  ownerDocument: t = globalThis.document,
11826
11810
  enableHWA: e = !1
@@ -11885,7 +11869,7 @@ class pl {
11885
11869
  destroy(t = !1) {
11886
11870
  }
11887
11871
  }
11888
- class rf extends pl {
11872
+ class sf extends pl {
11889
11873
  #t;
11890
11874
  #e;
11891
11875
  #s;
@@ -12021,8 +12005,8 @@ class rf extends pl {
12021
12005
  let E = 0;
12022
12006
  for (let P = 0; P <= y; P++) {
12023
12007
  const N = Math.round(c + P * S), D = A + P * T;
12024
- for (let R = E; R <= N; R++)
12025
- _[R] = D;
12008
+ for (let L = E; L <= N; L++)
12009
+ _[L] = D;
12026
12010
  E = N + 1;
12027
12011
  }
12028
12012
  for (let P = E; P < 256; P++)
@@ -12095,19 +12079,19 @@ async function vl(a) {
12095
12079
  const e = await process.getBuiltinModule("fs").promises.readFile(a);
12096
12080
  return new Uint8Array(e);
12097
12081
  }
12098
- class of extends pl {
12082
+ class nf extends pl {
12099
12083
  }
12100
- class af extends dl {
12084
+ class rf extends dl {
12101
12085
  _createCanvas(t, e) {
12102
12086
  return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
12103
12087
  }
12104
12088
  }
12105
- class hf extends fl {
12089
+ class of extends fl {
12106
12090
  async _fetch(t) {
12107
12091
  return vl(t);
12108
12092
  }
12109
12093
  }
12110
- class lf extends ml {
12094
+ class af extends ml {
12111
12095
  async _fetch(t) {
12112
12096
  return vl(t);
12113
12097
  }
@@ -12117,7 +12101,7 @@ const Et = {
12117
12101
  STROKE: "Stroke",
12118
12102
  SHADING: "Shading"
12119
12103
  };
12120
- function Rr(a, t) {
12104
+ function Lr(a, t) {
12121
12105
  if (!t)
12122
12106
  return;
12123
12107
  const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
@@ -12128,7 +12112,7 @@ class vo {
12128
12112
  tt("Abstract method `getPattern` called.");
12129
12113
  }
12130
12114
  }
12131
- class cf extends vo {
12115
+ class hf extends vo {
12132
12116
  constructor(t) {
12133
12117
  super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
12134
12118
  }
@@ -12143,11 +12127,11 @@ class cf extends vo {
12143
12127
  let n;
12144
12128
  if (i === Et.STROKE || i === Et.FILL) {
12145
12129
  const r = e.current.getClippedPathBoundingBox(i, rt(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, h = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", o, h), c = l.context;
12146
- c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = B.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Rr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
12130
+ c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = B.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Lr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
12147
12131
  const u = new DOMMatrix(s);
12148
12132
  n.setTransform(u);
12149
12133
  } else
12150
- Rr(t, this._bbox), n = this._createGradient(t);
12134
+ Lr(t, this._bbox), n = this._createGradient(t);
12151
12135
  return n;
12152
12136
  }
12153
12137
  }
@@ -12158,25 +12142,25 @@ function fr(a, t, e, s, i, n, r, o) {
12158
12142
  const f = (h[e] + t.offsetX) * t.scaleX, g = (h[e + 1] + t.offsetY) * t.scaleY, p = (h[s] + t.offsetX) * t.scaleX, b = (h[s + 1] + t.offsetY) * t.scaleY, m = (h[i] + t.offsetX) * t.scaleX, v = (h[i + 1] + t.offsetY) * t.scaleY;
12159
12143
  if (g >= v)
12160
12144
  return;
12161
- const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], P = l[o], N = l[o + 1], D = l[o + 2], R = Math.round(g), k = Math.round(v);
12162
- let O, j, M, L, G, it, at, xt;
12163
- for (let gt = R; gt <= k; gt++) {
12145
+ const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], P = l[o], N = l[o + 1], D = l[o + 2], L = Math.round(g), k = Math.round(v);
12146
+ let O, j, M, R, G, it, at, xt;
12147
+ for (let gt = L; gt <= k; gt++) {
12164
12148
  if (gt < b) {
12165
12149
  const K = gt < g ? 0 : (g - gt) / (g - b);
12166
- O = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, L = S - (S - E) * K;
12150
+ O = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, R = S - (S - E) * K;
12167
12151
  } else {
12168
12152
  let K;
12169
- gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), O = p - (p - m) * K, j = A - (A - P) * K, M = T - (T - N) * K, L = E - (E - D) * K;
12153
+ gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), O = p - (p - m) * K, j = A - (A - P) * K, M = T - (T - N) * K, R = E - (E - D) * K;
12170
12154
  }
12171
12155
  let et;
12172
12156
  gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - P) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
12173
12157
  const Pt = Math.round(Math.min(O, G)), fe = Math.round(Math.max(O, G));
12174
12158
  let ht = u * gt + Pt * 4;
12175
12159
  for (let K = Pt; K <= fe; K++)
12176
- et = (O - K) / (O - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = L - (L - xt) * et | 0, c[ht++] = 255;
12160
+ et = (O - K) / (O - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = R - (R - xt) * et | 0, c[ht++] = 255;
12177
12161
  }
12178
12162
  }
12179
- function uf(a, t, e) {
12163
+ function lf(a, t, e) {
12180
12164
  const s = t.coords, i = t.colors;
12181
12165
  let n, r;
12182
12166
  switch (t.type) {
@@ -12196,7 +12180,7 @@ function uf(a, t, e) {
12196
12180
  throw new Error("illegal figure");
12197
12181
  }
12198
12182
  }
12199
- class df extends vo {
12183
+ class cf extends vo {
12200
12184
  constructor(t) {
12201
12185
  super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[7], this._background = t[8], this.matrix = null;
12202
12186
  }
@@ -12215,7 +12199,7 @@ class df extends vo {
12215
12199
  A[T] = e[0], A[T + 1] = e[1], A[T + 2] = e[2], A[T + 3] = 255;
12216
12200
  }
12217
12201
  for (const A of this._figures)
12218
- uf(_, A, p);
12202
+ lf(_, A, p);
12219
12203
  return y.putImageData(_, 2, 2), {
12220
12204
  canvas: v.canvas,
12221
12205
  offsetX: o - 2 * f,
@@ -12225,7 +12209,7 @@ class df extends vo {
12225
12209
  };
12226
12210
  }
12227
12211
  getPattern(t, e, s, i) {
12228
- Rr(t, this._bbox);
12212
+ Lr(t, this._bbox);
12229
12213
  let n;
12230
12214
  if (i === Et.SHADING)
12231
12215
  n = B.singularValueDecompose2dScale(rt(t));
@@ -12237,19 +12221,19 @@ class df extends vo {
12237
12221
  return i !== Et.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(r.offsetX, r.offsetY), t.scale(r.scaleX, r.scaleY), t.createPattern(r.canvas, "no-repeat");
12238
12222
  }
12239
12223
  }
12240
- class ff extends vo {
12224
+ class uf extends vo {
12241
12225
  getPattern() {
12242
12226
  return "hotpink";
12243
12227
  }
12244
12228
  }
12245
- function gf(a) {
12229
+ function df(a) {
12246
12230
  switch (a[0]) {
12247
12231
  case "RadialAxial":
12248
- return new cf(a);
12232
+ return new hf(a);
12249
12233
  case "Mesh":
12250
- return new df(a);
12234
+ return new cf(a);
12251
12235
  case "Dummy":
12252
- return new ff();
12236
+ return new uf();
12253
12237
  }
12254
12238
  throw new Error(`Unknown IR type: ${a[0]}`);
12255
12239
  }
@@ -12280,14 +12264,14 @@ class yo {
12280
12264
  let _ = g, S = p, A = !1, T = !1;
12281
12265
  const E = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
12282
12266
  E >= N ? _ = h : A = !0, P >= D ? S = l : T = !0;
12283
- const R = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), O = t.cachedCanvases.getCanvas("pattern", R.size, k.size), j = O.context, M = o.createCanvasGraphics(j);
12284
- if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-R.scale * c, -k.scale * u), M.transform(R.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
12285
- const L = O.canvas;
12267
+ const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), O = t.cachedCanvases.getCanvas("pattern", L.size, k.size), j = O.context, M = o.createCanvasGraphics(j);
12268
+ if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-L.scale * c, -k.scale * u), M.transform(L.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
12269
+ const R = O.canvas;
12286
12270
  A && (_ = h), T && (S = l);
12287
12271
  const G = this.getSizeAndScale(_, this.ctx.canvas.width, v), it = this.getSizeAndScale(S, this.ctx.canvas.height, y), at = G.size, xt = it.size, gt = t.cachedCanvases.getCanvas("pattern-workaround", at, xt), et = gt.context, Pt = A ? Math.floor(g / h) : 0, fe = T ? Math.floor(p / l) : 0;
12288
12272
  for (let ht = 0; ht <= Pt; ht++)
12289
12273
  for (let K = 0; K <= fe; K++)
12290
- et.drawImage(L, at * ht, xt * K, at, xt, 0, 0, at, xt);
12274
+ et.drawImage(R, at * ht, xt * K, at, xt, 0, 0, at, xt);
12291
12275
  return {
12292
12276
  canvas: gt.canvas,
12293
12277
  scaleX: G.scale,
@@ -12298,7 +12282,7 @@ class yo {
12298
12282
  }
12299
12283
  return {
12300
12284
  canvas: O.canvas,
12301
- scaleX: R.scale,
12285
+ scaleX: L.scale,
12302
12286
  scaleY: k.scale,
12303
12287
  offsetX: c,
12304
12288
  offsetY: u
@@ -12328,7 +12312,7 @@ class yo {
12328
12312
  i.fillStyle = o, i.strokeStyle = o, n.fillColor = o, n.strokeColor = o;
12329
12313
  break;
12330
12314
  default:
12331
- throw new Bd(`Unsupported paint type: ${e}`);
12315
+ throw new Nd(`Unsupported paint type: ${e}`);
12332
12316
  }
12333
12317
  }
12334
12318
  getPattern(t, e, s, i) {
@@ -12341,7 +12325,7 @@ class yo {
12341
12325
  return h.setTransform(o), h;
12342
12326
  }
12343
12327
  }
12344
- function pf({
12328
+ function ff({
12345
12329
  src: a,
12346
12330
  srcPos: t = 0,
12347
12331
  dest: e,
@@ -12369,8 +12353,8 @@ function pf({
12369
12353
  destPos: f
12370
12354
  };
12371
12355
  }
12372
- const Aa = 16, Ta = 100, mf = 15, Ea = 10, ka = 1e3, Vt = 16;
12373
- function bf(a, t) {
12356
+ const Aa = 16, Ta = 100, gf = 15, Ea = 10, ka = 1e3, Vt = 16;
12357
+ function pf(a, t) {
12374
12358
  if (a._removeMirroring)
12375
12359
  throw new Error("Context is already forwarding operations.");
12376
12360
  a.__originalSave = a.save, a.__originalRestore = a.restore, a.__originalRotate = a.rotate, a.__originalScale = a.scale, a.__originalTranslate = a.translate, a.__originalTransform = a.transform, a.__originalSetTransform = a.setTransform, a.__originalResetTransform = a.resetTransform, a.__originalClip = a.clip, a.__originalMoveTo = a.moveTo, a.__originalLineTo = a.lineTo, a.__originalBezierCurveTo = a.bezierCurveTo, a.__originalRect = a.rect, a.__originalClosePath = a.closePath, a.__originalBeginPath = a.beginPath, a._removeMirroring = () => {
@@ -12407,7 +12391,7 @@ function bf(a, t) {
12407
12391
  t.beginPath(), this.__originalBeginPath();
12408
12392
  };
12409
12393
  }
12410
- class vf {
12394
+ class mf {
12411
12395
  constructor(t) {
12412
12396
  this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
12413
12397
  }
@@ -12439,7 +12423,7 @@ function Ui(a, t, e, s, i, n, r, o, h, l) {
12439
12423
  const b = Math.hypot(c, u), m = Math.hypot(d, f);
12440
12424
  return [b * h, m * l];
12441
12425
  }
12442
- function yf(a) {
12426
+ function bf(a) {
12443
12427
  const {
12444
12428
  width: t,
12445
12429
  height: e
@@ -12594,7 +12578,7 @@ function Oa(a, t) {
12594
12578
  const d = u < n ? Vt : i;
12595
12579
  ({
12596
12580
  srcPos: h
12597
- } = pf({
12581
+ } = ff({
12598
12582
  src: l,
12599
12583
  srcPos: h,
12600
12584
  dest: c,
@@ -12623,16 +12607,16 @@ function Da(a, t) {
12623
12607
  return !0;
12624
12608
  const e = B.singularValueDecompose2dScale(a);
12625
12609
  e[0] = Math.fround(e[0]), e[1] = Math.fround(e[1]);
12626
- const s = Math.fround((globalThis.devicePixelRatio || 1) * Rs.PDF_TO_CSS_UNITS);
12610
+ const s = Math.fround((globalThis.devicePixelRatio || 1) * Ls.PDF_TO_CSS_UNITS);
12627
12611
  return e[0] <= s && e[1] <= s;
12628
12612
  }
12629
- const _f = ["butt", "round", "square"], wf = ["miter", "round", "bevel"], xf = {}, La = {};
12613
+ const vf = ["butt", "round", "square"], yf = ["miter", "round", "bevel"], _f = {}, Ra = {};
12630
12614
  class Es {
12631
12615
  constructor(t, e, s, i, n, {
12632
12616
  optionalContentConfig: r,
12633
12617
  markedContentStack: o = null
12634
12618
  }, h, l) {
12635
- this.ctx = t, this.current = new Ma(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new vf(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12619
+ this.ctx = t, this.current = new Ma(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new mf(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12636
12620
  }
12637
12621
  getObject(t, e = null) {
12638
12622
  return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
@@ -12656,7 +12640,7 @@ class Es {
12656
12640
  const h = n.length;
12657
12641
  if (h === o)
12658
12642
  return o;
12659
- const l = h - o > Ea && typeof s == "function", c = l ? Date.now() + mf : 0;
12643
+ const l = h - o > Ea && typeof s == "function", c = l ? Date.now() + gf : 0;
12660
12644
  let u = 0;
12661
12645
  const d = this.commonObjs, f = this.objs;
12662
12646
  let g;
@@ -12752,10 +12736,10 @@ class Es {
12752
12736
  t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
12753
12737
  }
12754
12738
  setLineCap(t) {
12755
- this.ctx.lineCap = _f[t];
12739
+ this.ctx.lineCap = vf[t];
12756
12740
  }
12757
12741
  setLineJoin(t) {
12758
- this.ctx.lineJoin = wf[t];
12742
+ this.ctx.lineJoin = yf[t];
12759
12743
  }
12760
12744
  setMiterLimit(t) {
12761
12745
  this.ctx.miterLimit = t;
@@ -12825,7 +12809,7 @@ class Es {
12825
12809
  const t = this.ctx.canvas.width, e = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(s, t, e);
12826
12810
  this.suspendedCtx = this.ctx, this.ctx = i.context;
12827
12811
  const n = this.ctx;
12828
- n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n), bf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
12812
+ n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n), pf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
12829
12813
  }
12830
12814
  endSMaskMode() {
12831
12815
  if (!this.inSMaskMode)
@@ -12939,10 +12923,10 @@ class Es {
12939
12923
  this.consumePath();
12940
12924
  }
12941
12925
  clip() {
12942
- this.pendingClip = xf;
12926
+ this.pendingClip = _f;
12943
12927
  }
12944
12928
  eoClip() {
12945
- this.pendingClip = La;
12929
+ this.pendingClip = Ra;
12946
12930
  }
12947
12931
  beginText() {
12948
12932
  this.current.textMatrix = al, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
@@ -13096,25 +13080,25 @@ class Es {
13096
13080
  }
13097
13081
  let E = !1;
13098
13082
  const P = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
13099
- let R, k, O = T.width;
13083
+ let L, k, O = T.width;
13100
13084
  if (d) {
13101
- const M = T.vmetric || g, L = -(T.vmetric ? M[1] : O * 0.5) * p, G = M[2] * p;
13102
- O = M ? -M[0] : O, R = L / r, k = (S + G) / r;
13085
+ const M = T.vmetric || g, R = -(T.vmetric ? M[1] : O * 0.5) * p, G = M[2] * p;
13086
+ O = M ? -M[0] : O, L = R / r, k = (S + G) / r;
13103
13087
  } else
13104
- R = S / r, k = 0;
13088
+ L = S / r, k = 0;
13105
13089
  if (s.remeasure && O > 0) {
13106
13090
  const M = n.measureText(N).width * 1e3 / i * r;
13107
13091
  if (O < M && this.isFontSubpixelAAEnabled) {
13108
- const L = O / M;
13109
- E = !0, n.save(), n.scale(L, 1), R /= L;
13110
- } else O !== M && (R += (O - M) / 2e3 * i / r);
13092
+ const R = O / M;
13093
+ E = !0, n.save(), n.scale(R, 1), L /= R;
13094
+ } else O !== M && (L += (O - M) / 2e3 * i / r);
13111
13095
  }
13112
13096
  if (this.contentVisible && (T.isInFont || s.missingFile)) {
13113
13097
  if (b && !D)
13114
- n.fillText(N, R, k);
13115
- else if (this.paintChar(N, R, k, m, v), D) {
13116
- const M = R + i * D.offset.x / r, L = k - i * D.offset.y / r;
13117
- this.paintChar(D.fontChar, M, L, m, v);
13098
+ n.fillText(N, L, k);
13099
+ else if (this.paintChar(N, L, k, m, v), D) {
13100
+ const M = L + i * D.offset.x / r, R = k - i * D.offset.y / r;
13101
+ this.paintChar(D.fontChar, M, R, m, v);
13118
13102
  }
13119
13103
  }
13120
13104
  const j = d ? O * p - P * l : O * p + P * l;
@@ -13180,7 +13164,7 @@ class Es {
13180
13164
  }
13181
13165
  _getPattern(t, e = null) {
13182
13166
  let s;
13183
- return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = gf(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13167
+ return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = df(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13184
13168
  }
13185
13169
  shadingFill(t) {
13186
13170
  if (!this.contentVisible)
@@ -13286,7 +13270,7 @@ class Es {
13286
13270
  const e = t.count;
13287
13271
  t = this.getObject(t.data, t), t.count = e;
13288
13272
  const s = this.ctx, i = this.processingType3;
13289
- if (i && (i.compiled === void 0 && (i.compiled = yf(t)), i.compiled)) {
13273
+ if (i && (i.compiled === void 0 && (i.compiled = bf(t)), i.compiled)) {
13290
13274
  i.compiled(s);
13291
13275
  return;
13292
13276
  }
@@ -13436,7 +13420,7 @@ class Es {
13436
13420
  const e = this.current.isEmptyClip();
13437
13421
  this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(t);
13438
13422
  const s = this.ctx;
13439
- this.pendingClip && (e || (this.pendingClip === La ? s.clip("evenodd") : s.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), s.beginPath();
13423
+ this.pendingClip && (e || (this.pendingClip === Ra ? s.clip("evenodd") : s.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), s.beginPath();
13440
13424
  }
13441
13425
  getSinglePixelWidth() {
13442
13426
  if (!this._cachedGetSinglePixelWidth) {
@@ -13535,7 +13519,7 @@ class ri {
13535
13519
  this.#e = t;
13536
13520
  }
13537
13521
  }
13538
- class Sf {
13522
+ class wf {
13539
13523
  #t;
13540
13524
  #e;
13541
13525
  constructor({
@@ -13558,7 +13542,7 @@ class Sf {
13558
13542
  }
13559
13543
  }
13560
13544
  const _s = Symbol("INTERNAL");
13561
- class Cf {
13545
+ class xf {
13562
13546
  #t = !1;
13563
13547
  #e = !1;
13564
13548
  #s = !1;
@@ -13586,7 +13570,7 @@ class Cf {
13586
13570
  t !== _s && tt("Internal method `_setVisible` called."), this.#s = s, this.#i = e;
13587
13571
  }
13588
13572
  }
13589
- class Af {
13573
+ class Sf {
13590
13574
  #t = null;
13591
13575
  #e = /* @__PURE__ */ new Map();
13592
13576
  #s = null;
@@ -13595,7 +13579,7 @@ class Af {
13595
13579
  if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
13596
13580
  this.name = t.name, this.creator = t.creator, this.#i = t.order;
13597
13581
  for (const s of t.groups)
13598
- this.#e.set(s.id, new Cf(e, s));
13582
+ this.#e.set(s.id, new xf(e, s));
13599
13583
  if (t.baseState === "OFF")
13600
13584
  for (const s of this.#e.values())
13601
13585
  s._setVisible(_s, !1);
@@ -13746,7 +13730,7 @@ class Af {
13746
13730
  return this.#t = t.hexdigest();
13747
13731
  }
13748
13732
  }
13749
- class Tf {
13733
+ class Cf {
13750
13734
  constructor(t, {
13751
13735
  disableRange: e = !1,
13752
13736
  disableStream: s = !1
@@ -13815,12 +13799,12 @@ class Tf {
13815
13799
  getFullReader() {
13816
13800
  bt(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
13817
13801
  const t = this._queuedChunks;
13818
- return this._queuedChunks = null, new Ef(this, t, this._progressiveDone, this._contentDispositionFilename);
13802
+ return this._queuedChunks = null, new Af(this, t, this._progressiveDone, this._contentDispositionFilename);
13819
13803
  }
13820
13804
  getRangeReader(t, e) {
13821
13805
  if (e <= this._progressiveDataLength)
13822
13806
  return null;
13823
- const s = new kf(this, t, e);
13807
+ const s = new Tf(this, t, e);
13824
13808
  return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(s), s;
13825
13809
  }
13826
13810
  cancelAllRequests(t) {
@@ -13830,7 +13814,7 @@ class Tf {
13830
13814
  this._pdfDataRangeTransport.abort();
13831
13815
  }
13832
13816
  }
13833
- class Ef {
13817
+ class Af {
13834
13818
  constructor(t, e, s = !1, i = null) {
13835
13819
  this._stream = t, this._done = s || !1, this._filename = fo(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
13836
13820
  for (const n of this._queuedChunks)
@@ -13885,7 +13869,7 @@ class Ef {
13885
13869
  this._done || (this._done = !0);
13886
13870
  }
13887
13871
  }
13888
- class kf {
13872
+ class Tf {
13889
13873
  constructor(t, e, s) {
13890
13874
  this._stream = t, this._begin = e, this._end = s, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
13891
13875
  }
@@ -13937,7 +13921,7 @@ class kf {
13937
13921
  this._requests.length = 0, this._stream._removeRangeReader(this);
13938
13922
  }
13939
13923
  }
13940
- function Mf(a) {
13924
+ function Ef(a) {
13941
13925
  let t = !0, e = s("filename\\*", "i").exec(a);
13942
13926
  if (e) {
13943
13927
  e = e[1];
@@ -14058,7 +14042,7 @@ function _l({
14058
14042
  function wl(a) {
14059
14043
  const t = a.get("Content-Disposition");
14060
14044
  if (t) {
14061
- let e = Mf(t);
14045
+ let e = Ef(t);
14062
14046
  if (e.includes("%"))
14063
14047
  try {
14064
14048
  e = decodeURIComponent(e);
@@ -14088,7 +14072,7 @@ function Sl(a, t, e) {
14088
14072
  function Cl(a) {
14089
14073
  return a instanceof Uint8Array ? a.buffer : a instanceof ArrayBuffer ? a : (U(`getArrayBuffer - unexpected data format: ${a}`), new Uint8Array(a).buffer);
14090
14074
  }
14091
- class Ra {
14075
+ class La {
14092
14076
  _responseOrigin = null;
14093
14077
  constructor(t) {
14094
14078
  this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = yl(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
@@ -14097,12 +14081,12 @@ class Ra {
14097
14081
  return this._fullRequestReader?._loaded ?? 0;
14098
14082
  }
14099
14083
  getFullReader() {
14100
- return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Pf(this), this._fullRequestReader;
14084
+ return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new kf(this), this._fullRequestReader;
14101
14085
  }
14102
14086
  getRangeReader(t, e) {
14103
14087
  if (e <= this._progressiveDataLength)
14104
14088
  return null;
14105
- const s = new Of(this, t, e);
14089
+ const s = new Mf(this, t, e);
14106
14090
  return this._rangeRequestReaders.push(s), s;
14107
14091
  }
14108
14092
  cancelAllRequests(t) {
@@ -14111,7 +14095,7 @@ class Ra {
14111
14095
  e.cancel(t);
14112
14096
  }
14113
14097
  }
14114
- class Pf {
14098
+ class kf {
14115
14099
  constructor(t) {
14116
14100
  this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
14117
14101
  const e = t.source;
@@ -14169,7 +14153,7 @@ class Pf {
14169
14153
  this._reader?.cancel(t), this._abortController.abort();
14170
14154
  }
14171
14155
  }
14172
- class Of {
14156
+ class Mf {
14173
14157
  constructor(t, e, s) {
14174
14158
  this._stream = t, this._reader = null, this._loaded = 0;
14175
14159
  const i = t.source;
@@ -14210,11 +14194,11 @@ class Of {
14210
14194
  }
14211
14195
  }
14212
14196
  const gr = 200, pr = 206;
14213
- function Df(a) {
14197
+ function Pf(a) {
14214
14198
  const t = a.response;
14215
14199
  return typeof t != "string" ? t : Nn(t).buffer;
14216
14200
  }
14217
- class Lf {
14201
+ class Of {
14218
14202
  _responseOrigin = null;
14219
14203
  constructor({
14220
14204
  url: t,
@@ -14254,7 +14238,7 @@ class Lf {
14254
14238
  s.onError(i.status);
14255
14239
  return;
14256
14240
  }
14257
- const o = Df(i);
14241
+ const o = Pf(i);
14258
14242
  if (n === pr) {
14259
14243
  const h = i.getResponseHeader("Content-Range"), l = /bytes (\d+)-(\d+)\/(\d+)/.exec(h);
14260
14244
  l ? s.onDone({
@@ -14277,19 +14261,19 @@ class Lf {
14277
14261
  delete this.pendingRequests[t], e.abort();
14278
14262
  }
14279
14263
  }
14280
- class Rf {
14264
+ class Df {
14281
14265
  constructor(t) {
14282
- this._source = t, this._manager = new Lf(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14266
+ this._source = t, this._manager = new Of(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14283
14267
  }
14284
14268
  _onRangeRequestReaderClosed(t) {
14285
14269
  const e = this._rangeRequestReaders.indexOf(t);
14286
14270
  e >= 0 && this._rangeRequestReaders.splice(e, 1);
14287
14271
  }
14288
14272
  getFullReader() {
14289
- return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Ff(this._manager, this._source), this._fullRequestReader;
14273
+ return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Rf(this._manager, this._source), this._fullRequestReader;
14290
14274
  }
14291
14275
  getRangeReader(t, e) {
14292
- const s = new If(this._manager, t, e);
14276
+ const s = new Lf(this._manager, t, e);
14293
14277
  return s.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(s), s;
14294
14278
  }
14295
14279
  cancelAllRequests(t) {
@@ -14298,7 +14282,7 @@ class Rf {
14298
14282
  e.cancel(t);
14299
14283
  }
14300
14284
  }
14301
- class Ff {
14285
+ class Rf {
14302
14286
  constructor(t, e) {
14303
14287
  this._manager = t, this._url = e.url, this._fullRequestId = t.request({
14304
14288
  onHeadersReceived: this._onHeadersReceived.bind(this),
@@ -14390,7 +14374,7 @@ class Ff {
14390
14374
  this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
14391
14375
  }
14392
14376
  }
14393
- class If {
14377
+ class Lf {
14394
14378
  constructor(t, e, s) {
14395
14379
  this._manager = t, this._url = t.url, this._requestId = t.request({
14396
14380
  begin: e,
@@ -14463,27 +14447,27 @@ class If {
14463
14447
  this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
14464
14448
  }
14465
14449
  }
14466
- const Nf = /^[a-z][a-z0-9\-+.]+:/i;
14467
- function jf(a) {
14468
- if (Nf.test(a))
14450
+ const Ff = /^[a-z][a-z0-9\-+.]+:/i;
14451
+ function If(a) {
14452
+ if (Ff.test(a))
14469
14453
  return new URL(a);
14470
14454
  const t = process.getBuiltinModule("url");
14471
14455
  return new URL(t.pathToFileURL(a));
14472
14456
  }
14473
- class Bf {
14457
+ class Nf {
14474
14458
  constructor(t) {
14475
- this.source = t, this.url = jf(t.url), bt(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14459
+ this.source = t, this.url = If(t.url), bt(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14476
14460
  }
14477
14461
  get _progressiveDataLength() {
14478
14462
  return this._fullRequestReader?._loaded ?? 0;
14479
14463
  }
14480
14464
  getFullReader() {
14481
- return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Hf(this), this._fullRequestReader;
14465
+ return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new jf(this), this._fullRequestReader;
14482
14466
  }
14483
14467
  getRangeReader(t, e) {
14484
14468
  if (e <= this._progressiveDataLength)
14485
14469
  return null;
14486
- const s = new zf(this, t, e);
14470
+ const s = new Bf(this, t, e);
14487
14471
  return this._rangeRequestReaders.push(s), s;
14488
14472
  }
14489
14473
  cancelAllRequests(t) {
@@ -14492,7 +14476,7 @@ class Bf {
14492
14476
  e.cancel(t);
14493
14477
  }
14494
14478
  }
14495
- class Hf {
14479
+ class jf {
14496
14480
  constructor(t) {
14497
14481
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
14498
14482
  const e = t.source;
@@ -14556,7 +14540,7 @@ class Hf {
14556
14540
  }), !this._isStreamingSupported && this._isRangeSupported && this._error(new We("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
14557
14541
  }
14558
14542
  }
14559
- class zf {
14543
+ class Bf {
14560
14544
  constructor(t, e, s) {
14561
14545
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
14562
14546
  const i = t.source;
@@ -14606,7 +14590,7 @@ class zf {
14606
14590
  }), this._storedError && this._readableStream.destroy(this._storedError);
14607
14591
  }
14608
14592
  }
14609
- const Gf = 1e5, zt = 30, Vf = 0.8;
14593
+ const Hf = 1e5, zt = 30, zf = 0.8;
14610
14594
  class Dt {
14611
14595
  #t = Promise.withResolvers();
14612
14596
  #e = null;
@@ -14719,7 +14703,7 @@ class Dt {
14719
14703
  this.#n.ctx ??= Dt.#k(this.#r);
14720
14704
  const e = this.#m, s = this.#o;
14721
14705
  for (const i of t) {
14722
- if (e.length > Gf) {
14706
+ if (e.length > Hf) {
14723
14707
  U("Ignoring additional textDivs for performance reasons."), this.#s = !0;
14724
14708
  return;
14725
14709
  }
@@ -14748,7 +14732,7 @@ class Dt {
14748
14732
  r.vertical && (n += Math.PI / 2);
14749
14733
  let o = this.#i && r.fontSubstitution || r.fontFamily;
14750
14734
  o = Dt.fontFamilyMap.get(o) || o;
14751
- const h = Math.hypot(i[2], i[3]), l = h * Dt.#R(o, this.#r);
14735
+ const h = Math.hypot(i[2], i[3]), l = h * Dt.#L(o, this.#r);
14752
14736
  let c, u;
14753
14737
  n === 0 ? (c = i[4], u = i[5] - l) : (c = i[4] + l * Math.sin(n), u = i[5] - l * Math.cos(n));
14754
14738
  const d = "calc(var(--scale-factor)*", f = e.style;
@@ -14823,7 +14807,7 @@ class Dt {
14823
14807
  const t = document.createElement("div");
14824
14808
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#S = t.getBoundingClientRect().height, t.remove();
14825
14809
  }
14826
- static #R(t, e) {
14810
+ static #L(t, e) {
14827
14811
  const s = this.#_.get(t);
14828
14812
  if (s)
14829
14813
  return s;
@@ -14850,7 +14834,7 @@ class Dt {
14850
14834
  break;
14851
14835
  }
14852
14836
  i.canvas.width = i.canvas.height = 0;
14853
- const l = r ? r / (r + o) : Vf;
14837
+ const l = r ? r / (r + o) : zf;
14854
14838
  return this.#_.set(t, l), l;
14855
14839
  }
14856
14840
  }
@@ -14882,8 +14866,8 @@ class ui {
14882
14866
  return !(t === "textarea" || t === "input" || t === "option" || t === "select");
14883
14867
  }
14884
14868
  }
14885
- const Xf = 65536, Wf = 100, Uf = 5e3, Yf = kt ? af : nf, $f = kt ? hf : gl, qf = kt ? of : rf, Kf = kt ? lf : bl;
14886
- function Jf(a = {}) {
14869
+ const Gf = 65536, Vf = 100, Xf = 5e3, Wf = kt ? rf : ef, Uf = kt ? of : gl, Yf = kt ? nf : sf, $f = kt ? af : bl;
14870
+ function qf(a = {}) {
14887
14871
  typeof a == "string" || a instanceof URL ? a = {
14888
14872
  url: a
14889
14873
  } : (a instanceof ArrayBuffer || ArrayBuffer.isView(a)) && (a = {
@@ -14891,16 +14875,16 @@ function Jf(a = {}) {
14891
14875
  });
14892
14876
  const t = new _o(), {
14893
14877
  docId: e
14894
- } = t, s = a.url ? Zf(a.url) : null, i = a.data ? Qf(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Xf;
14878
+ } = t, s = a.url ? Kf(a.url) : null, i = a.data ? Jf(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Gf;
14895
14879
  let c = a.worker instanceof ks ? a.worker : null;
14896
- const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || $f, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || Kf, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, R = a.disableRange === !0, k = a.disableStream === !0, O = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Yf, L = a.FilterFactory || qf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14897
- Fd(u);
14880
+ const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || Uf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || $f, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, L = a.disableRange === !0, k = a.disableStream === !0, O = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Wf, R = a.FilterFactory || Yf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14881
+ Rd(u);
14898
14882
  const et = {
14899
14883
  canvasFactory: new M({
14900
14884
  ownerDocument: D,
14901
14885
  enableHWA: G
14902
14886
  }),
14903
- filterFactory: new L({
14887
+ filterFactory: new R({
14904
14888
  docId: e,
14905
14889
  ownerDocument: D
14906
14890
  }),
@@ -14961,8 +14945,8 @@ function Jf(a = {}) {
14961
14945
  const ht = c.messageHandler.sendWithPromise("GetDocRequest", Pt, i ? [i.buffer] : null);
14962
14946
  let K;
14963
14947
  if (h)
14964
- K = new Tf(h, {
14965
- disableRange: R,
14948
+ K = new Cf(h, {
14949
+ disableRange: L,
14966
14950
  disableStream: k
14967
14951
  });
14968
14952
  else if (!i) {
@@ -14973,18 +14957,18 @@ function Jf(a = {}) {
14973
14957
  if (Ks(s)) {
14974
14958
  if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
14975
14959
  throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
14976
- je = Ra;
14960
+ je = La;
14977
14961
  } else
14978
- je = Bf;
14962
+ je = Nf;
14979
14963
  else
14980
- je = Ks(s) ? Ra : Rf;
14964
+ je = Ks(s) ? La : Df;
14981
14965
  K = new je({
14982
14966
  url: s,
14983
14967
  length: it,
14984
14968
  httpHeaders: n,
14985
14969
  withCredentials: r,
14986
14970
  rangeChunkSize: l,
14987
- disableRange: R,
14971
+ disableRange: L,
14988
14972
  disableStream: k
14989
14973
  });
14990
14974
  }
@@ -14993,12 +14977,12 @@ function Jf(a = {}) {
14993
14977
  throw new Error("Loading aborted");
14994
14978
  if (c.destroyed)
14995
14979
  throw new Error("Worker was destroyed");
14996
- const ms = new Js(e, je, c.port), ge = new ig(ms, t, K, fe, et);
14980
+ const ms = new Js(e, je, c.port), ge = new eg(ms, t, K, fe, et);
14997
14981
  t._transport = ge, ms.send("Ready", null);
14998
14982
  });
14999
14983
  }).catch(t._capability.reject), t;
15000
14984
  }
15001
- function Zf(a) {
14985
+ function Kf(a) {
15002
14986
  if (a instanceof URL)
15003
14987
  return a.href;
15004
14988
  try {
@@ -15009,7 +14993,7 @@ function Zf(a) {
15009
14993
  }
15010
14994
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
15011
14995
  }
15012
- function Qf(a) {
14996
+ function Jf(a) {
15013
14997
  if (kt && typeof Buffer < "u" && a instanceof Buffer)
15014
14998
  throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
15015
14999
  if (a instanceof Uint8Array && a.byteLength === a.buffer.byteLength)
@@ -15088,7 +15072,7 @@ class Al {
15088
15072
  abort() {
15089
15073
  }
15090
15074
  }
15091
- class tg {
15075
+ class Zf {
15092
15076
  constructor(t, e) {
15093
15077
  this._pdfInfo = t, this._transport = e;
15094
15078
  }
@@ -15200,7 +15184,7 @@ class tg {
15200
15184
  return this._transport.getCalculationOrderIds();
15201
15185
  }
15202
15186
  }
15203
- class eg {
15187
+ class Qf {
15204
15188
  #t = null;
15205
15189
  #e = !1;
15206
15190
  constructor(t, e, s, i = !1) {
@@ -15412,7 +15396,7 @@ class eg {
15412
15396
  if (t)
15413
15397
  return this.#t = setTimeout(() => {
15414
15398
  this.#t = null, this.#s(!1);
15415
- }, Uf), !1;
15399
+ }, Xf), !1;
15416
15400
  for (const {
15417
15401
  renderTasks: e,
15418
15402
  operatorList: s
@@ -15492,7 +15476,7 @@ class eg {
15492
15476
  if (t.renderTasks.size > 0)
15493
15477
  return;
15494
15478
  if (e instanceof uo) {
15495
- let i = Wf;
15479
+ let i = Vf;
15496
15480
  e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
15497
15481
  t.streamReaderCancelTimeout = null, this._abortOperatorList({
15498
15482
  intentState: t,
@@ -15518,7 +15502,7 @@ class eg {
15518
15502
  return this._stats;
15519
15503
  }
15520
15504
  }
15521
- class sg {
15505
+ class tg {
15522
15506
  #t = /* @__PURE__ */ new Map();
15523
15507
  #e = Promise.resolve();
15524
15508
  postMessage(t, e) {
@@ -15561,7 +15545,7 @@ const nt = class nt {
15561
15545
  constructor({
15562
15546
  name: t = null,
15563
15547
  port: e = null,
15564
- verbosity: s = Id()
15548
+ verbosity: s = Ld()
15565
15549
  } = {}) {
15566
15550
  bs(this, Ms);
15567
15551
  if (this.name = t, this.destroyed = !1, this.verbosity = s, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, e) {
@@ -15638,7 +15622,7 @@ const nt = class nt {
15638
15622
  this._readyCapability.reject(new Error("Worker was destroyed"));
15639
15623
  return;
15640
15624
  }
15641
- const e = new sg();
15625
+ const e = new tg();
15642
15626
  this._port = e;
15643
15627
  const s = `fake${Eo(nt, _n)._++}`, i = new Js(s + "_worker", s, e);
15644
15628
  t.setup(i, e), this._messageHandler = new Js(s, s + "_worker", e), _i(this, Ms, Qi).call(this);
@@ -15699,14 +15683,14 @@ _n = new WeakMap(), is = new WeakMap(), ns = new WeakMap(), Ms = new WeakSet(),
15699
15683
  }));
15700
15684
  };
15701
15685
  let ks = nt;
15702
- class ig {
15686
+ class eg {
15703
15687
  #t = /* @__PURE__ */ new Map();
15704
15688
  #e = /* @__PURE__ */ new Map();
15705
15689
  #s = /* @__PURE__ */ new Map();
15706
15690
  #i = /* @__PURE__ */ new Map();
15707
15691
  #r = null;
15708
15692
  constructor(t, e, s, i, n) {
15709
- this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new ef({
15693
+ this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new Qd({
15710
15694
  ownerDocument: i.ownerDocument,
15711
15695
  styleElement: i.styleElement
15712
15696
  }), this.loadingParams = i.loadingParams, this._params = i, this.canvasFactory = n.canvasFactory, this.filterFactory = n.filterFactory, this.cMapReaderFactory = n.cMapReaderFactory, this.standardFontDataFactory = n.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = s, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
@@ -15722,7 +15706,7 @@ class ig {
15722
15706
  return Y(this, "annotationStorage", new bo());
15723
15707
  }
15724
15708
  getRenderingIntent(t, e = ze.ENABLE, s = null, i = !1, n = !1) {
15725
- let r = Yt.DISPLAY, o = Lr;
15709
+ let r = Yt.DISPLAY, o = Rr;
15726
15710
  switch (t) {
15727
15711
  case "any":
15728
15712
  r = Yt.ANY;
@@ -15852,7 +15836,7 @@ class ig {
15852
15836
  }), t.on("GetDoc", ({
15853
15837
  pdfInfo: s
15854
15838
  }) => {
15855
- this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new tg(s, this));
15839
+ this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new Zf(s, this));
15856
15840
  }), t.on("DocException", (s) => {
15857
15841
  e._capability.reject(Gt(s));
15858
15842
  }), t.on("PasswordRequest", (s) => {
@@ -15894,7 +15878,7 @@ class ig {
15894
15878
  U(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
15895
15879
  break;
15896
15880
  }
15897
- const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new sf(n, {
15881
+ const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new tf(n, {
15898
15882
  disableFontFace: r,
15899
15883
  fontExtraProperties: o,
15900
15884
  inspectFont: l
@@ -15935,7 +15919,7 @@ class ig {
15935
15919
  }
15936
15920
  switch (n) {
15937
15921
  case "Image":
15938
- o.objs.resolve(s, r), r?.dataLen > Od && (o._maybeCleanupAfterRender = !0);
15922
+ o.objs.resolve(s, r), r?.dataLen > Md && (o._maybeCleanupAfterRender = !0);
15939
15923
  break;
15940
15924
  case "Pattern":
15941
15925
  o.objs.resolve(s, r);
@@ -15993,7 +15977,7 @@ class ig {
15993
15977
  if (this.destroyed)
15994
15978
  throw new Error("Transport destroyed");
15995
15979
  n.refStr && this.#i.set(n.refStr, t);
15996
- const r = new eg(e, n, this, this._params.pdfBug);
15980
+ const r = new Qf(e, n, this, this._params.pdfBug);
15997
15981
  return this.#e.set(e, r), r;
15998
15982
  });
15999
15983
  return this.#s.set(e, i), i;
@@ -16062,7 +16046,7 @@ class ig {
16062
16046
  return this.messageHandler.sendWithPromise("GetOutline", null);
16063
16047
  }
16064
16048
  getOptionalContentConfig(t) {
16065
- return this.#n("GetOptionalContentConfig").then((e) => new Af(e, t));
16049
+ return this.#n("GetOptionalContentConfig").then((e) => new Sf(e, t));
16066
16050
  }
16067
16051
  getPermissions() {
16068
16052
  return this.messageHandler.sendWithPromise("GetPermissions", null);
@@ -16073,7 +16057,7 @@ class ig {
16073
16057
  return e;
16074
16058
  const s = this.messageHandler.sendWithPromise(t, null).then((i) => ({
16075
16059
  info: i[0],
16076
- metadata: i[1] ? new Sf(i[1]) : null,
16060
+ metadata: i[1] ? new wf(i[1]) : null,
16077
16061
  contentDispositionFilename: this._fullReader?.filename ?? null,
16078
16062
  contentLength: this._fullReader?.contentLength ?? null
16079
16063
  }));
@@ -16147,7 +16131,7 @@ class Tl {
16147
16131
  }
16148
16132
  }
16149
16133
  }
16150
- class ng {
16134
+ class sg {
16151
16135
  #t = null;
16152
16136
  constructor(t) {
16153
16137
  this.#t = t, this.onContinue = null;
@@ -16187,7 +16171,7 @@ class Cs {
16187
16171
  pdfBug: u = !1,
16188
16172
  pageColors: d = null
16189
16173
  }) {
16190
- this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new ng(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvasContext.canvas;
16174
+ this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new sg(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvasContext.canvas;
16191
16175
  }
16192
16176
  get completed() {
16193
16177
  return this.capability.promise.catch(function() {
@@ -16242,7 +16226,7 @@ class Cs {
16242
16226
  this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), Cs.#e.delete(this._canvas), this.callback())));
16243
16227
  }
16244
16228
  }
16245
- const rg = "4.10.38", og = "f9bea397f";
16229
+ const ig = "4.10.38", ng = "f9bea397f";
16246
16230
  function Ia(a) {
16247
16231
  return Math.floor(Math.max(0, Math.min(1, a)) * 255).toString(16).padStart(2, "0");
16248
16232
  }
@@ -16296,7 +16280,7 @@ class Na {
16296
16280
  return ["CMYK", i, n, r, o];
16297
16281
  }
16298
16282
  }
16299
- class ag {
16283
+ class rg {
16300
16284
  create(t, e, s = !1) {
16301
16285
  if (t <= 0 || e <= 0)
16302
16286
  throw new Error("Invalid SVG dimensions");
@@ -16312,7 +16296,7 @@ class ag {
16312
16296
  tt("Abstract method `_createSVG` called.");
16313
16297
  }
16314
16298
  }
16315
- class wo extends ag {
16299
+ class wo extends rg {
16316
16300
  _createSVG(t) {
16317
16301
  return document.createElementNS(Ee, t);
16318
16302
  }
@@ -16466,30 +16450,30 @@ class El {
16466
16450
  t.div.style.transform = e, t.div.hidden = !1;
16467
16451
  }
16468
16452
  }
16469
- const yi = 1e3, hg = 9, us = /* @__PURE__ */ new WeakSet();
16453
+ const yi = 1e3, og = 9, us = /* @__PURE__ */ new WeakSet();
16470
16454
  function Ge(a) {
16471
16455
  return {
16472
16456
  width: a[2] - a[0],
16473
16457
  height: a[3] - a[1]
16474
16458
  };
16475
16459
  }
16476
- class lg {
16460
+ class ag {
16477
16461
  static create(t) {
16478
16462
  switch (t.data.annotationType) {
16479
16463
  case yt.LINK:
16480
16464
  return new kl(t);
16481
16465
  case yt.TEXT:
16482
- return new cg(t);
16466
+ return new hg(t);
16483
16467
  case yt.WIDGET:
16484
16468
  switch (t.data.fieldType) {
16485
16469
  case "Tx":
16486
- return new ug(t);
16470
+ return new lg(t);
16487
16471
  case "Btn":
16488
- return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new fg(t) : new gg(t);
16472
+ return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new ug(t) : new dg(t);
16489
16473
  case "Ch":
16490
- return new pg(t);
16474
+ return new fg(t);
16491
16475
  case "Sig":
16492
- return new dg(t);
16476
+ return new cg(t);
16493
16477
  }
16494
16478
  return new ps(t);
16495
16479
  case yt.POPUP:
@@ -16497,31 +16481,31 @@ class lg {
16497
16481
  case yt.FREETEXT:
16498
16482
  return new Pl(t);
16499
16483
  case yt.LINE:
16500
- return new bg(t);
16484
+ return new pg(t);
16501
16485
  case yt.SQUARE:
16502
- return new vg(t);
16486
+ return new mg(t);
16503
16487
  case yt.CIRCLE:
16504
- return new yg(t);
16488
+ return new bg(t);
16505
16489
  case yt.POLYLINE:
16506
16490
  return new Ol(t);
16507
16491
  case yt.CARET:
16508
- return new wg(t);
16492
+ return new yg(t);
16509
16493
  case yt.INK:
16510
16494
  return new xo(t);
16511
16495
  case yt.POLYGON:
16512
- return new _g(t);
16496
+ return new vg(t);
16513
16497
  case yt.HIGHLIGHT:
16514
16498
  return new Dl(t);
16515
16499
  case yt.UNDERLINE:
16516
- return new xg(t);
16500
+ return new _g(t);
16517
16501
  case yt.SQUIGGLY:
16518
- return new Sg(t);
16502
+ return new wg(t);
16519
16503
  case yt.STRIKEOUT:
16520
- return new Cg(t);
16504
+ return new xg(t);
16521
16505
  case yt.STAMP:
16522
- return new Ll(t);
16506
+ return new Rl(t);
16523
16507
  case yt.FILEATTACHMENT:
16524
- return new Ag(t);
16508
+ return new Sg(t);
16525
16509
  default:
16526
16510
  return new ft(t);
16527
16511
  }
@@ -17026,7 +17010,7 @@ class kl extends ft {
17026
17010
  };
17027
17011
  }
17028
17012
  }
17029
- class cg extends ft {
17013
+ class hg extends ft {
17030
17014
  constructor(t) {
17031
17015
  super(t, {
17032
17016
  isRenderable: !0
@@ -17095,7 +17079,7 @@ class ps extends ft {
17095
17079
  _setTextStyle(t) {
17096
17080
  const e = ["left", "center", "right"], {
17097
17081
  fontColor: s
17098
- } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || hg, n = t.style;
17082
+ } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || og, n = t.style;
17099
17083
  let r;
17100
17084
  const o = 2, h = (l) => Math.round(10 * l) / 10;
17101
17085
  if (this.data.multiLine) {
@@ -17111,7 +17095,7 @@ class ps extends ft {
17111
17095
  e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
17112
17096
  }
17113
17097
  }
17114
- class ug extends ps {
17098
+ class lg extends ps {
17115
17099
  constructor(t) {
17116
17100
  const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
17117
17101
  super(t, {
@@ -17311,14 +17295,14 @@ class ug extends ps {
17311
17295
  return this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
17312
17296
  }
17313
17297
  }
17314
- class dg extends ps {
17298
+ class cg extends ps {
17315
17299
  constructor(t) {
17316
17300
  super(t, {
17317
17301
  isRenderable: !!t.data.hasOwnCanvas
17318
17302
  });
17319
17303
  }
17320
17304
  }
17321
- class fg extends ps {
17305
+ class ug extends ps {
17322
17306
  constructor(t) {
17323
17307
  super(t, {
17324
17308
  isRenderable: t.renderForms
@@ -17417,7 +17401,7 @@ class Ml extends ps {
17417
17401
  return this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
17418
17402
  }
17419
17403
  }
17420
- class gg extends kl {
17404
+ class dg extends kl {
17421
17405
  constructor(t) {
17422
17406
  super(t, {
17423
17407
  ignoreBorder: t.data.hasAppearance
@@ -17432,7 +17416,7 @@ class gg extends kl {
17432
17416
  })), t;
17433
17417
  }
17434
17418
  }
17435
- class pg extends ps {
17419
+ class fg extends ps {
17436
17420
  constructor(t) {
17437
17421
  super(t, {
17438
17422
  isRenderable: t.renderForms
@@ -17583,7 +17567,7 @@ class Fr extends ft {
17583
17567
  }
17584
17568
  render() {
17585
17569
  this.container.classList.add("popupAnnotation");
17586
- const t = this.popup = new mg({
17570
+ const t = this.popup = new gg({
17587
17571
  container: this.container,
17588
17572
  color: this.data.color,
17589
17573
  titleObj: this.data.titleObj,
@@ -17601,7 +17585,7 @@ class Fr extends ft {
17601
17585
  return this.container.setAttribute("aria-controls", e.map((s) => `${co}${s}`).join(",")), this.container;
17602
17586
  }
17603
17587
  }
17604
- class mg {
17588
+ class gg {
17605
17589
  #t = this.#E.bind(this);
17606
17590
  #e = this.#T.bind(this);
17607
17591
  #s = this.#k.bind(this);
@@ -17811,7 +17795,7 @@ class Pl extends ft {
17811
17795
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
17812
17796
  }
17813
17797
  }
17814
- class bg extends ft {
17798
+ class pg extends ft {
17815
17799
  #t = null;
17816
17800
  constructor(t) {
17817
17801
  super(t, {
@@ -17834,7 +17818,7 @@ class bg extends ft {
17834
17818
  this.container.classList.add("highlightArea");
17835
17819
  }
17836
17820
  }
17837
- class vg extends ft {
17821
+ class mg extends ft {
17838
17822
  #t = null;
17839
17823
  constructor(t) {
17840
17824
  super(t, {
@@ -17857,7 +17841,7 @@ class vg extends ft {
17857
17841
  this.container.classList.add("highlightArea");
17858
17842
  }
17859
17843
  }
17860
- class yg extends ft {
17844
+ class bg extends ft {
17861
17845
  #t = null;
17862
17846
  constructor(t) {
17863
17847
  super(t, {
@@ -17920,12 +17904,12 @@ class Ol extends ft {
17920
17904
  this.container.classList.add("highlightArea");
17921
17905
  }
17922
17906
  }
17923
- class _g extends Ol {
17907
+ class vg extends Ol {
17924
17908
  constructor(t) {
17925
17909
  super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
17926
17910
  }
17927
17911
  }
17928
- class wg extends ft {
17912
+ class yg extends ft {
17929
17913
  constructor(t) {
17930
17914
  super(t, {
17931
17915
  isRenderable: !0,
@@ -18033,7 +18017,7 @@ class Dl extends ft {
18033
18017
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
18034
18018
  }
18035
18019
  }
18036
- class xg extends ft {
18020
+ class _g extends ft {
18037
18021
  constructor(t) {
18038
18022
  super(t, {
18039
18023
  isRenderable: !0,
@@ -18045,7 +18029,7 @@ class xg extends ft {
18045
18029
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
18046
18030
  }
18047
18031
  }
18048
- class Sg extends ft {
18032
+ class wg extends ft {
18049
18033
  constructor(t) {
18050
18034
  super(t, {
18051
18035
  isRenderable: !0,
@@ -18057,7 +18041,7 @@ class Sg extends ft {
18057
18041
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
18058
18042
  }
18059
18043
  }
18060
- class Cg extends ft {
18044
+ class xg extends ft {
18061
18045
  constructor(t) {
18062
18046
  super(t, {
18063
18047
  isRenderable: !0,
@@ -18069,7 +18053,7 @@ class Cg extends ft {
18069
18053
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
18070
18054
  }
18071
18055
  }
18072
- class Ll extends ft {
18056
+ class Rl extends ft {
18073
18057
  constructor(t) {
18074
18058
  super(t, {
18075
18059
  isRenderable: !0,
@@ -18080,7 +18064,7 @@ class Ll extends ft {
18080
18064
  return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
18081
18065
  }
18082
18066
  }
18083
- class Ag extends ft {
18067
+ class Sg extends ft {
18084
18068
  #t = null;
18085
18069
  constructor(t) {
18086
18070
  super(t, {
@@ -18119,7 +18103,7 @@ class Ag extends ft {
18119
18103
  this.downloadManager?.openOrDownloadData(this.content, this.filename);
18120
18104
  }
18121
18105
  }
18122
- class Tg {
18106
+ class Cg {
18123
18107
  #t = null;
18124
18108
  #e = null;
18125
18109
  #s = /* @__PURE__ */ new Map();
@@ -18183,7 +18167,7 @@ class Tg {
18183
18167
  continue;
18184
18168
  }
18185
18169
  n.data = r;
18186
- const h = lg.create(n);
18170
+ const h = ag.create(n);
18187
18171
  if (!h.isRenderable)
18188
18172
  continue;
18189
18173
  if (!o && r.popupRef) {
@@ -18801,7 +18785,7 @@ class ss {
18801
18785
  t.push(`L${(r[0] - e) / i} ${(r[1] - s) / n} L${h} ${l} L${c} ${u} L${(o[0] - e) / i} ${(o[1] - s) / n}`);
18802
18786
  }
18803
18787
  newFreeDrawOutline(t, e, s, i, n, r) {
18804
- return new Rl(t, e, s, i, n, r);
18788
+ return new Ll(t, e, s, i, n, r);
18805
18789
  }
18806
18790
  getOutlines() {
18807
18791
  const t = this.#r, e = this.#e, s = this.#n, [i, n, r, o] = this.#t, h = new Float32Array((this.#f?.length ?? 0) + 2);
@@ -18842,7 +18826,7 @@ class ss {
18842
18826
  return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / o, (s[1] - r) / h, NaN, NaN, NaN, NaN, l, c, NaN, NaN, NaN, NaN, u, d, NaN, NaN, NaN, NaN, (i[0] - n) / o, (i[1] - r) / h], e), e += 24;
18843
18827
  }
18844
18828
  }
18845
- class Rl extends I {
18829
+ class Ll extends I {
18846
18830
  #t;
18847
18831
  #e = new Float32Array(4);
18848
18832
  #s;
@@ -18987,7 +18971,7 @@ class Ir {
18987
18971
  }
18988
18972
  n.push(d, f);
18989
18973
  }
18990
- return new Eg(i, this.#t, this.#e);
18974
+ return new Ag(i, this.#t, this.#e);
18991
18975
  }
18992
18976
  #n(t) {
18993
18977
  const e = this.#i;
@@ -19049,7 +19033,7 @@ class Ir {
19049
19033
  return n;
19050
19034
  }
19051
19035
  }
19052
- class Eg extends I {
19036
+ class Ag extends I {
19053
19037
  #t;
19054
19038
  #e;
19055
19039
  constructor(t, e, s) {
@@ -19087,10 +19071,10 @@ class Eg extends I {
19087
19071
  }
19088
19072
  class Nr extends ss {
19089
19073
  newFreeDrawOutline(t, e, s, i, n, r) {
19090
- return new kg(t, e, s, i, n, r);
19074
+ return new Tg(t, e, s, i, n, r);
19091
19075
  }
19092
19076
  }
19093
- class kg extends Rl {
19077
+ class Tg extends Ll {
19094
19078
  newOutliner(t, e, s, i, n, r = 0) {
19095
19079
  return new Nr(t, e, s, i, n, r);
19096
19080
  }
@@ -19645,7 +19629,7 @@ class ct extends z {
19645
19629
  #O() {
19646
19630
  return this.#u ? this.rotation : 0;
19647
19631
  }
19648
- #R() {
19632
+ #L() {
19649
19633
  if (this.#u)
19650
19634
  return null;
19651
19635
  const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#s, r = new Float32Array(n.length * 8);
@@ -19853,16 +19837,16 @@ class ct extends z {
19853
19837
  color: s,
19854
19838
  opacity: this.#o,
19855
19839
  thickness: this.#p,
19856
- quadPoints: this.#R(),
19840
+ quadPoints: this.#L(),
19857
19841
  outlines: this.#I(e),
19858
19842
  pageIndex: this.pageIndex,
19859
19843
  rect: e,
19860
19844
  rotation: this.#O(),
19861
19845
  structTreeParentId: this._structTreeParentId
19862
19846
  };
19863
- return this.annotationElementId && !this.#L(i) ? null : (i.id = this.annotationElementId, i);
19847
+ return this.annotationElementId && !this.#R(i) ? null : (i.id = this.annotationElementId, i);
19864
19848
  }
19865
- #L(t) {
19849
+ #R(t) {
19866
19850
  const {
19867
19851
  color: e
19868
19852
  } = this._initialData;
@@ -19877,7 +19861,7 @@ class ct extends z {
19877
19861
  return !1;
19878
19862
  }
19879
19863
  }
19880
- class Mg {
19864
+ class Eg {
19881
19865
  #t = /* @__PURE__ */ Object.create(null);
19882
19866
  updateProperty(t, e) {
19883
19867
  this[t] = e, this.updateSVGProperty(t, e);
@@ -20317,7 +20301,7 @@ class H extends z {
20317
20301
  return !1;
20318
20302
  }
20319
20303
  }
20320
- class Pg {
20304
+ class kg {
20321
20305
  #t = new Float64Array(6);
20322
20306
  #e;
20323
20307
  #s;
@@ -20761,7 +20745,7 @@ class Vn extends I {
20761
20745
  };
20762
20746
  }
20763
20747
  }
20764
- class So extends Mg {
20748
+ class So extends Eg {
20765
20749
  #t;
20766
20750
  constructor(t) {
20767
20751
  super(), this.#t = t, super.updateProperties({
@@ -20806,7 +20790,7 @@ class Co extends H {
20806
20790
  return Y(this, "typesMap", /* @__PURE__ */ new Map([[$.INK_THICKNESS, "stroke-width"], [$.INK_COLOR, "stroke"], [$.INK_OPACITY, "stroke-opacity"]]));
20807
20791
  }
20808
20792
  static createDrawerInstance(t, e, s, i, n) {
20809
- return new Pg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
20793
+ return new kg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
20810
20794
  }
20811
20795
  static deserializeDraw(t, e, s, i, n, r) {
20812
20796
  return Vn.deserialize(t, e, s, i, n, r);
@@ -21243,14 +21227,14 @@ class Ao extends z {
21243
21227
  } = this.#t, e.getContext("2d").drawImage(this.#t, 0, 0), e.toDataURL();
21244
21228
  }
21245
21229
  if (this.#c) {
21246
- const [e, s] = this.pageDimensions, i = Math.round(this.width * e * Rs.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * Rs.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
21230
+ const [e, s] = this.pageDimensions, i = Math.round(this.width * e * Ls.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * Ls.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
21247
21231
  return r.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, i, n), r.transferToImageBitmap();
21248
21232
  }
21249
21233
  return structuredClone(this.#t);
21250
21234
  }
21251
21235
  static async deserialize(t, e, s) {
21252
21236
  let i = null;
21253
- if (t instanceof Ll) {
21237
+ if (t instanceof Rl) {
21254
21238
  const {
21255
21239
  data: {
21256
21240
  rect: g,
@@ -21936,7 +21920,7 @@ V.ColorPicker;
21936
21920
  V.DOMSVGFactory;
21937
21921
  V.DrawLayer;
21938
21922
  V.FeatureTest;
21939
- var Og = V.GlobalWorkerOptions;
21923
+ var Mg = V.GlobalWorkerOptions;
21940
21924
  V.ImageKind;
21941
21925
  V.InvalidPDFException;
21942
21926
  V.MissingPDFException;
@@ -21958,7 +21942,7 @@ V.XfaLayer;
21958
21942
  V.build;
21959
21943
  V.createValidAbsoluteUrl;
21960
21944
  V.fetchData;
21961
- var Dg = V.getDocument;
21945
+ var Pg = V.getDocument;
21962
21946
  V.getFilenameFromUrl;
21963
21947
  V.getPdfFilenameFromUrl;
21964
21948
  V.getXfaPageViewport;
@@ -21969,19 +21953,19 @@ V.normalizeUnicode;
21969
21953
  V.setLayerDimensions;
21970
21954
  V.shadow;
21971
21955
  V.stopEvent;
21972
- var Lg = V.version;
21956
+ var Og = V.version;
21973
21957
  let ja = null;
21974
- function Rg() {
21958
+ function Dg() {
21975
21959
  const a = document.createElement("div");
21976
21960
  a.style.width = "1in", document.body.append(a);
21977
21961
  const t = a.offsetWidth;
21978
21962
  return a.remove(), t;
21979
21963
  }
21980
- function Fg() {
21981
- const a = ja ?? Rg();
21964
+ function Rg() {
21965
+ const a = ja ?? Dg();
21982
21966
  return ja = a, a / 72;
21983
21967
  }
21984
- function Ig(a, t = 500) {
21968
+ function Lg(a, t = 500) {
21985
21969
  if (typeof a != "function") throw new TypeError("The first argument is not a function.");
21986
21970
  let e = null;
21987
21971
  return function(...s) {
@@ -21990,18 +21974,20 @@ function Ig(a, t = 500) {
21990
21974
  }, t);
21991
21975
  };
21992
21976
  }
21993
- function Ng(a) {
21994
- return new Promise((t, e) => {
21977
+ function Fg(a) {
21978
+ return a.arrayBuffer ? a.arrayBuffer() : new Promise((t, e) => {
21995
21979
  const s = new FileReader();
21996
- s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsArrayBuffer(a);
21980
+ s.addEventListener("load", () => {
21981
+ const i = s.result;
21982
+ if (!(i instanceof ArrayBuffer)) {
21983
+ e(new Error("Failed to read file as ArrayBuffer."));
21984
+ return;
21985
+ }
21986
+ t(i);
21987
+ }), s.addEventListener("error", e), s.readAsArrayBuffer(a);
21997
21988
  });
21998
21989
  }
21999
- Fl() || (Og.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Lg}/pdf.worker.min.mjs`);
22000
- async function jg(a) {
22001
- const t = await Ng(a);
22002
- if (t instanceof ArrayBuffer)
22003
- return t;
22004
- }
21990
+ Fl() || (Mg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Og}/pdf.worker.min.mjs`);
22005
21991
  function Fl() {
22006
21992
  try {
22007
21993
  return typeof OffscreenCanvas < "u" && typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.prototype.transferControlToOffscreen == "function";
@@ -22009,103 +21995,103 @@ function Fl() {
22009
21995
  return !1;
22010
21996
  }
22011
21997
  }
22012
- async function Bg({ page: a, data: t, scale: e, password: s }, i) {
22013
- const n = Fg() / window.devicePixelRatio;
21998
+ async function Ig({ page: a, data: t, scale: e, password: s }, i) {
21999
+ const n = Rg() / window.devicePixelRatio, r = await Fg(t);
22014
22000
  if (Fl()) {
22015
- const r = new Worker(new URL(
22001
+ const o = new Worker(new URL(
22016
22002
  /* @vite-ignore */
22017
22003
  "" + new URL("assets/pdfjs.worker-DawqtvLM.js", import.meta.url).href,
22018
22004
  import.meta.url
22019
22005
  ), { type: "module" });
22020
- return r.postMessage({ data: t, password: s, id: i, page: a, units: n, scale: e }), await new Promise((h) => {
22021
- r.addEventListener("message", ({ data: l }) => {
22022
- if (l.status === "success")
22023
- if (l.bitmap) {
22024
- const c = document.createElement("canvas"), u = c.getContext("bitmaprenderer");
22025
- c.width = l.width, c.height = l.height, u?.transferFromImageBitmap(l.bitmap), h({ pages: l.pages, canvas: c });
22006
+ return o.postMessage({ data: r, password: s, id: i, page: a, units: n, scale: e }), await new Promise((l) => {
22007
+ o.addEventListener("message", ({ data: c }) => {
22008
+ if (c.status === "success")
22009
+ if (c.bitmap) {
22010
+ const u = document.createElement("canvas"), d = u.getContext("bitmaprenderer");
22011
+ u.width = c.width, u.height = c.height, d?.transferFromImageBitmap(c.bitmap), l({ pages: c.pages, canvas: u });
22026
22012
  } else
22027
- h({ pages: l.pages, canvas: null });
22013
+ l({ pages: c.pages, canvas: null });
22028
22014
  });
22029
22015
  });
22030
22016
  } else {
22031
- const r = await Dg({ data: t, password: s }).promise, o = r.numPages;
22032
- if (!i) return { canvas: null, pages: o };
22033
- const h = await r.getPage(a), l = h.getViewport({ scale: e }), c = document.createElement("canvas"), d = {
22034
- canvasContext: c.getContext("2d"),
22035
- viewport: l,
22017
+ const o = await Pg({ data: r, password: s }).promise, h = o.numPages;
22018
+ if (!i) return { canvas: null, pages: h };
22019
+ const l = await o.getPage(a), c = l.getViewport({ scale: e }), u = document.createElement("canvas"), f = {
22020
+ canvasContext: u.getContext("2d"),
22021
+ viewport: c,
22036
22022
  transform: [n, 0, 0, n, 0, 0]
22037
22023
  };
22038
- return c.width = Math.floor(l.width * n), c.height = Math.floor(l.height * n), h.render(d).promise.then(() => ({ canvas: c, pages: o }));
22024
+ return u.width = Math.floor(c.width * n), u.height = Math.floor(c.height * n), l.render(f).promise.then(() => ({ canvas: u, pages: h }));
22039
22025
  }
22040
22026
  }
22041
22027
  const Ft = /* @__PURE__ */ new Map();
22042
- function Hg(a) {
22028
+ function Ng(a) {
22043
22029
  const t = new Er(a);
22044
22030
  return Ft.set(a, t), t;
22045
22031
  }
22046
- function zg(a, t) {
22047
- const e = Date.now();
22032
+ function jg(a) {
22033
+ const t = Date.now();
22048
22034
  return {
22049
- PDFId: `${a.name}-${e}`,
22035
+ PDFId: `${a.name}-${t}`,
22050
22036
  name: a.name.replace(/.pdf/, ""),
22051
- updateDate: e,
22052
- data: t
22037
+ updateDate: t,
22038
+ data: a
22053
22039
  };
22054
22040
  }
22055
- async function Gg({ src: a }, t, e) {
22041
+ async function Bg({ src: a }, t, e) {
22056
22042
  if (!a || !e) return null;
22057
22043
  const { objects: s, options: i } = await vd(a), n = s.filter((o) => o !== null), r = Fu.groupSVGElements(n, i);
22058
22044
  return n.forEach((o) => {
22059
22045
  o.stroke = e;
22060
22046
  }), r.hoverCursor = "pointer", r.stroke = `${e}-${t}`, r;
22061
22047
  }
22062
- function Vg(a, t) {
22048
+ function Hg(a, t) {
22063
22049
  if (!Ft.get(a)) return;
22064
- const s = 1 / 3, i = Kg(t, s);
22050
+ const s = 1 / 3, i = Yg(t, s);
22065
22051
  Nl(a, i, s);
22066
22052
  }
22067
- async function Xg(a, t) {
22068
- const e = await Md(a), s = Date.now(), n = {
22069
- PDFId: `${a.name}${s}`,
22053
+ async function zg(a, t) {
22054
+ const e = Date.now(), i = {
22055
+ PDFId: `${a.name}-${e}`,
22070
22056
  name: a.name.replace(/.png|.jpg|.jpeg/, ""),
22071
- updateDate: s,
22072
- PDFBase64: e
22057
+ updateDate: e,
22058
+ data: a
22073
22059
  };
22074
- return t && Il(t, { url: e }), { ...n, pages: 1 };
22060
+ return t && Il(t, { data: a }), { ...i, pages: 1 };
22075
22061
  }
22076
- async function Il(a, { url: t, scale: e = 0.5 }) {
22062
+ async function Il(a, { data: t, scale: e = 0.5 }) {
22077
22063
  if (!Ft.get(a)) return;
22078
- const i = await Tt.fromURL(t);
22079
- i.scale(e), Nl(a, i, e);
22064
+ const i = URL.createObjectURL(t), n = await Tt.fromURL(i);
22065
+ n.scale(e), Nl(a, n, e), URL.revokeObjectURL(i);
22080
22066
  }
22081
22067
  function Nl(a, t, e) {
22082
22068
  const s = Ft.get(a);
22083
22069
  s && (s.setWidth(t.width * e), s.setHeight(t.height * e), s.backgroundImage = t, s.renderAll());
22084
22070
  }
22085
- function Wg(a, t) {
22071
+ function Gg(a, t) {
22086
22072
  if (!t) return;
22087
22073
  const { oCoords: e } = a;
22088
22074
  if (!e) return;
22089
22075
  const { x: s, y: i } = e.tl.touchCorner.tl, { height: n, width: r, scaleY: o, scaleX: h } = t;
22090
22076
  t.top = i - n * o / 2, t.left = s - r * h / 2, t.setCoords();
22091
22077
  }
22092
- function Ug(a, t, e) {
22093
- !e || !a || (e.scale(1 / t), Wg(a, e));
22078
+ function Vg(a, t, e) {
22079
+ !e || !a || (e.scale(1 / t), Gg(a, e));
22094
22080
  }
22095
- function Yg(a, t) {
22081
+ function Xg(a, t) {
22096
22082
  if (!a) return;
22097
22083
  const e = a._cornerSize || 6;
22098
22084
  a.borderScaleFactor = 1 / t, a.cornerSize = e * (1 / t), a.touchCornerSize = e * 4 * (1 / t), a.setCoords();
22099
22085
  }
22100
- function $g(a) {
22086
+ function Wg(a) {
22101
22087
  const t = Ft.get(a);
22102
22088
  t && (t.discardActiveObject(), t.renderAll());
22103
22089
  }
22104
- function qg(a) {
22090
+ function Ug(a) {
22105
22091
  const t = Ft.get(a);
22106
22092
  t && (t.clear(), Ft.delete(a));
22107
22093
  }
22108
- function Kg(a, t) {
22094
+ function Yg(a, t) {
22109
22095
  return new Tt(a, { scaleX: t, scaleY: t });
22110
22096
  }
22111
22097
  function jr(a, t) {
@@ -22113,27 +22099,25 @@ function jr(a, t) {
22113
22099
  const { left: e, top: s, scaleX: i, scaleY: n, width: r, height: o } = a, h = t.x * r * i, l = t.y * o * n;
22114
22100
  a.set({ left: e - h, top: s - l });
22115
22101
  }
22116
- function Jg(a, t, e) {
22102
+ function $g(a, t, e) {
22117
22103
  const s = a.type;
22118
22104
  return {
22119
- "application/pdf": Zg,
22105
+ "application/pdf": qg,
22120
22106
  "image/png": Ba,
22121
22107
  "image/jpeg": Ba
22122
22108
  }[s]?.(a, t, e) ?? Promise.reject(new Error(`Unsupported ${s} file type.`));
22123
22109
  }
22124
- async function Zg(a, t, e) {
22125
- const s = await jg(a);
22126
- if (!s) return;
22127
- const i = zg(a, s), n = await jl({ page: 1, data: s, scale: 0.8, password: t }, e);
22128
- return { ...i, pages: n };
22110
+ async function qg(a, t, e) {
22111
+ const s = jg(a), i = await jl({ page: 1, data: a, scale: 0.8, password: t }, e);
22112
+ return { ...s, pages: i };
22129
22113
  }
22130
22114
  function jl(a, t) {
22131
- return Bg(a, t).then(({ canvas: e, pages: s }) => (e && t && Vg(t, e), s));
22115
+ return Ig(a, t).then(({ canvas: e, pages: s }) => (e && t && Hg(t, e), s));
22132
22116
  }
22133
22117
  async function Ba(a, t, e) {
22134
- return await Xg(a, e);
22118
+ return await zg(a, e);
22135
22119
  }
22136
- function Qg(a, t) {
22120
+ function Kg(a, t) {
22137
22121
  const e = Ft.get(a);
22138
22122
  if (!e) return;
22139
22123
  const s = e.getActiveObject();
@@ -22141,7 +22125,7 @@ function Qg(a, t) {
22141
22125
  i.set(t);
22142
22126
  }) : s.set(t), e.renderAll());
22143
22127
  }
22144
- async function tp(a, t) {
22128
+ async function Jg(a, t) {
22145
22129
  const e = Ft.get(a);
22146
22130
  if (!e) return;
22147
22131
  const s = e?.getActiveObject();
@@ -22151,7 +22135,7 @@ async function tp(a, t) {
22151
22135
  e.add(n), t(e, n);
22152
22136
  }) : (e.add(i), t(e, i)), jr(i, { x: -0.1, y: -0.1 }), e.setActiveObject(i);
22153
22137
  }
22154
- function ep(a) {
22138
+ function Zg(a) {
22155
22139
  const t = Ft.get(a);
22156
22140
  if (!t) return;
22157
22141
  const e = t.getActiveObject();
@@ -22159,7 +22143,7 @@ function ep(a) {
22159
22143
  t.remove(s);
22160
22144
  }), t.discardActiveObject()) : t.remove(e));
22161
22145
  }
22162
- function sp(a) {
22146
+ function Qg(a) {
22163
22147
  const {
22164
22148
  id: t = "",
22165
22149
  selectionOptions: e,
@@ -22172,7 +22156,7 @@ function sp(a) {
22172
22156
  let h = null, l = null, c = 1, u = { ...Zl };
22173
22157
  function d() {
22174
22158
  if (!t || Ft.has(t)) return;
22175
- const k = Hg(t);
22159
+ const k = Ng(t);
22176
22160
  return k.on("selection:created", (O) => {
22177
22161
  if (r?.(O), O.selected.length <= 1) return;
22178
22162
  const j = k.getActiveObject();
@@ -22182,28 +22166,28 @@ function sp(a) {
22182
22166
  }), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
22183
22167
  }
22184
22168
  function f(k, O) {
22185
- return Jg(k, O, t);
22169
+ return $g(k, O, t);
22186
22170
  }
22187
22171
  function g(k) {
22188
22172
  return jl(k, t);
22189
22173
  }
22190
- function p({ url: k, scale: O = 0.5 }) {
22191
- return Il(t, { url: k, scale: O });
22174
+ function p({ data: k, scale: O = 0.5 }) {
22175
+ return Il(t, { data: k, scale: O });
22192
22176
  }
22193
22177
  async function b(k, O, j) {
22194
22178
  const M = Ft.get(t);
22195
22179
  if (!M) return;
22196
- const L = await Tt.fromURL(k, {}, { ...ql, ...O });
22197
- jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22180
+ const R = await Tt.fromURL(k, {}, { ...ql, ...O });
22181
+ jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
22198
22182
  }
22199
22183
  function m(k, O, j) {
22200
22184
  const M = Ft.get(t);
22201
22185
  if (!M) return;
22202
- const L = new Ct(k, {
22186
+ const R = new Ct(k, {
22203
22187
  ...Kl,
22204
22188
  ...O
22205
22189
  });
22206
- jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22190
+ jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
22207
22191
  }
22208
22192
  function v(k, O) {
22209
22193
  O.on("selected", (j) => y({ canvas: k, target: j.target })), O.on("modified", (j) => y({ canvas: k, target: j.target })), O.on("scaling", () => T(k)), O.on("moving", () => T(k)), O.on("rotating", () => T(k)), O._cornerSize = O._cornerSize ?? O.cornerSize;
@@ -22215,7 +22199,7 @@ function sp(a) {
22215
22199
  uuid: M = Date.now()
22216
22200
  }) {
22217
22201
  if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
22218
- const G = await Gg(u, M, j);
22202
+ const G = await Bg(u, M, j);
22219
22203
  T(k), h = G, l = O, _(k, O, M), S(c, !0), G && k.add(G);
22220
22204
  }
22221
22205
  function _(k, O, j) {
@@ -22234,7 +22218,7 @@ function sp(a) {
22234
22218
  }
22235
22219
  function S(k, O = !1) {
22236
22220
  const j = Ft.get(t);
22237
- c = k, j && (Yg(l, k), Ug(l, k, h), !O && j.renderAll());
22221
+ c = k, j && (Xg(l, k), Vg(l, k, h), !O && j.renderAll());
22238
22222
  }
22239
22223
  function A(k) {
22240
22224
  if (!k) return;
@@ -22246,19 +22230,19 @@ function sp(a) {
22246
22230
  l = null, h && (k.remove(h), h = null);
22247
22231
  }
22248
22232
  function E() {
22249
- $g(t);
22233
+ Wg(t);
22250
22234
  }
22251
22235
  function P() {
22252
- qg(t);
22236
+ Ug(t);
22253
22237
  }
22254
22238
  function N(k) {
22255
- Qg(t, k);
22239
+ Kg(t, k);
22256
22240
  }
22257
22241
  function D() {
22258
- return tp(t, v);
22242
+ return Jg(t, v);
22259
22243
  }
22260
- function R() {
22261
- ep(t);
22244
+ function L() {
22245
+ Zg(t);
22262
22246
  }
22263
22247
  return {
22264
22248
  createCanvas: d,
@@ -22273,12 +22257,12 @@ function sp(a) {
22273
22257
  setCloseSvgOptions: A,
22274
22258
  setActiveFabric: N,
22275
22259
  copyActiveFabric: D,
22276
- deleteActiveFabric: R
22260
+ deleteActiveFabric: L
22277
22261
  };
22278
22262
  }
22279
- function ip(a) {
22263
+ function tp(a) {
22280
22264
  let t = 0;
22281
- const e = Ig(() => {
22265
+ const e = Lg(() => {
22282
22266
  t !== window.innerWidth && (t = window.innerWidth, a());
22283
22267
  });
22284
22268
  Bl(() => {
@@ -22287,7 +22271,7 @@ function ip(a) {
22287
22271
  window.removeEventListener("resize", e);
22288
22272
  });
22289
22273
  }
22290
- const op = /* @__PURE__ */ Hl({
22274
+ const ip = /* @__PURE__ */ Hl({
22291
22275
  __name: "pdf-canvas",
22292
22276
  props: {
22293
22277
  file: {},
@@ -22321,7 +22305,7 @@ const op = /* @__PURE__ */ Hl({
22321
22305
  setCloseSvgOptions: y,
22322
22306
  copyActiveFabric: _,
22323
22307
  deleteActiveFabric: S
22324
- } = sp({
22308
+ } = Qg({
22325
22309
  id: o,
22326
22310
  selectionOptions: l,
22327
22311
  pointerDown: (D) => i("pointerDown", D),
@@ -22330,18 +22314,17 @@ const op = /* @__PURE__ */ Hl({
22330
22314
  selectionCreated: (D) => i("selectionCreated", D),
22331
22315
  selectionCleared: (D) => i("selectionCleared", D)
22332
22316
  });
22333
- A(), ip(N);
22317
+ A(), tp(N);
22334
22318
  async function A() {
22335
- const { file: D, page: R, fileScale: k } = s;
22319
+ const { file: D, page: L, fileScale: k } = s;
22336
22320
  globalThis.requestAnimationFrame(async () => {
22337
- if (await Gl(), c(), typeof D.data == "string") {
22338
- const j = D.data;
22339
- g({ url: j, scale: k / 3 }), i("loaded");
22321
+ if (await Gl(), c(), D.data.type.startsWith("image/")) {
22322
+ g({ data: D.data, scale: k / 3 }), i("loaded");
22340
22323
  return;
22341
22324
  }
22342
22325
  await u({
22343
- page: R,
22344
- data: D.canvas?.[R - 1] ?? D.data,
22326
+ page: L,
22327
+ data: D.canvas?.[L - 1] ?? D.data,
22345
22328
  scale: k,
22346
22329
  password: s.password
22347
22330
  }), i("loaded");
@@ -22349,14 +22332,14 @@ const op = /* @__PURE__ */ Hl({
22349
22332
  }
22350
22333
  function T(D) {
22351
22334
  if (!s.isDrop || !D.dataTransfer) return;
22352
- const { dataTransfer: R, offsetX: k, offsetY: O } = D, j = R.getData("text/plain"), M = R.getData("text/uri-list"), L = R.getData("custom/offset"), G = L ? JSON.parse(L) : null, it = { top: O, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22335
+ const { dataTransfer: L, offsetX: k, offsetY: O } = D, j = L.getData("text/plain"), M = L.getData("text/uri-list"), R = L.getData("custom/offset"), G = R ? JSON.parse(R) : null, it = { top: O, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22353
22336
  M ? E(M, it, at) : j && P(j, it, at);
22354
22337
  }
22355
- function E(D, R, k) {
22356
- d(D, { ...s.dropImageOptions, ...R }, k);
22338
+ function E(D, L, k) {
22339
+ d(D, { ...s.dropImageOptions, ...L }, k);
22357
22340
  }
22358
- function P(D, R, k) {
22359
- f(D, { ...s.dropTextOptions, ...R }, k);
22341
+ function P(D, L, k) {
22342
+ f(D, { ...s.dropTextOptions, ...L }, k);
22360
22343
  }
22361
22344
  function N() {
22362
22345
  s.manualReload || A(), i("reload");
@@ -22371,11 +22354,11 @@ const op = /* @__PURE__ */ Hl({
22371
22354
  copyActiveFabric: _,
22372
22355
  deleteActiveFabric: S,
22373
22356
  canvasRef: r
22374
- }), (D, R) => (Xl(), Vl("div", {
22357
+ }), (D, L) => (Xl(), Vl("div", {
22375
22358
  style: Wl({ transform: `scale(${h.value})` }),
22376
- onDragover: R[0] || (R[0] = Un(() => {
22359
+ onDragover: L[0] || (L[0] = Un(() => {
22377
22360
  }, ["prevent"])),
22378
- onDragenter: R[1] || (R[1] = Un(() => {
22361
+ onDragenter: L[1] || (L[1] = Un(() => {
22379
22362
  }, ["prevent"])),
22380
22363
  onDrop: Un(T, ["stop", "prevent"])
22381
22364
  }, [
@@ -22389,7 +22372,7 @@ const op = /* @__PURE__ */ Hl({
22389
22372
  }
22390
22373
  });
22391
22374
  export {
22392
- op as default,
22393
- Jg as loadFile,
22394
- sp as useFabric
22375
+ ip as default,
22376
+ $g as loadFile,
22377
+ Qg as useFabric
22395
22378
  };