turbowrap-issue-widget 1.0.15 → 1.0.16

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.
@@ -73,48 +73,53 @@ class Un {
73
73
  }
74
74
  }
75
75
  async parseSSEStream(A, e, t, s) {
76
- var o;
77
- const n = (o = A.body) == null ? void 0 : o.getReader();
76
+ var B;
77
+ const n = (B = A.body) == null ? void 0 : B.getReader();
78
78
  if (!n) {
79
79
  s("Response body is not readable");
80
80
  return;
81
81
  }
82
82
  const i = new TextDecoder();
83
83
  let a = "";
84
+ const o = (c) => {
85
+ if (!c.trim()) return;
86
+ const l = c.split(`
87
+ `);
88
+ let w = "", u = "";
89
+ for (const g of l)
90
+ if (g.startsWith("event: "))
91
+ w = g.slice(7).trim();
92
+ else if (g.startsWith("data: ")) {
93
+ const Q = g.slice(6);
94
+ u += u ? `
95
+ ` + Q : Q;
96
+ }
97
+ if (u)
98
+ try {
99
+ const g = JSON.parse(u);
100
+ if (w === "error" || g.error) {
101
+ s(String(g.error || g.message || "Unknown error"));
102
+ return;
103
+ }
104
+ g.message && (w === "progress" || w === "log") && e(String(g.message)), (w === "complete" || g.questions || g.identifier) && (console.log("[IssueAPIClient] SSE complete/data event:", w, g), t(g));
105
+ } catch (g) {
106
+ console.warn("Failed to parse SSE data:", g);
107
+ }
108
+ };
84
109
  try {
85
110
  for (; ; ) {
86
- const { done: B, value: c } = await n.read();
87
- if (B) break;
88
- a += i.decode(c, { stream: !0 });
89
- const l = a.split(`
111
+ const { done: c, value: l } = await n.read();
112
+ if (c) {
113
+ a.trim() && (console.log("[IssueAPIClient] Processing remaining buffer on stream end"), o(a));
114
+ break;
115
+ }
116
+ a += i.decode(l, { stream: !0 });
117
+ const w = a.split(`
90
118
 
91
119
  `);
92
- a = l.pop() || "";
93
- for (const w of l) {
94
- if (!w.trim()) continue;
95
- const u = w.split(`
96
- `);
97
- let g = "", Q = "";
98
- for (const C of u)
99
- if (C.startsWith("event: "))
100
- g = C.slice(7).trim();
101
- else if (C.startsWith("data: ")) {
102
- const U = C.slice(6);
103
- Q += Q ? `
104
- ` + U : U;
105
- }
106
- if (Q)
107
- try {
108
- const C = JSON.parse(Q);
109
- if (g === "error" || C.error) {
110
- s(String(C.error || C.message || "Unknown error"));
111
- return;
112
- }
113
- C.message && (g === "progress" || g === "log") && e(String(C.message)), (g === "complete" || C.questions || C.identifier) && (console.log("[IssueAPIClient] SSE complete/data event:", g, C), t(C));
114
- } catch (C) {
115
- console.warn("Failed to parse SSE data:", C);
116
- }
117
- }
120
+ a = w.pop() || "";
121
+ for (const u of w)
122
+ o(u);
118
123
  }
119
124
  } finally {
120
125
  n.releaseLock();
@@ -193,14 +198,14 @@ class Un {
193
198
  else if (g.startsWith("data: ")) {
194
199
  const Q = g.slice(6);
195
200
  try {
196
- const C = JSON.parse(Q);
197
- if (u === "error" || C.error) {
198
- n(String(C.error || "Unknown error"));
201
+ const F = JSON.parse(Q);
202
+ if (u === "error" || F.error) {
203
+ n(String(F.error || "Unknown error"));
199
204
  return;
200
205
  }
201
- u === "chunk" && C.content && e(String(C.content)), u === "action" && C.type && C.data && t(C), u === "done" && s();
202
- } catch (C) {
203
- console.warn("Failed to parse chat SSE data:", C);
206
+ u === "chunk" && F.content && e(String(F.content)), u === "action" && F.type && F.data && t(F), u === "done" && s();
207
+ } catch (F) {
208
+ console.warn("Failed to parse chat SSE data:", F);
204
209
  }
205
210
  }
206
211
  }
@@ -1413,9 +1418,9 @@ var mr = function(r, A) {
1413
1418
  B = null;
1414
1419
  }
1415
1420
  }
1416
- return r.map(function(Q, C) {
1421
+ return r.map(function(Q, F) {
1417
1422
  var U = Q.color;
1418
- return { color: U, stop: Math.max(Math.min(1, s[C] / A), 0) };
1423
+ return { color: U, stop: Math.max(Math.min(1, s[F] / A), 0) };
1419
1424
  });
1420
1425
  }, ga = function(r, A, e) {
1421
1426
  var t = A / 2, s = e / 2, n = L(r[0], A) - t, i = s - L(r[1], e);
@@ -3827,15 +3832,15 @@ var cB = 1, Ut = 2, Ft = 3, Mr = 4, Or = 5, lB = 7, Rr = 8, pt = 9, vt = 10, Gr
3827
3832
  var u = l.values.filter(K);
3828
3833
  u.length && B.appendChild(a.createTextNode(A.getAttribute(u[0].value) || ""));
3829
3834
  } else if (l.name === "counter") {
3830
- var g = l.values.filter(WA), Q = g[0], C = g[1];
3835
+ var g = l.values.filter(WA), Q = g[0], F = g[1];
3831
3836
  if (Q && K(Q)) {
3832
- var U = n.counters.getCounterValue(Q.value), F = C && K(C) ? Xt.parse(n.context, C.value) : 3;
3833
- B.appendChild(a.createTextNode(ue(U, F, !1)));
3837
+ var U = n.counters.getCounterValue(Q.value), C = F && K(F) ? Xt.parse(n.context, F.value) : 3;
3838
+ B.appendChild(a.createTextNode(ue(U, C, !1)));
3834
3839
  }
3835
3840
  } else if (l.name === "counters") {
3836
- var y = l.values.filter(WA), Q = y[0], E = y[1], C = y[2];
3841
+ var y = l.values.filter(WA), Q = y[0], E = y[1], F = y[2];
3837
3842
  if (Q && K(Q)) {
3838
- var p = n.counters.getCounterValues(Q.value), h = C && K(C) ? Xt.parse(n.context, C.value) : 3, m = E && E.type === 0 ? E.value : "", I = p.map(function(J) {
3843
+ var p = n.counters.getCounterValues(Q.value), h = F && K(F) ? Xt.parse(n.context, F.value) : 3, m = E && E.type === 0 ? E.value : "", I = p.map(function(J) {
3839
3844
  return ue(J, h, !1);
3840
3845
  }).join(m);
3841
3846
  B.appendChild(a.createTextNode(I));
@@ -4060,12 +4065,12 @@ var qB = function(r, A) {
4060
4065
  /** @class */
4061
4066
  /* @__PURE__ */ function() {
4062
4067
  function r(A) {
4063
- var e = A.styles, t = A.bounds, s = se(e.borderTopLeftRadius, t.width, t.height), n = s[0], i = s[1], a = se(e.borderTopRightRadius, t.width, t.height), o = a[0], B = a[1], c = se(e.borderBottomRightRadius, t.width, t.height), l = c[0], w = c[1], u = se(e.borderBottomLeftRadius, t.width, t.height), g = u[0], Q = u[1], C = [];
4064
- C.push((n + o) / t.width), C.push((g + l) / t.width), C.push((i + Q) / t.height), C.push((B + w) / t.height);
4065
- var U = Math.max.apply(Math, C);
4068
+ var e = A.styles, t = A.bounds, s = se(e.borderTopLeftRadius, t.width, t.height), n = s[0], i = s[1], a = se(e.borderTopRightRadius, t.width, t.height), o = a[0], B = a[1], c = se(e.borderBottomRightRadius, t.width, t.height), l = c[0], w = c[1], u = se(e.borderBottomLeftRadius, t.width, t.height), g = u[0], Q = u[1], F = [];
4069
+ F.push((n + o) / t.width), F.push((g + l) / t.width), F.push((i + Q) / t.height), F.push((B + w) / t.height);
4070
+ var U = Math.max.apply(Math, F);
4066
4071
  U > 1 && (n /= U, i /= U, o /= U, B /= U, l /= U, w /= U, g /= U, Q /= U);
4067
- var F = t.width - o, y = t.height - w, E = t.width - l, p = t.height - Q, h = e.borderTopWidth, m = e.borderRightWidth, I = e.borderBottomWidth, v = e.borderLeftWidth, M = L(e.paddingTop, A.bounds.width), J = L(e.paddingRight, A.bounds.width), z = L(e.paddingBottom, A.bounds.width), x = L(e.paddingLeft, A.bounds.width);
4068
- this.topLeftBorderDoubleOuterBox = n > 0 || i > 0 ? S(t.left + v / 3, t.top + h / 3, n - v / 3, i - h / 3, b.TOP_LEFT) : new f(t.left + v / 3, t.top + h / 3), this.topRightBorderDoubleOuterBox = n > 0 || i > 0 ? S(t.left + F, t.top + h / 3, o - m / 3, B - h / 3, b.TOP_RIGHT) : new f(t.left + t.width - m / 3, t.top + h / 3), this.bottomRightBorderDoubleOuterBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m / 3, w - I / 3, b.BOTTOM_RIGHT) : new f(t.left + t.width - m / 3, t.top + t.height - I / 3), this.bottomLeftBorderDoubleOuterBox = g > 0 || Q > 0 ? S(t.left + v / 3, t.top + p, g - v / 3, Q - I / 3, b.BOTTOM_LEFT) : new f(t.left + v / 3, t.top + t.height - I / 3), this.topLeftBorderDoubleInnerBox = n > 0 || i > 0 ? S(t.left + v * 2 / 3, t.top + h * 2 / 3, n - v * 2 / 3, i - h * 2 / 3, b.TOP_LEFT) : new f(t.left + v * 2 / 3, t.top + h * 2 / 3), this.topRightBorderDoubleInnerBox = n > 0 || i > 0 ? S(t.left + F, t.top + h * 2 / 3, o - m * 2 / 3, B - h * 2 / 3, b.TOP_RIGHT) : new f(t.left + t.width - m * 2 / 3, t.top + h * 2 / 3), this.bottomRightBorderDoubleInnerBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m * 2 / 3, w - I * 2 / 3, b.BOTTOM_RIGHT) : new f(t.left + t.width - m * 2 / 3, t.top + t.height - I * 2 / 3), this.bottomLeftBorderDoubleInnerBox = g > 0 || Q > 0 ? S(t.left + v * 2 / 3, t.top + p, g - v * 2 / 3, Q - I * 2 / 3, b.BOTTOM_LEFT) : new f(t.left + v * 2 / 3, t.top + t.height - I * 2 / 3), this.topLeftBorderStroke = n > 0 || i > 0 ? S(t.left + v / 2, t.top + h / 2, n - v / 2, i - h / 2, b.TOP_LEFT) : new f(t.left + v / 2, t.top + h / 2), this.topRightBorderStroke = n > 0 || i > 0 ? S(t.left + F, t.top + h / 2, o - m / 2, B - h / 2, b.TOP_RIGHT) : new f(t.left + t.width - m / 2, t.top + h / 2), this.bottomRightBorderStroke = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m / 2, w - I / 2, b.BOTTOM_RIGHT) : new f(t.left + t.width - m / 2, t.top + t.height - I / 2), this.bottomLeftBorderStroke = g > 0 || Q > 0 ? S(t.left + v / 2, t.top + p, g - v / 2, Q - I / 2, b.BOTTOM_LEFT) : new f(t.left + v / 2, t.top + t.height - I / 2), this.topLeftBorderBox = n > 0 || i > 0 ? S(t.left, t.top, n, i, b.TOP_LEFT) : new f(t.left, t.top), this.topRightBorderBox = o > 0 || B > 0 ? S(t.left + F, t.top, o, B, b.TOP_RIGHT) : new f(t.left + t.width, t.top), this.bottomRightBorderBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l, w, b.BOTTOM_RIGHT) : new f(t.left + t.width, t.top + t.height), this.bottomLeftBorderBox = g > 0 || Q > 0 ? S(t.left, t.top + p, g, Q, b.BOTTOM_LEFT) : new f(t.left, t.top + t.height), this.topLeftPaddingBox = n > 0 || i > 0 ? S(t.left + v, t.top + h, Math.max(0, n - v), Math.max(0, i - h), b.TOP_LEFT) : new f(t.left + v, t.top + h), this.topRightPaddingBox = o > 0 || B > 0 ? S(t.left + Math.min(F, t.width - m), t.top + h, F > t.width + m ? 0 : Math.max(0, o - m), Math.max(0, B - h), b.TOP_RIGHT) : new f(t.left + t.width - m, t.top + h), this.bottomRightPaddingBox = l > 0 || w > 0 ? S(t.left + Math.min(E, t.width - v), t.top + Math.min(y, t.height - I), Math.max(0, l - m), Math.max(0, w - I), b.BOTTOM_RIGHT) : new f(t.left + t.width - m, t.top + t.height - I), this.bottomLeftPaddingBox = g > 0 || Q > 0 ? S(t.left + v, t.top + Math.min(p, t.height - I), Math.max(0, g - v), Math.max(0, Q - I), b.BOTTOM_LEFT) : new f(t.left + v, t.top + t.height - I), this.topLeftContentBox = n > 0 || i > 0 ? S(t.left + v + x, t.top + h + M, Math.max(0, n - (v + x)), Math.max(0, i - (h + M)), b.TOP_LEFT) : new f(t.left + v + x, t.top + h + M), this.topRightContentBox = o > 0 || B > 0 ? S(t.left + Math.min(F, t.width + v + x), t.top + h + M, F > t.width + v + x ? 0 : o - v + x, B - (h + M), b.TOP_RIGHT) : new f(t.left + t.width - (m + J), t.top + h + M), this.bottomRightContentBox = l > 0 || w > 0 ? S(t.left + Math.min(E, t.width - (v + x)), t.top + Math.min(y, t.height + h + M), Math.max(0, l - (m + J)), w - (I + z), b.BOTTOM_RIGHT) : new f(t.left + t.width - (m + J), t.top + t.height - (I + z)), this.bottomLeftContentBox = g > 0 || Q > 0 ? S(t.left + v + x, t.top + p, Math.max(0, g - (v + x)), Q - (I + z), b.BOTTOM_LEFT) : new f(t.left + v + x, t.top + t.height - (I + z));
4072
+ var C = t.width - o, y = t.height - w, E = t.width - l, p = t.height - Q, h = e.borderTopWidth, m = e.borderRightWidth, I = e.borderBottomWidth, v = e.borderLeftWidth, M = L(e.paddingTop, A.bounds.width), J = L(e.paddingRight, A.bounds.width), z = L(e.paddingBottom, A.bounds.width), x = L(e.paddingLeft, A.bounds.width);
4073
+ this.topLeftBorderDoubleOuterBox = n > 0 || i > 0 ? S(t.left + v / 3, t.top + h / 3, n - v / 3, i - h / 3, b.TOP_LEFT) : new f(t.left + v / 3, t.top + h / 3), this.topRightBorderDoubleOuterBox = n > 0 || i > 0 ? S(t.left + C, t.top + h / 3, o - m / 3, B - h / 3, b.TOP_RIGHT) : new f(t.left + t.width - m / 3, t.top + h / 3), this.bottomRightBorderDoubleOuterBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m / 3, w - I / 3, b.BOTTOM_RIGHT) : new f(t.left + t.width - m / 3, t.top + t.height - I / 3), this.bottomLeftBorderDoubleOuterBox = g > 0 || Q > 0 ? S(t.left + v / 3, t.top + p, g - v / 3, Q - I / 3, b.BOTTOM_LEFT) : new f(t.left + v / 3, t.top + t.height - I / 3), this.topLeftBorderDoubleInnerBox = n > 0 || i > 0 ? S(t.left + v * 2 / 3, t.top + h * 2 / 3, n - v * 2 / 3, i - h * 2 / 3, b.TOP_LEFT) : new f(t.left + v * 2 / 3, t.top + h * 2 / 3), this.topRightBorderDoubleInnerBox = n > 0 || i > 0 ? S(t.left + C, t.top + h * 2 / 3, o - m * 2 / 3, B - h * 2 / 3, b.TOP_RIGHT) : new f(t.left + t.width - m * 2 / 3, t.top + h * 2 / 3), this.bottomRightBorderDoubleInnerBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m * 2 / 3, w - I * 2 / 3, b.BOTTOM_RIGHT) : new f(t.left + t.width - m * 2 / 3, t.top + t.height - I * 2 / 3), this.bottomLeftBorderDoubleInnerBox = g > 0 || Q > 0 ? S(t.left + v * 2 / 3, t.top + p, g - v * 2 / 3, Q - I * 2 / 3, b.BOTTOM_LEFT) : new f(t.left + v * 2 / 3, t.top + t.height - I * 2 / 3), this.topLeftBorderStroke = n > 0 || i > 0 ? S(t.left + v / 2, t.top + h / 2, n - v / 2, i - h / 2, b.TOP_LEFT) : new f(t.left + v / 2, t.top + h / 2), this.topRightBorderStroke = n > 0 || i > 0 ? S(t.left + C, t.top + h / 2, o - m / 2, B - h / 2, b.TOP_RIGHT) : new f(t.left + t.width - m / 2, t.top + h / 2), this.bottomRightBorderStroke = l > 0 || w > 0 ? S(t.left + E, t.top + y, l - m / 2, w - I / 2, b.BOTTOM_RIGHT) : new f(t.left + t.width - m / 2, t.top + t.height - I / 2), this.bottomLeftBorderStroke = g > 0 || Q > 0 ? S(t.left + v / 2, t.top + p, g - v / 2, Q - I / 2, b.BOTTOM_LEFT) : new f(t.left + v / 2, t.top + t.height - I / 2), this.topLeftBorderBox = n > 0 || i > 0 ? S(t.left, t.top, n, i, b.TOP_LEFT) : new f(t.left, t.top), this.topRightBorderBox = o > 0 || B > 0 ? S(t.left + C, t.top, o, B, b.TOP_RIGHT) : new f(t.left + t.width, t.top), this.bottomRightBorderBox = l > 0 || w > 0 ? S(t.left + E, t.top + y, l, w, b.BOTTOM_RIGHT) : new f(t.left + t.width, t.top + t.height), this.bottomLeftBorderBox = g > 0 || Q > 0 ? S(t.left, t.top + p, g, Q, b.BOTTOM_LEFT) : new f(t.left, t.top + t.height), this.topLeftPaddingBox = n > 0 || i > 0 ? S(t.left + v, t.top + h, Math.max(0, n - v), Math.max(0, i - h), b.TOP_LEFT) : new f(t.left + v, t.top + h), this.topRightPaddingBox = o > 0 || B > 0 ? S(t.left + Math.min(C, t.width - m), t.top + h, C > t.width + m ? 0 : Math.max(0, o - m), Math.max(0, B - h), b.TOP_RIGHT) : new f(t.left + t.width - m, t.top + h), this.bottomRightPaddingBox = l > 0 || w > 0 ? S(t.left + Math.min(E, t.width - v), t.top + Math.min(y, t.height - I), Math.max(0, l - m), Math.max(0, w - I), b.BOTTOM_RIGHT) : new f(t.left + t.width - m, t.top + t.height - I), this.bottomLeftPaddingBox = g > 0 || Q > 0 ? S(t.left + v, t.top + Math.min(p, t.height - I), Math.max(0, g - v), Math.max(0, Q - I), b.BOTTOM_LEFT) : new f(t.left + v, t.top + t.height - I), this.topLeftContentBox = n > 0 || i > 0 ? S(t.left + v + x, t.top + h + M, Math.max(0, n - (v + x)), Math.max(0, i - (h + M)), b.TOP_LEFT) : new f(t.left + v + x, t.top + h + M), this.topRightContentBox = o > 0 || B > 0 ? S(t.left + Math.min(C, t.width + v + x), t.top + h + M, C > t.width + v + x ? 0 : o - v + x, B - (h + M), b.TOP_RIGHT) : new f(t.left + t.width - (m + J), t.top + h + M), this.bottomRightContentBox = l > 0 || w > 0 ? S(t.left + Math.min(E, t.width - (v + x)), t.top + Math.min(y, t.height + h + M), Math.max(0, l - (m + J)), w - (I + z), b.BOTTOM_RIGHT) : new f(t.left + t.width - (m + J), t.top + t.height - (I + z)), this.bottomLeftContentBox = g > 0 || Q > 0 ? S(t.left + v + x, t.top + p, Math.max(0, g - (v + x)), Q - (I + z), b.BOTTOM_LEFT) : new f(t.left + v + x, t.top + t.height - (I + z));
4069
4074
  }
4070
4075
  return r;
4071
4076
  }()
@@ -4365,12 +4370,12 @@ var S = function(r, A, e, t, s) {
4365
4370
  var u = c ? t : s * n, g = l ? s : t / n;
4366
4371
  return [u, g];
4367
4372
  }
4368
- var Q = c ? t : e.width, C = l ? s : e.height;
4369
- return [Q, C];
4373
+ var Q = c ? t : e.width, F = l ? s : e.height;
4374
+ return [Q, F];
4370
4375
  }
4371
4376
  if (o) {
4372
- var U = 0, F = 0;
4373
- return O(i) ? U = L(i, e.width) : O(a) && (F = L(a, e.height)), kA(i) ? U = F * n : (!a || kA(a)) && (F = U / n), [U, F];
4377
+ var U = 0, C = 0;
4378
+ return O(i) ? U = L(i, e.width) : O(a) && (C = L(a, e.height)), kA(i) ? U = C * n : (!a || kA(a)) && (C = U / n), [U, C];
4374
4379
  }
4375
4380
  var y = null, E = null;
4376
4381
  if (O(i) ? y = L(i, e.width) : a && O(a) && (E = L(a, e.height)), y !== null && (!a || kA(a)) && (E = c && l ? y / t * s : e.height), E !== null && kA(i) && (y = c && l ? E / s * t : e.width), y !== null && E !== null)
@@ -4524,8 +4529,8 @@ var S = function(r, A, e, t, s) {
4524
4529
  switch (Q) {
4525
4530
  case 0:
4526
4531
  w.ctx.fillStyle = G(t.color), w.renderTextWithLetterSpacing(g, t.letterSpacing, B);
4527
- var C = t.textShadow;
4528
- C.length && g.text.trim().length && (C.slice(0).reverse().forEach(function(U) {
4532
+ var F = t.textShadow;
4533
+ F.length && g.text.trim().length && (F.slice(0).reverse().forEach(function(U) {
4529
4534
  w.ctx.shadowColor = G(U.color), w.ctx.shadowOffsetX = U.offsetX.number * w.options.scale, w.ctx.shadowOffsetY = U.offsetY.number * w.options.scale, w.ctx.shadowBlur = U.blur.number, w.renderTextWithLetterSpacing(g, t.letterSpacing, B);
4530
4535
  }), w.ctx.shadowColor = "", w.ctx.shadowOffsetX = 0, w.ctx.shadowOffsetY = 0, w.ctx.shadowBlur = 0), t.textDecorationLine.length && (w.ctx.fillStyle = G(t.textDecorationColor || t.color), t.textDecorationLine.forEach(function(U) {
4531
4536
  switch (U) {
@@ -4559,7 +4564,7 @@ var S = function(r, A, e, t, s) {
4559
4564
  }
4560
4565
  }, A.prototype.renderNodeContent = function(e) {
4561
4566
  return X(this, void 0, void 0, function() {
4562
- var t, s, n, i, a, o, F, F, B, c, l, w, E, u, g, p, Q, C, U, F, y, E, p;
4567
+ var t, s, n, i, a, o, C, C, B, c, l, w, E, u, g, p, Q, F, U, C, y, E, p;
4563
4568
  return P(this, function(h) {
4564
4569
  switch (h.label) {
4565
4570
  case 0:
@@ -4579,7 +4584,7 @@ var S = function(r, A, e, t, s) {
4579
4584
  case 5:
4580
4585
  return h.trys.push([5, 7, , 8]), [4, this.context.cache.match(t.src)];
4581
4586
  case 6:
4582
- return F = h.sent(), this.renderReplacedElement(t, s, F), [3, 8];
4587
+ return C = h.sent(), this.renderReplacedElement(t, s, C), [3, 8];
4583
4588
  case 7:
4584
4589
  return h.sent(), this.context.logger.error("Error loading image " + t.src), [3, 8];
4585
4590
  case 8:
@@ -4588,7 +4593,7 @@ var S = function(r, A, e, t, s) {
4588
4593
  case 9:
4589
4594
  return h.trys.push([9, 11, , 12]), [4, this.context.cache.match(t.svg)];
4590
4595
  case 10:
4591
- return F = h.sent(), this.renderReplacedElement(t, s, F), [3, 12];
4596
+ return C = h.sent(), this.renderReplacedElement(t, s, C), [3, 12];
4592
4597
  case 11:
4593
4598
  return h.sent(), this.context.logger.error("Error loading svg " + t.svg.substring(0, 255)), [3, 12];
4594
4599
  case 12:
@@ -4620,12 +4625,12 @@ var S = function(r, A, e, t, s) {
4620
4625
  Q += p.width;
4621
4626
  break;
4622
4627
  }
4623
- C = p.add(Q, 0, 0, -p.height / 2 + 1), this.ctx.save(), this.path([
4628
+ F = p.add(Q, 0, 0, -p.height / 2 + 1), this.ctx.save(), this.path([
4624
4629
  new f(p.left, p.top),
4625
4630
  new f(p.left + p.width, p.top),
4626
4631
  new f(p.left + p.width, p.top + p.height),
4627
4632
  new f(p.left, p.top + p.height)
4628
- ]), this.ctx.clip(), this.renderTextWithLetterSpacing(new ce(t.value, C), n.letterSpacing, g), this.ctx.restore(), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = "left";
4633
+ ]), this.ctx.clip(), this.renderTextWithLetterSpacing(new ce(t.value, F), n.letterSpacing, g), this.ctx.restore(), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = "left";
4629
4634
  }
4630
4635
  if (!R(
4631
4636
  t.styles.display,
@@ -4634,11 +4639,11 @@ var S = function(r, A, e, t, s) {
4634
4639
  )) return [3, 20];
4635
4640
  if (t.styles.listStyleImage === null) return [3, 19];
4636
4641
  if (U = t.styles.listStyleImage, U.type !== 0) return [3, 18];
4637
- F = void 0, y = U.url, h.label = 15;
4642
+ C = void 0, y = U.url, h.label = 15;
4638
4643
  case 15:
4639
4644
  return h.trys.push([15, 17, , 18]), [4, this.context.cache.match(y)];
4640
4645
  case 16:
4641
- return F = h.sent(), this.ctx.drawImage(F, t.bounds.left - (F.width + 10), t.bounds.top), [3, 18];
4646
+ return C = h.sent(), this.ctx.drawImage(C, t.bounds.left - (C.width + 10), t.bounds.top), [3, 18];
4642
4647
  case 17:
4643
4648
  return h.sent(), this.context.logger.error("Error loading list-style-image " + y), [3, 18];
4644
4649
  case 18:
@@ -4655,9 +4660,9 @@ var S = function(r, A, e, t, s) {
4655
4660
  });
4656
4661
  }, A.prototype.renderStackContent = function(e) {
4657
4662
  return X(this, void 0, void 0, function() {
4658
- var t, s, U, n, i, U, a, o, U, B, c, U, l, w, U, u, g, U, Q, C, U;
4659
- return P(this, function(F) {
4660
- switch (F.label) {
4663
+ var t, s, U, n, i, U, a, o, U, B, c, U, l, w, U, u, g, U, Q, F, U;
4664
+ return P(this, function(C) {
4665
+ switch (C.label) {
4661
4666
  case 0:
4662
4667
  if (R(
4663
4668
  e.element.container.flags,
@@ -4667,61 +4672,61 @@ var S = function(r, A, e, t, s) {
4667
4672
  debugger;
4668
4673
  return [4, this.renderNodeBackgroundAndBorders(e.element)];
4669
4674
  case 1:
4670
- F.sent(), t = 0, s = e.negativeZIndex, F.label = 2;
4675
+ C.sent(), t = 0, s = e.negativeZIndex, C.label = 2;
4671
4676
  case 2:
4672
4677
  return t < s.length ? (U = s[t], [4, this.renderStack(U)]) : [3, 5];
4673
4678
  case 3:
4674
- F.sent(), F.label = 4;
4679
+ C.sent(), C.label = 4;
4675
4680
  case 4:
4676
4681
  return t++, [3, 2];
4677
4682
  case 5:
4678
4683
  return [4, this.renderNodeContent(e.element)];
4679
4684
  case 6:
4680
- F.sent(), n = 0, i = e.nonInlineLevel, F.label = 7;
4685
+ C.sent(), n = 0, i = e.nonInlineLevel, C.label = 7;
4681
4686
  case 7:
4682
4687
  return n < i.length ? (U = i[n], [4, this.renderNode(U)]) : [3, 10];
4683
4688
  case 8:
4684
- F.sent(), F.label = 9;
4689
+ C.sent(), C.label = 9;
4685
4690
  case 9:
4686
4691
  return n++, [3, 7];
4687
4692
  case 10:
4688
- a = 0, o = e.nonPositionedFloats, F.label = 11;
4693
+ a = 0, o = e.nonPositionedFloats, C.label = 11;
4689
4694
  case 11:
4690
4695
  return a < o.length ? (U = o[a], [4, this.renderStack(U)]) : [3, 14];
4691
4696
  case 12:
4692
- F.sent(), F.label = 13;
4697
+ C.sent(), C.label = 13;
4693
4698
  case 13:
4694
4699
  return a++, [3, 11];
4695
4700
  case 14:
4696
- B = 0, c = e.nonPositionedInlineLevel, F.label = 15;
4701
+ B = 0, c = e.nonPositionedInlineLevel, C.label = 15;
4697
4702
  case 15:
4698
4703
  return B < c.length ? (U = c[B], [4, this.renderStack(U)]) : [3, 18];
4699
4704
  case 16:
4700
- F.sent(), F.label = 17;
4705
+ C.sent(), C.label = 17;
4701
4706
  case 17:
4702
4707
  return B++, [3, 15];
4703
4708
  case 18:
4704
- l = 0, w = e.inlineLevel, F.label = 19;
4709
+ l = 0, w = e.inlineLevel, C.label = 19;
4705
4710
  case 19:
4706
4711
  return l < w.length ? (U = w[l], [4, this.renderNode(U)]) : [3, 22];
4707
4712
  case 20:
4708
- F.sent(), F.label = 21;
4713
+ C.sent(), C.label = 21;
4709
4714
  case 21:
4710
4715
  return l++, [3, 19];
4711
4716
  case 22:
4712
- u = 0, g = e.zeroOrAutoZIndexOrTransformedOrOpacity, F.label = 23;
4717
+ u = 0, g = e.zeroOrAutoZIndexOrTransformedOrOpacity, C.label = 23;
4713
4718
  case 23:
4714
4719
  return u < g.length ? (U = g[u], [4, this.renderStack(U)]) : [3, 26];
4715
4720
  case 24:
4716
- F.sent(), F.label = 25;
4721
+ C.sent(), C.label = 25;
4717
4722
  case 25:
4718
4723
  return u++, [3, 23];
4719
4724
  case 26:
4720
- Q = 0, C = e.positiveZIndex, F.label = 27;
4725
+ Q = 0, F = e.positiveZIndex, C.label = 27;
4721
4726
  case 27:
4722
- return Q < C.length ? (U = C[Q], [4, this.renderStack(U)]) : [3, 30];
4727
+ return Q < F.length ? (U = F[Q], [4, this.renderStack(U)]) : [3, 30];
4723
4728
  case 28:
4724
- F.sent(), F.label = 29;
4729
+ C.sent(), C.label = 29;
4725
4730
  case 29:
4726
4731
  return Q++, [3, 27];
4727
4732
  case 30:
@@ -4759,7 +4764,7 @@ var S = function(r, A, e, t, s) {
4759
4764
  switch (B.label) {
4760
4765
  case 0:
4761
4766
  t = e.styles.backgroundImage.length - 1, s = function(c) {
4762
- var l, w, u, M, W, Y, x, V, I, g, M, W, Y, x, V, Q, C, U, F, y, E, p, h, m, I, v, M, J, z, x, V, fA, W, Y, IA, iA, hA, yA, bA, cA, xA, lA;
4767
+ var l, w, u, M, W, Y, x, V, I, g, M, W, Y, x, V, Q, F, U, C, y, E, p, h, m, I, v, M, J, z, x, V, fA, W, Y, IA, iA, hA, yA, bA, cA, xA, lA;
4763
4768
  return P(this, function(MA) {
4764
4769
  switch (MA.label) {
4765
4770
  case 0:
@@ -4778,7 +4783,7 @@ var S = function(r, A, e, t, s) {
4778
4783
  l.width / l.height
4779
4784
  ]), M = u[0], W = u[1], Y = u[2], x = u[3], V = u[4], I = n.ctx.createPattern(n.resizeImage(l, x, V), "repeat"), n.renderRepeat(M, I, W, Y)), [3, 6];
4780
4785
  case 5:
4781
- Ca(c) ? (g = xt(e, t, [null, null, null]), M = g[0], W = g[1], Y = g[2], x = g[3], V = g[4], Q = ua(c.angle, x, V), C = Q[0], U = Q[1], F = Q[2], y = Q[3], E = Q[4], p = document.createElement("canvas"), p.width = x, p.height = V, h = p.getContext("2d"), m = h.createLinearGradient(U, y, F, E), Ir(c.stops, C).forEach(function(ZA) {
4786
+ Ca(c) ? (g = xt(e, t, [null, null, null]), M = g[0], W = g[1], Y = g[2], x = g[3], V = g[4], Q = ua(c.angle, x, V), F = Q[0], U = Q[1], C = Q[2], y = Q[3], E = Q[4], p = document.createElement("canvas"), p.width = x, p.height = V, h = p.getContext("2d"), m = h.createLinearGradient(U, y, C, E), Ir(c.stops, F).forEach(function(ZA) {
4782
4787
  return m.addColorStop(ZA.stop, G(ZA.color));
4783
4788
  }), h.fillStyle = m, h.fillRect(0, 0, x, V), x > 0 && V > 0 && (I = n.ctx.createPattern(p, "repeat"), n.renderRepeat(M, I, W, Y))) : Ua(c) && (v = xt(e, t, [
4784
4789
  null,
@@ -4856,8 +4861,8 @@ var S = function(r, A, e, t, s) {
4856
4861
  case 1:
4857
4862
  w.sent(), this.ctx.restore(), t.boxShadow.slice(0).reverse().forEach(function(u) {
4858
4863
  l.ctx.save();
4859
- var g = qe(e.curves), Q = u.inset ? 0 : Sc, C = pc(g, -Q + (u.inset ? 1 : -1) * u.spread.number, (u.inset ? 1 : -1) * u.spread.number, u.spread.number * (u.inset ? -2 : 2), u.spread.number * (u.inset ? -2 : 2));
4860
- u.inset ? (l.path(g), l.ctx.clip(), l.mask(C)) : (l.mask(g), l.ctx.clip(), l.path(C)), l.ctx.shadowOffsetX = u.offsetX.number + Q, l.ctx.shadowOffsetY = u.offsetY.number, l.ctx.shadowColor = G(u.color), l.ctx.shadowBlur = u.blur.number, l.ctx.fillStyle = u.inset ? G(u.color) : "rgba(0,0,0,1)", l.ctx.fill(), l.ctx.restore();
4864
+ var g = qe(e.curves), Q = u.inset ? 0 : Sc, F = pc(g, -Q + (u.inset ? 1 : -1) * u.spread.number, (u.inset ? 1 : -1) * u.spread.number, u.spread.number * (u.inset ? -2 : 2), u.spread.number * (u.inset ? -2 : 2));
4865
+ u.inset ? (l.path(g), l.ctx.clip(), l.mask(F)) : (l.mask(g), l.ctx.clip(), l.path(F)), l.ctx.shadowOffsetX = u.offsetX.number + Q, l.ctx.shadowOffsetY = u.offsetY.number, l.ctx.shadowColor = G(u.color), l.ctx.shadowBlur = u.blur.number, l.ctx.fillStyle = u.inset ? G(u.color) : "rgba(0,0,0,1)", l.ctx.fill(), l.ctx.restore();
4861
4866
  }), w.label = 2;
4862
4867
  case 2:
4863
4868
  a = 0, o = 0, B = n, w.label = 3;
@@ -4905,9 +4910,9 @@ var S = function(r, A, e, t, s) {
4905
4910
  });
4906
4911
  }, A.prototype.renderDashedDottedBorder = function(e, t, s, n, i) {
4907
4912
  return X(this, void 0, void 0, function() {
4908
- var a, o, B, c, l, w, u, g, Q, C, U, F, y, E, p, h, p, h;
4913
+ var a, o, B, c, l, w, u, g, Q, F, U, C, y, E, p, h, p, h;
4909
4914
  return P(this, function(m) {
4910
- return this.ctx.save(), a = mc(n, s), o = ss(n, s), i === 2 && (this.path(o), this.ctx.clip()), eA(o[0]) ? (B = o[0].start.x, c = o[0].start.y) : (B = o[0].x, c = o[0].y), eA(o[1]) ? (l = o[1].end.x, w = o[1].end.y) : (l = o[1].x, w = o[1].y), s === 0 || s === 2 ? u = Math.abs(B - l) : u = Math.abs(c - w), this.ctx.beginPath(), i === 3 ? this.formatPath(a) : this.formatPath(o.slice(0, 2)), g = t < 3 ? t * 3 : t * 2, Q = t < 3 ? t * 2 : t, i === 3 && (g = t, Q = t), C = !0, u <= g * 2 ? C = !1 : u <= g * 2 + Q ? (U = u / (2 * g + Q), g *= U, Q *= U) : (F = Math.floor((u + Q) / (g + Q)), y = (u - F * g) / (F - 1), E = (u - (F + 1) * g) / F, Q = E <= 0 || Math.abs(Q - y) < Math.abs(Q - E) ? y : E), C && (i === 3 ? this.ctx.setLineDash([0, g + Q]) : this.ctx.setLineDash([g, Q])), i === 3 ? (this.ctx.lineCap = "round", this.ctx.lineWidth = t) : this.ctx.lineWidth = t * 2 + 1.1, this.ctx.strokeStyle = G(e), this.ctx.stroke(), this.ctx.setLineDash([]), i === 2 && (eA(o[0]) && (p = o[3], h = o[0], this.ctx.beginPath(), this.formatPath([new f(p.end.x, p.end.y), new f(h.start.x, h.start.y)]), this.ctx.stroke()), eA(o[1]) && (p = o[1], h = o[2], this.ctx.beginPath(), this.formatPath([new f(p.end.x, p.end.y), new f(h.start.x, h.start.y)]), this.ctx.stroke())), this.ctx.restore(), [
4915
+ return this.ctx.save(), a = mc(n, s), o = ss(n, s), i === 2 && (this.path(o), this.ctx.clip()), eA(o[0]) ? (B = o[0].start.x, c = o[0].start.y) : (B = o[0].x, c = o[0].y), eA(o[1]) ? (l = o[1].end.x, w = o[1].end.y) : (l = o[1].x, w = o[1].y), s === 0 || s === 2 ? u = Math.abs(B - l) : u = Math.abs(c - w), this.ctx.beginPath(), i === 3 ? this.formatPath(a) : this.formatPath(o.slice(0, 2)), g = t < 3 ? t * 3 : t * 2, Q = t < 3 ? t * 2 : t, i === 3 && (g = t, Q = t), F = !0, u <= g * 2 ? F = !1 : u <= g * 2 + Q ? (U = u / (2 * g + Q), g *= U, Q *= U) : (C = Math.floor((u + Q) / (g + Q)), y = (u - C * g) / (C - 1), E = (u - (C + 1) * g) / C, Q = E <= 0 || Math.abs(Q - y) < Math.abs(Q - E) ? y : E), F && (i === 3 ? this.ctx.setLineDash([0, g + Q]) : this.ctx.setLineDash([g, Q])), i === 3 ? (this.ctx.lineCap = "round", this.ctx.lineWidth = t) : this.ctx.lineWidth = t * 2 + 1.1, this.ctx.strokeStyle = G(e), this.ctx.stroke(), this.ctx.setLineDash([]), i === 2 && (eA(o[0]) && (p = o[3], h = o[0], this.ctx.beginPath(), this.formatPath([new f(p.end.x, p.end.y), new f(h.start.x, h.start.y)]), this.ctx.stroke()), eA(o[1]) && (p = o[1], h = o[2], this.ctx.beginPath(), this.formatPath([new f(p.end.x, p.end.y), new f(h.start.x, h.start.y)]), this.ctx.stroke())), this.ctx.restore(), [
4911
4916
  2
4912
4917
  /*return*/
4913
4918
  ];
@@ -5024,7 +5029,7 @@ var S = function(r, A, e, t, s) {
5024
5029
  typeof window < "u" && cn.setContext(window);
5025
5030
  var Xc = function(r, A) {
5026
5031
  return X(void 0, void 0, void 0, function() {
5027
- var e, t, s, n, i, a, o, B, c, l, w, u, g, Q, C, U, F, y, E, p, m, h, m, I, v, M, J, z, x, V, fA, W, Y, IA, iA, hA, yA, bA, cA, xA;
5032
+ var e, t, s, n, i, a, o, B, c, l, w, u, g, Q, F, U, C, y, E, p, m, h, m, I, v, M, J, z, x, V, fA, W, Y, IA, iA, hA, yA, bA, cA, xA;
5028
5033
  return P(this, function(lA) {
5029
5034
  switch (lA.label) {
5030
5035
  case 0:
@@ -5052,19 +5057,19 @@ var Xc = function(r, A) {
5052
5057
  copyStyles: B
5053
5058
  }, o.logger.debug("Starting document clone with size " + a.width + "x" + a.height + " scrolled to " + -a.left + "," + -a.top), l = new es(o, r, c), w = l.clonedReferenceElement, w ? [4, l.toIFrame(e, a)] : [2, Promise.reject("Unable to find element in cloned iframe")];
5054
5059
  case 1:
5055
- return u = lA.sent(), g = ir(w) || JB(w) ? Fn(w.ownerDocument) : At(o, w), Q = g.width, C = g.height, U = g.left, F = g.top, y = Jc(o, w, A.backgroundColor), E = {
5060
+ return u = lA.sent(), g = ir(w) || JB(w) ? Fn(w.ownerDocument) : At(o, w), Q = g.width, F = g.height, U = g.left, C = g.top, y = Jc(o, w, A.backgroundColor), E = {
5056
5061
  canvas: A.canvas,
5057
5062
  backgroundColor: y,
5058
5063
  scale: (iA = (IA = A.scale) !== null && IA !== void 0 ? IA : t.devicePixelRatio) !== null && iA !== void 0 ? iA : 1,
5059
5064
  x: ((hA = A.x) !== null && hA !== void 0 ? hA : 0) + U,
5060
- y: ((yA = A.y) !== null && yA !== void 0 ? yA : 0) + F,
5065
+ y: ((yA = A.y) !== null && yA !== void 0 ? yA : 0) + C,
5061
5066
  width: (bA = A.width) !== null && bA !== void 0 ? bA : Math.ceil(Q),
5062
- height: (cA = A.height) !== null && cA !== void 0 ? cA : Math.ceil(C)
5067
+ height: (cA = A.height) !== null && cA !== void 0 ? cA : Math.ceil(F)
5063
5068
  }, B ? (o.logger.debug("Document cloned, using foreign object rendering"), m = new Vc(o, E), [4, m.render(w)]) : [3, 3];
5064
5069
  case 2:
5065
5070
  return p = lA.sent(), [3, 5];
5066
5071
  case 3:
5067
- return o.logger.debug("Document cloned, element located at " + U + "," + F + " with size " + Q + "x" + C + " using computed rendering"), o.logger.debug("Starting DOM parsing"), h = en(o, w), y === h.styles.backgroundColor && (h.styles.backgroundColor = uA.TRANSPARENT), o.logger.debug("Starting renderer for element at " + E.x + "," + E.y + " with size " + E.width + "x" + E.height), m = new Dc(o, E), [4, m.render(h)];
5072
+ return o.logger.debug("Document cloned, element located at " + U + "," + C + " with size " + Q + "x" + F + " using computed rendering"), o.logger.debug("Starting DOM parsing"), h = en(o, w), y === h.styles.backgroundColor && (h.styles.backgroundColor = uA.TRANSPARENT), o.logger.debug("Starting renderer for element at " + E.x + "," + E.y + " with size " + E.width + "x" + E.height), m = new Dc(o, E), [4, m.render(h)];
5068
5073
  case 4:
5069
5074
  p = lA.sent(), lA.label = 5;
5070
5075
  case 5:
@@ -6302,7 +6307,7 @@ const $c = `
6302
6307
  <line x1="22" y1="2" x2="11" y2="13"/>
6303
6308
  <polygon points="22 2 15 22 11 13 2 9 22 2"/>
6304
6309
  </svg>`
6305
- }, cs = "1.0.15", ls = 100, jc = 50;
6310
+ }, cs = "1.0.16", ls = 100, jc = 50;
6306
6311
  class Al {
6307
6312
  constructor(A) {
6308
6313
  $(this, "config");