pdf-factory 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/parser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, i, o, s) => {
3
3
  if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
4
  get: ((e) => i[e]).bind(null, d),
5
5
  enumerable: !(s = n(i, d)) || s.enumerable
@@ -118665,7 +118665,7 @@ async function Ch(e, t = {}) {
118665
118665
  };
118666
118666
  }
118667
118667
  //#endregion
118668
- //#region node_modules/.pnpm/pixelmatch@7.2.0/node_modules/pixelmatch/index.js
118668
+ //#region node_modules/.pnpm/pixelmatch@8.0.0/node_modules/pixelmatch/index.js
118669
118669
  function wh(e, t, n, r, i, a = {}) {
118670
118670
  let { threshold: o = .1, alpha: s = .1, aaColor: c = [
118671
118671
  255,
@@ -118675,76 +118675,155 @@ function wh(e, t, n, r, i, a = {}) {
118675
118675
  255,
118676
118676
  0,
118677
118677
  0
118678
- ], checkerboard: u = !0, includeAA: d, diffColorAlt: f, diffMask: p } = a;
118679
- if (!Th(e) || !Th(t) || n && !Th(n)) throw Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");
118678
+ ], checkerboard: u = !0, windowSize: d = Infinity, includeAA: f, diffColorAlt: p, diffMask: m, ignoreMask: h } = a;
118679
+ if (!Th(e) || !Th(t) || n && !Th(n) || h && !Th(h)) throw Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");
118680
118680
  if (e.length !== t.length || n && n.length !== e.length) throw Error(`Image sizes do not match. Image 1 size: ${e.length}, image 2 size: ${t.length}`);
