@component-hook/pdf-canvas 1.2.2-alpha.4 → 1.3.0-alpha.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.
- package/README.md +30 -8
- package/dist/react/pdf-canvas.es.d.ts +15 -3
- package/dist/react/pdf-canvas.es.js +145 -145
- package/dist/react/pdf-canvas.umd.js +24 -24
- package/dist/vue/pdf-canvas.es.d.ts +15 -3
- package/dist/vue/pdf-canvas.es.js +135 -135
- package/dist/vue/pdf-canvas.umd.js +7 -7
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ function sc() {
|
|
|
55
55
|
return "Suspense";
|
|
56
56
|
case T:
|
|
57
57
|
return "SuspenseList";
|
|
58
|
-
case
|
|
58
|
+
case N:
|
|
59
59
|
return "Activity";
|
|
60
60
|
}
|
|
61
61
|
if (typeof E == "object")
|
|
@@ -146,14 +146,14 @@ function sc() {
|
|
|
146
146
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
147
147
|
}
|
|
148
148
|
function l(E, H, V, J, At, st) {
|
|
149
|
-
var
|
|
149
|
+
var B = V.ref;
|
|
150
150
|
return E = {
|
|
151
151
|
$$typeof: g,
|
|
152
152
|
type: E,
|
|
153
153
|
key: H,
|
|
154
154
|
props: V,
|
|
155
155
|
_owner: J
|
|
156
|
-
}, (
|
|
156
|
+
}, (B !== void 0 ? B : null) !== null ? Object.defineProperty(E, "ref", {
|
|
157
157
|
enumerable: !1,
|
|
158
158
|
get: h
|
|
159
159
|
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
@@ -179,24 +179,24 @@ function sc() {
|
|
|
179
179
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
180
180
|
}
|
|
181
181
|
function c(E, H, V, J, At, st) {
|
|
182
|
-
var
|
|
183
|
-
if (
|
|
182
|
+
var B = H.children;
|
|
183
|
+
if (B !== void 0)
|
|
184
184
|
if (J)
|
|
185
|
-
if (D(
|
|
186
|
-
for (J = 0; J <
|
|
187
|
-
u(
|
|
188
|
-
Object.freeze && Object.freeze(
|
|
185
|
+
if (D(B)) {
|
|
186
|
+
for (J = 0; J < B.length; J++)
|
|
187
|
+
u(B[J]);
|
|
188
|
+
Object.freeze && Object.freeze(B);
|
|
189
189
|
} else
|
|
190
190
|
console.error(
|
|
191
191
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
192
192
|
);
|
|
193
|
-
else u(
|
|
193
|
+
else u(B);
|
|
194
194
|
if (O.call(H, "key")) {
|
|
195
|
-
|
|
195
|
+
B = a(E);
|
|
196
196
|
var at = Object.keys(H).filter(function(Wt) {
|
|
197
197
|
return Wt !== "key";
|
|
198
198
|
});
|
|
199
|
-
J = 0 < at.length ? "{key: someKey, " + at.join(": ..., ") + ": ...}" : "{key: someKey}", lt[
|
|
199
|
+
J = 0 < at.length ? "{key: someKey, " + at.join(": ..., ") + ": ...}" : "{key: someKey}", lt[B + J] || (at = 0 < at.length ? "{" + at.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
200
200
|
`A props object containing a "key" prop is being spread into JSX:
|
|
201
201
|
let props = %s;
|
|
202
202
|
<%s {...props} />
|
|
@@ -204,22 +204,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
204
204
|
let props = %s;
|
|
205
205
|
<%s key={someKey} {...props} />`,
|
|
206
206
|
J,
|
|
207
|
-
|
|
207
|
+
B,
|
|
208
208
|
at,
|
|
209
|
-
|
|
210
|
-
), lt[
|
|
209
|
+
B
|
|
210
|
+
), lt[B + J] = !0);
|
|
211
211
|
}
|
|
212
|
-
if (
|
|
212
|
+
if (B = null, V !== void 0 && (e(V), B = "" + V), r(H) && (e(H.key), B = "" + H.key), "key" in H) {
|
|
213
213
|
V = {};
|
|
214
214
|
for (var Tt in H)
|
|
215
215
|
Tt !== "key" && (V[Tt] = H[Tt]);
|
|
216
216
|
} else V = H;
|
|
217
|
-
return
|
|
217
|
+
return B && o(
|
|
218
218
|
V,
|
|
219
219
|
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
220
220
|
), l(
|
|
221
221
|
E,
|
|
222
|
-
|
|
222
|
+
B,
|
|
223
223
|
V,
|
|
224
224
|
i(),
|
|
225
225
|
At,
|
|
@@ -232,7 +232,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
function d(E) {
|
|
233
233
|
return typeof E == "object" && E !== null && E.$$typeof === g;
|
|
234
234
|
}
|
|
235
|
-
var f = Zl, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"),
|
|
235
|
+
var f = Zl, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), I = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
236
236
|
return null;
|
|
237
237
|
};
|
|
238
238
|
f = {
|
|
@@ -2341,9 +2341,9 @@ let ke = class en extends zc {
|
|
|
2341
2341
|
toObject() {
|
|
2342
2342
|
const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(en.customProperties, this.constructor.customProperties || []);
|
|
2343
2343
|
let e;
|
|
2344
|
-
const s = tt.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: k, flipY: P, opacity:
|
|
2344
|
+
const s = tt.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: k, flipY: P, opacity: N, visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: M, skewY: R } = this;
|
|
2345
2345
|
i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
|
|
2346
|
-
const W = (lt) => nt(lt, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(
|
|
2346
|
+
const W = (lt) => nt(lt, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(N), shadow: o && o.toObject(), visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: W(M), skewY: W(R) }, e ? { clipPath: e } : null);
|
|
2347
2347
|
return this.includeDefaultValues ? ot : this._removeDefaultValues(ot);
|
|
2348
2348
|
}
|
|
2349
2349
|
toDatalessObject(t) {
|
|
@@ -2499,8 +2499,8 @@ function Fh(a, t, e, s, i) {
|
|
|
2499
2499
|
if (fe(n, h)) return !1;
|
|
2500
2500
|
const { origin: u, flip: d } = ir[r], f = yt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && to(e, $, $, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
|
|
2501
2501
|
return Hs(sh, zs(((m, v, y, _) => (function(S, A, T) {
|
|
2502
|
-
let { target: k, ex: P, ey:
|
|
2503
|
-
const { skew: O } = ir[S], D = T.subtract(new C(P,
|
|
2502
|
+
let { target: k, ex: P, ey: N, skewingSide: F } = A, I = ht(A, Jc);
|
|
2503
|
+
const { skew: O } = ir[S], D = T.subtract(new C(P, N)).divide(new C(k.scaleX, k.scaleY))[S], z = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, ot = 2 * D * F / Math.max(W, 1) + R, lt = Te(Math.atan(ot));
|
|
2504
2504
|
k.set(O, lt);
|
|
2505
2505
|
const E = z !== k[O];
|
|
2506
2506
|
if (E && S === "y") {
|
|
@@ -3392,18 +3392,18 @@ const Fu = (a, t, e) => {
|
|
|
3392
3392
|
const u = ((d, f, g, p, b, m, v) => {
|
|
3393
3393
|
if (g === 0 || p === 0) return [];
|
|
3394
3394
|
let y = 0, _ = 0, S = 0;
|
|
3395
|
-
const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T),
|
|
3395
|
+
const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T), N = 0.5 * (-P * d - k * f), F = 0.5 * (-P * f + k * d), I = g ** 2, O = p ** 2, D = F ** 2, z = N ** 2, M = I * O - I * D - O * z;
|
|
3396
3396
|
let R = Math.abs(g), W = Math.abs(p);
|
|
3397
3397
|
if (M < 0) {
|
|
3398
3398
|
const Wt = Math.sqrt(1 - M / (I * O));
|
|
3399
3399
|
R *= Wt, W *= Wt;
|
|
3400
3400
|
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (I * D + O * z));
|
|
3401
|
-
const ot = S * R * F / W, lt = -S * W *
|
|
3402
|
-
let V = wa(1, 0, (
|
|
3401
|
+
const ot = S * R * F / W, lt = -S * W * N / R, E = P * ot - k * lt + 0.5 * d, H = k * ot + P * lt + 0.5 * f;
|
|
3402
|
+
let V = wa(1, 0, (N - ot) / R, (F - lt) / W), J = wa((N - ot) / R, (F - lt) / W, (-N - ot) / R, (-F - lt) / W);
|
|
3403
3403
|
m === 0 && J > 0 ? J -= 2 * A : m === 1 && J < 0 && (J += 2 * A);
|
|
3404
|
-
const At = Math.ceil(Math.abs(J / A * 2)), st = [],
|
|
3405
|
-
let Tt = V +
|
|
3406
|
-
for (let Wt = 0; Wt < At; Wt++) st[Wt] = Lu(V, Tt, P, k, R, W, E, H, at, y, _), y = st[Wt][5], _ = st[Wt][6], V = Tt, Tt +=
|
|
3404
|
+
const At = Math.ceil(Math.abs(J / A * 2)), st = [], B = J / At, at = 8 / 3 * Math.sin(B / 4) * Math.sin(B / 4) / Math.sin(B / 2);
|
|
3405
|
+
let Tt = V + B;
|
|
3406
|
+
for (let Wt = 0; Wt < At; Wt++) st[Wt] = Lu(V, Tt, P, k, R, W, E, H, at, y, _), y = st[Wt][5], _ = st[Wt][6], V = Tt, Tt += B;
|
|
3407
3407
|
return st;
|
|
3408
3408
|
})(l - a, c - t, i, n, o, h, r);
|
|
3409
3409
|
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;
|
|
@@ -5205,10 +5205,10 @@ class kt extends dl {
|
|
|
5205
5205
|
this.direction === "rtl" && (W = this.width - W - b), m && v && y && (t.fillStyle = v, t.fillRect(W, T + h * k + P - o * R, b, R)), p = D.left, b = D.width, m = _, y = A, v = S, k = z, P = M;
|
|
5206
5206
|
} else b += D.kernedWidth;
|
|
5207
5207
|
}
|
|
5208
|
-
let
|
|
5209
|
-
this.direction === "rtl" && (
|
|
5208
|
+
let N = i + g + p;
|
|
5209
|
+
this.direction === "rtl" && (N = this.width - N - b), t.fillStyle = S;
|
|
5210
5210
|
const F = this.fontSize * A / 1e3;
|
|
5211
|
-
_ && S && A && t.fillRect(
|
|
5211
|
+
_ && S && A && t.fillRect(N, T + h * k + P - o * F, b - r, F), s += u;
|
|
5212
5212
|
}
|
|
5213
5213
|
this._removeShadow(t);
|
|
5214
5214
|
}
|
|
@@ -6660,23 +6660,23 @@ async function Ed(a, t) {
|
|
|
6660
6660
|
const { x: S = 0, y: A = 0, transform: T = "" } = p, k = "".concat(T, " ").concat(_.transform || "", " translate(").concat(S, ", ").concat(A, ")");
|
|
6661
6661
|
if (lr(v), /^svg$/i.test(v.nodeName)) {
|
|
6662
6662
|
const P = v.ownerDocument.createElementNS(Sr, "g");
|
|
6663
|
-
Object.entries(_).forEach(((
|
|
6664
|
-
let [F, I] =
|
|
6663
|
+
Object.entries(_).forEach(((N) => {
|
|
6664
|
+
let [F, I] = N;
|
|
6665
6665
|
return P.setAttributeNS(Sr, F, I);
|
|
6666
6666
|
})), P.append(...v.childNodes), v = P;
|
|
6667
6667
|
}
|
|
6668
6668
|
for (const P of g) {
|
|
6669
6669
|
if (!P) continue;
|
|
6670
|
-
const { name:
|
|
6671
|
-
if (!d.includes(
|
|
6670
|
+
const { name: N, value: F } = P;
|
|
6671
|
+
if (!d.includes(N)) if (N === "style") {
|
|
6672
6672
|
const I = {};
|
|
6673
6673
|
Tr(F, I), Object.entries(_).forEach(((D) => {
|
|
6674
6674
|
let [z, M] = D;
|
|
6675
6675
|
I[z] = M;
|
|
6676
6676
|
})), Tr(_.style || "", I);
|
|
6677
6677
|
const O = Object.entries(I).map(((D) => D.join(":"))).join(";");
|
|
6678
|
-
v.setAttribute(
|
|
6679
|
-
} else !_[
|
|
6678
|
+
v.setAttribute(N, O);
|
|
6679
|
+
} else !_[N] && v.setAttribute(N, F);
|
|
6680
6680
|
}
|
|
6681
6681
|
v.setAttribute("transform", k), v.setAttribute("instantiated_by_use", "1"), v.removeAttribute("id"), f.parentNode.replaceChild(v, f);
|
|
6682
6682
|
}
|
|
@@ -7717,13 +7717,13 @@ class Yi extends Ct {
|
|
|
7717
7717
|
lanczosResize(t, e, s, i, n) {
|
|
7718
7718
|
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 };
|
|
7719
7719
|
return (function y(_) {
|
|
7720
|
-
let S, A, T, k, P,
|
|
7720
|
+
let S, A, T, k, P, N, F, I, O, D, z;
|
|
7721
7721
|
for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
|
|
7722
|
-
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0,
|
|
7722
|
+
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, F = 0, I = 0, O = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
|
|
7723
7723
|
D = Math.floor(1e3 * Math.abs(A - m.x)), b[D] || (b[D] = {});
|
|
7724
|
-
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (z = Math.floor(1e3 * Math.abs(M - m.y)), b[D][z] || (b[D][z] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(z * f, 2)) / 1e3)), T = b[D][z], T > 0 && (k = 4 * (M * e + A), P += T,
|
|
7724
|
+
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (z = Math.floor(1e3 * Math.abs(M - m.y)), b[D][z] || (b[D][z] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(z * f, 2)) / 1e3)), T = b[D][z], T > 0 && (k = 4 * (M * e + A), P += T, N += T * r[k], F += T * r[k + 1], I += T * r[k + 2], O += T * r[k + 3]));
|
|
7725
7725
|
}
|
|
7726
|
-
k = 4 * (S * i + _), h[k] =
|
|
7726
|
+
k = 4 * (S * i + _), h[k] = N / P, h[k + 1] = F / P, h[k + 2] = I / P, h[k + 3] = O / P;
|
|
7727
7727
|
}
|
|
7728
7728
|
return ++_ < i ? y(_) : o;
|
|
7729
7729
|
})(0);
|
|
@@ -7741,9 +7741,9 @@ class Yi extends Ct {
|
|
|
7741
7741
|
let b = 0, m = 0, v = 0, y = 0, _ = 0, S = 0, A = 0;
|
|
7742
7742
|
const T = (f + 0.5) * o;
|
|
7743
7743
|
for (let k = Math.floor(f * o); k < (f + 1) * o; k++) {
|
|
7744
|
-
const P = Math.abs(T - (k + 0.5)) / l,
|
|
7744
|
+
const P = Math.abs(T - (k + 0.5)) / l, N = (g + 0.5) * r, F = P * P;
|
|
7745
7745
|
for (let I = Math.floor(g * r); I < (g + 1) * r; I++) {
|
|
7746
|
-
let O = Math.abs(
|
|
7746
|
+
let O = Math.abs(N - (I + 0.5)) / h;
|
|
7747
7747
|
const D = Math.sqrt(F + O * O);
|
|
7748
7748
|
D > 1 && D < -1 || (b = 2 * D * D * D - 3 * D * D + 1, b > 0 && (O = 4 * (I + k * e), A += b * c[O + 3], v += b, c[O + 3] < 255 && (b = b * c[O + 3] / 250), y += b * c[O], _ += b * c[O + 1], S += b * c[O + 2], m += b));
|
|
7749
7749
|
}
|
|
@@ -10867,10 +10867,10 @@ class U {
|
|
|
10867
10867
|
const y = p(o, h), _ = b(o, h);
|
|
10868
10868
|
let S = d(..._);
|
|
10869
10869
|
const A = U._round(n + S[0]), T = U._round(r + S[1]);
|
|
10870
|
-
let k = 1, P = 1,
|
|
10870
|
+
let k = 1, P = 1, N, F;
|
|
10871
10871
|
if (e.fromKeyboard)
|
|
10872
10872
|
({
|
|
10873
|
-
deltaX:
|
|
10873
|
+
deltaX: N,
|
|
10874
10874
|
deltaY: F
|
|
10875
10875
|
} = e);
|
|
10876
10876
|
else {
|
|
@@ -10878,12 +10878,12 @@ class U {
|
|
|
10878
10878
|
screenX: M,
|
|
10879
10879
|
screenY: R
|
|
10880
10880
|
} = e, [W, ot] = this.#c;
|
|
10881
|
-
[
|
|
10881
|
+
[N, F] = this.screenToPageTranslation(M - W, R - ot), this.#c[0] = M, this.#c[1] = R;
|
|
10882
10882
|
}
|
|
10883
|
-
if ([
|
|
10883
|
+
if ([N, F] = g(N / s, F / i), m) {
|
|
10884
10884
|
const M = Math.hypot(o, h);
|
|
10885
|
-
k = P = Math.max(Math.min(Math.hypot(_[0] - y[0] -
|
|
10886
|
-
} else v ? k = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] -
|
|
10885
|
+
k = P = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - F) / M, 1 / o, 1 / h), l / o, c / h);
|
|
10886
|
+
} else v ? k = 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] - F))) / h;
|
|
10887
10887
|
const I = U._round(o * k), O = U._round(h * P);
|
|
10888
10888
|
S = d(...b(I, O));
|
|
10889
10889
|
const D = A - S[0], z = T - S[1];
|
|
@@ -12280,10 +12280,10 @@ class pf extends El {
|
|
|
12280
12280
|
const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
|
|
12281
12281
|
let k = 0;
|
|
12282
12282
|
for (let P = 0; P <= y; P++) {
|
|
12283
|
-
const
|
|
12284
|
-
for (let I = k; I <=
|
|
12283
|
+
const N = Math.round(c + P * S), F = A + P * T;
|
|
12284
|
+
for (let I = k; I <= N; I++)
|
|
12285
12285
|
_[I] = F;
|
|
12286
|
-
k =
|
|
12286
|
+
k = N + 1;
|
|
12287
12287
|
}
|
|
12288
12288
|
for (let P = k; P < 256; P++)
|
|
12289
12289
|
_[P] = _[k - 1];
|
|
@@ -12418,22 +12418,22 @@ function mr(a, t, e, s, i, n, r, o) {
|
|
|
12418
12418
|
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;
|
|
12419
12419
|
if (g >= v)
|
|
12420
12420
|
return;
|
|
12421
|
-
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o],
|
|
12421
|
+
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o], N = l[o + 1], F = l[o + 2], I = Math.round(g), O = Math.round(v);
|
|
12422
12422
|
let D, z, M, R, W, ot, lt, E;
|
|
12423
12423
|
for (let H = I; H <= O; H++) {
|
|
12424
12424
|
if (H < b) {
|
|
12425
|
-
const
|
|
12426
|
-
D = f - (f - p) *
|
|
12425
|
+
const B = H < g ? 0 : (g - H) / (g - b);
|
|
12426
|
+
D = f - (f - p) * B, z = y - (y - A) * B, M = _ - (_ - T) * B, R = S - (S - k) * B;
|
|
12427
12427
|
} else {
|
|
12428
|
-
let
|
|
12429
|
-
H > v ?
|
|
12428
|
+
let B;
|
|
12429
|
+
H > v ? B = 1 : b === v ? B = 0 : B = (b - H) / (b - v), D = p - (p - m) * B, z = A - (A - P) * B, M = T - (T - N) * B, R = k - (k - F) * B;
|
|
12430
12430
|
}
|
|
12431
12431
|
let V;
|
|
12432
|
-
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, lt = _ - (_ -
|
|
12432
|
+
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, lt = _ - (_ - N) * V, E = S - (S - F) * V;
|
|
12433
12433
|
const J = Math.round(Math.min(D, W)), At = Math.round(Math.max(D, W));
|
|
12434
12434
|
let st = u * H + J * 4;
|
|
12435
|
-
for (let
|
|
12436
|
-
V = (D -
|
|
12435
|
+
for (let B = J; B <= At; B++)
|
|
12436
|
+
V = (D - B) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = z - (z - ot) * V | 0, c[st++] = M - (M - lt) * V | 0, c[st++] = R - (R - E) * V | 0, c[st++] = 255;
|
|
12437
12437
|
}
|
|
12438
12438
|
}
|
|
12439
12439
|
function wf(a, t, e) {
|
|
@@ -12538,16 +12538,16 @@ class xo {
|
|
|
12538
12538
|
h = Math.abs(h), l = Math.abs(l), zn("TilingType: " + n);
|
|
12539
12539
|
const c = e[0], u = e[1], d = e[2], f = e[3], g = d - c, p = f - u, b = G.singularValueDecompose2dScale(this.matrix), m = G.singularValueDecompose2dScale(this.baseTransform), v = b[0] * m[0], y = b[1] * m[1];
|
|
12540
12540
|
let _ = g, S = p, A = !1, T = !1;
|
|
12541
|
-
const k = Math.ceil(h * v), P = Math.ceil(l * y),
|
|
12542
|
-
k >=
|
|
12541
|
+
const k = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), F = Math.ceil(p * y);
|
|
12542
|
+
k >= N ? _ = h : A = !0, P >= F ? S = l : T = !0;
|
|
12543
12543
|
const I = this.getSizeAndScale(_, this.ctx.canvas.width, v), O = this.getSizeAndScale(S, this.ctx.canvas.height, y), D = t.cachedCanvases.getCanvas("pattern", I.size, O.size), z = D.context, M = o.createCanvasGraphics(z);
|
|
12544
12544
|
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), z.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), z.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = ut(M.ctx), M.executeOperatorList(s), M.endDrawing(), z.restore(), A || T) {
|
|
12545
12545
|
const R = D.canvas;
|
|
12546
12546
|
A && (_ = h), T && (S = l);
|
|
12547
12547
|
const W = this.getSizeAndScale(_, this.ctx.canvas.width, v), ot = this.getSizeAndScale(S, this.ctx.canvas.height, y), lt = W.size, E = ot.size, H = t.cachedCanvases.getCanvas("pattern-workaround", lt, E), V = H.context, J = A ? Math.floor(g / h) : 0, At = T ? Math.floor(p / l) : 0;
|
|
12548
12548
|
for (let st = 0; st <= J; st++)
|
|
12549
|
-
for (let
|
|
12550
|
-
V.drawImage(R, lt * st, E *
|
|
12549
|
+
for (let B = 0; B <= At; B++)
|
|
12550
|
+
V.drawImage(R, lt * st, E * B, lt, E, 0, 0, lt, E);
|
|
12551
12551
|
return {
|
|
12552
12552
|
canvas: H.canvas,
|
|
12553
12553
|
scaleX: W.scale,
|
|
@@ -12819,11 +12819,11 @@ function Va(a, t) {
|
|
|
12819
12819
|
const A = b - h;
|
|
12820
12820
|
let T = 0;
|
|
12821
12821
|
const k = A > y ? s : A * 8 - 7, P = k & -8;
|
|
12822
|
-
let
|
|
12822
|
+
let N = 0, F = 0;
|
|
12823
12823
|
for (; T < P; T += 8)
|
|
12824
12824
|
F = c[h++], m[l++] = F & 128 ? _ : S, m[l++] = F & 64 ? _ : S, m[l++] = F & 32 ? _ : S, m[l++] = F & 16 ? _ : S, m[l++] = F & 8 ? _ : S, m[l++] = F & 4 ? _ : S, m[l++] = F & 2 ? _ : S, m[l++] = F & 1 ? _ : S;
|
|
12825
12825
|
for (; T < k; T++)
|
|
12826
|
-
|
|
12826
|
+
N === 0 && (F = c[h++], N = 128), m[l++] = F & N ? _ : S, N >>= 1;
|
|
12827
12827
|
}
|
|
12828
12828
|
for (; l < v; )
|
|
12829
12829
|
m[l++] = 0;
|
|
@@ -12987,10 +12987,10 @@ class ks {
|
|
|
12987
12987
|
l = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(k), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(k, h));
|
|
12988
12988
|
const P = h.get(l);
|
|
12989
12989
|
if (P && !r) {
|
|
12990
|
-
const
|
|
12990
|
+
const N = Math.round(Math.min(o[0], o[2]) + o[4]), F = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
12991
12991
|
return {
|
|
12992
12992
|
canvas: P,
|
|
12993
|
-
offsetX:
|
|
12993
|
+
offsetX: N,
|
|
12994
12994
|
offsetY: F
|
|
12995
12995
|
};
|
|
12996
12996
|
}
|
|
@@ -13355,7 +13355,7 @@ class ks {
|
|
|
13355
13355
|
continue;
|
|
13356
13356
|
}
|
|
13357
13357
|
let k = !1;
|
|
13358
|
-
const P = (T.isSpace ? h : 0) + o,
|
|
13358
|
+
const P = (T.isSpace ? h : 0) + o, N = T.fontChar, F = T.accent;
|
|
13359
13359
|
let I, O, D = T.width;
|
|
13360
13360
|
if (d) {
|
|
13361
13361
|
const M = T.vmetric || g, R = -(T.vmetric ? M[1] : D * 0.5) * p, W = M[2] * p;
|
|
@@ -13363,7 +13363,7 @@ class ks {
|
|
|
13363
13363
|
} else
|
|
13364
13364
|
I = S / r, O = 0;
|
|
13365
13365
|
if (s.remeasure && D > 0) {
|
|
13366
|
-
const M = n.measureText(
|
|
13366
|
+
const M = n.measureText(N).width * 1e3 / i * r;
|
|
13367
13367
|
if (D < M && this.isFontSubpixelAAEnabled) {
|
|
13368
13368
|
const R = D / M;
|
|
13369
13369
|
k = !0, n.save(), n.scale(R, 1), I /= R;
|
|
@@ -13371,8 +13371,8 @@ class ks {
|
|
|
13371
13371
|
}
|
|
13372
13372
|
if (this.contentVisible && (T.isInFont || s.missingFile)) {
|
|
13373
13373
|
if (b && !F)
|
|
13374
|
-
n.fillText(
|
|
13375
|
-
else if (this.paintChar(
|
|
13374
|
+
n.fillText(N, I, O);
|
|
13375
|
+
else if (this.paintChar(N, I, O, m, v), F) {
|
|
13376
13376
|
const M = I + i * F.offset.x / r, R = O - i * F.offset.y / r;
|
|
13377
13377
|
this.paintChar(F.fontChar, M, R, m, v);
|
|
13378
13378
|
}
|
|
@@ -15153,7 +15153,7 @@ function ag(a = {}) {
|
|
|
15153
15153
|
docId: e
|
|
15154
15154
|
} = t, s = a.url ? hg(a.url) : null, i = a.data ? lg(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Nl ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : tg;
|
|
15155
15155
|
let c = a.worker instanceof Ms ? a.worker : null;
|
|
15156
|
-
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || ng, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || og, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0,
|
|
15156
|
+
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || ng, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || og, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, F = a.ownerDocument || globalThis.document, I = a.disableRange === !0, O = a.disableStream === !0, D = a.disableAutoFetch === !0, z = a.pdfBug === !0, M = a.CanvasFactory || ig, R = a.FilterFactory || rg, W = a.enableHWA === !0, ot = h ? h.length : a.length ?? NaN, lt = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !Dt && !k, E = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === Tl && m === Ml && f && b && ti(f, document.baseURI) && ti(b, document.baseURI), H = null;
|
|
15157
15157
|
Xd(u);
|
|
15158
15158
|
const V = {
|
|
15159
15159
|
canvasFactory: new M({
|
|
@@ -15188,7 +15188,7 @@ function ag(a = {}) {
|
|
|
15188
15188
|
rangeChunkSize: l,
|
|
15189
15189
|
length: ot,
|
|
15190
15190
|
docBaseUrl: d,
|
|
15191
|
-
enableXfa:
|
|
15191
|
+
enableXfa: N,
|
|
15192
15192
|
evaluatorOptions: {
|
|
15193
15193
|
maxImageSize: y,
|
|
15194
15194
|
disableFontFace: k,
|
|
@@ -15210,7 +15210,7 @@ function ag(a = {}) {
|
|
|
15210
15210
|
styleElement: H,
|
|
15211
15211
|
loadingParams: {
|
|
15212
15212
|
disableAutoFetch: D,
|
|
15213
|
-
enableXfa:
|
|
15213
|
+
enableXfa: N
|
|
15214
15214
|
}
|
|
15215
15215
|
};
|
|
15216
15216
|
return c.promise.then(function() {
|
|
@@ -15219,9 +15219,9 @@ function ag(a = {}) {
|
|
|
15219
15219
|
if (c.destroyed)
|
|
15220
15220
|
throw new Error("Worker was destroyed");
|
|
15221
15221
|
const st = c.messageHandler.sendWithPromise("GetDocRequest", J, i ? [i.buffer] : null);
|
|
15222
|
-
let
|
|
15222
|
+
let B;
|
|
15223
15223
|
if (h)
|
|
15224
|
-
|
|
15224
|
+
B = new If(h, {
|
|
15225
15225
|
disableRange: I,
|
|
15226
15226
|
disableStream: O
|
|
15227
15227
|
});
|
|
@@ -15238,7 +15238,7 @@ function ag(a = {}) {
|
|
|
15238
15238
|
at = qf;
|
|
15239
15239
|
else
|
|
15240
15240
|
at = ti(s) ? Ya : Wf;
|
|
15241
|
-
|
|
15241
|
+
B = new at({
|
|
15242
15242
|
url: s,
|
|
15243
15243
|
length: ot,
|
|
15244
15244
|
httpHeaders: n,
|
|
@@ -15253,7 +15253,7 @@ function ag(a = {}) {
|
|
|
15253
15253
|
throw new Error("Loading aborted");
|
|
15254
15254
|
if (c.destroyed)
|
|
15255
15255
|
throw new Error("Worker was destroyed");
|
|
15256
|
-
const Tt = new ei(e, at, c.port), Wt = new fg(Tt, t,
|
|
15256
|
+
const Tt = new ei(e, at, c.port), Wt = new fg(Tt, t, B, At, V);
|
|
15257
15257
|
t._transport = Wt, Tt.send("Ready", null);
|
|
15258
15258
|
});
|
|
15259
15259
|
}).catch(t._capability.reject), t;
|
|
@@ -18927,7 +18927,7 @@ class St extends U {
|
|
|
18927
18927
|
super.resetAnnotationElement(t), t.resetEdited();
|
|
18928
18928
|
}
|
|
18929
18929
|
}
|
|
18930
|
-
class
|
|
18930
|
+
class j {
|
|
18931
18931
|
static PRECISION = 1e-4;
|
|
18932
18932
|
toSVGPath() {
|
|
18933
18933
|
rt("Abstract method `toSVGPath` must be implemented.");
|
|
@@ -19102,7 +19102,7 @@ class is {
|
|
|
19102
19102
|
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;
|
|
19103
19103
|
}
|
|
19104
19104
|
}
|
|
19105
|
-
class Ul extends
|
|
19105
|
+
class Ul extends j {
|
|
19106
19106
|
#t;
|
|
19107
19107
|
#e = new Float32Array(4);
|
|
19108
19108
|
#s;
|
|
@@ -19134,16 +19134,16 @@ class Ul extends B {
|
|
|
19134
19134
|
let h, l;
|
|
19135
19135
|
switch (n) {
|
|
19136
19136
|
case 0:
|
|
19137
|
-
h =
|
|
19137
|
+
h = j._rescale(this.#h, t, i, r, -o), l = j._rescale(this.#r, t, i, r, -o);
|
|
19138
19138
|
break;
|
|
19139
19139
|
case 90:
|
|
19140
|
-
h =
|
|
19140
|
+
h = j._rescaleAndSwap(this.#h, t, e, r, o), l = j._rescaleAndSwap(this.#r, t, e, r, o);
|
|
19141
19141
|
break;
|
|
19142
19142
|
case 180:
|
|
19143
|
-
h =
|
|
19143
|
+
h = j._rescale(this.#h, s, e, -r, o), l = j._rescale(this.#r, s, e, -r, o);
|
|
19144
19144
|
break;
|
|
19145
19145
|
case 270:
|
|
19146
|
-
h =
|
|
19146
|
+
h = j._rescaleAndSwap(this.#h, s, i, -r, -o), l = j._rescaleAndSwap(this.#r, s, i, -r, -o);
|
|
19147
19147
|
break;
|
|
19148
19148
|
}
|
|
19149
19149
|
return {
|
|
@@ -19309,7 +19309,7 @@ class Br {
|
|
|
19309
19309
|
return n;
|
|
19310
19310
|
}
|
|
19311
19311
|
}
|
|
19312
|
-
class Ng extends
|
|
19312
|
+
class Ng extends j {
|
|
19313
19313
|
#t;
|
|
19314
19314
|
#e;
|
|
19315
19315
|
constructor(t, e, s) {
|
|
@@ -20601,7 +20601,7 @@ class Hg {
|
|
|
20601
20601
|
t === "stroke-width" && (this.#r = e);
|
|
20602
20602
|
}
|
|
20603
20603
|
#u(t, e) {
|
|
20604
|
-
return
|
|
20604
|
+
return j._normalizePoint(t, e, this.#l, this.#d, this.#i);
|
|
20605
20605
|
}
|
|
20606
20606
|
isEmpty() {
|
|
20607
20607
|
return !this.#s || this.#s.length === 0;
|
|
@@ -20616,7 +20616,7 @@ class Hg {
|
|
|
20616
20616
|
path: {
|
|
20617
20617
|
d: this.toSVGPath()
|
|
20618
20618
|
}
|
|
20619
|
-
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...
|
|
20619
|
+
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...j.createBezierPoints(s, i, n, r, t, e)), {
|
|
20620
20620
|
path: {
|
|
20621
20621
|
d: this.toSVGPath()
|
|
20622
20622
|
}
|
|
@@ -20668,7 +20668,7 @@ class Hg {
|
|
|
20668
20668
|
};
|
|
20669
20669
|
}
|
|
20670
20670
|
toSVGPath() {
|
|
20671
|
-
const t =
|
|
20671
|
+
const t = j.svgRound(this.#e[4]), e = j.svgRound(this.#e[5]);
|
|
20672
20672
|
if (this.#n.length === 2)
|
|
20673
20673
|
return this.#h = `${this.#h} M ${t} ${e} Z`, this.#h;
|
|
20674
20674
|
if (this.#n.length <= 6) {
|
|
@@ -20676,13 +20676,13 @@ class Hg {
|
|
|
20676
20676
|
this.#h = `${this.#h.slice(0, i)} M ${t} ${e}`, this.#a = 6;
|
|
20677
20677
|
}
|
|
20678
20678
|
if (this.#n.length === 4) {
|
|
20679
|
-
const i =
|
|
20679
|
+
const i = j.svgRound(this.#e[10]), n = j.svgRound(this.#e[11]);
|
|
20680
20680
|
return this.#h = `${this.#h} L ${i} ${n}`, this.#a = 12, this.#h;
|
|
20681
20681
|
}
|
|
20682
20682
|
const s = [];
|
|
20683
20683
|
this.#a === 0 && (s.push(`M ${t} ${e}`), this.#a = 6);
|
|
20684
20684
|
for (let i = this.#a, n = this.#e.length; i < n; i += 6) {
|
|
20685
|
-
const [r, o, h, l, c, u] = this.#e.slice(i, i + 6).map(
|
|
20685
|
+
const [r, o, h, l, c, u] = this.#e.slice(i, i + 6).map(j.svgRound);
|
|
20686
20686
|
s.push(`C${r} ${o} ${h} ${l} ${c} ${u}`);
|
|
20687
20687
|
}
|
|
20688
20688
|
return this.#h += s.join(" "), this.#a = this.#e.length, this.#h;
|
|
@@ -20703,7 +20703,7 @@ class Hg {
|
|
|
20703
20703
|
};
|
|
20704
20704
|
}
|
|
20705
20705
|
}
|
|
20706
|
-
class $n extends
|
|
20706
|
+
class $n extends j {
|
|
20707
20707
|
#t;
|
|
20708
20708
|
#e = 0;
|
|
20709
20709
|
#s;
|
|
@@ -20735,16 +20735,16 @@ class $n extends B {
|
|
|
20735
20735
|
for (const {
|
|
20736
20736
|
line: e
|
|
20737
20737
|
} of this.#i) {
|
|
20738
|
-
if (t.push(`M${
|
|
20738
|
+
if (t.push(`M${j.svgRound(e[4])} ${j.svgRound(e[5])}`), e.length === 6) {
|
|
20739
20739
|
t.push("Z");
|
|
20740
20740
|
continue;
|
|
20741
20741
|
}
|
|
20742
20742
|
if (e.length === 12) {
|
|
20743
|
-
t.push(`L${
|
|
20743
|
+
t.push(`L${j.svgRound(e[10])} ${j.svgRound(e[11])}`);
|
|
20744
20744
|
continue;
|
|
20745
20745
|
}
|
|
20746
20746
|
for (let s = 6, i = e.length; s < i; s += 6) {
|
|
20747
|
-
const [n, r, o, h, l, c] = e.subarray(s, s + 6).map(
|
|
20747
|
+
const [n, r, o, h, l, c] = e.subarray(s, s + 6).map(j.svgRound);
|
|
20748
20748
|
t.push(`C${n} ${r} ${o} ${h} ${l} ${c}`);
|
|
20749
20749
|
}
|
|
20750
20750
|
}
|
|
@@ -20755,16 +20755,16 @@ class $n extends B {
|
|
|
20755
20755
|
let d, f, g, p, b, m, v, y, _;
|
|
20756
20756
|
switch (this.#a) {
|
|
20757
20757
|
case 0:
|
|
20758
|
-
_ =
|
|
20758
|
+
_ = j._rescale, d = t, f = e + i, g = s, p = -i, b = t + h * s, m = e + (1 - l - u) * i, v = t + (h + c) * s, y = e + (1 - l) * i;
|
|
20759
20759
|
break;
|
|
20760
20760
|
case 90:
|
|
20761
|
-
_ =
|
|
20761
|
+
_ = j._rescaleAndSwap, d = t, f = e, g = s, p = i, b = t + l * s, m = e + h * i, v = t + (l + u) * s, y = e + (h + c) * i;
|
|
20762
20762
|
break;
|
|
20763
20763
|
case 180:
|
|
20764
|
-
_ =
|
|
20764
|
+
_ = j._rescale, d = t + s, f = e, g = -s, p = i, b = t + (1 - h - c) * s, m = e + l * i, v = t + (1 - h) * s, y = e + (l + u) * i;
|
|
20765
20765
|
break;
|
|
20766
20766
|
case 270:
|
|
20767
|
-
_ =
|
|
20767
|
+
_ = j._rescaleAndSwap, d = t + s, f = e + i, g = -s, p = -i, b = t + (1 - l - u) * s, m = e + (1 - h - c) * i, v = t + (1 - l) * s, y = e + (1 - h) * i;
|
|
20768
20768
|
break;
|
|
20769
20769
|
}
|
|
20770
20770
|
for (const {
|
|
@@ -20790,16 +20790,16 @@ class $n extends B {
|
|
|
20790
20790
|
let u, d, f, g, p;
|
|
20791
20791
|
switch (h) {
|
|
20792
20792
|
case 0:
|
|
20793
|
-
p =
|
|
20793
|
+
p = j._rescale, u = -t / s, d = e / i + 1, f = 1 / s, g = -1 / i;
|
|
20794
20794
|
break;
|
|
20795
20795
|
case 90:
|
|
20796
|
-
p =
|
|
20796
|
+
p = j._rescaleAndSwap, u = -e / i, d = -t / s, f = 1 / i, g = 1 / s;
|
|
20797
20797
|
break;
|
|
20798
20798
|
case 180:
|
|
20799
|
-
p =
|
|
20799
|
+
p = j._rescale, u = t / s + 1, d = -e / i, f = -1 / s, g = 1 / i;
|
|
20800
20800
|
break;
|
|
20801
20801
|
case 270:
|
|
20802
|
-
p =
|
|
20802
|
+
p = j._rescaleAndSwap, u = e / i + 1, d = t / s + 1, f = -1 / i, g = -1 / s;
|
|
20803
20803
|
break;
|
|
20804
20804
|
}
|
|
20805
20805
|
if (!r) {
|
|
@@ -20819,8 +20819,8 @@ class $n extends B {
|
|
|
20819
20819
|
let [_, S, A, T] = m.subarray(0, 4);
|
|
20820
20820
|
y.set([NaN, NaN, NaN, NaN, _, S], 0);
|
|
20821
20821
|
for (let k = 4; k < v; k += 2) {
|
|
20822
|
-
const P = m[k],
|
|
20823
|
-
y.set(
|
|
20822
|
+
const P = m[k], N = m[k + 1];
|
|
20823
|
+
y.set(j.createBezierPoints(_, S, A, T, P, N), (k - 2) * 3), [_, S, A, T] = [A, T, P, N];
|
|
20824
20824
|
}
|
|
20825
20825
|
}
|
|
20826
20826
|
}
|
|
@@ -20887,7 +20887,7 @@ class $n extends B {
|
|
|
20887
20887
|
};
|
|
20888
20888
|
}
|
|
20889
20889
|
get viewBox() {
|
|
20890
|
-
return this.#t.map(
|
|
20890
|
+
return this.#t.map(j.svgRound).join(" ");
|
|
20891
20891
|
}
|
|
20892
20892
|
get defaultProperties() {
|
|
20893
20893
|
const [t, e] = this.#t;
|
|
@@ -20896,7 +20896,7 @@ class $n extends B {
|
|
|
20896
20896
|
viewBox: this.viewBox
|
|
20897
20897
|
},
|
|
20898
20898
|
path: {
|
|
20899
|
-
"transform-origin": `${
|
|
20899
|
+
"transform-origin": `${j.svgRound(t)} ${j.svgRound(e)}`
|
|
20900
20900
|
}
|
|
20901
20901
|
};
|
|
20902
20902
|
}
|
|
@@ -20916,15 +20916,15 @@ class $n extends B {
|
|
|
20916
20916
|
default:
|
|
20917
20917
|
return "";
|
|
20918
20918
|
}
|
|
20919
|
-
return `matrix(${s} ${i} ${n} ${r} ${
|
|
20919
|
+
return `matrix(${s} ${i} ${n} ${r} ${j.svgRound(o)} ${j.svgRound(h)})`;
|
|
20920
20920
|
}
|
|
20921
20921
|
getPathResizingSVGProperties([t, e, s, i]) {
|
|
20922
20922
|
const [n, r] = this.#l(), [o, h, l, c] = this.#t;
|
|
20923
|
-
if (Math.abs(l - n) <=
|
|
20923
|
+
if (Math.abs(l - n) <= j.PRECISION || Math.abs(c - r) <= j.PRECISION) {
|
|
20924
20924
|
const p = t + s / 2 - (o + l / 2), b = e + i / 2 - (h + c / 2);
|
|
20925
20925
|
return {
|
|
20926
20926
|
path: {
|
|
20927
|
-
"transform-origin": `${
|
|
20927
|
+
"transform-origin": `${j.svgRound(t)} ${j.svgRound(e)}`,
|
|
20928
20928
|
transform: `${this.rotationTransform} translate(${p} ${b})`
|
|
20929
20929
|
}
|
|
20930
20930
|
};
|
|
@@ -20932,26 +20932,26 @@ class $n extends B {
|
|
|
20932
20932
|
const u = (s - 2 * n) / (l - 2 * n), d = (i - 2 * r) / (c - 2 * r), f = l / s, g = c / i;
|
|
20933
20933
|
return {
|
|
20934
20934
|
path: {
|
|
20935
|
-
"transform-origin": `${
|
|
20936
|
-
transform: `${this.rotationTransform} scale(${f} ${g}) translate(${
|
|
20935
|
+
"transform-origin": `${j.svgRound(o)} ${j.svgRound(h)}`,
|
|
20936
|
+
transform: `${this.rotationTransform} scale(${f} ${g}) translate(${j.svgRound(n)} ${j.svgRound(r)}) scale(${u} ${d}) translate(${j.svgRound(-n)} ${j.svgRound(-r)})`
|
|
20937
20937
|
}
|
|
20938
20938
|
};
|
|
20939
20939
|
}
|
|
20940
20940
|
getPathResizedSVGProperties([t, e, s, i]) {
|
|
20941
20941
|
const [n, r] = this.#l(), o = this.#t, [h, l, c, u] = o;
|
|
20942
|
-
if (o[0] = t, o[1] = e, o[2] = s, o[3] = i, Math.abs(c - n) <=
|
|
20942
|
+
if (o[0] = t, o[1] = e, o[2] = s, o[3] = i, Math.abs(c - n) <= j.PRECISION || Math.abs(u - r) <= j.PRECISION) {
|
|
20943
20943
|
const b = t + s / 2 - (h + c / 2), m = e + i / 2 - (l + u / 2);
|
|
20944
20944
|
for (const {
|
|
20945
20945
|
line: v,
|
|
20946
20946
|
points: y
|
|
20947
20947
|
} of this.#i)
|
|
20948
|
-
|
|
20948
|
+
j._translate(v, b, m, v), j._translate(y, b, m, y);
|
|
20949
20949
|
return {
|
|
20950
20950
|
root: {
|
|
20951
20951
|
viewBox: this.viewBox
|
|
20952
20952
|
},
|
|
20953
20953
|
path: {
|
|
20954
|
-
"transform-origin": `${
|
|
20954
|
+
"transform-origin": `${j.svgRound(t)} ${j.svgRound(e)}`,
|
|
20955
20955
|
transform: this.rotationTransform || null,
|
|
20956
20956
|
d: this.toSVGPath()
|
|
20957
20957
|
}
|
|
@@ -20963,13 +20963,13 @@ class $n extends B {
|
|
|
20963
20963
|
line: b,
|
|
20964
20964
|
points: m
|
|
20965
20965
|
} of this.#i)
|
|
20966
|
-
|
|
20966
|
+
j._rescale(b, g, p, d, f, b), j._rescale(m, g, p, d, f, m);
|
|
20967
20967
|
return {
|
|
20968
20968
|
root: {
|
|
20969
20969
|
viewBox: this.viewBox
|
|
20970
20970
|
},
|
|
20971
20971
|
path: {
|
|
20972
|
-
"transform-origin": `${
|
|
20972
|
+
"transform-origin": `${j.svgRound(t)} ${j.svgRound(e)}`,
|
|
20973
20973
|
transform: this.rotationTransform || null,
|
|
20974
20974
|
d: this.toSVGPath()
|
|
20975
20975
|
}
|
|
@@ -20982,7 +20982,7 @@ class $n extends B {
|
|
|
20982
20982
|
line: l,
|
|
20983
20983
|
points: c
|
|
20984
20984
|
} of this.#i)
|
|
20985
|
-
|
|
20985
|
+
j._translate(l, o, h, l), j._translate(c, o, h, c);
|
|
20986
20986
|
else {
|
|
20987
20987
|
const l = this.#r / i, c = this.#n / n;
|
|
20988
20988
|
this.#r = i, this.#n = n;
|
|
@@ -20990,7 +20990,7 @@ class $n extends B {
|
|
|
20990
20990
|
line: u,
|
|
20991
20991
|
points: d
|
|
20992
20992
|
} of this.#i)
|
|
20993
|
-
|
|
20993
|
+
j._rescale(u, o, h, l, c, u), j._rescale(d, o, h, l, c, d);
|
|
20994
20994
|
r[2] *= l, r[3] *= c;
|
|
20995
20995
|
}
|
|
20996
20996
|
return r[0] = t, r[1] = e, {
|
|
@@ -20999,7 +20999,7 @@ class $n extends B {
|
|
|
20999
20999
|
},
|
|
21000
21000
|
path: {
|
|
21001
21001
|
d: this.toSVGPath(),
|
|
21002
|
-
"transform-origin": `${
|
|
21002
|
+
"transform-origin": `${j.svgRound(t)} ${j.svgRound(e)}`
|
|
21003
21003
|
}
|
|
21004
21004
|
};
|
|
21005
21005
|
}
|
|
@@ -21014,7 +21014,7 @@ class $n extends B {
|
|
|
21014
21014
|
},
|
|
21015
21015
|
path: {
|
|
21016
21016
|
d: this.toSVGPath(),
|
|
21017
|
-
"transform-origin": `${
|
|
21017
|
+
"transform-origin": `${j.svgRound(t[0])} ${j.svgRound(t[1])}`,
|
|
21018
21018
|
transform: this.rotationTransform || null
|
|
21019
21019
|
},
|
|
21020
21020
|
bbox: t
|
|
@@ -22253,14 +22253,14 @@ function Ug(a, t = 500) {
|
|
|
22253
22253
|
function Yg(a) {
|
|
22254
22254
|
return new Promise((t, e) => {
|
|
22255
22255
|
const s = new FileReader();
|
|
22256
|
-
s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.
|
|
22256
|
+
s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsArrayBuffer(a);
|
|
22257
22257
|
});
|
|
22258
22258
|
}
|
|
22259
22259
|
Yl() || (zg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Vg}/pdf.worker.min.mjs`);
|
|
22260
22260
|
async function $g(a) {
|
|
22261
|
-
const t =
|
|
22262
|
-
if (
|
|
22263
|
-
return
|
|
22261
|
+
const t = await Yg(a);
|
|
22262
|
+
if (t instanceof ArrayBuffer)
|
|
22263
|
+
return t;
|
|
22264
22264
|
}
|
|
22265
22265
|
function Yl() {
|
|
22266
22266
|
try {
|
|
@@ -22269,7 +22269,7 @@ function Yl() {
|
|
|
22269
22269
|
return !1;
|
|
22270
22270
|
}
|
|
22271
22271
|
}
|
|
22272
|
-
async function qg({ page: a,
|
|
22272
|
+
async function qg({ page: a, data: t, scale: e, password: s }, i) {
|
|
22273
22273
|
const n = Xg() / window.devicePixelRatio;
|
|
22274
22274
|
if (Yl()) {
|
|
22275
22275
|
const r = new Worker(new URL(
|
|
@@ -22309,7 +22309,7 @@ function Jg(a, t) {
|
|
|
22309
22309
|
PDFId: `${a.name}-${e}`,
|
|
22310
22310
|
name: a.name.replace(/.pdf/, ""),
|
|
22311
22311
|
updateDate: e,
|
|
22312
|
-
|
|
22312
|
+
data: t
|
|
22313
22313
|
};
|
|
22314
22314
|
}
|
|
22315
22315
|
async function Zg({ src: a }, t, e) {
|
|
@@ -22384,7 +22384,7 @@ function ap(a, t, e) {
|
|
|
22384
22384
|
async function hp(a, t, e) {
|
|
22385
22385
|
const s = await $g(a);
|
|
22386
22386
|
if (!s) return;
|
|
22387
|
-
const i = Jg(a, s), n = await Kl({ page: 1,
|
|
22387
|
+
const i = Jg(a, s), n = await Kl({ page: 1, data: s, scale: 0.8, password: t }, e);
|
|
22388
22388
|
return { ...i, pages: n };
|
|
22389
22389
|
}
|
|
22390
22390
|
function Kl(a, t) {
|
|
@@ -22510,7 +22510,7 @@ function dp(a) {
|
|
|
22510
22510
|
function P() {
|
|
22511
22511
|
rp(t);
|
|
22512
22512
|
}
|
|
22513
|
-
function
|
|
22513
|
+
function N(O) {
|
|
22514
22514
|
lp(t, O);
|
|
22515
22515
|
}
|
|
22516
22516
|
function F() {
|
|
@@ -22530,7 +22530,7 @@ function dp(a) {
|
|
|
22530
22530
|
deleteCanvas: P,
|
|
22531
22531
|
scaleFabric: S,
|
|
22532
22532
|
setCloseSvgOptions: A,
|
|
22533
|
-
setActiveFabric:
|
|
22533
|
+
setActiveFabric: N,
|
|
22534
22534
|
copyActiveFabric: F,
|
|
22535
22535
|
deleteActiveFabric: I
|
|
22536
22536
|
};
|
|
@@ -22566,7 +22566,7 @@ function gp({
|
|
|
22566
22566
|
onSelectionCleared: _
|
|
22567
22567
|
}, S) {
|
|
22568
22568
|
const A = ws(null), T = `${e}-${t - 1}`, k = No(() => s * n, [s, n]), P = No(() => ({ ...ac, ...d }), [d]), {
|
|
22569
|
-
createCanvas:
|
|
22569
|
+
createCanvas: N,
|
|
22570
22570
|
specifyPage: F,
|
|
22571
22571
|
addFabric: I,
|
|
22572
22572
|
addTextFabric: O,
|
|
@@ -22590,29 +22590,29 @@ function gp({
|
|
|
22590
22590
|
fp(st);
|
|
22591
22591
|
async function H() {
|
|
22592
22592
|
globalThis.requestAnimationFrame(async () => {
|
|
22593
|
-
if (
|
|
22594
|
-
const
|
|
22595
|
-
D({ url:
|
|
22593
|
+
if (N(), typeof a.data == "string") {
|
|
22594
|
+
const at = a.data;
|
|
22595
|
+
D({ url: at, scale: i / 3 }), g?.();
|
|
22596
22596
|
return;
|
|
22597
22597
|
}
|
|
22598
22598
|
await F({
|
|
22599
22599
|
page: t,
|
|
22600
|
-
|
|
22600
|
+
data: a.canvas?.[t - 1] ?? a.data,
|
|
22601
22601
|
scale: i,
|
|
22602
22602
|
password: h
|
|
22603
22603
|
}), g?.();
|
|
22604
22604
|
});
|
|
22605
22605
|
}
|
|
22606
|
-
function V(
|
|
22607
|
-
if (
|
|
22608
|
-
const { dataTransfer: at, nativeEvent: Tt } =
|
|
22606
|
+
function V(B) {
|
|
22607
|
+
if (B.preventDefault(), B.stopPropagation(), !o || !B.dataTransfer) return;
|
|
22608
|
+
const { dataTransfer: at, nativeEvent: Tt } = B, { offsetX: Wt, offsetY: Jl } = Tt, Mo = at.getData("text/plain"), Po = at.getData("text/uri-list"), Oo = at.getData("custom/offset"), Do = Oo ? JSON.parse(Oo) : null, Ro = { top: Jl, left: Wt }, Lo = { x: Do?.offsetX ?? 0, y: Do?.offsetY ?? 0 };
|
|
22609
22609
|
Po ? J(Po, Ro, Lo) : Mo && At(Mo, Ro, Lo);
|
|
22610
22610
|
}
|
|
22611
|
-
function J(
|
|
22612
|
-
I(
|
|
22611
|
+
function J(B, at, Tt) {
|
|
22612
|
+
I(B, { ...c, ...at }, Tt);
|
|
22613
22613
|
}
|
|
22614
|
-
function At(
|
|
22615
|
-
O(
|
|
22614
|
+
function At(B, at, Tt) {
|
|
22615
|
+
O(B, { ...l, ...at }, Tt);
|
|
22616
22616
|
}
|
|
22617
22617
|
function st() {
|
|
22618
22618
|
f || H(), p?.();
|
|
@@ -22637,8 +22637,8 @@ function gp({
|
|
|
22637
22637
|
"div",
|
|
22638
22638
|
{
|
|
22639
22639
|
style: { transform: `scale(${k})` },
|
|
22640
|
-
onDragOver: (
|
|
22641
|
-
onDragEnter: (
|
|
22640
|
+
onDragOver: (B) => B.preventDefault(),
|
|
22641
|
+
onDragEnter: (B) => B.preventDefault(),
|
|
22642
22642
|
onDrop: V,
|
|
22643
22643
|
children: /* @__PURE__ */ zo.jsx(
|
|
22644
22644
|
"canvas",
|