flipbookengine 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flipbook-engine.js
CHANGED
|
@@ -5,7 +5,7 @@ var UB = (s) => {
|
|
|
5
5
|
var Ga = (s, I, g) => I in s ? ca(s, I, { enumerable: !0, configurable: !0, writable: !0, value: g }) : s[I] = g;
|
|
6
6
|
var M = (s, I, g) => Ga(s, typeof I != "symbol" ? I + "" : I, g), am = (s, I, g) => I.has(s) || UB("Cannot " + g);
|
|
7
7
|
var l = (s, I, g) => (am(s, I, "read from private field"), g ? g.call(s) : I.get(s)), w = (s, I, g) => I.has(s) ? UB("Cannot add the same private member more than once") : I instanceof WeakSet ? I.add(s) : I.set(s, g), B = (s, I, g, C) => (am(s, I, "write to private field"), C ? C.call(s, g) : I.set(s, g), g), Y = (s, I, g) => (am(s, I, "access private method"), g);
|
|
8
|
-
var
|
|
8
|
+
var qI = (s, I, g, C) => ({
|
|
9
9
|
set _(A) {
|
|
10
10
|
B(s, I, A, g);
|
|
11
11
|
},
|
|
@@ -63,7 +63,7 @@ const zg = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
63
63
|
}, Fm = {
|
|
64
64
|
TRIANGLES: 1,
|
|
65
65
|
LATTICE: 2
|
|
66
|
-
},
|
|
66
|
+
}, _I = {
|
|
67
67
|
FILL: 0,
|
|
68
68
|
STROKE: 1,
|
|
69
69
|
FILL_STROKE: 2,
|
|
@@ -74,7 +74,7 @@ const zg = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
74
74
|
GRAYSCALE_1BPP: 1,
|
|
75
75
|
RGB_24BPP: 2,
|
|
76
76
|
RGBA_32BPP: 3
|
|
77
|
-
},
|
|
77
|
+
}, vI = {
|
|
78
78
|
TEXT: 1,
|
|
79
79
|
LINK: 2,
|
|
80
80
|
FREETEXT: 3,
|
|
@@ -1482,7 +1482,7 @@ class Sa {
|
|
|
1482
1482
|
w(this, T0, 0);
|
|
1483
1483
|
}
|
|
1484
1484
|
get id() {
|
|
1485
|
-
return `${nc}${
|
|
1485
|
+
return `${nc}${qI(this, T0)._++}`;
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
T0 = new WeakMap();
|
|
@@ -1543,7 +1543,7 @@ const kB = class kB {
|
|
|
1543
1543
|
const A = new OffscreenCanvas(g.width, g.height);
|
|
1544
1544
|
return A.getContext("2d").drawImage(g, 0, 0), C = {
|
|
1545
1545
|
bitmap: A.transferToImageBitmap(),
|
|
1546
|
-
id: `image_${l(this, td)}_${
|
|
1546
|
+
id: `image_${l(this, td)}_${qI(this, Sc)._++}`,
|
|
1547
1547
|
refCounter: 1,
|
|
1548
1548
|
isSvg: !1
|
|
1549
1549
|
}, l(this, Rg).set(I, C), l(this, Rg).set(C.id, C), C;
|
|
@@ -1581,7 +1581,7 @@ td = new WeakMap(), Sc = new WeakMap(), Rg = new WeakMap(), ed = new WeakSet(),
|
|
|
1581
1581
|
try {
|
|
1582
1582
|
C || (C = {
|
|
1583
1583
|
bitmap: null,
|
|
1584
|
-
id: `image_${l(this, td)}_${
|
|
1584
|
+
id: `image_${l(this, td)}_${qI(this, Sc)._++}`,
|
|
1585
1585
|
refCounter: 0,
|
|
1586
1586
|
isSvg: !1
|
|
1587
1587
|
});
|
|
@@ -1746,7 +1746,7 @@ const j0 = class j0 {
|
|
|
1746
1746
|
};
|
|
1747
1747
|
M(j0, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
|
|
1748
1748
|
let Qm = j0;
|
|
1749
|
-
var nd, IC, Vd, zI,
|
|
1749
|
+
var nd, IC, Vd, zI, Ig, Nd, uC, Xd, yC, ug, pl, Sl, Rd, Fl, sA, HC, Si, Jc, zc, ud, kc, cA, Jl, yd, zl, GA, Q0, kl, Hd, Lc, Ll, Fi, Md, Tl, Tc, EI, GI, LA, rl, jl, rc, Dd, jc, Ql, bA, TA, Qc, xc, MC, S, rb, xm, vW, EW, gc, PW, fW, qW, Um, _W, $W, Ih, gh, Kg, SA, Ch, Ah, Om, lh, Cc, vm;
|
|
1750
1750
|
const bd = class bd {
|
|
1751
1751
|
constructor(I, g, C, A, i, Z, d, c, G, b, m, W, a, n, e, X) {
|
|
1752
1752
|
w(this, S);
|
|
@@ -1754,7 +1754,7 @@ const bd = class bd {
|
|
|
1754
1754
|
w(this, IC, null);
|
|
1755
1755
|
w(this, Vd, null);
|
|
1756
1756
|
w(this, zI, /* @__PURE__ */ new Map());
|
|
1757
|
-
w(this,
|
|
1757
|
+
w(this, Ig, /* @__PURE__ */ new Map());
|
|
1758
1758
|
w(this, Nd, null);
|
|
1759
1759
|
w(this, uC, null);
|
|
1760
1760
|
w(this, Xd, null);
|
|
@@ -1786,7 +1786,7 @@ const bd = class bd {
|
|
|
1786
1786
|
w(this, Md, null);
|
|
1787
1787
|
w(this, Tl, null);
|
|
1788
1788
|
w(this, Tc, null);
|
|
1789
|
-
w(this,
|
|
1789
|
+
w(this, EI, P.NONE);
|
|
1790
1790
|
w(this, GI, /* @__PURE__ */ new Set());
|
|
1791
1791
|
w(this, LA, null);
|
|
1792
1792
|
w(this, rl, null);
|
|
@@ -1892,9 +1892,9 @@ const bd = class bd {
|
|
|
1892
1892
|
destroy() {
|
|
1893
1893
|
var I, g, C, A, i, Z, d, c, G;
|
|
1894
1894
|
(I = l(this, MC)) == null || I.resolve(), B(this, MC, null), (g = l(this, nd)) == null || g.abort(), B(this, nd, null), this._signal = null;
|
|
1895
|
-
for (const b of l(this,
|
|
1895
|
+
for (const b of l(this, Ig).values())
|
|
1896
1896
|
b.destroy();
|
|
1897
|
-
l(this,
|
|
1897
|
+
l(this, Ig).clear(), l(this, zI).clear(), l(this, Si).clear(), (C = l(this, Tl)) == null || C.clear(), B(this, IC, null), l(this, GI).clear(), l(this, yC).destroy(), (A = l(this, Nd)) == null || A.destroy(), (i = l(this, ug)) == null || i.destroy(), (Z = l(this, rl)) == null || Z.destroy(), (d = l(this, GA)) == null || d.hide(), B(this, GA, null), (c = l(this, Md)) == null || c.destroy(), B(this, Md, null), B(this, Vd, null), l(this, cA) && (clearTimeout(l(this, cA)), B(this, cA, null)), l(this, bA) && (clearTimeout(l(this, bA)), B(this, bA, null)), (G = this._editorUndoBar) == null || G.destroy(), B(this, Dd, null);
|
|
1898
1898
|
}
|
|
1899
1899
|
combinedSignal(I) {
|
|
1900
1900
|
return AbortSignal.any([this._signal, I.signal]);
|
|
@@ -1964,7 +1964,7 @@ const bd = class bd {
|
|
|
1964
1964
|
(i = l(this, ug)) == null || i.showDialog(this, I, g, C, A);
|
|
1965
1965
|
}
|
|
1966
1966
|
selectComment(I, g) {
|
|
1967
|
-
const C = l(this,
|
|
1967
|
+
const C = l(this, Ig).get(I), A = C == null ? void 0 : C.getEditorByUID(g);
|
|
1968
1968
|
A == null || A.toggleComment(!0, !0);
|
|
1969
1969
|
}
|
|
1970
1970
|
updateComment(I) {
|
|
@@ -1992,7 +1992,7 @@ const bd = class bd {
|
|
|
1992
1992
|
return ((I = l(this, ug)) == null ? void 0 : I.dialogElement) || null;
|
|
1993
1993
|
}
|
|
1994
1994
|
async waitForEditorsRendered(I) {
|
|
1995
|
-
if (l(this,
|
|
1995
|
+
if (l(this, Ig).has(I - 1))
|
|
1996
1996
|
return;
|
|
1997
1997
|
const {
|
|
1998
1998
|
resolve: g,
|
|
@@ -2047,7 +2047,7 @@ const bd = class bd {
|
|
|
2047
2047
|
l(this, TA).focus();
|
|
2048
2048
|
}
|
|
2049
2049
|
findParent(I, g) {
|
|
2050
|
-
for (const C of l(this,
|
|
2050
|
+
for (const C of l(this, Ig).values()) {
|
|
2051
2051
|
const {
|
|
2052
2052
|
x: A,
|
|
2053
2053
|
y: i,
|
|
@@ -2095,7 +2095,7 @@ const bd = class bd {
|
|
|
2095
2095
|
if (!m)
|
|
2096
2096
|
return;
|
|
2097
2097
|
C.empty();
|
|
2098
|
-
const W = Y(this, S, xm).call(this, b), a = l(this,
|
|
2098
|
+
const W = Y(this, S, xm).call(this, b), a = l(this, EI) === P.NONE, n = () => {
|
|
2099
2099
|
const e = W == null ? void 0 : W.createAndAddNewEditor({
|
|
2100
2100
|
x: 0,
|
|
2101
2101
|
y: 0
|
|
@@ -2243,7 +2243,7 @@ const bd = class bd {
|
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
2245
|
keydown(I) {
|
|
2246
|
-
!this.isShiftKeyDown && I.key === "Shift" && (this.isShiftKeyDown = !0), l(this,
|
|
2246
|
+
!this.isShiftKeyDown && I.key === "Shift" && (this.isShiftKeyDown = !0), l(this, EI) !== P.NONE && !this.isEditorHandlingKeyboard && bd._keyboardManager.exec(this, I);
|
|
2247
2247
|
}
|
|
2248
2248
|
keyup(I) {
|
|
2249
2249
|
this.isShiftKeyDown && I.key === "Shift" && (this.isShiftKeyDown = !1, l(this, zl) && (B(this, zl, !1), Y(this, S, gc).call(this, "main_toolbar")));
|
|
@@ -2268,7 +2268,7 @@ const bd = class bd {
|
|
|
2268
2268
|
}
|
|
2269
2269
|
setEditingState(I) {
|
|
2270
2270
|
I ? (Y(this, S, fW).call(this), Y(this, S, $W).call(this), Y(this, S, Kg).call(this, {
|
|
2271
|
-
isEditing: l(this,
|
|
2271
|
+
isEditing: l(this, EI) !== P.NONE,
|
|
2272
2272
|
isEmpty: Y(this, S, Cc).call(this),
|
|
2273
2273
|
hasSomethingToUndo: l(this, yC).hasSomethingToUndo(),
|
|
2274
2274
|
hasSomethingToRedo: l(this, yC).hasSomethingToRedo(),
|
|
@@ -2288,24 +2288,24 @@ const bd = class bd {
|
|
|
2288
2288
|
return l(this, Q0).id;
|
|
2289
2289
|
}
|
|
2290
2290
|
get currentLayer() {
|
|
2291
|
-
return l(this,
|
|
2291
|
+
return l(this, Ig).get(l(this, Rd));
|
|
2292
2292
|
}
|
|
2293
2293
|
getLayer(I) {
|
|
2294
|
-
return l(this,
|
|
2294
|
+
return l(this, Ig).get(I);
|
|
2295
2295
|
}
|
|
2296
2296
|
get currentPageIndex() {
|
|
2297
2297
|
return l(this, Rd);
|
|
2298
2298
|
}
|
|
2299
2299
|
addLayer(I) {
|
|
2300
|
-
l(this,
|
|
2300
|
+
l(this, Ig).set(I.pageIndex, I), l(this, kl) ? I.enable() : I.disable();
|
|
2301
2301
|
}
|
|
2302
2302
|
removeLayer(I) {
|
|
2303
|
-
l(this,
|
|
2303
|
+
l(this, Ig).delete(I.pageIndex);
|
|
2304
2304
|
}
|
|
2305
2305
|
async updateMode(I, g = null, C = !1, A = !1, i = !1, Z = !1) {
|
|
2306
2306
|
var d, c, G, b, m, W;
|
|
2307
|
-
if (l(this,
|
|
2308
|
-
if (B(this, MC, Promise.withResolvers()), (d = l(this, Sl)) == null || d.commitOrRemove(), l(this,
|
|
2307
|
+
if (l(this, EI) !== I && !(l(this, MC) && (await l(this, MC).promise, !l(this, MC)))) {
|
|
2308
|
+
if (B(this, MC, Promise.withResolvers()), (d = l(this, Sl)) == null || d.commitOrRemove(), l(this, EI) === P.POPUP && ((c = l(this, ug)) == null || c.hideSidebar()), (G = l(this, ug)) == null || G.destroyPopup(), B(this, EI, I), I === P.NONE) {
|
|
2309
2309
|
this.setEditingState(!1), Y(this, S, Ah).call(this);
|
|
2310
2310
|
for (const a of l(this, zI).values())
|
|
2311
2311
|
a.hideStandaloneCommentButton();
|
|
@@ -2315,7 +2315,7 @@ const bd = class bd {
|
|
|
2315
2315
|
for (const a of l(this, zI).values())
|
|
2316
2316
|
a.addStandaloneCommentButton();
|
|
2317
2317
|
I === P.SIGNATURE && await ((m = l(this, rl)) == null ? void 0 : m.loadSignatures()), C && Xg.clearPointerType(), this.setEditingState(!0), await Y(this, S, Ch).call(this), this.unselectAll();
|
|
2318
|
-
for (const a of l(this,
|
|
2318
|
+
for (const a of l(this, Ig).values())
|
|
2319
2319
|
a.updateMode(I);
|
|
2320
2320
|
if (I === P.POPUP) {
|
|
2321
2321
|
l(this, Vd) || B(this, Vd, await l(this, Dd).getAnnotationsByType(new Set(l(this, HC).map((e) => e._editorType))));
|
|
@@ -2351,7 +2351,7 @@ const bd = class bd {
|
|
|
2351
2351
|
this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
|
|
2352
2352
|
}
|
|
2353
2353
|
updateToolbar(I) {
|
|
2354
|
-
I.mode !== l(this,
|
|
2354
|
+
I.mode !== l(this, EI) && this._eventBus.dispatch("switchannotationeditormode", {
|
|
2355
2355
|
source: this,
|
|
2356
2356
|
...I
|
|
2357
2357
|
});
|
|
@@ -2392,7 +2392,7 @@ const bd = class bd {
|
|
|
2392
2392
|
enableWaiting(I = !1) {
|
|
2393
2393
|
if (l(this, Lc) !== I) {
|
|
2394
2394
|
B(this, Lc, I);
|
|
2395
|
-
for (const g of l(this,
|
|
2395
|
+
for (const g of l(this, Ig).values())
|
|
2396
2396
|
I ? g.disableClick() : g.enableClick(), g.div.classList.toggle("waiting", I);
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
@@ -2530,7 +2530,7 @@ const bd = class bd {
|
|
|
2530
2530
|
}
|
|
2531
2531
|
unselectAll() {
|
|
2532
2532
|
var I;
|
|
2533
|
-
if (!(l(this, IC) && (l(this, IC).commitOrRemove(), l(this,
|
|
2533
|
+
if (!(l(this, IC) && (l(this, IC).commitOrRemove(), l(this, EI) !== P.NONE)) && !((I = l(this, Sl)) != null && I.commitOrRemove()) && this.hasSelection) {
|
|
2534
2534
|
for (const g of l(this, GI))
|
|
2535
2535
|
g.unselect();
|
|
2536
2536
|
l(this, GI).clear(), Y(this, S, Kg).call(this, {
|
|
@@ -2590,7 +2590,7 @@ const bd = class bd {
|
|
|
2590
2590
|
return !1;
|
|
2591
2591
|
const C = (A, i, Z, d) => {
|
|
2592
2592
|
if (l(this, zI).has(A.id)) {
|
|
2593
|
-
const c = l(this,
|
|
2593
|
+
const c = l(this, Ig).get(d);
|
|
2594
2594
|
c ? A._setParentAndPosition(c, i, Z) : (A.pageIndex = d, A.x = i, A.y = Z);
|
|
2595
2595
|
}
|
|
2596
2596
|
};
|
|
@@ -2637,10 +2637,10 @@ const bd = class bd {
|
|
|
2637
2637
|
return l(this, IC);
|
|
2638
2638
|
}
|
|
2639
2639
|
getMode() {
|
|
2640
|
-
return l(this,
|
|
2640
|
+
return l(this, EI);
|
|
2641
2641
|
}
|
|
2642
2642
|
isEditingMode() {
|
|
2643
|
-
return l(this,
|
|
2643
|
+
return l(this, EI) !== P.NONE;
|
|
2644
2644
|
}
|
|
2645
2645
|
get imageManager() {
|
|
2646
2646
|
return v(this, "imageManager", new jm());
|
|
@@ -2725,7 +2725,7 @@ const bd = class bd {
|
|
|
2725
2725
|
if (!g)
|
|
2726
2726
|
return;
|
|
2727
2727
|
const C = l(this, uC).getRawValue(g);
|
|
2728
|
-
C && (l(this,
|
|
2728
|
+
C && (l(this, EI) === P.NONE && !C.hasBeenModified || C.renderAnnotationElement(I));
|
|
2729
2729
|
}
|
|
2730
2730
|
setMissingCanvas(I, g, C) {
|
|
2731
2731
|
var i;
|
|
@@ -2736,7 +2736,7 @@ const bd = class bd {
|
|
|
2736
2736
|
(l(this, Tl) || B(this, Tl, /* @__PURE__ */ new Map())).set(I, g);
|
|
2737
2737
|
}
|
|
2738
2738
|
};
|
|
2739
|
-
nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
2739
|
+
nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(), Ig = new WeakMap(), Nd = new WeakMap(), uC = new WeakMap(), Xd = new WeakMap(), yC = new WeakMap(), ug = new WeakMap(), pl = new WeakMap(), Sl = new WeakMap(), Rd = new WeakMap(), Fl = new WeakMap(), sA = new WeakMap(), HC = new WeakMap(), Si = new WeakMap(), Jc = new WeakMap(), zc = new WeakMap(), ud = new WeakMap(), kc = new WeakMap(), cA = new WeakMap(), Jl = new WeakMap(), yd = new WeakMap(), zl = new WeakMap(), GA = new WeakMap(), Q0 = new WeakMap(), kl = new WeakMap(), Hd = new WeakMap(), Lc = new WeakMap(), Ll = new WeakMap(), Fi = new WeakMap(), Md = new WeakMap(), Tl = new WeakMap(), Tc = new WeakMap(), EI = new WeakMap(), GI = new WeakMap(), LA = new WeakMap(), rl = new WeakMap(), jl = new WeakMap(), rc = new WeakMap(), Dd = new WeakMap(), jc = new WeakMap(), Ql = new WeakMap(), bA = new WeakMap(), TA = new WeakMap(), Qc = new WeakMap(), xc = new WeakMap(), MC = new WeakMap(), S = new WeakSet(), rb = function({
|
|
2740
2740
|
anchorNode: I
|
|
2741
2741
|
}) {
|
|
2742
2742
|
return I.nodeType === Node.TEXT_NODE ? I.parentElement : I;
|
|
@@ -2746,7 +2746,7 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2746
2746
|
} = this;
|
|
2747
2747
|
if (g.hasTextLayer(I))
|
|
2748
2748
|
return g;
|
|
2749
|
-
for (const C of l(this,
|
|
2749
|
+
for (const C of l(this, Ig).values())
|
|
2750
2750
|
if (C.hasTextLayer(I))
|
|
2751
2751
|
return C;
|
|
2752
2752
|
return null;
|
|
@@ -2779,8 +2779,8 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2779
2779
|
}
|
|
2780
2780
|
if ((d = l(this, GA)) == null || d.hide(), B(this, LA, g), Y(this, S, Kg).call(this, {
|
|
2781
2781
|
hasSelectedText: !0
|
|
2782
|
-
}), !(l(this,
|
|
2783
|
-
const c = l(this,
|
|
2782
|
+
}), !(l(this, EI) !== P.HIGHLIGHT && l(this, EI) !== P.NONE) && (l(this, EI) === P.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), B(this, zl, this.isShiftKeyDown), !this.isShiftKeyDown)) {
|
|
2783
|
+
const c = l(this, EI) === P.HIGHLIGHT ? Y(this, S, xm).call(this, A) : null;
|
|
2784
2784
|
if (c == null || c.toggleDrawing(), l(this, Hd)) {
|
|
2785
2785
|
const G = new AbortController(), b = this.combinedSignal(G), m = (W) => {
|
|
2786
2786
|
W.type === "pointerup" && W.button !== 0 || (G.abort(), c == null || c.toggleDrawing(!0), W.type === "pointerup" && Y(this, S, gc).call(this, "main_toolbar"));
|
|
@@ -2794,7 +2794,7 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2794
2794
|
c == null || c.toggleDrawing(!0), Y(this, S, gc).call(this, "main_toolbar");
|
|
2795
2795
|
}
|
|
2796
2796
|
}, gc = function(I = "") {
|
|
2797
|
-
l(this,
|
|
2797
|
+
l(this, EI) === P.HIGHLIGHT ? this.highlightSelection(I) : l(this, Jc) && Y(this, S, vW).call(this);
|
|
2798
2798
|
}, PW = function() {
|
|
2799
2799
|
document.addEventListener("selectionchange", Y(this, S, EW).bind(this), {
|
|
2800
2800
|
signal: this._signal
|
|
@@ -2851,7 +2851,7 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2851
2851
|
Object.entries(I).some(([C, A]) => l(this, jc)[C] !== A) && (this._eventBus.dispatch("annotationeditorstateschanged", {
|
|
2852
2852
|
source: this,
|
|
2853
2853
|
details: Object.assign(l(this, jc), I)
|
|
2854
|
-
}), l(this,
|
|
2854
|
+
}), l(this, EI) === P.HIGHLIGHT && I.hasSelectedEditor === !1 && Y(this, S, SA).call(this, [[gI.HIGHLIGHT_FREE, !0]]));
|
|
2855
2855
|
}, SA = function(I) {
|
|
2856
2856
|
this._eventBus.dispatch("annotationeditorparamschanged", {
|
|
2857
2857
|
source: this,
|
|
@@ -2861,7 +2861,7 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2861
2861
|
if (!l(this, kl)) {
|
|
2862
2862
|
B(this, kl, !0);
|
|
2863
2863
|
const I = [];
|
|
2864
|
-
for (const g of l(this,
|
|
2864
|
+
for (const g of l(this, Ig).values())
|
|
2865
2865
|
I.push(g.enable());
|
|
2866
2866
|
await Promise.all(I);
|
|
2867
2867
|
for (const g of l(this, zI).values())
|
|
@@ -2870,13 +2870,13 @@ nd = new WeakMap(), IC = new WeakMap(), Vd = new WeakMap(), zI = new WeakMap(),
|
|
|
2870
2870
|
}, Ah = function() {
|
|
2871
2871
|
if (this.unselectAll(), l(this, kl)) {
|
|
2872
2872
|
B(this, kl, !1);
|
|
2873
|
-
for (const I of l(this,
|
|
2873
|
+
for (const I of l(this, Ig).values())
|
|
2874
2874
|
I.disable();
|
|
2875
2875
|
for (const I of l(this, zI).values())
|
|
2876
2876
|
I.disable();
|
|
2877
2877
|
}
|
|
2878
2878
|
}, Om = function(I) {
|
|
2879
|
-
const g = l(this,
|
|
2879
|
+
const g = l(this, Ig).get(I.pageIndex);
|
|
2880
2880
|
g ? g.addOrRebuild(I) : (this.addEditor(I), this.addToAnnotationStorage(I));
|
|
2881
2881
|
}, lh = function() {
|
|
2882
2882
|
let I = null;
|
|
@@ -5557,7 +5557,7 @@ PA = new WeakMap(), O0 = new WeakMap();
|
|
|
5557
5557
|
const Mb = {
|
|
5558
5558
|
DATA: 1,
|
|
5559
5559
|
ERROR: 2
|
|
5560
|
-
},
|
|
5560
|
+
}, OI = {
|
|
5561
5561
|
CANCEL: 1,
|
|
5562
5562
|
CANCEL_COMPLETE: 2,
|
|
5563
5563
|
CLOSE: 3,
|
|
@@ -5650,7 +5650,7 @@ class dc {
|
|
|
5650
5650
|
return this.streamControllers[i].pullCall = b, c.postMessage({
|
|
5651
5651
|
sourceName: Z,
|
|
5652
5652
|
targetName: d,
|
|
5653
|
-
stream:
|
|
5653
|
+
stream: OI.PULL,
|
|
5654
5654
|
streamId: i,
|
|
5655
5655
|
desiredSize: G.desiredSize
|
|
5656
5656
|
}), b.promise;
|
|
@@ -5661,7 +5661,7 @@ class dc {
|
|
|
5661
5661
|
return this.streamControllers[i].cancelCall = b, this.streamControllers[i].isClosed = !0, c.postMessage({
|
|
5662
5662
|
sourceName: Z,
|
|
5663
5663
|
targetName: d,
|
|
5664
|
-
stream:
|
|
5664
|
+
stream: OI.CANCEL,
|
|
5665
5665
|
streamId: i,
|
|
5666
5666
|
reason: Qg(G)
|
|
5667
5667
|
}), b.promise;
|
|
@@ -5732,7 +5732,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5732
5732
|
this.desiredSize -= b, W > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), i.postMessage({
|
|
5733
5733
|
sourceName: C,
|
|
5734
5734
|
targetName: A,
|
|
5735
|
-
stream:
|
|
5735
|
+
stream: OI.ENQUEUE,
|
|
5736
5736
|
streamId: g,
|
|
5737
5737
|
chunk: G
|
|
5738
5738
|
}, m);
|
|
@@ -5741,7 +5741,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5741
5741
|
this.isCancelled || (this.isCancelled = !0, i.postMessage({
|
|
5742
5742
|
sourceName: C,
|
|
5743
5743
|
targetName: A,
|
|
5744
|
-
stream:
|
|
5744
|
+
stream: OI.CLOSE,
|
|
5745
5745
|
streamId: g
|
|
5746
5746
|
}), delete Z.streamSinks[g]);
|
|
5747
5747
|
},
|
|
@@ -5749,7 +5749,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5749
5749
|
CI(G instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, i.postMessage({
|
|
5750
5750
|
sourceName: C,
|
|
5751
5751
|
targetName: A,
|
|
5752
|
-
stream:
|
|
5752
|
+
stream: OI.ERROR,
|
|
5753
5753
|
streamId: g,
|
|
5754
5754
|
reason: Qg(G)
|
|
5755
5755
|
}));
|
|
@@ -5765,7 +5765,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5765
5765
|
i.postMessage({
|
|
5766
5766
|
sourceName: C,
|
|
5767
5767
|
targetName: A,
|
|
5768
|
-
stream:
|
|
5768
|
+
stream: OI.START_COMPLETE,
|
|
5769
5769
|
streamId: g,
|
|
5770
5770
|
success: !0
|
|
5771
5771
|
});
|
|
@@ -5773,7 +5773,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5773
5773
|
i.postMessage({
|
|
5774
5774
|
sourceName: C,
|
|
5775
5775
|
targetName: A,
|
|
5776
|
-
stream:
|
|
5776
|
+
stream: OI.START_COMPLETE,
|
|
5777
5777
|
streamId: g,
|
|
5778
5778
|
reason: Qg(G)
|
|
5779
5779
|
});
|
|
@@ -5781,18 +5781,18 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5781
5781
|
}, nh = function(I) {
|
|
5782
5782
|
const g = I.streamId, C = this.sourceName, A = I.sourceName, i = this.comObj, Z = this.streamControllers[g], d = this.streamSinks[g];
|
|
5783
5783
|
switch (I.stream) {
|
|
5784
|
-
case
|
|
5784
|
+
case OI.START_COMPLETE:
|
|
5785
5785
|
I.success ? Z.startCall.resolve() : Z.startCall.reject(Qg(I.reason));
|
|
5786
5786
|
break;
|
|
5787
|
-
case
|
|
5787
|
+
case OI.PULL_COMPLETE:
|
|
5788
5788
|
I.success ? Z.pullCall.resolve() : Z.pullCall.reject(Qg(I.reason));
|
|
5789
5789
|
break;
|
|
5790
|
-
case
|
|
5790
|
+
case OI.PULL:
|
|
5791
5791
|
if (!d) {
|
|
5792
5792
|
i.postMessage({
|
|
5793
5793
|
sourceName: C,
|
|
5794
5794
|
targetName: A,
|
|
5795
|
-
stream:
|
|
5795
|
+
stream: OI.PULL_COMPLETE,
|
|
5796
5796
|
streamId: g,
|
|
5797
5797
|
success: !0
|
|
5798
5798
|
});
|
|
@@ -5802,7 +5802,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5802
5802
|
i.postMessage({
|
|
5803
5803
|
sourceName: C,
|
|
5804
5804
|
targetName: A,
|
|
5805
|
-
stream:
|
|
5805
|
+
stream: OI.PULL_COMPLETE,
|
|
5806
5806
|
streamId: g,
|
|
5807
5807
|
success: !0
|
|
5808
5808
|
});
|
|
@@ -5810,29 +5810,29 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5810
5810
|
i.postMessage({
|
|
5811
5811
|
sourceName: C,
|
|
5812
5812
|
targetName: A,
|
|
5813
|
-
stream:
|
|
5813
|
+
stream: OI.PULL_COMPLETE,
|
|
5814
5814
|
streamId: g,
|
|
5815
5815
|
reason: Qg(G)
|
|
5816
5816
|
});
|
|
5817
5817
|
});
|
|
5818
5818
|
break;
|
|
5819
|
-
case
|
|
5819
|
+
case OI.ENQUEUE:
|
|
5820
5820
|
if (CI(Z, "enqueue should have stream controller"), Z.isClosed)
|
|
5821
5821
|
break;
|
|
5822
5822
|
Z.controller.enqueue(I.chunk);
|
|
5823
5823
|
break;
|
|
5824
|
-
case
|
|
5824
|
+
case OI.CLOSE:
|
|
5825
5825
|
if (CI(Z, "close should have stream controller"), Z.isClosed)
|
|
5826
5826
|
break;
|
|
5827
5827
|
Z.isClosed = !0, Z.controller.close(), Y(this, LC, vb).call(this, Z, g);
|
|
5828
5828
|
break;
|
|
5829
|
-
case
|
|
5829
|
+
case OI.ERROR:
|
|
5830
5830
|
CI(Z, "error should have stream controller"), Z.controller.error(Qg(I.reason)), Y(this, LC, vb).call(this, Z, g);
|
|
5831
5831
|
break;
|
|
5832
|
-
case
|
|
5832
|
+
case OI.CANCEL_COMPLETE:
|
|
5833
5833
|
I.success ? Z.cancelCall.resolve() : Z.cancelCall.reject(Qg(I.reason)), Y(this, LC, vb).call(this, Z, g);
|
|
5834
5834
|
break;
|
|
5835
|
-
case
|
|
5835
|
+
case OI.CANCEL:
|
|
5836
5836
|
if (!d)
|
|
5837
5837
|
break;
|
|
5838
5838
|
const c = Qg(I.reason);
|
|
@@ -5840,7 +5840,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5840
5840
|
i.postMessage({
|
|
5841
5841
|
sourceName: C,
|
|
5842
5842
|
targetName: A,
|
|
5843
|
-
stream:
|
|
5843
|
+
stream: OI.CANCEL_COMPLETE,
|
|
5844
5844
|
streamId: g,
|
|
5845
5845
|
success: !0
|
|
5846
5846
|
});
|
|
@@ -5848,7 +5848,7 @@ vd = new WeakMap(), LC = new WeakSet(), th = function({
|
|
|
5848
5848
|
i.postMessage({
|
|
5849
5849
|
sourceName: C,
|
|
5850
5850
|
targetName: A,
|
|
5851
|
-
stream:
|
|
5851
|
+
stream: OI.CANCEL_COMPLETE,
|
|
5852
5852
|
streamId: g,
|
|
5853
5853
|
reason: Qg(G)
|
|
5854
5854
|
});
|
|
@@ -5988,7 +5988,7 @@ class Oa extends Xh {
|
|
|
5988
5988
|
const [A, i, Z] = Y(this, J, Eb).call(this, g), d = g.length === 1 ? A : `${A}${i}${Z}`;
|
|
5989
5989
|
if (C = l(this, J, Ng).get(d), C)
|
|
5990
5990
|
return l(this, J, Ng).set(g, C), C;
|
|
5991
|
-
const c = `g_${l(this, qA)}_transfer_map_${
|
|
5991
|
+
const c = `g_${l(this, qA)}_transfer_map_${qI(this, CZ)._++}`, G = Y(this, J, ld).call(this, c);
|
|
5992
5992
|
l(this, J, Ng).set(g, G), l(this, J, Ng).set(d, G);
|
|
5993
5993
|
const b = Y(this, J, id).call(this, c);
|
|
5994
5994
|
return Y(this, J, Gc).call(this, A, i, Z, b), G;
|
|
@@ -6030,7 +6030,7 @@ class Oa extends Xh {
|
|
|
6030
6030
|
const [A] = Y(this, J, Eb).call(this, [g]), i = `alpha_${A}`;
|
|
6031
6031
|
if (C = l(this, J, Ng).get(i), C)
|
|
6032
6032
|
return l(this, J, Ng).set(g, C), C;
|
|
6033
|
-
const Z = `g_${l(this, qA)}_alpha_map_${
|
|
6033
|
+
const Z = `g_${l(this, qA)}_alpha_map_${qI(this, CZ)._++}`, d = Y(this, J, ld).call(this, Z);
|
|
6034
6034
|
l(this, J, Ng).set(g, d), l(this, J, Ng).set(i, d);
|
|
6035
6035
|
const c = Y(this, J, id).call(this, Z);
|
|
6036
6036
|
return Y(this, J, so).call(this, A, c), d;
|
|
@@ -6042,7 +6042,7 @@ class Oa extends Xh {
|
|
|
6042
6042
|
let A, i;
|
|
6043
6043
|
if (g ? ([A] = Y(this, J, Eb).call(this, [g]), i = `luminosity_${A}`) : i = "luminosity", C = l(this, J, Ng).get(i), C)
|
|
6044
6044
|
return l(this, J, Ng).set(g, C), C;
|
|
6045
|
-
const Z = `g_${l(this, qA)}_luminosity_map_${
|
|
6045
|
+
const Z = `g_${l(this, qA)}_luminosity_map_${qI(this, CZ)._++}`, d = Y(this, J, ld).call(this, Z);
|
|
6046
6046
|
l(this, J, Ng).set(g, d), l(this, J, Ng).set(i, d);
|
|
6047
6047
|
const c = Y(this, J, id).call(this, Z);
|
|
6048
6048
|
return Y(this, J, Rh).call(this, c), g && Y(this, J, so).call(this, A, c), d;
|
|
@@ -6491,19 +6491,19 @@ const TB = class TB {
|
|
|
6491
6491
|
throw new Error("Unreachable");
|
|
6492
6492
|
}
|
|
6493
6493
|
save(I) {
|
|
6494
|
-
return
|
|
6494
|
+
return qI(this, _d)._++, l(this, tI).save(l(this, kI)), this;
|
|
6495
6495
|
}
|
|
6496
6496
|
restore(I) {
|
|
6497
|
-
return l(this, _d) > 0 && (l(this, tI).restore(l(this, kI)),
|
|
6497
|
+
return l(this, _d) > 0 && (l(this, tI).restore(l(this, kI)), qI(this, _d)._--), this;
|
|
6498
6498
|
}
|
|
6499
6499
|
recordOpenMarker(I) {
|
|
6500
|
-
return
|
|
6500
|
+
return qI(this, qd)._++, this;
|
|
6501
6501
|
}
|
|
6502
6502
|
getOpenMarker() {
|
|
6503
6503
|
return l(this, qd) > 0 ? l(this, kI) : l(this, tI).getOpenMarker();
|
|
6504
6504
|
}
|
|
6505
6505
|
recordCloseMarker(I) {
|
|
6506
|
-
return
|
|
6506
|
+
return qI(this, qd)._--, this;
|
|
6507
6507
|
}
|
|
6508
6508
|
beginMarkedContent(I) {
|
|
6509
6509
|
return this;
|
|
@@ -6978,7 +6978,7 @@ class GW {
|
|
|
6978
6978
|
M(this, "charSpacing", 0);
|
|
6979
6979
|
M(this, "wordSpacing", 0);
|
|
6980
6980
|
M(this, "textHScale", 1);
|
|
6981
|
-
M(this, "textRenderingMode",
|
|
6981
|
+
M(this, "textRenderingMode", _I.FILL);
|
|
6982
6982
|
M(this, "textRise", 0);
|
|
6983
6983
|
M(this, "fillColor", "#000000");
|
|
6984
6984
|
M(this, "strokeColor", "#000000");
|
|
@@ -7515,19 +7515,19 @@ const rB = class rB {
|
|
|
7515
7515
|
}
|
|
7516
7516
|
paintChar(I, g, C, A, i, Z) {
|
|
7517
7517
|
var N, u, V, o;
|
|
7518
|
-
const d = this.ctx, c = this.current, G = c.font, b = c.textRenderingMode, m = c.fontSize / c.fontSizeScale, W = b &
|
|
7518
|
+
const d = this.ctx, c = this.current, G = c.font, b = c.textRenderingMode, m = c.fontSize / c.fontSizeScale, W = b & _I.FILL_STROKE_MASK, a = !!(b & _I.ADD_TO_PATH_FLAG), n = c.patternFill && !G.missingFile, e = c.patternStroke && !G.missingFile;
|
|
7519
7519
|
let X;
|
|
7520
7520
|
if ((G.disableFontFace || a || n || e) && !G.missingFile && (X = G.getPathGenerator(this.commonObjs, g)), X && (G.disableFontFace || n || e)) {
|
|
7521
7521
|
d.save(), d.translate(C, A), d.scale(m, -m), (N = this.dependencyTracker) == null || N.recordCharacterBBox(I, d, G);
|
|
7522
7522
|
let h;
|
|
7523
|
-
if (W ===
|
|
7523
|
+
if (W === _I.FILL || W === _I.FILL_STROKE)
|
|
7524
7524
|
if (i) {
|
|
7525
7525
|
h = d.getTransform(), d.setTransform(...i);
|
|
7526
7526
|
const t = Y(this, lA, Wo).call(this, X, h, i);
|
|
7527
7527
|
d.fill(t);
|
|
7528
7528
|
} else
|
|
7529
7529
|
d.fill(X);
|
|
7530
|
-
if (W ===
|
|
7530
|
+
if (W === _I.STROKE || W === _I.FILL_STROKE)
|
|
7531
7531
|
if (Z) {
|
|
7532
7532
|
h || (h = d.getTransform()), d.setTransform(...Z);
|
|
7533
7533
|
const {
|
|
@@ -7541,7 +7541,7 @@ const rB = class rB {
|
|
|
7541
7541
|
d.lineWidth /= m, d.stroke(X);
|
|
7542
7542
|
d.restore();
|
|
7543
7543
|
} else
|
|
7544
|
-
(W ===
|
|
7544
|
+
(W === _I.FILL || W === _I.FILL_STROKE) && (d.fillText(g, C, A), (u = this.dependencyTracker) == null || u.recordCharacterBBox(I, d, G, m, C, A, () => d.measureText(g))), (W === _I.STROKE || W === _I.FILL_STROKE) && (this.dependencyTracker && ((V = this.dependencyTracker) == null || V.recordCharacterBBox(I, d, G, m, C, A, () => d.measureText(g)).recordDependencies(I, NC.stroke)), d.strokeText(g, C, A));
|
|
7545
7545
|
a && ((this.pendingTextPaths || (this.pendingTextPaths = [])).push({
|
|
7546
7546
|
transform: SI(d),
|
|
7547
7547
|
x: C,
|
|
@@ -7566,7 +7566,7 @@ const rB = class rB {
|
|
|
7566
7566
|
}
|
|
7567
7567
|
showText(I, g) {
|
|
7568
7568
|
var D, k, T, r;
|
|
7569
|
-
this.dependencyTracker && (this.dependencyTracker.recordDependencies(I, NC.showText).resetBBox(I), this.current.textRenderingMode &
|
|
7569
|
+
this.dependencyTracker && (this.dependencyTracker.recordDependencies(I, NC.showText).resetBBox(I), this.current.textRenderingMode & _I.ADD_TO_PATH_FLAG && this.dependencyTracker.recordFutureForcedDependency("textClip", I).inheritPendingDependenciesAsFutureForcedDependencies());
|
|
7570
7570
|
const C = this.current, A = C.font;
|
|
7571
7571
|
if (A.isType3Font) {
|
|
7572
7572
|
this.showType3Text(I, g), (D = this.dependencyTracker) == null || D.recordShowTextOperation(I);
|
|
@@ -7577,10 +7577,10 @@ const rB = class rB {
|
|
|
7577
7577
|
(k = this.dependencyTracker) == null || k.recordOperation(I);
|
|
7578
7578
|
return;
|
|
7579
7579
|
}
|
|
7580
|
-
const Z = this.ctx, d = C.fontSizeScale, c = C.charSpacing, G = C.wordSpacing, b = C.fontDirection, m = C.textHScale * b, W = g.length, a = A.vertical, n = a ? 1 : -1, e = A.defaultVMetrics, X = i * C.fontMatrix[0], N = C.textRenderingMode ===
|
|
7580
|
+
const Z = this.ctx, d = C.fontSizeScale, c = C.charSpacing, G = C.wordSpacing, b = C.fontDirection, m = C.textHScale * b, W = g.length, a = A.vertical, n = a ? 1 : -1, e = A.defaultVMetrics, X = i * C.fontMatrix[0], N = C.textRenderingMode === _I.FILL && !A.disableFontFace && !C.patternFill;
|
|
7581
7581
|
Z.save(), C.textMatrix && Z.transform(...C.textMatrix), Z.translate(C.x, C.y + C.textRise), b > 0 ? Z.scale(m, -1) : Z.scale(m, 1);
|
|
7582
7582
|
let u, V;
|
|
7583
|
-
const o = C.textRenderingMode &
|
|
7583
|
+
const o = C.textRenderingMode & _I.FILL_STROKE_MASK, h = o === _I.FILL || o === _I.FILL_STROKE, t = o === _I.STROKE || o === _I.FILL_STROKE;
|
|
7584
7584
|
if (h && C.patternFill) {
|
|
7585
7585
|
Z.save();
|
|
7586
7586
|
const U = C.fillColor.getPattern(Z, this, iA(Z), ag.FILL, I);
|
|
@@ -7646,7 +7646,7 @@ const rB = class rB {
|
|
|
7646
7646
|
a ? C.y -= H : C.x += H * m, Z.restore(), this.compose(), (r = this.dependencyTracker) == null || r.recordShowTextOperation(I);
|
|
7647
7647
|
}
|
|
7648
7648
|
showType3Text(I, g) {
|
|
7649
|
-
const C = this.ctx, A = this.current, i = A.font, Z = A.fontSize, d = A.fontDirection, c = i.vertical ? 1 : -1, G = A.charSpacing, b = A.wordSpacing, m = A.textHScale * d, W = A.fontMatrix || Sm, a = g.length, n = A.textRenderingMode ===
|
|
7649
|
+
const C = this.ctx, A = this.current, i = A.font, Z = A.fontSize, d = A.fontDirection, c = i.vertical ? 1 : -1, G = A.charSpacing, b = A.wordSpacing, m = A.textHScale * d, W = A.fontMatrix || Sm, a = g.length, n = A.textRenderingMode === _I.INVISIBLE;
|
|
7650
7650
|
let e, X, N, u;
|
|
7651
7651
|
if (n || Z === 0)
|
|
7652
7652
|
return;
|
|
@@ -9597,7 +9597,7 @@ const P0 = class P0 {
|
|
|
9597
9597
|
M(this, "_capability", Promise.withResolvers());
|
|
9598
9598
|
M(this, "_transport", null);
|
|
9599
9599
|
M(this, "_worker", null);
|
|
9600
|
-
M(this, "docId", `d${
|
|
9600
|
+
M(this, "docId", `d${qI(P0, E0)._++}`);
|
|
9601
9601
|
M(this, "destroyed", !1);
|
|
9602
9602
|
M(this, "onPassword", null);
|
|
9603
9603
|
M(this, "onProgress", null);
|
|
@@ -10237,7 +10237,7 @@ _l = new WeakMap(), PC = new WeakMap(), Al = new WeakMap(), oZ = new WeakMap(),
|
|
|
10237
10237
|
}
|
|
10238
10238
|
const g = new xa();
|
|
10239
10239
|
B(this, Al, g);
|
|
10240
|
-
const C = `fake${
|
|
10240
|
+
const C = `fake${qI(yI, f0)._++}`, A = new dc(C + "_worker", C, g);
|
|
10241
10241
|
I.setup(A, g), B(this, PC, new dc(C, C + "_worker", g)), Y(this, Lg, fb).call(this);
|
|
10242
10242
|
}).catch((I) => {
|
|
10243
10243
|
l(this, _l).reject(new Error(`Setting up fake worker failed: "${I.message}".`));
|
|
@@ -10790,7 +10790,7 @@ const yi = class yi {
|
|
|
10790
10790
|
Ii = new WeakMap(), wZ = new WeakMap(), w(yi, wZ, /* @__PURE__ */ new WeakSet());
|
|
10791
10791
|
let eo = yi;
|
|
10792
10792
|
const kY = "5.4.530", LY = "50cc4adac";
|
|
10793
|
-
var ZC, aZ, ms,
|
|
10793
|
+
var ZC, aZ, ms, gg, kG, os, Zl, LG, gi, fC, TG, wI, no, Vo, No, Ni, xh, ul;
|
|
10794
10794
|
const xg = class xg {
|
|
10795
10795
|
constructor({
|
|
10796
10796
|
editor: I = null,
|
|
@@ -10800,7 +10800,7 @@ const xg = class xg {
|
|
|
10800
10800
|
w(this, ZC, null);
|
|
10801
10801
|
w(this, aZ, null);
|
|
10802
10802
|
w(this, ms);
|
|
10803
|
-
w(this,
|
|
10803
|
+
w(this, gg, null);
|
|
10804
10804
|
w(this, kG, !1);
|
|
10805
10805
|
w(this, os, !1);
|
|
10806
10806
|
w(this, Zl, null);
|
|
@@ -10832,7 +10832,7 @@ const xg = class xg {
|
|
|
10832
10832
|
return C.className = "swatch", C.ariaHidden = "true", C.style.backgroundColor = l(this, ms), I.append(C), I;
|
|
10833
10833
|
}
|
|
10834
10834
|
renderMainDropdown() {
|
|
10835
|
-
const I = B(this,
|
|
10835
|
+
const I = B(this, gg, Y(this, wI, no).call(this));
|
|
10836
10836
|
return I.ariaOrientation = "horizontal", I.ariaLabelledBy = "highlightColorPickerLabel", I;
|
|
10837
10837
|
}
|
|
10838
10838
|
_colorSelectFromKeyboard(I) {
|
|
@@ -10850,14 +10850,14 @@ const xg = class xg {
|
|
|
10850
10850
|
return;
|
|
10851
10851
|
}
|
|
10852
10852
|
if (I.target === l(this, ZC)) {
|
|
10853
|
-
(g = l(this,
|
|
10853
|
+
(g = l(this, gg).firstElementChild) == null || g.focus();
|
|
10854
10854
|
return;
|
|
10855
10855
|
}
|
|
10856
10856
|
(C = I.target.nextSibling) == null || C.focus();
|
|
10857
10857
|
}
|
|
10858
10858
|
_moveToPrevious(I) {
|
|
10859
10859
|
var g, C;
|
|
10860
|
-
if (I.target === ((g = l(this,
|
|
10860
|
+
if (I.target === ((g = l(this, gg)) == null ? void 0 : g.firstElementChild) || I.target === l(this, ZC)) {
|
|
10861
10861
|
l(this, wI, ul) && this._hideDropdownFromKeyboard();
|
|
10862
10862
|
return;
|
|
10863
10863
|
}
|
|
@@ -10869,7 +10869,7 @@ const xg = class xg {
|
|
|
10869
10869
|
Y(this, wI, Ni).call(this, I);
|
|
10870
10870
|
return;
|
|
10871
10871
|
}
|
|
10872
|
-
(g = l(this,
|
|
10872
|
+
(g = l(this, gg).firstElementChild) == null || g.focus();
|
|
10873
10873
|
}
|
|
10874
10874
|
_moveToEnd(I) {
|
|
10875
10875
|
var g;
|
|
@@ -10877,11 +10877,11 @@ const xg = class xg {
|
|
|
10877
10877
|
Y(this, wI, Ni).call(this, I);
|
|
10878
10878
|
return;
|
|
10879
10879
|
}
|
|
10880
|
-
(g = l(this,
|
|
10880
|
+
(g = l(this, gg).lastElementChild) == null || g.focus();
|
|
10881
10881
|
}
|
|
10882
10882
|
hideDropdown() {
|
|
10883
10883
|
var I, g;
|
|
10884
|
-
(I = l(this,
|
|
10884
|
+
(I = l(this, gg)) == null || I.classList.add("hidden"), l(this, ZC).ariaExpanded = "false", (g = l(this, gi)) == null || g.abort(), B(this, gi, null);
|
|
10885
10885
|
}
|
|
10886
10886
|
_hideDropdownFromKeyboard() {
|
|
10887
10887
|
var I;
|
|
@@ -10897,18 +10897,18 @@ const xg = class xg {
|
|
|
10897
10897
|
}
|
|
10898
10898
|
}
|
|
10899
10899
|
updateColor(I) {
|
|
10900
|
-
if (l(this, aZ) && (l(this, aZ).style.backgroundColor = I), !l(this,
|
|
10900
|
+
if (l(this, aZ) && (l(this, aZ).style.backgroundColor = I), !l(this, gg))
|
|
10901
10901
|
return;
|
|
10902
10902
|
const g = l(this, fC).highlightColors.values();
|
|
10903
|
-
for (const C of l(this,
|
|
10903
|
+
for (const C of l(this, gg).children)
|
|
10904
10904
|
C.ariaSelected = g.next().value === I.toUpperCase();
|
|
10905
10905
|
}
|
|
10906
10906
|
destroy() {
|
|
10907
10907
|
var I, g;
|
|
10908
|
-
(I = l(this, ZC)) == null || I.remove(), B(this, ZC, null), B(this, aZ, null), (g = l(this,
|
|
10908
|
+
(I = l(this, ZC)) == null || I.remove(), B(this, ZC, null), B(this, aZ, null), (g = l(this, gg)) == null || g.remove(), B(this, gg, null);
|
|
10909
10909
|
}
|
|
10910
10910
|
};
|
|
10911
|
-
ZC = new WeakMap(), aZ = new WeakMap(), ms = new WeakMap(),
|
|
10911
|
+
ZC = new WeakMap(), aZ = new WeakMap(), ms = new WeakMap(), gg = new WeakMap(), kG = new WeakMap(), os = new WeakMap(), Zl = new WeakMap(), LG = new WeakMap(), gi = new WeakMap(), fC = new WeakMap(), TG = new WeakMap(), wI = new WeakSet(), no = function() {
|
|
10912
10912
|
const I = document.createElement("div"), g = l(this, fC)._signal;
|
|
10913
10913
|
I.addEventListener("contextmenu", TC, {
|
|
10914
10914
|
signal: g
|
|
@@ -10939,17 +10939,17 @@ ZC = new WeakMap(), aZ = new WeakMap(), ms = new WeakMap(), Ig = new WeakMap(),
|
|
|
10939
10939
|
}
|
|
10940
10940
|
if (B(this, kG, I.detail === 0), l(this, gi) || (B(this, gi, new AbortController()), window.addEventListener("pointerdown", Y(this, wI, xh).bind(this), {
|
|
10941
10941
|
signal: l(this, fC).combinedSignal(l(this, gi))
|
|
10942
|
-
})), l(this, ZC).ariaExpanded = "true", l(this,
|
|
10943
|
-
l(this,
|
|
10942
|
+
})), l(this, ZC).ariaExpanded = "true", l(this, gg)) {
|
|
10943
|
+
l(this, gg).classList.remove("hidden");
|
|
10944
10944
|
return;
|
|
10945
10945
|
}
|
|
10946
|
-
const g = B(this,
|
|
10946
|
+
const g = B(this, gg, Y(this, wI, no).call(this));
|
|
10947
10947
|
l(this, ZC).append(g);
|
|
10948
10948
|
}, xh = function(I) {
|
|
10949
10949
|
var g;
|
|
10950
|
-
(g = l(this,
|
|
10950
|
+
(g = l(this, gg)) != null && g.contains(I.target) || this.hideDropdown();
|
|
10951
10951
|
}, ul = function() {
|
|
10952
|
-
return l(this,
|
|
10952
|
+
return l(this, gg) && !l(this, gg).classList.contains("hidden");
|
|
10953
10953
|
}, w(xg, TG, null);
|
|
10954
10954
|
let X0 = xg;
|
|
10955
10955
|
var eA, rG, Bs, jG;
|
|
@@ -11067,11 +11067,11 @@ const rY = 9, PZ = /* @__PURE__ */ new WeakSet(), jY = (/* @__PURE__ */ new Date
|
|
|
11067
11067
|
class um {
|
|
11068
11068
|
static create(I) {
|
|
11069
11069
|
switch (I.data.annotationType) {
|
|
11070
|
-
case
|
|
11070
|
+
case vI.LINK:
|
|
11071
11071
|
return new nB(I);
|
|
11072
|
-
case
|
|
11072
|
+
case vI.TEXT:
|
|
11073
11073
|
return new xY(I);
|
|
11074
|
-
case
|
|
11074
|
+
case vI.WIDGET:
|
|
11075
11075
|
switch (I.data.fieldType) {
|
|
11076
11076
|
case "Tx":
|
|
11077
11077
|
return new UY(I);
|
|
@@ -11083,35 +11083,35 @@ class um {
|
|
|
11083
11083
|
return new OY(I);
|
|
11084
11084
|
}
|
|
11085
11085
|
return new _Z(I);
|
|
11086
|
-
case
|
|
11086
|
+
case vI.POPUP:
|
|
11087
11087
|
return new Ro(I);
|
|
11088
|
-
case
|
|
11088
|
+
case vI.FREETEXT:
|
|
11089
11089
|
return new _h(I);
|
|
11090
|
-
case
|
|
11090
|
+
case vI.LINE:
|
|
11091
11091
|
return new qY(I);
|
|
11092
|
-
case
|
|
11092
|
+
case vI.SQUARE:
|
|
11093
11093
|
return new _Y(I);
|
|
11094
|
-
case
|
|
11094
|
+
case vI.CIRCLE:
|
|
11095
11095
|
return new $Y(I);
|
|
11096
|
-
case
|
|
11096
|
+
case vI.POLYLINE:
|
|
11097
11097
|
return new $h(I);
|
|
11098
|
-
case
|
|
11098
|
+
case vI.CARET:
|
|
11099
11099
|
return new gt(I);
|
|
11100
|
-
case
|
|
11100
|
+
case vI.INK:
|
|
11101
11101
|
return new VB(I);
|
|
11102
|
-
case
|
|
11102
|
+
case vI.POLYGON:
|
|
11103
11103
|
return new It(I);
|
|
11104
|
-
case
|
|
11104
|
+
case vI.HIGHLIGHT:
|
|
11105
11105
|
return new Iw(I);
|
|
11106
|
-
case
|
|
11106
|
+
case vI.UNDERLINE:
|
|
11107
11107
|
return new Ct(I);
|
|
11108
|
-
case
|
|
11108
|
+
case vI.SQUIGGLY:
|
|
11109
11109
|
return new At(I);
|
|
11110
|
-
case
|
|
11110
|
+
case vI.STRIKEOUT:
|
|
11111
11111
|
return new lt(I);
|
|
11112
|
-
case
|
|
11112
|
+
case vI.STAMP:
|
|
11113
11113
|
return new gw(I);
|
|
11114
|
-
case
|
|
11114
|
+
case vI.FILEATTACHMENT:
|
|
11115
11115
|
return new it(I);
|
|
11116
11116
|
default:
|
|
11117
11117
|
return new FI(I);
|
|
@@ -12632,8 +12632,8 @@ class fY {
|
|
|
12632
12632
|
resetEdited() {
|
|
12633
12633
|
var I;
|
|
12634
12634
|
l(this, eZ) && ({
|
|
12635
|
-
contentsObj:
|
|
12636
|
-
richText:
|
|
12635
|
+
contentsObj: qI(this, nA)._,
|
|
12636
|
+
richText: qI(this, Gl)._
|
|
12637
12637
|
} = l(this, eZ), B(this, eZ, null), (I = l(this, sC)) == null || I.remove(), B(this, sC, null), B(this, sl, null));
|
|
12638
12638
|
}
|
|
12639
12639
|
remove() {
|
|
@@ -13201,7 +13201,7 @@ const QB = class QB {
|
|
|
13201
13201
|
for (const c of g) {
|
|
13202
13202
|
if (c.noHTML)
|
|
13203
13203
|
continue;
|
|
13204
|
-
const G = c.annotationType ===
|
|
13204
|
+
const G = c.annotationType === vI.POPUP;
|
|
13205
13205
|
if (G) {
|
|
13206
13206
|
const W = A.get(c.id);
|
|
13207
13207
|
if (!W)
|
|
@@ -13385,14 +13385,14 @@ VZ = new WeakMap(), NZ = new WeakMap(), es = new WeakMap(), di = new WeakMap(),
|
|
|
13385
13385
|
};
|
|
13386
13386
|
let Fo = QB;
|
|
13387
13387
|
const Fb = /\r\n?|\n/g;
|
|
13388
|
-
var GC, Cb, RZ, bC,
|
|
13388
|
+
var GC, Cb, RZ, bC, fI, Cw, Aw, lw, A0, Nl, l0, i0, iw, ko, Zw;
|
|
13389
13389
|
const uI = class uI extends RI {
|
|
13390
13390
|
constructor(g) {
|
|
13391
13391
|
super({
|
|
13392
13392
|
...g,
|
|
13393
13393
|
name: "freeTextEditor"
|
|
13394
13394
|
});
|
|
13395
|
-
w(this,
|
|
13395
|
+
w(this, fI);
|
|
13396
13396
|
w(this, GC, "");
|
|
13397
13397
|
w(this, Cb, `${this.id}-editor`);
|
|
13398
13398
|
w(this, RZ, null);
|
|
@@ -13448,10 +13448,10 @@ const uI = class uI extends RI {
|
|
|
13448
13448
|
updateParams(g, C) {
|
|
13449
13449
|
switch (g) {
|
|
13450
13450
|
case gI.FREETEXT_SIZE:
|
|
13451
|
-
Y(this,
|
|
13451
|
+
Y(this, fI, Cw).call(this, C);
|
|
13452
13452
|
break;
|
|
13453
13453
|
case gI.FREETEXT_COLOR:
|
|
13454
|
-
Y(this,
|
|
13454
|
+
Y(this, fI, Aw).call(this, C);
|
|
13455
13455
|
break;
|
|
13456
13456
|
}
|
|
13457
13457
|
}
|
|
@@ -13521,7 +13521,7 @@ const uI = class uI extends RI {
|
|
|
13521
13521
|
if (!this.isInEditMode())
|
|
13522
13522
|
return;
|
|
13523
13523
|
super.commit(), this.disableEditMode();
|
|
13524
|
-
const g = l(this, GC), C = B(this, GC, Y(this,
|
|
13524
|
+
const g = l(this, GC), C = B(this, GC, Y(this, fI, lw).call(this).trimEnd());
|
|
13525
13525
|
if (g === C)
|
|
13526
13526
|
return;
|
|
13527
13527
|
const A = (i) => {
|
|
@@ -13529,7 +13529,7 @@ const uI = class uI extends RI {
|
|
|
13529
13529
|
this.remove();
|
|
13530
13530
|
return;
|
|
13531
13531
|
}
|
|
13532
|
-
Y(this,
|
|
13532
|
+
Y(this, fI, i0).call(this), this._uiManager.rebuild(this), Y(this, fI, A0).call(this);
|
|
13533
13533
|
};
|
|
13534
13534
|
this.addCommands({
|
|
13535
13535
|
cmd: () => {
|
|
@@ -13539,7 +13539,7 @@ const uI = class uI extends RI {
|
|
|
13539
13539
|
A(g);
|
|
13540
13540
|
},
|
|
13541
13541
|
mustExec: !1
|
|
13542
|
-
}), Y(this,
|
|
13542
|
+
}), Y(this, fI, A0).call(this);
|
|
13543
13543
|
}
|
|
13544
13544
|
shouldGetKeyboardEvents() {
|
|
13545
13545
|
return this.isInEditMode();
|
|
@@ -13606,7 +13606,7 @@ const uI = class uI extends RI {
|
|
|
13606
13606
|
this.setAt(n * i, e * Z, c, G);
|
|
13607
13607
|
} else
|
|
13608
13608
|
this._moveAfterPaste(g, C);
|
|
13609
|
-
Y(this,
|
|
13609
|
+
Y(this, fI, i0).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
|
|
13610
13610
|
} else
|
|
13611
13611
|
this._isDraggable = !1, this.editorDiv.contentEditable = !0;
|
|
13612
13612
|
return this.div;
|
|
@@ -13657,7 +13657,7 @@ const uI = class uI extends RI {
|
|
|
13657
13657
|
}
|
|
13658
13658
|
B(this, GC, `${b.join(`
|
|
13659
13659
|
`)}${i}${m.join(`
|
|
13660
|
-
`)}`), Y(this,
|
|
13660
|
+
`)}`), Y(this, fI, i0).call(this);
|
|
13661
13661
|
const W = new Range();
|
|
13662
13662
|
let a = Math.sumPrecise(b.map((N) => N.length));
|
|
13663
13663
|
for (const {
|
|
@@ -13740,9 +13740,9 @@ const uI = class uI extends RI {
|
|
|
13740
13740
|
const C = RI._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.color), A = Object.assign(super.serialize(g), {
|
|
13741
13741
|
color: C,
|
|
13742
13742
|
fontSize: l(this, bC),
|
|
13743
|
-
value: Y(this,
|
|
13743
|
+
value: Y(this, fI, iw).call(this)
|
|
13744
13744
|
});
|
|
13745
|
-
return this.addComment(A), g ? (A.isCopy = !0, A) : this.annotationElementId && !Y(this,
|
|
13745
|
+
return this.addComment(A), g ? (A.isCopy = !0, A) : this.annotationElementId && !Y(this, fI, Zw).call(this, A) ? null : (A.id = this.annotationElementId, A);
|
|
13746
13746
|
}
|
|
13747
13747
|
renderAnnotationElement(g) {
|
|
13748
13748
|
const C = super.renderAnnotationElement(g);
|
|
@@ -13768,9 +13768,9 @@ const uI = class uI extends RI {
|
|
|
13768
13768
|
super.resetAnnotationElement(g), g.resetEdited();
|
|
13769
13769
|
}
|
|
13770
13770
|
};
|
|
13771
|
-
GC = new WeakMap(), Cb = new WeakMap(), RZ = new WeakMap(), bC = new WeakMap(),
|
|
13771
|
+
GC = new WeakMap(), Cb = new WeakMap(), RZ = new WeakMap(), bC = new WeakMap(), fI = new WeakSet(), Cw = function(g) {
|
|
13772
13772
|
const C = (i) => {
|
|
13773
|
-
this.editorDiv.style.fontSize = `calc(${i}px * var(--total-scale-factor))`, this.translate(0, -(i - l(this, bC)) * this.parentScale), B(this, bC, i), Y(this,
|
|
13773
|
+
this.editorDiv.style.fontSize = `calc(${i}px * var(--total-scale-factor))`, this.translate(0, -(i - l(this, bC)) * this.parentScale), B(this, bC, i), Y(this, fI, A0).call(this);
|
|
13774
13774
|
}, A = l(this, bC);
|
|
13775
13775
|
this.addCommands({
|
|
13776
13776
|
cmd: C.bind(this, g),
|
|
@@ -14819,8 +14819,8 @@ ys = new WeakMap(), mb = new WeakMap(), ml = new WeakMap(), MZ = new WeakMap(),
|
|
|
14819
14819
|
l(this, WC) === null || !this.parent || (this.parent.drawLayer.remove(l(this, WC)), B(this, WC, null), this.parent.drawLayer.remove(l(this, Mg)), B(this, Mg, null));
|
|
14820
14820
|
}, Ri = function(g = this.parent) {
|
|
14821
14821
|
l(this, WC) === null && ({
|
|
14822
|
-
id:
|
|
14823
|
-
clipPathId:
|
|
14822
|
+
id: qI(this, WC)._,
|
|
14823
|
+
clipPathId: qI(this, MZ)._
|
|
14824
14824
|
} = g.drawLayer.draw({
|
|
14825
14825
|
bbox: l(this, BC).box,
|
|
14826
14826
|
root: {
|
|
@@ -17585,7 +17585,7 @@ QZ = new WeakMap(), Ls = new WeakMap(), Bi = new WeakMap(), Wi = new WeakMap(),
|
|
|
17585
17585
|
}, M(QC, "_initialized", !1), w(QC, ai, new Map([zo, vo, IB, H0, $o].map((I) => [I._editorType, I])));
|
|
17586
17586
|
let CB = QC;
|
|
17587
17587
|
var gA, Jg, xZ, Yb, Am, rw, KA, dB, jw, sB;
|
|
17588
|
-
const
|
|
17588
|
+
const $I = class $I {
|
|
17589
17589
|
constructor({
|
|
17590
17590
|
pageIndex: I
|
|
17591
17591
|
}) {
|
|
@@ -17611,35 +17611,35 @@ const _I = class _I {
|
|
|
17611
17611
|
return v(this, "_svgFactory", new u0());
|
|
17612
17612
|
}
|
|
17613
17613
|
draw(I, g = !1, C = !1) {
|
|
17614
|
-
const A =
|
|
17614
|
+
const A = qI($I, Yb)._++, i = Y(this, KA, dB).call(this), Z = $I._svgFactory.createElement("defs");
|
|
17615
17615
|
i.append(Z);
|
|
17616
|
-
const d =
|
|
17616
|
+
const d = $I._svgFactory.createElement("path");
|
|
17617
17617
|
Z.append(d);
|
|
17618
17618
|
const c = `path_p${this.pageIndex}_${A}`;
|
|
17619
17619
|
d.setAttribute("id", c), d.setAttribute("vector-effect", "non-scaling-stroke"), g && l(this, xZ).set(A, d);
|
|
17620
|
-
const G = C ? Y(this, KA, jw).call(this, Z, c) : null, b =
|
|
17620
|
+
const G = C ? Y(this, KA, jw).call(this, Z, c) : null, b = $I._svgFactory.createElement("use");
|
|
17621
17621
|
return i.append(b), b.setAttribute("href", `#${c}`), this.updateProperties(i, I), l(this, Jg).set(A, i), {
|
|
17622
17622
|
id: A,
|
|
17623
17623
|
clipPathId: `url(#${G})`
|
|
17624
17624
|
};
|
|
17625
17625
|
}
|
|
17626
17626
|
drawOutline(I, g) {
|
|
17627
|
-
const C =
|
|
17627
|
+
const C = qI($I, Yb)._++, A = Y(this, KA, dB).call(this), i = $I._svgFactory.createElement("defs");
|
|
17628
17628
|
A.append(i);
|
|
17629
|
-
const Z =
|
|
17629
|
+
const Z = $I._svgFactory.createElement("path");
|
|
17630
17630
|
i.append(Z);
|
|
17631
17631
|
const d = `path_p${this.pageIndex}_${C}`;
|
|
17632
17632
|
Z.setAttribute("id", d), Z.setAttribute("vector-effect", "non-scaling-stroke");
|
|
17633
17633
|
let c;
|
|
17634
17634
|
if (g) {
|
|
17635
|
-
const m =
|
|
17635
|
+
const m = $I._svgFactory.createElement("mask");
|
|
17636
17636
|
i.append(m), c = `mask_p${this.pageIndex}_${C}`, m.setAttribute("id", c), m.setAttribute("maskUnits", "objectBoundingBox");
|
|
17637
|
-
const W =
|
|
17637
|
+
const W = $I._svgFactory.createElement("rect");
|
|
17638
17638
|
m.append(W), W.setAttribute("width", "1"), W.setAttribute("height", "1"), W.setAttribute("fill", "white");
|
|
17639
|
-
const a =
|
|
17639
|
+
const a = $I._svgFactory.createElement("use");
|
|
17640
17640
|
m.append(a), a.setAttribute("href", `#${d}`), a.setAttribute("stroke", "none"), a.setAttribute("fill", "black"), a.setAttribute("fill-rule", "nonzero"), a.classList.add("mask");
|
|
17641
17641
|
}
|
|
17642
|
-
const G =
|
|
17642
|
+
const G = $I._svgFactory.createElement("use");
|
|
17643
17643
|
A.append(G), G.setAttribute("href", `#${d}`), c && G.setAttribute("mask", `url(#${c})`);
|
|
17644
17644
|
const b = G.cloneNode();
|
|
17645
17645
|
return A.append(b), G.classList.add("mainOutline"), b.classList.add("secondaryOutline"), this.updateProperties(A, I), l(this, Jg).set(C, A), C;
|
|
@@ -17658,7 +17658,7 @@ const _I = class _I {
|
|
|
17658
17658
|
path: Z
|
|
17659
17659
|
} = g, d = typeof I == "number" ? l(this, Jg).get(I) : I;
|
|
17660
17660
|
if (d) {
|
|
17661
|
-
if (C && Y(this, KA, sB).call(this, d, C), A && Y(c =
|
|
17661
|
+
if (C && Y(this, KA, sB).call(this, d, C), A && Y(c = $I, Am, rw).call(c, d, A), i) {
|
|
17662
17662
|
const {
|
|
17663
17663
|
classList: G
|
|
17664
17664
|
} = d;
|
|
@@ -17693,20 +17693,20 @@ gA = new WeakMap(), Jg = new WeakMap(), xZ = new WeakMap(), Yb = new WeakMap(),
|
|
|
17693
17693
|
} = I;
|
|
17694
17694
|
Z.top = `${100 * C}%`, Z.left = `${100 * g}%`, Z.width = `${100 * A}%`, Z.height = `${100 * i}%`;
|
|
17695
17695
|
}, KA = new WeakSet(), dB = function() {
|
|
17696
|
-
const I =
|
|
17696
|
+
const I = $I._svgFactory.create(1, 1, !0);
|
|
17697
17697
|
return l(this, gA).append(I), I.setAttribute("aria-hidden", !0), I;
|
|
17698
17698
|
}, jw = function(I, g) {
|
|
17699
|
-
const C =
|
|
17699
|
+
const C = $I._svgFactory.createElement("clipPath");
|
|
17700
17700
|
I.append(C);
|
|
17701
17701
|
const A = `clip_${g}`;
|
|
17702
17702
|
C.setAttribute("id", A), C.setAttribute("clipPathUnits", "objectBoundingBox");
|
|
17703
|
-
const i =
|
|
17703
|
+
const i = $I._svgFactory.createElement("use");
|
|
17704
17704
|
return C.append(i), i.setAttribute("href", `#${g}`), i.classList.add("clip"), A;
|
|
17705
17705
|
}, sB = function(I, g) {
|
|
17706
17706
|
for (const [C, A] of Object.entries(g))
|
|
17707
17707
|
A === null ? I.removeAttribute(C) : I.setAttribute(C, A);
|
|
17708
|
-
}, w(
|
|
17709
|
-
let ZB =
|
|
17708
|
+
}, w($I, Am), w($I, Yb, 0);
|
|
17709
|
+
let ZB = $I;
|
|
17710
17710
|
globalThis._pdfjsTestingUtils = {
|
|
17711
17711
|
HighlightOutliner: Lo
|
|
17712
17712
|
};
|
|
@@ -17718,7 +17718,7 @@ globalThis.pdfjsLib = {
|
|
|
17718
17718
|
AnnotationEditorUIManager: EZ,
|
|
17719
17719
|
AnnotationLayer: Fo,
|
|
17720
17720
|
AnnotationMode: yl,
|
|
17721
|
-
AnnotationType:
|
|
17721
|
+
AnnotationType: vI,
|
|
17722
17722
|
applyOpacity: Da,
|
|
17723
17723
|
build: LY,
|
|
17724
17724
|
ColorPicker: X0,
|
|
@@ -18749,7 +18749,7 @@ Object.defineProperty($Z.prototype, "value", { get: function() {
|
|
|
18749
18749
|
if (this.h(), s !== void 0 && (s.i = this.i), 16 & this.f) throw this.v;
|
|
18750
18750
|
return this.v;
|
|
18751
18751
|
} });
|
|
18752
|
-
function
|
|
18752
|
+
function UI(s, I) {
|
|
18753
18753
|
return new $Z(s, I);
|
|
18754
18754
|
}
|
|
18755
18755
|
function Aa(s) {
|
|
@@ -18813,15 +18813,15 @@ function hd(s, I) {
|
|
|
18813
18813
|
var C = g.d.bind(g);
|
|
18814
18814
|
return C[Symbol.dispose] = C, C;
|
|
18815
18815
|
}
|
|
18816
|
-
const
|
|
18816
|
+
const PI = eg(0), om = eg(0), Cg = eg(!1), Qs = eg(!0), k0 = eg("landscape"), BB = eg("read"), SB = eg("auto"), FB = eg(!0), jt = eg(!1), la = eg("#7367f0"), JB = eg(!1), ia = eg(!1), el = eg(!1), zB = eg(3e3), Yl = eg(!0), dI = eg({
|
|
18817
18817
|
isActive: !1,
|
|
18818
18818
|
translateX: 0,
|
|
18819
18819
|
translateY: 0,
|
|
18820
18820
|
isDragging: !1,
|
|
18821
18821
|
scale: 1
|
|
18822
|
-
}), tl = eg([]), Bm =
|
|
18822
|
+
}), tl = eg([]), Bm = UI(() => !Cg.value && k0.value === "landscape"), Qt = UI(() => Bm.value && PI.value === 0), xt = UI(() => Bm.value ? PI.value >= om.value - 1 : !1);
|
|
18823
18823
|
function Ut(s, I, g, C) {
|
|
18824
|
-
om.value = I, tl.value = g, jt.value = C, s.theme !== void 0 && (SB.value = s.theme), s.primaryColor !== void 0 && (la.value = s.primaryColor), s.showThumbs !== void 0 && (Qs.value = s.showThumbs), s.allowDownload !== void 0 && (FB.value = s.allowDownload), s.whiteLabel !== void 0 && (JB.value = s.whiteLabel), s.soundEnabled !== void 0 && (Yl.value = s.soundEnabled), s.isSingleMode !== void 0 && (Cg.value = s.isSingleMode), s.singleMode !== void 0 && (Cg.value = s.singleMode), s.autoPlay !== void 0 && (el.value = s.autoPlay), s.autoPlayInterval !== void 0 && (zB.value = s.autoPlayInterval),
|
|
18824
|
+
om.value = I, tl.value = g, jt.value = C, s.theme !== void 0 && (SB.value = s.theme), s.primaryColor !== void 0 && (la.value = s.primaryColor), s.showThumbs !== void 0 && (Qs.value = s.showThumbs), s.allowDownload !== void 0 && (FB.value = s.allowDownload), s.whiteLabel !== void 0 && (JB.value = s.whiteLabel), s.soundEnabled !== void 0 && (Yl.value = s.soundEnabled), s.isSingleMode !== void 0 && (Cg.value = s.isSingleMode), s.singleMode !== void 0 && (Cg.value = s.singleMode), s.autoPlay !== void 0 && (el.value = s.autoPlay), s.autoPlayInterval !== void 0 && (zB.value = s.autoPlayInterval), PI.value = 0;
|
|
18825
18825
|
}
|
|
18826
18826
|
const Ot = {
|
|
18827
18827
|
emptyStateTitle: "No data available.",
|
|
@@ -18871,7 +18871,7 @@ function Pt(s) {
|
|
|
18871
18871
|
/* @__PURE__ */ p(
|
|
18872
18872
|
"button",
|
|
18873
18873
|
{
|
|
18874
|
-
class:
|
|
18874
|
+
class: UI(() => `bk-btn ${Qs.value ? "active" : ""}`),
|
|
18875
18875
|
onClick: s.onToggleThumbs,
|
|
18876
18876
|
title: I.thumbnails || "Thumbnails",
|
|
18877
18877
|
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
@@ -18885,7 +18885,7 @@ function Pt(s) {
|
|
|
18885
18885
|
/* @__PURE__ */ p(
|
|
18886
18886
|
"button",
|
|
18887
18887
|
{
|
|
18888
|
-
class:
|
|
18888
|
+
class: UI(() => `bk-btn bz-hide-mobile ${Cg.value ? "active" : ""}`),
|
|
18889
18889
|
onClick: s.onToggleSingleMode,
|
|
18890
18890
|
title: I.singlePageMode || "Single Page",
|
|
18891
18891
|
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
@@ -18900,20 +18900,20 @@ function Pt(s) {
|
|
|
18900
18900
|
/* @__PURE__ */ p(
|
|
18901
18901
|
"button",
|
|
18902
18902
|
{
|
|
18903
|
-
class:
|
|
18903
|
+
class: UI(() => `bk-btn ${el.value ? "active" : ""}`),
|
|
18904
18904
|
onClick: s.onToggleAutoPlay,
|
|
18905
|
-
title: el.value ? I.pause || "Pause" : I.play || "Play",
|
|
18906
|
-
children: el.value ? /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
18905
|
+
title: UI(() => el.value ? I.pause || "Pause" : I.play || "Play"),
|
|
18906
|
+
children: UI(() => el.value ? /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
18907
18907
|
/* @__PURE__ */ p("rect", { x: "6", y: "4", width: "4", height: "16" }),
|
|
18908
18908
|
/* @__PURE__ */ p("rect", { x: "14", y: "4", width: "4", height: "16" })
|
|
18909
|
-
] }) : /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polygon", { points: "5 3 19 12 5 21 5 3" }) })
|
|
18909
|
+
] }) : /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polygon", { points: "5 3 19 12 5 21 5 3" }) }))
|
|
18910
18910
|
}
|
|
18911
18911
|
)
|
|
18912
18912
|
] }),
|
|
18913
18913
|
/* @__PURE__ */ p("div", { class: "bk-btn-group bk-btn-group--center", children: [
|
|
18914
18914
|
/* @__PURE__ */ p("button", { class: "bk-btn", onClick: s.onPrevPage, title: I.previous || "Previous", children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polyline", { points: "15 18 9 12 15 6" }) }) }),
|
|
18915
|
-
/* @__PURE__ */ p("span", { class: "bz-page-info", children:
|
|
18916
|
-
const g =
|
|
18915
|
+
/* @__PURE__ */ p("span", { class: "bz-page-info", children: UI(() => {
|
|
18916
|
+
const g = PI.value, C = om.value;
|
|
18917
18917
|
if (Cg.value || g === 0 || g >= C - 1)
|
|
18918
18918
|
return `${g + 1} / ${C}`;
|
|
18919
18919
|
const A = g % 2 === 1 ? g : g - 1;
|
|
@@ -18931,7 +18931,7 @@ function Pt(s) {
|
|
|
18931
18931
|
/* @__PURE__ */ p(
|
|
18932
18932
|
"button",
|
|
18933
18933
|
{
|
|
18934
|
-
class:
|
|
18934
|
+
class: UI(() => `bk-btn ${ia.value ? "active" : ""}`),
|
|
18935
18935
|
onClick: s.onZoomOut,
|
|
18936
18936
|
title: I.zoomOut || "Zoom Out",
|
|
18937
18937
|
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
@@ -18942,7 +18942,7 @@ function Pt(s) {
|
|
|
18942
18942
|
}
|
|
18943
18943
|
),
|
|
18944
18944
|
/* @__PURE__ */ p("button", { class: "bk-btn bk-btn--fullscreen", onClick: s.onToggleFullscreen, title: I.fullscreen || "Fullscreen", children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
|
|
18945
|
-
|
|
18945
|
+
UI(() => FB.value && s.onDownload ? /* @__PURE__ */ p("button", { class: "bk-btn bk-btn--download", onClick: s.onDownload, title: I.downloadCatalog || "Download", children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
18946
18946
|
/* @__PURE__ */ p("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
18947
18947
|
/* @__PURE__ */ p("polyline", { points: "7 10 12 15 17 10" }),
|
|
18948
18948
|
/* @__PURE__ */ p("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
@@ -18950,12 +18950,12 @@ function Pt(s) {
|
|
|
18950
18950
|
/* @__PURE__ */ p(
|
|
18951
18951
|
"button",
|
|
18952
18952
|
{
|
|
18953
|
-
class:
|
|
18953
|
+
class: UI(() => `bk-btn ${Yl.value ? "" : "muted"}`),
|
|
18954
18954
|
onClick: () => {
|
|
18955
18955
|
Yl.value = !Yl.value, s.onSoundToggle();
|
|
18956
18956
|
},
|
|
18957
18957
|
title: "Sound",
|
|
18958
|
-
children:
|
|
18958
|
+
children: UI(() => Yl.value ? /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
18959
18959
|
/* @__PURE__ */ p("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
18960
18960
|
/* @__PURE__ */ p("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
|
|
18961
18961
|
/* @__PURE__ */ p("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
|
|
@@ -18970,9 +18970,9 @@ function Pt(s) {
|
|
|
18970
18970
|
] });
|
|
18971
18971
|
}
|
|
18972
18972
|
function ft(s) {
|
|
18973
|
-
return /* @__PURE__ */ p("div", { class: "bk-thumbs", style:
|
|
18973
|
+
return /* @__PURE__ */ p("div", { class: "bk-thumbs", style: UI(() => Qs.value ? "display:flex;" : "display:none;"), children: tl.value.map((I, g) => {
|
|
18974
18974
|
const C = () => {
|
|
18975
|
-
const A =
|
|
18975
|
+
const A = PI.value;
|
|
18976
18976
|
if (Cg.value || A === 0 || A >= tl.value.length - 1)
|
|
18977
18977
|
return A === g;
|
|
18978
18978
|
const i = A % 2 === 1 ? A : A - 1;
|
|
@@ -18981,7 +18981,7 @@ function ft(s) {
|
|
|
18981
18981
|
return /* @__PURE__ */ p(
|
|
18982
18982
|
"div",
|
|
18983
18983
|
{
|
|
18984
|
-
class:
|
|
18984
|
+
class: UI(() => `thumb-item ${C() ? "active" : ""}`),
|
|
18985
18985
|
onClick: () => s.onThumbClick(g),
|
|
18986
18986
|
children: [
|
|
18987
18987
|
/* @__PURE__ */ p("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ p(
|
|
@@ -19007,7 +19007,7 @@ function qt(s) {
|
|
|
19007
19007
|
"div",
|
|
19008
19008
|
{
|
|
19009
19009
|
id: "bk-book-wrapper",
|
|
19010
|
-
class:
|
|
19010
|
+
class: UI(() => {
|
|
19011
19011
|
let I = "";
|
|
19012
19012
|
return Bm.value && (I += "double-mode "), Qt.value && (I += "bk-is-cover "), xt.value && (I += "bk-is-back-cover "), dI.value.isActive && (I += "zoomed "), I.trim();
|
|
19013
19013
|
}),
|
|
@@ -19023,8 +19023,8 @@ function qt(s) {
|
|
|
19023
19023
|
{
|
|
19024
19024
|
id: "bk-book",
|
|
19025
19025
|
ref: s.bookContainerRef,
|
|
19026
|
-
class:
|
|
19027
|
-
style:
|
|
19026
|
+
class: UI(() => BB.value !== "read" ? "is-flipping" : ""),
|
|
19027
|
+
style: UI(() => `display: ${Cg.value ? "none" : "block"};`),
|
|
19028
19028
|
children: tl.value.map((I, g) => {
|
|
19029
19029
|
const C = g === 0 || g === tl.value.length - 1;
|
|
19030
19030
|
return /* @__PURE__ */ p(
|
|
@@ -19055,9 +19055,9 @@ function qt(s) {
|
|
|
19055
19055
|
"div",
|
|
19056
19056
|
{
|
|
19057
19057
|
id: "bk-single-view",
|
|
19058
|
-
style:
|
|
19059
|
-
children:
|
|
19060
|
-
const I = tl.value[
|
|
19058
|
+
style: UI(() => `display: ${Cg.value ? "flex" : "none"}; width: 100%; height: 100%; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; z-index: 10;`),
|
|
19059
|
+
children: UI(() => {
|
|
19060
|
+
const I = tl.value[PI.value];
|
|
19061
19061
|
return I ? /* @__PURE__ */ p(
|
|
19062
19062
|
"img",
|
|
19063
19063
|
{
|
|
@@ -19094,7 +19094,7 @@ function _t(s) {
|
|
|
19094
19094
|
document.fullscreenElement ? document.exitFullscreen().catch((m) => console.warn("Exit fullscreen err:", m)) : (((b = document.querySelector(".bk-wrapper")) == null ? void 0 : b.parentElement) || document.documentElement).requestFullscreen().catch((W) => console.warn("Fullscreen err:", W));
|
|
19095
19095
|
}, d = (b) => {
|
|
19096
19096
|
var m;
|
|
19097
|
-
|
|
19097
|
+
PI.value !== b && (PI.value = b, (m = s.pageFlipAdapterRef.current) == null || m.playSound());
|
|
19098
19098
|
}, c = () => {
|
|
19099
19099
|
var b;
|
|
19100
19100
|
(b = s.pageFlipAdapterRef.current) == null || b.turnToNextPage();
|
|
@@ -19105,7 +19105,7 @@ function _t(s) {
|
|
|
19105
19105
|
return /* @__PURE__ */ p(
|
|
19106
19106
|
"div",
|
|
19107
19107
|
{
|
|
19108
|
-
class:
|
|
19108
|
+
class: UI(() => `bk-wrapper bk-theme-${SB.value} ${s.className || ""}`),
|
|
19109
19109
|
children: [
|
|
19110
19110
|
/* @__PURE__ */ p("div", { class: "bk-main-area", children: [
|
|
19111
19111
|
/* @__PURE__ */ p(
|
|
@@ -20242,7 +20242,7 @@ class ge {
|
|
|
20242
20242
|
}
|
|
20243
20243
|
bindEvents() {
|
|
20244
20244
|
this.pageFlip.on("flip", (I) => {
|
|
20245
|
-
|
|
20245
|
+
PI.value !== I.data && (this.isLibraryFlipping = !0, PI.value = I.data, this.playSound(), this.isLibraryFlipping = !1);
|
|
20246
20246
|
}), this.pageFlip.on("changeState", (I) => {
|
|
20247
20247
|
BB.value = I.data;
|
|
20248
20248
|
}), this.pageFlip.on("changeOrientation", (I) => {
|
|
@@ -20252,7 +20252,7 @@ class ge {
|
|
|
20252
20252
|
setupSignalSync() {
|
|
20253
20253
|
this.unsubs.push(
|
|
20254
20254
|
hd(() => {
|
|
20255
|
-
const I =
|
|
20255
|
+
const I = PI.value, g = BB.peek();
|
|
20256
20256
|
if (!this.pageFlip || this.isLibraryFlipping || g !== "read") return;
|
|
20257
20257
|
const C = this.pageFlip.getCurrentPageIndex();
|
|
20258
20258
|
if (C !== I && !Cg.value) {
|
|
@@ -20271,7 +20271,7 @@ class ge {
|
|
|
20271
20271
|
const I = el.value, g = zB.value || 3e3;
|
|
20272
20272
|
this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), I && (this.autoPlayTimer = setInterval(() => {
|
|
20273
20273
|
const C = tl.value.length - 1;
|
|
20274
|
-
if (
|
|
20274
|
+
if (PI.peek() >= C || PI.peek() >= C - 1 && !Cg.peek()) {
|
|
20275
20275
|
el.value = !1;
|
|
20276
20276
|
return;
|
|
20277
20277
|
}
|
|
@@ -20282,14 +20282,14 @@ class ge {
|
|
|
20282
20282
|
}
|
|
20283
20283
|
turnToNextPage() {
|
|
20284
20284
|
if (Cg.value) {
|
|
20285
|
-
const I =
|
|
20286
|
-
I < tl.value.length && (
|
|
20285
|
+
const I = PI.value + 1;
|
|
20286
|
+
I < tl.value.length && (PI.value = I, this.playSound());
|
|
20287
20287
|
} else this.pageFlip && this.pageFlip.flipNext();
|
|
20288
20288
|
}
|
|
20289
20289
|
turnToPrevPage() {
|
|
20290
20290
|
if (Cg.value) {
|
|
20291
|
-
const I =
|
|
20292
|
-
I >= 0 && (
|
|
20291
|
+
const I = PI.value - 1;
|
|
20292
|
+
I >= 0 && (PI.value = I, this.playSound());
|
|
20293
20293
|
} else this.pageFlip && this.pageFlip.flipPrev();
|
|
20294
20294
|
}
|
|
20295
20295
|
playSound() {
|
|
@@ -20409,7 +20409,7 @@ class Ae {
|
|
|
20409
20409
|
}, { passive: !1 }), this.container.addEventListener("touchend", (A) => {
|
|
20410
20410
|
if (this.touchStartX !== null && !dI.value.isActive && Cg.value && A.changedTouches.length === 1) {
|
|
20411
20411
|
const i = A.changedTouches[0].clientX - this.touchStartX;
|
|
20412
|
-
i > 50 &&
|
|
20412
|
+
i > 50 && PI.value > 0 ? this.pageFlipAdapter.turnToPrevPage() : i < -50 && PI.value < om.value - 1 && this.pageFlipAdapter.turnToNextPage();
|
|
20413
20413
|
}
|
|
20414
20414
|
this.touchStartX = null, I = !1;
|
|
20415
20415
|
}, { passive: !0 });
|
|
@@ -20584,7 +20584,7 @@ const lm = class lm {
|
|
|
20584
20584
|
});
|
|
20585
20585
|
}
|
|
20586
20586
|
goToPage(I) {
|
|
20587
|
-
|
|
20587
|
+
PI.value = I;
|
|
20588
20588
|
}
|
|
20589
20589
|
nextPage() {
|
|
20590
20590
|
this.pageFlipAdapter && this.pageFlipAdapter.turnToNextPage();
|