118681
- if (e.length !== r * i * 4) throw Error(`Image data size does not match width/height. Expecting ${r * i * 4}. Got ${e.length}`);
118682
- let m = r * i, h = new Uint32Array(e.buffer, e.byteOffset, m), g = new Uint32Array(t.buffer, t.byteOffset, m), _ = !0;
118683
- for (let e = 0; e < m; e++) if (h[e] !== g[e]) {
118684
- _ = !1;
118681
+ let g = r * i;
118682
+ if (e.length !== g * 4) throw Error(`Image data size does not match width/height. Expecting ${g * 4}. Got ${e.length}`);
118683
+ if (h && h.length !== g) throw Error(`Ignore mask size does not match image width/height. Expecting ${g}. Got ${h.length}`);
118684
+ let _ = new Uint32Array(e.buffer, e.byteOffset, g), v = new Uint32Array(t.buffer, t.byteOffset, g), y = !0;
118685
+ for (let e = 0; e < g; e++) if (_[e] !== v[e] && (!h || !h[e])) {
118686
+ y = !1;
118685
118687
  break;
118686
118688
  }
118687
- if (_) {
118688
- if (n && !p) for (let t = 0, r = 0; t < m; t++, r += 4) jh(e, r, s, n);
118689
+ if (y) {
118690
+ if (n && !m) for (let t = 0, r = 0; t < g; t++, r += 4) rg(n, r, e, s);
118689
118691
  return 0;
118690
118692
  }
118691
- let v = 35215 * o * o, [y, b, x] = c, [S, C, w] = l, [T, E, D] = f || l, O = 0;
118692
- for (let a = 0, o = 0; a < m; a++, o += 4) {
118693
- let c = h[a] === g[a] ? 0 : Oh(e, t, o, o, u);
118694
- if (Math.abs(c) > v) {
118695
- let s = a % r, l = a / r | 0;
118696
- !d && (Eh(e, s, l, r, i, h, g, u) || Eh(t, s, l, r, i, g, h, u)) ? n && !p && Ah(n, o, y, b, x) : (n && (c < 0 ? Ah(n, o, T, E, D) : Ah(n, o, S, C, w)), O++);
118697
- } else n && !p && jh(e, o, s, n);
118693
+ let [b, x, S] = c, [C, w, T] = l, [E, D, O] = p || l, k = 0, A = Number.isFinite(d) ? new Uint8Array(g) : null, j = -1, M = 0;
118694
+ for (let a = 0, c = 0; a < g; a++, c += 4) {
118695
+ let l = _[a] === v[a] || h && h[a] ? 0 : Xh(e, t, c, u, o);
118696
+ if (l) {
118697
+ let o = a % r, s = a / r | 0;
118698
+ !f && (Eh(e, o, s, r, i, _, v) || Eh(t, o, s, r, i, v, _)) ? (n && !m && ng(n, c, b, x, S), A && (A[a] = 2)) : (n && (l < 0 ? ng(n, c, E, D, O) : ng(n, c, C, w, T)), A && (A[a] = 1, j < 0 && (j = s), M = s), k++);
118699
+ } else n && !m && rg(n, c, e, s);
118700
+ }
118701
+ if (!A || !k) return k;
118702
+ let N = Math.min(Math.max(Math.floor(d), 1), r, i), P = new Uint16Array(r), F = 0, I = 0, L = Math.min(i - 1, M + N - 1);
118703
+ for (let e = j; e <= L; e++) {
118704
+ let t = e * r, n = e - N;
118705
+ if (n >= 0) {
118706
+ let e = n * r;
118707
+ for (let n = 0; n < r; n++) {
118708
+ let r = (A[t + n] & 1) - (A[e + n] & 1);
118709
+ P[n] += r, I += r;
118710
+ }
118711
+ } else {
118712
+ for (let e = 0; e < r; e++) {
118713
+ let n = A[t + e] & 1;
118714
+ P[e] += n, I += n;
118715
+ }
118716
+ if (e < N - 1) continue;
118717
+ }
118718
+ if (I <= F) continue;
118719
+ let i = 0;
118720
+ for (let e = 0; e < N - 1; e++) i += P[e];
118721
+ for (let e = N - 1; e < r; e++) i += P[e], i > F && (F = i), i -= P[e - N + 1];
118698
118722
  }
118699
- return O;
118723
+ return F;
118700
118724
  }
118701
118725
  function Th(e) {
118702
118726
  return ArrayBuffer.isView(e) && e.BYTES_PER_ELEMENT === 1;
118703
118727
  }
118704
- function Eh(e, t, n, r, i, a, o, s) {
118705
- let c = Math.max(t - 1, 0), l = Math.max(n - 1, 0), u = Math.min(t + 1, r - 1), d = Math.min(n + 1, i - 1), f = (n * r + t) * 4, p = e[f], m = e[f + 1], h = e[f + 2], g = e[f + 3], _ = +(t === c || t === u || n === l || n === d), v = 0, y = 0, b = 0, x = 0, S = 0, C = 0;
118706
- for (let i = c; i <= u; i++) for (let a = l; a <= d; a++) {
118707
- if (i === t && a === n) continue;
118708
- let o = kh(e, f, (a * r + i) * 4, p, m, h, g, s);
118709
- if (o === 0) {
118710
- if (_++, _ > 2) return !1;
118711
- } else o < v ? (v = o, b = i, x = a) : o > y && (y = o, S = i, C = a);
118712
- }
118713
- return v === 0 || y === 0 ? !1 : Dh(a, b, x, r, i) && Dh(o, b, x, r, i) || Dh(a, S, C, r, i) && Dh(o, S, C, r, i);
118728
+ function Eh(e, t, n, r, i, a, o) {
118729
+ let s = t > 0 ? t - 1 : 0, c = n > 0 ? n - 1 : 0, l = t < r - 1 ? t + 1 : r - 1, u = n < i - 1 ? n + 1 : i - 1, d = (n * r + t) * 4, f = e[d], p = e[d + 1], m = e[d + 2], h = e[d + 3], g = +(t === s || t === l || n === c || n === u), _ = 0, v = 0, y = 0, b = 0, x = 0, S = 0, C = r * 4;
118730
+ for (let i = s; i <= l; i++) {
118731
+ let a = (c * r + i) * 4;
118732
+ for (let r = c; r <= u; r++, a += C) {
118733
+ if (i === t && r === n) continue;
118734
+ let o = tg(e, a, f, p, m, h);
118735
+ if (o === 0) {
118736
+ if (g++, g > 2) return !1;
118737
+ } else o < _ ? (_ = o, y = i, b = r) : o > v && (v = o, x = i, S = r);
118738
+ }
118739
+ }
118740
+ return _ === 0 || v === 0 ? !1 : Dh(a, y, b, r, i) && Dh(o, y, b, r, i) || Dh(a, x, S, r, i) && Dh(o, x, S, r, i);
118714
118741
  }
118715
118742
  function Dh(e, t, n, r, i) {
118716
- let a = Math.max(t - 1, 0), o = Math.max(n - 1, 0), s = Math.min(t + 1, r - 1), c = Math.min(n + 1, i - 1), l = e[n * r + t], u = +(t === a || t === s || n === o || n === c);
118717
- for (let i = a; i <= s; i++) for (let a = o; a <= c; a++) if ((i !== t || a !== n) && (u += +(l === e[a * r + i]), u > 2)) return !0;
118743
+ let a = n * r + t, o = e[a];
118744
+ if (t > 0 && t < r - 1 && n > 0 && n < i - 1) return +(o === e[a - r - 1]) + +(o === e[a - 1]) + +(o === e[a + r - 1]) + +(o === e[a - r]) + +(o === e[a + r]) + +(o === e[a - r + 1]) + +(o === e[a + 1]) + +(o === e[a + r + 1]) > 2;
118745
+ let s = t > 0 ? t - 1 : 0, c = n > 0 ? n - 1 : 0, l = t < r - 1 ? t + 1 : r - 1, u = n < i - 1 ? n + 1 : i - 1, d = +(t === s || t === l || n === c || n === u);
118746
+ for (let i = s; i <= l; i++) {
118747
+ let a = c * r + i;
118748
+ for (let s = c; s <= u; s++, a += r) if ((i !== t || s !== n) && (d += +(o === e[a]), d > 2)) return !0;
118749
+ }
118718
118750
  return !1;
118719
118751
  }
118720
- function Oh(e, t, n, r, i) {
118721
- let a = e[n], o = e[n + 1], s = e[n + 2], c = e[n + 3], l = t[r], u = t[r + 1], d = t[r + 2], f = t[r + 3], p = a - l, m = o - u, h = s - d, g = c - f;
118722
- if (c < 255 || f < 255) {
118723
- let e = 255, t = 255, r = 255;
118724
- i && (e = 48 + n % 2 * 159, t = 48 + 159 * ((n / 1.618033988749895 | 0) % 2), r = 48 + 159 * ((n / 2.618033988749895 | 0) % 2)), p = (a * c - l * f - e * g) / 255, m = (o * c - u * f - t * g) / 255, h = (s * c - d * f - r * g) / 255;
118725
- }
118726
- let _ = p * .29889531 + m * .58662247 + h * .11448223, v = p * .59597799 - m * .2741761 - h * .32180189, y = p * .21147017 - m * .52261711 + h * .31114694, b = .5053 * _ * _ + .299 * v * v + .1957 * y * y;
118727
- return _ > 0 ? -b : b;
118752
+ var Oh = /* @__PURE__ */ new Float64Array(257);
118753
+ for (let e = 0; e < 256; e++) {
118754
+ let t = e / 255;
118755
+ Oh[e] = t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
118756
+ }
118757
+ Oh[256] = Oh[255];
118758
+ var kh = /* @__PURE__ */ new Float64Array(256), Ah = /* @__PURE__ */ new Float64Array(256), jh = /* @__PURE__ */ new Float64Array(256), Mh = /* @__PURE__ */ new Float64Array(256), Nh = /* @__PURE__ */ new Float64Array(256), Ph = /* @__PURE__ */ new Float64Array(256), Fh = /* @__PURE__ */ new Float64Array(256), Ih = /* @__PURE__ */ new Float64Array(256), Lh = /* @__PURE__ */ new Float64Array(256);
118759
+ for (let e = 0; e < 256; e++) {
118760
+ let t = Oh[e];
118761
+ kh[e] = .4122214708 * t, Mh[e] = .2119034982 * t, Fh[e] = .0883024619 * t, Ah[e] = .5363325363 * t, Nh[e] = .6806995451 * t, Ih[e] = .2817188376 * t, jh[e] = .0514459929 * t, Ph[e] = .1073969566 * t, Lh[e] = .6299787005 * t;
118762
+ }
118763
+ function Rh(e) {
118764
+ let t = e | 0;
118765
+ return Oh[t] + (Oh[t + 1] - Oh[t]) * (e - t);
118766
+ }
118767
+ var zh = 4096, Bh = /* @__PURE__ */ new Float64Array(4098);
118768
+ for (let e = 0; e <= 4097; e++) Bh[e] = Math.cbrt(e / zh);
118769
+ var Vh = 8;
118770
+ function Hh(e) {
118771
+ let t = e * zh, n = t | 0;
118772
+ return n < Vh ? Math.cbrt(e) : Bh[n] + (Bh[n + 1] - Bh[n]) * (t - n);
118773
+ }
118774
+ var Uh = 20, Wh = 4096, Gh = new Uint32Array(Wh), Kh = new Float64Array(Wh * 4), qh = .206, Jh = .03, Yh = 1.206 / 1.03;
118775
+ function Xh(e, t, n, r, i) {
118776
+ let a = e[n], o = e[n + 1], s = e[n + 2], c = e[n + 3], l = t[n], u = t[n + 1], d = t[n + 2], f = t[n + 3];
118777
+ return c === 255 && f === 255 ? Zh(a, o, s, l, u, d, i) : Qh(a, o, s, c, l, u, d, f, n, r, i);
118778
+ }
118779
+ function Zh(e, t, n, r, i, a, o) {
118780
+ let s = e << 16 | t << 8 | n, c = Math.imul(s, 2654435761) >>> Uh, l = s + 1, u = c * 4, d, f, p, m;
118781
+ Gh[c] === l ? (d = Kh[u], f = Kh[u + 1], p = Kh[u + 2], m = Kh[u + 3]) : (d = Hh(kh[e] + Ah[t] + jh[n]), f = Hh(Mh[e] + Nh[t] + Ph[n]), p = Hh(Fh[e] + Ih[t] + Lh[n]), m = eg(d, f, p), Gh[c] = l, Kh[u] = d, Kh[u + 1] = f, Kh[u + 2] = p, Kh[u + 3] = m);
118782
+ let h = r << 16 | i << 8 | a, g = Math.imul(h, 2654435761) >>> Uh, _ = h + 1, v = g * 4, y, b, x, S;
118783
+ return Gh[g] === _ ? (y = Kh[v], b = Kh[v + 1], x = Kh[v + 2], S = Kh[v + 3]) : (y = Hh(kh[r] + Ah[i] + jh[a]), b = Hh(Mh[r] + Nh[i] + Ph[a]), x = Hh(Fh[r] + Ih[i] + Lh[a]), S = eg(y, b, x), Gh[g] = _, Kh[v] = y, Kh[v + 1] = b, Kh[v + 2] = x, Kh[v + 3] = S), $h(m - S, d - y, f - b, p - x, o);
118784
+ }
118785
+ function Qh(e, t, n, r, i, a, o, s, c, l, u) {
118786
+ let d = 255, f = 255, p = 255;
118787
+ if (l) {
118788
+ let e = Math.imul(c >> 2, 2654435761);
118789
+ d = 48 + 159 * (e >>> 31), f = 48 + 159 * (e >>> 30 & 1), p = 48 + 159 * (e >>> 29 & 1);
118790
+ }
118791
+ e = (e * r + d * (255 - r)) / 255, t = (t * r + f * (255 - r)) / 255, n = (n * r + p * (255 - r)) / 255, i = (i * s + d * (255 - s)) / 255, a = (a * s + f * (255 - s)) / 255, o = (o * s + p * (255 - s)) / 255;
118792
+ let m = Rh(e), h = Rh(t), g = Rh(n), _ = Rh(i), v = Rh(a), y = Rh(o), b = Hh(.4122214708 * m + .5363325363 * h + .0514459929 * g), x = Hh(.2119034982 * m + .6806995451 * h + .1073969566 * g), S = Hh(.0883024619 * m + .2817188376 * h + .6299787005 * g), C = Hh(.4122214708 * _ + .5363325363 * v + .0514459929 * y), w = Hh(.2119034982 * _ + .6806995451 * v + .1073969566 * y), T = Hh(.0883024619 * _ + .2817188376 * v + .6299787005 * y);
118793
+ return $h(eg(b, x, S) - eg(C, w, T), b - C, x - w, S - T, u);
118794
+ }
118795
+ function $h(e, t, n, r, i) {
118796
+ let a = i - Math.abs(e);
118797
+ if (a >= 0) {
118798
+ let e = 1.9779984951 * t - 2.428592205 * n + .4505937099 * r, i = .0259040371 * t + .7827717662 * n - .808675766 * r;
118799
+ if (e * e + i * i <= a * a) return 0;
118800
+ }
118801
+ return e > 0 ? -1 : 1;
118802
+ }
118803
+ function eg(e, t, n) {
118804
+ let r = .2104542553 * e + .793617785 * t - .0040720468 * n, i = Yh * r - qh;
118805
+ return .5 * (i + Math.sqrt(i * i + 4 * Jh * Yh * r));
118728
118806
  }
118729
- function kh(e, t, n, r, i, a, o, s) {
118730
- let c = e[n], l = e[n + 1], u = e[n + 2], d = e[n + 3], f = r - c, p = i - l, m = a - u, h = o - d;
118731
- if (!f && !p && !m && !h) return 0;
118732
- if (o < 255 || d < 255) {
118733
- let e = 255, n = 255, g = 255;
118734
- s && (e = 48 + t % 2 * 159, n = 48 + 159 * ((t / 1.618033988749895 | 0) % 2), g = 48 + 159 * ((t / 2.618033988749895 | 0) % 2)), f = (r * o - c * d - e * h) / 255, p = (i * o - l * d - n * h) / 255, m = (a * o - u * d - g * h) / 255;
118735
- }
118736
- return f * .29889531 + p * .58662247 + m * .11448223;
118807
+ function tg(e, t, n, r, i, a) {
118808
+ let o = e[t], s = e[t + 1], c = e[t + 2], l = e[t + 3], u = n - o, d = r - s, f = i - c, p = a - l;
118809
+ if (!u && !d && !f && !p) return 0;
118810
+ if (a < 255 || l < 255) {
118811
+ u = (n * a - o * l - 255 * p) / 255, d = (r * a - s * l - 255 * p) / 255, f = (i * a - c * l - 255 * p) / 255;
118812
+ let e = u * .29889531 + d * .58662247 + f * .11448223;
118813
+ return e === 0 && p ? p / 2 : e;
118814
+ }
118815
+ return u * .29889531 + d * .58662247 + f * .11448223;
118737
118816
  }
118738
- function Ah(e, t, n, r, i) {
118817
+ function ng(e, t, n, r, i) {
118739
118818
  e[t] = n, e[t + 1] = r, e[t + 2] = i, e[t + 3] = 255;
118740
118819
  }
118741
- function jh(e, t, n, r) {
118742
- let i = 255 + (e[t] * .29889531 + e[t + 1] * .58662247 + e[t + 2] * .11448223 - 255) * n * e[t + 3] / 255;
118743
- Ah(r, t, i, i, i);
118820
+ function rg(e, t, n, r) {
118821
+ let i = 255 + (n[t] * .29889531 + n[t + 1] * .58662247 + n[t + 2] * .11448223 - 255) * r * n[t + 3] / 255;
118822
+ ng(e, t, i, i, i);
118744
118823
  }
118745
118824
  //#endregion
118746
118825
  //#region node_modules/.pnpm/pngjs@7.0.0/node_modules/pngjs/lib/chunkstream.js
118747
- var Mh = /* @__PURE__ */ o(((e, t) => {
118826
+ var ig = /* @__PURE__ */ o(((e, t) => {
118748
118827
  var n = l(), r = l(), i = t.exports = function() {
118749
118828
  r.call(this), this._buffers = [], this._buffered = 0, this._reads = [], this._paused = !1, this._encoding = "utf8", this.writable = !0;
118750
118829
  };
@@ -118791,7 +118870,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
118791
118870
  this.emit("error", e);
118792
118871
  }
118793
118872
  };
118794
- })), Nh = /* @__PURE__ */ o(((e) => {
118873
+ })), ag = /* @__PURE__ */ o(((e) => {
118795
118874
  var t = [
118796
118875
  {
118797
118876
  x: [0],
@@ -118870,13 +118949,13 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
118870
118949
  return o * 4 + c * e * 4;
118871
118950
  };
118872
118951
  };
118873
- })), Ph = /* @__PURE__ */ o(((e, t) => {
118952
+ })), og = /* @__PURE__ */ o(((e, t) => {
118874
118953
  t.exports = function(e, t, n) {
118875
118954
  let r = e + t - n, i = Math.abs(r - e), a = Math.abs(r - t), o = Math.abs(r - n);
118876
118955
  return i <= a && i <= o ? e : a <= o ? t : n;
118877
118956
  };
118878
- })), Fh = /* @__PURE__ */ o(((e, t) => {
118879
- var n = Nh(), r = Ph();
118957
+ })), sg = /* @__PURE__ */ o(((e, t) => {
118958
+ var n = ag(), r = og();
118880
118959
  function i(e, t, n) {
118881
118960
  let r = e * t;
118882
118961
  return n !== 8 && (r = Math.ceil(r / (8 / n))), r;
@@ -118943,8 +119022,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
118943
119022
  }
118944
119023
  this.write(n), r.lineIndex++, r.lineIndex >= r.height ? (this._lastLine = null, this._imageIndex++, r = this._images[this._imageIndex]) : this._lastLine = n, r ? this.read(r.byteWidth + 1, this._reverseFilterLine.bind(this)) : (this._lastLine = null, this.complete());
118945
119024
  };
118946
- })), Ih = /* @__PURE__ */ o(((e, t) => {
118947
- var n = l(), r = Mh(), i = Fh(), a = t.exports = function(e) {
119025
+ })), cg = /* @__PURE__ */ o(((e, t) => {
119026
+ var n = l(), r = ig(), i = sg(), a = t.exports = function(e) {
118948
119027
  r.call(this);
118949
119028
  let t = [], n = this;
118950
119029
  this._filter = new i(e, {
@@ -118958,7 +119037,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
118958
119037
  }), this._filter.start();
118959
119038
  };
118960
119039
  n.inherits(a, r);
118961
- })), Lh = /* @__PURE__ */ o(((e, t) => {
119040
+ })), lg = /* @__PURE__ */ o(((e, t) => {
118962
119041
  t.exports = {
118963
119042
  PNG_SIGNATURE: [
118964
119043
  137,
@@ -118991,7 +119070,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
118991
119070
  },
118992
119071
  GAMMA_DIVISION: 1e5
118993
119072
  };
118994
- })), Rh = /* @__PURE__ */ o(((e, t) => {
119073
+ })), ug = /* @__PURE__ */ o(((e, t) => {
118995
119074
  var n = [];
118996
119075
  (function() {
118997
119076
  for (let e = 0; e < 256; e++) {
@@ -119013,8 +119092,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119013
119092
  for (let r = 0; r < e.length; r++) t = n[(t ^ e[r]) & 255] ^ t >>> 8;
119014
119093
  return t ^ -1;
119015
119094
  };
119016
- })), zh = /* @__PURE__ */ o(((e, t) => {
119017
- var n = Lh(), r = Rh(), i = t.exports = function(e, t) {
119095
+ })), dg = /* @__PURE__ */ o(((e, t) => {
119096
+ var n = lg(), r = ug(), i = t.exports = function(e, t) {
119018
119097
  this._options = e, e.checkCRC = e.checkCRC !== !1, this._hasIHDR = !1, this._hasIEND = !1, this._emittedHeadersFinished = !1, this._palette = [], this._colorType = 0, this._chunks = {}, this._chunks[n.TYPE_IHDR] = this._handleIHDR.bind(this), this._chunks[n.TYPE_IEND] = this._handleIEND.bind(this), this._chunks[n.TYPE_IDAT] = this._handleIDAT.bind(this), this._chunks[n.TYPE_PLTE] = this._handlePLTE.bind(this), this._chunks[n.TYPE_tRNS] = this._handleTRNS.bind(this), this._chunks[n.TYPE_gAMA] = this._handleGAMA.bind(this), this.read = t.read, this.error = t.error, this.metadata = t.metadata, this.gamma = t.gamma, this.transColor = t.transColor, this.palette = t.palette, this.parsed = t.parsed, this.inflateData = t.inflateData, this.finished = t.finished, this.simpleTransparency = t.simpleTransparency, this.headersFinished = t.headersFinished || function() {};
119019
119098
  };
119020
119099
  i.prototype.start = function() {
@@ -119128,8 +119207,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119128
119207
  }, i.prototype._parseIEND = function(e) {
119129
119208
  this._crc.write(e), this._hasIEND = !0, this._handleChunkEnd(), this.finished && this.finished();
119130
119209
  };
119131
- })), Bh = /* @__PURE__ */ o(((e) => {
119132
- var t = Nh(), n = [
119210
+ })), fg = /* @__PURE__ */ o(((e) => {
119211
+ var t = ag(), n = [
119133
119212
  function() {},
119134
119213
  function(e, t, n, r) {
119135
119214
  if (r === t.length) throw Error("Ran out of data");
@@ -119242,7 +119321,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119242
119321
  } else d.end();
119243
119322
  return f;
119244
119323
  };
119245
- })), Vh = /* @__PURE__ */ o(((e, t) => {
119324
+ })), pg = /* @__PURE__ */ o(((e, t) => {
119246
119325
  function n(e, t, n, r, i) {
119247
119326
  let a = 0;
119248
119327
  for (let o = 0; o < r; o++) for (let r = 0; r < n; r++) {
@@ -119271,8 +119350,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119271
119350
  let o = t.depth, s = t.width, c = t.height, l = t.colorType, u = t.transColor, d = t.palette, f = e;
119272
119351
  return l === 3 ? n(e, f, s, c, d) : (u && r(e, f, s, c, u), o !== 8 && !a && (o === 16 && (f = Buffer.alloc(s * c * 4)), i(e, f, s, c, o))), f;
119273
119352
  };
119274
- })), Hh = /* @__PURE__ */ o(((e, t) => {
119275
- var n = l(), r = l(), i = Mh(), a = Ih(), o = zh(), s = Bh(), c = Vh(), u = t.exports = function(e) {
119353
+ })), mg = /* @__PURE__ */ o(((e, t) => {
119354
+ var n = l(), r = l(), i = ig(), a = cg(), o = dg(), s = fg(), c = pg(), u = t.exports = function(e) {
119276
119355
  i.call(this), this._parser = new o(e, {
119277
119356
  read: this.read.bind(this),
119278
119357
  error: this._handleError.bind(this),
@@ -119329,8 +119408,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119329
119408
  }
119330
119409
  this.emit("parsed", t);
119331
119410
  };
119332
- })), Uh = /* @__PURE__ */ o(((e, t) => {
119333
- var n = Lh();
119411
+ })), hg = /* @__PURE__ */ o(((e, t) => {
119412
+ var n = lg();
119334
119413
  t.exports = function(e, t, r, i) {
119335
119414
  let a = [n.COLORTYPE_COLOR_ALPHA, n.COLORTYPE_ALPHA].indexOf(i.colorType) !== -1;
119336
119415
  if (i.colorType === i.inputColorType) {
@@ -119389,8 +119468,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119389
119468
  }
119390
119469
  return u;
119391
119470
  };
119392
- })), Wh = /* @__PURE__ */ o(((e, t) => {
119393
- var n = Ph();
119471
+ })), gg = /* @__PURE__ */ o(((e, t) => {
119472
+ var n = og();
119394
119473
  function r(e, t, n, r, i) {
119395
119474
  for (let a = 0; a < n; a++) r[i + a] = e[t + a];
119396
119475
  }
@@ -119493,8 +119572,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119493
119572
  }
119494
119573
  return l;
119495
119574
  };
119496
- })), Gh = /* @__PURE__ */ o(((e, t) => {
119497
- var n = Lh(), r = Rh(), i = Uh(), a = Wh(), o = l(), s = t.exports = function(e) {
119575
+ })), _g = /* @__PURE__ */ o(((e, t) => {
119576
+ var n = lg(), r = ug(), i = hg(), a = gg(), o = l(), s = t.exports = function(e) {
119498
119577
  if (this._options = e, e.deflateChunkSize = e.deflateChunkSize || 32768, e.deflateLevel = e.deflateLevel == null ? 9 : e.deflateLevel, e.deflateStrategy = e.deflateStrategy == null ? 3 : e.deflateStrategy, e.inputHasAlpha = e.inputHasAlpha == null || e.inputHasAlpha, e.deflateFactory = e.deflateFactory || o.createDeflate, e.bitDepth = e.bitDepth || 8, e.colorType = typeof e.colorType == "number" ? e.colorType : n.COLORTYPE_COLOR_ALPHA, e.inputColorType = typeof e.inputColorType == "number" ? e.inputColorType : n.COLORTYPE_COLOR_ALPHA, [
119499
119578
  n.COLORTYPE_GRAYSCALE,
119500
119579
  n.COLORTYPE_COLOR,
@@ -119534,8 +119613,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119534
119613
  }, s.prototype.packIEND = function() {
119535
119614
  return this._packChunk(n.TYPE_IEND, null);
119536
119615
  };
119537
- })), Kh = /* @__PURE__ */ o(((e, t) => {
119538
- var n = l(), r = l(), i = Lh(), a = Gh(), o = t.exports = function(e) {
119616
+ })), vg = /* @__PURE__ */ o(((e, t) => {
119617
+ var n = l(), r = l(), i = lg(), a = _g(), o = t.exports = function(e) {
119539
119618
  r.call(this);
119540
119619
  let t = e || {};
119541
119620
  this._packer = new a(t), this._deflate = this._packer.createDeflate(), this.readable = !0;
@@ -119549,7 +119628,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119549
119628
  this.emit("data", this._packer.packIEND()), this.emit("end");
119550
119629
  }.bind(this)), this._deflate.end(a);
119551
119630
  };
119552
- })), qh = /* @__PURE__ */ o(((e, t) => {
119631
+ })), yg = /* @__PURE__ */ o(((e, t) => {
119553
119632
  var n = l().ok, r = l(), i = l(), a = l().kMaxLength;
119554
119633
  function o(e) {
119555
119634
  if (!(this instanceof o)) return new o(e);
@@ -119595,7 +119674,7 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119595
119674
  return u(new o(t), e);
119596
119675
  }
119597
119676
  t.exports = e = d, e.Inflate = o, e.createInflate = s, e.inflateSync = d;
119598
- })), Jh = /* @__PURE__ */ o(((e, t) => {
119677
+ })), bg = /* @__PURE__ */ o(((e, t) => {
119599
119678
  var n = t.exports = function(e) {
119600
119679
  this._buffer = e, this._reads = [];
119601
119680
  };
@@ -119617,8 +119696,8 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119617
119696
  if (this._reads.length > 0) throw Error("There are some read requests waitng on finished stream");
119618
119697
  if (this._buffer.length > 0) throw Error("unrecognised content at end of stream");
119619
119698
  };
119620
- })), Yh = /* @__PURE__ */ o(((e) => {
119621
- var t = Jh(), n = Fh();
119699
+ })), xg = /* @__PURE__ */ o(((e) => {
119700
+ var t = bg(), n = sg();
119622
119701
  e.process = function(e, r) {
119623
119702
  let i = [], a = new t(e);
119624
119703
  return new n(r, {
@@ -119629,10 +119708,10 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119629
119708
  complete: function() {}
119630
119709
  }).start(), a.process(), Buffer.concat(i);
119631
119710
  };
119632
- })), Xh = /* @__PURE__ */ o(((e, t) => {
119633
- var n = !0, r = l(), i = qh();
119711
+ })), Sg = /* @__PURE__ */ o(((e, t) => {
119712
+ var n = !0, r = l(), i = yg();
119634
119713
  r.deflateSync || (n = !1);
119635
- var a = Jh(), o = Yh(), s = zh(), c = Bh(), u = Vh();
119714
+ var a = bg(), o = xg(), s = dg(), c = fg(), u = pg();
119636
119715
  t.exports = function(e, t) {
119637
119716
  if (!n) throw Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");
119638
119717
  let l;
@@ -119690,10 +119769,10 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119690
119769
  let E = u(T, f, t.skipRescale);
119691
119770
  return f.data = E, f.gamma = _ || 0, f;
119692
119771
  };
119693
- })), Zh = /* @__PURE__ */ o(((e, t) => {
119772
+ })), Cg = /* @__PURE__ */ o(((e, t) => {
119694
119773
  var n = !0, r = l();
119695
119774
  r.deflateSync || (n = !1);
119696
- var i = Lh(), a = Gh();
119775
+ var i = lg(), a = _g();
119697
119776
  t.exports = function(e, t) {
119698
119777
  if (!n) throw Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");
119699
119778
  let o = new a(t || {}), s = [];
@@ -119702,15 +119781,15 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119702
119781
  if (c = null, !l || !l.length) throw Error("bad png - invalid compressed data response");
119703
119782
  return s.push(o.packIDAT(l)), s.push(o.packIEND()), Buffer.concat(s);
119704
119783
  };
119705
- })), Qh = /* @__PURE__ */ o(((e) => {
119706
- var t = Xh(), n = Zh();
119784
+ })), wg = /* @__PURE__ */ o(((e) => {
119785
+ var t = Sg(), n = Cg();
119707
119786
  e.read = function(e, n) {
119708
119787
  return t(e, n || {});
119709
119788
  }, e.write = function(e, t) {
119710
119789
  return n(e, t);
119711
119790
  };
119712
- })), $h = (/* @__PURE__ */ o(((e) => {
119713
- var t = l(), n = l(), r = Hh(), i = Kh(), a = Qh(), o = e.PNG = function(e) {
119791
+ })), Tg = (/* @__PURE__ */ o(((e) => {
119792
+ var t = l(), n = l(), r = mg(), i = vg(), a = wg(), o = e.PNG = function(e) {
119714
119793
  n.call(this), e ||= {}, this.width = e.width | 0, this.height = e.height | 0, this.data = this.width > 0 && this.height > 0 ? Buffer.alloc(4 * this.width * this.height) : null, e.fill && this.data && this.data.fill(0), this.gamma = 0, this.readable = this.writable = !0, this._parser = new r(e), this._parser.on("error", this.emit.bind(this, "error")), this._parser.on("close", this._handleClose.bind(this)), this._parser.on("metadata", this._metadata.bind(this)), this._parser.on("gamma", this._gamma.bind(this)), this._parser.on("parsed", function(e) {
119715
119794
  this.data = e, this.emit("parsed", e);
119716
119795
  }.bind(this)), this._packer = new i(e), this._packer.on("data", this.emit.bind(this, "data")), this._packer.on("end", this.emit.bind(this, "end")), this._parser.on("close", this._handleClose.bind(this)), this._packer.on("error", this.emit.bind(this, "error"));
@@ -119760,15 +119839,15 @@ var Mh = /* @__PURE__ */ o(((e, t) => {
119760
119839
  o.adjustGamma(this);
119761
119840
  };
119762
119841
  })))();
119763
- async function eg(e, t = 2) {
119842
+ async function Eg(e, t = 2) {
119764
119843
  let n = [], r = await Ch(e, { scale: t });
119765
119844
  for await (let e of r) n.push(e);
119766
119845
  return n;
119767
119846
  }
119768
- async function tg(e, t) {
119847
+ async function Dg(e, t) {
119769
119848
  let { scale: n = 2, threshold: r = .1, snapshotsDir: i, snapshotName: a, updateSnapshots: o = !1 } = t;
119770
119849
  (0, u.mkdirSync)(i, { recursive: !0 });
119771
- let s = await eg(e, n), c = [];
119850
+ let s = await Eg(e, n), c = [];
119772
119851
  for (let e = 0; e < s.length; e++) {
119773
119852
  let t = e + 1, n = (0, u.resolve)(i, `${a}-page${t}.png`), l = (0, u.resolve)(i, `${a}-page${t}-diff.png`);
119774
119853
  if (!(0, u.existsSync)(n) || o) {
@@ -119781,7 +119860,7 @@ async function tg(e, t) {
119781
119860
  });
119782
119861
  continue;
119783
119862
  }
119784
- let d = $h.PNG.sync.read(s[e]), f = $h.PNG.sync.read((0, u.readFileSync)(n));
119863
+ let d = Tg.PNG.sync.read(s[e]), f = Tg.PNG.sync.read((0, u.readFileSync)(n));
119785
119864
  if (d.width !== f.width || d.height !== f.height) {
119786
119865
  (0, u.writeFileSync)((0, u.resolve)(i, `${a}-page${t}-actual.png`), s[e]), c.push({
119787
119866
  page: t,
@@ -119792,11 +119871,11 @@ async function tg(e, t) {
119792
119871
  });
119793
119872
  continue;
119794
119873
  }
119795
- let p = new $h.PNG({
119874
+ let p = new Tg.PNG({
119796
119875
  width: d.width,
119797
119876
  height: d.height
119798
119877
  }), m = wh(d.data, f.data, p.data, d.width, d.height, { threshold: r }), h = d.width * d.height, g = m / h * 100;
119799
- m > 0 && (0, u.writeFileSync)(l, $h.PNG.sync.write(p)), c.push({
119878
+ m > 0 && (0, u.writeFileSync)(l, Tg.PNG.sync.write(p)), c.push({
119800
119879
  page: t,
119801
119880
  mismatchedPixels: m,
119802
119881
  totalPixels: h,
@@ -119807,9 +119886,9 @@ async function tg(e, t) {
119807
119886
  }
119808
119887
  return c;
119809
119888
  }
119810
- async function ng(e, t, n, r = "a", i = "b", a = 2, o = .1) {
119889
+ async function Og(e, t, n, r = "a", i = "b", a = 2, o = .1) {
119811
119890
  (0, u.mkdirSync)(n, { recursive: !0 });
119812
- let s = await eg(e, a), c = await eg(t, a), l = Math.max(s.length, c.length), d = [];
119891
+ let s = await Eg(e, a), c = await Eg(t, a), l = Math.max(s.length, c.length), d = [];
119813
119892
  for (let e = 0; e < l; e++) {
119814
119893
  let t = e + 1;
119815
119894
  if (!s[e] || !c[e]) {
@@ -119823,7 +119902,7 @@ async function ng(e, t, n, r = "a", i = "b", a = 2, o = .1) {
119823
119902
  continue;
119824
119903
  }
119825
119904
  (0, u.writeFileSync)((0, u.resolve)(n, `${r}-page${t}.png`), s[e]), (0, u.writeFileSync)((0, u.resolve)(n, `${i}-page${t}.png`), c[e]);
119826
- let a = $h.PNG.sync.read(s[e]), l = $h.PNG.sync.read(c[e]), f = Math.min(a.width, l.width), p = Math.min(a.height, l.height);
119905
+ let a = Tg.PNG.sync.read(s[e]), l = Tg.PNG.sync.read(c[e]), f = Math.min(a.width, l.width), p = Math.min(a.height, l.height);
119827
119906
  if (a.width !== l.width || a.height !== l.height) {
119828
119907
  d.push({
119829
119908
  page: t,
@@ -119834,11 +119913,11 @@ async function ng(e, t, n, r = "a", i = "b", a = 2, o = .1) {
119834
119913
  });
119835
119914
  continue;
119836
119915
  }
119837
- let m = new $h.PNG({
119916
+ let m = new Tg.PNG({
119838
119917
  width: f,
119839
119918
  height: p
119840
119919
  }), h = wh(a.data, l.data, m.data, f, p, { threshold: o }), g = f * p;
119841
- (0, u.writeFileSync)((0, u.resolve)(n, `diff-page${t}.png`), $h.PNG.sync.write(m)), d.push({
119920
+ (0, u.writeFileSync)((0, u.resolve)(n, `diff-page${t}.png`), Tg.PNG.sync.write(m)), d.push({
119842
119921
  page: t,
119843
119922
  mismatchedPixels: h,
119844
119923
  totalPixels: g,
@@ -119850,6 +119929,6 @@ async function ng(e, t, n, r = "a", i = "b", a = 2, o = .1) {
119850
119929
  return d;
119851
119930
  }
119852
119931
  //#endregion
119853
- export { ga as classifyText, Sa as cleanMergedText, Yi as clusterCoordinates, tg as comparePdfToSnapshot, ng as comparetwoPdfs, Qi as detectRegions, Ca as extractDrawFromPage, Aa as extractDrawMerged, va as extractPlayerName, ya as extractSeedValue, Zi as findClusterIndex, ba as mergeTextItems, qi as parsePdfBuffer, eg as pdfToImages };
119932
+ export { ga as classifyText, Sa as cleanMergedText, Yi as clusterCoordinates, Dg as comparePdfToSnapshot, Og as comparetwoPdfs, Qi as detectRegions, Ca as extractDrawFromPage, Aa as extractDrawMerged, va as extractPlayerName, ya as extractSeedValue, Zi as findClusterIndex, ba as mergeTextItems, qi as parsePdfBuffer, Eg as pdfToImages };
119854
119933
 
119855
119934
  //# sourceMappingURL=parser.js.map