jspdf-utils 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * Helpers that prepare an HTML element for clean, paginated PDF output
5
5
  * via jsPDF's doc.html() renderer.
6
6
  */
7
- import type { jsPDF } from "jspdf";
7
+ import jsPDF from "jspdf-with-html2canvas-pro";
8
8
  export interface Margin {
9
9
  top: number;
10
10
  right: number;
@@ -1198,22 +1198,22 @@ const sA = (t) => t.type === 15, O = (t) => t.type === 17, H = (t) => t.type ===
1198
1198
  const n = (C, d) => {
1199
1199
  if (O(d))
1200
1200
  return d.number;
1201
- const E = (y) => y === "r" || y === "x" ? 0 : y === "g" || y === "y" ? 1 : 2;
1201
+ const p = (y) => y === "r" || y === "x" ? 0 : y === "g" || y === "y" ? 1 : 2;
1202
1202
  if (H(d)) {
1203
- const y = E(d.value);
1203
+ const y = p(d.value);
1204
1204
  return C[y];
1205
1205
  }
1206
- const p = (y) => {
1206
+ const E = (y) => {
1207
1207
  const G = y.filter(V);
1208
1208
  let AA = "(";
1209
1209
  for (const R of G)
1210
- AA += R.type === 18 && R.name === "calc" ? p(R.values) : O(R) ? R.number : R.type === 6 || H(R) ? R.value : "";
1210
+ AA += R.type === 18 && R.name === "calc" ? E(R.values) : O(R) ? R.number : R.type === 6 || H(R) ? R.value : "";
1211
1211
  return AA += ")", AA;
1212
1212
  };
1213
1213
  if (d.type === 18) {
1214
1214
  const y = d.values.filter(V);
1215
1215
  if (d.name === "calc") {
1216
- const G = p(y).replace(/r|x/, C[0].toString()).replace(/g|y/, C[1].toString()).replace(/b|z/, C[2].toString());
1216
+ const G = E(y).replace(/r|x/, C[0].toString()).replace(/g|y/, C[1].toString()).replace(/b|z/, C[2].toString());
1217
1217
  return new Function("return " + G)();
1218
1218
  }
1219
1219
  }
@@ -1224,21 +1224,21 @@ const sA = (t) => t.type === 15, O = (t) => t.type === 17, H = (t) => t.type ===
1224
1224
  if (typeof rA[e[1].value.toUpperCase()] > "u")
1225
1225
  throw new Error("Attempting to use unknown color in relative color 'from'");
1226
1226
  {
1227
- const d = RA(t, e[1].value), E = 255 & d, p = 255 & d >> 8, y = 255 & d >> 16;
1227
+ const d = RA(t, e[1].value), p = 255 & d, E = 255 & d >> 8, y = 255 & d >> 16;
1228
1228
  i = [
1229
1229
  { type: 17, number: 255 & d >> 24, flags: 1 },
1230
1230
  { type: 17, number: y, flags: 1 },
1231
- { type: 17, number: p, flags: 1 },
1232
- { type: 17, number: E > 1 ? E / 255 : E, flags: 1 }
1231
+ { type: 17, number: E, flags: 1 },
1232
+ { type: 17, number: p > 1 ? p / 255 : p, flags: 1 }
1233
1233
  ];
1234
1234
  }
1235
1235
  } else if (e[1].type === 5) {
1236
- const [C, d, E, p] = qs(e[1]);
1236
+ const [C, d, p, E] = qs(e[1]);
1237
1237
  i = [
1238
1238
  { type: 17, number: C, flags: 1 },
1239
1239
  { type: 17, number: d, flags: 1 },
1240
- { type: 17, number: E, flags: 1 },
1241
- { type: 17, number: p > 1 ? p / 255 : p, flags: 1 }
1240
+ { type: 17, number: p, flags: 1 },
1241
+ { type: 17, number: E > 1 ? E / 255 : E, flags: 1 }
1242
1242
  ];
1243
1243
  }
1244
1244
  if (i.length === 0)
@@ -4132,8 +4132,8 @@ class zl {
4132
4132
  g.push((s + o) / r.width), g.push((c + i) / r.width), g.push((n + l) / r.height), g.push((B + a) / r.height);
4133
4133
  const Q = Math.max(...g);
4134
4134
  Q > 1 && (s /= Q, n /= Q, o /= Q, B /= Q, i /= Q, a /= Q, c /= Q, l /= Q);
4135
- const w = r.width - o, h = r.height - a, f = r.width - i, u = r.height - l, C = e.borderTopWidth, d = e.borderRightWidth, E = e.borderBottomWidth, p = e.borderLeftWidth, y = I(e.paddingTop, A.bounds.width), G = I(e.paddingRight, A.bounds.width), AA = I(e.paddingBottom, A.bounds.width), R = I(e.paddingLeft, A.bounds.width);
4136
- this.topLeftBorderDoubleOuterBox = s > 0 || n > 0 ? K(r.left + p / 3, r.top + C / 3, s - p / 3, n - C / 3, x.TOP_LEFT) : new F(r.left + p / 3, r.top + C / 3), this.topRightBorderDoubleOuterBox = s > 0 || n > 0 ? K(r.left + w, r.top + C / 3, o - d / 3, B - C / 3, x.TOP_RIGHT) : new F(r.left + r.width - d / 3, r.top + C / 3), this.bottomRightBorderDoubleOuterBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d / 3, a - E / 3, x.BOTTOM_RIGHT) : new F(r.left + r.width - d / 3, r.top + r.height - E / 3), this.bottomLeftBorderDoubleOuterBox = c > 0 || l > 0 ? K(r.left + p / 3, r.top + u, c - p / 3, l - E / 3, x.BOTTOM_LEFT) : new F(r.left + p / 3, r.top + r.height - E / 3), this.topLeftBorderDoubleInnerBox = s > 0 || n > 0 ? K(r.left + p * 2 / 3, r.top + C * 2 / 3, s - p * 2 / 3, n - C * 2 / 3, x.TOP_LEFT) : new F(r.left + p * 2 / 3, r.top + C * 2 / 3), this.topRightBorderDoubleInnerBox = s > 0 || n > 0 ? K(r.left + w, r.top + C * 2 / 3, o - d * 2 / 3, B - C * 2 / 3, x.TOP_RIGHT) : new F(r.left + r.width - d * 2 / 3, r.top + C * 2 / 3), this.bottomRightBorderDoubleInnerBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d * 2 / 3, a - E * 2 / 3, x.BOTTOM_RIGHT) : new F(r.left + r.width - d * 2 / 3, r.top + r.height - E * 2 / 3), this.bottomLeftBorderDoubleInnerBox = c > 0 || l > 0 ? K(r.left + p * 2 / 3, r.top + u, c - p * 2 / 3, l - E * 2 / 3, x.BOTTOM_LEFT) : new F(r.left + p * 2 / 3, r.top + r.height - E * 2 / 3), this.topLeftBorderStroke = s > 0 || n > 0 ? K(r.left + p / 2, r.top + C / 2, s - p / 2, n - C / 2, x.TOP_LEFT) : new F(r.left + p / 2, r.top + C / 2), this.topRightBorderStroke = s > 0 || n > 0 ? K(r.left + w, r.top + C / 2, o - d / 2, B - C / 2, x.TOP_RIGHT) : new F(r.left + r.width - d / 2, r.top + C / 2), this.bottomRightBorderStroke = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d / 2, a - E / 2, x.BOTTOM_RIGHT) : new F(r.left + r.width - d / 2, r.top + r.height - E / 2), this.bottomLeftBorderStroke = c > 0 || l > 0 ? K(r.left + p / 2, r.top + u, c - p / 2, l - E / 2, x.BOTTOM_LEFT) : new F(r.left + p / 2, r.top + r.height - E / 2), this.topLeftBorderBox = s > 0 || n > 0 ? K(r.left, r.top, s, n, x.TOP_LEFT) : new F(r.left, r.top), this.topRightBorderBox = o > 0 || B > 0 ? K(r.left + w, r.top, o, B, x.TOP_RIGHT) : new F(r.left + r.width, r.top), this.bottomRightBorderBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i, a, x.BOTTOM_RIGHT) : new F(r.left + r.width, r.top + r.height), this.bottomLeftBorderBox = c > 0 || l > 0 ? K(r.left, r.top + u, c, l, x.BOTTOM_LEFT) : new F(r.left, r.top + r.height), this.topLeftPaddingBox = s > 0 || n > 0 ? K(r.left + p, r.top + C, Math.max(0, s - p), Math.max(0, n - C), x.TOP_LEFT) : new F(r.left + p, r.top + C), this.topRightPaddingBox = o > 0 || B > 0 ? K(r.left + Math.min(w, r.width - d), r.top + C, w > r.width + d ? 0 : Math.max(0, o - d), Math.max(0, B - C), x.TOP_RIGHT) : new F(r.left + r.width - d, r.top + C), this.bottomRightPaddingBox = i > 0 || a > 0 ? K(r.left + Math.min(f, r.width - p), r.top + Math.min(h, r.height - E), Math.max(0, i - d), Math.max(0, a - E), x.BOTTOM_RIGHT) : new F(r.left + r.width - d, r.top + r.height - E), this.bottomLeftPaddingBox = c > 0 || l > 0 ? K(r.left + p, r.top + Math.min(u, r.height - E), Math.max(0, c - p), Math.max(0, l - E), x.BOTTOM_LEFT) : new F(r.left + p, r.top + r.height - E), this.topLeftContentBox = s > 0 || n > 0 ? K(r.left + p + R, r.top + C + y, Math.max(0, s - (p + R)), Math.max(0, n - (C + y)), x.TOP_LEFT) : new F(r.left + p + R, r.top + C + y), this.topRightContentBox = o > 0 || B > 0 ? K(r.left + Math.min(w, r.width + p + R), r.top + C + y, w > r.width + p + R ? 0 : o - p + R, B - (C + y), x.TOP_RIGHT) : new F(r.left + r.width - (d + G), r.top + C + y), this.bottomRightContentBox = i > 0 || a > 0 ? K(r.left + Math.min(f, r.width - (p + R)), r.top + Math.min(h, r.height + C + y), Math.max(0, i - (d + G)), a - (E + AA), x.BOTTOM_RIGHT) : new F(r.left + r.width - (d + G), r.top + r.height - (E + AA)), this.bottomLeftContentBox = c > 0 || l > 0 ? K(r.left + p + R, r.top + u, Math.max(0, c - (p + R)), l - (E + AA), x.BOTTOM_LEFT) : new F(r.left + p + R, r.top + r.height - (E + AA));
4135
+ const w = r.width - o, h = r.height - a, f = r.width - i, u = r.height - l, C = e.borderTopWidth, d = e.borderRightWidth, p = e.borderBottomWidth, E = e.borderLeftWidth, y = I(e.paddingTop, A.bounds.width), G = I(e.paddingRight, A.bounds.width), AA = I(e.paddingBottom, A.bounds.width), R = I(e.paddingLeft, A.bounds.width);
4136
+ this.topLeftBorderDoubleOuterBox = s > 0 || n > 0 ? K(r.left + E / 3, r.top + C / 3, s - E / 3, n - C / 3, x.TOP_LEFT) : new F(r.left + E / 3, r.top + C / 3), this.topRightBorderDoubleOuterBox = s > 0 || n > 0 ? K(r.left + w, r.top + C / 3, o - d / 3, B - C / 3, x.TOP_RIGHT) : new F(r.left + r.width - d / 3, r.top + C / 3), this.bottomRightBorderDoubleOuterBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d / 3, a - p / 3, x.BOTTOM_RIGHT) : new F(r.left + r.width - d / 3, r.top + r.height - p / 3), this.bottomLeftBorderDoubleOuterBox = c > 0 || l > 0 ? K(r.left + E / 3, r.top + u, c - E / 3, l - p / 3, x.BOTTOM_LEFT) : new F(r.left + E / 3, r.top + r.height - p / 3), this.topLeftBorderDoubleInnerBox = s > 0 || n > 0 ? K(r.left + E * 2 / 3, r.top + C * 2 / 3, s - E * 2 / 3, n - C * 2 / 3, x.TOP_LEFT) : new F(r.left + E * 2 / 3, r.top + C * 2 / 3), this.topRightBorderDoubleInnerBox = s > 0 || n > 0 ? K(r.left + w, r.top + C * 2 / 3, o - d * 2 / 3, B - C * 2 / 3, x.TOP_RIGHT) : new F(r.left + r.width - d * 2 / 3, r.top + C * 2 / 3), this.bottomRightBorderDoubleInnerBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d * 2 / 3, a - p * 2 / 3, x.BOTTOM_RIGHT) : new F(r.left + r.width - d * 2 / 3, r.top + r.height - p * 2 / 3), this.bottomLeftBorderDoubleInnerBox = c > 0 || l > 0 ? K(r.left + E * 2 / 3, r.top + u, c - E * 2 / 3, l - p * 2 / 3, x.BOTTOM_LEFT) : new F(r.left + E * 2 / 3, r.top + r.height - p * 2 / 3), this.topLeftBorderStroke = s > 0 || n > 0 ? K(r.left + E / 2, r.top + C / 2, s - E / 2, n - C / 2, x.TOP_LEFT) : new F(r.left + E / 2, r.top + C / 2), this.topRightBorderStroke = s > 0 || n > 0 ? K(r.left + w, r.top + C / 2, o - d / 2, B - C / 2, x.TOP_RIGHT) : new F(r.left + r.width - d / 2, r.top + C / 2), this.bottomRightBorderStroke = i > 0 || a > 0 ? K(r.left + f, r.top + h, i - d / 2, a - p / 2, x.BOTTOM_RIGHT) : new F(r.left + r.width - d / 2, r.top + r.height - p / 2), this.bottomLeftBorderStroke = c > 0 || l > 0 ? K(r.left + E / 2, r.top + u, c - E / 2, l - p / 2, x.BOTTOM_LEFT) : new F(r.left + E / 2, r.top + r.height - p / 2), this.topLeftBorderBox = s > 0 || n > 0 ? K(r.left, r.top, s, n, x.TOP_LEFT) : new F(r.left, r.top), this.topRightBorderBox = o > 0 || B > 0 ? K(r.left + w, r.top, o, B, x.TOP_RIGHT) : new F(r.left + r.width, r.top), this.bottomRightBorderBox = i > 0 || a > 0 ? K(r.left + f, r.top + h, i, a, x.BOTTOM_RIGHT) : new F(r.left + r.width, r.top + r.height), this.bottomLeftBorderBox = c > 0 || l > 0 ? K(r.left, r.top + u, c, l, x.BOTTOM_LEFT) : new F(r.left, r.top + r.height), this.topLeftPaddingBox = s > 0 || n > 0 ? K(r.left + E, r.top + C, Math.max(0, s - E), Math.max(0, n - C), x.TOP_LEFT) : new F(r.left + E, r.top + C), this.topRightPaddingBox = o > 0 || B > 0 ? K(r.left + Math.min(w, r.width - d), r.top + C, w > r.width + d ? 0 : Math.max(0, o - d), Math.max(0, B - C), x.TOP_RIGHT) : new F(r.left + r.width - d, r.top + C), this.bottomRightPaddingBox = i > 0 || a > 0 ? K(r.left + Math.min(f, r.width - E), r.top + Math.min(h, r.height - p), Math.max(0, i - d), Math.max(0, a - p), x.BOTTOM_RIGHT) : new F(r.left + r.width - d, r.top + r.height - p), this.bottomLeftPaddingBox = c > 0 || l > 0 ? K(r.left + E, r.top + Math.min(u, r.height - p), Math.max(0, c - E), Math.max(0, l - p), x.BOTTOM_LEFT) : new F(r.left + E, r.top + r.height - p), this.topLeftContentBox = s > 0 || n > 0 ? K(r.left + E + R, r.top + C + y, Math.max(0, s - (E + R)), Math.max(0, n - (C + y)), x.TOP_LEFT) : new F(r.left + E + R, r.top + C + y), this.topRightContentBox = o > 0 || B > 0 ? K(r.left + Math.min(w, r.width + E + R), r.top + C + y, w > r.width + E + R ? 0 : o - E + R, B - (C + y), x.TOP_RIGHT) : new F(r.left + r.width - (d + G), r.top + C + y), this.bottomRightContentBox = i > 0 || a > 0 ? K(r.left + Math.min(f, r.width - (E + R)), r.top + Math.min(h, r.height + C + y), Math.max(0, i - (d + G)), a - (p + AA), x.BOTTOM_RIGHT) : new F(r.left + r.width - (d + G), r.top + r.height - (p + AA)), this.bottomLeftContentBox = c > 0 || l > 0 ? K(r.left + E + R, r.top + u, Math.max(0, c - (E + R)), l - (p + AA), x.BOTTOM_LEFT) : new F(r.left + E + R, r.top + r.height - (p + AA));
4137
4137
  }
