@mxmweb/fviewer 1.1.3 → 1.1.5
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/index.js +894 -872
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,13 +4,13 @@ var K0 = (e) => {
|
|
|
4
4
|
};
|
|
5
5
|
var vm = (e, t, n) => t in e ? mm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
6
|
var Yg = (e, t, n) => vm(e, typeof t != "symbol" ? t + "" : t, n), _0 = (e, t, n) => t.has(e) || K0("Cannot " + n);
|
|
7
|
-
var
|
|
7
|
+
var Gr = (e, t, n) => (_0(e, t, "read from private field"), n ? n.call(e) : t.get(e)), bl = (e, t, n) => t.has(e) ? K0("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Cl = (e, t, n, r) => (_0(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), ml = (e, t, n) => (_0(e, t, "access private method"), n);
|
|
8
8
|
var k0 = (e, t, n, r) => ({
|
|
9
9
|
set _(s) {
|
|
10
10
|
Cl(e, t, s, n);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return Gr(e, t, r);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
import React, { createElement, useContext, useRef, useState, useCallback, useEffect, useMemo, forwardRef, useLayoutEffect, createContext, useReducer, Component, memo } from "react";
|
|
@@ -1017,13 +1017,13 @@ function it$1(e, t, n) {
|
|
|
1017
1017
|
var pe = new Qe$1(n, de, r ? s.componentStyle : void 0);
|
|
1018
1018
|
function st(Ye, N) {
|
|
1019
1019
|
return function(P, p, mt) {
|
|
1020
|
-
var It = P.attrs, Zn = P.componentStyle, Kn = P.defaultProps, Is = P.foldedComponentIds, qs = P.styledComponentId,
|
|
1020
|
+
var It = P.attrs, Zn = P.componentStyle, Kn = P.defaultProps, Is = P.foldedComponentIds, qs = P.styledComponentId, Ur = P.target, Ar = React.useContext(et), Fr = Ge$1(), sr = P.shouldForwardProp || Fr.shouldForwardProp, As = I(p, Ar, Kn) || C$1, Si = function(Un, St, Xn) {
|
|
1021
1021
|
for (var Gn, me = __assign(__assign({}, St), { className: void 0, theme: Xn }), kt = 0; kt < Un.length; kt += 1) {
|
|
1022
1022
|
var Lt = re(Gn = Un[kt]) ? Gn(me) : Gn;
|
|
1023
1023
|
for (var zt in Lt) me[zt] = zt === "className" ? ie(me[zt], Lt[zt]) : zt === "style" ? __assign(__assign({}, me[zt]), Lt[zt]) : Lt[zt];
|
|
1024
1024
|
}
|
|
1025
1025
|
return St.className && (me.className = ie(me.className, St.className)), me;
|
|
1026
|
-
}(It, p, As), Oi = Si.as ||
|
|
1026
|
+
}(It, p, As), Oi = Si.as || Ur, dl = {};
|
|
1027
1027
|
for (var ur in Si) Si[ur] === void 0 || ur[0] === "$" || ur === "as" || ur === "theme" && Si.theme === As || (ur === "forwardedAs" ? dl.as = Si.forwardedAs : sr && !sr(ur, Oi) || (dl[ur] = Si[ur]));
|
|
1028
1028
|
var Dt = function(Un, St) {
|
|
1029
1029
|
var Xn = Ge$1(), Gn = Un.generateAndInjectStyles(St, Xn.styleSheet, Xn.stylis);
|
|
@@ -1261,20 +1261,20 @@ const defaultTheme$4 = {
|
|
|
1261
1261
|
}) => {
|
|
1262
1262
|
const [de, Le] = useState(!1), [E, u] = useState(null), [o, pe] = useState(0), [st, nt] = useState(0), [Ye, N] = useState(!1), [P, p] = useState(!0), mt = (tt == null ? void 0 : tt.theme) || defaultTheme$4, It = useRef(null), Zn = useRef(null), Kn = useRef(!1);
|
|
1263
1263
|
useRef(null);
|
|
1264
|
-
const Is = useCallback((
|
|
1264
|
+
const Is = useCallback((Ur) => {
|
|
1265
1265
|
if (!Zn.current || !P || !h) return null;
|
|
1266
|
-
const
|
|
1266
|
+
const Ar = Zn.current, Fr = Ar.offsetWidth - 40, sr = Ar.offsetHeight - 40, As = Fr / Ur.width, Si = sr / Ur.height, Oi = Math.min(As, Si, 1), dl = Math.max(0.3, Math.min(1, Oi));
|
|
1267
1267
|
return console.log("\u81EA\u52A8\u8BA1\u7B97\u7F29\u653E\u6BD4\u4F8B:", {
|
|
1268
|
-
containerWidth:
|
|
1268
|
+
containerWidth: Fr,
|
|
1269
1269
|
containerHeight: sr,
|
|
1270
|
-
viewportWidth:
|
|
1271
|
-
viewportHeight:
|
|
1270
|
+
viewportWidth: Ur.width,
|
|
1271
|
+
viewportHeight: Ur.height,
|
|
1272
1272
|
scaleX: As,
|
|
1273
1273
|
scaleY: Si,
|
|
1274
1274
|
autoScale: Oi,
|
|
1275
1275
|
finalScale: dl
|
|
1276
1276
|
}), dl;
|
|
1277
|
-
}, [P, h]), qs = useCallback(async (
|
|
1277
|
+
}, [P, h]), qs = useCallback(async (Ur) => {
|
|
1278
1278
|
if (!(!e || !It.current)) {
|
|
1279
1279
|
if (Kn.current) {
|
|
1280
1280
|
console.log("\u9875\u9762\u6B63\u5728\u6E32\u67D3\u4E2D\uFF0C\u8DF3\u8FC7");
|
|
@@ -1282,21 +1282,21 @@ const defaultTheme$4 = {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
try {
|
|
1284
1284
|
Kn.current = !0;
|
|
1285
|
-
const
|
|
1286
|
-
if (console.log(`\u6E32\u67D3\u9875\u9762: \u5168\u5C40\u9875\u7801=${
|
|
1287
|
-
throw console.error(`\u9875\u7801\u8D85\u51FA\u8303\u56F4: \u76F8\u5BF9\u9875\u7801=${
|
|
1288
|
-
const
|
|
1285
|
+
const Ar = Ur - n + 1;
|
|
1286
|
+
if (console.log(`\u6E32\u67D3\u9875\u9762: \u5168\u5C40\u9875\u7801=${Ur}, PDF\u8D77\u59CB\u9875=${n}, \u76F8\u5BF9\u9875\u7801=${Ar}`), Ar < 1 || Ar > e.numPages)
|
|
1287
|
+
throw console.error(`\u9875\u7801\u8D85\u51FA\u8303\u56F4: \u76F8\u5BF9\u9875\u7801=${Ar}, PDF\u603B\u9875\u6570=${e.numPages}`), new Error(`\u9875\u7801\u8D85\u51FA\u8303\u56F4: \u8BF7\u6C42\u7B2C${Ur}\u9875\uFF0C\u4F46PDF\u6587\u6863\u53EA\u5305\u542B${e.numPages}\u9875`);
|
|
1288
|
+
const Fr = await e.getPage(Ar), sr = It.current, As = sr.getContext("2d");
|
|
1289
1289
|
console.log("\u5F53\u524Dscale\u503C:", r);
|
|
1290
|
-
const Si =
|
|
1291
|
-
if (console.log("viewport\u5C3A\u5BF8:", Si.width, "x", Si.height), P && p(!1), sr.width = Si.width, sr.height = Si.height, await
|
|
1290
|
+
const Si = Fr.getViewport({ scale: 1 });
|
|
1291
|
+
if (console.log("viewport\u5C3A\u5BF8:", Si.width, "x", Si.height), P && p(!1), sr.width = Si.width, sr.height = Si.height, await Fr.render({
|
|
1292
1292
|
canvasContext: As,
|
|
1293
1293
|
viewport: Si
|
|
1294
1294
|
}).promise, console.log("PDF\u6E32\u67D3\u6210\u529F, canvas\u5C3A\u5BF8:", sr.width, "x", sr.height), Zn.current) {
|
|
1295
1295
|
const Oi = Zn.current;
|
|
1296
1296
|
console.log("\u5BB9\u5668\u5C3A\u5BF8:", Oi.offsetWidth, "x", Oi.offsetHeight), console.log("Canvas\u663E\u793A\u5C3A\u5BF8:", sr.offsetWidth, "x", sr.offsetHeight);
|
|
1297
1297
|
}
|
|
1298
|
-
} catch (
|
|
1299
|
-
console.error("PDF\u6E32\u67D3\u5931\u8D25:",
|
|
1298
|
+
} catch (Ar) {
|
|
1299
|
+
console.error("PDF\u6E32\u67D3\u5931\u8D25:", Ar);
|
|
1300
1300
|
} finally {
|
|
1301
1301
|
Kn.current = !1;
|
|
1302
1302
|
}
|
|
@@ -2147,8 +2147,8 @@ var Yl = (e, t, n) => {
|
|
|
2147
2147
|
throw new Error("Cannot move a path [".concat(It, "] to new path [").concat(Zn, "] because the destination is inside itself."));
|
|
2148
2148
|
var Kn = L.get(e, It), Is = L.parent(e, It), qs = It[It.length - 1];
|
|
2149
2149
|
Is.children.splice(qs, 1);
|
|
2150
|
-
var
|
|
2151
|
-
if (
|
|
2150
|
+
var Ur = C.transform(It, n), Ar = L.get(e, C.parent(Ur)), Fr = Ur[Ur.length - 1];
|
|
2151
|
+
if (Ar.children.splice(Fr, 0, Kn), t)
|
|
2152
2152
|
for (var [sr, As] of A.points(t))
|
|
2153
2153
|
t[As] = ce.transform(sr, n);
|
|
2154
2154
|
break;
|
|
@@ -2186,8 +2186,8 @@ var Yl = (e, t, n) => {
|
|
|
2186
2186
|
if (zt.length === 0) break;
|
|
2187
2187
|
var ln = L.leaf(e, kt), nr = ln.text.slice(0, Lt), Yn = ln.text.slice(Lt + zt.length);
|
|
2188
2188
|
if (ln.text = nr + Yn, t)
|
|
2189
|
-
for (var [un,
|
|
2190
|
-
t[
|
|
2189
|
+
for (var [un, Br] of A.points(t))
|
|
2190
|
+
t[Br] = ce.transform(un, n);
|
|
2191
2191
|
break;
|
|
2192
2192
|
}
|
|
2193
2193
|
case "set_node": {
|
|
@@ -4478,10 +4478,10 @@ var If = (e, t) => {
|
|
|
4478
4478
|
at: h,
|
|
4479
4479
|
voids: c
|
|
4480
4480
|
})) {
|
|
4481
|
-
var [
|
|
4482
|
-
Is && C.compare(
|
|
4481
|
+
var [Ur, Ar] = qs;
|
|
4482
|
+
Is && C.compare(Ar, Is) === 0 || (!c && K.isElement(Ur) && (d.isVoid(e, Ur) || d.isElementReadOnly(e, Ur)) || !C.isCommon(Ar, pe.path) && !C.isCommon(Ar, st.path)) && (Kn.push(qs), Is = Ar);
|
|
4483
4483
|
}
|
|
4484
|
-
var
|
|
4484
|
+
var Fr = Array.from(Kn, (ln) => {
|
|
4485
4485
|
var [, nr] = ln;
|
|
4486
4486
|
return d.pathRef(e, nr);
|
|
4487
4487
|
}), sr = d.pointRef(e, pe), As = d.pointRef(e, st), Si = "";
|
|
@@ -4498,7 +4498,7 @@ var If = (e, t) => {
|
|
|
4498
4498
|
text: ot
|
|
4499
4499
|
}), Si = ot);
|
|
4500
4500
|
}
|
|
4501
|
-
if (
|
|
4501
|
+
if (Fr.reverse().map((ln) => ln.unref()).filter((ln) => ln !== null).forEach((ln) => j.removeNodes(e, {
|
|
4502
4502
|
at: ln,
|
|
4503
4503
|
voids: c
|
|
4504
4504
|
})), !mt) {
|
|
@@ -4588,14 +4588,14 @@ var If = (e, t) => {
|
|
|
4588
4588
|
}))
|
|
4589
4589
|
p(mt) && P.push(mt);
|
|
4590
4590
|
var It = [], Zn = [], Kn = [], Is = !0, qs = !1;
|
|
4591
|
-
for (var [
|
|
4592
|
-
K.isElement(
|
|
4593
|
-
var [
|
|
4591
|
+
for (var [Ur] of P)
|
|
4592
|
+
K.isElement(Ur) && !e.isInline(Ur) ? (Is = !1, qs = !0, Zn.push(Ur)) : Is ? It.push(Ur) : Kn.push(Ur);
|
|
4593
|
+
var [Ar] = d.nodes(e, {
|
|
4594
4594
|
at: i,
|
|
4595
4595
|
match: (ot) => U.isText(ot) || d.isInline(e, ot),
|
|
4596
4596
|
mode: "highest",
|
|
4597
4597
|
voids: s
|
|
4598
|
-
}), [,
|
|
4598
|
+
}), [, Fr] = Ar, sr = d.isStart(e, i, Fr), As = d.isEnd(e, i, Fr), Si = d.pathRef(e, o && !Kn.length ? C.next(E) : E), Oi = d.pathRef(e, As ? C.next(Fr) : Fr);
|
|
4599
4599
|
j.splitNodes(e, {
|
|
4600
4600
|
at: i,
|
|
4601
4601
|
match: (ot) => qs ? K.isElement(ot) && d.isBlock(e, ot) : U.isText(ot) || d.isInline(e, ot),
|
|
@@ -4603,7 +4603,7 @@ var If = (e, t) => {
|
|
|
4603
4603
|
always: qs && (!u || It.length > 0) && (!o || Kn.length > 0),
|
|
4604
4604
|
voids: s
|
|
4605
4605
|
});
|
|
4606
|
-
var dl = d.pathRef(e, !sr || sr && As ? C.next(
|
|
4606
|
+
var dl = d.pathRef(e, !sr || sr && As ? C.next(Fr) : Fr);
|
|
4607
4607
|
if (j.insertNodes(e, It, {
|
|
4608
4608
|
at: dl.current,
|
|
4609
4609
|
match: (ot) => U.isText(ot) || d.isInline(e, ot),
|
|
@@ -4823,8 +4823,8 @@ var Zf = function(e, t) {
|
|
|
4823
4823
|
node: Zn
|
|
4824
4824
|
};
|
|
4825
4825
|
e.apply(Is), c = C.next(c), Ye.push(Is), U.isText ? N.push(...Array.from(L.nodes(Zn), (qs) => {
|
|
4826
|
-
var [,
|
|
4827
|
-
return Kn.concat(
|
|
4826
|
+
var [, Ur] = qs;
|
|
4827
|
+
return Kn.concat(Ur);
|
|
4828
4828
|
})) : N.push(Kn);
|
|
4829
4829
|
};
|
|
4830
4830
|
for (var Zn of t)
|
|
@@ -5202,22 +5202,22 @@ var Zf = function(e, t) {
|
|
|
5202
5202
|
var Is = !1;
|
|
5203
5203
|
if (Kn.length < p.length || Kn.length === 0 || !r && K.isElement(Zn) && d.isVoid(e, Zn))
|
|
5204
5204
|
break;
|
|
5205
|
-
var qs = tt.current,
|
|
5205
|
+
var qs = tt.current, Ur = d.isEnd(e, qs, Kn);
|
|
5206
5206
|
if (c || !tt || !d.isEdge(e, qs, Kn)) {
|
|
5207
5207
|
Is = !0;
|
|
5208
|
-
var
|
|
5208
|
+
var Ar = L.extractProps(Zn);
|
|
5209
5209
|
e.apply({
|
|
5210
5210
|
type: "split_node",
|
|
5211
5211
|
path: Kn,
|
|
5212
5212
|
position: It,
|
|
5213
|
-
properties:
|
|
5213
|
+
properties: Ar
|
|
5214
5214
|
});
|
|
5215
5215
|
}
|
|
5216
|
-
It = Kn[Kn.length - 1] + (Is ||
|
|
5216
|
+
It = Kn[Kn.length - 1] + (Is || Ur ? 1 : 0);
|
|
5217
5217
|
}
|
|
5218
5218
|
if (t.at == null) {
|
|
5219
|
-
var
|
|
5220
|
-
j.select(e,
|
|
5219
|
+
var Fr = de.current || d.end(e, []);
|
|
5220
|
+
j.select(e, Fr);
|
|
5221
5221
|
}
|
|
5222
5222
|
} finally {
|
|
5223
5223
|
var sr;
|
|
@@ -5923,19 +5923,19 @@ function ro() {
|
|
|
5923
5923
|
throw new TypeError(r);
|
|
5924
5924
|
h = n(h) || 0, e(l) && (pe = !!l.leading, st = "maxWait" in l, de = st ? s(n(l.maxWait) || 0, h) : de, nt = "trailing" in l ? !!l.trailing : nt);
|
|
5925
5925
|
function Ye(qs) {
|
|
5926
|
-
var
|
|
5927
|
-
return b = tt = void 0, o = qs, Le = c.apply(
|
|
5926
|
+
var Ur = b, Ar = tt;
|
|
5927
|
+
return b = tt = void 0, o = qs, Le = c.apply(Ar, Ur), Le;
|
|
5928
5928
|
}
|
|
5929
5929
|
function N(qs) {
|
|
5930
5930
|
return o = qs, E = setTimeout(mt, h), pe ? Ye(qs) : Le;
|
|
5931
5931
|
}
|
|
5932
5932
|
function P(qs) {
|
|
5933
|
-
var
|
|
5934
|
-
return st ? i(
|
|
5933
|
+
var Ur = qs - u, Ar = qs - o, Fr = h - Ur;
|
|
5934
|
+
return st ? i(Fr, de - Ar) : Fr;
|
|
5935
5935
|
}
|
|
5936
5936
|
function p(qs) {
|
|
5937
|
-
var
|
|
5938
|
-
return u === void 0 ||
|
|
5937
|
+
var Ur = qs - u, Ar = qs - o;
|
|
5938
|
+
return u === void 0 || Ur >= h || Ur < 0 || st && Ar >= de;
|
|
5939
5939
|
}
|
|
5940
5940
|
function mt() {
|
|
5941
5941
|
var qs = t();
|
|
@@ -5953,8 +5953,8 @@ function ro() {
|
|
|
5953
5953
|
return E === void 0 ? Le : It(t());
|
|
5954
5954
|
}
|
|
5955
5955
|
function Is() {
|
|
5956
|
-
var qs = t(),
|
|
5957
|
-
if (b = arguments, tt = this, u = qs,
|
|
5956
|
+
var qs = t(), Ur = p(qs);
|
|
5957
|
+
if (b = arguments, tt = this, u = qs, Ur) {
|
|
5958
5958
|
if (E === void 0)
|
|
5959
5959
|
return N(u);
|
|
5960
5960
|
if (st)
|
|
@@ -6005,7 +6005,7 @@ const Od = /* @__PURE__ */ Qa(Fd), zu = (e) => typeof e == "object" && e != null
|
|
|
6005
6005
|
}, Qr = (e, t, n, r, s, i, a, c) => i < e && a > t || i > e && a < t ? 0 : i <= e && c <= n || a >= t && c >= n ? i - e - r : a > t && c < n || i < e && c > n ? a - t + s : 0, kd = (e) => e.parentElement ?? (e.getRootNode().host || null), Wu = (e, t) => {
|
|
6006
6006
|
var n, r, s, i;
|
|
6007
6007
|
if (typeof document > "u") return [];
|
|
6008
|
-
const { scrollMode: a, block: c, inline: h, boundary: l, skipOverflowHiddenElements: b } = t, tt = typeof l == "function" ? l : (
|
|
6008
|
+
const { scrollMode: a, block: c, inline: h, boundary: l, skipOverflowHiddenElements: b } = t, tt = typeof l == "function" ? l : (Fr) => Fr !== l;
|
|
6009
6009
|
if (!zu(e)) throw new TypeError("Invalid target");
|
|
6010
6010
|
const de = document.scrollingElement || document.documentElement, Le = [];
|
|
6011
6011
|
let E = e;
|
|
@@ -6016,27 +6016,27 @@ const Od = /* @__PURE__ */ Qa(Fd), zu = (e) => typeof e == "object" && e != null
|
|
|
6016
6016
|
}
|
|
6017
6017
|
E != null && E === document.body && Jr(E) && !Jr(document.documentElement) || E != null && Jr(E, b) && Le.push(E);
|
|
6018
6018
|
}
|
|
6019
|
-
const u = (r = (n = window.visualViewport) == null ? void 0 : n.width) != null ? r : innerWidth, o = (i = (s = window.visualViewport) == null ? void 0 : s.height) != null ? i : innerHeight, { scrollX: pe, scrollY: st } = window, { height: nt, width: Ye, top: N, right: P, bottom: p, left: mt } = e.getBoundingClientRect(), { top: It, right: Zn, bottom: Kn, left: Is } = ((
|
|
6020
|
-
const sr = window.getComputedStyle(
|
|
6019
|
+
const u = (r = (n = window.visualViewport) == null ? void 0 : n.width) != null ? r : innerWidth, o = (i = (s = window.visualViewport) == null ? void 0 : s.height) != null ? i : innerHeight, { scrollX: pe, scrollY: st } = window, { height: nt, width: Ye, top: N, right: P, bottom: p, left: mt } = e.getBoundingClientRect(), { top: It, right: Zn, bottom: Kn, left: Is } = ((Fr) => {
|
|
6020
|
+
const sr = window.getComputedStyle(Fr);
|
|
6021
6021
|
return { top: parseFloat(sr.scrollMarginTop) || 0, right: parseFloat(sr.scrollMarginRight) || 0, bottom: parseFloat(sr.scrollMarginBottom) || 0, left: parseFloat(sr.scrollMarginLeft) || 0 };
|
|
6022
6022
|
})(e);
|
|
6023
|
-
let qs = c === "start" || c === "nearest" ? N - It : c === "end" ? p + Kn : N + nt / 2 - It + Kn,
|
|
6024
|
-
const
|
|
6025
|
-
for (let
|
|
6026
|
-
const sr = Le[
|
|
6027
|
-
if (a === "if-needed" && N >= 0 && mt >= 0 && p <= o && P <= u && (sr === de && !Jr(sr) || N >= Oi && p <= ur && mt >= Dt && P <= dl)) return
|
|
6023
|
+
let qs = c === "start" || c === "nearest" ? N - It : c === "end" ? p + Kn : N + nt / 2 - It + Kn, Ur = h === "center" ? mt + Ye / 2 - Is + Zn : h === "end" ? P + Zn : mt - Is;
|
|
6024
|
+
const Ar = [];
|
|
6025
|
+
for (let Fr = 0; Fr < Le.length; Fr++) {
|
|
6026
|
+
const sr = Le[Fr], { height: As, width: Si, top: Oi, right: dl, bottom: ur, left: Dt } = sr.getBoundingClientRect();
|
|
6027
|
+
if (a === "if-needed" && N >= 0 && mt >= 0 && p <= o && P <= u && (sr === de && !Jr(sr) || N >= Oi && p <= ur && mt >= Dt && P <= dl)) return Ar;
|
|
6028
6028
|
const ot = getComputedStyle(sr), Un = parseInt(ot.borderLeftWidth, 10), St = parseInt(ot.borderTopWidth, 10), Xn = parseInt(ot.borderRightWidth, 10), Gn = parseInt(ot.borderBottomWidth, 10);
|
|
6029
6029
|
let me = 0, kt = 0;
|
|
6030
6030
|
const Lt = "offsetWidth" in sr ? sr.offsetWidth - sr.clientWidth - Un - Xn : 0, zt = "offsetHeight" in sr ? sr.offsetHeight - sr.clientHeight - St - Gn : 0, ln = "offsetWidth" in sr ? sr.offsetWidth === 0 ? 0 : Si / sr.offsetWidth : 0, nr = "offsetHeight" in sr ? sr.offsetHeight === 0 ? 0 : As / sr.offsetHeight : 0;
|
|
6031
|
-
if (de === sr) me = c === "start" ? qs : c === "end" ? qs - o : c === "nearest" ? Qr(st, st + o, o, St, Gn, st + qs, st + qs + nt, nt) : qs - o / 2, kt = h === "start" ?
|
|
6031
|
+
if (de === sr) me = c === "start" ? qs : c === "end" ? qs - o : c === "nearest" ? Qr(st, st + o, o, St, Gn, st + qs, st + qs + nt, nt) : qs - o / 2, kt = h === "start" ? Ur : h === "center" ? Ur - u / 2 : h === "end" ? Ur - u : Qr(pe, pe + u, u, Un, Xn, pe + Ur, pe + Ur + Ye, Ye), me = Math.max(0, me + st), kt = Math.max(0, kt + pe);
|
|
6032
6032
|
else {
|
|
6033
|
-
me = c === "start" ? qs - Oi - St : c === "end" ? qs - ur + Gn + zt : c === "nearest" ? Qr(Oi, ur, As, St, Gn + zt, qs, qs + nt, nt) : qs - (Oi + As / 2) + zt / 2, kt = h === "start" ?
|
|
6033
|
+
me = c === "start" ? qs - Oi - St : c === "end" ? qs - ur + Gn + zt : c === "nearest" ? Qr(Oi, ur, As, St, Gn + zt, qs, qs + nt, nt) : qs - (Oi + As / 2) + zt / 2, kt = h === "start" ? Ur - Dt - Un : h === "center" ? Ur - (Dt + Si / 2) + Lt / 2 : h === "end" ? Ur - dl + Xn + Lt : Qr(Dt, dl, Si, Un, Xn + Lt, Ur, Ur + Ye, Ye);
|
|
6034
6034
|
const { scrollLeft: Yn, scrollTop: un } = sr;
|
|
6035
|
-
me = nr === 0 ? 0 : Math.max(0, Math.min(un + me / nr, sr.scrollHeight - As / nr + zt)), kt = ln === 0 ? 0 : Math.max(0, Math.min(Yn + kt / ln, sr.scrollWidth - Si / ln + Lt)), qs += un - me,
|
|
6035
|
+
me = nr === 0 ? 0 : Math.max(0, Math.min(un + me / nr, sr.scrollHeight - As / nr + zt)), kt = ln === 0 ? 0 : Math.max(0, Math.min(Yn + kt / ln, sr.scrollWidth - Si / ln + Lt)), qs += un - me, Ur += Yn - kt;
|
|
6036
6036
|
}
|
|
6037
|
-
|
|
6037
|
+
Ar.push({ el: sr, top: me, left: kt });
|
|
6038
6038
|
}
|
|
6039
|
-
return
|
|
6039
|
+
return Ar;
|
|
6040
6040
|
}, Sd = (e) => e === !1 ? { block: "end", inline: "nearest" } : ((t) => t === Object(t) && Object.keys(t).length !== 0)(e) ? e : { block: "start", inline: "nearest" };
|
|
6041
6041
|
function Pd(e, t) {
|
|
6042
6042
|
if (!e.isConnected || !((s) => {
|
|
@@ -6871,11 +6871,11 @@ var F = {
|
|
|
6871
6871
|
"[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"
|
|
6872
6872
|
) : [], Is = pe.closest('[data-slate-node="element"]');
|
|
6873
6873
|
if (i === "forward") {
|
|
6874
|
-
var qs,
|
|
6875
|
-
st = (qs =
|
|
6874
|
+
var qs, Ur = [...Kn(Is), ...Kn(Is == null ? void 0 : Is.nextElementSibling)];
|
|
6875
|
+
st = (qs = Ur.find((Dt) => Dh(pe, Dt))) !== null && qs !== void 0 ? qs : null;
|
|
6876
6876
|
} else {
|
|
6877
|
-
var
|
|
6878
|
-
st = (
|
|
6877
|
+
var Ar, Fr = [...Kn(Is == null ? void 0 : Is.previousElementSibling), ...Kn(Is)];
|
|
6878
|
+
st = (Ar = Fr.findLast((Dt) => Qu(pe, Dt))) !== null && Ar !== void 0 ? Ar : null;
|
|
6879
6879
|
}
|
|
6880
6880
|
st && (l = st.closest('[data-slate-node="text"]'), nt = st, i === "forward" ? b = 0 : (b = nt.textContent.length, nt.querySelectorAll("[data-slate-zero-width]").forEach((Dt) => {
|
|
6881
6881
|
b -= Dt.textContent.length;
|
|
@@ -7266,8 +7266,8 @@ function Ph(e) {
|
|
|
7266
7266
|
if (jt.delete(t), Is) {
|
|
7267
7267
|
var {
|
|
7268
7268
|
selection: qs
|
|
7269
|
-
} = t,
|
|
7270
|
-
|
|
7269
|
+
} = t, Ur = es(t, Is);
|
|
7270
|
+
Ur && (!qs || !A.equals(Ur, qs)) && j.select(t, Ur);
|
|
7271
7271
|
}
|
|
7272
7272
|
}, tt = () => {
|
|
7273
7273
|
var Is = Rt.get(t);
|
|
@@ -7276,8 +7276,8 @@ function Ph(e) {
|
|
|
7276
7276
|
var qs = ce.isPoint(Is.at) ? za(t, Is.at) : es(t, Is.at);
|
|
7277
7277
|
if (!qs)
|
|
7278
7278
|
return;
|
|
7279
|
-
var
|
|
7280
|
-
(!t.selection || !A.equals(t.selection,
|
|
7279
|
+
var Ur = d.range(t, qs);
|
|
7280
|
+
(!t.selection || !A.equals(t.selection, Ur)) && j.select(t, qs);
|
|
7281
7281
|
}
|
|
7282
7282
|
Is.run();
|
|
7283
7283
|
}
|
|
@@ -7291,16 +7291,16 @@ function Ph(e) {
|
|
|
7291
7291
|
affinity: "forward"
|
|
7292
7292
|
});
|
|
7293
7293
|
At.set(t, t.marks), kh("flush", Rt.get(t), Ze.get(t));
|
|
7294
|
-
for (var qs = Ye(),
|
|
7295
|
-
var
|
|
7294
|
+
for (var qs = Ye(), Ur; Ur = (Ar = Ze.get(t)) === null || Ar === void 0 ? void 0 : Ar[0]; ) {
|
|
7295
|
+
var Ar, Fr, sr = gt.get(t);
|
|
7296
7296
|
sr !== void 0 && (gt.delete(t), t.marks = sr), sr && l === !1 && (l = null);
|
|
7297
|
-
var As = Ah(
|
|
7298
|
-
(!t.selection || !A.equals(t.selection, As)) && j.select(t, As),
|
|
7297
|
+
var As = Ah(Ur);
|
|
7298
|
+
(!t.selection || !A.equals(t.selection, As)) && j.select(t, As), Ur.diff.text ? d.insertText(t, Ur.diff.text) : d.deleteFragment(t), Ze.set(t, (Fr = Ze.get(t)) === null || Fr === void 0 ? void 0 : Fr.filter((dl) => {
|
|
7299
7299
|
var {
|
|
7300
7300
|
id: ur
|
|
7301
7301
|
} = dl;
|
|
7302
|
-
return ur !==
|
|
7303
|
-
})), wh(t,
|
|
7302
|
+
return ur !== Ur.id;
|
|
7303
|
+
})), wh(t, Ur) || (qs = !1, Rt.delete(t), At.delete(t), s = "action", jt.delete(t), n.cancel(), r.cancel(), Is == null || Is.unref());
|
|
7304
7304
|
}
|
|
7305
7305
|
var Si = Is == null ? void 0 : Is.unref();
|
|
7306
7306
|
if (Si && !jt.get(t) && (!t.selection || !A.equals(Si, t.selection)) && j.select(t, Si), nt()) {
|
|
@@ -7326,24 +7326,24 @@ function Ph(e) {
|
|
|
7326
7326
|
qs.style.removeProperty("display");
|
|
7327
7327
|
}
|
|
7328
7328
|
}, o = (Is, qs) => {
|
|
7329
|
-
var
|
|
7330
|
-
Ze.set(t,
|
|
7331
|
-
var
|
|
7329
|
+
var Ur, Ar = (Ur = Ze.get(t)) !== null && Ur !== void 0 ? Ur : [];
|
|
7330
|
+
Ze.set(t, Ar);
|
|
7331
|
+
var Fr = L.leaf(t, Is), sr = Ar.findIndex((Oi) => C.equals(Oi.path, Is));
|
|
7332
7332
|
if (sr < 0) {
|
|
7333
|
-
var As = wo(
|
|
7334
|
-
As &&
|
|
7333
|
+
var As = wo(Fr.text, qs);
|
|
7334
|
+
As && Ar.push({
|
|
7335
7335
|
path: Is,
|
|
7336
7336
|
diff: qs,
|
|
7337
7337
|
id: h++
|
|
7338
7338
|
}), u();
|
|
7339
7339
|
return;
|
|
7340
7340
|
}
|
|
7341
|
-
var Si = Bh(
|
|
7341
|
+
var Si = Bh(Fr.text, Ar[sr].diff, qs);
|
|
7342
7342
|
if (!Si) {
|
|
7343
|
-
|
|
7343
|
+
Ar.splice(sr, 1), u();
|
|
7344
7344
|
return;
|
|
7345
7345
|
}
|
|
7346
|
-
|
|
7346
|
+
Ar[sr] = nn(nn({}, Ar[sr]), {}, {
|
|
7347
7347
|
diff: Si
|
|
7348
7348
|
});
|
|
7349
7349
|
}, pe = function(Is) {
|
|
@@ -7358,46 +7358,46 @@ function Ph(e) {
|
|
|
7358
7358
|
var qs;
|
|
7359
7359
|
if (a && (clearTimeout(a), a = null), !fr.get(t)) {
|
|
7360
7360
|
var {
|
|
7361
|
-
inputType:
|
|
7362
|
-
} = Is,
|
|
7363
|
-
l !== !1 &&
|
|
7361
|
+
inputType: Ur
|
|
7362
|
+
} = Is, Ar = null, Fr = Is.dataTransfer || Is.data || void 0;
|
|
7363
|
+
l !== !1 && Ur !== "insertText" && Ur !== "insertCompositionText" && (l = !1);
|
|
7364
7364
|
var [sr] = Is.getTargetRanges();
|
|
7365
|
-
sr && (
|
|
7365
|
+
sr && (Ar = F.toSlateRange(t, sr, {
|
|
7366
7366
|
exactMatch: !1,
|
|
7367
7367
|
suppressThrow: !0
|
|
7368
7368
|
}));
|
|
7369
7369
|
var As = F.getWindow(t), Si = As.getSelection();
|
|
7370
|
-
if (!
|
|
7370
|
+
if (!Ar && Si && (sr = Si, Ar = F.toSlateRange(t, Si, {
|
|
7371
7371
|
exactMatch: !1,
|
|
7372
7372
|
suppressThrow: !0
|
|
7373
|
-
})),
|
|
7373
|
+
})), Ar = (qs = Ar) !== null && qs !== void 0 ? qs : t.selection, !!Ar) {
|
|
7374
7374
|
var Oi = !0;
|
|
7375
|
-
if (
|
|
7376
|
-
if (A.isExpanded(
|
|
7377
|
-
var [dl, ur] = A.edges(
|
|
7375
|
+
if (Ur.startsWith("delete")) {
|
|
7376
|
+
if (A.isExpanded(Ar)) {
|
|
7377
|
+
var [dl, ur] = A.edges(Ar), Dt = L.leaf(t, dl.path);
|
|
7378
7378
|
if (Dt.text.length === dl.offset && ur.offset === 0) {
|
|
7379
7379
|
var ot = d.next(t, {
|
|
7380
7380
|
at: dl.path,
|
|
7381
7381
|
match: U.isText
|
|
7382
7382
|
});
|
|
7383
|
-
ot && C.equals(ot[1], ur.path) && (
|
|
7383
|
+
ot && C.equals(ot[1], ur.path) && (Ar = {
|
|
7384
7384
|
anchor: ur,
|
|
7385
7385
|
focus: ur
|
|
7386
7386
|
});
|
|
7387
7387
|
}
|
|
7388
7388
|
}
|
|
7389
|
-
var Un =
|
|
7389
|
+
var Un = Ur.endsWith("Backward") ? "backward" : "forward", [St, Xn] = A.edges(Ar), [Gn, me] = d.leaf(t, St.path), kt = {
|
|
7390
7390
|
text: "",
|
|
7391
7391
|
start: St.offset,
|
|
7392
7392
|
end: Xn.offset
|
|
7393
7393
|
}, Lt = Ze.get(t), zt = Lt == null ? void 0 : Lt.find((xl) => C.equals(xl.path, me)), ln = zt ? [zt.diff, kt] : [kt], nr = bo(Gn.text, ...ln);
|
|
7394
|
-
if (nr.length === 0 && (Oi = !1), A.isExpanded(
|
|
7395
|
-
if (Oi && C.equals(
|
|
7394
|
+
if (nr.length === 0 && (Oi = !1), A.isExpanded(Ar)) {
|
|
7395
|
+
if (Oi && C.equals(Ar.anchor.path, Ar.focus.path)) {
|
|
7396
7396
|
var Yn = {
|
|
7397
|
-
path:
|
|
7397
|
+
path: Ar.anchor.path,
|
|
7398
7398
|
offset: St.offset
|
|
7399
7399
|
}, un = d.range(t, Yn, Yn);
|
|
7400
|
-
return p(un), o(
|
|
7400
|
+
return p(un), o(Ar.anchor.path, {
|
|
7401
7401
|
text: "",
|
|
7402
7402
|
end: Xn.offset,
|
|
7403
7403
|
start: St.offset
|
|
@@ -7406,45 +7406,45 @@ function Ph(e) {
|
|
|
7406
7406
|
return pe(() => d.deleteFragment(t, {
|
|
7407
7407
|
direction: Un
|
|
7408
7408
|
}), {
|
|
7409
|
-
at:
|
|
7409
|
+
at: Ar
|
|
7410
7410
|
});
|
|
7411
7411
|
}
|
|
7412
7412
|
}
|
|
7413
|
-
switch (
|
|
7413
|
+
switch (Ur) {
|
|
7414
7414
|
case "deleteByComposition":
|
|
7415
7415
|
case "deleteByCut":
|
|
7416
7416
|
case "deleteByDrag":
|
|
7417
7417
|
return pe(() => d.deleteFragment(t), {
|
|
7418
|
-
at:
|
|
7418
|
+
at: Ar
|
|
7419
7419
|
});
|
|
7420
7420
|
case "deleteContent":
|
|
7421
7421
|
case "deleteContentForward": {
|
|
7422
7422
|
var {
|
|
7423
|
-
anchor:
|
|
7424
|
-
} =
|
|
7425
|
-
if (Oi && A.isCollapsed(
|
|
7426
|
-
var Ni = L.leaf(t,
|
|
7427
|
-
if (
|
|
7428
|
-
return o(
|
|
7423
|
+
anchor: Br
|
|
7424
|
+
} = Ar;
|
|
7425
|
+
if (Oi && A.isCollapsed(Ar)) {
|
|
7426
|
+
var Ni = L.leaf(t, Br.path);
|
|
7427
|
+
if (Br.offset < Ni.text.length)
|
|
7428
|
+
return o(Br.path, {
|
|
7429
7429
|
text: "",
|
|
7430
|
-
start:
|
|
7431
|
-
end:
|
|
7430
|
+
start: Br.offset,
|
|
7431
|
+
end: Br.offset + 1
|
|
7432
7432
|
});
|
|
7433
7433
|
}
|
|
7434
7434
|
return pe(() => d.deleteForward(t), {
|
|
7435
|
-
at:
|
|
7435
|
+
at: Ar
|
|
7436
7436
|
});
|
|
7437
7437
|
}
|
|
7438
7438
|
case "deleteContentBackward": {
|
|
7439
7439
|
var ki, {
|
|
7440
7440
|
anchor: Pi
|
|
7441
|
-
} =
|
|
7442
|
-
return Oi && ji && A.isCollapsed(
|
|
7441
|
+
} = Ar, ji = Ma(sr) ? sr.isCollapsed : !!((ki = sr) !== null && ki !== void 0 && ki.collapsed);
|
|
7442
|
+
return Oi && ji && A.isCollapsed(Ar) && Pi.offset > 0 ? o(Pi.path, {
|
|
7443
7443
|
text: "",
|
|
7444
7444
|
start: Pi.offset - 1,
|
|
7445
7445
|
end: Pi.offset
|
|
7446
7446
|
}) : pe(() => d.deleteBackward(t), {
|
|
7447
|
-
at:
|
|
7447
|
+
at: Ar
|
|
7448
7448
|
});
|
|
7449
7449
|
}
|
|
7450
7450
|
case "deleteEntireSoftLine":
|
|
@@ -7455,51 +7455,51 @@ function Ph(e) {
|
|
|
7455
7455
|
unit: "line"
|
|
7456
7456
|
});
|
|
7457
7457
|
}, {
|
|
7458
|
-
at:
|
|
7458
|
+
at: Ar
|
|
7459
7459
|
});
|
|
7460
7460
|
case "deleteHardLineBackward":
|
|
7461
7461
|
return pe(() => d.deleteBackward(t, {
|
|
7462
7462
|
unit: "block"
|
|
7463
7463
|
}), {
|
|
7464
|
-
at:
|
|
7464
|
+
at: Ar
|
|
7465
7465
|
});
|
|
7466
7466
|
case "deleteSoftLineBackward":
|
|
7467
7467
|
return pe(() => d.deleteBackward(t, {
|
|
7468
7468
|
unit: "line"
|
|
7469
7469
|
}), {
|
|
7470
|
-
at:
|
|
7470
|
+
at: Ar
|
|
7471
7471
|
});
|
|
7472
7472
|
case "deleteHardLineForward":
|
|
7473
7473
|
return pe(() => d.deleteForward(t, {
|
|
7474
7474
|
unit: "block"
|
|
7475
7475
|
}), {
|
|
7476
|
-
at:
|
|
7476
|
+
at: Ar
|
|
7477
7477
|
});
|
|
7478
7478
|
case "deleteSoftLineForward":
|
|
7479
7479
|
return pe(() => d.deleteForward(t, {
|
|
7480
7480
|
unit: "line"
|
|
7481
7481
|
}), {
|
|
7482
|
-
at:
|
|
7482
|
+
at: Ar
|
|
7483
7483
|
});
|
|
7484
7484
|
case "deleteWordBackward":
|
|
7485
7485
|
return pe(() => d.deleteBackward(t, {
|
|
7486
7486
|
unit: "word"
|
|
7487
7487
|
}), {
|
|
7488
|
-
at:
|
|
7488
|
+
at: Ar
|
|
7489
7489
|
});
|
|
7490
7490
|
case "deleteWordForward":
|
|
7491
7491
|
return pe(() => d.deleteForward(t, {
|
|
7492
7492
|
unit: "word"
|
|
7493
7493
|
}), {
|
|
7494
|
-
at:
|
|
7494
|
+
at: Ar
|
|
7495
7495
|
});
|
|
7496
7496
|
case "insertLineBreak":
|
|
7497
7497
|
return pe(() => d.insertSoftBreak(t), {
|
|
7498
|
-
at:
|
|
7498
|
+
at: Ar
|
|
7499
7499
|
});
|
|
7500
7500
|
case "insertParagraph":
|
|
7501
7501
|
return pe(() => d.insertBreak(t), {
|
|
7502
|
-
at:
|
|
7502
|
+
at: Ar
|
|
7503
7503
|
});
|
|
7504
7504
|
case "insertCompositionText":
|
|
7505
7505
|
case "deleteCompositionText":
|
|
@@ -7509,12 +7509,12 @@ function Ph(e) {
|
|
|
7509
7509
|
case "insertFromYank":
|
|
7510
7510
|
case "insertReplacementText":
|
|
7511
7511
|
case "insertText": {
|
|
7512
|
-
if (Sh(
|
|
7513
|
-
return pe(() => F.insertData(t,
|
|
7514
|
-
at:
|
|
7512
|
+
if (Sh(Fr))
|
|
7513
|
+
return pe(() => F.insertData(t, Fr), {
|
|
7514
|
+
at: Ar
|
|
7515
7515
|
});
|
|
7516
|
-
var _a =
|
|
7517
|
-
if (gt.get(t) && (_a = _a.replace("\uFEFF", "")),
|
|
7516
|
+
var _a = Fr ?? "";
|
|
7517
|
+
if (gt.get(t) && (_a = _a.replace("\uFEFF", "")), Ur === "insertText" && /.*\n.*\n$/.test(_a) && (_a = _a.slice(0, -1)), _a.includes(`
|
|
7518
7518
|
`))
|
|
7519
7519
|
return pe(() => {
|
|
7520
7520
|
var xl = _a.split(`
|
|
@@ -7523,18 +7523,18 @@ function Ph(e) {
|
|
|
7523
7523
|
Ol && d.insertText(t, Ol), fg !== xl.length - 1 && d.insertSoftBreak(t);
|
|
7524
7524
|
});
|
|
7525
7525
|
}, {
|
|
7526
|
-
at:
|
|
7526
|
+
at: Ar
|
|
7527
7527
|
});
|
|
7528
|
-
if (C.equals(
|
|
7529
|
-
var [vl, Ha] = A.edges(
|
|
7528
|
+
if (C.equals(Ar.anchor.path, Ar.focus.path)) {
|
|
7529
|
+
var [vl, Ha] = A.edges(Ar), Fl = {
|
|
7530
7530
|
start: vl.offset,
|
|
7531
7531
|
end: Ha.offset,
|
|
7532
7532
|
text: _a
|
|
7533
7533
|
};
|
|
7534
|
-
if (_a && l &&
|
|
7534
|
+
if (_a && l && Ur === "insertCompositionText") {
|
|
7535
7535
|
var Al = l.start + l.text.search(/\S|$/), wl = Fl.start + Fl.text.search(/\S|$/);
|
|
7536
7536
|
wl === Al + 1 && Fl.end === l.start + l.text.length ? (Fl.start -= 1, l = null, Zn()) : l = !1;
|
|
7537
|
-
} else
|
|
7537
|
+
} else Ur === "insertText" ? l === null ? l = Fl : l && A.isCollapsed(Ar) && l.end + l.text.length === vl.offset ? l = nn(nn({}, l), {}, {
|
|
7538
7538
|
text: l.text + _a
|
|
7539
7539
|
}) : l = !1 : l = !1;
|
|
7540
7540
|
if (Oi) {
|
|
@@ -7543,7 +7543,7 @@ function Ph(e) {
|
|
|
7543
7543
|
}
|
|
7544
7544
|
}
|
|
7545
7545
|
return pe(() => d.insertText(t, _a), {
|
|
7546
|
-
at:
|
|
7546
|
+
at: Ar
|
|
7547
7547
|
});
|
|
7548
7548
|
}
|
|
7549
7549
|
}
|
|
@@ -7558,8 +7558,8 @@ function Ph(e) {
|
|
|
7558
7558
|
selection: qs
|
|
7559
7559
|
} = t;
|
|
7560
7560
|
if (Is) {
|
|
7561
|
-
var
|
|
7562
|
-
(
|
|
7561
|
+
var Ur = !qs || !C.equals(qs.anchor.path, Is.anchor.path), Ar = !qs || !C.equals(qs.anchor.path.slice(0, -1), Is.anchor.path.slice(0, -1));
|
|
7562
|
+
(Ur && l || Ar) && (l = !1), (Ur || Ye()) && (a = setTimeout(de, Oh));
|
|
7563
7563
|
}
|
|
7564
7564
|
}, mt = () => {
|
|
7565
7565
|
(nt() || !Ye()) && de();
|
|
@@ -7568,7 +7568,7 @@ function Ph(e) {
|
|
|
7568
7568
|
}, Zn = () => {
|
|
7569
7569
|
nt() || (c = setTimeout(de));
|
|
7570
7570
|
}, Kn = (Is) => {
|
|
7571
|
-
if (!(Ye() || nt()) && Is.some((
|
|
7571
|
+
if (!(Ye() || nt()) && Is.some((Ur) => hi(t, Ur, Is))) {
|
|
7572
7572
|
var qs;
|
|
7573
7573
|
(qs = po.get(t)) === null || qs === void 0 || qs();
|
|
7574
7574
|
}
|
|
@@ -8209,21 +8209,21 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8209
8209
|
var {
|
|
8210
8210
|
anchorNode: nr,
|
|
8211
8211
|
focusNode: Yn
|
|
8212
|
-
} = ln, un = F.hasEditableTarget(o, nr) || F.isTargetInsideNonReadonlyVoid(o, nr),
|
|
8213
|
-
if (un &&
|
|
8212
|
+
} = ln, un = F.hasEditableTarget(o, nr) || F.isTargetInsideNonReadonlyVoid(o, nr), Br = F.hasTarget(o, Yn);
|
|
8213
|
+
if (un && Br) {
|
|
8214
8214
|
var Ni = F.toSlateRange(o, ln, {
|
|
8215
8215
|
exactMatch: !1,
|
|
8216
8216
|
suppressThrow: !0
|
|
8217
8217
|
});
|
|
8218
8218
|
Ni && (!F.isComposing(o) && !(me != null && me.hasPendingChanges()) && !(me != null && me.isFlushing()) ? j.select(o, Ni) : me == null || me.handleUserSelect(Ni));
|
|
8219
8219
|
}
|
|
8220
|
-
c && (!un || !
|
|
8220
|
+
c && (!un || !Br) && j.deselect(o);
|
|
8221
8221
|
}
|
|
8222
|
-
}, 100), [o, c, Kn]),
|
|
8222
|
+
}, 100), [o, c, Kn]), Ur = useMemo(() => Ad(qs, 0), [qs]);
|
|
8223
8223
|
Is.current = Ih({
|
|
8224
8224
|
node: nt,
|
|
8225
8225
|
onDOMSelectionChange: qs,
|
|
8226
|
-
scheduleOnDOMSelectionChange:
|
|
8226
|
+
scheduleOnDOMSelectionChange: Ur
|
|
8227
8227
|
}), Vr(() => {
|
|
8228
8228
|
var St, Xn, Gn;
|
|
8229
8229
|
nt.current && (Gn = di(nt.current)) ? (ho.set(o, Gn), hn.set(o, nt.current), Gt.set(o, nt.current), Hr.set(nt.current, o)) : Gt.delete(o);
|
|
@@ -8232,8 +8232,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8232
8232
|
} = o, kt = F.findDocumentOrShadowRoot(o), Lt = Nr(kt);
|
|
8233
8233
|
if (!(!Lt || !F.isFocused(o) || (St = Is.current) !== null && St !== void 0 && St.hasPendingAction())) {
|
|
8234
8234
|
var zt = (un) => {
|
|
8235
|
-
var
|
|
8236
|
-
if (!(!me && !
|
|
8235
|
+
var Br = Lt.type !== "None";
|
|
8236
|
+
if (!(!me && !Br)) {
|
|
8237
8237
|
var Ni = Lt.focusNode, ki;
|
|
8238
8238
|
if (lr && Lt.rangeCount > 1) {
|
|
8239
8239
|
var Pi = Lt.getRangeAt(0), ji = Lt.getRangeAt(Lt.rangeCount - 1);
|
|
@@ -8241,7 +8241,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8241
8241
|
} else
|
|
8242
8242
|
ki = Lt.anchorNode;
|
|
8243
8243
|
var _a = hn.get(o), vl = !1;
|
|
8244
|
-
if (_a.contains(ki) && _a.contains(Ni) && (vl = !0),
|
|
8244
|
+
if (_a.contains(ki) && _a.contains(Ni) && (vl = !0), Br && vl && me && !un) {
|
|
8245
8245
|
var Ha = F.toSlateRange(o, Lt, {
|
|
8246
8246
|
exactMatch: !0,
|
|
8247
8247
|
// domSelection is not necessarily a valid Slate range
|
|
@@ -8276,10 +8276,10 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8276
8276
|
}
|
|
8277
8277
|
var nr = null, Yn = requestAnimationFrame(() => {
|
|
8278
8278
|
if (ln) {
|
|
8279
|
-
var un = (
|
|
8279
|
+
var un = (Br) => {
|
|
8280
8280
|
try {
|
|
8281
8281
|
var Ni = F.toDOMNode(o, o);
|
|
8282
|
-
Ni.focus(), zt(
|
|
8282
|
+
Ni.focus(), zt(Br);
|
|
8283
8283
|
} catch {
|
|
8284
8284
|
}
|
|
8285
8285
|
};
|
|
@@ -8293,7 +8293,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8293
8293
|
};
|
|
8294
8294
|
}
|
|
8295
8295
|
});
|
|
8296
|
-
var
|
|
8296
|
+
var Ar = useCallback((St) => {
|
|
8297
8297
|
var Xn = F.toDOMNode(o, o), Gn = Xn.getRootNode();
|
|
8298
8298
|
if (p != null && p.current && qt && Gn instanceof ShadowRoot) {
|
|
8299
8299
|
var me = St.getTargetRanges(), kt = me[0], Lt = new window.Range();
|
|
@@ -8309,13 +8309,13 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8309
8309
|
var ln;
|
|
8310
8310
|
if (Is.current)
|
|
8311
8311
|
return Is.current.handleDOMBeforeInput(St);
|
|
8312
|
-
|
|
8312
|
+
Ur.flush(), qs.flush();
|
|
8313
8313
|
var {
|
|
8314
8314
|
selection: nr
|
|
8315
8315
|
} = o, {
|
|
8316
8316
|
inputType: Yn
|
|
8317
|
-
} = St, un = St.dataTransfer || St.data || void 0,
|
|
8318
|
-
if (
|
|
8317
|
+
} = St, un = St.dataTransfer || St.data || void 0, Br = Yn === "insertCompositionText" || Yn === "deleteCompositionText";
|
|
8318
|
+
if (Br && F.isComposing(o))
|
|
8319
8319
|
return;
|
|
8320
8320
|
var Ni = !1;
|
|
8321
8321
|
if (Yn === "insertText" && nr && A.isCollapsed(nr) && // Only use native character insertion for single characters a-z or space for now.
|
|
@@ -8349,12 +8349,12 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8349
8349
|
});
|
|
8350
8350
|
if (!nr || !A.equals(nr, fg)) {
|
|
8351
8351
|
Ni = !1;
|
|
8352
|
-
var Rl = !
|
|
8352
|
+
var Rl = !Br && o.selection && d.rangeRef(o, o.selection);
|
|
8353
8353
|
j.select(o, fg), Rl && $r.set(o, Rl);
|
|
8354
8354
|
}
|
|
8355
8355
|
}
|
|
8356
8356
|
}
|
|
8357
|
-
if (
|
|
8357
|
+
if (Br)
|
|
8358
8358
|
return;
|
|
8359
8359
|
if (Ni || St.preventDefault(), nr && A.isExpanded(nr) && Yn.startsWith("delete")) {
|
|
8360
8360
|
var lg = Yn.endsWith("Backward") ? "backward" : "forward";
|
|
@@ -8443,19 +8443,19 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8443
8443
|
var hl = (ln = $r.get(o)) === null || ln === void 0 ? void 0 : ln.unref();
|
|
8444
8444
|
$r.delete(o), hl && (!o.selection || !A.equals(o.selection, hl)) && j.select(o, hl);
|
|
8445
8445
|
}
|
|
8446
|
-
}, [o, qs, mt, i, c,
|
|
8447
|
-
St == null ? (qs.cancel(),
|
|
8448
|
-
}, [qs,
|
|
8446
|
+
}, [o, qs, mt, i, c, Ur]), Fr = useCallback((St) => {
|
|
8447
|
+
St == null ? (qs.cancel(), Ur.cancel(), hn.delete(o), Gt.delete(o), nt.current && Pt && nt.current.removeEventListener("beforeinput", Ar)) : Pt && St.addEventListener("beforeinput", Ar), nt.current = St, typeof t == "function" ? t(St) : t && (t.current = St);
|
|
8448
|
+
}, [qs, Ur, o, Ar, t]);
|
|
8449
8449
|
Vr(() => {
|
|
8450
8450
|
var St = F.getWindow(o);
|
|
8451
|
-
St.document.addEventListener("selectionchange",
|
|
8451
|
+
St.document.addEventListener("selectionchange", Ur);
|
|
8452
8452
|
var Xn = () => {
|
|
8453
8453
|
Kn.isDraggingInternally = !1;
|
|
8454
8454
|
};
|
|
8455
8455
|
return St.document.addEventListener("dragend", Xn), St.document.addEventListener("drop", Xn), () => {
|
|
8456
|
-
St.document.removeEventListener("selectionchange",
|
|
8456
|
+
St.document.removeEventListener("selectionchange", Ur), St.document.removeEventListener("dragend", Xn), St.document.removeEventListener("drop", Xn);
|
|
8457
8457
|
};
|
|
8458
|
-
}, [
|
|
8458
|
+
}, [Ur, Kn]);
|
|
8459
8459
|
var sr = s([o, []]), As = a && o.children.length === 1 && Array.from(L.texts(o)).length === 1 && L.string(o) === "" && !pe, Si = useCallback((St) => {
|
|
8460
8460
|
if (St && As) {
|
|
8461
8461
|
var Xn;
|
|
@@ -8541,7 +8541,7 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8541
8541
|
// this magic zIndex="-1" will fix it
|
|
8542
8542
|
zindex: -1,
|
|
8543
8543
|
suppressContentEditableWarning: !0,
|
|
8544
|
-
ref:
|
|
8544
|
+
ref: Fr,
|
|
8545
8545
|
style: bt(bt({}, E ? {} : bt({
|
|
8546
8546
|
// Allow positioning relative to the editable element.
|
|
8547
8547
|
position: "relative",
|
|
@@ -8627,8 +8627,8 @@ var vp = (e) => /* @__PURE__ */ React.createElement(React.Fragment, null, xo(e))
|
|
|
8627
8627
|
at: nr
|
|
8628
8628
|
});
|
|
8629
8629
|
if (Yn && un && C.equals(Yn[1], un[1])) {
|
|
8630
|
-
var
|
|
8631
|
-
j.select(o,
|
|
8630
|
+
var Br = d.range(o, ln);
|
|
8631
|
+
j.select(o, Br);
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
}, [o, u.onClick, c]),
|
|
@@ -11713,13 +11713,13 @@ function pv(e, t, n) {
|
|
|
11713
11713
|
var pe = new hv(n, de, r ? s.componentStyle : void 0);
|
|
11714
11714
|
function st(Ye, N) {
|
|
11715
11715
|
return function(P, p, mt) {
|
|
11716
|
-
var It = P.attrs, Zn = P.componentStyle, Kn = P.defaultProps, Is = P.foldedComponentIds, qs = P.styledComponentId,
|
|
11716
|
+
var It = P.attrs, Zn = P.componentStyle, Kn = P.defaultProps, Is = P.foldedComponentIds, qs = P.styledComponentId, Ur = P.target, Ar = React.useContext(ll), Fr = js(), sr = P.shouldForwardProp || Fr.shouldForwardProp, As = Rg(p, Ar, Kn) || Dr, Si = function(Un, St, Xn) {
|
|
11717
11717
|
for (var Gn, me = Qe(Qe({}, St), { className: void 0, theme: Xn }), kt = 0; kt < Un.length; kt += 1) {
|
|
11718
11718
|
var Lt = Cr(Gn = Un[kt]) ? Gn(me) : Gn;
|
|
11719
11719
|
for (var zt in Lt) me[zt] = zt === "className" ? Vt(me[zt], Lt[zt]) : zt === "style" ? Qe(Qe({}, me[zt]), Lt[zt]) : Lt[zt];
|
|
11720
11720
|
}
|
|
11721
11721
|
return St.className && (me.className = Vt(me.className, St.className)), me;
|
|
11722
|
-
}(It, p, As), Oi = Si.as ||
|
|
11722
|
+
}(It, p, As), Oi = Si.as || Ur, dl = {};
|
|
11723
11723
|
for (var ur in Si) Si[ur] === void 0 || ur[0] === "$" || ur === "as" || ur === "theme" && Si.theme === As || (ur === "forwardedAs" ? dl.as = Si.forwardedAs : sr && !sr(ur, Oi) || (dl[ur] = Si[ur]));
|
|
11724
11724
|
var Dt = function(Un, St) {
|
|
11725
11725
|
var Xn = js(), Gn = Un.generateAndInjectStyles(St, Xn.styleSheet, Xn.stylis);
|
|
@@ -12736,14 +12736,14 @@ const Fv = ut.div`
|
|
|
12736
12736
|
useEffect(() => {
|
|
12737
12737
|
st(qs);
|
|
12738
12738
|
}, [qs]);
|
|
12739
|
-
const
|
|
12739
|
+
const Ur = useMemo(() => t ? `${pe.length * n}px` : "auto", [pe.length, n, t]), Ar = useMemo(() => {
|
|
12740
12740
|
if (!t) return pe;
|
|
12741
12741
|
const dl = Math.max(0, nt.start - r), ur = Math.min(pe.length, nt.end + r);
|
|
12742
12742
|
return pe.slice(dl, ur).map((Dt, ot) => ({
|
|
12743
12743
|
...Dt,
|
|
12744
12744
|
virtualIndex: dl + ot
|
|
12745
12745
|
}));
|
|
12746
|
-
}, [pe, nt, t, r]),
|
|
12746
|
+
}, [pe, nt, t, r]), Fr = useCallback((dl) => {
|
|
12747
12747
|
const { scrollTop: ur, scrollHeight: Dt, clientHeight: ot } = dl.currentTarget;
|
|
12748
12748
|
if (P(ur), t) {
|
|
12749
12749
|
const Un = Math.floor(ur / n), St = Math.min(pe.length, Un + Math.ceil(p / n) + 1);
|
|
@@ -12808,7 +12808,7 @@ const Fv = ut.div`
|
|
|
12808
12808
|
}, [t, n, h, l, Le]), Si = () => pe.length === 0 ? /* @__PURE__ */ Y.jsxs(Sv, { theme: h, children: [
|
|
12809
12809
|
/* @__PURE__ */ Y.jsx("h3", { children: "\u6682\u65E0\u5185\u5BB9" }),
|
|
12810
12810
|
/* @__PURE__ */ Y.jsx("p", { children: "\u8BF7\u6DFB\u52A0\u4E00\u4E9B\u5185\u5BB9\u6765\u5F00\u59CB" })
|
|
12811
|
-
] }) : t ? /* @__PURE__ */ Y.jsx("div", { style: { height:
|
|
12811
|
+
] }) : t ? /* @__PURE__ */ Y.jsx("div", { style: { height: Ur, position: "relative" }, children: Ar.map(As) }) : pe.map(As), Oi = () => !It && !a ? null : /* @__PURE__ */ Y.jsx(kv, { theme: h, children: a ? "\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9..." : "\u52A0\u8F7D\u4E2D..." });
|
|
12812
12812
|
return /* @__PURE__ */ Y.jsx(
|
|
12813
12813
|
Fv,
|
|
12814
12814
|
{
|
|
@@ -12822,14 +12822,14 @@ const Fv = ut.div`
|
|
|
12822
12822
|
{
|
|
12823
12823
|
ref: Is,
|
|
12824
12824
|
theme: h,
|
|
12825
|
-
onScroll:
|
|
12826
|
-
children: /* @__PURE__ */ Y.jsx(Ws, { theme: h, height:
|
|
12825
|
+
onScroll: Fr,
|
|
12826
|
+
children: /* @__PURE__ */ Y.jsx(Ws, { theme: h, height: Ur, children: Si() })
|
|
12827
12827
|
}
|
|
12828
12828
|
) : /* @__PURE__ */ Y.jsxs(
|
|
12829
12829
|
Ws,
|
|
12830
12830
|
{
|
|
12831
12831
|
theme: h,
|
|
12832
|
-
onScroll:
|
|
12832
|
+
onScroll: Fr,
|
|
12833
12833
|
children: [
|
|
12834
12834
|
Si(),
|
|
12835
12835
|
Oi()
|
|
@@ -12900,7 +12900,7 @@ const Fv = ut.div`
|
|
|
12900
12900
|
.markdown-table-mode .table-container{
|
|
12901
12901
|
margin: 0 !important;
|
|
12902
12902
|
overflow: visible !important;
|
|
12903
|
-
width:
|
|
12903
|
+
width: 100% !important;
|
|
12904
12904
|
min-width: 100% !important;
|
|
12905
12905
|
}
|
|
12906
12906
|
|
|
@@ -12910,8 +12910,15 @@ const Fv = ut.div`
|
|
|
12910
12910
|
white-space: nowrap !important;
|
|
12911
12911
|
min-width: 50px !important;
|
|
12912
12912
|
}
|
|
12913
|
+
|
|
12914
|
+
/* \u79FB\u9664fit-content\uFF0C\u4F7F\u7528100%\u5BBD\u5EA6\u786E\u4FDD\u5185\u5BB9\u80FD\u6B63\u5E38\u663E\u793A */
|
|
12913
12915
|
.markdown-table-mode div{
|
|
12914
|
-
width:
|
|
12916
|
+
width: 100% !important;
|
|
12917
|
+
}
|
|
12918
|
+
|
|
12919
|
+
/* \u4E3A\u8868\u683C\u6DFB\u52A0\u6700\u5C0F\u5BBD\u5EA6\uFF0C\u786E\u4FDD\u5185\u5BB9\u4E0D\u88AB\u538B\u7F29 */
|
|
12920
|
+
.markdown-table-mode table {
|
|
12921
|
+
min-width: 100% !important;
|
|
12915
12922
|
}
|
|
12916
12923
|
|
|
12917
12924
|
.markdown-table-mode.markdown-scrollbar::-webkit-scrollbar {
|
|
@@ -12922,7 +12929,7 @@ const Fv = ut.div`
|
|
|
12922
12929
|
|
|
12923
12930
|
/* \u81EA\u5B9A\u4E49\u6EDA\u52A8\u6761\u6837\u5F0F */
|
|
12924
12931
|
.markdown-scrollbar::-webkit-scrollbar {
|
|
12925
|
-
width:
|
|
12932
|
+
width: 8px;
|
|
12926
12933
|
height: 8px;
|
|
12927
12934
|
}
|
|
12928
12935
|
|
|
@@ -13155,12 +13162,12 @@ const Fv = ut.div`
|
|
|
13155
13162
|
if (!pe || !o.current) return;
|
|
13156
13163
|
const qs = window.getSelection();
|
|
13157
13164
|
if (!qs || qs.isCollapsed) return;
|
|
13158
|
-
const
|
|
13159
|
-
if (!
|
|
13160
|
-
const
|
|
13165
|
+
const Ur = qs.getRangeAt(0), Ar = Ur.toString().trim();
|
|
13166
|
+
if (!Ar) return;
|
|
13167
|
+
const Fr = o.current;
|
|
13161
13168
|
let sr = 0, As = 0;
|
|
13162
13169
|
const Si = document.createTreeWalker(
|
|
13163
|
-
|
|
13170
|
+
Fr,
|
|
13164
13171
|
NodeFilter.SHOW_TEXT,
|
|
13165
13172
|
{
|
|
13166
13173
|
acceptNode: (ur) => {
|
|
@@ -13171,22 +13178,22 @@ const Fv = ut.div`
|
|
|
13171
13178
|
);
|
|
13172
13179
|
let Oi = Si.nextNode();
|
|
13173
13180
|
for (; Oi; ) {
|
|
13174
|
-
if (Oi ===
|
|
13175
|
-
As = sr +
|
|
13181
|
+
if (Oi === Ur.startContainer) {
|
|
13182
|
+
As = sr + Ur.startOffset;
|
|
13176
13183
|
break;
|
|
13177
13184
|
}
|
|
13178
13185
|
sr += ((Is = Oi.textContent) == null ? void 0 : Is.length) || 0, Oi = Si.nextNode();
|
|
13179
13186
|
}
|
|
13180
13187
|
console.log("\u9009\u4E2D\u6587\u672C\u4FE1\u606F:", {
|
|
13181
|
-
text:
|
|
13188
|
+
text: Ar,
|
|
13182
13189
|
startOffset: As,
|
|
13183
13190
|
charCount: sr,
|
|
13184
|
-
container:
|
|
13191
|
+
container: Ur.startContainer.textContent
|
|
13185
13192
|
});
|
|
13186
13193
|
const dl = {
|
|
13187
13194
|
id: `md-anno-${Date.now()}`,
|
|
13188
13195
|
start: As,
|
|
13189
|
-
end: As +
|
|
13196
|
+
end: As + Ar.length,
|
|
13190
13197
|
color: "#FFE599"
|
|
13191
13198
|
};
|
|
13192
13199
|
console.log("\u521B\u5EFA\u65B0\u6807\u6CE8:", dl), t.eventsEmit && t.eventsEmit("md_annotation_add", dl), qs.removeAllRanges();
|
|
@@ -13200,14 +13207,14 @@ const Fv = ut.div`
|
|
|
13200
13207
|
return;
|
|
13201
13208
|
}
|
|
13202
13209
|
const Is = o.current.querySelectorAll(".md-annotation");
|
|
13203
|
-
console.log("\u6E05\u7A7AMarkdown\u6807\u6CE8\u6570\u91CF:", Is.length), Is.forEach((
|
|
13204
|
-
const
|
|
13205
|
-
|
|
13210
|
+
console.log("\u6E05\u7A7AMarkdown\u6807\u6CE8\u6570\u91CF:", Is.length), Is.forEach((Ur) => {
|
|
13211
|
+
const Ar = Ur.parentNode;
|
|
13212
|
+
Ar && Ar.replaceChild(document.createTextNode(Ur.textContent || ""), Ur);
|
|
13206
13213
|
});
|
|
13207
13214
|
const qs = o.current.querySelectorAll("table");
|
|
13208
|
-
console.log("\u6E05\u7A7A\u8868\u683C\u6807\u6CE8\uFF0C\u8868\u683C\u6570\u91CF:", qs.length), qs.forEach((
|
|
13209
|
-
|
|
13210
|
-
|
|
13215
|
+
console.log("\u6E05\u7A7A\u8868\u683C\u6807\u6CE8\uFF0C\u8868\u683C\u6570\u91CF:", qs.length), qs.forEach((Ur) => {
|
|
13216
|
+
Ur.querySelectorAll("td, th").forEach((Fr) => {
|
|
13217
|
+
Fr instanceof HTMLTableCellElement && (Fr.style.backgroundColor = "", Fr.title = "");
|
|
13211
13218
|
});
|
|
13212
13219
|
}), console.log("\u6240\u6709\u6807\u6CE8\u5DF2\u6E05\u7A7A");
|
|
13213
13220
|
}, []), Zn = useCallback(() => {
|
|
@@ -13218,22 +13225,22 @@ const Fv = ut.div`
|
|
|
13218
13225
|
const Is = o.current.querySelectorAll("table");
|
|
13219
13226
|
if (console.log("\u627E\u5230\u8868\u683C\u6570\u91CF:", Is.length), console.log("markdownRef.current.innerHTML:", o.current.innerHTML.substring(0, 500)), Is.length === 0) {
|
|
13220
13227
|
console.log("\u6CA1\u6709\u627E\u5230\u8868\u683C\u5143\u7D20"), console.log("\u5C1D\u8BD5\u67E5\u627E\u5176\u4ED6\u53EF\u80FD\u7684\u8868\u683C\u5143\u7D20...");
|
|
13221
|
-
const
|
|
13222
|
-
console.log("\u6240\u6709\u5143\u7D20\u6570\u91CF:",
|
|
13223
|
-
const
|
|
13224
|
-
(
|
|
13228
|
+
const Ur = o.current.querySelectorAll("*");
|
|
13229
|
+
console.log("\u6240\u6709\u5143\u7D20\u6570\u91CF:", Ur.length);
|
|
13230
|
+
const Ar = Array.from(Ur).filter(
|
|
13231
|
+
(Fr) => Fr.tagName.toLowerCase().includes("table") || Fr.className.toLowerCase().includes("table")
|
|
13225
13232
|
);
|
|
13226
|
-
console.log("\u53EF\u80FD\u7684\u8868\u683C\u5143\u7D20:",
|
|
13233
|
+
console.log("\u53EF\u80FD\u7684\u8868\u683C\u5143\u7D20:", Ar);
|
|
13227
13234
|
return;
|
|
13228
13235
|
}
|
|
13229
13236
|
const qs = [];
|
|
13230
|
-
return mt.forEach((
|
|
13231
|
-
const
|
|
13232
|
-
if (console.log("\u5904\u7406\u8868\u683C\u6807\u6CE8:",
|
|
13233
|
-
console.warn("[TableAnnotation] annotation.offsets is not valid",
|
|
13237
|
+
return mt.forEach((Ur, Ar) => {
|
|
13238
|
+
const Fr = Ur.offsets;
|
|
13239
|
+
if (console.log("\u5904\u7406\u8868\u683C\u6807\u6CE8:", Ur), !Array.isArray(Fr) || !Fr.length || !Array.isArray(Fr[0]) || Fr[0].length !== 2) {
|
|
13240
|
+
console.warn("[TableAnnotation] annotation.offsets is not valid", Ur);
|
|
13234
13241
|
return;
|
|
13235
13242
|
}
|
|
13236
|
-
|
|
13243
|
+
Fr.forEach((sr, As) => {
|
|
13237
13244
|
const [Si, Oi] = sr;
|
|
13238
13245
|
if (typeof Si != "number" || typeof Oi != "number") {
|
|
13239
13246
|
console.warn("[TableAnnotation] offset is not [number, number]", sr);
|
|
@@ -13255,14 +13262,14 @@ const Fv = ut.div`
|
|
|
13255
13262
|
cell: St,
|
|
13256
13263
|
original: St.style.backgroundColor,
|
|
13257
13264
|
originalTitle: St.title
|
|
13258
|
-
}), St.style.backgroundColor =
|
|
13265
|
+
}), St.style.backgroundColor = Ur.color || "rgba(255, 229, 153, 0.5)", Ur.content && (St.title = Ur.content), Si && St && As === 0 && Ar === 0 && setTimeout(() => {
|
|
13259
13266
|
St.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
13260
13267
|
}, 500);
|
|
13261
13268
|
});
|
|
13262
13269
|
});
|
|
13263
13270
|
}), () => {
|
|
13264
|
-
qs.forEach(({ cell:
|
|
13265
|
-
|
|
13271
|
+
qs.forEach(({ cell: Ur, original: Ar, originalTitle: Fr }) => {
|
|
13272
|
+
Ur.style.backgroundColor = Ar, Ur.title = Fr;
|
|
13266
13273
|
});
|
|
13267
13274
|
};
|
|
13268
13275
|
}, [mt]);
|
|
@@ -13291,8 +13298,8 @@ const Fv = ut.div`
|
|
|
13291
13298
|
}, [p, mt, n, It, Zn, e.content]);
|
|
13292
13299
|
const Kn = useCallback(() => {
|
|
13293
13300
|
console.log("=== \u5F00\u59CB\u5E94\u7528Markdown\u6807\u6CE8 ===");
|
|
13294
|
-
const Is = new MutationObserver((
|
|
13295
|
-
console.log("\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u6570\u91CF:",
|
|
13301
|
+
const Is = new MutationObserver((Ar) => {
|
|
13302
|
+
console.log("\u68C0\u6D4B\u5230DOM\u53D8\u5316\uFF0C\u6570\u91CF:", Ar.length), Ar.some((sr) => Array.from(sr.addedNodes).some((As) => {
|
|
13296
13303
|
if (As.nodeType === Node.TEXT_NODE) return !0;
|
|
13297
13304
|
if (As.nodeType === Node.ELEMENT_NODE) {
|
|
13298
13305
|
const Si = As;
|
|
@@ -13300,7 +13307,7 @@ const Fv = ut.div`
|
|
|
13300
13307
|
}
|
|
13301
13308
|
return !1;
|
|
13302
13309
|
})) && (console.log("\u68C0\u6D4B\u5230\u6587\u672C\u8282\u70B9\u53D8\u5316\uFF0C\u5F00\u59CB\u5E94\u7528\u6807\u6CE8..."), Is.disconnect(), setTimeout(() => {
|
|
13303
|
-
|
|
13310
|
+
Ur();
|
|
13304
13311
|
}, 100));
|
|
13305
13312
|
});
|
|
13306
13313
|
o.current && Is.observe(o.current, {
|
|
@@ -13309,11 +13316,11 @@ const Fv = ut.div`
|
|
|
13309
13316
|
characterData: !0
|
|
13310
13317
|
});
|
|
13311
13318
|
const qs = setTimeout(() => {
|
|
13312
|
-
console.log("5\u79D2\u8D85\u65F6\uFF0C\u5C1D\u8BD5\u5E94\u7528\u6807\u6CE8..."), Is.disconnect(),
|
|
13313
|
-
}, 5e3),
|
|
13314
|
-
var
|
|
13319
|
+
console.log("5\u79D2\u8D85\u65F6\uFF0C\u5C1D\u8BD5\u5E94\u7528\u6807\u6CE8..."), Is.disconnect(), Ur();
|
|
13320
|
+
}, 5e3), Ur = () => {
|
|
13321
|
+
var Ar, Fr;
|
|
13315
13322
|
console.log("\u5F00\u59CB\u5E94\u7528\u6807\u6CE8...");
|
|
13316
|
-
const sr = (
|
|
13323
|
+
const sr = (Ar = o.current) == null ? void 0 : Ar.querySelectorAll(".md-annotation");
|
|
13317
13324
|
console.log("\u79FB\u9664\u73B0\u6709\u6807\u6CE8\u6570\u91CF:", (sr == null ? void 0 : sr.length) || 0), sr == null || sr.forEach((ot) => {
|
|
13318
13325
|
const Un = ot.parentNode;
|
|
13319
13326
|
Un && Un.replaceChild(document.createTextNode(ot.textContent || ""), ot);
|
|
@@ -13337,7 +13344,7 @@ const Fv = ut.div`
|
|
|
13337
13344
|
const St = Un.slice(0, 10), Xn = Un.slice(10), Gn = document.createElement("span");
|
|
13338
13345
|
Gn.className = "md-annotation", Gn.style.backgroundColor = "#FF0000", Gn.textContent = St;
|
|
13339
13346
|
const me = document.createDocumentFragment();
|
|
13340
|
-
me.appendChild(Gn), Xn && me.appendChild(document.createTextNode(Xn)), (
|
|
13347
|
+
me.appendChild(Gn), Xn && me.appendChild(document.createTextNode(Xn)), (Fr = ot.parentNode) == null || Fr.replaceChild(me, ot), console.log("\u6210\u529F\u5E94\u7528\u6D4B\u8BD5\u6807\u6CE8:", St);
|
|
13341
13348
|
}
|
|
13342
13349
|
}
|
|
13343
13350
|
console.log("\u5F00\u59CB\u5E94\u7528\u771F\u6B63\u6807\u6CE8...");
|
|
@@ -13362,12 +13369,12 @@ const Fv = ut.div`
|
|
|
13362
13369
|
);
|
|
13363
13370
|
console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:", Gn.length), Gn.forEach(({ node: me, start: kt }) => {
|
|
13364
13371
|
var Lt, zt, ln, nr, Yn, un;
|
|
13365
|
-
const
|
|
13366
|
-
if (console.log("\u672C\u5730\u4F4D\u7F6E:", { localStart:
|
|
13372
|
+
const Br = Math.max(0, Un - kt), Ni = Math.min(((Lt = me.textContent) == null ? void 0 : Lt.length) || 0, St - kt);
|
|
13373
|
+
if (console.log("\u672C\u5730\u4F4D\u7F6E:", { localStart: Br, localEnd: Ni, nodeTextLength: (zt = me.textContent) == null ? void 0 : zt.length }), Br >= Ni) {
|
|
13367
13374
|
console.log("\u672C\u5730\u4F4D\u7F6E\u65E0\u6548\uFF0C\u8DF3\u8FC7");
|
|
13368
13375
|
return;
|
|
13369
13376
|
}
|
|
13370
|
-
const ki = ((ln = me.textContent) == null ? void 0 : ln.slice(0,
|
|
13377
|
+
const ki = ((ln = me.textContent) == null ? void 0 : ln.slice(0, Br)) || "", Pi = ((nr = me.textContent) == null ? void 0 : nr.slice(Br, Ni)) || "", ji = ((Yn = me.textContent) == null ? void 0 : Yn.slice(Ni)) || "";
|
|
13371
13378
|
console.log("\u5206\u5272\u6587\u672C:", { before: ki, annotatedText: Pi, after: ji });
|
|
13372
13379
|
const _a = document.createElement("span");
|
|
13373
13380
|
_a.className = "md-annotation", _a.style.backgroundColor = Xn || "#FFE599", _a.textContent = Pi;
|
|
@@ -13393,7 +13400,22 @@ const Fv = ut.div`
|
|
|
13393
13400
|
return;
|
|
13394
13401
|
}
|
|
13395
13402
|
console.log("=== Markdown\u5185\u5BB9\u4FE1\u606F ==="), console.log("isTableMode:", n), console.log("\u5185\u5BB9\u957F\u5EA6:", qs.length || 0), typeof qs == "string" ? (console.log("\u5185\u5BB9\u524D100\u5B57\u7B26:", qs.substring(0, 100)), console.log("\u5185\u5BB9\u540E100\u5B57\u7B26:", qs.substring(qs.length - 100))) : (console.log("\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B:", typeof qs), console.log("\u5185\u5BB9\u503C:", qs)), console.log("\u6807\u6CE8\u6570\u636E:", p), console.log("\u8868\u683C\u6807\u6CE8\u6570\u636E:", mt);
|
|
13396
|
-
}, [p, mt, n]),
|
|
13403
|
+
}, [p, mt, n]), useEffect(() => {
|
|
13404
|
+
if (n && o.current) {
|
|
13405
|
+
const Is = setTimeout(() => {
|
|
13406
|
+
var qs;
|
|
13407
|
+
const Ur = (qs = o.current) == null ? void 0 : qs.querySelectorAll("table");
|
|
13408
|
+
Ur && Ur.length > 0 && (console.log("\u8C03\u6574\u8868\u683C\u5C3A\u5BF8\uFF0C\u627E\u5230\u8868\u683C\u6570\u91CF:", Ur.length), Ur.forEach((Ar, Fr) => {
|
|
13409
|
+
if (Ar instanceof HTMLTableElement) {
|
|
13410
|
+
Ar.style.width = "100%", Ar.style.minWidth = "100%", Ar.style.tableLayout = "auto";
|
|
13411
|
+
const sr = Ar.closest(".markdown-table-mode");
|
|
13412
|
+
sr && sr instanceof HTMLElement && (sr.style.width = "100%", sr.style.overflowX = "auto"), console.log(`\u8868\u683C ${Fr + 1} \u5C3A\u5BF8\u8C03\u6574\u5B8C\u6210`);
|
|
13413
|
+
}
|
|
13414
|
+
}));
|
|
13415
|
+
}, 500);
|
|
13416
|
+
return () => clearTimeout(Is);
|
|
13417
|
+
}
|
|
13418
|
+
}, [n, e.content]), /* @__PURE__ */ React.createElement(
|
|
13397
13419
|
"div",
|
|
13398
13420
|
{
|
|
13399
13421
|
style: {
|
|
@@ -13908,7 +13930,7 @@ function requirePdf() {
|
|
|
13908
13930
|
(e, t, n) => {
|
|
13909
13931
|
Object.defineProperty(t, "__esModule", {
|
|
13910
13932
|
value: !0
|
|
13911
|
-
}), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength =
|
|
13933
|
+
}), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.UNSUPPORTED_FEATURES = t.TextRenderingMode = t.StreamType = t.RenderingIntentFlag = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FontType = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.AnnotationType = t.AnnotationStateModelType = t.AnnotationReviewState = t.AnnotationReplyType = t.AnnotationMode = t.AnnotationMarkedState = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.arrayByteLength = Br, t.arraysToBytes = Ni, t.assert = Dt, t.bytesToString = Yn, t.createPromiseCapability = Tg, t.createValidAbsoluteUrl = Un, t.escapeString = Ol, t.getModificationDate = cg, t.getVerbosityLevel = Si, t.info = Oi, t.isArrayBuffer = gl, t.isArrayEqual = Bl, t.isAscii = fg, t.objectFromMap = ji, t.objectSize = Pi, t.setVerbosityLevel = As, t.shadow = St, t.string32 = ki, t.stringToBytes = un, t.stringToPDFString = xl, t.stringToUTF16BEString = Rl, t.stringToUTF8String = lg, t.unreachable = ur, t.utf8StringToString = hl, t.warn = dl, n(2);
|
|
13912
13934
|
const r = [1, 0, 0, 1, 0, 0];
|
|
13913
13935
|
t.IDENTITY_MATRIX = r;
|
|
13914
13936
|
const s = [1e-3, 0, 0, 1e-3, 0, 0];
|
|
@@ -14147,7 +14169,7 @@ function requirePdf() {
|
|
|
14147
14169
|
STREAM: 2
|
|
14148
14170
|
};
|
|
14149
14171
|
t.CMapCompressionType = qs;
|
|
14150
|
-
const
|
|
14172
|
+
const Ur = {
|
|
14151
14173
|
dependency: 1,
|
|
14152
14174
|
setLineWidth: 2,
|
|
14153
14175
|
setLineCap: 3,
|
|
@@ -14240,8 +14262,8 @@ function requirePdf() {
|
|
|
14240
14262
|
paintSolidColorImageMask: 90,
|
|
14241
14263
|
constructPath: 91
|
|
14242
14264
|
};
|
|
14243
|
-
t.OPS =
|
|
14244
|
-
const
|
|
14265
|
+
t.OPS = Ur;
|
|
14266
|
+
const Ar = {
|
|
14245
14267
|
unknown: "unknown",
|
|
14246
14268
|
forms: "forms",
|
|
14247
14269
|
javaScript: "javaScript",
|
|
@@ -14265,12 +14287,12 @@ function requirePdf() {
|
|
|
14265
14287
|
errorMarkedContent: "errorMarkedContent",
|
|
14266
14288
|
errorContentSubStream: "errorContentSubStream"
|
|
14267
14289
|
};
|
|
14268
|
-
t.UNSUPPORTED_FEATURES =
|
|
14269
|
-
const
|
|
14290
|
+
t.UNSUPPORTED_FEATURES = Ar;
|
|
14291
|
+
const Fr = {
|
|
14270
14292
|
NEED_PASSWORD: 1,
|
|
14271
14293
|
INCORRECT_PASSWORD: 2
|
|
14272
14294
|
};
|
|
14273
|
-
t.PasswordResponses =
|
|
14295
|
+
t.PasswordResponses = Fr;
|
|
14274
14296
|
let sr = Is.WARNINGS;
|
|
14275
14297
|
function As(pl) {
|
|
14276
14298
|
Number.isInteger(pl) && (sr = pl);
|
|
@@ -14402,7 +14424,7 @@ function requirePdf() {
|
|
|
14402
14424
|
Ti[Dl] = pl.charCodeAt(Dl) & 255;
|
|
14403
14425
|
return Ti;
|
|
14404
14426
|
}
|
|
14405
|
-
function
|
|
14427
|
+
function Br(pl) {
|
|
14406
14428
|
if (pl.length !== void 0)
|
|
14407
14429
|
return pl.length;
|
|
14408
14430
|
if (pl.byteLength !== void 0)
|
|
@@ -14415,7 +14437,7 @@ function requirePdf() {
|
|
|
14415
14437
|
return pl[0];
|
|
14416
14438
|
let Ti = 0;
|
|
14417
14439
|
for (let Ug = 0; Ug < Ri; Ug++)
|
|
14418
|
-
Ti +=
|
|
14440
|
+
Ti += Br(pl[Ug]);
|
|
14419
14441
|
let Dl = 0;
|
|
14420
14442
|
const Pl = new Uint8Array(Ti);
|
|
14421
14443
|
for (let Ug = 0; Ug < Ri; Ug++) {
|
|
@@ -15032,20 +15054,20 @@ function requirePdf() {
|
|
|
15032
15054
|
Is || (Is = /* @__PURE__ */ Object.create(null), this._intentStates.set(Kn.cacheKey, Is)), Is.streamReaderCancelTimeout && (clearTimeout(Is.streamReaderCancelTimeout), Is.streamReaderCancelTimeout = null);
|
|
15033
15055
|
const qs = N || new DefaultCanvasFactory({
|
|
15034
15056
|
ownerDocument: this._ownerDocument
|
|
15035
|
-
}),
|
|
15057
|
+
}), Ur = !!(Kn.renderingIntent & _util.RenderingIntentFlag.PRINT);
|
|
15036
15058
|
Is.displayReadyCapability || (Is.displayReadyCapability = (0, _util.createPromiseCapability)(), Is.operatorList = {
|
|
15037
15059
|
fnArray: [],
|
|
15038
15060
|
argsArray: [],
|
|
15039
15061
|
lastChunk: !1,
|
|
15040
15062
|
separateAnnots: null
|
|
15041
15063
|
}, this._stats && this._stats.time("Page Request"), this._pumpOperatorList(Kn));
|
|
15042
|
-
const
|
|
15043
|
-
Is.renderTasks.delete(
|
|
15064
|
+
const Ar = (Oi) => {
|
|
15065
|
+
Is.renderTasks.delete(Fr), (this.cleanupAfterRender || Ur) && (this.pendingCleanup = !0), this._tryCleanup(), Oi ? (Fr.capability.reject(Oi), this._abortOperatorList({
|
|
15044
15066
|
intentState: Is,
|
|
15045
15067
|
reason: Oi instanceof Error ? Oi : new Error(Oi)
|
|
15046
|
-
})) :
|
|
15047
|
-
},
|
|
15048
|
-
callback:
|
|
15068
|
+
})) : Fr.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"));
|
|
15069
|
+
}, Fr = new InternalRenderTask({
|
|
15070
|
+
callback: Ar,
|
|
15049
15071
|
params: {
|
|
15050
15072
|
canvasContext: u,
|
|
15051
15073
|
viewport: o,
|
|
@@ -15059,22 +15081,22 @@ function requirePdf() {
|
|
|
15059
15081
|
operatorList: Is.operatorList,
|
|
15060
15082
|
pageIndex: this._pageIndex,
|
|
15061
15083
|
canvasFactory: qs,
|
|
15062
|
-
useRequestAnimationFrame: !
|
|
15084
|
+
useRequestAnimationFrame: !Ur,
|
|
15063
15085
|
pdfBug: this._pdfBug,
|
|
15064
15086
|
pageColors: It
|
|
15065
15087
|
});
|
|
15066
|
-
(Is.renderTasks || (Is.renderTasks = /* @__PURE__ */ new Set())).add(
|
|
15067
|
-
const sr =
|
|
15088
|
+
(Is.renderTasks || (Is.renderTasks = /* @__PURE__ */ new Set())).add(Fr);
|
|
15089
|
+
const sr = Fr.task;
|
|
15068
15090
|
return Promise.all([Is.displayReadyCapability.promise, p]).then(([Oi, dl]) => {
|
|
15069
15091
|
if (this.pendingCleanup) {
|
|
15070
|
-
|
|
15092
|
+
Ar();
|
|
15071
15093
|
return;
|
|
15072
15094
|
}
|
|
15073
|
-
this._stats && this._stats.time("Rendering"),
|
|
15095
|
+
this._stats && this._stats.time("Rendering"), Fr.initializeGraphics({
|
|
15074
15096
|
transparency: Oi,
|
|
15075
15097
|
optionalContentConfig: dl
|
|
15076
|
-
}),
|
|
15077
|
-
}).catch(
|
|
15098
|
+
}), Fr.operatorListChanged();
|
|
15099
|
+
}).catch(Ar), sr;
|
|
15078
15100
|
}
|
|
15079
15101
|
getOperatorList({
|
|
15080
15102
|
intent: u = "display",
|
|
@@ -15318,10 +15340,10 @@ function requirePdf() {
|
|
|
15318
15340
|
port: u = null,
|
|
15319
15341
|
verbosity: o = (0, _util.getVerbosityLevel)()
|
|
15320
15342
|
} = {}) {
|
|
15321
|
-
if (u &&
|
|
15343
|
+
if (u && Gr(_PDFWorker, r).has(u))
|
|
15322
15344
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
15323
15345
|
if (this.name = E, this.destroyed = !1, this.verbosity = o, this._readyCapability = (0, _util.createPromiseCapability)(), this._port = null, this._webWorker = null, this._messageHandler = null, u) {
|
|
15324
|
-
|
|
15346
|
+
Gr(_PDFWorker, r).set(u, this), this._initializeFromPort(u);
|
|
15325
15347
|
return;
|
|
15326
15348
|
}
|
|
15327
15349
|
this._initialize();
|
|
@@ -15401,12 +15423,12 @@ function requirePdf() {
|
|
|
15401
15423
|
});
|
|
15402
15424
|
}
|
|
15403
15425
|
destroy() {
|
|
15404
|
-
this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null),
|
|
15426
|
+
this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), Gr(_PDFWorker, r).delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
|
|
15405
15427
|
}
|
|
15406
15428
|
static fromPort(E) {
|
|
15407
15429
|
if (!(E != null && E.port))
|
|
15408
15430
|
throw new Error("PDFWorker.fromPort - invalid method signature.");
|
|
15409
|
-
return
|
|
15431
|
+
return Gr(this, r).has(E.port) ? Gr(this, r).get(E.port) : new _PDFWorker(E);
|
|
15410
15432
|
}
|
|
15411
15433
|
static get workerSrc() {
|
|
15412
15434
|
if (_worker_options.GlobalWorkerOptions.workerSrc)
|
|
@@ -15464,7 +15486,7 @@ function requirePdf() {
|
|
|
15464
15486
|
return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
|
|
15465
15487
|
}
|
|
15466
15488
|
get stats() {
|
|
15467
|
-
return
|
|
15489
|
+
return Gr(this, s);
|
|
15468
15490
|
}
|
|
15469
15491
|
getRenderingIntent(u, o = _util.AnnotationMode.ENABLE, pe = null, st = !1) {
|
|
15470
15492
|
let nt = _util.RenderingIntentFlag.DISPLAY, Ye = null;
|
|
@@ -15506,9 +15528,9 @@ function requirePdf() {
|
|
|
15506
15528
|
return this.destroyCapability.promise;
|
|
15507
15529
|
this.destroyed = !0, this.destroyCapability = (0, _util.createPromiseCapability)(), this._passwordCapability && this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));
|
|
15508
15530
|
const u = [];
|
|
15509
|
-
for (const pe of
|
|
15531
|
+
for (const pe of Gr(this, i).values())
|
|
15510
15532
|
u.push(pe._destroy());
|
|
15511
|
-
|
|
15533
|
+
Gr(this, i).clear(), Gr(this, a).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
|
|
15512
15534
|
const o = this.messageHandler.sendWithPromise("Terminate", null);
|
|
15513
15535
|
return u.push(o), Promise.all(u).then(() => {
|
|
15514
15536
|
this.commonObjs.clear(), this.fontLoader.clear(), Cl(this, c, null), this._getFieldObjectsPromise = null, this._hasJSActionsPromise = null, this._networkStream && this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
|
|
@@ -15636,7 +15658,7 @@ function requirePdf() {
|
|
|
15636
15658
|
}), u.on("StartRenderPage", (pe) => {
|
|
15637
15659
|
if (this.destroyed)
|
|
15638
15660
|
return;
|
|
15639
|
-
|
|
15661
|
+
Gr(this, i).get(pe.pageIndex)._startRenderPage(pe.transparency, pe.cacheKey);
|
|
15640
15662
|
}), u.on("commonobj", ([pe, st, nt]) => {
|
|
15641
15663
|
var Ye;
|
|
15642
15664
|
if (!this.destroyed && !this.commonObjs.has(pe))
|
|
@@ -15678,7 +15700,7 @@ function requirePdf() {
|
|
|
15678
15700
|
var P;
|
|
15679
15701
|
if (this.destroyed)
|
|
15680
15702
|
return;
|
|
15681
|
-
const N =
|
|
15703
|
+
const N = Gr(this, i).get(st);
|
|
15682
15704
|
if (!N.objs.has(pe))
|
|
15683
15705
|
switch (nt) {
|
|
15684
15706
|
case "Image":
|
|
@@ -15729,7 +15751,7 @@ function requirePdf() {
|
|
|
15729
15751
|
getPage(u) {
|
|
15730
15752
|
if (!Number.isInteger(u) || u <= 0 || u > this._numPages)
|
|
15731
15753
|
return Promise.reject(new Error("Invalid page request."));
|
|
15732
|
-
const o = u - 1, pe =
|
|
15754
|
+
const o = u - 1, pe = Gr(this, a).get(o);
|
|
15733
15755
|
if (pe)
|
|
15734
15756
|
return pe;
|
|
15735
15757
|
const st = this.messageHandler.sendWithPromise("GetPage", {
|
|
@@ -15738,9 +15760,9 @@ function requirePdf() {
|
|
|
15738
15760
|
if (this.destroyed)
|
|
15739
15761
|
throw new Error("Transport destroyed");
|
|
15740
15762
|
const Ye = new PDFPageProxy(o, nt, this, this._params.ownerDocument, this._params.pdfBug);
|
|
15741
|
-
return
|
|
15763
|
+
return Gr(this, i).set(o, Ye), Ye;
|
|
15742
15764
|
});
|
|
15743
|
-
return
|
|
15765
|
+
return Gr(this, a).set(o, st), st;
|
|
15744
15766
|
}
|
|
15745
15767
|
getPageIndex(u) {
|
|
15746
15768
|
return typeof u != "object" || u === null || !Number.isInteger(u.num) || u.num < 0 || !Number.isInteger(u.gen) || u.gen < 0 ? Promise.reject(new Error("Invalid pageIndex request.")) : this.messageHandler.sendWithPromise("GetPageIndex", {
|
|
@@ -15826,7 +15848,7 @@ function requirePdf() {
|
|
|
15826
15848
|
return this.messageHandler.sendWithPromise("GetPermissions", null);
|
|
15827
15849
|
}
|
|
15828
15850
|
getMetadata() {
|
|
15829
|
-
return
|
|
15851
|
+
return Gr(this, c) || Cl(this, c, this.messageHandler.sendWithPromise("GetMetadata", null).then((u) => {
|
|
15830
15852
|
var o, pe;
|
|
15831
15853
|
return {
|
|
15832
15854
|
info: u[0],
|
|
@@ -15841,7 +15863,7 @@ function requirePdf() {
|
|
|
15841
15863
|
}
|
|
15842
15864
|
async startCleanup(u = !1) {
|
|
15843
15865
|
if (await this.messageHandler.sendWithPromise("Cleanup", null), !this.destroyed) {
|
|
15844
|
-
for (const o of
|
|
15866
|
+
for (const o of Gr(this, i).values())
|
|
15845
15867
|
if (!o.cleanup())
|
|
15846
15868
|
throw new Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`);
|
|
15847
15869
|
this.commonObjs.clear(), u || this.fontLoader.clear(), Cl(this, c, null), this._getFieldObjectsPromise = null, this._hasJSActionsPromise = null;
|
|
@@ -15866,13 +15888,13 @@ function requirePdf() {
|
|
|
15866
15888
|
const st = ml(this, l, P0).call(this, u);
|
|
15867
15889
|
return st.capability.promise.then(() => o(st.data)), null;
|
|
15868
15890
|
}
|
|
15869
|
-
const pe =
|
|
15891
|
+
const pe = Gr(this, h)[u];
|
|
15870
15892
|
if (!(pe != null && pe.capability.settled))
|
|
15871
15893
|
throw new Error(`Requesting object that isn't resolved yet ${u}.`);
|
|
15872
15894
|
return pe.data;
|
|
15873
15895
|
}
|
|
15874
15896
|
has(u) {
|
|
15875
|
-
const o =
|
|
15897
|
+
const o = Gr(this, h)[u];
|
|
15876
15898
|
return (o == null ? void 0 : o.capability.settled) || !1;
|
|
15877
15899
|
}
|
|
15878
15900
|
resolve(u, o = null) {
|
|
@@ -15884,8 +15906,8 @@ function requirePdf() {
|
|
|
15884
15906
|
}
|
|
15885
15907
|
}
|
|
15886
15908
|
h = new WeakMap(), l = new WeakSet(), P0 = function(u) {
|
|
15887
|
-
const o =
|
|
15888
|
-
return o || (
|
|
15909
|
+
const o = Gr(this, h)[u];
|
|
15910
|
+
return o || (Gr(this, h)[u] = {
|
|
15889
15911
|
capability: (0, _util.createPromiseCapability)(),
|
|
15890
15912
|
data: null
|
|
15891
15913
|
});
|
|
@@ -15896,20 +15918,20 @@ function requirePdf() {
|
|
|
15896
15918
|
Cl(this, tt, u), this.onContinue = null;
|
|
15897
15919
|
}
|
|
15898
15920
|
get promise() {
|
|
15899
|
-
return
|
|
15921
|
+
return Gr(this, tt).capability.promise;
|
|
15900
15922
|
}
|
|
15901
15923
|
cancel() {
|
|
15902
|
-
|
|
15924
|
+
Gr(this, tt).cancel();
|
|
15903
15925
|
}
|
|
15904
15926
|
get separateAnnots() {
|
|
15905
15927
|
const {
|
|
15906
15928
|
separateAnnots: u
|
|
15907
|
-
} =
|
|
15929
|
+
} = Gr(this, tt).operatorList;
|
|
15908
15930
|
if (!u)
|
|
15909
15931
|
return !1;
|
|
15910
15932
|
const {
|
|
15911
15933
|
annotationCanvasMap: o
|
|
15912
|
-
} =
|
|
15934
|
+
} = Gr(this, tt);
|
|
15913
15935
|
return u.form || u.canvas && (o == null ? void 0 : o.size) > 0;
|
|
15914
15936
|
}
|
|
15915
15937
|
}
|
|
@@ -15942,9 +15964,9 @@ function requirePdf() {
|
|
|
15942
15964
|
if (this.cancelled)
|
|
15943
15965
|
return;
|
|
15944
15966
|
if (this._canvas) {
|
|
15945
|
-
if (
|
|
15967
|
+
if (Gr(Le, de).has(this._canvas))
|
|
15946
15968
|
throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
|
|
15947
|
-
|
|
15969
|
+
Gr(Le, de).add(this._canvas);
|
|
15948
15970
|
}
|
|
15949
15971
|
this._pdfBug && ((P = globalThis.StepperManager) != null && P.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
|
|
15950
15972
|
const {
|
|
@@ -15962,7 +15984,7 @@ function requirePdf() {
|
|
|
15962
15984
|
}), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback && this.graphicsReadyCallback();
|
|
15963
15985
|
}
|
|
15964
15986
|
cancel(u = null) {
|
|
15965
|
-
this.running = !1, this.cancelled = !0, this.gfx && this.gfx.endDrawing(), this._canvas &&
|
|
15987
|
+
this.running = !1, this.cancelled = !0, this.gfx && this.gfx.endDrawing(), this._canvas && Gr(Le, de).delete(this._canvas), this.callback(u || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, "canvas"));
|
|
15966
15988
|
}
|
|
15967
15989
|
operatorListChanged() {
|
|
15968
15990
|
if (!this.graphicsReady) {
|
|
@@ -15980,7 +16002,7 @@ function requirePdf() {
|
|
|
15980
16002
|
}) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
|
|
15981
16003
|
}
|
|
15982
16004
|
async _next() {
|
|
15983
|
-
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), this._canvas &&
|
|
16005
|
+
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), this._canvas && Gr(Le, de).delete(this._canvas), this.callback())));
|
|
15984
16006
|
}
|
|
15985
16007
|
};
|
|
15986
16008
|
de = new WeakMap(), bl(Le, de, /* @__PURE__ */ new WeakSet());
|
|
@@ -16075,7 +16097,7 @@ function requirePdf() {
|
|
|
16075
16097
|
(0, r.unreachable)("Should not call PrintAnnotationStorage.print");
|
|
16076
16098
|
}
|
|
16077
16099
|
get serializable() {
|
|
16078
|
-
return
|
|
16100
|
+
return Gr(this, b);
|
|
16079
16101
|
}
|
|
16080
16102
|
}
|
|
16081
16103
|
b = new WeakMap(), t.PrintAnnotationStorage = c;
|
|
@@ -16107,10 +16129,10 @@ function requirePdf() {
|
|
|
16107
16129
|
this.div.style.zIndex = 0;
|
|
16108
16130
|
}
|
|
16109
16131
|
setInForeground() {
|
|
16110
|
-
this.div.style.zIndex =
|
|
16132
|
+
this.div.style.zIndex = Gr(this, tt);
|
|
16111
16133
|
}
|
|
16112
16134
|
focusin(E) {
|
|
16113
|
-
|
|
16135
|
+
Gr(this, h) ? Cl(this, h, !1) : this.parent.setSelected(this);
|
|
16114
16136
|
}
|
|
16115
16137
|
focusout(E) {
|
|
16116
16138
|
if (!this.isAttachedToDOM)
|
|
@@ -16159,7 +16181,7 @@ function requirePdf() {
|
|
|
16159
16181
|
return [0, 0];
|
|
16160
16182
|
}
|
|
16161
16183
|
render() {
|
|
16162
|
-
this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin",
|
|
16184
|
+
this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin", Gr(this, a)), this.div.addEventListener("focusout", Gr(this, c));
|
|
16163
16185
|
const [E, u] = this.getInitialTranslation();
|
|
16164
16186
|
return this.translate(E, u), (0, r.bindEvents)(this, this.div, ["dragstart", "pointerdown"]), this.div;
|
|
16165
16187
|
}
|
|
@@ -16213,7 +16235,7 @@ function requirePdf() {
|
|
|
16213
16235
|
Cl(this, b, !1);
|
|
16214
16236
|
}
|
|
16215
16237
|
isInEditMode() {
|
|
16216
|
-
return
|
|
16238
|
+
return Gr(this, b);
|
|
16217
16239
|
}
|
|
16218
16240
|
shouldGetKeyboardEvents() {
|
|
16219
16241
|
return !1;
|
|
@@ -16223,7 +16245,7 @@ function requirePdf() {
|
|
|
16223
16245
|
}
|
|
16224
16246
|
rebuild() {
|
|
16225
16247
|
var E;
|
|
16226
|
-
(E = this.div) == null || E.addEventListener("focusin",
|
|
16248
|
+
(E = this.div) == null || E.addEventListener("focusin", Gr(this, a));
|
|
16227
16249
|
}
|
|
16228
16250
|
serialize() {
|
|
16229
16251
|
(0, s.unreachable)("An editor must be serializable");
|
|
@@ -16238,7 +16260,7 @@ function requirePdf() {
|
|
|
16238
16260
|
return o.x = nt / pe, o.y = Ye / st, o.width = N / pe, o.height = P / st, o;
|
|
16239
16261
|
}
|
|
16240
16262
|
remove() {
|
|
16241
|
-
this.div.removeEventListener("focusin",
|
|
16263
|
+
this.div.removeEventListener("focusin", Gr(this, a)), this.div.removeEventListener("focusout", Gr(this, c)), this.isEmpty() || this.commit(), this.parent.remove(this);
|
|
16242
16264
|
}
|
|
16243
16265
|
select() {
|
|
16244
16266
|
var E;
|
|
@@ -16261,7 +16283,7 @@ function requirePdf() {
|
|
|
16261
16283
|
return this.div;
|
|
16262
16284
|
}
|
|
16263
16285
|
get isEditing() {
|
|
16264
|
-
return
|
|
16286
|
+
return Gr(this, l);
|
|
16265
16287
|
}
|
|
16266
16288
|
set isEditing(E) {
|
|
16267
16289
|
Cl(this, l, E), E ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null);
|
|
@@ -16274,13 +16296,13 @@ function requirePdf() {
|
|
|
16274
16296
|
/* 7 */
|
|
16275
16297
|
/***/
|
|
16276
16298
|
(e, t, n) => {
|
|
16277
|
-
var Le, E, u, o, pe, st, Y0, N, p, mt, It, Zn, Kn, Is, qs,
|
|
16299
|
+
var Le, E, u, o, pe, st, Y0, N, p, mt, It, Zn, Kn, Is, qs, Ur, Ar, Fr, sr, As, Si, Oi, dl, ur, Dt, ot, Z0, T0, r0, p0, J0, Q0, R0, g0, C0;
|
|
16278
16300
|
Object.defineProperty(t, "__esModule", {
|
|
16279
16301
|
value: !0
|
|
16280
16302
|
}), t.KeyboardManager = t.CommandManager = t.ColorManager = t.AnnotationEditorUIManager = void 0, t.bindEvents = i, t.opacityToHex = a;
|
|
16281
16303
|
var r = n(1), s = n(8);
|
|
16282
|
-
function i(Yn, un,
|
|
16283
|
-
for (const Ni of
|
|
16304
|
+
function i(Yn, un, Br) {
|
|
16305
|
+
for (const Ni of Br)
|
|
16284
16306
|
un.addEventListener(Ni, Yn[Ni].bind(Yn));
|
|
16285
16307
|
}
|
|
16286
16308
|
function a(Yn) {
|
|
@@ -16305,41 +16327,41 @@ function requirePdf() {
|
|
|
16305
16327
|
}
|
|
16306
16328
|
add({
|
|
16307
16329
|
cmd: un,
|
|
16308
|
-
undo:
|
|
16330
|
+
undo: Br,
|
|
16309
16331
|
mustExec: Ni,
|
|
16310
16332
|
type: ki = NaN,
|
|
16311
16333
|
overwriteIfSameType: Pi = !1,
|
|
16312
16334
|
keepUndo: ji = !1
|
|
16313
16335
|
}) {
|
|
16314
|
-
if (Ni && un(),
|
|
16336
|
+
if (Ni && un(), Gr(this, u))
|
|
16315
16337
|
return;
|
|
16316
16338
|
const _a = {
|
|
16317
16339
|
cmd: un,
|
|
16318
|
-
undo:
|
|
16340
|
+
undo: Br,
|
|
16319
16341
|
type: ki
|
|
16320
16342
|
};
|
|
16321
|
-
if (
|
|
16322
|
-
|
|
16343
|
+
if (Gr(this, pe) === -1) {
|
|
16344
|
+
Gr(this, E).length > 0 && (Gr(this, E).length = 0), Cl(this, pe, 0), Gr(this, E).push(_a);
|
|
16323
16345
|
return;
|
|
16324
16346
|
}
|
|
16325
|
-
if (Pi &&
|
|
16326
|
-
ji && (_a.undo =
|
|
16347
|
+
if (Pi && Gr(this, E)[Gr(this, pe)].type === ki) {
|
|
16348
|
+
ji && (_a.undo = Gr(this, E)[Gr(this, pe)].undo), Gr(this, E)[Gr(this, pe)] = _a;
|
|
16327
16349
|
return;
|
|
16328
16350
|
}
|
|
16329
|
-
const vl =
|
|
16330
|
-
vl ===
|
|
16351
|
+
const vl = Gr(this, pe) + 1;
|
|
16352
|
+
vl === Gr(this, o) ? Gr(this, E).splice(0, 1) : (Cl(this, pe, vl), vl < Gr(this, E).length && Gr(this, E).splice(vl)), Gr(this, E).push(_a);
|
|
16331
16353
|
}
|
|
16332
16354
|
undo() {
|
|
16333
|
-
|
|
16355
|
+
Gr(this, pe) !== -1 && (Cl(this, u, !0), Gr(this, E)[Gr(this, pe)].undo(), Cl(this, u, !1), Cl(this, pe, Gr(this, pe) - 1));
|
|
16334
16356
|
}
|
|
16335
16357
|
redo() {
|
|
16336
|
-
|
|
16358
|
+
Gr(this, pe) < Gr(this, E).length - 1 && (Cl(this, pe, Gr(this, pe) + 1), Cl(this, u, !0), Gr(this, E)[Gr(this, pe)].cmd(), Cl(this, u, !1));
|
|
16337
16359
|
}
|
|
16338
16360
|
hasSomethingToUndo() {
|
|
16339
|
-
return
|
|
16361
|
+
return Gr(this, pe) !== -1;
|
|
16340
16362
|
}
|
|
16341
16363
|
hasSomethingToRedo() {
|
|
16342
|
-
return
|
|
16364
|
+
return Gr(this, pe) < Gr(this, E).length - 1;
|
|
16343
16365
|
}
|
|
16344
16366
|
destroy() {
|
|
16345
16367
|
Cl(this, E, null);
|
|
@@ -16350,11 +16372,11 @@ function requirePdf() {
|
|
|
16350
16372
|
constructor(un) {
|
|
16351
16373
|
bl(this, st);
|
|
16352
16374
|
this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
|
|
16353
|
-
const
|
|
16375
|
+
const Br = Ye.platform.isMac;
|
|
16354
16376
|
for (const [Ni, ki] of un)
|
|
16355
16377
|
for (const Pi of Ni) {
|
|
16356
16378
|
const ji = Pi.startsWith("mac+");
|
|
16357
|
-
|
|
16379
|
+
Br && ji ? (this.callbacks.set(Pi.slice(4), ki), this.allKeys.add(Pi.split("+").at(-1))) : !Br && !ji && (this.callbacks.set(Pi, ki), this.allKeys.add(Pi.split("+").at(-1)));
|
|
16358
16380
|
}
|
|
16359
16381
|
}
|
|
16360
16382
|
static get platform() {
|
|
@@ -16364,17 +16386,17 @@ function requirePdf() {
|
|
|
16364
16386
|
isMac: un.includes("Mac")
|
|
16365
16387
|
});
|
|
16366
16388
|
}
|
|
16367
|
-
exec(un,
|
|
16368
|
-
if (!this.allKeys.has(
|
|
16389
|
+
exec(un, Br) {
|
|
16390
|
+
if (!this.allKeys.has(Br.key))
|
|
16369
16391
|
return;
|
|
16370
|
-
const Ni = this.callbacks.get(ml(this, st, Y0).call(this,
|
|
16371
|
-
Ni && (Ni.bind(un)(),
|
|
16392
|
+
const Ni = this.callbacks.get(ml(this, st, Y0).call(this, Br));
|
|
16393
|
+
Ni && (Ni.bind(un)(), Br.stopPropagation(), Br.preventDefault());
|
|
16372
16394
|
}
|
|
16373
16395
|
};
|
|
16374
16396
|
st = new WeakSet(), Y0 = function(un) {
|
|
16375
16397
|
un.altKey && this.buffer.push("alt"), un.ctrlKey && this.buffer.push("ctrl"), un.metaKey && this.buffer.push("meta"), un.shiftKey && this.buffer.push("shift"), this.buffer.push(un.key);
|
|
16376
|
-
const
|
|
16377
|
-
return this.buffer.length = 0,
|
|
16398
|
+
const Br = this.buffer.join("+");
|
|
16399
|
+
return this.buffer.length = 0, Br;
|
|
16378
16400
|
};
|
|
16379
16401
|
let l = Ye;
|
|
16380
16402
|
t.KeyboardManager = l;
|
|
@@ -16383,13 +16405,13 @@ function requirePdf() {
|
|
|
16383
16405
|
bl(this, N, null);
|
|
16384
16406
|
}
|
|
16385
16407
|
copy(un) {
|
|
16386
|
-
un && (Array.isArray(un) ? Cl(this, N, un.map((
|
|
16408
|
+
un && (Array.isArray(un) ? Cl(this, N, un.map((Br) => Br.serialize())) : Cl(this, N, [un.serialize()]), Cl(this, N, Gr(this, N).filter((Br) => !!Br)), Gr(this, N).length === 0 && Cl(this, N, null));
|
|
16387
16409
|
}
|
|
16388
16410
|
paste() {
|
|
16389
|
-
return
|
|
16411
|
+
return Gr(this, N);
|
|
16390
16412
|
}
|
|
16391
16413
|
isEmpty() {
|
|
16392
|
-
return
|
|
16414
|
+
return Gr(this, N) === null;
|
|
16393
16415
|
}
|
|
16394
16416
|
destroy() {
|
|
16395
16417
|
Cl(this, N, null);
|
|
@@ -16402,24 +16424,24 @@ function requirePdf() {
|
|
|
16402
16424
|
return (0, s.getColorValues)(un), (0, r.shadow)(this, "_colors", un);
|
|
16403
16425
|
}
|
|
16404
16426
|
convert(un) {
|
|
16405
|
-
const
|
|
16427
|
+
const Br = (0, s.getRGB)(un);
|
|
16406
16428
|
if (!window.matchMedia("(forced-colors: active)").matches)
|
|
16407
|
-
return
|
|
16429
|
+
return Br;
|
|
16408
16430
|
for (const [Ni, ki] of this._colors)
|
|
16409
|
-
if (ki.every((Pi, ji) => Pi ===
|
|
16431
|
+
if (ki.every((Pi, ji) => Pi === Br[ji]))
|
|
16410
16432
|
return P._colorsMapping.get(Ni);
|
|
16411
|
-
return
|
|
16433
|
+
return Br;
|
|
16412
16434
|
}
|
|
16413
16435
|
getHexCode(un) {
|
|
16414
|
-
const
|
|
16415
|
-
return
|
|
16436
|
+
const Br = this._colors.get(un);
|
|
16437
|
+
return Br ? r.Util.makeHexColor(...Br) : un;
|
|
16416
16438
|
}
|
|
16417
16439
|
};
|
|
16418
16440
|
Yg(P, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
|
|
16419
16441
|
let tt = P;
|
|
16420
16442
|
t.ColorManager = tt;
|
|
16421
16443
|
const nr = class nr {
|
|
16422
|
-
constructor(un,
|
|
16444
|
+
constructor(un, Br) {
|
|
16423
16445
|
bl(this, ot);
|
|
16424
16446
|
bl(this, p, null);
|
|
16425
16447
|
bl(this, mt, /* @__PURE__ */ new Map());
|
|
@@ -16428,9 +16450,9 @@ function requirePdf() {
|
|
|
16428
16450
|
bl(this, Kn, new h());
|
|
16429
16451
|
bl(this, Is, 0);
|
|
16430
16452
|
bl(this, qs, null);
|
|
16431
|
-
bl(this,
|
|
16432
|
-
bl(this,
|
|
16433
|
-
bl(this,
|
|
16453
|
+
bl(this, Ur, null);
|
|
16454
|
+
bl(this, Ar, new c());
|
|
16455
|
+
bl(this, Fr, !1);
|
|
16434
16456
|
bl(this, sr, r.AnnotationEditorType.NONE);
|
|
16435
16457
|
bl(this, As, /* @__PURE__ */ new Set());
|
|
16436
16458
|
bl(this, Si, this.keydown.bind(this));
|
|
@@ -16445,13 +16467,13 @@ function requirePdf() {
|
|
|
16445
16467
|
hasSelectedEditor: !1
|
|
16446
16468
|
});
|
|
16447
16469
|
bl(this, Dt, null);
|
|
16448
|
-
Cl(this, Dt, un), Cl(this,
|
|
16470
|
+
Cl(this, Dt, un), Cl(this, Ur, Br), Gr(this, Ur)._on("editingaction", Gr(this, Oi)), Gr(this, Ur)._on("pagechanging", Gr(this, dl));
|
|
16449
16471
|
}
|
|
16450
16472
|
destroy() {
|
|
16451
|
-
ml(this, ot, T0).call(this),
|
|
16452
|
-
for (const un of
|
|
16473
|
+
ml(this, ot, T0).call(this), Gr(this, Ur)._off("editingaction", Gr(this, Oi)), Gr(this, Ur)._off("pagechanging", Gr(this, dl));
|
|
16474
|
+
for (const un of Gr(this, It).values())
|
|
16453
16475
|
un.destroy();
|
|
16454
|
-
|
|
16476
|
+
Gr(this, It).clear(), Gr(this, mt).clear(), Cl(this, p, null), Gr(this, As).clear(), Gr(this, Zn).destroy(), Gr(this, Kn).destroy();
|
|
16455
16477
|
}
|
|
16456
16478
|
onPageChanging({
|
|
16457
16479
|
pageNumber: un
|
|
@@ -16459,134 +16481,134 @@ function requirePdf() {
|
|
|
16459
16481
|
Cl(this, Is, un - 1);
|
|
16460
16482
|
}
|
|
16461
16483
|
focusMainContainer() {
|
|
16462
|
-
|
|
16484
|
+
Gr(this, Dt).focus();
|
|
16463
16485
|
}
|
|
16464
16486
|
keydown(un) {
|
|
16465
|
-
var
|
|
16466
|
-
(
|
|
16487
|
+
var Br;
|
|
16488
|
+
(Br = this.getActive()) != null && Br.shouldGetKeyboardEvents() || nr._keyboardManager.exec(this, un);
|
|
16467
16489
|
}
|
|
16468
16490
|
onEditingAction(un) {
|
|
16469
16491
|
["undo", "redo", "cut", "copy", "paste", "delete", "selectAll"].includes(un.name) && this[un.name]();
|
|
16470
16492
|
}
|
|
16471
16493
|
setEditingState(un) {
|
|
16472
16494
|
un ? (ml(this, ot, Z0).call(this), ml(this, ot, r0).call(this, {
|
|
16473
|
-
isEditing:
|
|
16495
|
+
isEditing: Gr(this, sr) !== r.AnnotationEditorType.NONE,
|
|
16474
16496
|
isEmpty: ml(this, ot, g0).call(this),
|
|
16475
|
-
hasSomethingToUndo:
|
|
16476
|
-
hasSomethingToRedo:
|
|
16497
|
+
hasSomethingToUndo: Gr(this, Kn).hasSomethingToUndo(),
|
|
16498
|
+
hasSomethingToRedo: Gr(this, Kn).hasSomethingToRedo(),
|
|
16477
16499
|
hasSelectedEditor: !1,
|
|
16478
|
-
hasEmptyClipboard:
|
|
16500
|
+
hasEmptyClipboard: Gr(this, Zn).isEmpty()
|
|
16479
16501
|
})) : (ml(this, ot, T0).call(this), ml(this, ot, r0).call(this, {
|
|
16480
16502
|
isEditing: !1
|
|
16481
16503
|
}));
|
|
16482
16504
|
}
|
|
16483
16505
|
registerEditorTypes(un) {
|
|
16484
16506
|
Cl(this, qs, un);
|
|
16485
|
-
for (const
|
|
16486
|
-
ml(this, ot, p0).call(this,
|
|
16507
|
+
for (const Br of Gr(this, qs))
|
|
16508
|
+
ml(this, ot, p0).call(this, Br.defaultPropertiesToUpdate);
|
|
16487
16509
|
}
|
|
16488
16510
|
getId() {
|
|
16489
|
-
return
|
|
16511
|
+
return Gr(this, Ar).getId();
|
|
16490
16512
|
}
|
|
16491
16513
|
addLayer(un) {
|
|
16492
|
-
|
|
16514
|
+
Gr(this, It).set(un.pageIndex, un), Gr(this, Fr) ? un.enable() : un.disable();
|
|
16493
16515
|
}
|
|
16494
16516
|
removeLayer(un) {
|
|
16495
|
-
|
|
16517
|
+
Gr(this, It).delete(un.pageIndex);
|
|
16496
16518
|
}
|
|
16497
16519
|
updateMode(un) {
|
|
16498
16520
|
if (Cl(this, sr, un), un === r.AnnotationEditorType.NONE)
|
|
16499
16521
|
this.setEditingState(!1), ml(this, ot, Q0).call(this);
|
|
16500
16522
|
else {
|
|
16501
16523
|
this.setEditingState(!0), ml(this, ot, J0).call(this);
|
|
16502
|
-
for (const
|
|
16503
|
-
|
|
16524
|
+
for (const Br of Gr(this, It).values())
|
|
16525
|
+
Br.updateMode(un);
|
|
16504
16526
|
}
|
|
16505
16527
|
}
|
|
16506
16528
|
updateToolbar(un) {
|
|
16507
|
-
un !==
|
|
16529
|
+
un !== Gr(this, sr) && Gr(this, Ur).dispatch("switchannotationeditormode", {
|
|
16508
16530
|
source: this,
|
|
16509
16531
|
mode: un
|
|
16510
16532
|
});
|
|
16511
16533
|
}
|
|
16512
|
-
updateParams(un,
|
|
16513
|
-
for (const Ni of
|
|
16514
|
-
Ni.updateParams(un,
|
|
16515
|
-
for (const Ni of
|
|
16516
|
-
Ni.updateDefaultParams(un,
|
|
16534
|
+
updateParams(un, Br) {
|
|
16535
|
+
for (const Ni of Gr(this, As))
|
|
16536
|
+
Ni.updateParams(un, Br);
|
|
16537
|
+
for (const Ni of Gr(this, qs))
|
|
16538
|
+
Ni.updateDefaultParams(un, Br);
|
|
16517
16539
|
}
|
|
16518
16540
|
getEditors(un) {
|
|
16519
|
-
const
|
|
16520
|
-
for (const Ni of
|
|
16521
|
-
Ni.pageIndex === un &&
|
|
16522
|
-
return
|
|
16541
|
+
const Br = [];
|
|
16542
|
+
for (const Ni of Gr(this, mt).values())
|
|
16543
|
+
Ni.pageIndex === un && Br.push(Ni);
|
|
16544
|
+
return Br;
|
|
16523
16545
|
}
|
|
16524
16546
|
getEditor(un) {
|
|
16525
|
-
return
|
|
16547
|
+
return Gr(this, mt).get(un);
|
|
16526
16548
|
}
|
|
16527
16549
|
addEditor(un) {
|
|
16528
|
-
|
|
16550
|
+
Gr(this, mt).set(un.id, un);
|
|
16529
16551
|
}
|
|
16530
16552
|
removeEditor(un) {
|
|
16531
|
-
|
|
16553
|
+
Gr(this, mt).delete(un.id), this.unselect(un);
|
|
16532
16554
|
}
|
|
16533
16555
|
setActiveEditor(un) {
|
|
16534
|
-
|
|
16556
|
+
Gr(this, p) !== un && (Cl(this, p, un), un && ml(this, ot, p0).call(this, un.propertiesToUpdate));
|
|
16535
16557
|
}
|
|
16536
16558
|
toggleSelected(un) {
|
|
16537
|
-
if (
|
|
16538
|
-
|
|
16559
|
+
if (Gr(this, As).has(un)) {
|
|
16560
|
+
Gr(this, As).delete(un), un.unselect(), ml(this, ot, r0).call(this, {
|
|
16539
16561
|
hasSelectedEditor: this.hasSelection
|
|
16540
16562
|
});
|
|
16541
16563
|
return;
|
|
16542
16564
|
}
|
|
16543
|
-
|
|
16565
|
+
Gr(this, As).add(un), un.select(), ml(this, ot, p0).call(this, un.propertiesToUpdate), ml(this, ot, r0).call(this, {
|
|
16544
16566
|
hasSelectedEditor: !0
|
|
16545
16567
|
});
|
|
16546
16568
|
}
|
|
16547
16569
|
setSelected(un) {
|
|
16548
|
-
for (const
|
|
16549
|
-
|
|
16550
|
-
|
|
16570
|
+
for (const Br of Gr(this, As))
|
|
16571
|
+
Br !== un && Br.unselect();
|
|
16572
|
+
Gr(this, As).clear(), Gr(this, As).add(un), un.select(), ml(this, ot, p0).call(this, un.propertiesToUpdate), ml(this, ot, r0).call(this, {
|
|
16551
16573
|
hasSelectedEditor: !0
|
|
16552
16574
|
});
|
|
16553
16575
|
}
|
|
16554
16576
|
isSelected(un) {
|
|
16555
|
-
return
|
|
16577
|
+
return Gr(this, As).has(un);
|
|
16556
16578
|
}
|
|
16557
16579
|
unselect(un) {
|
|
16558
|
-
un.unselect(),
|
|
16580
|
+
un.unselect(), Gr(this, As).delete(un), ml(this, ot, r0).call(this, {
|
|
16559
16581
|
hasSelectedEditor: this.hasSelection
|
|
16560
16582
|
});
|
|
16561
16583
|
}
|
|
16562
16584
|
get hasSelection() {
|
|
16563
|
-
return
|
|
16585
|
+
return Gr(this, As).size !== 0;
|
|
16564
16586
|
}
|
|
16565
16587
|
undo() {
|
|
16566
|
-
|
|
16567
|
-
hasSomethingToUndo:
|
|
16588
|
+
Gr(this, Kn).undo(), ml(this, ot, r0).call(this, {
|
|
16589
|
+
hasSomethingToUndo: Gr(this, Kn).hasSomethingToUndo(),
|
|
16568
16590
|
hasSomethingToRedo: !0,
|
|
16569
16591
|
isEmpty: ml(this, ot, g0).call(this)
|
|
16570
16592
|
});
|
|
16571
16593
|
}
|
|
16572
16594
|
redo() {
|
|
16573
|
-
|
|
16595
|
+
Gr(this, Kn).redo(), ml(this, ot, r0).call(this, {
|
|
16574
16596
|
hasSomethingToUndo: !0,
|
|
16575
|
-
hasSomethingToRedo:
|
|
16597
|
+
hasSomethingToRedo: Gr(this, Kn).hasSomethingToRedo(),
|
|
16576
16598
|
isEmpty: ml(this, ot, g0).call(this)
|
|
16577
16599
|
});
|
|
16578
16600
|
}
|
|
16579
16601
|
addCommands(un) {
|
|
16580
|
-
|
|
16602
|
+
Gr(this, Kn).add(un), ml(this, ot, r0).call(this, {
|
|
16581
16603
|
hasSomethingToUndo: !0,
|
|
16582
16604
|
hasSomethingToRedo: !1,
|
|
16583
16605
|
isEmpty: ml(this, ot, g0).call(this)
|
|
16584
16606
|
});
|
|
16585
16607
|
}
|
|
16586
16608
|
delete() {
|
|
16587
|
-
if (
|
|
16609
|
+
if (Gr(this, p) && Gr(this, p).commitOrRemove(), !this.hasSelection)
|
|
16588
16610
|
return;
|
|
16589
|
-
const un = [...
|
|
16611
|
+
const un = [...Gr(this, As)], Br = () => {
|
|
16590
16612
|
for (const ki of un)
|
|
16591
16613
|
ki.remove();
|
|
16592
16614
|
}, Ni = () => {
|
|
@@ -16594,19 +16616,19 @@ function requirePdf() {
|
|
|
16594
16616
|
ml(this, ot, R0).call(this, ki);
|
|
16595
16617
|
};
|
|
16596
16618
|
this.addCommands({
|
|
16597
|
-
cmd:
|
|
16619
|
+
cmd: Br,
|
|
16598
16620
|
undo: Ni,
|
|
16599
16621
|
mustExec: !0
|
|
16600
16622
|
});
|
|
16601
16623
|
}
|
|
16602
16624
|
copy() {
|
|
16603
|
-
if (
|
|
16625
|
+
if (Gr(this, p) && Gr(this, p).commitOrRemove(), this.hasSelection) {
|
|
16604
16626
|
const un = [];
|
|
16605
|
-
for (const
|
|
16606
|
-
|
|
16627
|
+
for (const Br of Gr(this, As))
|
|
16628
|
+
Br.isEmpty() || un.push(Br);
|
|
16607
16629
|
if (un.length === 0)
|
|
16608
16630
|
return;
|
|
16609
|
-
|
|
16631
|
+
Gr(this, Zn).copy(un), ml(this, ot, r0).call(this, {
|
|
16610
16632
|
hasEmptyClipboard: !1
|
|
16611
16633
|
});
|
|
16612
16634
|
}
|
|
@@ -16615,15 +16637,15 @@ function requirePdf() {
|
|
|
16615
16637
|
this.copy(), this.delete();
|
|
16616
16638
|
}
|
|
16617
16639
|
paste() {
|
|
16618
|
-
if (
|
|
16640
|
+
if (Gr(this, Zn).isEmpty())
|
|
16619
16641
|
return;
|
|
16620
16642
|
this.unselectAll();
|
|
16621
|
-
const un =
|
|
16622
|
-
for (const Pi of
|
|
16643
|
+
const un = Gr(this, It).get(Gr(this, Is)), Br = Gr(this, Zn).paste().map((Pi) => un.deserialize(Pi)), Ni = () => {
|
|
16644
|
+
for (const Pi of Br)
|
|
16623
16645
|
ml(this, ot, R0).call(this, Pi);
|
|
16624
|
-
ml(this, ot, C0).call(this,
|
|
16646
|
+
ml(this, ot, C0).call(this, Br);
|
|
16625
16647
|
}, ki = () => {
|
|
16626
|
-
for (const Pi of
|
|
16648
|
+
for (const Pi of Br)
|
|
16627
16649
|
Pi.remove();
|
|
16628
16650
|
};
|
|
16629
16651
|
this.addCommands({
|
|
@@ -16633,73 +16655,73 @@ function requirePdf() {
|
|
|
16633
16655
|
});
|
|
16634
16656
|
}
|
|
16635
16657
|
selectAll() {
|
|
16636
|
-
for (const un of
|
|
16658
|
+
for (const un of Gr(this, As))
|
|
16637
16659
|
un.commit();
|
|
16638
|
-
ml(this, ot, C0).call(this,
|
|
16660
|
+
ml(this, ot, C0).call(this, Gr(this, mt).values());
|
|
16639
16661
|
}
|
|
16640
16662
|
unselectAll() {
|
|
16641
|
-
if (
|
|
16642
|
-
|
|
16663
|
+
if (Gr(this, p)) {
|
|
16664
|
+
Gr(this, p).commitOrRemove();
|
|
16643
16665
|
return;
|
|
16644
16666
|
}
|
|
16645
16667
|
if (ml(this, ot, C0).size !== 0) {
|
|
16646
|
-
for (const un of
|
|
16668
|
+
for (const un of Gr(this, As))
|
|
16647
16669
|
un.unselect();
|
|
16648
|
-
|
|
16670
|
+
Gr(this, As).clear(), ml(this, ot, r0).call(this, {
|
|
16649
16671
|
hasSelectedEditor: !1
|
|
16650
16672
|
});
|
|
16651
16673
|
}
|
|
16652
16674
|
}
|
|
16653
16675
|
isActive(un) {
|
|
16654
|
-
return
|
|
16676
|
+
return Gr(this, p) === un;
|
|
16655
16677
|
}
|
|
16656
16678
|
getActive() {
|
|
16657
|
-
return
|
|
16679
|
+
return Gr(this, p);
|
|
16658
16680
|
}
|
|
16659
16681
|
getMode() {
|
|
16660
|
-
return
|
|
16682
|
+
return Gr(this, sr);
|
|
16661
16683
|
}
|
|
16662
16684
|
};
|
|
16663
|
-
p = new WeakMap(), mt = new WeakMap(), It = new WeakMap(), Zn = new WeakMap(), Kn = new WeakMap(), Is = new WeakMap(), qs = new WeakMap(),
|
|
16664
|
-
|
|
16685
|
+
p = new WeakMap(), mt = new WeakMap(), It = new WeakMap(), Zn = new WeakMap(), Kn = new WeakMap(), Is = new WeakMap(), qs = new WeakMap(), Ur = new WeakMap(), Ar = new WeakMap(), Fr = new WeakMap(), sr = new WeakMap(), As = new WeakMap(), Si = new WeakMap(), Oi = new WeakMap(), dl = new WeakMap(), ur = new WeakMap(), Dt = new WeakMap(), ot = new WeakSet(), Z0 = function() {
|
|
16686
|
+
Gr(this, Dt).addEventListener("keydown", Gr(this, Si));
|
|
16665
16687
|
}, T0 = function() {
|
|
16666
|
-
|
|
16688
|
+
Gr(this, Dt).removeEventListener("keydown", Gr(this, Si));
|
|
16667
16689
|
}, r0 = function(un) {
|
|
16668
|
-
Object.entries(un).some(([Ni, ki]) =>
|
|
16690
|
+
Object.entries(un).some(([Ni, ki]) => Gr(this, ur)[Ni] !== ki) && Gr(this, Ur).dispatch("annotationeditorstateschanged", {
|
|
16669
16691
|
source: this,
|
|
16670
|
-
details: Object.assign(
|
|
16692
|
+
details: Object.assign(Gr(this, ur), un)
|
|
16671
16693
|
});
|
|
16672
16694
|
}, p0 = function(un) {
|
|
16673
|
-
|
|
16695
|
+
Gr(this, Ur).dispatch("annotationeditorparamschanged", {
|
|
16674
16696
|
source: this,
|
|
16675
16697
|
details: un
|
|
16676
16698
|
});
|
|
16677
16699
|
}, J0 = function() {
|
|
16678
|
-
if (!
|
|
16679
|
-
Cl(this,
|
|
16680
|
-
for (const un of
|
|
16700
|
+
if (!Gr(this, Fr)) {
|
|
16701
|
+
Cl(this, Fr, !0);
|
|
16702
|
+
for (const un of Gr(this, It).values())
|
|
16681
16703
|
un.enable();
|
|
16682
16704
|
}
|
|
16683
16705
|
}, Q0 = function() {
|
|
16684
|
-
if (this.unselectAll(),
|
|
16685
|
-
Cl(this,
|
|
16686
|
-
for (const un of
|
|
16706
|
+
if (this.unselectAll(), Gr(this, Fr)) {
|
|
16707
|
+
Cl(this, Fr, !1);
|
|
16708
|
+
for (const un of Gr(this, It).values())
|
|
16687
16709
|
un.disable();
|
|
16688
16710
|
}
|
|
16689
16711
|
}, R0 = function(un) {
|
|
16690
|
-
const
|
|
16691
|
-
|
|
16712
|
+
const Br = Gr(this, It).get(un.pageIndex);
|
|
16713
|
+
Br ? Br.addOrRebuild(un) : this.addEditor(un);
|
|
16692
16714
|
}, g0 = function() {
|
|
16693
|
-
if (
|
|
16715
|
+
if (Gr(this, mt).size === 0)
|
|
16694
16716
|
return !0;
|
|
16695
|
-
if (
|
|
16696
|
-
for (const un of
|
|
16717
|
+
if (Gr(this, mt).size === 1)
|
|
16718
|
+
for (const un of Gr(this, mt).values())
|
|
16697
16719
|
return un.isEmpty();
|
|
16698
16720
|
return !1;
|
|
16699
16721
|
}, C0 = function(un) {
|
|
16700
|
-
|
|
16701
|
-
for (const
|
|
16702
|
-
|
|
16722
|
+
Gr(this, As).clear();
|
|
16723
|
+
for (const Br of un)
|
|
16724
|
+
Br.isEmpty() || (Gr(this, As).add(Br), Br.select());
|
|
16703
16725
|
ml(this, ot, r0).call(this, {
|
|
16704
16726
|
hasSelectedEditor: !0
|
|
16705
16727
|
});
|
|
@@ -16716,37 +16738,37 @@ function requirePdf() {
|
|
|
16716
16738
|
var r = n(9), s = n(1);
|
|
16717
16739
|
const i = "http://www.w3.org/2000/svg", a = "pdfjs_internal_id_";
|
|
16718
16740
|
t.AnnotationPrefix = a;
|
|
16719
|
-
const
|
|
16741
|
+
const Ur = class Ur {
|
|
16720
16742
|
};
|
|
16721
|
-
Yg(
|
|
16722
|
-
let c =
|
|
16743
|
+
Yg(Ur, "CSS", 96), Yg(Ur, "PDF", 72), Yg(Ur, "PDF_TO_CSS_UNITS", Ur.CSS / Ur.PDF);
|
|
16744
|
+
let c = Ur;
|
|
16723
16745
|
t.PixelsPerInch = c;
|
|
16724
16746
|
class h extends r.BaseCanvasFactory {
|
|
16725
16747
|
constructor({
|
|
16726
|
-
ownerDocument:
|
|
16748
|
+
ownerDocument: Fr = globalThis.document
|
|
16727
16749
|
} = {}) {
|
|
16728
|
-
super(), this._document =
|
|
16750
|
+
super(), this._document = Fr;
|
|
16729
16751
|
}
|
|
16730
|
-
_createCanvas(
|
|
16752
|
+
_createCanvas(Fr, sr) {
|
|
16731
16753
|
const As = this._document.createElement("canvas");
|
|
16732
|
-
return As.width =
|
|
16754
|
+
return As.width = Fr, As.height = sr, As;
|
|
16733
16755
|
}
|
|
16734
16756
|
}
|
|
16735
16757
|
t.DOMCanvasFactory = h;
|
|
16736
|
-
async function l(
|
|
16737
|
-
if (Ye(
|
|
16738
|
-
const sr = await fetch(
|
|
16758
|
+
async function l(Ar, Fr = !1) {
|
|
16759
|
+
if (Ye(Ar, document.baseURI)) {
|
|
16760
|
+
const sr = await fetch(Ar);
|
|
16739
16761
|
if (!sr.ok)
|
|
16740
16762
|
throw new Error(sr.statusText);
|
|
16741
|
-
return
|
|
16763
|
+
return Fr ? new Uint8Array(await sr.arrayBuffer()) : (0, s.stringToBytes)(await sr.text());
|
|
16742
16764
|
}
|
|
16743
16765
|
return new Promise((sr, As) => {
|
|
16744
16766
|
const Si = new XMLHttpRequest();
|
|
16745
|
-
Si.open("GET",
|
|
16767
|
+
Si.open("GET", Ar, !0), Fr && (Si.responseType = "arraybuffer"), Si.onreadystatechange = () => {
|
|
16746
16768
|
if (Si.readyState === XMLHttpRequest.DONE) {
|
|
16747
16769
|
if (Si.status === 200 || Si.status === 0) {
|
|
16748
16770
|
let Oi;
|
|
16749
|
-
if (
|
|
16771
|
+
if (Fr && Si.response ? Oi = new Uint8Array(Si.response) : !Fr && Si.responseText && (Oi = (0, s.stringToBytes)(Si.responseText)), Oi) {
|
|
16750
16772
|
sr(Oi);
|
|
16751
16773
|
return;
|
|
16752
16774
|
}
|
|
@@ -16757,8 +16779,8 @@ function requirePdf() {
|
|
|
16757
16779
|
});
|
|
16758
16780
|
}
|
|
16759
16781
|
class b extends r.BaseCMapReaderFactory {
|
|
16760
|
-
_fetchData(
|
|
16761
|
-
return l(
|
|
16782
|
+
_fetchData(Fr, sr) {
|
|
16783
|
+
return l(Fr, this.isCompressed).then((As) => ({
|
|
16762
16784
|
cMapData: As,
|
|
16763
16785
|
compressionType: sr
|
|
16764
16786
|
}));
|
|
@@ -16766,28 +16788,28 @@ function requirePdf() {
|
|
|
16766
16788
|
}
|
|
16767
16789
|
t.DOMCMapReaderFactory = b;
|
|
16768
16790
|
class tt extends r.BaseStandardFontDataFactory {
|
|
16769
|
-
_fetchData(
|
|
16770
|
-
return l(
|
|
16791
|
+
_fetchData(Fr) {
|
|
16792
|
+
return l(Fr, !0);
|
|
16771
16793
|
}
|
|
16772
16794
|
}
|
|
16773
16795
|
t.DOMStandardFontDataFactory = tt;
|
|
16774
16796
|
class de extends r.BaseSVGFactory {
|
|
16775
|
-
_createSVG(
|
|
16776
|
-
return document.createElementNS(i,
|
|
16797
|
+
_createSVG(Fr) {
|
|
16798
|
+
return document.createElementNS(i, Fr);
|
|
16777
16799
|
}
|
|
16778
16800
|
}
|
|
16779
16801
|
t.DOMSVGFactory = de;
|
|
16780
16802
|
class Le {
|
|
16781
16803
|
constructor({
|
|
16782
|
-
viewBox:
|
|
16804
|
+
viewBox: Fr,
|
|
16783
16805
|
scale: sr,
|
|
16784
16806
|
rotation: As,
|
|
16785
16807
|
offsetX: Si = 0,
|
|
16786
16808
|
offsetY: Oi = 0,
|
|
16787
16809
|
dontFlip: dl = !1
|
|
16788
16810
|
}) {
|
|
16789
|
-
this.viewBox =
|
|
16790
|
-
const ur = (
|
|
16811
|
+
this.viewBox = Fr, this.scale = sr, this.rotation = As, this.offsetX = Si, this.offsetY = Oi;
|
|
16812
|
+
const ur = (Fr[2] + Fr[0]) / 2, Dt = (Fr[3] + Fr[1]) / 2;
|
|
16791
16813
|
let ot, Un, St, Xn;
|
|
16792
16814
|
switch (As %= 360, As < 0 && (As += 360), As) {
|
|
16793
16815
|
case 180:
|
|
@@ -16807,10 +16829,10 @@ function requirePdf() {
|
|
|
16807
16829
|
}
|
|
16808
16830
|
dl && (St = -St, Xn = -Xn);
|
|
16809
16831
|
let Gn, me, kt, Lt;
|
|
16810
|
-
ot === 0 ? (Gn = Math.abs(Dt -
|
|
16832
|
+
ot === 0 ? (Gn = Math.abs(Dt - Fr[1]) * sr + Si, me = Math.abs(ur - Fr[0]) * sr + Oi, kt = Math.abs(Fr[3] - Fr[1]) * sr, Lt = Math.abs(Fr[2] - Fr[0]) * sr) : (Gn = Math.abs(ur - Fr[0]) * sr + Si, me = Math.abs(Dt - Fr[1]) * sr + Oi, kt = Math.abs(Fr[2] - Fr[0]) * sr, Lt = Math.abs(Fr[3] - Fr[1]) * sr), this.transform = [ot * sr, Un * sr, St * sr, Xn * sr, Gn - ot * sr * ur - St * sr * Dt, me - Un * sr * ur - Xn * sr * Dt], this.width = kt, this.height = Lt;
|
|
16811
16833
|
}
|
|
16812
16834
|
clone({
|
|
16813
|
-
scale:
|
|
16835
|
+
scale: Fr = this.scale,
|
|
16814
16836
|
rotation: sr = this.rotation,
|
|
16815
16837
|
offsetX: As = this.offsetX,
|
|
16816
16838
|
offsetY: Si = this.offsetY,
|
|
@@ -16818,75 +16840,75 @@ function requirePdf() {
|
|
|
16818
16840
|
} = {}) {
|
|
16819
16841
|
return new Le({
|
|
16820
16842
|
viewBox: this.viewBox.slice(),
|
|
16821
|
-
scale:
|
|
16843
|
+
scale: Fr,
|
|
16822
16844
|
rotation: sr,
|
|
16823
16845
|
offsetX: As,
|
|
16824
16846
|
offsetY: Si,
|
|
16825
16847
|
dontFlip: Oi
|
|
16826
16848
|
});
|
|
16827
16849
|
}
|
|
16828
|
-
convertToViewportPoint(
|
|
16829
|
-
return s.Util.applyTransform([
|
|
16850
|
+
convertToViewportPoint(Fr, sr) {
|
|
16851
|
+
return s.Util.applyTransform([Fr, sr], this.transform);
|
|
16830
16852
|
}
|
|
16831
|
-
convertToViewportRectangle(
|
|
16832
|
-
const sr = s.Util.applyTransform([
|
|
16853
|
+
convertToViewportRectangle(Fr) {
|
|
16854
|
+
const sr = s.Util.applyTransform([Fr[0], Fr[1]], this.transform), As = s.Util.applyTransform([Fr[2], Fr[3]], this.transform);
|
|
16833
16855
|
return [sr[0], sr[1], As[0], As[1]];
|
|
16834
16856
|
}
|
|
16835
|
-
convertToPdfPoint(
|
|
16836
|
-
return s.Util.applyInverseTransform([
|
|
16857
|
+
convertToPdfPoint(Fr, sr) {
|
|
16858
|
+
return s.Util.applyInverseTransform([Fr, sr], this.transform);
|
|
16837
16859
|
}
|
|
16838
16860
|
}
|
|
16839
16861
|
t.PageViewport = Le;
|
|
16840
16862
|
class E extends s.BaseException {
|
|
16841
|
-
constructor(
|
|
16842
|
-
super(
|
|
16863
|
+
constructor(Fr, sr) {
|
|
16864
|
+
super(Fr, "RenderingCancelledException"), this.type = sr;
|
|
16843
16865
|
}
|
|
16844
16866
|
}
|
|
16845
16867
|
t.RenderingCancelledException = E;
|
|
16846
|
-
function u(
|
|
16847
|
-
const
|
|
16868
|
+
function u(Ar) {
|
|
16869
|
+
const Fr = Ar.length;
|
|
16848
16870
|
let sr = 0;
|
|
16849
|
-
for (; sr <
|
|
16871
|
+
for (; sr < Fr && Ar[sr].trim() === ""; )
|
|
16850
16872
|
sr++;
|
|
16851
|
-
return
|
|
16873
|
+
return Ar.substring(sr, sr + 5).toLowerCase() === "data:";
|
|
16852
16874
|
}
|
|
16853
|
-
function o(
|
|
16854
|
-
return typeof
|
|
16875
|
+
function o(Ar) {
|
|
16876
|
+
return typeof Ar == "string" && /\.pdf$/i.test(Ar);
|
|
16855
16877
|
}
|
|
16856
|
-
function pe(
|
|
16857
|
-
const
|
|
16858
|
-
return
|
|
16878
|
+
function pe(Ar) {
|
|
16879
|
+
const Fr = Ar.indexOf("#"), sr = Ar.indexOf("?"), As = Math.min(Fr > 0 ? Fr : Ar.length, sr > 0 ? sr : Ar.length);
|
|
16880
|
+
return Ar.substring(Ar.lastIndexOf("/", As) + 1, As);
|
|
16859
16881
|
}
|
|
16860
|
-
function st(
|
|
16861
|
-
if (typeof
|
|
16862
|
-
return
|
|
16863
|
-
if (u(
|
|
16864
|
-
return (0, s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),
|
|
16865
|
-
const sr = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, As = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Si = sr.exec(
|
|
16882
|
+
function st(Ar, Fr = "document.pdf") {
|
|
16883
|
+
if (typeof Ar != "string")
|
|
16884
|
+
return Fr;
|
|
16885
|
+
if (u(Ar))
|
|
16886
|
+
return (0, s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), Fr;
|
|
16887
|
+
const sr = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, As = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Si = sr.exec(Ar);
|
|
16866
16888
|
let Oi = As.exec(Si[1]) || As.exec(Si[2]) || As.exec(Si[3]);
|
|
16867
16889
|
if (Oi && (Oi = Oi[0], Oi.includes("%")))
|
|
16868
16890
|
try {
|
|
16869
16891
|
Oi = As.exec(decodeURIComponent(Oi))[0];
|
|
16870
16892
|
} catch {
|
|
16871
16893
|
}
|
|
16872
|
-
return Oi ||
|
|
16894
|
+
return Oi || Fr;
|
|
16873
16895
|
}
|
|
16874
16896
|
class nt {
|
|
16875
16897
|
constructor() {
|
|
16876
16898
|
this.started = /* @__PURE__ */ Object.create(null), this.times = [];
|
|
16877
16899
|
}
|
|
16878
|
-
time(
|
|
16879
|
-
|
|
16900
|
+
time(Fr) {
|
|
16901
|
+
Fr in this.started && (0, s.warn)(`Timer is already running for ${Fr}`), this.started[Fr] = Date.now();
|
|
16880
16902
|
}
|
|
16881
|
-
timeEnd(
|
|
16882
|
-
|
|
16883
|
-
name:
|
|
16884
|
-
start: this.started[
|
|
16903
|
+
timeEnd(Fr) {
|
|
16904
|
+
Fr in this.started || (0, s.warn)(`Timer has not been started for ${Fr}`), this.times.push({
|
|
16905
|
+
name: Fr,
|
|
16906
|
+
start: this.started[Fr],
|
|
16885
16907
|
end: Date.now()
|
|
16886
|
-
}), delete this.started[
|
|
16908
|
+
}), delete this.started[Fr];
|
|
16887
16909
|
}
|
|
16888
16910
|
toString() {
|
|
16889
|
-
const
|
|
16911
|
+
const Fr = [];
|
|
16890
16912
|
let sr = 0;
|
|
16891
16913
|
for (const As of this.times) {
|
|
16892
16914
|
const Si = As.name;
|
|
@@ -16894,43 +16916,43 @@ function requirePdf() {
|
|
|
16894
16916
|
}
|
|
16895
16917
|
for (const As of this.times) {
|
|
16896
16918
|
const Si = As.end - As.start;
|
|
16897
|
-
|
|
16919
|
+
Fr.push(`${As.name.padEnd(sr)} ${Si}ms
|
|
16898
16920
|
`);
|
|
16899
16921
|
}
|
|
16900
|
-
return
|
|
16922
|
+
return Fr.join("");
|
|
16901
16923
|
}
|
|
16902
16924
|
}
|
|
16903
16925
|
t.StatTimer = nt;
|
|
16904
|
-
function Ye(
|
|
16926
|
+
function Ye(Ar, Fr) {
|
|
16905
16927
|
try {
|
|
16906
16928
|
const {
|
|
16907
16929
|
protocol: sr
|
|
16908
|
-
} =
|
|
16930
|
+
} = Fr ? new URL(Ar, Fr) : new URL(Ar);
|
|
16909
16931
|
return sr === "http:" || sr === "https:";
|
|
16910
16932
|
} catch {
|
|
16911
16933
|
return !1;
|
|
16912
16934
|
}
|
|
16913
16935
|
}
|
|
16914
|
-
function N(
|
|
16936
|
+
function N(Ar, Fr = !1) {
|
|
16915
16937
|
return new Promise((sr, As) => {
|
|
16916
16938
|
const Si = document.createElement("script");
|
|
16917
|
-
Si.src =
|
|
16918
|
-
|
|
16939
|
+
Si.src = Ar, Si.onload = function(Oi) {
|
|
16940
|
+
Fr && Si.remove(), sr(Oi);
|
|
16919
16941
|
}, Si.onerror = function() {
|
|
16920
16942
|
As(new Error(`Cannot load script at: ${Si.src}`));
|
|
16921
16943
|
}, (document.head || document.documentElement).append(Si);
|
|
16922
16944
|
});
|
|
16923
16945
|
}
|
|
16924
|
-
function P(
|
|
16925
|
-
console.log("Deprecated API usage: " +
|
|
16946
|
+
function P(Ar) {
|
|
16947
|
+
console.log("Deprecated API usage: " + Ar);
|
|
16926
16948
|
}
|
|
16927
16949
|
let p;
|
|
16928
16950
|
class mt {
|
|
16929
|
-
static toDateObject(
|
|
16930
|
-
if (!
|
|
16951
|
+
static toDateObject(Fr) {
|
|
16952
|
+
if (!Fr || typeof Fr != "string")
|
|
16931
16953
|
return null;
|
|
16932
16954
|
p || (p = new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
|
|
16933
|
-
const sr = p.exec(
|
|
16955
|
+
const sr = p.exec(Fr);
|
|
16934
16956
|
if (!sr)
|
|
16935
16957
|
return null;
|
|
16936
16958
|
const As = parseInt(sr[1], 10);
|
|
@@ -16952,58 +16974,58 @@ function requirePdf() {
|
|
|
16952
16974
|
}
|
|
16953
16975
|
}
|
|
16954
16976
|
t.PDFDateString = mt;
|
|
16955
|
-
function It(
|
|
16956
|
-
scale:
|
|
16977
|
+
function It(Ar, {
|
|
16978
|
+
scale: Fr = 1,
|
|
16957
16979
|
rotation: sr = 0
|
|
16958
16980
|
}) {
|
|
16959
16981
|
const {
|
|
16960
16982
|
width: As,
|
|
16961
16983
|
height: Si
|
|
16962
|
-
} =
|
|
16984
|
+
} = Ar.attributes.style, Oi = [0, 0, parseInt(As), parseInt(Si)];
|
|
16963
16985
|
return new Le({
|
|
16964
16986
|
viewBox: Oi,
|
|
16965
|
-
scale:
|
|
16987
|
+
scale: Fr,
|
|
16966
16988
|
rotation: sr
|
|
16967
16989
|
});
|
|
16968
16990
|
}
|
|
16969
|
-
function Zn(
|
|
16970
|
-
if (
|
|
16971
|
-
const
|
|
16972
|
-
return [(
|
|
16991
|
+
function Zn(Ar) {
|
|
16992
|
+
if (Ar.startsWith("#")) {
|
|
16993
|
+
const Fr = parseInt(Ar.slice(1), 16);
|
|
16994
|
+
return [(Fr & 16711680) >> 16, (Fr & 65280) >> 8, Fr & 255];
|
|
16973
16995
|
}
|
|
16974
|
-
return
|
|
16996
|
+
return Ar.startsWith("rgb(") ? Ar.slice(4, -1).split(",").map((Fr) => parseInt(Fr)) : Ar.startsWith("rgba(") ? Ar.slice(5, -1).split(",").map((Fr) => parseInt(Fr)).slice(0, 3) : ((0, s.warn)(`Not a valid color format: "${Ar}"`), [0, 0, 0]);
|
|
16975
16997
|
}
|
|
16976
|
-
function Kn(
|
|
16977
|
-
const
|
|
16978
|
-
|
|
16979
|
-
for (const sr of
|
|
16980
|
-
|
|
16981
|
-
const As = window.getComputedStyle(
|
|
16982
|
-
|
|
16983
|
-
}
|
|
16984
|
-
|
|
16998
|
+
function Kn(Ar) {
|
|
16999
|
+
const Fr = document.createElement("span");
|
|
17000
|
+
Fr.style.visibility = "hidden", document.body.append(Fr);
|
|
17001
|
+
for (const sr of Ar.keys()) {
|
|
17002
|
+
Fr.style.color = sr;
|
|
17003
|
+
const As = window.getComputedStyle(Fr).color;
|
|
17004
|
+
Ar.set(sr, Zn(As));
|
|
17005
|
+
}
|
|
17006
|
+
Fr.remove();
|
|
16985
17007
|
}
|
|
16986
|
-
function Is(
|
|
17008
|
+
function Is(Ar) {
|
|
16987
17009
|
const {
|
|
16988
|
-
a:
|
|
17010
|
+
a: Fr,
|
|
16989
17011
|
b: sr,
|
|
16990
17012
|
c: As,
|
|
16991
17013
|
d: Si,
|
|
16992
17014
|
e: Oi,
|
|
16993
17015
|
f: dl
|
|
16994
|
-
} =
|
|
16995
|
-
return [
|
|
17016
|
+
} = Ar.getTransform();
|
|
17017
|
+
return [Fr, sr, As, Si, Oi, dl];
|
|
16996
17018
|
}
|
|
16997
|
-
function qs(
|
|
17019
|
+
function qs(Ar) {
|
|
16998
17020
|
const {
|
|
16999
|
-
a:
|
|
17021
|
+
a: Fr,
|
|
17000
17022
|
b: sr,
|
|
17001
17023
|
c: As,
|
|
17002
17024
|
d: Si,
|
|
17003
17025
|
e: Oi,
|
|
17004
17026
|
f: dl
|
|
17005
|
-
} =
|
|
17006
|
-
return [
|
|
17027
|
+
} = Ar.getTransform().invertSelf();
|
|
17028
|
+
return [Fr, sr, As, Si, Oi, dl];
|
|
17007
17029
|
}
|
|
17008
17030
|
},
|
|
17009
17031
|
/* 9 */
|
|
@@ -17274,28 +17296,28 @@ function requirePdf() {
|
|
|
17274
17296
|
return (0, r.shadow)(this, "_loadTestFont", h());
|
|
17275
17297
|
}
|
|
17276
17298
|
_prepareFontLoadEvent(h, l, b) {
|
|
17277
|
-
function tt(qs,
|
|
17278
|
-
return qs.charCodeAt(
|
|
17299
|
+
function tt(qs, Ur) {
|
|
17300
|
+
return qs.charCodeAt(Ur) << 24 | qs.charCodeAt(Ur + 1) << 16 | qs.charCodeAt(Ur + 2) << 8 | qs.charCodeAt(Ur + 3) & 255;
|
|
17279
17301
|
}
|
|
17280
|
-
function de(qs,
|
|
17281
|
-
const sr = qs.substring(0,
|
|
17282
|
-
return sr +
|
|
17302
|
+
function de(qs, Ur, Ar, Fr) {
|
|
17303
|
+
const sr = qs.substring(0, Ur), As = qs.substring(Ur + Ar);
|
|
17304
|
+
return sr + Fr + As;
|
|
17283
17305
|
}
|
|
17284
17306
|
let Le, E;
|
|
17285
17307
|
const u = this._document.createElement("canvas");
|
|
17286
17308
|
u.width = 1, u.height = 1;
|
|
17287
17309
|
const o = u.getContext("2d");
|
|
17288
17310
|
let pe = 0;
|
|
17289
|
-
function st(qs,
|
|
17311
|
+
function st(qs, Ur) {
|
|
17290
17312
|
if (pe++, pe > 30) {
|
|
17291
|
-
(0, r.warn)("Load test font never loaded."),
|
|
17313
|
+
(0, r.warn)("Load test font never loaded."), Ur();
|
|
17292
17314
|
return;
|
|
17293
17315
|
}
|
|
17294
17316
|
if (o.font = "30px " + qs, o.fillText(".", 0, 20), o.getImageData(0, 0, 1, 1).data[3] > 0) {
|
|
17295
|
-
|
|
17317
|
+
Ur();
|
|
17296
17318
|
return;
|
|
17297
17319
|
}
|
|
17298
|
-
setTimeout(st.bind(null, qs,
|
|
17320
|
+
setTimeout(st.bind(null, qs, Ur));
|
|
17299
17321
|
}
|
|
17300
17322
|
const nt = `lt${Date.now()}${this.loadTestFontId++}`;
|
|
17301
17323
|
let Ye = this._loadTestFont;
|
|
@@ -17314,8 +17336,8 @@ function requirePdf() {
|
|
|
17314
17336
|
const Is = this._document.createElement("div");
|
|
17315
17337
|
Is.style.visibility = "hidden", Is.style.width = Is.style.height = "10px", Is.style.position = "absolute", Is.style.top = Is.style.left = "0px";
|
|
17316
17338
|
for (const qs of Kn) {
|
|
17317
|
-
const
|
|
17318
|
-
|
|
17339
|
+
const Ur = this._document.createElement("span");
|
|
17340
|
+
Ur.textContent = "Hi", Ur.style.fontFamily = qs, Is.append(Ur);
|
|
17319
17341
|
}
|
|
17320
17342
|
this._document.body.append(Is), st(nt, () => {
|
|
17321
17343
|
Is.remove(), b.complete();
|
|
@@ -17458,14 +17480,14 @@ function requirePdf() {
|
|
|
17458
17480
|
}
|
|
17459
17481
|
}
|
|
17460
17482
|
function pe(ur, Dt, ot, Un, St, Xn, Gn, me, kt, Lt) {
|
|
17461
|
-
const [zt, ln, nr, Yn, un,
|
|
17483
|
+
const [zt, ln, nr, Yn, un, Br] = (0, r.getCurrentTransform)(ur);
|
|
17462
17484
|
if (ln === 0 && nr === 0) {
|
|
17463
|
-
const Pi = Gn * zt + un, ji = Math.round(Pi), _a = me * Yn +
|
|
17464
|
-
return ur.setTransform(Math.sign(zt), 0, 0, Math.sign(Yn), ji, vl), ur.drawImage(Dt, ot, Un, St, Xn, 0, 0, Fl, wl), ur.setTransform(zt, ln, nr, Yn, un,
|
|
17485
|
+
const Pi = Gn * zt + un, ji = Math.round(Pi), _a = me * Yn + Br, vl = Math.round(_a), Ha = (Gn + kt) * zt + un, Fl = Math.abs(Math.round(Ha) - ji) || 1, Al = (me + Lt) * Yn + Br, wl = Math.abs(Math.round(Al) - vl) || 1;
|
|
17486
|
+
return ur.setTransform(Math.sign(zt), 0, 0, Math.sign(Yn), ji, vl), ur.drawImage(Dt, ot, Un, St, Xn, 0, 0, Fl, wl), ur.setTransform(zt, ln, nr, Yn, un, Br), [Fl, wl];
|
|
17465
17487
|
}
|
|
17466
17488
|
if (zt === 0 && Yn === 0) {
|
|
17467
|
-
const Pi = me * nr + un, ji = Math.round(Pi), _a = Gn * ln +
|
|
17468
|
-
return ur.setTransform(0, Math.sign(ln), Math.sign(nr), 0, ji, vl), ur.drawImage(Dt, ot, Un, St, Xn, 0, 0, wl, Fl), ur.setTransform(zt, ln, nr, Yn, un,
|
|
17489
|
+
const Pi = me * nr + un, ji = Math.round(Pi), _a = Gn * ln + Br, vl = Math.round(_a), Ha = (me + Lt) * nr + un, Fl = Math.abs(Math.round(Ha) - ji) || 1, Al = (Gn + kt) * ln + Br, wl = Math.abs(Math.round(Al) - vl) || 1;
|
|
17490
|
+
return ur.setTransform(0, Math.sign(ln), Math.sign(nr), 0, ji, vl), ur.drawImage(Dt, ot, Un, St, Xn, 0, 0, wl, Fl), ur.setTransform(zt, ln, nr, Yn, un, Br), [wl, Fl];
|
|
17469
17491
|
}
|
|
17470
17492
|
ur.drawImage(Dt, ot, Un, St, Xn, Gn, me, kt, Lt);
|
|
17471
17493
|
const Ni = Math.hypot(zt, ln), ki = Math.hypot(nr, Yn);
|
|
@@ -17502,7 +17524,7 @@ function requirePdf() {
|
|
|
17502
17524
|
ln[nr] !== ln[nr + 1] && (Gn[Lt + kt] = ln[nr] ? 4 : 8, ++Yn), nr++;
|
|
17503
17525
|
if (ln[nr] !== 0 && (Gn[Lt + kt] = 4, ++Yn), Yn > Un)
|
|
17504
17526
|
return null;
|
|
17505
|
-
const un = new Int32Array([0, Xn, -1, 0, -Xn, 0, 0, 0, 1]),
|
|
17527
|
+
const un = new Int32Array([0, Xn, -1, 0, -Xn, 0, 0, 0, 1]), Br = new Path2D();
|
|
17506
17528
|
for (me = 0; Yn && me <= ot; me++) {
|
|
17507
17529
|
let ki = me * Xn;
|
|
17508
17530
|
const Pi = ki + Dt;
|
|
@@ -17510,7 +17532,7 @@ function requirePdf() {
|
|
|
17510
17532
|
ki++;
|
|
17511
17533
|
if (ki === Pi)
|
|
17512
17534
|
continue;
|
|
17513
|
-
|
|
17535
|
+
Br.moveTo(ki % Xn, me);
|
|
17514
17536
|
const ji = ki;
|
|
17515
17537
|
let _a = Gn[ki];
|
|
17516
17538
|
do {
|
|
@@ -17519,12 +17541,12 @@ function requirePdf() {
|
|
|
17519
17541
|
ki += vl;
|
|
17520
17542
|
while (!Gn[ki]);
|
|
17521
17543
|
const Ha = Gn[ki];
|
|
17522
|
-
Ha !== 5 && Ha !== 10 ? (_a = Ha, Gn[ki] = 0) : (_a = Ha & 51 * _a >> 4, Gn[ki] &= _a >> 2 | _a << 2),
|
|
17544
|
+
Ha !== 5 && Ha !== 10 ? (_a = Ha, Gn[ki] = 0) : (_a = Ha & 51 * _a >> 4, Gn[ki] &= _a >> 2 | _a << 2), Br.lineTo(ki % Xn, ki / Xn | 0), Gn[ki] || --Yn;
|
|
17523
17545
|
} while (ji !== ki);
|
|
17524
17546
|
--me;
|
|
17525
17547
|
}
|
|
17526
17548
|
return ln = null, Gn = null, function(ki) {
|
|
17527
|
-
ki.save(), ki.scale(1 / Dt, -1 / ot), ki.translate(0, -ot), ki.fill(
|
|
17549
|
+
ki.save(), ki.scale(1 / Dt, -1 / ot), ki.translate(0, -ot), ki.fill(Br), ki.beginPath(), ki.restore();
|
|
17528
17550
|
};
|
|
17529
17551
|
}
|
|
17530
17552
|
class nt {
|
|
@@ -17587,7 +17609,7 @@ function requirePdf() {
|
|
|
17587
17609
|
const Un = Dt.height, St = Dt.width, Xn = Un % E, Gn = (Un - Xn) / E, me = Xn === 0 ? Gn : Gn + 1, kt = ur.createImageData(St, E);
|
|
17588
17610
|
let Lt = 0, zt;
|
|
17589
17611
|
const ln = Dt.data, nr = kt.data;
|
|
17590
|
-
let Yn, un,
|
|
17612
|
+
let Yn, un, Br, Ni, ki, Pi, ji, _a;
|
|
17591
17613
|
if (ot)
|
|
17592
17614
|
switch (ot.length) {
|
|
17593
17615
|
case 1:
|
|
@@ -17601,7 +17623,7 @@ function requirePdf() {
|
|
|
17601
17623
|
const vl = ln.byteLength, Ha = new Uint32Array(nr.buffer, 0, nr.byteLength >> 2), Fl = Ha.length, Al = St + 7 >> 3;
|
|
17602
17624
|
let wl = 4294967295, xl = s.FeatureTest.isLittleEndian ? 4278190080 : 255;
|
|
17603
17625
|
for (_a && _a[0] === 255 && _a[255] === 0 && ([wl, xl] = [xl, wl]), Yn = 0; Yn < me; Yn++) {
|
|
17604
|
-
for (
|
|
17626
|
+
for (Br = Yn < Gn ? E : Xn, zt = 0, un = 0; un < Br; un++) {
|
|
17605
17627
|
const Ol = vl - Lt;
|
|
17606
17628
|
let fg = 0;
|
|
17607
17629
|
const Rl = Ol > Al ? St : Ol * 8 - 7, lg = Rl & -8;
|
|
@@ -17631,8 +17653,8 @@ function requirePdf() {
|
|
|
17631
17653
|
}
|
|
17632
17654
|
} else if (Dt.kind === s.ImageKind.RGB_24BPP) {
|
|
17633
17655
|
const vl = !!(ki || Pi || ji);
|
|
17634
|
-
for (
|
|
17635
|
-
for (Yn >= Gn && (
|
|
17656
|
+
for (Br = E, Ni = St * Br, Yn = 0; Yn < me; Yn++) {
|
|
17657
|
+
for (Yn >= Gn && (Br = Xn, Ni = St * Br), zt = 0, un = Ni; un--; )
|
|
17636
17658
|
nr[zt++] = ln[Lt++], nr[zt++] = ln[Lt++], nr[zt++] = ln[Lt++], nr[zt++] = 255;
|
|
17637
17659
|
if (vl)
|
|
17638
17660
|
for (let Ha = 0; Ha < zt; Ha += 4)
|
|
@@ -17702,12 +17724,12 @@ function requirePdf() {
|
|
|
17702
17724
|
}
|
|
17703
17725
|
function Kn(ur, Dt, ot, Un, St, Xn, Gn, me, kt, Lt, zt) {
|
|
17704
17726
|
const ln = !!Xn, nr = ln ? Xn[0] : 0, Yn = ln ? Xn[1] : 0, un = ln ? Xn[2] : 0;
|
|
17705
|
-
let
|
|
17706
|
-
St === "Luminosity" ?
|
|
17727
|
+
let Br;
|
|
17728
|
+
St === "Luminosity" ? Br = Zn : Br = It;
|
|
17707
17729
|
const ki = Math.min(Un, Math.ceil(1048576 / ot));
|
|
17708
17730
|
for (let Pi = 0; Pi < Un; Pi += ki) {
|
|
17709
17731
|
const ji = Math.min(ki, Un - Pi), _a = ur.getImageData(me - Lt, Pi + (kt - zt), ot, ji), vl = Dt.getImageData(me, Pi + kt, ot, ji);
|
|
17710
|
-
ln && mt(_a.data, nr, Yn, un),
|
|
17732
|
+
ln && mt(_a.data, nr, Yn, un), Br(_a.data, vl.data, Gn), Dt.putImageData(vl, me, Pi + kt);
|
|
17711
17733
|
}
|
|
17712
17734
|
}
|
|
17713
17735
|
function Is(ur, Dt, ot, Un) {
|
|
@@ -17720,7 +17742,7 @@ function requirePdf() {
|
|
|
17720
17742
|
const Un = Math.fround((globalThis.devicePixelRatio || 1) * r.PixelsPerInch.PDF_TO_CSS_UNITS);
|
|
17721
17743
|
return Dt !== void 0 ? Dt : ot[0] <= Un || ot[1] <= Un;
|
|
17722
17744
|
}
|
|
17723
|
-
const
|
|
17745
|
+
const Ur = ["butt", "round", "square"], Ar = ["miter", "round", "bevel"], Fr = {}, sr = {}, dl = class dl {
|
|
17724
17746
|
constructor(Dt, ot, Un, St, Xn, Gn, me, kt) {
|
|
17725
17747
|
bl(this, Si);
|
|
17726
17748
|
this.ctx = Dt, this.current = new nt(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = ot, this.objs = Un, this.canvasFactory = St, this.imageLayer = Xn, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = [], this.optionalContentConfig = Gn, this.cachedCanvases = new o(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = me, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.backgroundColor = (kt == null ? void 0 : kt.background) || null, this.foregroundColor = (kt == null ? void 0 : kt.foreground) || null, this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
|
|
@@ -17744,9 +17766,9 @@ function requirePdf() {
|
|
|
17744
17766
|
if (this.ctx.fillStyle = me, ln = this.ctx.fillStyle, zt = typeof ln == "string" && /^#[0-9A-Fa-f]{6}$/.test(ln), kt === "#000000" && Lt === "#ffffff" || kt === Lt || !zt)
|
|
17745
17767
|
this.foregroundColor = this.backgroundColor = null;
|
|
17746
17768
|
else {
|
|
17747
|
-
const [nr, Yn, un] = (0, r.getRGB)(ln),
|
|
17769
|
+
const [nr, Yn, un] = (0, r.getRGB)(ln), Br = (ki) => (ki /= 255, ki <= 0.03928 ? ki / 12.92 : ((ki + 0.055) / 1.055) ** 2.4), Ni = Math.round(0.2126 * Br(nr) + 0.7152 * Br(Yn) + 0.0722 * Br(un));
|
|
17748
17770
|
this.selectColor = (ki, Pi, ji) => {
|
|
17749
|
-
const _a = 0.2126 *
|
|
17771
|
+
const _a = 0.2126 * Br(ki) + 0.7152 * Br(Pi) + 0.0722 * Br(ji);
|
|
17750
17772
|
return Math.round(_a) === Ni ? Lt : kt;
|
|
17751
17773
|
};
|
|
17752
17774
|
}
|
|
@@ -17773,10 +17795,10 @@ function requirePdf() {
|
|
|
17773
17795
|
if (un = Gn[me], un !== s.OPS.dependency)
|
|
17774
17796
|
this[un].apply(this, Xn[me]);
|
|
17775
17797
|
else
|
|
17776
|
-
for (const
|
|
17777
|
-
const Ni =
|
|
17778
|
-
if (!Ni.has(
|
|
17779
|
-
return Ni.get(
|
|
17798
|
+
for (const Br of Xn[me]) {
|
|
17799
|
+
const Ni = Br.startsWith("g_") ? nr : Yn;
|
|
17800
|
+
if (!Ni.has(Br))
|
|
17801
|
+
return Ni.get(Br, Un), me;
|
|
17780
17802
|
}
|
|
17781
17803
|
if (me++, me === kt)
|
|
17782
17804
|
return me;
|
|
@@ -17832,7 +17854,7 @@ function requirePdf() {
|
|
|
17832
17854
|
zt || (ln = this.cachedCanvases.getCanvas("maskCanvas", Un, St), N(ln.context, Dt));
|
|
17833
17855
|
let nr = s.Util.transform(me, [1 / Un, 0, 0, -1 / St, 0, 0]);
|
|
17834
17856
|
nr = s.Util.transform(nr, [1, 0, 0, 1, 0, -St]);
|
|
17835
|
-
const Yn = s.Util.applyTransform([0, 0], nr), un = s.Util.applyTransform([Un, St], nr),
|
|
17857
|
+
const Yn = s.Util.applyTransform([0, 0], nr), un = s.Util.applyTransform([Un, St], nr), Br = s.Util.normalizeRect([Yn[0], Yn[1], un[0], un[1]]), Ni = Math.round(Br[2] - Br[0]) || 1, ki = Math.round(Br[3] - Br[1]) || 1, Pi = this.cachedCanvases.getCanvas("fillCanvas", Ni, ki), ji = Pi.context, _a = Math.min(Yn[0], un[0]), vl = Math.min(Yn[1], un[1]);
|
|
17836
17858
|
ji.translate(-_a, -vl), ji.transform(...nr), zt || (zt = this._scaleImage(ln.canvas, (0, r.getCurrentTransformInverse)(ji)), zt = zt.img, kt && Gn && kt.set(Lt, zt)), ji.imageSmoothingEnabled = qs((0, r.getCurrentTransform)(ji), Dt.interpolate), pe(ji, zt, 0, 0, zt.width, zt.height, 0, 0, Un, St), ji.globalCompositeOperation = "source-in";
|
|
17837
17859
|
const Ha = s.Util.transform((0, r.getCurrentTransformInverse)(ji), [1, 0, 0, 1, -_a, -vl]);
|
|
17838
17860
|
return ji.fillStyle = Gn ? Xn.getPattern(ot, this, Ha, i.PathType.FILL) : Xn, ji.fillRect(0, 0, Un, St), kt && !Gn && (this.cachedCanvases.delete("fillCanvas"), kt.set(Lt, Pi.canvas)), {
|
|
@@ -17845,10 +17867,10 @@ function requirePdf() {
|
|
|
17845
17867
|
Dt !== this.current.lineWidth && (this._cachedScaleForStroking = null), this.current.lineWidth = Dt, this.ctx.lineWidth = Dt;
|
|
17846
17868
|
}
|
|
17847
17869
|
setLineCap(Dt) {
|
|
17848
|
-
this.ctx.lineCap =
|
|
17870
|
+
this.ctx.lineCap = Ur[Dt];
|
|
17849
17871
|
}
|
|
17850
17872
|
setLineJoin(Dt) {
|
|
17851
|
-
this.ctx.lineJoin =
|
|
17873
|
+
this.ctx.lineJoin = Ar[Dt];
|
|
17852
17874
|
}
|
|
17853
17875
|
setMiterLimit(Dt) {
|
|
17854
17876
|
this.ctx.miterLimit = Dt;
|
|
@@ -17948,7 +17970,7 @@ function requirePdf() {
|
|
|
17948
17970
|
const St = this.ctx, Xn = this.current;
|
|
17949
17971
|
let Gn = Xn.x, me = Xn.y, kt, Lt;
|
|
17950
17972
|
const zt = (0, r.getCurrentTransform)(St), ln = zt[0] === 0 && zt[3] === 0 || zt[1] === 0 && zt[2] === 0, nr = ln ? Un.slice(0) : null;
|
|
17951
|
-
for (let Yn = 0, un = 0,
|
|
17973
|
+
for (let Yn = 0, un = 0, Br = Dt.length; Yn < Br; Yn++)
|
|
17952
17974
|
switch (Dt[Yn] | 0) {
|
|
17953
17975
|
case s.OPS.rectangle:
|
|
17954
17976
|
Gn = ot[un++], me = ot[un++];
|
|
@@ -18014,7 +18036,7 @@ function requirePdf() {
|
|
|
18014
18036
|
this.consumePath();
|
|
18015
18037
|
}
|
|
18016
18038
|
clip() {
|
|
18017
|
-
this.pendingClip =
|
|
18039
|
+
this.pendingClip = Fr;
|
|
18018
18040
|
}
|
|
18019
18041
|
eoClip() {
|
|
18020
18042
|
this.pendingClip = sr;
|
|
@@ -18108,7 +18130,7 @@ function requirePdf() {
|
|
|
18108
18130
|
const St = ot.fontSize;
|
|
18109
18131
|
if (St === 0)
|
|
18110
18132
|
return;
|
|
18111
|
-
const Xn = this.ctx, Gn = ot.fontSizeScale, me = ot.charSpacing, kt = ot.wordSpacing, Lt = ot.fontDirection, zt = ot.textHScale * Lt, ln = Dt.length, nr = Un.vertical, Yn = nr ? 1 : -1, un = Un.defaultVMetrics,
|
|
18133
|
+
const Xn = this.ctx, Gn = ot.fontSizeScale, me = ot.charSpacing, kt = ot.wordSpacing, Lt = ot.fontDirection, zt = ot.textHScale * Lt, ln = Dt.length, nr = Un.vertical, Yn = nr ? 1 : -1, un = Un.defaultVMetrics, Br = St * ot.fontMatrix[0], Ni = ot.textRenderingMode === s.TextRenderingMode.FILL && !Un.disableFontFace && !ot.patternFill;
|
|
18112
18134
|
Xn.save(), Xn.transform(...ot.textMatrix), Xn.translate(ot.x, ot.y + ot.textRise), Lt > 0 ? Xn.scale(zt, -1) : Xn.scale(zt, 1);
|
|
18113
18135
|
let ki;
|
|
18114
18136
|
if (ot.patternFill) {
|
|
@@ -18135,7 +18157,7 @@ function requirePdf() {
|
|
|
18135
18157
|
const Al = (Ha.isSpace ? kt : 0) + me, wl = Ha.fontChar, xl = Ha.accent;
|
|
18136
18158
|
let Ol, fg, Rl = Ha.width;
|
|
18137
18159
|
if (nr) {
|
|
18138
|
-
const hl = Ha.vmetric || un, gl = -(Ha.vmetric ? hl[1] : Rl * 0.5) *
|
|
18160
|
+
const hl = Ha.vmetric || un, gl = -(Ha.vmetric ? hl[1] : Rl * 0.5) * Br, Bl = hl[2] * Br;
|
|
18139
18161
|
Rl = hl ? -hl[0] : Rl, Ol = gl / Gn, fg = (_a + Bl) / Gn;
|
|
18140
18162
|
} else
|
|
18141
18163
|
Ol = _a / Gn, fg = 0;
|
|
@@ -18155,25 +18177,25 @@ function requirePdf() {
|
|
|
18155
18177
|
}
|
|
18156
18178
|
}
|
|
18157
18179
|
let lg;
|
|
18158
|
-
nr ? lg = Rl *
|
|
18180
|
+
nr ? lg = Rl * Br - Al * Lt : lg = Rl * Br + Al * Lt, _a += lg, Fl && Xn.restore();
|
|
18159
18181
|
}
|
|
18160
18182
|
nr ? ot.y -= _a : ot.x += _a * zt, Xn.restore(), this.compose();
|
|
18161
18183
|
}
|
|
18162
18184
|
showType3Text(Dt) {
|
|
18163
18185
|
const ot = this.ctx, Un = this.current, St = Un.font, Xn = Un.fontSize, Gn = Un.fontDirection, me = St.vertical ? 1 : -1, kt = Un.charSpacing, Lt = Un.wordSpacing, zt = Un.textHScale * Gn, ln = Un.fontMatrix || s.FONT_IDENTITY_MATRIX, nr = Dt.length, Yn = Un.textRenderingMode === s.TextRenderingMode.INVISIBLE;
|
|
18164
|
-
let un,
|
|
18186
|
+
let un, Br, Ni, ki;
|
|
18165
18187
|
if (!(Yn || Xn === 0)) {
|
|
18166
18188
|
for (this._cachedScaleForStroking = null, this._cachedGetSinglePixelWidth = null, ot.save(), ot.transform(...Un.textMatrix), ot.translate(Un.x, Un.y), ot.scale(zt, Gn), un = 0; un < nr; ++un) {
|
|
18167
|
-
if (
|
|
18168
|
-
ki = me *
|
|
18189
|
+
if (Br = Dt[un], typeof Br == "number") {
|
|
18190
|
+
ki = me * Br * Xn / 1e3, this.ctx.translate(ki, 0), Un.x += ki * zt;
|
|
18169
18191
|
continue;
|
|
18170
18192
|
}
|
|
18171
|
-
const Pi = (
|
|
18193
|
+
const Pi = (Br.isSpace ? Lt : 0) + kt, ji = St.charProcOperatorList[Br.operatorListId];
|
|
18172
18194
|
if (!ji) {
|
|
18173
|
-
(0, s.warn)(`Type3 character "${
|
|
18195
|
+
(0, s.warn)(`Type3 character "${Br.operatorListId}" is not available.`);
|
|
18174
18196
|
continue;
|
|
18175
18197
|
}
|
|
18176
|
-
this.contentVisible && (this.processingType3 =
|
|
18198
|
+
this.contentVisible && (this.processingType3 = Br, this.save(), ot.scale(Xn, Xn), ot.transform(...ln), this.executeOperatorList(ji), this.restore()), Ni = s.Util.applyTransform([Br.width, 0], ln)[0] * Xn + Pi, ot.translate(Ni, 0), Un.x += Ni * zt;
|
|
18177
18199
|
}
|
|
18178
18200
|
ot.restore(), this.processingType3 = null;
|
|
18179
18201
|
}
|
|
@@ -18223,8 +18245,8 @@ function requirePdf() {
|
|
|
18223
18245
|
ot.fillStyle = Un.getPattern(ot, this, (0, r.getCurrentTransformInverse)(ot), i.PathType.SHADING);
|
|
18224
18246
|
const St = (0, r.getCurrentTransformInverse)(ot);
|
|
18225
18247
|
if (St) {
|
|
18226
|
-
const Xn = ot.canvas, Gn = Xn.width, me = Xn.height, kt = s.Util.applyTransform([0, 0], St), Lt = s.Util.applyTransform([0, me], St), zt = s.Util.applyTransform([Gn, 0], St), ln = s.Util.applyTransform([Gn, me], St), nr = Math.min(kt[0], Lt[0], zt[0], ln[0]), Yn = Math.min(kt[1], Lt[1], zt[1], ln[1]), un = Math.max(kt[0], Lt[0], zt[0], ln[0]),
|
|
18227
|
-
this.ctx.fillRect(nr, Yn, un - nr,
|
|
18248
|
+
const Xn = ot.canvas, Gn = Xn.width, me = Xn.height, kt = s.Util.applyTransform([0, 0], St), Lt = s.Util.applyTransform([0, me], St), zt = s.Util.applyTransform([Gn, 0], St), ln = s.Util.applyTransform([Gn, me], St), nr = Math.min(kt[0], Lt[0], zt[0], ln[0]), Yn = Math.min(kt[1], Lt[1], zt[1], ln[1]), un = Math.max(kt[0], Lt[0], zt[0], ln[0]), Br = Math.max(kt[1], Lt[1], zt[1], ln[1]);
|
|
18249
|
+
this.ctx.fillRect(nr, Yn, un - nr, Br - Yn);
|
|
18228
18250
|
} else
|
|
18229
18251
|
this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
|
|
18230
18252
|
this.compose(this.current.getClippedPathBoundingBox()), this.restore();
|
|
@@ -18595,25 +18617,25 @@ function requirePdf() {
|
|
|
18595
18617
|
const It = st.coords, Zn = st.colors, Kn = pe.data, Is = pe.width * 4;
|
|
18596
18618
|
let qs;
|
|
18597
18619
|
It[nt + 1] > It[Ye + 1] && (qs = nt, nt = Ye, Ye = qs, qs = P, P = p, p = qs), It[Ye + 1] > It[N + 1] && (qs = Ye, Ye = N, N = qs, qs = p, p = mt, mt = qs), It[nt + 1] > It[Ye + 1] && (qs = nt, nt = Ye, Ye = qs, qs = P, P = p, p = qs);
|
|
18598
|
-
const
|
|
18599
|
-
if (
|
|
18620
|
+
const Ur = (It[nt] + st.offsetX) * st.scaleX, Ar = (It[nt + 1] + st.offsetY) * st.scaleY, Fr = (It[Ye] + st.offsetX) * st.scaleX, sr = (It[Ye + 1] + st.offsetY) * st.scaleY, As = (It[N] + st.offsetX) * st.scaleX, Si = (It[N + 1] + st.offsetY) * st.scaleY;
|
|
18621
|
+
if (Ar >= Si)
|
|
18600
18622
|
return;
|
|
18601
|
-
const Oi = Zn[P], dl = Zn[P + 1], ur = Zn[P + 2], Dt = Zn[p], ot = Zn[p + 1], Un = Zn[p + 2], St = Zn[mt], Xn = Zn[mt + 1], Gn = Zn[mt + 2], me = Math.round(
|
|
18602
|
-
let Lt, zt, ln, nr, Yn, un,
|
|
18623
|
+
const Oi = Zn[P], dl = Zn[P + 1], ur = Zn[P + 2], Dt = Zn[p], ot = Zn[p + 1], Un = Zn[p + 2], St = Zn[mt], Xn = Zn[mt + 1], Gn = Zn[mt + 2], me = Math.round(Ar), kt = Math.round(Si);
|
|
18624
|
+
let Lt, zt, ln, nr, Yn, un, Br, Ni;
|
|
18603
18625
|
for (let ki = me; ki <= kt; ki++) {
|
|
18604
18626
|
if (ki < sr) {
|
|
18605
18627
|
let Ha;
|
|
18606
|
-
ki <
|
|
18628
|
+
ki < Ar ? Ha = 0 : Ha = (Ar - ki) / (Ar - sr), Lt = Ur - (Ur - Fr) * Ha, zt = Oi - (Oi - Dt) * Ha, ln = dl - (dl - ot) * Ha, nr = ur - (ur - Un) * Ha;
|
|
18607
18629
|
} else {
|
|
18608
18630
|
let Ha;
|
|
18609
|
-
ki > Si ? Ha = 1 : sr === Si ? Ha = 0 : Ha = (sr - ki) / (sr - Si), Lt =
|
|
18631
|
+
ki > Si ? Ha = 1 : sr === Si ? Ha = 0 : Ha = (sr - ki) / (sr - Si), Lt = Fr - (Fr - As) * Ha, zt = Dt - (Dt - St) * Ha, ln = ot - (ot - Xn) * Ha, nr = Un - (Un - Gn) * Ha;
|
|
18610
18632
|
}
|
|
18611
18633
|
let Pi;
|
|
18612
|
-
ki <
|
|
18634
|
+
ki < Ar ? Pi = 0 : ki > Si ? Pi = 1 : Pi = (Ar - ki) / (Ar - Si), Yn = Ur - (Ur - As) * Pi, un = Oi - (Oi - St) * Pi, Br = dl - (dl - Xn) * Pi, Ni = ur - (ur - Gn) * Pi;
|
|
18613
18635
|
const ji = Math.round(Math.min(Lt, Yn)), _a = Math.round(Math.max(Lt, Yn));
|
|
18614
18636
|
let vl = Is * ki + ji * 4;
|
|
18615
18637
|
for (let Ha = ji; Ha <= _a; Ha++)
|
|
18616
|
-
Pi = (Lt - Ha) / (Lt - Yn), Pi < 0 ? Pi = 0 : Pi > 1 && (Pi = 1), Kn[vl++] = zt - (zt - un) * Pi | 0, Kn[vl++] = ln - (ln -
|
|
18638
|
+
Pi = (Lt - Ha) / (Lt - Yn), Pi < 0 ? Pi = 0 : Pi > 1 && (Pi = 1), Kn[vl++] = zt - (zt - un) * Pi | 0, Kn[vl++] = ln - (ln - Br) * Pi | 0, Kn[vl++] = nr - (nr - Ni) * Pi | 0, Kn[vl++] = 255;
|
|
18617
18639
|
}
|
|
18618
18640
|
}
|
|
18619
18641
|
function tt(pe, st, nt) {
|
|
@@ -18641,13 +18663,13 @@ function requirePdf() {
|
|
|
18641
18663
|
super(), this._coords = st[2], this._colors = st[3], this._figures = st[4], this._bounds = st[5], this._bbox = st[7], this._background = st[8], this.matrix = null;
|
|
18642
18664
|
}
|
|
18643
18665
|
_createMeshCanvas(st, nt, Ye) {
|
|
18644
|
-
const mt = Math.floor(this._bounds[0]), It = Math.floor(this._bounds[1]), Zn = Math.ceil(this._bounds[2]) - mt, Kn = Math.ceil(this._bounds[3]) - It, Is = Math.min(Math.ceil(Math.abs(Zn * st[0] * 1.1)), 3e3), qs = Math.min(Math.ceil(Math.abs(Kn * st[1] * 1.1)), 3e3),
|
|
18666
|
+
const mt = Math.floor(this._bounds[0]), It = Math.floor(this._bounds[1]), Zn = Math.ceil(this._bounds[2]) - mt, Kn = Math.ceil(this._bounds[3]) - It, Is = Math.min(Math.ceil(Math.abs(Zn * st[0] * 1.1)), 3e3), qs = Math.min(Math.ceil(Math.abs(Kn * st[1] * 1.1)), 3e3), Ur = Zn / Is, Ar = Kn / qs, Fr = {
|
|
18645
18667
|
coords: this._coords,
|
|
18646
18668
|
colors: this._colors,
|
|
18647
18669
|
offsetX: -mt,
|
|
18648
18670
|
offsetY: -It,
|
|
18649
|
-
scaleX: 1 /
|
|
18650
|
-
scaleY: 1 /
|
|
18671
|
+
scaleX: 1 / Ur,
|
|
18672
|
+
scaleY: 1 / Ar
|
|
18651
18673
|
}, sr = Is + 4, As = qs + 4, Si = Ye.getCanvas("mesh", sr, As, !1), Oi = Si.context, dl = Oi.createImageData(Is, qs);
|
|
18652
18674
|
if (nt) {
|
|
18653
18675
|
const Dt = dl.data;
|
|
@@ -18655,13 +18677,13 @@ function requirePdf() {
|
|
|
18655
18677
|
Dt[ot] = nt[0], Dt[ot + 1] = nt[1], Dt[ot + 2] = nt[2], Dt[ot + 3] = 255;
|
|
18656
18678
|
}
|
|
18657
18679
|
for (const Dt of this._figures)
|
|
18658
|
-
tt(dl, Dt,
|
|
18680
|
+
tt(dl, Dt, Fr);
|
|
18659
18681
|
return Oi.putImageData(dl, 2, 2), {
|
|
18660
18682
|
canvas: Si.canvas,
|
|
18661
|
-
offsetX: mt - 2 *
|
|
18662
|
-
offsetY: It - 2 *
|
|
18663
|
-
scaleX:
|
|
18664
|
-
scaleY:
|
|
18683
|
+
offsetX: mt - 2 * Ur,
|
|
18684
|
+
offsetY: It - 2 * Ar,
|
|
18685
|
+
scaleX: Ur,
|
|
18686
|
+
scaleY: Ar
|
|
18665
18687
|
};
|
|
18666
18688
|
}
|
|
18667
18689
|
getPattern(st, nt, Ye, N) {
|
|
@@ -18707,9 +18729,9 @@ function requirePdf() {
|
|
|
18707
18729
|
createPatternCanvas(st) {
|
|
18708
18730
|
const nt = this.operatorList, Ye = this.bbox, N = this.xstep, P = this.ystep, p = this.paintType, mt = this.tilingType, It = this.color, Zn = this.canvasGraphicsFactory;
|
|
18709
18731
|
(0, r.info)("TilingType: " + mt);
|
|
18710
|
-
const Kn = Ye[0], Is = Ye[1], qs = Ye[2],
|
|
18732
|
+
const Kn = Ye[0], Is = Ye[1], qs = Ye[2], Ur = Ye[3], Ar = r.Util.singularValueDecompose2dScale(this.matrix), Fr = r.Util.singularValueDecompose2dScale(this.baseTransform), sr = [Ar[0] * Fr[0], Ar[1] * Fr[1]], As = this.getSizeAndScale(N, this.ctx.canvas.width, sr[0]), Si = this.getSizeAndScale(P, this.ctx.canvas.height, sr[1]), Oi = st.cachedCanvases.getCanvas("pattern", As.size, Si.size, !0), dl = Oi.context, ur = Zn.createCanvasGraphics(dl);
|
|
18711
18733
|
ur.groupLevel = st.groupLevel, this.setFillAndStrokeStyleToContext(ur, p, It);
|
|
18712
|
-
let Dt = Kn, ot = Is, Un = qs, St =
|
|
18734
|
+
let Dt = Kn, ot = Is, Un = qs, St = Ur;
|
|
18713
18735
|
return Kn < 0 && (Dt = 0, Un += Math.abs(Kn)), Is < 0 && (ot = 0, St += Math.abs(Is)), dl.translate(-(As.scale * Dt), -(Si.scale * ot)), ur.transform(As.scale, 0, 0, Si.scale, 0, 0), dl.save(), this.clipBbox(ur, Dt, ot, Un, St), ur.baseTransform = (0, s.getCurrentTransform)(ur.ctx), ur.executeOperatorList(nt), ur.endDrawing(), {
|
|
18714
18736
|
canvas: Oi.canvas,
|
|
18715
18737
|
scaleX: As.scale,
|
|
@@ -19139,16 +19161,16 @@ function requirePdf() {
|
|
|
19139
19161
|
Cl(this, i, h), Cl(this, a, l);
|
|
19140
19162
|
}
|
|
19141
19163
|
getRaw() {
|
|
19142
|
-
return
|
|
19164
|
+
return Gr(this, a);
|
|
19143
19165
|
}
|
|
19144
19166
|
get(h) {
|
|
19145
|
-
return
|
|
19167
|
+
return Gr(this, i).get(h) ?? null;
|
|
19146
19168
|
}
|
|
19147
19169
|
getAll() {
|
|
19148
|
-
return (0, r.objectFromMap)(
|
|
19170
|
+
return (0, r.objectFromMap)(Gr(this, i));
|
|
19149
19171
|
}
|
|
19150
19172
|
has(h) {
|
|
19151
|
-
return
|
|
19173
|
+
return Gr(this, i).has(h);
|
|
19152
19174
|
}
|
|
19153
19175
|
}
|
|
19154
19176
|
i = new WeakMap(), a = new WeakMap(), t.Metadata = s;
|
|
@@ -19168,7 +19190,7 @@ function requirePdf() {
|
|
|
19168
19190
|
this.name = u, this.intent = o;
|
|
19169
19191
|
}
|
|
19170
19192
|
get visible() {
|
|
19171
|
-
return
|
|
19193
|
+
return Gr(this, c);
|
|
19172
19194
|
}
|
|
19173
19195
|
_setVisible(u, o) {
|
|
19174
19196
|
u !== s && (0, r.unreachable)("Internal method `_setVisible` called."), Cl(this, c, o);
|
|
@@ -19185,58 +19207,58 @@ function requirePdf() {
|
|
|
19185
19207
|
if (this.name = null, this.creator = null, u !== null) {
|
|
19186
19208
|
this.name = u.name, this.creator = u.creator, Cl(this, tt, u.order);
|
|
19187
19209
|
for (const o of u.groups)
|
|
19188
|
-
|
|
19210
|
+
Gr(this, l).set(o.id, new i(o.name, o.intent));
|
|
19189
19211
|
if (u.baseState === "OFF")
|
|
19190
|
-
for (const o of
|
|
19212
|
+
for (const o of Gr(this, l).values())
|
|
19191
19213
|
o._setVisible(s, !1);
|
|
19192
19214
|
for (const o of u.on)
|
|
19193
|
-
|
|
19215
|
+
Gr(this, l).get(o)._setVisible(s, !0);
|
|
19194
19216
|
for (const o of u.off)
|
|
19195
|
-
|
|
19217
|
+
Gr(this, l).get(o)._setVisible(s, !1);
|
|
19196
19218
|
Cl(this, b, /* @__PURE__ */ new Map());
|
|
19197
|
-
for (const [o, pe] of
|
|
19198
|
-
|
|
19219
|
+
for (const [o, pe] of Gr(this, l))
|
|
19220
|
+
Gr(this, b).set(o, pe.visible);
|
|
19199
19221
|
}
|
|
19200
19222
|
}
|
|
19201
19223
|
isVisible(u) {
|
|
19202
|
-
if (
|
|
19224
|
+
if (Gr(this, l).size === 0)
|
|
19203
19225
|
return !0;
|
|
19204
19226
|
if (!u)
|
|
19205
19227
|
return (0, r.warn)("Optional content group not defined."), !0;
|
|
19206
19228
|
if (u.type === "OCG")
|
|
19207
|
-
return
|
|
19229
|
+
return Gr(this, l).has(u.id) ? Gr(this, l).get(u.id).visible : ((0, r.warn)(`Optional content group not found: ${u.id}`), !0);
|
|
19208
19230
|
if (u.type === "OCMD") {
|
|
19209
19231
|
if (u.expression)
|
|
19210
19232
|
return ml(this, de, M0).call(this, u.expression);
|
|
19211
19233
|
if (!u.policy || u.policy === "AnyOn") {
|
|
19212
19234
|
for (const o of u.ids) {
|
|
19213
|
-
if (!
|
|
19235
|
+
if (!Gr(this, l).has(o))
|
|
19214
19236
|
return (0, r.warn)(`Optional content group not found: ${o}`), !0;
|
|
19215
|
-
if (
|
|
19237
|
+
if (Gr(this, l).get(o).visible)
|
|
19216
19238
|
return !0;
|
|
19217
19239
|
}
|
|
19218
19240
|
return !1;
|
|
19219
19241
|
} else if (u.policy === "AllOn") {
|
|
19220
19242
|
for (const o of u.ids) {
|
|
19221
|
-
if (!
|
|
19243
|
+
if (!Gr(this, l).has(o))
|
|
19222
19244
|
return (0, r.warn)(`Optional content group not found: ${o}`), !0;
|
|
19223
|
-
if (!
|
|
19245
|
+
if (!Gr(this, l).get(o).visible)
|
|
19224
19246
|
return !1;
|
|
19225
19247
|
}
|
|
19226
19248
|
return !0;
|
|
19227
19249
|
} else if (u.policy === "AnyOff") {
|
|
19228
19250
|
for (const o of u.ids) {
|
|
19229
|
-
if (!
|
|
19251
|
+
if (!Gr(this, l).has(o))
|
|
19230
19252
|
return (0, r.warn)(`Optional content group not found: ${o}`), !0;
|
|
19231
|
-
if (!
|
|
19253
|
+
if (!Gr(this, l).get(o).visible)
|
|
19232
19254
|
return !0;
|
|
19233
19255
|
}
|
|
19234
19256
|
return !1;
|
|
19235
19257
|
} else if (u.policy === "AllOff") {
|
|
19236
19258
|
for (const o of u.ids) {
|
|
19237
|
-
if (!
|
|
19259
|
+
if (!Gr(this, l).has(o))
|
|
19238
19260
|
return (0, r.warn)(`Optional content group not found: ${o}`), !0;
|
|
19239
|
-
if (
|
|
19261
|
+
if (Gr(this, l).get(o).visible)
|
|
19240
19262
|
return !1;
|
|
19241
19263
|
}
|
|
19242
19264
|
return !0;
|
|
@@ -19246,30 +19268,30 @@ function requirePdf() {
|
|
|
19246
19268
|
return (0, r.warn)(`Unknown group type ${u.type}.`), !0;
|
|
19247
19269
|
}
|
|
19248
19270
|
setVisibility(u, o = !0) {
|
|
19249
|
-
if (!
|
|
19271
|
+
if (!Gr(this, l).has(u)) {
|
|
19250
19272
|
(0, r.warn)(`Optional content group not found: ${u}`);
|
|
19251
19273
|
return;
|
|
19252
19274
|
}
|
|
19253
|
-
|
|
19275
|
+
Gr(this, l).get(u)._setVisible(s, !!o), Cl(this, h, null);
|
|
19254
19276
|
}
|
|
19255
19277
|
get hasInitialVisibility() {
|
|
19256
|
-
if (
|
|
19257
|
-
return
|
|
19258
|
-
for (const [u, o] of
|
|
19259
|
-
const pe =
|
|
19278
|
+
if (Gr(this, h) !== null)
|
|
19279
|
+
return Gr(this, h);
|
|
19280
|
+
for (const [u, o] of Gr(this, l)) {
|
|
19281
|
+
const pe = Gr(this, b).get(u);
|
|
19260
19282
|
if (o.visible !== pe)
|
|
19261
19283
|
return Cl(this, h, !1);
|
|
19262
19284
|
}
|
|
19263
19285
|
return Cl(this, h, !0);
|
|
19264
19286
|
}
|
|
19265
19287
|
getOrder() {
|
|
19266
|
-
return
|
|
19288
|
+
return Gr(this, l).size ? Gr(this, tt) ? Gr(this, tt).slice() : [...Gr(this, l).keys()] : null;
|
|
19267
19289
|
}
|
|
19268
19290
|
getGroups() {
|
|
19269
|
-
return
|
|
19291
|
+
return Gr(this, l).size > 0 ? (0, r.objectFromMap)(Gr(this, l)) : null;
|
|
19270
19292
|
}
|
|
19271
19293
|
getGroup(u) {
|
|
19272
|
-
return
|
|
19294
|
+
return Gr(this, l).get(u) || null;
|
|
19273
19295
|
}
|
|
19274
19296
|
}
|
|
19275
19297
|
h = new WeakMap(), l = new WeakMap(), b = new WeakMap(), tt = new WeakMap(), de = new WeakSet(), M0 = function(u) {
|
|
@@ -19282,8 +19304,8 @@ function requirePdf() {
|
|
|
19282
19304
|
let Ye;
|
|
19283
19305
|
if (Array.isArray(nt))
|
|
19284
19306
|
Ye = ml(this, de, M0).call(this, nt);
|
|
19285
|
-
else if (
|
|
19286
|
-
Ye =
|
|
19307
|
+
else if (Gr(this, l).has(nt))
|
|
19308
|
+
Ye = Gr(this, l).get(nt).visible;
|
|
19287
19309
|
else
|
|
19288
19310
|
return (0, r.warn)(`Optional content group not found: ${nt}`), !0;
|
|
19289
19311
|
switch (pe) {
|
|
@@ -19596,19 +19618,19 @@ function requirePdf() {
|
|
|
19596
19618
|
bl(this, Le, !1);
|
|
19597
19619
|
bl(this, E, !1);
|
|
19598
19620
|
bl(this, u);
|
|
19599
|
-
N._initialized || (N._initialized = !0, i.FreeTextEditor.initialize(p.l10n), a.InkEditor.initialize(p.l10n), p.uiManager.registerEditorTypes([i.FreeTextEditor, a.InkEditor])), Cl(this, u, p.uiManager), this.annotationStorage = p.annotationStorage, this.pageIndex = p.pageIndex, this.div = p.div, Cl(this, h, p.accessibilityManager),
|
|
19621
|
+
N._initialized || (N._initialized = !0, i.FreeTextEditor.initialize(p.l10n), a.InkEditor.initialize(p.l10n), p.uiManager.registerEditorTypes([i.FreeTextEditor, a.InkEditor])), Cl(this, u, p.uiManager), this.annotationStorage = p.annotationStorage, this.pageIndex = p.pageIndex, this.div = p.div, Cl(this, h, p.accessibilityManager), Gr(this, u).addLayer(this);
|
|
19600
19622
|
}
|
|
19601
19623
|
updateToolbar(p) {
|
|
19602
|
-
|
|
19624
|
+
Gr(this, u).updateToolbar(p);
|
|
19603
19625
|
}
|
|
19604
|
-
updateMode(p =
|
|
19605
|
-
ml(this, o, tm).call(this), p === s.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(),
|
|
19626
|
+
updateMode(p = Gr(this, u).getMode()) {
|
|
19627
|
+
ml(this, o, tm).call(this), p === s.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(), Gr(this, u).unselectAll();
|
|
19606
19628
|
}
|
|
19607
19629
|
addInkEditorIfNeeded(p) {
|
|
19608
|
-
if (!p &&
|
|
19630
|
+
if (!p && Gr(this, u).getMode() !== s.AnnotationEditorType.INK)
|
|
19609
19631
|
return;
|
|
19610
19632
|
if (!p) {
|
|
19611
|
-
for (const It of
|
|
19633
|
+
for (const It of Gr(this, de).values())
|
|
19612
19634
|
if (It.isEmpty()) {
|
|
19613
19635
|
It.setInBackground();
|
|
19614
19636
|
return;
|
|
@@ -19620,44 +19642,44 @@ function requirePdf() {
|
|
|
19620
19642
|
}).setInBackground();
|
|
19621
19643
|
}
|
|
19622
19644
|
setEditingState(p) {
|
|
19623
|
-
|
|
19645
|
+
Gr(this, u).setEditingState(p);
|
|
19624
19646
|
}
|
|
19625
19647
|
addCommands(p) {
|
|
19626
|
-
|
|
19648
|
+
Gr(this, u).addCommands(p);
|
|
19627
19649
|
}
|
|
19628
19650
|
enable() {
|
|
19629
19651
|
this.div.style.pointerEvents = "auto";
|
|
19630
|
-
for (const p of
|
|
19652
|
+
for (const p of Gr(this, de).values())
|
|
19631
19653
|
p.enableEditing();
|
|
19632
19654
|
}
|
|
19633
19655
|
disable() {
|
|
19634
19656
|
this.div.style.pointerEvents = "none";
|
|
19635
|
-
for (const p of
|
|
19657
|
+
for (const p of Gr(this, de).values())
|
|
19636
19658
|
p.disableEditing();
|
|
19637
19659
|
}
|
|
19638
19660
|
setActiveEditor(p) {
|
|
19639
|
-
|
|
19661
|
+
Gr(this, u).getActive() !== p && Gr(this, u).setActiveEditor(p);
|
|
19640
19662
|
}
|
|
19641
19663
|
enableClick() {
|
|
19642
|
-
this.div.addEventListener("pointerdown",
|
|
19664
|
+
this.div.addEventListener("pointerdown", Gr(this, tt)), this.div.addEventListener("pointerup", Gr(this, b));
|
|
19643
19665
|
}
|
|
19644
19666
|
disableClick() {
|
|
19645
|
-
this.div.removeEventListener("pointerdown",
|
|
19667
|
+
this.div.removeEventListener("pointerdown", Gr(this, tt)), this.div.removeEventListener("pointerup", Gr(this, b));
|
|
19646
19668
|
}
|
|
19647
19669
|
attach(p) {
|
|
19648
|
-
|
|
19670
|
+
Gr(this, de).set(p.id, p);
|
|
19649
19671
|
}
|
|
19650
19672
|
detach(p) {
|
|
19651
19673
|
var mt;
|
|
19652
|
-
|
|
19674
|
+
Gr(this, de).delete(p.id), (mt = Gr(this, h)) == null || mt.removePointerInTextLayer(p.contentDiv);
|
|
19653
19675
|
}
|
|
19654
19676
|
remove(p) {
|
|
19655
|
-
|
|
19656
|
-
p.div.style.display = "", p.div.remove(), p.isAttachedToDOM = !1, document.activeElement === document.body &&
|
|
19657
|
-
}, 0),
|
|
19677
|
+
Gr(this, u).removeEditor(p), this.detach(p), this.annotationStorage.remove(p.id), p.div.style.display = "none", setTimeout(() => {
|
|
19678
|
+
p.div.style.display = "", p.div.remove(), p.isAttachedToDOM = !1, document.activeElement === document.body && Gr(this, u).focusMainContainer();
|
|
19679
|
+
}, 0), Gr(this, E) || this.addInkEditorIfNeeded(!1);
|
|
19658
19680
|
}
|
|
19659
19681
|
add(p) {
|
|
19660
|
-
if (ml(this, o, L0).call(this, p),
|
|
19682
|
+
if (ml(this, o, L0).call(this, p), Gr(this, u).addEditor(p), this.attach(p), !p.isAttachedToDOM) {
|
|
19661
19683
|
const mt = p.render();
|
|
19662
19684
|
this.div.append(mt), p.isAttachedToDOM = !0;
|
|
19663
19685
|
}
|
|
@@ -19665,7 +19687,7 @@ function requirePdf() {
|
|
|
19665
19687
|
}
|
|
19666
19688
|
moveEditorInDOM(p) {
|
|
19667
19689
|
var mt;
|
|
19668
|
-
(mt =
|
|
19690
|
+
(mt = Gr(this, h)) == null || mt.moveElementInDOM(this.div, p.div, p.contentDiv, !0);
|
|
19669
19691
|
}
|
|
19670
19692
|
addToAnnotationStorage(p) {
|
|
19671
19693
|
!p.isEmpty() && !this.annotationStorage.has(p.id) && this.annotationStorage.setValue(p.id, p);
|
|
@@ -19698,7 +19720,7 @@ function requirePdf() {
|
|
|
19698
19720
|
});
|
|
19699
19721
|
}
|
|
19700
19722
|
getNextId() {
|
|
19701
|
-
return
|
|
19723
|
+
return Gr(this, u).getId();
|
|
19702
19724
|
}
|
|
19703
19725
|
deserialize(p) {
|
|
19704
19726
|
switch (p.annotationType) {
|
|
@@ -19710,21 +19732,21 @@ function requirePdf() {
|
|
|
19710
19732
|
return null;
|
|
19711
19733
|
}
|
|
19712
19734
|
setSelected(p) {
|
|
19713
|
-
|
|
19735
|
+
Gr(this, u).setSelected(p);
|
|
19714
19736
|
}
|
|
19715
19737
|
toggleSelected(p) {
|
|
19716
|
-
|
|
19738
|
+
Gr(this, u).toggleSelected(p);
|
|
19717
19739
|
}
|
|
19718
19740
|
isSelected(p) {
|
|
19719
|
-
return
|
|
19741
|
+
return Gr(this, u).isSelected(p);
|
|
19720
19742
|
}
|
|
19721
19743
|
unselect(p) {
|
|
19722
|
-
|
|
19744
|
+
Gr(this, u).unselect(p);
|
|
19723
19745
|
}
|
|
19724
19746
|
pointerup(p) {
|
|
19725
19747
|
const mt = r.KeyboardManager.platform.isMac;
|
|
19726
|
-
if (!(p.button !== 0 || p.ctrlKey && mt) && p.target === this.div &&
|
|
19727
|
-
if (Cl(this, Le, !1), !
|
|
19748
|
+
if (!(p.button !== 0 || p.ctrlKey && mt) && p.target === this.div && Gr(this, Le)) {
|
|
19749
|
+
if (Cl(this, Le, !1), !Gr(this, l)) {
|
|
19728
19750
|
Cl(this, l, !0);
|
|
19729
19751
|
return;
|
|
19730
19752
|
}
|
|
@@ -19736,11 +19758,11 @@ function requirePdf() {
|
|
|
19736
19758
|
if (p.button !== 0 || p.ctrlKey && mt || p.target !== this.div)
|
|
19737
19759
|
return;
|
|
19738
19760
|
Cl(this, Le, !0);
|
|
19739
|
-
const It =
|
|
19761
|
+
const It = Gr(this, u).getActive();
|
|
19740
19762
|
Cl(this, l, !It || It.isEmpty());
|
|
19741
19763
|
}
|
|
19742
19764
|
drop(p) {
|
|
19743
|
-
const mt = p.dataTransfer.getData("text/plain"), It =
|
|
19765
|
+
const mt = p.dataTransfer.getData("text/plain"), It = Gr(this, u).getEditor(mt);
|
|
19744
19766
|
if (!It)
|
|
19745
19767
|
return;
|
|
19746
19768
|
p.preventDefault(), p.dataTransfer.dropEffect = "move", ml(this, o, L0).call(this, It);
|
|
@@ -19752,14 +19774,14 @@ function requirePdf() {
|
|
|
19752
19774
|
}
|
|
19753
19775
|
destroy() {
|
|
19754
19776
|
var p, mt;
|
|
19755
|
-
((p =
|
|
19756
|
-
for (const It of
|
|
19757
|
-
(mt =
|
|
19758
|
-
this.div = null,
|
|
19777
|
+
((p = Gr(this, u).getActive()) == null ? void 0 : p.parent) === this && Gr(this, u).setActiveEditor(null);
|
|
19778
|
+
for (const It of Gr(this, de).values())
|
|
19779
|
+
(mt = Gr(this, h)) == null || mt.removePointerInTextLayer(It.contentDiv), It.isAttachedToDOM = !1, It.div.remove(), It.parent = null;
|
|
19780
|
+
this.div = null, Gr(this, de).clear(), Gr(this, u).removeLayer(this);
|
|
19759
19781
|
}
|
|
19760
19782
|
render(p) {
|
|
19761
19783
|
this.viewport = p.viewport, (0, r.bindEvents)(this, this.div, ["dragover", "drop"]), this.setDimensions();
|
|
19762
|
-
for (const mt of
|
|
19784
|
+
for (const mt of Gr(this, u).getEditors(this.pageIndex))
|
|
19763
19785
|
this.add(mt);
|
|
19764
19786
|
this.updateMode();
|
|
19765
19787
|
}
|
|
@@ -19794,7 +19816,7 @@ function requirePdf() {
|
|
|
19794
19816
|
var mt;
|
|
19795
19817
|
p.parent !== this && (this.attach(p), p.pageIndex = this.pageIndex, (mt = p.parent) == null || mt.detach(p), p.parent = this, p.div && p.isAttachedToDOM && (p.div.remove(), this.div.append(p.div)));
|
|
19796
19818
|
}, em = function(p) {
|
|
19797
|
-
switch (
|
|
19819
|
+
switch (Gr(this, u).getMode()) {
|
|
19798
19820
|
case s.AnnotationEditorType.FREETEXT:
|
|
19799
19821
|
return new i.FreeTextEditor(p);
|
|
19800
19822
|
case s.AnnotationEditorType.INK:
|
|
@@ -19811,7 +19833,7 @@ function requirePdf() {
|
|
|
19811
19833
|
return It && this.add(It), It;
|
|
19812
19834
|
}, tm = function() {
|
|
19813
19835
|
Cl(this, E, !0);
|
|
19814
|
-
for (const p of
|
|
19836
|
+
for (const p of Gr(this, de).values())
|
|
19815
19837
|
p.isEmpty() && p.remove();
|
|
19816
19838
|
Cl(this, E, !1);
|
|
19817
19839
|
}, Yg(N, "_initialized", !1);
|
|
@@ -19871,19 +19893,19 @@ function requirePdf() {
|
|
|
19871
19893
|
return [[r.AnnotationEditorParamsType.FREETEXT_SIZE, nt._defaultFontSize], [r.AnnotationEditorParamsType.FREETEXT_COLOR, nt._defaultColor || i.AnnotationEditor._defaultLineColor]];
|
|
19872
19894
|
}
|
|
19873
19895
|
get propertiesToUpdate() {
|
|
19874
|
-
return [[r.AnnotationEditorParamsType.FREETEXT_SIZE,
|
|
19896
|
+
return [[r.AnnotationEditorParamsType.FREETEXT_SIZE, Gr(this, Le)], [r.AnnotationEditorParamsType.FREETEXT_COLOR, Gr(this, b)]];
|
|
19875
19897
|
}
|
|
19876
19898
|
getInitialTranslation() {
|
|
19877
|
-
return [-nt._internalPadding * this.parent.scaleFactor, -(nt._internalPadding +
|
|
19899
|
+
return [-nt._internalPadding * this.parent.scaleFactor, -(nt._internalPadding + Gr(this, Le)) * this.parent.scaleFactor];
|
|
19878
19900
|
}
|
|
19879
19901
|
rebuild() {
|
|
19880
19902
|
super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this));
|
|
19881
19903
|
}
|
|
19882
19904
|
enableEditMode() {
|
|
19883
|
-
this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.enableEditing(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this.div.draggable = !1, this.editorDiv.addEventListener("keydown",
|
|
19905
|
+
this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.enableEditing(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this.div.draggable = !1, this.editorDiv.addEventListener("keydown", Gr(this, l)), this.editorDiv.addEventListener("focus", Gr(this, h)), this.editorDiv.addEventListener("blur", Gr(this, c)));
|
|
19884
19906
|
}
|
|
19885
19907
|
disableEditMode() {
|
|
19886
|
-
this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.disableEditing(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.draggable = !0, this.editorDiv.removeEventListener("keydown",
|
|
19908
|
+
this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.disableEditing(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.draggable = !0, this.editorDiv.removeEventListener("keydown", Gr(this, l)), this.editorDiv.removeEventListener("focus", Gr(this, h)), this.editorDiv.removeEventListener("blur", Gr(this, c)), this.div.focus(), this.isEditing = !1);
|
|
19887
19909
|
}
|
|
19888
19910
|
focusin(P) {
|
|
19889
19911
|
super.focusin(P), P.target !== this.editorDiv && this.editorDiv.focus();
|
|
@@ -19898,7 +19920,7 @@ function requirePdf() {
|
|
|
19898
19920
|
this.isEditing = !1, this.parent.setEditingState(!0), super.remove();
|
|
19899
19921
|
}
|
|
19900
19922
|
commit() {
|
|
19901
|
-
super.commit(),
|
|
19923
|
+
super.commit(), Gr(this, de) || (Cl(this, de, !0), this.parent.addUndoableEditor(this)), this.disableEditMode(), Cl(this, tt, ml(this, E, sm).call(this).trimEnd()), ml(this, E, N0).call(this);
|
|
19902
19924
|
}
|
|
19903
19925
|
shouldGetKeyboardEvents() {
|
|
19904
19926
|
return this.isInEditMode();
|
|
@@ -19938,10 +19960,10 @@ function requirePdf() {
|
|
|
19938
19960
|
const {
|
|
19939
19961
|
style: mt
|
|
19940
19962
|
} = this.editorDiv;
|
|
19941
|
-
if (mt.fontSize = `calc(${
|
|
19963
|
+
if (mt.fontSize = `calc(${Gr(this, Le)}px * var(--scale-factor))`, mt.color = Gr(this, b), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, s.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
|
|
19942
19964
|
const [It, Zn] = this.parent.viewportBaseDimensions;
|
|
19943
19965
|
this.setAt(P * It, p * Zn, this.width * It, this.height * Zn);
|
|
19944
|
-
for (const Kn of
|
|
19966
|
+
for (const Kn of Gr(this, tt).split(`
|
|
19945
19967
|
`)) {
|
|
19946
19968
|
const Is = document.createElement("div");
|
|
19947
19969
|
Is.append(Kn ? document.createTextNode(Kn) : document.createElement("br")), this.editorDiv.append(Is);
|
|
@@ -19965,8 +19987,8 @@ function requirePdf() {
|
|
|
19965
19987
|
return {
|
|
19966
19988
|
annotationType: r.AnnotationEditorType.FREETEXT,
|
|
19967
19989
|
color: mt,
|
|
19968
|
-
fontSize:
|
|
19969
|
-
value:
|
|
19990
|
+
fontSize: Gr(this, Le),
|
|
19991
|
+
value: Gr(this, tt),
|
|
19970
19992
|
pageIndex: this.parent.pageIndex,
|
|
19971
19993
|
rect: p,
|
|
19972
19994
|
rotation: this.rotation
|
|
@@ -19975,8 +19997,8 @@ function requirePdf() {
|
|
|
19975
19997
|
};
|
|
19976
19998
|
c = new WeakMap(), h = new WeakMap(), l = new WeakMap(), b = new WeakMap(), tt = new WeakMap(), de = new WeakMap(), Le = new WeakMap(), E = new WeakSet(), nm = function(P) {
|
|
19977
19999
|
const p = (It) => {
|
|
19978
|
-
this.editorDiv.style.fontSize = `calc(${It}px * var(--scale-factor))`, this.translate(0, -(It -
|
|
19979
|
-
}, mt =
|
|
20000
|
+
this.editorDiv.style.fontSize = `calc(${It}px * var(--scale-factor))`, this.translate(0, -(It - Gr(this, Le)) * this.parent.scaleFactor), Cl(this, Le, It), ml(this, E, N0).call(this);
|
|
20001
|
+
}, mt = Gr(this, Le);
|
|
19980
20002
|
this.parent.addCommands({
|
|
19981
20003
|
cmd: () => {
|
|
19982
20004
|
p(P);
|
|
@@ -19990,7 +20012,7 @@ function requirePdf() {
|
|
|
19990
20012
|
keepUndo: !0
|
|
19991
20013
|
});
|
|
19992
20014
|
}, rm = function(P) {
|
|
19993
|
-
const p =
|
|
20015
|
+
const p = Gr(this, b);
|
|
19994
20016
|
this.parent.addCommands({
|
|
19995
20017
|
cmd: () => {
|
|
19996
20018
|
Cl(this, b, P), this.editorDiv.style.color = P;
|
|
@@ -20096,13 +20118,13 @@ function requirePdf() {
|
|
|
20096
20118
|
super.rebuild(), this.div !== null && (this.canvas || (ml(this, p, y0).call(this), ml(this, p, A0).call(this)), this.isAttachedToDOM || (this.parent.add(this), ml(this, p, c0).call(this)), ml(this, p, d0).call(this));
|
|
20097
20119
|
}
|
|
20098
20120
|
remove() {
|
|
20099
|
-
this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null,
|
|
20121
|
+
this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, Gr(this, nt).disconnect(), Cl(this, nt, null), super.remove());
|
|
20100
20122
|
}
|
|
20101
20123
|
enableEditMode() {
|
|
20102
|
-
|
|
20124
|
+
Gr(this, o) || this.canvas === null || (super.enableEditMode(), this.div.draggable = !1, this.canvas.addEventListener("pointerdown", Gr(this, u)), this.canvas.addEventListener("pointerup", Gr(this, E)));
|
|
20103
20125
|
}
|
|
20104
20126
|
disableEditMode() {
|
|
20105
|
-
!this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this.div.draggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown",
|
|
20127
|
+
!this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this.div.draggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", Gr(this, u)), this.canvas.removeEventListener("pointerup", Gr(this, E)));
|
|
20106
20128
|
}
|
|
20107
20129
|
onceAdded() {
|
|
20108
20130
|
this.div.draggable = !this.isEmpty();
|
|
@@ -20111,13 +20133,13 @@ function requirePdf() {
|
|
|
20111
20133
|
return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
|
|
20112
20134
|
}
|
|
20113
20135
|
commit() {
|
|
20114
|
-
|
|
20136
|
+
Gr(this, o) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), Cl(this, o, !0), this.div.classList.add("disabled"), ml(this, p, d0).call(this, !0), this.parent.addInkEditorIfNeeded(!0), this.parent.moveEditorInDOM(this), this.div.focus());
|
|
20115
20137
|
}
|
|
20116
20138
|
focusin(Yn) {
|
|
20117
20139
|
super.focusin(Yn), this.enableEditMode();
|
|
20118
20140
|
}
|
|
20119
20141
|
canvasPointerdown(Yn) {
|
|
20120
|
-
Yn.button !== 0 || !this.isInEditMode() ||
|
|
20142
|
+
Yn.button !== 0 || !this.isInEditMode() || Gr(this, o) || (this.setInForeground(), Yn.type !== "mouse" && this.div.focus(), Yn.stopPropagation(), this.canvas.addEventListener("pointerleave", Gr(this, Le)), this.canvas.addEventListener("pointermove", Gr(this, de)), ml(this, p, lm).call(this, Yn.offsetX, Yn.offsetY));
|
|
20121
20143
|
}
|
|
20122
20144
|
canvasPointermove(Yn) {
|
|
20123
20145
|
Yn.stopPropagation(), ml(this, p, cm).call(this, Yn.offsetX, Yn.offsetY);
|
|
@@ -20136,8 +20158,8 @@ function requirePdf() {
|
|
|
20136
20158
|
var _a;
|
|
20137
20159
|
return (_a = this.div) == null ? void 0 : _a.setAttribute("aria-label", ji);
|
|
20138
20160
|
});
|
|
20139
|
-
const [
|
|
20140
|
-
if (this.setAt(
|
|
20161
|
+
const [Br, Ni, ki, Pi] = ml(this, p, um).call(this);
|
|
20162
|
+
if (this.setAt(Br, Ni, 0, 0), this.setDims(ki, Pi), ml(this, p, y0).call(this), this.width) {
|
|
20141
20163
|
const [ji, _a] = this.parent.viewportBaseDimensions;
|
|
20142
20164
|
this.setAt(Yn * ji, un * _a, this.width * ji, this.height * _a), Cl(this, pe, !0), ml(this, p, c0).call(this), this.setDims(this.width * ji, this.height * _a), ml(this, p, s0).call(this), ml(this, p, q0).call(this), this.div.classList.add("disabled");
|
|
20143
20165
|
} else
|
|
@@ -20145,42 +20167,42 @@ function requirePdf() {
|
|
|
20145
20167
|
return ml(this, p, A0).call(this), this.div;
|
|
20146
20168
|
}
|
|
20147
20169
|
setDimensions(Yn, un) {
|
|
20148
|
-
const
|
|
20149
|
-
if (
|
|
20170
|
+
const Br = Math.round(Yn), Ni = Math.round(un);
|
|
20171
|
+
if (Gr(this, Ye) === Br && Gr(this, N) === Ni)
|
|
20150
20172
|
return;
|
|
20151
|
-
Cl(this, Ye,
|
|
20173
|
+
Cl(this, Ye, Br), Cl(this, N, Ni), this.canvas.style.visibility = "hidden", Gr(this, l) && Math.abs(Gr(this, l) - Yn / un) > 0.01 && (un = Math.ceil(Yn / Gr(this, l)), this.setDims(Yn, un));
|
|
20152
20174
|
const [ki, Pi] = this.parent.viewportBaseDimensions;
|
|
20153
|
-
this.width = Yn / ki, this.height = un / Pi,
|
|
20175
|
+
this.width = Yn / ki, this.height = un / Pi, Gr(this, o) && ml(this, p, U0).call(this, Yn, un), ml(this, p, c0).call(this), ml(this, p, s0).call(this), this.canvas.style.visibility = "visible";
|
|
20154
20176
|
}
|
|
20155
20177
|
static deserialize(Yn, un) {
|
|
20156
20178
|
var Fl, Al;
|
|
20157
|
-
const
|
|
20158
|
-
|
|
20159
|
-
const [Ni, ki] = un.pageDimensions, Pi =
|
|
20160
|
-
Cl(
|
|
20179
|
+
const Br = super.deserialize(Yn, un);
|
|
20180
|
+
Br.thickness = Yn.thickness, Br.color = r.Util.makeHexColor(...Yn.color), Br.opacity = Yn.opacity;
|
|
20181
|
+
const [Ni, ki] = un.pageDimensions, Pi = Br.width * Ni, ji = Br.height * ki, _a = un.scaleFactor, vl = Yn.thickness / 2;
|
|
20182
|
+
Cl(Br, l, Pi / ji), Cl(Br, o, !0), Cl(Br, Ye, Math.round(Pi)), Cl(Br, N, Math.round(ji));
|
|
20161
20183
|
for (const {
|
|
20162
20184
|
bezier: wl
|
|
20163
20185
|
} of Yn.paths) {
|
|
20164
20186
|
const xl = [];
|
|
20165
|
-
|
|
20187
|
+
Br.paths.push(xl);
|
|
20166
20188
|
let Ol = _a * (wl[0] - vl), fg = _a * (ji - wl[1] - vl);
|
|
20167
20189
|
for (let lg = 2, hl = wl.length; lg < hl; lg += 6) {
|
|
20168
20190
|
const gl = _a * (wl[lg] - vl), Bl = _a * (ji - wl[lg + 1] - vl), cg = _a * (wl[lg + 2] - vl), Tg = _a * (ji - wl[lg + 3] - vl), pl = _a * (wl[lg + 4] - vl), Ri = _a * (ji - wl[lg + 5] - vl);
|
|
20169
20191
|
xl.push([[Ol, fg], [gl, Bl], [cg, Tg], [pl, Ri]]), Ol = pl, fg = Ri;
|
|
20170
20192
|
}
|
|
20171
20193
|
const Rl = ml(this, Dt, z0).call(this, xl);
|
|
20172
|
-
|
|
20194
|
+
Br.bezierPath2D.push(Rl);
|
|
20173
20195
|
}
|
|
20174
|
-
const Ha = ml(Fl =
|
|
20175
|
-
return Cl(
|
|
20196
|
+
const Ha = ml(Fl = Br, p, W0).call(Fl);
|
|
20197
|
+
return Cl(Br, tt, Math.max(c, Ha[2] - Ha[0])), Cl(Br, b, Math.max(c, Ha[3] - Ha[1])), ml(Al = Br, p, U0).call(Al, Pi, ji), Br;
|
|
20176
20198
|
}
|
|
20177
20199
|
serialize() {
|
|
20178
20200
|
if (this.isEmpty())
|
|
20179
20201
|
return null;
|
|
20180
|
-
const Yn = this.getRect(0, 0), un = this.rotation % 180 === 0 ? Yn[3] - Yn[1] : Yn[2] - Yn[0],
|
|
20202
|
+
const Yn = this.getRect(0, 0), un = this.rotation % 180 === 0 ? Yn[3] - Yn[1] : Yn[2] - Yn[0], Br = s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
|
|
20181
20203
|
return {
|
|
20182
20204
|
annotationType: r.AnnotationEditorType.INK,
|
|
20183
|
-
color:
|
|
20205
|
+
color: Br,
|
|
20184
20206
|
thickness: this.thickness,
|
|
20185
20207
|
opacity: this.opacity,
|
|
20186
20208
|
paths: ml(this, p, hm).call(this, this.scaleFactor / this.parent.scaleFactor, this.translationX, this.translationY, un),
|
|
@@ -20237,9 +20259,9 @@ function requirePdf() {
|
|
|
20237
20259
|
const {
|
|
20238
20260
|
width: Yn,
|
|
20239
20261
|
height: un,
|
|
20240
|
-
rotation:
|
|
20262
|
+
rotation: Br
|
|
20241
20263
|
} = this.parent.viewport;
|
|
20242
|
-
switch (
|
|
20264
|
+
switch (Br) {
|
|
20243
20265
|
case 90:
|
|
20244
20266
|
return [0, Yn, Yn, un];
|
|
20245
20267
|
case 180:
|
|
@@ -20252,17 +20274,17 @@ function requirePdf() {
|
|
|
20252
20274
|
}, $0 = function() {
|
|
20253
20275
|
this.ctx.lineWidth = this.thickness * this.parent.scaleFactor / this.scaleFactor, this.ctx.lineCap = "round", this.ctx.lineJoin = "round", this.ctx.miterLimit = 10, this.ctx.strokeStyle = `${this.color}${(0, a.opacityToHex)(this.opacity)}`;
|
|
20254
20276
|
}, lm = function(Yn, un) {
|
|
20255
|
-
this.isEditing = !0,
|
|
20256
|
-
|
|
20257
|
-
}), window.requestAnimationFrame(
|
|
20277
|
+
this.isEditing = !0, Gr(this, pe) || (Cl(this, pe, !0), ml(this, p, c0).call(this), this.thickness || (this.thickness = zt._defaultThickness), this.color || (this.color = zt._defaultColor || s.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = zt._defaultOpacity)), this.currentPath.push([Yn, un]), Cl(this, st, null), ml(this, p, $0).call(this), this.ctx.beginPath(), this.ctx.moveTo(Yn, un), Cl(this, P, () => {
|
|
20278
|
+
Gr(this, P) && (Gr(this, st) && (this.isEmpty() ? (this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)) : ml(this, p, s0).call(this), this.ctx.lineTo(...Gr(this, st)), Cl(this, st, null), this.ctx.stroke()), window.requestAnimationFrame(Gr(this, P)));
|
|
20279
|
+
}), window.requestAnimationFrame(Gr(this, P));
|
|
20258
20280
|
}, cm = function(Yn, un) {
|
|
20259
|
-
const [
|
|
20260
|
-
Yn ===
|
|
20281
|
+
const [Br, Ni] = this.currentPath.at(-1);
|
|
20282
|
+
Yn === Br && un === Ni || (this.currentPath.push([Yn, un]), Cl(this, st, [Yn, un]));
|
|
20261
20283
|
}, dm = function(Yn, un) {
|
|
20262
20284
|
var vl;
|
|
20263
20285
|
this.ctx.closePath(), Cl(this, P, null), Yn = Math.min(Math.max(Yn, 0), this.canvas.width), un = Math.min(Math.max(un, 0), this.canvas.height);
|
|
20264
|
-
const [
|
|
20265
|
-
(Yn !==
|
|
20286
|
+
const [Br, Ni] = this.currentPath.at(-1);
|
|
20287
|
+
(Yn !== Br || un !== Ni) && this.currentPath.push([Yn, un]);
|
|
20266
20288
|
let ki;
|
|
20267
20289
|
if (this.currentPath.length !== 1)
|
|
20268
20290
|
ki = (0, i.fitCurve)(this.currentPath, 30, null);
|
|
@@ -20293,10 +20315,10 @@ function requirePdf() {
|
|
|
20293
20315
|
ctx: un
|
|
20294
20316
|
} = this;
|
|
20295
20317
|
un.setTransform(1, 0, 0, 1, 0, 0), un.clearRect(0, 0, Yn.width, Yn.height), ml(this, p, E0).call(this);
|
|
20296
|
-
for (const
|
|
20297
|
-
un.stroke(
|
|
20318
|
+
for (const Br of this.bezierPath2D)
|
|
20319
|
+
un.stroke(Br);
|
|
20298
20320
|
}, j0 = function(Yn) {
|
|
20299
|
-
ml(this, p, dm).call(this, Yn.offsetX, Yn.offsetY), this.canvas.removeEventListener("pointerleave",
|
|
20321
|
+
ml(this, p, dm).call(this, Yn.offsetX, Yn.offsetY), this.canvas.removeEventListener("pointerleave", Gr(this, Le)), this.canvas.removeEventListener("pointermove", Gr(this, de)), this.parent.addToAnnotationStorage(this);
|
|
20300
20322
|
}, y0 = function() {
|
|
20301
20323
|
this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", zt._l10nPromise.get("editor_ink_canvas_aria_label").then((Yn) => {
|
|
20302
20324
|
var un;
|
|
@@ -20306,32 +20328,32 @@ function requirePdf() {
|
|
|
20306
20328
|
Cl(this, nt, new ResizeObserver((Yn) => {
|
|
20307
20329
|
const un = Yn[0].contentRect;
|
|
20308
20330
|
un.width && un.height && this.setDimensions(un.width, un.height);
|
|
20309
|
-
})),
|
|
20331
|
+
})), Gr(this, nt).observe(this.div);
|
|
20310
20332
|
}, c0 = function() {
|
|
20311
|
-
if (!
|
|
20333
|
+
if (!Gr(this, pe))
|
|
20312
20334
|
return;
|
|
20313
20335
|
const [Yn, un] = this.parent.viewportBaseDimensions;
|
|
20314
20336
|
this.canvas.width = Math.ceil(this.width * Yn), this.canvas.height = Math.ceil(this.height * un), ml(this, p, E0).call(this);
|
|
20315
20337
|
}, U0 = function(Yn, un) {
|
|
20316
|
-
const
|
|
20338
|
+
const Br = ml(this, p, D0).call(this), Ni = (Yn - Br) / Gr(this, tt), ki = (un - Br) / Gr(this, b);
|
|
20317
20339
|
this.scaleFactor = Math.min(Ni, ki);
|
|
20318
20340
|
}, E0 = function() {
|
|
20319
20341
|
const Yn = ml(this, p, D0).call(this) / 2;
|
|
20320
20342
|
this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + Yn, this.translationY * this.scaleFactor + Yn);
|
|
20321
20343
|
}, Dt = new WeakSet(), z0 = function(Yn) {
|
|
20322
20344
|
const un = new Path2D();
|
|
20323
|
-
for (let
|
|
20324
|
-
const [ki, Pi, ji, _a] = Yn[
|
|
20325
|
-
|
|
20345
|
+
for (let Br = 0, Ni = Yn.length; Br < Ni; Br++) {
|
|
20346
|
+
const [ki, Pi, ji, _a] = Yn[Br];
|
|
20347
|
+
Br === 0 && un.moveTo(...ki), un.bezierCurveTo(Pi[0], Pi[1], ji[0], ji[1], _a[0], _a[1]);
|
|
20326
20348
|
}
|
|
20327
20349
|
return un;
|
|
20328
|
-
}, hm = function(Yn, un,
|
|
20350
|
+
}, hm = function(Yn, un, Br, Ni) {
|
|
20329
20351
|
const Pi = [], ji = this.thickness / 2;
|
|
20330
20352
|
let _a, vl;
|
|
20331
20353
|
for (const Ha of this.paths) {
|
|
20332
20354
|
_a = [], vl = [];
|
|
20333
20355
|
for (let Fl = 0, Al = Ha.length; Fl < Al; Fl++) {
|
|
20334
|
-
const [wl, xl, Ol, fg] = Ha[Fl], Rl = Yn * (wl[0] + un) + ji, lg = Ni - Yn * (wl[1] +
|
|
20356
|
+
const [wl, xl, Ol, fg] = Ha[Fl], Rl = Yn * (wl[0] + un) + ji, lg = Ni - Yn * (wl[1] + Br) - ji, hl = Yn * (xl[0] + un) + ji, gl = Ni - Yn * (xl[1] + Br) - ji, Bl = Yn * (Ol[0] + un) + ji, cg = Ni - Yn * (Ol[1] + Br) - ji, Tg = Yn * (fg[0] + un) + ji, pl = Ni - Yn * (fg[1] + Br) - ji;
|
|
20335
20357
|
Fl === 0 && (_a.push(Rl, lg), vl.push(Rl, lg)), _a.push(hl, gl, Bl, cg, Tg, pl), ml(this, p, fm).call(this, Rl, lg, hl, gl, Bl, cg, Tg, pl, 4, vl);
|
|
20336
20358
|
}
|
|
20337
20359
|
Pi.push({
|
|
@@ -20340,51 +20362,51 @@ function requirePdf() {
|
|
|
20340
20362
|
});
|
|
20341
20363
|
}
|
|
20342
20364
|
return Pi;
|
|
20343
|
-
}, fm = function(Yn, un,
|
|
20344
|
-
if (ml(this, p, pm).call(this, Yn, un,
|
|
20365
|
+
}, fm = function(Yn, un, Br, Ni, ki, Pi, ji, _a, vl, Ha) {
|
|
20366
|
+
if (ml(this, p, pm).call(this, Yn, un, Br, Ni, ki, Pi, ji, _a)) {
|
|
20345
20367
|
Ha.push(ji, _a);
|
|
20346
20368
|
return;
|
|
20347
20369
|
}
|
|
20348
20370
|
for (let Fl = 1; Fl < vl - 1; Fl++) {
|
|
20349
20371
|
const Al = Fl / vl, wl = 1 - Al;
|
|
20350
|
-
let xl = Al * Yn + wl *
|
|
20372
|
+
let xl = Al * Yn + wl * Br, Ol = Al * un + wl * Ni, fg = Al * Br + wl * ki, Rl = Al * Ni + wl * Pi;
|
|
20351
20373
|
const lg = Al * ki + wl * ji, hl = Al * Pi + wl * _a;
|
|
20352
20374
|
xl = Al * xl + wl * fg, Ol = Al * Ol + wl * Rl, fg = Al * fg + wl * lg, Rl = Al * Rl + wl * hl, xl = Al * xl + wl * fg, Ol = Al * Ol + wl * Rl, Ha.push(xl, Ol);
|
|
20353
20375
|
}
|
|
20354
20376
|
Ha.push(ji, _a);
|
|
20355
|
-
}, pm = function(Yn, un,
|
|
20356
|
-
const Ha = (3 *
|
|
20377
|
+
}, pm = function(Yn, un, Br, Ni, ki, Pi, ji, _a) {
|
|
20378
|
+
const Ha = (3 * Br - 2 * Yn - ji) ** 2, Fl = (3 * Ni - 2 * un - _a) ** 2, Al = (3 * ki - Yn - 2 * ji) ** 2, wl = (3 * Pi - un - 2 * _a) ** 2;
|
|
20357
20379
|
return Math.max(Ha, Al) + Math.max(Fl, wl) <= 10;
|
|
20358
20380
|
}, W0 = function() {
|
|
20359
|
-
let Yn = 1 / 0, un = -1 / 0,
|
|
20381
|
+
let Yn = 1 / 0, un = -1 / 0, Br = 1 / 0, Ni = -1 / 0;
|
|
20360
20382
|
for (const ki of this.paths)
|
|
20361
20383
|
for (const [Pi, ji, _a, vl] of ki) {
|
|
20362
20384
|
const Ha = r.Util.bezierBoundingBox(...Pi, ...ji, ..._a, ...vl);
|
|
20363
|
-
Yn = Math.min(Yn, Ha[0]),
|
|
20385
|
+
Yn = Math.min(Yn, Ha[0]), Br = Math.min(Br, Ha[1]), un = Math.max(un, Ha[2]), Ni = Math.max(Ni, Ha[3]);
|
|
20364
20386
|
}
|
|
20365
|
-
return [Yn,
|
|
20387
|
+
return [Yn, Br, un, Ni];
|
|
20366
20388
|
}, D0 = function() {
|
|
20367
|
-
return
|
|
20389
|
+
return Gr(this, o) ? Math.ceil(this.thickness * this.parent.scaleFactor) : 0;
|
|
20368
20390
|
}, d0 = function(Yn = !1) {
|
|
20369
20391
|
if (this.isEmpty())
|
|
20370
20392
|
return;
|
|
20371
|
-
if (!
|
|
20393
|
+
if (!Gr(this, o)) {
|
|
20372
20394
|
ml(this, p, s0).call(this);
|
|
20373
20395
|
return;
|
|
20374
20396
|
}
|
|
20375
|
-
const un = ml(this, p, W0).call(this),
|
|
20397
|
+
const un = ml(this, p, W0).call(this), Br = ml(this, p, D0).call(this);
|
|
20376
20398
|
Cl(this, tt, Math.max(c, un[2] - un[0])), Cl(this, b, Math.max(c, un[3] - un[1]));
|
|
20377
|
-
const Ni = Math.ceil(
|
|
20399
|
+
const Ni = Math.ceil(Br + Gr(this, tt) * this.scaleFactor), ki = Math.ceil(Br + Gr(this, b) * this.scaleFactor), [Pi, ji] = this.parent.viewportBaseDimensions;
|
|
20378
20400
|
this.width = Ni / Pi, this.height = ki / ji, Cl(this, l, Ni / ki), ml(this, p, q0).call(this);
|
|
20379
20401
|
const _a = this.translationX, vl = this.translationY;
|
|
20380
20402
|
this.translationX = -un[0], this.translationY = -un[1], ml(this, p, c0).call(this), ml(this, p, s0).call(this), Cl(this, Ye, Ni), Cl(this, N, ki), this.setDims(Ni, ki);
|
|
20381
|
-
const Ha = Yn ?
|
|
20403
|
+
const Ha = Yn ? Br / this.scaleFactor / 2 : 0;
|
|
20382
20404
|
this.translate(_a - this.translationX - Ha, vl - this.translationY - Ha);
|
|
20383
20405
|
}, q0 = function() {
|
|
20384
20406
|
const {
|
|
20385
20407
|
style: Yn
|
|
20386
20408
|
} = this.div;
|
|
20387
|
-
|
|
20409
|
+
Gr(this, l) >= 1 ? (Yn.minHeight = `${c}px`, Yn.minWidth = `${Math.round(Gr(this, l) * c)}px`) : (Yn.minWidth = `${c}px`, Yn.minHeight = `${Math.round(c / Gr(this, l))}px`);
|
|
20388
20410
|
}, bl(zt, Dt), Yg(zt, "_defaultColor", null), Yg(zt, "_defaultOpacity", 1), Yg(zt, "_defaultThickness", 1), Yg(zt, "_l10nPromise"), Yg(zt, "_type", "ink");
|
|
20389
20411
|
let h = zt;
|
|
20390
20412
|
t.InkEditor = h;
|
|
@@ -20413,13 +20435,13 @@ function requirePdf() {
|
|
|
20413
20435
|
return n(E, st, nt, u, o);
|
|
20414
20436
|
}
|
|
20415
20437
|
function n(E, u, o, pe, st) {
|
|
20416
|
-
var Ye, N, P, p, mt, It, Zn, Kn, Is, qs,
|
|
20438
|
+
var Ye, N, P, p, mt, It, Zn, Kn, Is, qs, Ur, Ar, Fr;
|
|
20417
20439
|
if (E.length === 2)
|
|
20418
|
-
return
|
|
20440
|
+
return Ar = de.vectorLen(de.subtract(E[0], E[1])) / 3, Ye = [E[0], de.addArrays(E[0], de.mulItems(u, Ar)), de.addArrays(E[1], de.mulItems(o, Ar)), E[1]], [Ye];
|
|
20419
20441
|
if (N = c(E), [Ye, p, It] = r(E, N, N, u, o, st), p === 0 || p < pe)
|
|
20420
20442
|
return [Ye];
|
|
20421
20443
|
if (p < pe * pe)
|
|
20422
|
-
for (P = N, mt = p, Zn = It,
|
|
20444
|
+
for (P = N, mt = p, Zn = It, Fr = 0; Fr < 20; Fr++) {
|
|
20423
20445
|
if (P = i(Ye, E, P), [Ye, p, It] = r(E, N, P, u, o, st), p < pe)
|
|
20424
20446
|
return [Ye];
|
|
20425
20447
|
if (It === Zn) {
|
|
@@ -20429,7 +20451,7 @@ function requirePdf() {
|
|
|
20429
20451
|
}
|
|
20430
20452
|
mt = p, Zn = It;
|
|
20431
20453
|
}
|
|
20432
|
-
return
|
|
20454
|
+
return Ur = [], Kn = de.subtract(E[It - 1], E[It + 1]), Kn.every((sr) => sr === 0) && (Kn = de.subtract(E[It - 1], E[It]), [Kn[0], Kn[1]] = [-Kn[1], Kn[0]]), Is = de.normalize(Kn), qs = de.mulItems(Is, -1), Ur = Ur.concat(n(E.slice(0, It + 1), u, Is, pe, st)), Ur = Ur.concat(n(E.slice(It), qs, o, pe, st)), Ur;
|
|
20433
20455
|
}
|
|
20434
20456
|
function r(E, u, o, pe, st, nt) {
|
|
20435
20457
|
var Ye, N, P;
|
|
@@ -20442,11 +20464,11 @@ function requirePdf() {
|
|
|
20442
20464
|
}), [Ye, N, P];
|
|
20443
20465
|
}
|
|
20444
20466
|
function s(E, u, o, pe) {
|
|
20445
|
-
var st, nt, Ye, N, P, p, mt, It, Zn, Kn, Is, qs,
|
|
20446
|
-
for (st = [Si, null, null, Oi], nt = de.zeros_Xx2x2(u.length),
|
|
20447
|
-
sr = u[
|
|
20448
|
-
for (N = [[0, 0], [0, 0]], P = [0, 0],
|
|
20449
|
-
sr = u[
|
|
20467
|
+
var st, nt, Ye, N, P, p, mt, It, Zn, Kn, Is, qs, Ur, Ar, Fr, sr, As, Si = E[0], Oi = E[E.length - 1];
|
|
20468
|
+
for (st = [Si, null, null, Oi], nt = de.zeros_Xx2x2(u.length), Ur = 0, Ar = u.length; Ur < Ar; Ur++)
|
|
20469
|
+
sr = u[Ur], As = 1 - sr, Ye = nt[Ur], Ye[0] = de.mulItems(o, 3 * sr * (As * As)), Ye[1] = de.mulItems(pe, 3 * As * (sr * sr));
|
|
20470
|
+
for (N = [[0, 0], [0, 0]], P = [0, 0], Ur = 0, Ar = E.length; Ur < Ar; Ur++)
|
|
20471
|
+
sr = u[Ur], Ye = nt[Ur], N[0][0] += de.dot(Ye[0], Ye[0]), N[0][1] += de.dot(Ye[0], Ye[1]), N[1][0] += de.dot(Ye[0], Ye[1]), N[1][1] += de.dot(Ye[1], Ye[1]), Fr = de.subtract(E[Ur], Le.q([Si, Si, Oi, Oi], sr)), P[0] += de.dot(Ye[0], Fr), P[1] += de.dot(Ye[1], Fr);
|
|
20450
20472
|
return p = N[0][0] * N[1][1] - N[1][0] * N[0][1], mt = N[0][0] * P[1] - N[1][0] * P[0], It = P[0] * N[1][1] - P[1] * N[0][1], Zn = p === 0 ? 0 : It / p, Kn = p === 0 ? 0 : mt / p, qs = de.vectorLen(de.subtract(Si, Oi)), Is = 1e-6 * qs, Zn < Is || Kn < Is ? (st[1] = de.addArrays(Si, de.mulItems(o, qs / 3)), st[2] = de.addArrays(Oi, de.mulItems(pe, qs / 3))) : (st[1] = de.addArrays(Si, de.mulItems(o, Zn)), st[2] = de.addArrays(Oi, de.mulItems(pe, Kn))), st;
|
|
20451
20473
|
}
|
|
20452
20474
|
function i(E, u, o) {
|
|
@@ -20590,13 +20612,13 @@ function requirePdf() {
|
|
|
20590
20612
|
case r.AnnotationType.POLYLINE:
|
|
20591
20613
|
return new Is(me);
|
|
20592
20614
|
case r.AnnotationType.CARET:
|
|
20593
|
-
return new Gr(me);
|
|
20594
|
-
case r.AnnotationType.INK:
|
|
20595
20615
|
return new Ur(me);
|
|
20616
|
+
case r.AnnotationType.INK:
|
|
20617
|
+
return new Ar(me);
|
|
20596
20618
|
case r.AnnotationType.POLYGON:
|
|
20597
20619
|
return new qs(me);
|
|
20598
20620
|
case r.AnnotationType.HIGHLIGHT:
|
|
20599
|
-
return new
|
|
20621
|
+
return new Fr(me);
|
|
20600
20622
|
case r.AnnotationType.UNDERLINE:
|
|
20601
20623
|
return new sr(me);
|
|
20602
20624
|
case r.AnnotationType.SQUIGGLY:
|
|
@@ -20624,7 +20646,7 @@ function requirePdf() {
|
|
|
20624
20646
|
const kt = this.data, Lt = this.page, zt = this.viewport, ln = document.createElement("section"), {
|
|
20625
20647
|
width: nr,
|
|
20626
20648
|
height: Yn
|
|
20627
|
-
} = tt(kt.rect), [un,
|
|
20649
|
+
} = tt(kt.rect), [un, Br, Ni, ki] = zt.viewBox, Pi = Ni - un, ji = ki - Br;
|
|
20628
20650
|
ln.setAttribute("data-annotation-id", kt.id);
|
|
20629
20651
|
const _a = r.Util.normalizeRect([kt.rect[0], Lt.view[3] - kt.rect[1] + Lt.view[1], kt.rect[2], Lt.view[3] - kt.rect[3] + Lt.view[1]]);
|
|
20630
20652
|
if (!me && kt.borderStyle.width > 0) {
|
|
@@ -20657,7 +20679,7 @@ function requirePdf() {
|
|
|
20657
20679
|
const Al = kt.borderColor || null;
|
|
20658
20680
|
Al ? ln.style.borderColor = r.Util.makeHexColor(Al[0] | 0, Al[1] | 0, Al[2] | 0) : ln.style.borderWidth = 0;
|
|
20659
20681
|
}
|
|
20660
|
-
ln.style.left = `${100 * (_a[0] - un) / Pi}%`, ln.style.top = `${100 * (_a[1] -
|
|
20682
|
+
ln.style.left = `${100 * (_a[0] - un) / Pi}%`, ln.style.top = `${100 * (_a[1] - Br) / ji}%`;
|
|
20661
20683
|
const {
|
|
20662
20684
|
rotation: vl
|
|
20663
20685
|
} = kt;
|
|
@@ -20665,11 +20687,11 @@ function requirePdf() {
|
|
|
20665
20687
|
}
|
|
20666
20688
|
setRotation(me, kt = this.container) {
|
|
20667
20689
|
const [Lt, zt, ln, nr] = this.viewport.viewBox, Yn = ln - Lt, un = nr - zt, {
|
|
20668
|
-
width:
|
|
20690
|
+
width: Br,
|
|
20669
20691
|
height: Ni
|
|
20670
20692
|
} = tt(this.data.rect);
|
|
20671
20693
|
let ki, Pi;
|
|
20672
|
-
me % 180 === 0 ? (ki = 100 *
|
|
20694
|
+
me % 180 === 0 ? (ki = 100 * Br / Yn, Pi = 100 * Ni / un) : (ki = 100 * Ni / Yn, Pi = 100 * Br / un), kt.style.width = `${ki}%`, kt.style.height = `${Pi}%`, kt.setAttribute("data-main-rotation", (360 - me) % 360);
|
|
20673
20695
|
}
|
|
20674
20696
|
get _commonActions() {
|
|
20675
20697
|
const me = (kt, Lt, zt) => {
|
|
@@ -20804,15 +20826,15 @@ function requirePdf() {
|
|
|
20804
20826
|
} of zt) {
|
|
20805
20827
|
if (ln === -1 || nr === kt)
|
|
20806
20828
|
continue;
|
|
20807
|
-
const un = typeof Yn == "string" ? Yn : null,
|
|
20808
|
-
if (
|
|
20829
|
+
const un = typeof Yn == "string" ? Yn : null, Br = document.querySelector(`[data-element-id="${nr}"]`);
|
|
20830
|
+
if (Br && !b.has(Br)) {
|
|
20809
20831
|
(0, r.warn)(`_getElementsByName - element not allowed: ${nr}`);
|
|
20810
20832
|
continue;
|
|
20811
20833
|
}
|
|
20812
20834
|
Lt.push({
|
|
20813
20835
|
id: nr,
|
|
20814
20836
|
exportValue: un,
|
|
20815
|
-
domElement:
|
|
20837
|
+
domElement: Br
|
|
20816
20838
|
});
|
|
20817
20839
|
}
|
|
20818
20840
|
return Lt;
|
|
@@ -20911,12 +20933,12 @@ function requirePdf() {
|
|
|
20911
20933
|
} else
|
|
20912
20934
|
for (const ki of Object.values(this._fieldObjects))
|
|
20913
20935
|
Yn.push(...ki);
|
|
20914
|
-
const un = this.annotationStorage,
|
|
20936
|
+
const un = this.annotationStorage, Br = [];
|
|
20915
20937
|
for (const ki of Yn) {
|
|
20916
20938
|
const {
|
|
20917
20939
|
id: Pi
|
|
20918
20940
|
} = ki;
|
|
20919
|
-
switch (
|
|
20941
|
+
switch (Br.push(Pi), ki.type) {
|
|
20920
20942
|
case "text": {
|
|
20921
20943
|
const _a = ki.defaultValue || "";
|
|
20922
20944
|
un.setValue(Pi, {
|
|
@@ -20956,7 +20978,7 @@ function requirePdf() {
|
|
|
20956
20978
|
source: this,
|
|
20957
20979
|
detail: {
|
|
20958
20980
|
id: "app",
|
|
20959
|
-
ids:
|
|
20981
|
+
ids: Br,
|
|
20960
20982
|
name: "ResetForm"
|
|
20961
20983
|
}
|
|
20962
20984
|
})), !1;
|
|
@@ -21030,8 +21052,8 @@ function requirePdf() {
|
|
|
21030
21052
|
} = this.data.defaultAppearanceData, zt = this.data.defaultAppearanceData.fontSize || l, ln = me.style;
|
|
21031
21053
|
let nr;
|
|
21032
21054
|
if (this.data.multiLine) {
|
|
21033
|
-
const Yn = Math.abs(this.data.rect[3] - this.data.rect[1]), un = Math.round(Yn / (r.LINE_FACTOR * zt)) || 1,
|
|
21034
|
-
nr = Math.min(zt, Math.round(
|
|
21055
|
+
const Yn = Math.abs(this.data.rect[3] - this.data.rect[1]), un = Math.round(Yn / (r.LINE_FACTOR * zt)) || 1, Br = Yn / un;
|
|
21056
|
+
nr = Math.min(zt, Math.round(Br / r.LINE_FACTOR));
|
|
21035
21057
|
} else {
|
|
21036
21058
|
const Yn = Math.abs(this.data.rect[3] - this.data.rect[1]);
|
|
21037
21059
|
nr = Math.min(zt, Math.round(Yn / r.LINE_FACTOR));
|
|
@@ -21083,7 +21105,7 @@ function requirePdf() {
|
|
|
21083
21105
|
const ki = this.data.defaultFieldValue ?? "";
|
|
21084
21106
|
Lt.value = un.userValue = ki, un.formattedValue = null;
|
|
21085
21107
|
});
|
|
21086
|
-
let
|
|
21108
|
+
let Br = (Ni) => {
|
|
21087
21109
|
const {
|
|
21088
21110
|
formattedValue: ki
|
|
21089
21111
|
} = un;
|
|
@@ -21161,8 +21183,8 @@ function requirePdf() {
|
|
|
21161
21183
|
}
|
|
21162
21184
|
}));
|
|
21163
21185
|
});
|
|
21164
|
-
const Ni =
|
|
21165
|
-
|
|
21186
|
+
const Ni = Br;
|
|
21187
|
+
Br = null, Lt.addEventListener("blur", (ki) => {
|
|
21166
21188
|
var ji;
|
|
21167
21189
|
const {
|
|
21168
21190
|
value: Pi
|
|
@@ -21222,7 +21244,7 @@ function requirePdf() {
|
|
|
21222
21244
|
});
|
|
21223
21245
|
}), this._setEventListeners(Lt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (ki) => ki.target.value);
|
|
21224
21246
|
}
|
|
21225
|
-
if (
|
|
21247
|
+
if (Br && Lt.addEventListener("blur", Br), this.data.comb) {
|
|
21226
21248
|
const ki = (this.data.rect[2] - this.data.rect[0]) / Yn;
|
|
21227
21249
|
Lt.classList.add("comb"), Lt.style.letterSpacing = `calc(${ki}px * var(--scale-factor) - 1ch)`;
|
|
21228
21250
|
}
|
|
@@ -21251,9 +21273,9 @@ function requirePdf() {
|
|
|
21251
21273
|
name: Yn,
|
|
21252
21274
|
checked: un
|
|
21253
21275
|
} = nr.target;
|
|
21254
|
-
for (const
|
|
21255
|
-
const Ni = un &&
|
|
21256
|
-
|
|
21276
|
+
for (const Br of this._getElementsByName(Yn, Lt)) {
|
|
21277
|
+
const Ni = un && Br.exportValue === kt.exportValue;
|
|
21278
|
+
Br.domElement && (Br.domElement.checked = Ni), me.setValue(Br.id, {
|
|
21257
21279
|
value: Ni
|
|
21258
21280
|
});
|
|
21259
21281
|
}
|
|
@@ -21296,8 +21318,8 @@ function requirePdf() {
|
|
|
21296
21318
|
name: Yn,
|
|
21297
21319
|
checked: un
|
|
21298
21320
|
} = nr.target;
|
|
21299
|
-
for (const
|
|
21300
|
-
me.setValue(
|
|
21321
|
+
for (const Br of this._getElementsByName(Yn, Lt))
|
|
21322
|
+
me.setValue(Br.id, {
|
|
21301
21323
|
value: !1
|
|
21302
21324
|
});
|
|
21303
21325
|
me.setValue(Lt, {
|
|
@@ -21310,9 +21332,9 @@ function requirePdf() {
|
|
|
21310
21332
|
const nr = kt.buttonValue;
|
|
21311
21333
|
ln.addEventListener("updatefromsandbox", (Yn) => {
|
|
21312
21334
|
const un = {
|
|
21313
|
-
value: (
|
|
21314
|
-
const Ni = nr ===
|
|
21315
|
-
for (const ki of this._getElementsByName(
|
|
21335
|
+
value: (Br) => {
|
|
21336
|
+
const Ni = nr === Br.detail.value;
|
|
21337
|
+
for (const ki of this._getElementsByName(Br.target.name)) {
|
|
21316
21338
|
const Pi = Ni && ki.id === Lt;
|
|
21317
21339
|
ki.domElement && (ki.domElement.checked = Pi), me.setValue(ki.id, {
|
|
21318
21340
|
value: Pi
|
|
@@ -21354,33 +21376,33 @@ function requirePdf() {
|
|
|
21354
21376
|
}), zt = document.createElement("select");
|
|
21355
21377
|
b.add(zt), zt.setAttribute("data-element-id", kt), zt.disabled = this.data.readOnly, this._setRequired(zt, this.data.required), zt.name = this.data.fieldName, zt.tabIndex = h;
|
|
21356
21378
|
let ln = this.data.combo && this.data.options.length > 0;
|
|
21357
|
-
this.data.combo || (zt.size = this.data.options.length, this.data.multiSelect && (zt.multiple = !0)), zt.addEventListener("resetform", (
|
|
21379
|
+
this.data.combo || (zt.size = this.data.options.length, this.data.multiSelect && (zt.multiple = !0)), zt.addEventListener("resetform", (Br) => {
|
|
21358
21380
|
const Ni = this.data.defaultFieldValue;
|
|
21359
21381
|
for (const ki of zt.options)
|
|
21360
21382
|
ki.selected = ki.value === Ni;
|
|
21361
21383
|
});
|
|
21362
|
-
for (const
|
|
21384
|
+
for (const Br of this.data.options) {
|
|
21363
21385
|
const Ni = document.createElement("option");
|
|
21364
|
-
Ni.textContent =
|
|
21386
|
+
Ni.textContent = Br.displayValue, Ni.value = Br.exportValue, Lt.value.includes(Br.exportValue) && (Ni.setAttribute("selected", !0), ln = !1), zt.append(Ni);
|
|
21365
21387
|
}
|
|
21366
21388
|
let nr = null;
|
|
21367
21389
|
if (ln) {
|
|
21368
|
-
const
|
|
21369
|
-
|
|
21370
|
-
|
|
21390
|
+
const Br = document.createElement("option");
|
|
21391
|
+
Br.value = " ", Br.setAttribute("hidden", !0), Br.setAttribute("selected", !0), zt.prepend(Br), nr = () => {
|
|
21392
|
+
Br.remove(), zt.removeEventListener("input", nr), nr = null;
|
|
21371
21393
|
}, zt.addEventListener("input", nr);
|
|
21372
21394
|
}
|
|
21373
|
-
const Yn = (
|
|
21374
|
-
const ki = Ni ? "value" : "textContent", Pi =
|
|
21375
|
-
return
|
|
21376
|
-
}, un = (
|
|
21377
|
-
const Ni =
|
|
21395
|
+
const Yn = (Br, Ni) => {
|
|
21396
|
+
const ki = Ni ? "value" : "textContent", Pi = Br.target.options;
|
|
21397
|
+
return Br.target.multiple ? Array.prototype.filter.call(Pi, (ji) => ji.selected).map((ji) => ji[ki]) : Pi.selectedIndex === -1 ? null : Pi[Pi.selectedIndex][ki];
|
|
21398
|
+
}, un = (Br) => {
|
|
21399
|
+
const Ni = Br.target.options;
|
|
21378
21400
|
return Array.prototype.map.call(Ni, (ki) => ({
|
|
21379
21401
|
displayValue: ki.textContent,
|
|
21380
21402
|
exportValue: ki.value
|
|
21381
21403
|
}));
|
|
21382
21404
|
};
|
|
21383
|
-
return this.enableScripting && this.hasJSActions ? (zt.addEventListener("updatefromsandbox", (
|
|
21405
|
+
return this.enableScripting && this.hasJSActions ? (zt.addEventListener("updatefromsandbox", (Br) => {
|
|
21384
21406
|
const Ni = {
|
|
21385
21407
|
value(ki) {
|
|
21386
21408
|
nr == null || nr();
|
|
@@ -21450,10 +21472,10 @@ function requirePdf() {
|
|
|
21450
21472
|
ki.target.disabled = !ki.detail.editable;
|
|
21451
21473
|
}
|
|
21452
21474
|
};
|
|
21453
|
-
this._dispatchEventFromSandbox(Ni,
|
|
21454
|
-
}), zt.addEventListener("input", (
|
|
21475
|
+
this._dispatchEventFromSandbox(Ni, Br);
|
|
21476
|
+
}), zt.addEventListener("input", (Br) => {
|
|
21455
21477
|
var Pi;
|
|
21456
|
-
const Ni = Yn(
|
|
21478
|
+
const Ni = Yn(Br, !0), ki = Yn(Br, !1);
|
|
21457
21479
|
me.setValue(kt, {
|
|
21458
21480
|
value: Ni
|
|
21459
21481
|
}), (Pi = this.linkService.eventBus) == null || Pi.dispatch("dispatcheventinsandbox", {
|
|
@@ -21468,9 +21490,9 @@ function requirePdf() {
|
|
|
21468
21490
|
keyDown: !1
|
|
21469
21491
|
}
|
|
21470
21492
|
});
|
|
21471
|
-
}), this._setEventListeners(zt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"]], (
|
|
21493
|
+
}), this._setEventListeners(zt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"]], (Br) => Br.target.checked)) : zt.addEventListener("input", function(Br) {
|
|
21472
21494
|
me.setValue(kt, {
|
|
21473
|
-
value: Yn(
|
|
21495
|
+
value: Yn(Br, !0)
|
|
21474
21496
|
});
|
|
21475
21497
|
}), this.data.combo && this._setTextStyle(zt), this._setBackgroundColor(zt), this._setDefaultPropertiesFromJS(zt), this.container.append(zt), this.container;
|
|
21476
21498
|
}
|
|
@@ -21498,8 +21520,8 @@ function requirePdf() {
|
|
|
21498
21520
|
modificationDate: this.data.modificationDate,
|
|
21499
21521
|
contentsObj: this.data.contentsObj,
|
|
21500
21522
|
richText: this.data.richText
|
|
21501
|
-
}), ln = this.page, nr = r.Util.normalizeRect([this.data.parentRect[0], ln.view[3] - this.data.parentRect[1] + ln.view[1], this.data.parentRect[2], ln.view[3] - this.data.parentRect[3] + ln.view[1]]), Yn = nr[0] + this.data.parentRect[2] - this.data.parentRect[0], un = nr[1], [
|
|
21502
|
-
return this.container.style.left = `${100 * (Yn -
|
|
21523
|
+
}), ln = this.page, nr = r.Util.normalizeRect([this.data.parentRect[0], ln.view[3] - this.data.parentRect[1] + ln.view[1], this.data.parentRect[2], ln.view[3] - this.data.parentRect[3] + ln.view[1]]), Yn = nr[0] + this.data.parentRect[2] - this.data.parentRect[0], un = nr[1], [Br, Ni, ki, Pi] = this.viewport.viewBox, ji = ki - Br, _a = Pi - Ni;
|
|
21524
|
+
return this.container.style.left = `${100 * (Yn - Br) / ji}%`, this.container.style.top = `${100 * (un - Ni) / _a}%`, this.container.append(zt.render()), this.container;
|
|
21503
21525
|
}
|
|
21504
21526
|
}
|
|
21505
21527
|
class p {
|
|
@@ -21514,18 +21536,18 @@ function requirePdf() {
|
|
|
21514
21536
|
Lt.className = "popup";
|
|
21515
21537
|
const zt = this.color;
|
|
21516
21538
|
if (zt) {
|
|
21517
|
-
const
|
|
21518
|
-
Lt.style.backgroundColor = r.Util.makeHexColor(
|
|
21539
|
+
const Br = 0.7 * (255 - zt[0]) + zt[0], Ni = 0.7 * (255 - zt[1]) + zt[1], ki = 0.7 * (255 - zt[2]) + zt[2];
|
|
21540
|
+
Lt.style.backgroundColor = r.Util.makeHexColor(Br | 0, Ni | 0, ki | 0);
|
|
21519
21541
|
}
|
|
21520
21542
|
const ln = document.createElement("h1");
|
|
21521
21543
|
ln.dir = this.titleObj.dir, ln.textContent = this.titleObj.str, Lt.append(ln);
|
|
21522
21544
|
const nr = s.PDFDateString.toDateObject(this.modificationDate);
|
|
21523
21545
|
if (nr) {
|
|
21524
|
-
const
|
|
21525
|
-
|
|
21546
|
+
const Br = document.createElement("span");
|
|
21547
|
+
Br.className = "popupDate", Br.textContent = "{{date}}, {{time}}", Br.dataset.l10nId = "annotation_date_string", Br.dataset.l10nArgs = JSON.stringify({
|
|
21526
21548
|
date: nr.toLocaleDateString(),
|
|
21527
21549
|
time: nr.toLocaleTimeString()
|
|
21528
|
-
}), Lt.append(
|
|
21550
|
+
}), Lt.append(Br);
|
|
21529
21551
|
}
|
|
21530
21552
|
if ((Yn = this.richText) != null && Yn.str && (!((un = this.contentsObj) != null && un.str) || this.contentsObj.str === this.richText.str))
|
|
21531
21553
|
c.XfaLayer.render({
|
|
@@ -21534,12 +21556,12 @@ function requirePdf() {
|
|
|
21534
21556
|
div: Lt
|
|
21535
21557
|
}), Lt.lastChild.className = "richText popupContent";
|
|
21536
21558
|
else {
|
|
21537
|
-
const
|
|
21538
|
-
Lt.append(
|
|
21559
|
+
const Br = this._formatContents(this.contentsObj);
|
|
21560
|
+
Lt.append(Br);
|
|
21539
21561
|
}
|
|
21540
21562
|
Array.isArray(this.trigger) || (this.trigger = [this.trigger]);
|
|
21541
|
-
for (const
|
|
21542
|
-
|
|
21563
|
+
for (const Br of this.trigger)
|
|
21564
|
+
Br.addEventListener("click", this._toggle.bind(this)), Br.addEventListener("mouseover", this._show.bind(this, !1)), Br.addEventListener("mouseout", this._hide.bind(this, !1));
|
|
21543
21565
|
return Lt.addEventListener("click", this._hide.bind(this, !0)), kt.append(Lt), kt;
|
|
21544
21566
|
}
|
|
21545
21567
|
_formatContents({
|
|
@@ -21658,8 +21680,8 @@ function requirePdf() {
|
|
|
21658
21680
|
} = tt(me.rect), zt = this.svgFactory.create(kt, Lt, !0);
|
|
21659
21681
|
let ln = [];
|
|
21660
21682
|
for (const Yn of me.vertices) {
|
|
21661
|
-
const un = Yn.x - me.rect[0],
|
|
21662
|
-
ln.push(un + "," +
|
|
21683
|
+
const un = Yn.x - me.rect[0], Br = me.rect[3] - Yn.y;
|
|
21684
|
+
ln.push(un + "," + Br);
|
|
21663
21685
|
}
|
|
21664
21686
|
ln = ln.join(" ");
|
|
21665
21687
|
const nr = this.svgFactory.createElement(this.svgElementName);
|
|
@@ -21671,7 +21693,7 @@ function requirePdf() {
|
|
|
21671
21693
|
super(me), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
|
|
21672
21694
|
}
|
|
21673
21695
|
}
|
|
21674
|
-
class
|
|
21696
|
+
class Ur extends Le {
|
|
21675
21697
|
constructor(me) {
|
|
21676
21698
|
var Lt, zt, ln;
|
|
21677
21699
|
const kt = !!(me.data.hasPopup || (Lt = me.data.titleObj) != null && Lt.str || (zt = me.data.contentsObj) != null && zt.str || (ln = me.data.richText) != null && ln.str);
|
|
@@ -21684,7 +21706,7 @@ function requirePdf() {
|
|
|
21684
21706
|
return this.container.className = "caretAnnotation", this.data.hasPopup || this._createPopup(null, this.data), this.container;
|
|
21685
21707
|
}
|
|
21686
21708
|
}
|
|
21687
|
-
class
|
|
21709
|
+
class Ar extends Le {
|
|
21688
21710
|
constructor(me) {
|
|
21689
21711
|
var Lt, zt, ln;
|
|
21690
21712
|
const kt = !!(me.data.hasPopup || (Lt = me.data.titleObj) != null && Lt.str || (zt = me.data.contentsObj) != null && zt.str || (ln = me.data.richText) != null && ln.str);
|
|
@@ -21702,8 +21724,8 @@ function requirePdf() {
|
|
|
21702
21724
|
for (const ln of me.inkLists) {
|
|
21703
21725
|
let nr = [];
|
|
21704
21726
|
for (const un of ln) {
|
|
21705
|
-
const
|
|
21706
|
-
nr.push(`${
|
|
21727
|
+
const Br = un.x - me.rect[0], Ni = me.rect[3] - un.y;
|
|
21728
|
+
nr.push(`${Br},${Ni}`);
|
|
21707
21729
|
}
|
|
21708
21730
|
nr = nr.join(" ");
|
|
21709
21731
|
const Yn = this.svgFactory.createElement(this.svgElementName);
|
|
@@ -21712,7 +21734,7 @@ function requirePdf() {
|
|
|
21712
21734
|
return this.container.append(zt), this.container;
|
|
21713
21735
|
}
|
|
21714
21736
|
}
|
|
21715
|
-
class
|
|
21737
|
+
class Fr extends Le {
|
|
21716
21738
|
constructor(me) {
|
|
21717
21739
|
var Lt, zt, ln;
|
|
21718
21740
|
const kt = !!(me.data.hasPopup || (Lt = me.data.titleObj) != null && Lt.str || (zt = me.data.contentsObj) != null && zt.str || (ln = me.data.richText) != null && ln.str);
|
|
@@ -21819,17 +21841,17 @@ function requirePdf() {
|
|
|
21819
21841
|
} = me;
|
|
21820
21842
|
ml(this, Dt, V0).call(this, Lt, zt);
|
|
21821
21843
|
let nr = 0;
|
|
21822
|
-
for (const
|
|
21823
|
-
if (
|
|
21844
|
+
for (const Br of kt) {
|
|
21845
|
+
if (Br.annotationType !== r.AnnotationType.POPUP) {
|
|
21824
21846
|
const {
|
|
21825
21847
|
width: ki,
|
|
21826
21848
|
height: Pi
|
|
21827
|
-
} = tt(
|
|
21849
|
+
} = tt(Br.rect);
|
|
21828
21850
|
if (ki <= 0 || Pi <= 0)
|
|
21829
21851
|
continue;
|
|
21830
21852
|
}
|
|
21831
21853
|
const Ni = de.create({
|
|
21832
|
-
data:
|
|
21854
|
+
data: Br,
|
|
21833
21855
|
layer: Lt,
|
|
21834
21856
|
page: me.page,
|
|
21835
21857
|
viewport: zt,
|
|
@@ -21848,11 +21870,11 @@ function requirePdf() {
|
|
|
21848
21870
|
});
|
|
21849
21871
|
if (Ni.isRenderable) {
|
|
21850
21872
|
const ki = Ni.render();
|
|
21851
|
-
if (
|
|
21873
|
+
if (Br.hidden && (ki.style.visibility = "hidden"), Array.isArray(ki))
|
|
21852
21874
|
for (const Pi of ki)
|
|
21853
|
-
Pi.style.zIndex = nr++, ml(Yn = Xn, Dt, H0).call(Yn, Pi,
|
|
21875
|
+
Pi.style.zIndex = nr++, ml(Yn = Xn, Dt, H0).call(Yn, Pi, Br.id, Lt, ln);
|
|
21854
21876
|
else
|
|
21855
|
-
ki.style.zIndex = nr++, Ni instanceof P ? Lt.prepend(ki) : ml(un = Xn, Dt, H0).call(un, ki,
|
|
21877
|
+
ki.style.zIndex = nr++, Ni instanceof P ? Lt.prepend(ki) : ml(un = Xn, Dt, H0).call(un, ki, Br.id, Lt, ln);
|
|
21856
21878
|
}
|
|
21857
21879
|
}
|
|
21858
21880
|
ml(this, Dt, G0).call(this, Lt, me.annotationCanvasMap);
|
|
@@ -22155,21 +22177,21 @@ function requirePdf() {
|
|
|
22155
22177
|
const Kn = N[Ye.fontName];
|
|
22156
22178
|
Kn.vertical && (Zn += Math.PI / 2);
|
|
22157
22179
|
const Is = Math.hypot(It[2], It[3]), qs = Is * b(Kn.fontFamily, P);
|
|
22158
|
-
let
|
|
22159
|
-
Zn === 0 ? (
|
|
22160
|
-
let
|
|
22180
|
+
let Ur, Ar;
|
|
22181
|
+
Zn === 0 ? (Ur = It[4], Ar = It[5] - qs) : (Ur = It[4] + qs * Math.sin(Zn), Ar = It[5] - qs * Math.cos(Zn)), p.style.left = `${Ur}px`, p.style.top = `${Ar}px`, p.style.fontSize = `${Is}px`, p.style.fontFamily = Kn.fontFamily, mt.fontSize = Is, p.setAttribute("role", "presentation"), p.textContent = Ye.str, p.dir = Ye.dir, nt._fontInspectorEnabled && (p.dataset.fontName = Ye.fontName), Zn !== 0 && (mt.angle = Zn * (180 / Math.PI));
|
|
22182
|
+
let Fr = !1;
|
|
22161
22183
|
if (Ye.str.length > 1 || nt._enhanceTextSelection && l.test(Ye.str))
|
|
22162
|
-
|
|
22184
|
+
Fr = !0;
|
|
22163
22185
|
else if (Ye.str !== " " && Ye.transform[0] !== Ye.transform[3]) {
|
|
22164
22186
|
const sr = Math.abs(Ye.transform[0]), As = Math.abs(Ye.transform[3]);
|
|
22165
|
-
sr !== As && Math.max(sr, As) / Math.min(sr, As) > 1.5 && (
|
|
22187
|
+
sr !== As && Math.max(sr, As) / Math.min(sr, As) > 1.5 && (Fr = !0);
|
|
22166
22188
|
}
|
|
22167
|
-
if (
|
|
22189
|
+
if (Fr && (Kn.vertical ? mt.canvasWidth = Ye.height * nt._viewport.scale : mt.canvasWidth = Ye.width * nt._viewport.scale), nt._textDivProperties.set(p, mt), nt._textContentStream && nt._layoutText(p), nt._enhanceTextSelection && mt.hasText) {
|
|
22168
22190
|
let sr = 1, As = 0;
|
|
22169
22191
|
Zn !== 0 && (sr = Math.cos(Zn), As = Math.sin(Zn));
|
|
22170
22192
|
const Si = (Kn.vertical ? Ye.height : Ye.width) * nt._viewport.scale, Oi = Is;
|
|
22171
22193
|
let dl, ur;
|
|
22172
|
-
Zn !== 0 ? (dl = [sr, As, -As, sr,
|
|
22194
|
+
Zn !== 0 ? (dl = [sr, As, -As, sr, Ur, Ar], ur = r.Util.getAxialAlignedBoundingBox([0, 0, Si, Oi], dl)) : ur = [Ur, Ar, Ur + Si, Ar + Oi], nt._bounds.push({
|
|
22173
22195
|
left: ur[0],
|
|
22174
22196
|
top: ur[1],
|
|
22175
22197
|
right: ur[2],
|
|
@@ -22209,13 +22231,13 @@ function requirePdf() {
|
|
|
22209
22231
|
It.paddingLeft = Ye[p].left - P[p].left, It.paddingTop = Ye[p].top - P[p].top, It.paddingRight = P[p].right - Ye[p].right, It.paddingBottom = P[p].bottom - Ye[p].bottom, nt._textDivProperties.set(mt, It);
|
|
22210
22232
|
continue;
|
|
22211
22233
|
}
|
|
22212
|
-
const Zn = P[p], Kn = Ye[p], Is = Kn.m, qs = Is[0],
|
|
22213
|
-
for (let As = 0, Si =
|
|
22214
|
-
const Oi = r.Util.applyTransform(
|
|
22215
|
-
|
|
22234
|
+
const Zn = P[p], Kn = Ye[p], Is = Kn.m, qs = Is[0], Ur = Is[1], Ar = [[0, 0], [0, Kn.size[1]], [Kn.size[0], 0], Kn.size], Fr = new Float64Array(64);
|
|
22235
|
+
for (let As = 0, Si = Ar.length; As < Si; As++) {
|
|
22236
|
+
const Oi = r.Util.applyTransform(Ar[As], Is);
|
|
22237
|
+
Fr[As + 0] = qs && (Zn.left - Oi[0]) / qs, Fr[As + 4] = Ur && (Zn.top - Oi[1]) / Ur, Fr[As + 8] = qs && (Zn.right - Oi[0]) / qs, Fr[As + 12] = Ur && (Zn.bottom - Oi[1]) / Ur, Fr[As + 16] = Ur && (Zn.left - Oi[0]) / -Ur, Fr[As + 20] = qs && (Zn.top - Oi[1]) / qs, Fr[As + 24] = Ur && (Zn.right - Oi[0]) / -Ur, Fr[As + 28] = qs && (Zn.bottom - Oi[1]) / qs, Fr[As + 32] = qs && (Zn.left - Oi[0]) / -qs, Fr[As + 36] = Ur && (Zn.top - Oi[1]) / -Ur, Fr[As + 40] = qs && (Zn.right - Oi[0]) / -qs, Fr[As + 44] = Ur && (Zn.bottom - Oi[1]) / -Ur, Fr[As + 48] = Ur && (Zn.left - Oi[0]) / Ur, Fr[As + 52] = qs && (Zn.top - Oi[1]) / -qs, Fr[As + 56] = Ur && (Zn.right - Oi[0]) / Ur, Fr[As + 60] = qs && (Zn.bottom - Oi[1]) / -qs;
|
|
22216
22238
|
}
|
|
22217
|
-
const sr = 1 + Math.min(Math.abs(qs), Math.abs(
|
|
22218
|
-
It.paddingLeft = Le(
|
|
22239
|
+
const sr = 1 + Math.min(Math.abs(qs), Math.abs(Ur));
|
|
22240
|
+
It.paddingLeft = Le(Fr, 32, 16) / sr, It.paddingTop = Le(Fr, 48, 16) / sr, It.paddingRight = Le(Fr, 0, 16) / sr, It.paddingBottom = Le(Fr, 16, 16) / sr, nt._textDivProperties.set(mt, It);
|
|
22219
22241
|
}
|
|
22220
22242
|
}
|
|
22221
22243
|
function u(nt, Ye, N) {
|
|
@@ -22275,30 +22297,30 @@ function requirePdf() {
|
|
|
22275
22297
|
let It = P.length - 1;
|
|
22276
22298
|
for (; It >= 0 && P[It].start >= p.y2; )
|
|
22277
22299
|
It--;
|
|
22278
|
-
let Zn, Kn, Is, qs,
|
|
22300
|
+
let Zn, Kn, Is, qs, Ur = -1 / 0;
|
|
22279
22301
|
for (Is = mt; Is <= It; Is++) {
|
|
22280
22302
|
Zn = P[Is], Kn = Zn.boundary;
|
|
22281
22303
|
let sr;
|
|
22282
|
-
Kn.x2 > p.x1 ? sr = Kn.index > p.index ? Kn.x1New : p.x1 : Kn.x2New === void 0 ? sr = (Kn.x2 + p.x1) / 2 : sr = Kn.x2New, sr >
|
|
22304
|
+
Kn.x2 > p.x1 ? sr = Kn.index > p.index ? Kn.x1New : p.x1 : Kn.x2New === void 0 ? sr = (Kn.x2 + p.x1) / 2 : sr = Kn.x2New, sr > Ur && (Ur = sr);
|
|
22283
22305
|
}
|
|
22284
|
-
for (p.x1New =
|
|
22285
|
-
Zn = P[Is], Kn = Zn.boundary, Kn.x2New === void 0 ? Kn.x2 > p.x1 ? Kn.index > p.index && (Kn.x2New = Kn.x2) : Kn.x2New =
|
|
22286
|
-
const
|
|
22287
|
-
let
|
|
22306
|
+
for (p.x1New = Ur, Is = mt; Is <= It; Is++)
|
|
22307
|
+
Zn = P[Is], Kn = Zn.boundary, Kn.x2New === void 0 ? Kn.x2 > p.x1 ? Kn.index > p.index && (Kn.x2New = Kn.x2) : Kn.x2New = Ur : Kn.x2New > Ur && (Kn.x2New = Math.max(Ur, Kn.x2));
|
|
22308
|
+
const Ar = [];
|
|
22309
|
+
let Fr = null;
|
|
22288
22310
|
for (Is = mt; Is <= It; Is++) {
|
|
22289
22311
|
Zn = P[Is], Kn = Zn.boundary;
|
|
22290
22312
|
const sr = Kn.x2 > p.x2 ? Kn : p;
|
|
22291
|
-
|
|
22313
|
+
Fr === sr ? Ar.at(-1).end = Zn.end : (Ar.push({
|
|
22292
22314
|
start: Zn.start,
|
|
22293
22315
|
end: Zn.end,
|
|
22294
22316
|
boundary: sr
|
|
22295
|
-
}),
|
|
22317
|
+
}), Fr = sr);
|
|
22296
22318
|
}
|
|
22297
|
-
for (P[mt].start < p.y1 && (
|
|
22319
|
+
for (P[mt].start < p.y1 && (Ar[0].start = p.y1, Ar.unshift({
|
|
22298
22320
|
start: P[mt].start,
|
|
22299
22321
|
end: p.y1,
|
|
22300
22322
|
boundary: P[mt].boundary
|
|
22301
|
-
})), p.y2 < P[It].end && (
|
|
22323
|
+
})), p.y2 < P[It].end && (Ar.at(-1).end = p.y2, Ar.push({
|
|
22302
22324
|
start: p.y2,
|
|
22303
22325
|
end: P[It].end,
|
|
22304
22326
|
boundary: P[It].boundary
|
|
@@ -22310,11 +22332,11 @@ function requirePdf() {
|
|
|
22310
22332
|
sr = P[qs].boundary === Kn;
|
|
22311
22333
|
for (qs = It + 1; !sr && qs < P.length && P[qs].end <= Kn.y2; qs++)
|
|
22312
22334
|
sr = P[qs].boundary === Kn;
|
|
22313
|
-
for (qs = 0; !sr && qs <
|
|
22314
|
-
sr =
|
|
22315
|
-
sr || (Kn.x2New =
|
|
22335
|
+
for (qs = 0; !sr && qs < Ar.length; qs++)
|
|
22336
|
+
sr = Ar[qs].boundary === Kn;
|
|
22337
|
+
sr || (Kn.x2New = Ur);
|
|
22316
22338
|
}
|
|
22317
|
-
Array.prototype.splice.apply(P, [mt, It - mt + 1, ...
|
|
22339
|
+
Array.prototype.splice.apply(P, [mt, It - mt + 1, ...Ar]);
|
|
22318
22340
|
}
|
|
22319
22341
|
for (const p of P) {
|
|
22320
22342
|
const mt = p.boundary;
|
|
@@ -22499,71 +22521,71 @@ function requirePdf() {
|
|
|
22499
22521
|
const mt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
22500
22522
|
let It = `data:${P};base64,`;
|
|
22501
22523
|
for (let Zn = 0, Kn = N.length; Zn < Kn; Zn += 3) {
|
|
22502
|
-
const Is = N[Zn] & 255, qs = N[Zn + 1] & 255,
|
|
22503
|
-
It += mt[
|
|
22524
|
+
const Is = N[Zn] & 255, qs = N[Zn + 1] & 255, Ur = N[Zn + 2] & 255, Ar = Is >> 2, Fr = (Is & 3) << 4 | qs >> 4, sr = Zn + 1 < Kn ? (qs & 15) << 2 | Ur >> 6 : 64, As = Zn + 2 < Kn ? Ur & 63 : 64;
|
|
22525
|
+
It += mt[Ar] + mt[Fr] + mt[sr] + mt[As];
|
|
22504
22526
|
}
|
|
22505
22527
|
return It;
|
|
22506
22528
|
}, Le = function() {
|
|
22507
22529
|
const N = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), P = 12, p = new Int32Array(256);
|
|
22508
|
-
for (let
|
|
22509
|
-
let
|
|
22510
|
-
for (let
|
|
22511
|
-
|
|
22512
|
-
p[
|
|
22530
|
+
for (let Ur = 0; Ur < 256; Ur++) {
|
|
22531
|
+
let Ar = Ur;
|
|
22532
|
+
for (let Fr = 0; Fr < 8; Fr++)
|
|
22533
|
+
Ar & 1 ? Ar = 3988292384 ^ Ar >> 1 & 2147483647 : Ar = Ar >> 1 & 2147483647;
|
|
22534
|
+
p[Ur] = Ar;
|
|
22513
22535
|
}
|
|
22514
|
-
function mt(
|
|
22536
|
+
function mt(Ur, Ar, Fr) {
|
|
22515
22537
|
let sr = -1;
|
|
22516
|
-
for (let As =
|
|
22517
|
-
const Si = (sr ^
|
|
22538
|
+
for (let As = Ar; As < Fr; As++) {
|
|
22539
|
+
const Si = (sr ^ Ur[As]) & 255, Oi = p[Si];
|
|
22518
22540
|
sr = sr >>> 8 ^ Oi;
|
|
22519
22541
|
}
|
|
22520
22542
|
return sr ^ -1;
|
|
22521
22543
|
}
|
|
22522
|
-
function It(
|
|
22544
|
+
function It(Ur, Ar, Fr, sr) {
|
|
22523
22545
|
let As = sr;
|
|
22524
|
-
const Si =
|
|
22525
|
-
|
|
22526
|
-
const Oi = mt(
|
|
22527
|
-
|
|
22546
|
+
const Si = Ar.length;
|
|
22547
|
+
Fr[As] = Si >> 24 & 255, Fr[As + 1] = Si >> 16 & 255, Fr[As + 2] = Si >> 8 & 255, Fr[As + 3] = Si & 255, As += 4, Fr[As] = Ur.charCodeAt(0) & 255, Fr[As + 1] = Ur.charCodeAt(1) & 255, Fr[As + 2] = Ur.charCodeAt(2) & 255, Fr[As + 3] = Ur.charCodeAt(3) & 255, As += 4, Fr.set(Ar, As), As += Ar.length;
|
|
22548
|
+
const Oi = mt(Fr, sr + 4, As);
|
|
22549
|
+
Fr[As] = Oi >> 24 & 255, Fr[As + 1] = Oi >> 16 & 255, Fr[As + 2] = Oi >> 8 & 255, Fr[As + 3] = Oi & 255;
|
|
22528
22550
|
}
|
|
22529
|
-
function Zn(
|
|
22551
|
+
function Zn(Ur, Ar, Fr) {
|
|
22530
22552
|
let sr = 1, As = 0;
|
|
22531
|
-
for (let Si =
|
|
22532
|
-
sr = (sr + (
|
|
22553
|
+
for (let Si = Ar; Si < Fr; ++Si)
|
|
22554
|
+
sr = (sr + (Ur[Si] & 255)) % 65521, As = (As + sr) % 65521;
|
|
22533
22555
|
return As << 16 | sr;
|
|
22534
22556
|
}
|
|
22535
|
-
function Kn(
|
|
22557
|
+
function Kn(Ur) {
|
|
22536
22558
|
if (!i.isNodeJS)
|
|
22537
|
-
return Is(
|
|
22559
|
+
return Is(Ur);
|
|
22538
22560
|
try {
|
|
22539
|
-
let
|
|
22540
|
-
parseInt(process.versions.node) >= 8 ?
|
|
22541
|
-
const
|
|
22561
|
+
let Ar;
|
|
22562
|
+
parseInt(process.versions.node) >= 8 ? Ar = Ur : Ar = Buffer.from(Ur);
|
|
22563
|
+
const Fr = require$$5.deflateSync(Ar, {
|
|
22542
22564
|
level: 9
|
|
22543
22565
|
});
|
|
22544
|
-
return
|
|
22545
|
-
} catch (
|
|
22546
|
-
(0, s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " +
|
|
22566
|
+
return Fr instanceof Uint8Array ? Fr : new Uint8Array(Fr);
|
|
22567
|
+
} catch (Ar) {
|
|
22568
|
+
(0, s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + Ar);
|
|
22547
22569
|
}
|
|
22548
|
-
return Is(
|
|
22570
|
+
return Is(Ur);
|
|
22549
22571
|
}
|
|
22550
|
-
function Is(
|
|
22551
|
-
let
|
|
22552
|
-
const
|
|
22572
|
+
function Is(Ur) {
|
|
22573
|
+
let Ar = Ur.length;
|
|
22574
|
+
const Fr = 65535, sr = Math.ceil(Ar / Fr), As = new Uint8Array(2 + Ar + sr * 5 + 4);
|
|
22553
22575
|
let Si = 0;
|
|
22554
22576
|
As[Si++] = 120, As[Si++] = 156;
|
|
22555
22577
|
let Oi = 0;
|
|
22556
|
-
for (;
|
|
22557
|
-
As[Si++] = 0, As[Si++] = 255, As[Si++] = 255, As[Si++] = 0, As[Si++] = 0, As.set(
|
|
22558
|
-
As[Si++] = 1, As[Si++] =
|
|
22559
|
-
const dl = Zn(
|
|
22578
|
+
for (; Ar > Fr; )
|
|
22579
|
+
As[Si++] = 0, As[Si++] = 255, As[Si++] = 255, As[Si++] = 0, As[Si++] = 0, As.set(Ur.subarray(Oi, Oi + Fr), Si), Si += Fr, Oi += Fr, Ar -= Fr;
|
|
22580
|
+
As[Si++] = 1, As[Si++] = Ar & 255, As[Si++] = Ar >> 8 & 255, As[Si++] = ~Ar & 65535 & 255, As[Si++] = (~Ar & 65535) >> 8 & 255, As.set(Ur.subarray(Oi), Si), Si += Ur.length - Oi;
|
|
22581
|
+
const dl = Zn(Ur, 0, Ur.length);
|
|
22560
22582
|
return As[Si++] = dl >> 24 & 255, As[Si++] = dl >> 16 & 255, As[Si++] = dl >> 8 & 255, As[Si++] = dl & 255, As;
|
|
22561
22583
|
}
|
|
22562
|
-
function qs(
|
|
22563
|
-
const As =
|
|
22584
|
+
function qs(Ur, Ar, Fr, sr) {
|
|
22585
|
+
const As = Ur.width, Si = Ur.height;
|
|
22564
22586
|
let Oi, dl, ur;
|
|
22565
|
-
const Dt =
|
|
22566
|
-
switch (
|
|
22587
|
+
const Dt = Ur.data;
|
|
22588
|
+
switch (Ar) {
|
|
22567
22589
|
case s.ImageKind.GRAYSCALE_1BPP:
|
|
22568
22590
|
dl = 0, Oi = 1, ur = As + 7 >> 3;
|
|
22569
22591
|
break;
|
|
@@ -22580,7 +22602,7 @@ function requirePdf() {
|
|
|
22580
22602
|
let Un = 0, St = 0;
|
|
22581
22603
|
for (let zt = 0; zt < Si; ++zt)
|
|
22582
22604
|
ot[Un++] = 0, ot.set(Dt.subarray(St, St + ur), Un), St += ur, Un += ur;
|
|
22583
|
-
if (
|
|
22605
|
+
if (Ar === s.ImageKind.GRAYSCALE_1BPP && sr) {
|
|
22584
22606
|
Un = 0;
|
|
22585
22607
|
for (let zt = 0; zt < Si; zt++) {
|
|
22586
22608
|
Un++;
|
|
@@ -22590,11 +22612,11 @@ function requirePdf() {
|
|
|
22590
22612
|
}
|
|
22591
22613
|
const Xn = new Uint8Array([As >> 24 & 255, As >> 16 & 255, As >> 8 & 255, As & 255, Si >> 24 & 255, Si >> 16 & 255, Si >> 8 & 255, Si & 255, Oi, dl, 0, 0, 0]), Gn = Kn(ot), me = N.length + P * 3 + Xn.length + Gn.length, kt = new Uint8Array(me);
|
|
22592
22614
|
let Lt = 0;
|
|
22593
|
-
return kt.set(N, Lt), Lt += N.length, It("IHDR", Xn, kt, Lt), Lt += P + Xn.length, It("IDATA", Gn, kt, Lt), Lt += P + Gn.length, It("IEND", new Uint8Array(0), kt, Lt), de(kt, "image/png",
|
|
22615
|
+
return kt.set(N, Lt), Lt += N.length, It("IHDR", Xn, kt, Lt), Lt += P + Xn.length, It("IDATA", Gn, kt, Lt), Lt += P + Gn.length, It("IEND", new Uint8Array(0), kt, Lt), de(kt, "image/png", Fr);
|
|
22594
22616
|
}
|
|
22595
|
-
return function(
|
|
22596
|
-
const As =
|
|
22597
|
-
return qs(
|
|
22617
|
+
return function(Ar, Fr, sr) {
|
|
22618
|
+
const As = Ar.kind === void 0 ? s.ImageKind.GRAYSCALE_1BPP : Ar.kind;
|
|
22619
|
+
return qs(Ar, As, Fr, sr);
|
|
22598
22620
|
};
|
|
22599
22621
|
}();
|
|
22600
22622
|
class E {
|
|
@@ -22843,31 +22865,31 @@ function requirePdf() {
|
|
|
22843
22865
|
const P = this.current, p = P.font, mt = P.fontSize;
|
|
22844
22866
|
if (mt === 0)
|
|
22845
22867
|
return;
|
|
22846
|
-
const It = P.fontSizeScale, Zn = P.charSpacing, Kn = P.wordSpacing, Is = P.fontDirection, qs = P.textHScale * Is,
|
|
22868
|
+
const It = P.fontSizeScale, Zn = P.charSpacing, Kn = P.wordSpacing, Is = P.fontDirection, qs = P.textHScale * Is, Ur = p.vertical, Ar = Ur ? 1 : -1, Fr = p.defaultVMetrics, sr = mt * P.fontMatrix[0];
|
|
22847
22869
|
let As = 0;
|
|
22848
22870
|
for (const dl of N) {
|
|
22849
22871
|
if (dl === null) {
|
|
22850
22872
|
As += Is * Kn;
|
|
22851
22873
|
continue;
|
|
22852
22874
|
} else if (typeof dl == "number") {
|
|
22853
|
-
As +=
|
|
22875
|
+
As += Ar * dl * mt / 1e3;
|
|
22854
22876
|
continue;
|
|
22855
22877
|
}
|
|
22856
22878
|
const ur = (dl.isSpace ? Kn : 0) + Zn, Dt = dl.fontChar;
|
|
22857
22879
|
let ot, Un, St = dl.width;
|
|
22858
|
-
if (
|
|
22880
|
+
if (Ur) {
|
|
22859
22881
|
let Gn;
|
|
22860
|
-
const me = dl.vmetric ||
|
|
22882
|
+
const me = dl.vmetric || Fr;
|
|
22861
22883
|
Gn = dl.vmetric ? me[1] : St * 0.5, Gn = -Gn * sr;
|
|
22862
22884
|
const kt = me[2] * sr;
|
|
22863
22885
|
St = me ? -me[0] : St, ot = Gn / It, Un = (As + kt) / It;
|
|
22864
22886
|
} else
|
|
22865
22887
|
ot = As / It, Un = 0;
|
|
22866
|
-
(dl.isInFont || p.missingFile) && (P.xcoords.push(P.x + ot),
|
|
22888
|
+
(dl.isInFont || p.missingFile) && (P.xcoords.push(P.x + ot), Ur && P.ycoords.push(-P.y + Un), P.tspan.textContent += Dt);
|
|
22867
22889
|
let Xn;
|
|
22868
|
-
|
|
22890
|
+
Ur ? Xn = St * sr - ur * Is : Xn = St * sr + ur * Is, As += Xn;
|
|
22869
22891
|
}
|
|
22870
|
-
P.tspan.setAttributeNS(null, "x", P.xcoords.map(o).join(" ")),
|
|
22892
|
+
P.tspan.setAttributeNS(null, "x", P.xcoords.map(o).join(" ")), Ur ? P.tspan.setAttributeNS(null, "y", P.ycoords.map(o).join(" ")) : P.tspan.setAttributeNS(null, "y", o(-P.y)), Ur ? P.y -= As : P.x += As * qs, P.tspan.setAttributeNS(null, "font-family", P.fontFamily), P.tspan.setAttributeNS(null, "font-size", `${o(P.fontSize)}px`), P.fontStyle !== c.fontStyle && P.tspan.setAttributeNS(null, "font-style", P.fontStyle), P.fontWeight !== c.fontWeight && P.tspan.setAttributeNS(null, "font-weight", P.fontWeight);
|
|
22871
22893
|
const Si = P.textRenderingMode & s.TextRenderingMode.FILL_STROKE_MASK;
|
|
22872
22894
|
if (Si === s.TextRenderingMode.FILL || Si === s.TextRenderingMode.FILL_STROKE ? (P.fillColor !== c.fillColor && P.tspan.setAttributeNS(null, "fill", P.fillColor), P.fillAlpha < 1 && P.tspan.setAttributeNS(null, "fill-opacity", P.fillAlpha)) : P.textRenderingMode === s.TextRenderingMode.ADD_TO_PATH ? P.tspan.setAttributeNS(null, "fill", "transparent") : P.tspan.setAttributeNS(null, "fill", "none"), Si === s.TextRenderingMode.STROKE || Si === s.TextRenderingMode.FILL_STROKE) {
|
|
22873
22895
|
const dl = 1 / (P.textMatrixScale || 1);
|
|
@@ -22932,21 +22954,21 @@ function requirePdf() {
|
|
|
22932
22954
|
this.current.fillColor = this._makeColorN_Pattern(N);
|
|
22933
22955
|
}
|
|
22934
22956
|
shadingFill(N) {
|
|
22935
|
-
const P = this.viewport.width, p = this.viewport.height, mt = s.Util.inverseTransform(this.transformMatrix), It = s.Util.applyTransform([0, 0], mt), Zn = s.Util.applyTransform([0, p], mt), Kn = s.Util.applyTransform([P, 0], mt), Is = s.Util.applyTransform([P, p], mt), qs = Math.min(It[0], Zn[0], Kn[0], Is[0]),
|
|
22936
|
-
sr.setAttributeNS(null, "x", qs), sr.setAttributeNS(null, "y",
|
|
22957
|
+
const P = this.viewport.width, p = this.viewport.height, mt = s.Util.inverseTransform(this.transformMatrix), It = s.Util.applyTransform([0, 0], mt), Zn = s.Util.applyTransform([0, p], mt), Kn = s.Util.applyTransform([P, 0], mt), Is = s.Util.applyTransform([P, p], mt), qs = Math.min(It[0], Zn[0], Kn[0], Is[0]), Ur = Math.min(It[1], Zn[1], Kn[1], Is[1]), Ar = Math.max(It[0], Zn[0], Kn[0], Is[0]), Fr = Math.max(It[1], Zn[1], Kn[1], Is[1]), sr = this.svgFactory.createElement("svg:rect");
|
|
22958
|
+
sr.setAttributeNS(null, "x", qs), sr.setAttributeNS(null, "y", Ur), sr.setAttributeNS(null, "width", Ar - qs), sr.setAttributeNS(null, "height", Fr - Ur), sr.setAttributeNS(null, "fill", this._makeShadingPattern(N)), this.current.fillAlpha < 1 && sr.setAttributeNS(null, "fill-opacity", this.current.fillAlpha), this._ensureTransformGroup().append(sr);
|
|
22937
22959
|
}
|
|
22938
22960
|
_makeColorN_Pattern(N) {
|
|
22939
22961
|
return N[0] === "TilingPattern" ? this._makeTilingPattern(N) : this._makeShadingPattern(N);
|
|
22940
22962
|
}
|
|
22941
22963
|
_makeTilingPattern(N) {
|
|
22942
|
-
const P = N[1], p = N[2], mt = N[3] || s.IDENTITY_MATRIX, [It, Zn, Kn, Is] = N[4], qs = N[5],
|
|
22943
|
-
Un.setAttributeNS(null, "id",
|
|
22964
|
+
const P = N[1], p = N[2], mt = N[3] || s.IDENTITY_MATRIX, [It, Zn, Kn, Is] = N[4], qs = N[5], Ur = N[6], Ar = N[7], Fr = `shading${Ye++}`, [sr, As, Si, Oi] = s.Util.normalizeRect([...s.Util.applyTransform([It, Zn], mt), ...s.Util.applyTransform([Kn, Is], mt)]), [dl, ur] = s.Util.singularValueDecompose2dScale(mt), Dt = qs * dl, ot = Ur * ur, Un = this.svgFactory.createElement("svg:pattern");
|
|
22965
|
+
Un.setAttributeNS(null, "id", Fr), Un.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), Un.setAttributeNS(null, "width", Dt), Un.setAttributeNS(null, "height", ot), Un.setAttributeNS(null, "x", `${sr}`), Un.setAttributeNS(null, "y", `${As}`);
|
|
22944
22966
|
const St = this.svg, Xn = this.transformMatrix, Gn = this.current.fillColor, me = this.current.strokeColor, kt = this.svgFactory.create(Si - sr, Oi - As);
|
|
22945
|
-
if (this.svg = kt, this.transformMatrix = mt,
|
|
22967
|
+
if (this.svg = kt, this.transformMatrix = mt, Ar === 2) {
|
|
22946
22968
|
const Lt = s.Util.makeHexColor(...P);
|
|
22947
22969
|
this.current.fillColor = Lt, this.current.strokeColor = Lt;
|
|
22948
22970
|
}
|
|
22949
|
-
return this.executeOpTree(this.convertOpList(p)), this.svg = St, this.transformMatrix = Xn, this.current.fillColor = Gn, this.current.strokeColor = me, Un.append(kt.childNodes[0]), this.defs.append(Un), `url(#${
|
|
22971
|
+
return this.executeOpTree(this.convertOpList(p)), this.svg = St, this.transformMatrix = Xn, this.current.fillColor = Gn, this.current.strokeColor = me, Un.append(kt.childNodes[0]), this.defs.append(Un), `url(#${Fr})`;
|
|
22950
22972
|
}
|
|
22951
22973
|
_makeShadingPattern(N) {
|
|
22952
22974
|
switch (typeof N == "string" && (N = this.objs.get(N)), N[0]) {
|
|
@@ -22959,8 +22981,8 @@ function requirePdf() {
|
|
|
22959
22981
|
mt = this.svgFactory.createElement("svg:linearGradient"), mt.setAttributeNS(null, "id", P), mt.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), mt.setAttributeNS(null, "x1", It[0]), mt.setAttributeNS(null, "y1", It[1]), mt.setAttributeNS(null, "x2", Zn[0]), mt.setAttributeNS(null, "y2", Zn[1]);
|
|
22960
22982
|
break;
|
|
22961
22983
|
case "radial":
|
|
22962
|
-
const Kn = N[4], Is = N[5], qs = N[6],
|
|
22963
|
-
mt = this.svgFactory.createElement("svg:radialGradient"), mt.setAttributeNS(null, "id", P), mt.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), mt.setAttributeNS(null, "cx", Is[0]), mt.setAttributeNS(null, "cy", Is[1]), mt.setAttributeNS(null, "r",
|
|
22984
|
+
const Kn = N[4], Is = N[5], qs = N[6], Ur = N[7];
|
|
22985
|
+
mt = this.svgFactory.createElement("svg:radialGradient"), mt.setAttributeNS(null, "id", P), mt.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), mt.setAttributeNS(null, "cx", Is[0]), mt.setAttributeNS(null, "cy", Is[1]), mt.setAttributeNS(null, "r", Ur), mt.setAttributeNS(null, "fx", Kn[0]), mt.setAttributeNS(null, "fy", Kn[1]), mt.setAttributeNS(null, "fr", qs);
|
|
22964
22986
|
break;
|
|
22965
22987
|
default:
|
|
22966
22988
|
throw new Error(`Unknown RadialAxial type: ${N[1]}`);
|
|
@@ -22988,8 +23010,8 @@ function requirePdf() {
|
|
|
22988
23010
|
switch (Is | 0) {
|
|
22989
23011
|
case s.OPS.rectangle:
|
|
22990
23012
|
mt = P[Kn++], It = P[Kn++];
|
|
22991
|
-
const qs = P[Kn++],
|
|
22992
|
-
Zn.push("M", o(mt), o(It), "L", o(
|
|
23013
|
+
const qs = P[Kn++], Ur = P[Kn++], Ar = mt + qs, Fr = It + Ur;
|
|
23014
|
+
Zn.push("M", o(mt), o(It), "L", o(Ar), o(It), "L", o(Ar), o(Fr), "L", o(mt), o(Fr), "Z");
|
|
22993
23015
|
break;
|
|
22994
23016
|
case s.OPS.moveTo:
|
|
22995
23017
|
mt = P[Kn++], It = P[Kn++], Zn.push("M", o(mt), o(It));
|
|
@@ -24568,11 +24590,11 @@ const ErrorContainer$1 = dt.div`
|
|
|
24568
24590
|
contentClass: Le
|
|
24569
24591
|
}) => {
|
|
24570
24592
|
var E;
|
|
24571
|
-
const u = (h == null ? void 0 : h.theme) || defaultTheme$1, [o, pe] = useState(!0), [st, nt] = useState("\u6587\u4EF6\u4E0B\u8F7D\u4E2D..."), [Ye, N] = useState(null), [P, p] = useState(null), [mt, It] = useState(i), [Zn, Kn] = useState(1), [Is, qs] = useState(0), [
|
|
24572
|
-
pe(!0), nt("\u6587\u4EF6\u4E0B\u8F7D\u4E2D..."), N(null), p(null), It(i), Kn(1), qs(0),
|
|
24593
|
+
const u = (h == null ? void 0 : h.theme) || defaultTheme$1, [o, pe] = useState(!0), [st, nt] = useState("\u6587\u4EF6\u4E0B\u8F7D\u4E2D..."), [Ye, N] = useState(null), [P, p] = useState(null), [mt, It] = useState(i), [Zn, Kn] = useState(1), [Is, qs] = useState(0), [Ur, Ar] = useState(!1), Fr = useCallback(() => {
|
|
24594
|
+
pe(!0), nt("\u6587\u4EF6\u4E0B\u8F7D\u4E2D..."), N(null), p(null), It(i), Kn(1), qs(0), Ar(!1);
|
|
24573
24595
|
}, [i]), sr = useCallback(async () => {
|
|
24574
24596
|
var Lt, zt;
|
|
24575
|
-
if (console.log("=== loadFile \u5F00\u59CB ==="), console.log("\u5F53\u524D\u53C2\u6570:", { fileUrl: e, fileName: r, fileType: t, data: a }),
|
|
24597
|
+
if (console.log("=== loadFile \u5F00\u59CB ==="), console.log("\u5F53\u524D\u53C2\u6570:", { fileUrl: e, fileName: r, fileType: t, data: a }), Fr(), a) {
|
|
24576
24598
|
pe(!1), N(null), p({
|
|
24577
24599
|
type: a.fileType || t || "text",
|
|
24578
24600
|
content: a.content,
|
|
@@ -24601,7 +24623,7 @@ const ErrorContainer$1 = dt.div`
|
|
|
24601
24623
|
} finally {
|
|
24602
24624
|
pe(!1);
|
|
24603
24625
|
}
|
|
24604
|
-
}, [e, r, t, s, a,
|
|
24626
|
+
}, [e, r, t, s, a, Fr]);
|
|
24605
24627
|
useEffect(() => {
|
|
24606
24628
|
sr();
|
|
24607
24629
|
}, [sr]);
|
|
@@ -24636,9 +24658,9 @@ const ErrorContainer$1 = dt.div`
|
|
|
24636
24658
|
It(zt), As("page:change", { page: zt });
|
|
24637
24659
|
}
|
|
24638
24660
|
}, [mt, P == null ? void 0 : P.totalPages, As]), Dt = useCallback(() => {
|
|
24639
|
-
const Lt = !
|
|
24640
|
-
|
|
24641
|
-
}, [
|
|
24661
|
+
const Lt = !Ur;
|
|
24662
|
+
Ar(Lt), As("annotation:toggle", { isAnnotating: Lt });
|
|
24663
|
+
}, [Ur, As]), ot = useCallback(() => {
|
|
24642
24664
|
As("download:start", { fileUrl: e, fileName: r });
|
|
24643
24665
|
}, [As, e, r]), Un = useCallback(() => {
|
|
24644
24666
|
qs((Lt) => (Lt - 90) % 360), As("rotate:left", { rotation: (Is - 90) % 360 });
|
|
@@ -24804,7 +24826,7 @@ const ErrorContainer$1 = dt.div`
|
|
|
24804
24826
|
},
|
|
24805
24827
|
onClose: Xn,
|
|
24806
24828
|
scale: Zn,
|
|
24807
|
-
isAnnotating:
|
|
24829
|
+
isAnnotating: Ur,
|
|
24808
24830
|
className: de
|
|
24809
24831
|
}
|
|
24810
24832
|
), /* @__PURE__ */ React.createElement(
|
|
@@ -26702,7 +26724,7 @@ const {
|
|
|
26702
26724
|
headerClass: E,
|
|
26703
26725
|
contentClass: u
|
|
26704
26726
|
}) => {
|
|
26705
|
-
const [o, pe] = useState(!0), [st, nt] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [Ye, N] = useState(null), [P, p] = useState(r), [mt, It] = useState(s || 0), [Zn, Kn] = useState(1), [Is, qs] = useState(0), [
|
|
26727
|
+
const [o, pe] = useState(!0), [st, nt] = useState("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."), [Ye, N] = useState(null), [P, p] = useState(r), [mt, It] = useState(s || 0), [Zn, Kn] = useState(1), [Is, qs] = useState(0), [Ur, Ar] = useState(null), [Fr, sr] = useState(null), [As, Si] = useState(""), [Oi, dl] = useState(null), [ur, Dt] = useState(null), ot = useRef({}), Un = useRef({}), St = useRef(null), Xn = useRef(null), Gn = useRef(r), me = (b == null ? void 0 : b.theme) || defaultTheme, kt = useCallback((hl, gl) => {
|
|
26706
26728
|
const Bl = Math.floor((hl - 1) / gl) * gl + 1;
|
|
26707
26729
|
return `${Bl}-${Bl + gl - 1}`;
|
|
26708
26730
|
}, []), Lt = useCallback(async (hl) => {
|
|
@@ -26764,7 +26786,7 @@ const {
|
|
|
26764
26786
|
gl ? (pe(!0), nt("\u6B63\u5728\u52A0\u8F7DPDF\u6587\u6863...")) : (pe(!0), nt(`\u6B63\u5728\u52A0\u8F7D\u7B2C ${hl} \u9875...`)), N(null), console.log(`\u5F00\u59CB\u52A0\u8F7DPDF\u9875\u9762: ${hl}, \u521D\u59CB\u52A0\u8F7D: ${gl}`);
|
|
26765
26787
|
const Tg = await Lt(hl);
|
|
26766
26788
|
if (Tg)
|
|
26767
|
-
return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${hl}`),
|
|
26789
|
+
return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${hl}`), Ar(Tg), pe(!1), nt(""), console.log(`\u9875\u9762 ${hl} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`), Tg;
|
|
26768
26790
|
const pl = await zt(hl), Ri = await parseFile(pl, {
|
|
26769
26791
|
fileName: t || "Stream\u6587\u6863",
|
|
26770
26792
|
fileType: "pdf",
|
|
@@ -26775,7 +26797,7 @@ const {
|
|
|
26775
26797
|
if (Ri.type !== "pdf" || !((Bl = Ri.content) != null && Bl.document))
|
|
26776
26798
|
throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684PDF\u6587\u6863");
|
|
26777
26799
|
const Ti = Ri.content.document;
|
|
26778
|
-
console.log("\u8BBE\u7F6EPDF\u6587\u6863:", Ti), console.log("PDF\u6587\u6863\u7C7B\u578B:", typeof Ti), console.log("PDF\u6587\u6863\u65B9\u6CD5:", Ti ? Object.getOwnPropertyNames(Object.getPrototypeOf(Ti)) : "\u65E0\u6587\u6863"), console.log("PDF\u6587\u6863\u9875\u6570:", Ti ? Ti.numPages : "\u65E0\u9875\u6570"), console.log("\u5F53\u524D\u8BF7\u6C42\u7684\u9875\u9762:", hl), console.log("PDF\u6587\u6863\u5305\u542B\u7684\u9875\u9762\u8303\u56F4:", Ti ? `1-${Ti.numPages}` : "\u65E0\u9875\u6570"),
|
|
26800
|
+
console.log("\u8BBE\u7F6EPDF\u6587\u6863:", Ti), console.log("PDF\u6587\u6863\u7C7B\u578B:", typeof Ti), console.log("PDF\u6587\u6863\u65B9\u6CD5:", Ti ? Object.getOwnPropertyNames(Object.getPrototypeOf(Ti)) : "\u65E0\u6587\u6863"), console.log("PDF\u6587\u6863\u9875\u6570:", Ti ? Ti.numPages : "\u65E0\u9875\u6570"), console.log("\u5F53\u524D\u8BF7\u6C42\u7684\u9875\u9762:", hl), console.log("PDF\u6587\u6863\u5305\u542B\u7684\u9875\u9762\u8303\u56F4:", Ti ? `1-${Ti.numPages}` : "\u65E0\u9875\u6570"), Ar(Ti);
|
|
26779
26801
|
const Dl = kt(hl, a);
|
|
26780
26802
|
return Un.current[Dl] && (Un.current[Dl].pdfDocument = Ti, console.log(`\u7F13\u5B58PDF\u6587\u6863\u5230chunk: ${Dl}`)), pe(!1), nt(""), console.log(`\u9875\u9762 ${hl} \u52A0\u8F7D\u5B8C\u6210`), Ti;
|
|
26781
26803
|
} catch (Tg) {
|
|
@@ -26813,7 +26835,7 @@ const {
|
|
|
26813
26835
|
} catch (gl) {
|
|
26814
26836
|
throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:", gl), new Error(`\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25: ${gl.message}`);
|
|
26815
26837
|
}
|
|
26816
|
-
}, [e, h, c]),
|
|
26838
|
+
}, [e, h, c]), Br = useCallback(async () => {
|
|
26817
26839
|
try {
|
|
26818
26840
|
pe(!0), nt("\u6B63\u5728\u52A0\u8F7Dmarkdown\u6587\u6863..."), N(null), console.log("\u5F00\u59CB\u52A0\u8F7D\u5B8C\u6574markdown\u6587\u6863");
|
|
26819
26841
|
const hl = Yn();
|
|
@@ -26993,14 +27015,14 @@ const {
|
|
|
26993
27015
|
}, []), useEffect(() => {
|
|
26994
27016
|
r && (async () => {
|
|
26995
27017
|
try {
|
|
26996
|
-
console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", n, "\u521D\u59CB\u5757/\u9875:", r), n === "markdown" || n === "markdown_table" ? (await
|
|
27018
|
+
console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:", n, "\u521D\u59CB\u5757/\u9875:", r), n === "markdown" || n === "markdown_table" ? (await Br(), p(r), l("pageChange", { pageNumber: r, totalPages: mt })) : n === "image" ? (await ki(), p(1), It(1), qs(0), l("pageChange", { pageNumber: 1, totalPages: 1 })) : n === "pdf" || n === "pdf_slides" ? (await ln(r, !0), p(r), setTimeout(() => {
|
|
26997
27019
|
l("pageChange", { pageNumber: r, totalPages: mt });
|
|
26998
27020
|
}, 0)) : (console.log("\u4F7F\u7528\u901A\u7528\u52A0\u8F7D\u51FD\u6570\u5904\u7406\u6587\u4EF6\u7C7B\u578B:", n), await ji(), p(1), It(1), l("pageChange", { pageNumber: 1, totalPages: 1 }));
|
|
26999
27021
|
} catch (gl) {
|
|
27000
27022
|
console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:", gl);
|
|
27001
27023
|
}
|
|
27002
27024
|
})();
|
|
27003
|
-
}, [r, n, ln,
|
|
27025
|
+
}, [r, n, ln, Br, ki, ji, l, mt]), Ye ? /* @__PURE__ */ React.createElement(ReaderContainer, { $theme: me, className: Le }, de != null && de.ErrorComponent ? /* @__PURE__ */ React.createElement(
|
|
27004
27026
|
de.ErrorComponent,
|
|
27005
27027
|
{
|
|
27006
27028
|
error: Ye,
|
|
@@ -27090,8 +27112,8 @@ const {
|
|
|
27090
27112
|
Fviewer,
|
|
27091
27113
|
{
|
|
27092
27114
|
data: {
|
|
27093
|
-
content:
|
|
27094
|
-
//
|
|
27115
|
+
content: As,
|
|
27116
|
+
// 直接传递markdown内容字符串
|
|
27095
27117
|
...lg() && { fileName: lg() },
|
|
27096
27118
|
...n && { fileType: n },
|
|
27097
27119
|
...mt && { totalPages: mt }
|
|
@@ -27117,7 +27139,7 @@ const {
|
|
|
27117
27139
|
Fviewer,
|
|
27118
27140
|
{
|
|
27119
27141
|
data: {
|
|
27120
|
-
content:
|
|
27142
|
+
content: Fr,
|
|
27121
27143
|
// { type: 'image', url }
|
|
27122
27144
|
...lg() && { fileName: lg() },
|
|
27123
27145
|
...n && { fileType: n }
|
|
@@ -27144,7 +27166,7 @@ const {
|
|
|
27144
27166
|
Fviewer,
|
|
27145
27167
|
{
|
|
27146
27168
|
data: {
|
|
27147
|
-
content: { document:
|
|
27169
|
+
content: { document: Ur },
|
|
27148
27170
|
// 修复:包装成期望的数据结构
|
|
27149
27171
|
...lg() && { fileName: lg() },
|
|
27150
27172
|
...n && { fileType: n },
|