4138
4138
  }
4139
4139
  var x;
@@ -4610,9 +4610,9 @@ class lr extends Ln {
4610
4610
  });
4611
4611
  const h = l[w - 1];
4612
4612
  if (h && h.length > 0 && r) {
4613
- const f = h.map((E) => E.text).join(""), u = h[0], C = r.width - (u.bounds.left - r.left), d = this.truncateTextWithEllipsis(f, C, e.letterSpacing);
4614
- n.forEach((E) => {
4615
- switch (E) {
4613
+ const f = h.map((p) => p.text).join(""), u = h[0], C = r.width - (u.bounds.left - r.left), d = this.truncateTextWithEllipsis(f, C, e.letterSpacing);
4614
+ n.forEach((p) => {
4615
+ switch (p) {
4616
4616
  case 0:
4617
4617
  this.ctx.fillStyle = b(e.color), e.letterSpacing === 0 ? this.ctx.fillText(d, u.bounds.left, u.bounds.top + e.fontSize.number) : tA(d).reduce((y, G) => (this.ctx.fillText(G, y, u.bounds.top + e.fontSize.number), y + this.ctx.measureText(G).width + e.letterSpacing), u.bounds.left);
4618
4618
  break;
@@ -4690,8 +4690,8 @@ class lr extends Ln {
4690
4690
  else if (f === 8)
4691
4691
  c > w ? (i += (c - w) / 2, c = w) : (g += (w - c) / 2, w = c), l > h ? (a += (l - h) / 2, l = h) : (Q += (h - l) / 2, h = l);
4692
4692
  else if (f === 16) {
4693
- const d = C > u ? w : h * C, E = c > w ? c : w;
4694
- d < E ? C > u ? (h = w / C, Q += (o.height - h) / 2) : (w = h * C, g += (o.width - w) / 2) : (c > w ? (i += (c - w) / 2, c = w) : (g += (w - c) / 2, w = c), l > h ? (a += (l - h) / 2, l = h) : (Q += (h - l) / 2, h = l));
4693
+ const d = C > u ? w : h * C, p = c > w ? c : w;
4694
+ d < p ? C > u ? (h = w / C, Q += (o.height - h) / 2) : (w = h * C, g += (o.width - w) / 2) : (c > w ? (i += (c - w) / 2, c = w) : (g += (w - c) / 2, w = c), l > h ? (a += (l - h) / 2, l = h) : (Q += (h - l) / 2, h = l));
4695
4695
  }
4696
4696
  this.ctx.drawImage(r, i, a, c, l, g, Q, w, h), this.ctx.restore();
4697
4697
  }
@@ -5082,15 +5082,15 @@ const dg = async (t, A) => {
5082
5082
  width: A.width ?? Math.ceil(w),
5083
5083
  height: A.height ?? Math.ceil(h)
5084
5084
  };
5085
- let E;
5085
+ let p;
5086
5086
  if (a)
5087
- i.logger.debug("Document cloned, using foreign object rendering"), E = await new ug(i, d).render(g);
5087
+ i.logger.debug("Document cloned, using foreign object rendering"), p = await new ug(i, d).render(g);
5088
5088
  else {
5089
5089
  i.logger.debug(`Document cloned, element located at ${f},${u} with size ${w}x${h} using computed rendering`), i.logger.debug("Starting DOM parsing");
5090
- const p = Un(i, g);
5091
- C === p.styles.backgroundColor && (p.styles.backgroundColor = rA.TRANSPARENT), i.logger.debug(`Starting renderer for element at ${d.x},${d.y} with size ${d.width}x${d.height}`), E = await new lr(i, d).render(p);
5090
+ const E = Un(i, g);
5091
+ C === E.styles.backgroundColor && (E.styles.backgroundColor = rA.TRANSPARENT), i.logger.debug(`Starting renderer for element at ${d.x},${d.y} with size ${d.width}x${d.height}`), p = await new lr(i, d).render(E);
5092
5092
  }
5093
- return (A.removeContainer ?? !0) && (hs.destroy(Q) || i.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")), i.logger.debug("Finished rendering"), E;
5093
+ return (A.removeContainer ?? !0) && (hs.destroy(Q) || i.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")), i.logger.debug("Finished rendering"), p;
5094
5094
  }, pg = (t, A, e) => {
5095
5095
  const r = A.ownerDocument, s = r.documentElement ? RA(t, getComputedStyle(r.documentElement).backgroundColor) : rA.TRANSPARENT, n = r.body ? RA(t, getComputedStyle(r.body).backgroundColor) : rA.TRANSPARENT, o = typeof e == "string" ? RA(t, e) : e === null ? rA.TRANSPARENT : 4294967295;
5096
5096
  return A === r.documentElement ? fA(s) ? fA(n) ? o : n : s : o;
@@ -5707,7 +5707,7 @@ async function kn(t, A, e, r, s, n, o) {
5707
5707
  fontSize: a = 2.5,
5708
5708
  fontFamily: c = "Arial, sans-serif",
5709
5709
  fontWeight: l = "normal"
5710
- } = A, g = a * e, Q = (A.gap ?? a * 0.5) * e, w = g * 0.5, h = Math.ceil(g * 2.5), f = Dg.test(B), u = Math.round(n - w * 2), C = Math.round(o - w * 2), [d, E] = await Promise.all([
5710
+ } = A, g = a * e, Q = (A.gap ?? a * 0.5) * e, w = g * 0.5, h = Math.ceil(g * 2.5), f = Dg.test(B), u = Math.round(n - w * 2), C = Math.round(o - w * 2), [d, p] = await Promise.all([
5711
5711
  Es(
5712
5712
  B,
5713
5713
  u,
@@ -5730,7 +5730,7 @@ async function kn(t, A, e, r, s, n, o) {
5730
5730
  Q,
5731
5731
  f
5732
5732
  )
5733
- ]), p = Math.round(h / 2);
5733
+ ]), E = Math.round(h / 2);
5734
5734
  t.drawImage(
5735
5735
  d,
5736
5736
  0,
@@ -5738,7 +5738,7 @@ async function kn(t, A, e, r, s, n, o) {
5738
5738
  d.width,
5739
5739
  d.height,
5740
5740
  r + w,
5741
- s - p,
5741
+ s - E,
5742
5742
  u,
5743
5743
  h
5744
5744
  ), t.drawImage(
@@ -5748,27 +5748,27 @@ async function kn(t, A, e, r, s, n, o) {
5748
5748
  d.width,
5749
5749
  d.height,
5750
5750
  r + w,
5751
- s + o - p,
5751
+ s + o - E,
5752
5752
  u,
5753
5753
  h
5754
5754
  ), t.save(), t.translate(r, s + o - w), t.rotate(-Math.PI / 2), t.drawImage(
5755
- E,
5755
+ p,
5756
5756
  0,
5757
5757
  0,
5758
- E.width,
5759
- E.height,
5758
+ p.width,
5759
+ p.height,
5760
5760
  0,
5761
- -p,
5761
+ -E,
5762
5762
  C,
5763
5763
  h
5764
5764
  ), t.restore(), t.save(), t.translate(r + n, s + w), t.rotate(Math.PI / 2), t.drawImage(
5765
- E,
5765
+ p,
5766
5766
  0,
5767
5767
  0,
5768
- E.width,
5769
- E.height,
5768
+ p.width,
5769
+ p.height,
5770
5770
  0,
5771
- -p,
5771
+ -E,
5772
5772
  C,
5773
5773
  h
5774
5774
  ), t.restore();
@@ -5895,7 +5895,7 @@ async function Gg(t, A = {}) {
5895
5895
  const a = await ae(o, {
5896
5896
  scale: s,
5897
5897
  backgroundColor: null
5898
- }), { jsPDF: c } = await import("jspdf"), l = Jn(a, n, B, s), g = Math.ceil(a.height / l.contentHeightPx), Q = _n(
5898
+ }), { jsPDF: c } = await import("./jspdf.es.min-BDu0IqVE.js").then((p) => p.j), l = Jn(a, n, B, s), g = Math.ceil(a.height / l.contentHeightPx), Q = _n(
5899
5899
  g,
5900
5900
  A.forcedPageCount
5901
5901
  ), w = n.pageWidth > n.pageHeight ? "l" : "p", { marginContent: h, textBorder: f, border: u } = A, C = h ? await ur(h, n, s) : {}, d = new c({
@@ -5903,29 +5903,29 @@ async function Gg(t, A = {}) {
5903
5903
  unit: "mm",
5904
5904
  format: [n.pageWidth, n.pageHeight]
5905
5905
  });
5906
- for (let E = 0; E < Q; E++) {
5906
+ for (let p = 0; p < Q; p++) {
5907
5907
  const {
5908
- canvas: p,
5908
+ canvas: E,
5909
5909
  ctx: y,
5910
5910
  sliceHeight: G
5911
- } = Wn(a, E, l);
5911
+ } = Wn(a, p, l);
5912
5912
  (h || f || u) && await Xn(
5913
5913
  y,
5914
5914
  h,
5915
5915
  C,
5916
5916
  n,
5917
5917
  l.pxPerMm,
5918
- E + 1,
5918
+ p + 1,
5919
5919
  Q,
5920
5920
  s,
5921
5921
  f,
5922
5922
  u
5923
- ), Yn(y, a, E, l, G);
5924
- const AA = p.toDataURL(
5923
+ ), Yn(y, a, p, l, G);
5924
+ const AA = E.toDataURL(
5925
5925
  `image/${e.toLowerCase()}`,
5926
5926
  r
5927
5927
  );
5928
- E > 0 && d.addPage([n.pageWidth, n.pageHeight], w), d.addImage(
5928
+ p > 0 && d.addPage([n.pageWidth, n.pageHeight], w), d.addImage(
5929
5929
  AA,
5930
5930
  e,
5931
5931
  0,
@@ -5957,11 +5957,11 @@ async function Mg(t, A = {}) {
5957
5957
  for (let C = 0; C < g; C++) {
5958
5958
  const {
5959
5959
  canvas: d,
5960
- ctx: E,
5961
- sliceHeight: p
5960
+ ctx: p,
5961
+ sliceHeight: E
5962
5962
  } = Wn(a, C, c);
5963
5963
  (w || h || f) && await Xn(
5964
- E,
5964
+ p,
5965
5965
  w,
5966
5966
  u,
5967
5967
  n,
@@ -5971,7 +5971,7 @@ async function Mg(t, A = {}) {
5971
5971
  s,
5972
5972
  h,
5973
5973
  f
5974
- ), Yn(E, a, C, c, p), Q.push(
5974
+ ), Yn(p, a, C, c, E), Q.push(
5975
5975
  d.toDataURL(
5976
5976
  `image/${e.toLowerCase()}`,
5977
5977
  r
@@ -6042,26 +6042,26 @@ async function Og(t, A, e = {}, r, s) {
6042
6042
  if (!C) continue;
6043
6043
  const d = Cr(u, n, f);
6044
6044
  if (d.width <= 0 || d.height <= 0) continue;
6045
- let E, p;
6045
+ let p, E;
6046
6046
  if (typeof C == "function") {
6047
6047
  const y = hr(C(h, o));
6048
6048
  if (!y) continue;
6049
- E = (await fr(
6049
+ p = (await fr(
6050
6050
  y,
6051
6051
  d.width,
6052
6052
  d.height,
6053
6053
  B
6054
6054
  )).toDataURL("image/png");
6055
6055
  } else
6056
- E = Q[u], p = `margin-${u}`;
6056
+ p = Q[u], E = `margin-${u}`;
6057
6057
  t.addImage(
6058
- E,
6058
+ p,
6059
6059
  "PNG",
6060
6060
  d.x,
6061
6061
  d.y,
6062
6062
  d.width,
6063
6063
  d.height,
6064
- p,
6064
+ E,
6065
6065
  "SLOW"
6066
6066
  );
6067
6067
  }