@prose-reader/core 1.215.0 → 1.217.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +463 -462
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +20 -20
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as
|
|
1
|
+
import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as Q, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as A, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, forkJoin as Ke, delay as wt, ReplaySubject as Jt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Kt, reduce as Qe, concatMap as Qt } from "rxjs";
|
|
2
2
|
import { Report as ti, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ei, parseContentType as ii, detectMimeTypeFromName as Lt, arrayEqual as ni } from "@prose-reader/shared";
|
|
3
|
-
import { isShallowEqual as
|
|
4
|
-
import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as
|
|
5
|
-
import { generate as Ie, parse as we, isParsedCfiRange as di,
|
|
6
|
-
const
|
|
3
|
+
import { isShallowEqual as Ts } from "@prose-reader/shared";
|
|
4
|
+
import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as te, withLatestFrom as ui } from "rxjs/operators";
|
|
5
|
+
import { generate as Ie, parse as we, isParsedCfiRange as di, isIndirectionOnly as gi, resolve as li } from "@prose-reader/cfi";
|
|
6
|
+
const ee = (e, t) => {
|
|
7
7
|
const i = new RegExp(`${t}\\s*=\\s*([0-9.]+)`, "i"), n = e.match(i) || [], o = n[1] || "0";
|
|
8
8
|
return n && Number.parseFloat(o) || 0;
|
|
9
|
-
},
|
|
9
|
+
}, pi = (e, t, i, n) => {
|
|
10
10
|
var o;
|
|
11
11
|
if ((o = e == null ? void 0 : e.contentDocument) != null && o.head) {
|
|
12
12
|
const s = e.contentDocument.createElement("style");
|
|
13
13
|
s.id = t, s.innerHTML = i, n ? e.contentDocument.head.prepend(s) : e.contentDocument.head.appendChild(s);
|
|
14
14
|
}
|
|
15
|
-
},
|
|
15
|
+
}, hi = (e, t) => {
|
|
16
16
|
var i;
|
|
17
17
|
if ((i = e == null ? void 0 : e.contentDocument) != null && i.head) {
|
|
18
18
|
const n = e.contentDocument.getElementById(t);
|
|
19
19
|
n && n.remove();
|
|
20
20
|
}
|
|
21
21
|
}, ot = (e, t, i, n) => {
|
|
22
|
-
e && (
|
|
23
|
-
},
|
|
22
|
+
e && (hi(e, t), pi(e, t, i, n));
|
|
23
|
+
}, Bt = (e) => {
|
|
24
24
|
if (e != null && e.contentDocument) {
|
|
25
25
|
const i = e.contentDocument.querySelector("meta[name='viewport']");
|
|
26
26
|
if (i) {
|
|
27
27
|
const n = i.getAttribute("content");
|
|
28
28
|
if (n) {
|
|
29
|
-
const o =
|
|
29
|
+
const o = ee(n, "width"), s = ee(n, "height");
|
|
30
30
|
return o > 0 && s > 0 ? {
|
|
31
31
|
hasViewport: !0,
|
|
32
32
|
width: o,
|
|
@@ -36,7 +36,7 @@ const ie = (e, t) => {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
return { hasViewport: !1 };
|
|
39
|
-
},
|
|
39
|
+
}, mi = (e) => e.pipe(
|
|
40
40
|
v((t) => {
|
|
41
41
|
var i;
|
|
42
42
|
return t.src === "about:blank" && ((i = t.contentDocument) == null ? void 0 : i.readyState) === "complete" && t.contentDocument.body ? w(t) : G(t, "load").pipe(
|
|
@@ -44,7 +44,7 @@ const ie = (e, t) => {
|
|
|
44
44
|
b(() => t)
|
|
45
45
|
);
|
|
46
46
|
})
|
|
47
|
-
),
|
|
47
|
+
), fi = (e) => e.pipe(
|
|
48
48
|
v(
|
|
49
49
|
(t) => {
|
|
50
50
|
var i;
|
|
@@ -53,7 +53,7 @@ const ie = (e, t) => {
|
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
|
-
),
|
|
56
|
+
), yi = (e) => (t) => {
|
|
57
57
|
const i = e(t), n = new IntersectionObserver((o) => {
|
|
58
58
|
o.forEach((s) => {
|
|
59
59
|
s.isIntersecting ? s.target.removeAttribute("tab-index") : s.target.setAttribute("tab-index", "-1");
|
|
@@ -89,7 +89,7 @@ const ie = (e, t) => {
|
|
|
89
89
|
), {
|
|
90
90
|
...i
|
|
91
91
|
};
|
|
92
|
-
},
|
|
92
|
+
}, Si = (e) => (t) => {
|
|
93
93
|
const i = e(t);
|
|
94
94
|
return i.context.state$.pipe(F(i.$.destroy$)).subscribe(({ containerElement: n }) => {
|
|
95
95
|
if (!n) return;
|
|
@@ -102,7 +102,7 @@ const ie = (e, t) => {
|
|
|
102
102
|
const o = i.spineItemsManager.get(n), s = o == null ? void 0 : o.renderer.getDocumentFrame();
|
|
103
103
|
s && ((r = s.contentDocument) == null || r.body.setAttribute("tabindex", "-1"));
|
|
104
104
|
}), i;
|
|
105
|
-
},
|
|
105
|
+
}, bi = "@prose-reader/core", j = ti.namespace(bi), Ii = [
|
|
106
106
|
"pointercancel",
|
|
107
107
|
"pointerdown",
|
|
108
108
|
"pointerenter",
|
|
@@ -114,24 +114,24 @@ const ie = (e, t) => {
|
|
|
114
114
|
// `touchstart` as const,
|
|
115
115
|
// `touchend` as const,
|
|
116
116
|
], Pe = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE;
|
|
117
|
-
function
|
|
117
|
+
function wi(e, t, i) {
|
|
118
118
|
if ("caretPositionFromPoint" in e)
|
|
119
119
|
return e.caretPositionFromPoint(t, i);
|
|
120
120
|
if ("caretRangeFromPoint" in e && // @ts-expect-error limited availability
|
|
121
121
|
typeof e.caretRangeFromPoint < "u")
|
|
122
122
|
return e.caretRangeFromPoint(t, i);
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const Pi = (e, t) => {
|
|
125
125
|
const i = "body" in e ? jt(e.body, t) : jt(e, t), n = "createRange" in e ? e : e.ownerDocument;
|
|
126
126
|
if (i) {
|
|
127
127
|
let o, s = 0;
|
|
128
128
|
const r = n.createRange();
|
|
129
129
|
return Array.from(i.childNodes).some((a) => {
|
|
130
130
|
r.selectNodeContents(a);
|
|
131
|
-
const c = r.getClientRects(), u =
|
|
131
|
+
const c = r.getClientRects(), u = vi(c, t);
|
|
132
132
|
if (u) {
|
|
133
133
|
o = r.cloneRange();
|
|
134
|
-
const d =
|
|
134
|
+
const d = wi(
|
|
135
135
|
n,
|
|
136
136
|
Math.ceil(u.left),
|
|
137
137
|
Math.ceil(u.top)
|
|
@@ -155,13 +155,13 @@ const wi = (e, t) => {
|
|
|
155
155
|
function ve(e, { left: t, right: i }) {
|
|
156
156
|
return e.left <= t && e.right <= t ? "before" : e.left <= t && e.right > t && e.right <= i ? "partially-before" : e.left <= i && e.right > i ? "partially-after" : e.left > i ? "after" : "within";
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function vi(e, t) {
|
|
159
159
|
return Array.from(e).find((i) => {
|
|
160
160
|
const n = ve(i, t);
|
|
161
161
|
return n !== "before" && n !== "after";
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
const
|
|
164
|
+
const xi = (e, t) => {
|
|
165
165
|
var i;
|
|
166
166
|
if (e.nodeType !== Node.CDATA_SECTION_NODE && e.nodeType !== Node.DOCUMENT_TYPE_NODE) {
|
|
167
167
|
const n = (i = e.ownerDocument) == null ? void 0 : i.createRange();
|
|
@@ -173,7 +173,7 @@ const vi = (e, t) => {
|
|
|
173
173
|
}
|
|
174
174
|
return n;
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, _t = (e) => {
|
|
177
177
|
var t, i, n, o, s;
|
|
178
178
|
if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
|
|
179
179
|
const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
|
|
@@ -185,10 +185,10 @@ const vi = (e, t) => {
|
|
|
185
185
|
if (r.PointerEvent && e instanceof r.PointerEvent)
|
|
186
186
|
return !0;
|
|
187
187
|
}
|
|
188
|
-
return !!
|
|
189
|
-
},
|
|
188
|
+
return !!Ii.includes(e.type);
|
|
189
|
+
}, $i = (e) => {
|
|
190
190
|
var t, i, n, o, s;
|
|
191
|
-
if (
|
|
191
|
+
if (_t(e)) return !1;
|
|
192
192
|
if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
|
|
193
193
|
const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
|
|
194
194
|
if (r.MouseEvent)
|
|
@@ -200,7 +200,7 @@ const vi = (e, t) => {
|
|
|
200
200
|
return e instanceof r.MouseEvent;
|
|
201
201
|
}
|
|
202
202
|
return !1;
|
|
203
|
-
},
|
|
203
|
+
}, Ti = (e) => {
|
|
204
204
|
var t, i, n, o, s;
|
|
205
205
|
if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
|
|
206
206
|
const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
|
|
@@ -213,7 +213,7 @@ const vi = (e, t) => {
|
|
|
213
213
|
return e instanceof r.TouchEvent;
|
|
214
214
|
}
|
|
215
215
|
return !1;
|
|
216
|
-
},
|
|
216
|
+
}, Fi = () => document.createElement("div"), xe = (e) => {
|
|
217
217
|
const t = [
|
|
218
218
|
"img",
|
|
219
219
|
// Images
|
|
@@ -229,7 +229,7 @@ const vi = (e, t) => {
|
|
|
229
229
|
// JavaScript files
|
|
230
230
|
].join(",");
|
|
231
231
|
return Array.from((e == null ? void 0 : e.querySelectorAll(t)) || []);
|
|
232
|
-
},
|
|
232
|
+
}, Li = (e) => {
|
|
233
233
|
if (xe(e).forEach((i) => {
|
|
234
234
|
var o;
|
|
235
235
|
const n = i.getAttribute("src") || i.getAttribute("href");
|
|
@@ -249,7 +249,7 @@ const vi = (e, t) => {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
function
|
|
252
|
+
function Mi(e, t) {
|
|
253
253
|
return Pe(e) && e.tagName.toLowerCase() === t.toLowerCase();
|
|
254
254
|
}
|
|
255
255
|
const Rt = ({
|
|
@@ -261,13 +261,13 @@ const Rt = ({
|
|
|
261
261
|
clientX: a,
|
|
262
262
|
clientY: c
|
|
263
263
|
};
|
|
264
|
-
},
|
|
264
|
+
}, Ci = (e, t, i, n) => {
|
|
265
265
|
var u;
|
|
266
266
|
const o = (u = t == null ? void 0 : t.view) == null ? void 0 : u.frameElement;
|
|
267
267
|
if (!t || !o) return e;
|
|
268
268
|
const s = i.getSpineItemFromIframe(o), r = o, { height: a, width: c } = n.getPageSize();
|
|
269
269
|
if (!s || !(r instanceof HTMLIFrameElement)) return e;
|
|
270
|
-
if (
|
|
270
|
+
if (_t(e)) {
|
|
271
271
|
const { clientX: d, clientY: g } = Rt({
|
|
272
272
|
position: e,
|
|
273
273
|
frameElement: r
|
|
@@ -282,7 +282,7 @@ const Rt = ({
|
|
|
282
282
|
enumerable: !0
|
|
283
283
|
}), l;
|
|
284
284
|
}
|
|
285
|
-
if (
|
|
285
|
+
if ($i(e)) {
|
|
286
286
|
const { clientX: d, clientY: g } = Rt({
|
|
287
287
|
position: e,
|
|
288
288
|
frameElement: r
|
|
@@ -296,7 +296,7 @@ const Rt = ({
|
|
|
296
296
|
enumerable: !0
|
|
297
297
|
}), l;
|
|
298
298
|
}
|
|
299
|
-
if (
|
|
299
|
+
if (Ti(e)) {
|
|
300
300
|
const d = Array.from(e.touches).map((l) => {
|
|
301
301
|
const { clientX: p, clientY: h } = Rt({
|
|
302
302
|
position: l,
|
|
@@ -319,7 +319,7 @@ const Rt = ({
|
|
|
319
319
|
}), g;
|
|
320
320
|
}
|
|
321
321
|
return e;
|
|
322
|
-
},
|
|
322
|
+
}, Ri = [
|
|
323
323
|
"pointercancel",
|
|
324
324
|
"pointerdown",
|
|
325
325
|
"pointerenter",
|
|
@@ -328,23 +328,23 @@ const Rt = ({
|
|
|
328
328
|
"pointerout",
|
|
329
329
|
"pointerover",
|
|
330
330
|
"pointerup"
|
|
331
|
-
],
|
|
332
|
-
...
|
|
331
|
+
], Ai = [
|
|
332
|
+
...Ri
|
|
333
333
|
/*, ...mouseEvents*/
|
|
334
|
-
],
|
|
334
|
+
], Oi = (e) => (t) => {
|
|
335
335
|
const i = e(t);
|
|
336
336
|
return i.hookManager.register(
|
|
337
337
|
"item.onDocumentLoad",
|
|
338
338
|
({ destroy: n, itemId: o }) => {
|
|
339
339
|
const s = i.spineItemsManager.get(o), r = s == null ? void 0 : s.renderer.getDocumentFrame();
|
|
340
340
|
if (!r || !s) return;
|
|
341
|
-
const a =
|
|
341
|
+
const a = Ai.map((c) => {
|
|
342
342
|
var d;
|
|
343
343
|
const u = (g) => {
|
|
344
344
|
var p;
|
|
345
345
|
let l = g;
|
|
346
|
-
if (
|
|
347
|
-
const h =
|
|
346
|
+
if (_t(g) && (l = new PointerEvent(g.type, g)), l !== g) {
|
|
347
|
+
const h = Ci(
|
|
348
348
|
l,
|
|
349
349
|
g,
|
|
350
350
|
i.spine.locator,
|
|
@@ -371,7 +371,7 @@ const Rt = ({
|
|
|
371
371
|
[n]: o
|
|
372
372
|
} : i,
|
|
373
373
|
{}
|
|
374
|
-
)),
|
|
374
|
+
)), Xt = (e) => (t) => t.pipe($e(e), Z(N));
|
|
375
375
|
function Te(e) {
|
|
376
376
|
return new st((t) => {
|
|
377
377
|
const i = new ResizeObserver((n) => {
|
|
@@ -389,7 +389,7 @@ const Ct = (e) => (t) => t.pipe(
|
|
|
389
389
|
X(() => i)
|
|
390
390
|
)
|
|
391
391
|
)
|
|
392
|
-
),
|
|
392
|
+
), Di = (e) => {
|
|
393
393
|
let t;
|
|
394
394
|
const i = e.subscribe((n) => {
|
|
395
395
|
t = { result: n };
|
|
@@ -410,16 +410,16 @@ function Fe() {
|
|
|
410
410
|
return () => clearTimeout(t);
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function ie(e) {
|
|
414
414
|
return Nt(() => Fe().pipe(_(e)));
|
|
415
415
|
}
|
|
416
|
-
const
|
|
416
|
+
const ne = (e, t) => new st((i) => {
|
|
417
417
|
const n = new MutationObserver((o) => {
|
|
418
418
|
i.next(o);
|
|
419
419
|
});
|
|
420
420
|
return n.observe(e, t), () => n.disconnect();
|
|
421
421
|
});
|
|
422
|
-
function
|
|
422
|
+
function Is(e, t) {
|
|
423
423
|
return new st((i) => {
|
|
424
424
|
const n = new IntersectionObserver((o) => {
|
|
425
425
|
i.next(o);
|
|
@@ -468,7 +468,7 @@ class Le {
|
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
watch(t) {
|
|
471
|
-
return Array.isArray(t) ? this.values$.pipe(
|
|
471
|
+
return Array.isArray(t) ? this.values$.pipe(Xt(t)) : this.values$.pipe(
|
|
472
472
|
X((i) => i[t]),
|
|
473
473
|
Z(N)
|
|
474
474
|
);
|
|
@@ -477,7 +477,7 @@ class Le {
|
|
|
477
477
|
this.outputSettingsUpdateSubject.complete();
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const Ni = (e) => {
|
|
481
481
|
const t = new FileReader();
|
|
482
482
|
return new Promise((i) => {
|
|
483
483
|
t.addEventListener(
|
|
@@ -489,7 +489,7 @@ const Di = (e) => {
|
|
|
489
489
|
), t.readAsDataURL(e);
|
|
490
490
|
});
|
|
491
491
|
};
|
|
492
|
-
let
|
|
492
|
+
let Vi = class extends Le {
|
|
493
493
|
computeOutputSettings(t) {
|
|
494
494
|
return t;
|
|
495
495
|
}
|
|
@@ -509,8 +509,8 @@ let Ni = class extends Le {
|
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
|
-
const
|
|
513
|
-
const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new
|
|
512
|
+
const ji = (e) => (t) => {
|
|
513
|
+
const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new Vi(
|
|
514
514
|
{
|
|
515
515
|
fontScale: i,
|
|
516
516
|
lineHeight: n,
|
|
@@ -556,7 +556,7 @@ const Vi = (e) => (t) => {
|
|
|
556
556
|
},
|
|
557
557
|
settings: c
|
|
558
558
|
};
|
|
559
|
-
},
|
|
559
|
+
}, ki = (e) => (t) => {
|
|
560
560
|
const i = e(t), n = (o) => G(o, "keyup").pipe(
|
|
561
561
|
D(i.settings.values$),
|
|
562
562
|
b(([s, { pageTurnDirection: r }]) => {
|
|
@@ -582,7 +582,7 @@ const Vi = (e) => (t) => {
|
|
|
582
582
|
(s) => s.loaded$.pipe(
|
|
583
583
|
v(() => {
|
|
584
584
|
const r = s.renderer.getDocumentFrame();
|
|
585
|
-
return r instanceof HTMLIFrameElement && (r != null && r.contentDocument) ? n(r.contentDocument) :
|
|
585
|
+
return r instanceof HTMLIFrameElement && (r != null && r.contentDocument) ? n(r.contentDocument) : Q;
|
|
586
586
|
})
|
|
587
587
|
)
|
|
588
588
|
)
|
|
@@ -590,7 +590,7 @@ const Vi = (e) => (t) => {
|
|
|
590
590
|
),
|
|
591
591
|
F(i.$.destroy$)
|
|
592
592
|
).subscribe(), i;
|
|
593
|
-
},
|
|
593
|
+
}, Wi = (e) => e.spine.spineItemsManager.items$.pipe(
|
|
594
594
|
v(
|
|
595
595
|
(t) => x(
|
|
596
596
|
...t.map((i) => i.loaded$.pipe(
|
|
@@ -624,7 +624,7 @@ const Ft = class Ft extends Y {
|
|
|
624
624
|
constructor(t) {
|
|
625
625
|
super(), this.triggerSubject = new U(), this.stateSubject = new k("idle"), this.unload$ = this.triggerSubject.pipe(
|
|
626
626
|
D(this.stateSubject),
|
|
627
|
-
|
|
627
|
+
A(
|
|
628
628
|
([o, s]) => o.type === "unload" && s !== "idle" && s !== "unloading"
|
|
629
629
|
),
|
|
630
630
|
b(() => {
|
|
@@ -632,7 +632,7 @@ const Ft = class Ft extends Y {
|
|
|
632
632
|
V()
|
|
633
633
|
), this.load$ = this.triggerSubject.pipe(
|
|
634
634
|
D(this.stateSubject),
|
|
635
|
-
|
|
635
|
+
A(
|
|
636
636
|
([o, s]) => o.type === "load" && s !== "loaded" && s !== "loading"
|
|
637
637
|
),
|
|
638
638
|
b(() => {
|
|
@@ -641,7 +641,7 @@ const Ft = class Ft extends Y {
|
|
|
641
641
|
), this.context = t.context, this.settings = t.settings, this.hookManager = t.hookManager, this.item = t.item, this.containerElement = t.containerElement, this.resourcesHandler = t.resourcesHandler;
|
|
642
642
|
const i = this.triggerSubject.pipe(
|
|
643
643
|
D(this.stateSubject),
|
|
644
|
-
|
|
644
|
+
A(
|
|
645
645
|
([o, s]) => o.type === "unload" && s !== "idle" && s !== "unloading"
|
|
646
646
|
),
|
|
647
647
|
b(() => {
|
|
@@ -752,7 +752,7 @@ const Ft = class Ft extends Y {
|
|
|
752
752
|
if (t) return t;
|
|
753
753
|
const i = this.getDocumentFrame();
|
|
754
754
|
if (i) {
|
|
755
|
-
const { hasViewport: o } =
|
|
755
|
+
const { hasViewport: o } = Bt(i);
|
|
756
756
|
if (o) return "pre-paginated";
|
|
757
757
|
}
|
|
758
758
|
return ((n = this.context.manifest) == null ? void 0 : n.renditionLayout) ?? "reflowable";
|
|
@@ -760,8 +760,8 @@ const Ft = class Ft extends Y {
|
|
|
760
760
|
};
|
|
761
761
|
Ft.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
|
|
762
762
|
let ht = Ft;
|
|
763
|
-
const
|
|
764
|
-
class
|
|
763
|
+
const zi = (e) => new URL(e.href);
|
|
764
|
+
class qt {
|
|
765
765
|
constructor(t, i) {
|
|
766
766
|
this.item = t, this.settings = i;
|
|
767
767
|
}
|
|
@@ -769,7 +769,7 @@ class Yt {
|
|
|
769
769
|
var i, n;
|
|
770
770
|
return await Ye(
|
|
771
771
|
((n = (i = this.settings.values).getResource) == null ? void 0 : n.call(i, this.item)) ?? w(void 0)
|
|
772
|
-
) ??
|
|
772
|
+
) ?? zi(this.item);
|
|
773
773
|
}
|
|
774
774
|
async fetchResource() {
|
|
775
775
|
const t = await this.getResource();
|
|
@@ -779,7 +779,7 @@ class Yt {
|
|
|
779
779
|
const Me = (e, t) => {
|
|
780
780
|
const i = e.startsWith("file://"), n = i ? e.replace("file://", "http://") : e, o = new URL(t, n).toString();
|
|
781
781
|
return i ? o.replace("http://", "file://") : o;
|
|
782
|
-
},
|
|
782
|
+
}, Ui = async (e, t, i, n, o) => {
|
|
783
783
|
if (!e || !e.defaultView) return;
|
|
784
784
|
const s = t.sheet;
|
|
785
785
|
if (s)
|
|
@@ -801,7 +801,7 @@ const Me = (e, t) => {
|
|
|
801
801
|
`${P.toLowerCase()}`
|
|
802
802
|
));
|
|
803
803
|
if (f) {
|
|
804
|
-
const P = new
|
|
804
|
+
const P = new qt(f, o);
|
|
805
805
|
try {
|
|
806
806
|
const $ = await P.getResource();
|
|
807
807
|
if ($ instanceof Response) {
|
|
@@ -828,7 +828,7 @@ const Me = (e, t) => {
|
|
|
828
828
|
} catch (r) {
|
|
829
829
|
console.error("Could not access stylesheet rules:", r);
|
|
830
830
|
}
|
|
831
|
-
},
|
|
831
|
+
}, Hi = (e, t, i, n, o) => {
|
|
832
832
|
var c;
|
|
833
833
|
const s = t.getAttribute("src") || t.getAttribute("href");
|
|
834
834
|
if (!s) return w(null);
|
|
@@ -836,7 +836,7 @@ const Me = (e, t) => {
|
|
|
836
836
|
`${u.toLowerCase()}`
|
|
837
837
|
));
|
|
838
838
|
if (!r) return w(null);
|
|
839
|
-
const a = new
|
|
839
|
+
const a = new qt(r, o);
|
|
840
840
|
return W(a.getResource()).pipe(
|
|
841
841
|
$t(
|
|
842
842
|
(u) => u instanceof Response ? W(u.blob()) : w(void 0)
|
|
@@ -852,7 +852,7 @@ const Me = (e, t) => {
|
|
|
852
852
|
return new st((l) => {
|
|
853
853
|
t.onload = async () => {
|
|
854
854
|
try {
|
|
855
|
-
t.sheet && await
|
|
855
|
+
t.sheet && await Ui(
|
|
856
856
|
e,
|
|
857
857
|
t,
|
|
858
858
|
i,
|
|
@@ -867,7 +867,7 @@ const Me = (e, t) => {
|
|
|
867
867
|
return w(null);
|
|
868
868
|
})
|
|
869
869
|
);
|
|
870
|
-
},
|
|
870
|
+
}, Ei = ({
|
|
871
871
|
settings: e,
|
|
872
872
|
item: t,
|
|
873
873
|
context: i
|
|
@@ -876,7 +876,7 @@ const Me = (e, t) => {
|
|
|
876
876
|
const s = xe(
|
|
877
877
|
o.contentDocument
|
|
878
878
|
), r = ei(t.href), a = s.map(
|
|
879
|
-
(c) =>
|
|
879
|
+
(c) => Hi(
|
|
880
880
|
o.contentDocument,
|
|
881
881
|
c,
|
|
882
882
|
r,
|
|
@@ -886,20 +886,20 @@ const Me = (e, t) => {
|
|
|
886
886
|
);
|
|
887
887
|
return q(a).pipe(b(() => o));
|
|
888
888
|
})
|
|
889
|
-
),
|
|
890
|
-
|
|
891
|
-
},
|
|
889
|
+
), Bi = (e) => {
|
|
890
|
+
Li(e == null ? void 0 : e.contentDocument);
|
|
891
|
+
}, _i = [".xhtml", ".html", ".htm"], lt = "prose-reader", Xi = (e) => new Promise((t, i) => {
|
|
892
892
|
const n = new Image();
|
|
893
893
|
n.src = e, n.onload = () => {
|
|
894
894
|
t({ height: n.naturalHeight, width: n.naturalWidth });
|
|
895
895
|
}, n.onerror = i;
|
|
896
|
-
}),
|
|
896
|
+
}), qi = async (e, t) => {
|
|
897
897
|
if (typeof e == "string") return e;
|
|
898
898
|
const i = ii(e.headers.get("Content-Type") || "") || Lt(t.href);
|
|
899
899
|
if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
|
|
900
900
|
(o) => o === i
|
|
901
901
|
)) {
|
|
902
|
-
const o = await
|
|
902
|
+
const o = await Ni(await e.blob()), { height: s, width: r } = await Xi(o);
|
|
903
903
|
return `
|
|
904
904
|
<html>
|
|
905
905
|
<head>
|
|
@@ -931,11 +931,11 @@ const Me = (e, t) => {
|
|
|
931
931
|
</body>
|
|
932
932
|
</html>
|
|
933
933
|
` : await e.text();
|
|
934
|
-
},
|
|
934
|
+
}, Yi = ({
|
|
935
935
|
item: e,
|
|
936
936
|
resourcesHandler: t
|
|
937
937
|
}) => {
|
|
938
|
-
const i = (n) =>
|
|
938
|
+
const i = (n) => qi(n, e);
|
|
939
939
|
return (n) => n.pipe(
|
|
940
940
|
v((o) => W(t.getResource()).pipe(
|
|
941
941
|
v((s) => s instanceof URL && e.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
|
|
@@ -945,11 +945,14 @@ const Me = (e, t) => {
|
|
|
945
945
|
"text/html",
|
|
946
946
|
"text/xml"
|
|
947
947
|
].includes(e.mediaType) || // no encoding ? then try to detect html
|
|
948
|
-
!e.mediaType &&
|
|
948
|
+
!e.mediaType && _i.some(
|
|
949
949
|
(a) => e.href.endsWith(a)
|
|
950
|
-
)) ? (o == null || o.setAttribute("src", e.href), w(o)) : (s instanceof URL ? W(t.fetchResource()) :
|
|
951
|
-
|
|
952
|
-
|
|
950
|
+
)) ? (o == null || o.setAttribute("src", e.href), w(o)) : (s instanceof URL ? W(t.fetchResource()) : w(s)).pipe(
|
|
951
|
+
v((a) => {
|
|
952
|
+
if (!(a instanceof Response))
|
|
953
|
+
throw new Error("Invalid resource");
|
|
954
|
+
return W(i(a));
|
|
955
|
+
}),
|
|
953
956
|
T((a) => {
|
|
954
957
|
if (a) {
|
|
955
958
|
const c = new Blob([a], { type: "text/html" }), u = URL.createObjectURL(c);
|
|
@@ -958,12 +961,13 @@ const Me = (e, t) => {
|
|
|
958
961
|
}),
|
|
959
962
|
b(() => o),
|
|
960
963
|
fe((a) => (j.error(
|
|
961
|
-
`Error while trying to fetch or load resource for item ${e.id}
|
|
964
|
+
`Error while trying to fetch or load resource for item ${e.id}`,
|
|
965
|
+
s
|
|
962
966
|
), j.error(a), w(o)))
|
|
963
967
|
))
|
|
964
968
|
))
|
|
965
969
|
);
|
|
966
|
-
},
|
|
970
|
+
}, Zi = () => {
|
|
967
971
|
const e = document.createElement("iframe");
|
|
968
972
|
return e.frameBorder = "no", e.tabIndex = 0, e.setAttribute(
|
|
969
973
|
"sandbox",
|
|
@@ -988,7 +992,7 @@ const Me = (e, t) => {
|
|
|
988
992
|
pageWidth: t,
|
|
989
993
|
frameElement: i
|
|
990
994
|
}) => {
|
|
991
|
-
const n =
|
|
995
|
+
const n = Bt(i);
|
|
992
996
|
if (i != null && i.contentDocument && i.contentWindow && n) {
|
|
993
997
|
const o = t / (n.width ?? 1);
|
|
994
998
|
return { computedScale: Math.min(
|
|
@@ -996,7 +1000,7 @@ const Me = (e, t) => {
|
|
|
996
1000
|
e / (n.height ?? 1)
|
|
997
1001
|
), computedWidthScale: o, viewportDimensions: n };
|
|
998
1002
|
}
|
|
999
|
-
},
|
|
1003
|
+
}, Gi = ({
|
|
1000
1004
|
columnWidth: e,
|
|
1001
1005
|
enableTouch: t,
|
|
1002
1006
|
spreadPosition: i
|
|
@@ -1041,12 +1045,12 @@ const Me = (e, t) => {
|
|
|
1041
1045
|
object-fit:contain;
|
|
1042
1046
|
`}
|
|
1043
1047
|
}
|
|
1044
|
-
`,
|
|
1048
|
+
`, Ji = ({
|
|
1045
1049
|
pageHeight: e,
|
|
1046
1050
|
pageWidth: t
|
|
1047
|
-
}) => ({ columnHeight: e, columnWidth: t }),
|
|
1051
|
+
}) => ({ columnHeight: e, columnWidth: t }), oe = (e, t) => {
|
|
1048
1052
|
e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
|
|
1049
|
-
},
|
|
1053
|
+
}, Ki = ({
|
|
1050
1054
|
minPageSpread: e,
|
|
1051
1055
|
blankPagePosition: t,
|
|
1052
1056
|
spreadPosition: i,
|
|
@@ -1058,18 +1062,18 @@ const Me = (e, t) => {
|
|
|
1058
1062
|
}) => {
|
|
1059
1063
|
const c = e * o;
|
|
1060
1064
|
if (s != null && s.contentDocument && (s != null && s.contentWindow)) {
|
|
1061
|
-
const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p =
|
|
1065
|
+
const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Gi(
|
|
1062
1066
|
{
|
|
1063
|
-
...
|
|
1067
|
+
...Ji({ pageHeight: n, pageWidth: o }),
|
|
1064
1068
|
enableTouch: a,
|
|
1065
1069
|
spreadPosition: i
|
|
1066
1070
|
},
|
|
1067
1071
|
u
|
|
1068
1072
|
);
|
|
1069
|
-
if (ot(s, "prose-reader-css", p), u ?
|
|
1073
|
+
if (ot(s, "prose-reader-css", p), u ? oe(s, {
|
|
1070
1074
|
width: u.width ?? 1,
|
|
1071
1075
|
height: u.height ?? 1
|
|
1072
|
-
}) :
|
|
1076
|
+
}) : oe(s, {
|
|
1073
1077
|
width: g,
|
|
1074
1078
|
height: l
|
|
1075
1079
|
}), u) {
|
|
@@ -1090,7 +1094,7 @@ const Me = (e, t) => {
|
|
|
1090
1094
|
return { width: c, height: l };
|
|
1091
1095
|
}
|
|
1092
1096
|
return { width: c, height: n };
|
|
1093
|
-
},
|
|
1097
|
+
}, Qi = () => `
|
|
1094
1098
|
${Ce()}
|
|
1095
1099
|
html {
|
|
1096
1100
|
width: 100%;
|
|
@@ -1105,7 +1109,7 @@ const Me = (e, t) => {
|
|
|
1105
1109
|
html, body {
|
|
1106
1110
|
touch-action: none;
|
|
1107
1111
|
}
|
|
1108
|
-
`,
|
|
1112
|
+
`, tn = ({
|
|
1109
1113
|
isScrollable: e,
|
|
1110
1114
|
enableTouch: t
|
|
1111
1115
|
}) => `
|
|
@@ -1130,7 +1134,7 @@ const Me = (e, t) => {
|
|
|
1130
1134
|
display: block;
|
|
1131
1135
|
}
|
|
1132
1136
|
` : ""}
|
|
1133
|
-
`,
|
|
1137
|
+
`, en = ({
|
|
1134
1138
|
width: e,
|
|
1135
1139
|
columnHeight: t,
|
|
1136
1140
|
columnWidth: i
|
|
@@ -1198,7 +1202,7 @@ const Me = (e, t) => {
|
|
|
1198
1202
|
td {
|
|
1199
1203
|
max-width: ${i}px;
|
|
1200
1204
|
}
|
|
1201
|
-
`,
|
|
1205
|
+
`, nn = ({
|
|
1202
1206
|
isUsingVerticalWriting: e,
|
|
1203
1207
|
minimumWidth: t,
|
|
1204
1208
|
pageHeight: i,
|
|
@@ -1214,7 +1218,7 @@ const Me = (e, t) => {
|
|
|
1214
1218
|
};
|
|
1215
1219
|
}, It = (e, t) => {
|
|
1216
1220
|
e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
|
|
1217
|
-
},
|
|
1221
|
+
}, on = ({
|
|
1218
1222
|
pageHeight: e,
|
|
1219
1223
|
pageWidth: t,
|
|
1220
1224
|
frameElement: i,
|
|
@@ -1242,7 +1246,7 @@ const Me = (e, t) => {
|
|
|
1242
1246
|
ot(
|
|
1243
1247
|
i,
|
|
1244
1248
|
"prose-reader-html-renderer-framce-css",
|
|
1245
|
-
|
|
1249
|
+
Qi()
|
|
1246
1250
|
), It(i, {
|
|
1247
1251
|
width: m.width ?? 1,
|
|
1248
1252
|
height: m.height ?? 1
|
|
@@ -1254,11 +1258,11 @@ const Me = (e, t) => {
|
|
|
1254
1258
|
`translate(-50%, -50%) scale(${S})`
|
|
1255
1259
|
), i == null || i.style.setProperty("transform-origin", "center center");
|
|
1256
1260
|
else {
|
|
1257
|
-
const L = c ?
|
|
1261
|
+
const L = c ? tn({
|
|
1258
1262
|
isScrollable: (n == null ? void 0 : n.renditionFlow) === "scrolled-continuous",
|
|
1259
1263
|
enableTouch: u
|
|
1260
|
-
}) :
|
|
1261
|
-
|
|
1264
|
+
}) : en(
|
|
1265
|
+
nn({
|
|
1262
1266
|
isUsingVerticalWriting: d,
|
|
1263
1267
|
minimumWidth: g,
|
|
1264
1268
|
pageHeight: h,
|
|
@@ -1295,7 +1299,7 @@ const Me = (e, t) => {
|
|
|
1295
1299
|
latestContentHeightWhenLoaded: l
|
|
1296
1300
|
};
|
|
1297
1301
|
};
|
|
1298
|
-
class
|
|
1302
|
+
class sn extends ht {
|
|
1299
1303
|
constructor() {
|
|
1300
1304
|
super(...arguments), this.isImageType = () => {
|
|
1301
1305
|
const t = this.item.mediaType ?? Lt(this.item.href);
|
|
@@ -1303,14 +1307,14 @@ class on extends ht {
|
|
|
1303
1307
|
};
|
|
1304
1308
|
}
|
|
1305
1309
|
onCreateDocument() {
|
|
1306
|
-
const t =
|
|
1310
|
+
const t = Zi();
|
|
1307
1311
|
return this.setDocumentContainer(t), w(t);
|
|
1308
1312
|
}
|
|
1309
1313
|
onLoadDocument() {
|
|
1310
1314
|
const t = this.getFrameElement();
|
|
1311
1315
|
if (!t) throw new Error("invalid frame");
|
|
1312
1316
|
return w(t).pipe(
|
|
1313
|
-
|
|
1317
|
+
Yi({
|
|
1314
1318
|
item: this.item,
|
|
1315
1319
|
resourcesHandler: this.resourcesHandler,
|
|
1316
1320
|
settings: this.settings
|
|
@@ -1319,17 +1323,17 @@ class on extends ht {
|
|
|
1319
1323
|
T(() => {
|
|
1320
1324
|
this.attach();
|
|
1321
1325
|
}),
|
|
1322
|
-
|
|
1323
|
-
|
|
1326
|
+
mi,
|
|
1327
|
+
Ei({
|
|
1324
1328
|
context: this.context,
|
|
1325
1329
|
item: this.item,
|
|
1326
1330
|
settings: this.settings
|
|
1327
1331
|
}),
|
|
1328
|
-
|
|
1332
|
+
fi
|
|
1329
1333
|
);
|
|
1330
1334
|
}
|
|
1331
1335
|
onUnload() {
|
|
1332
|
-
return
|
|
1336
|
+
return Bi(this.getFrameElement()), this.detach(), Q;
|
|
1333
1337
|
}
|
|
1334
1338
|
onLayout({
|
|
1335
1339
|
minPageSpread: t,
|
|
@@ -1341,7 +1345,7 @@ class on extends ht {
|
|
|
1341
1345
|
if (!r) return w(void 0);
|
|
1342
1346
|
const a = !!((d = this.writingMode) != null && d.startsWith("vertical"));
|
|
1343
1347
|
if (this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && ((g = this.context.manifest) == null ? void 0 : g.renditionLayout) === "pre-paginated") {
|
|
1344
|
-
const l =
|
|
1348
|
+
const l = Ki({
|
|
1345
1349
|
blankPagePosition: i,
|
|
1346
1350
|
enableTouch: this.settings.values.computedPageTurnMode !== "scrollable",
|
|
1347
1351
|
frameElement: r,
|
|
@@ -1353,7 +1357,7 @@ class on extends ht {
|
|
|
1353
1357
|
});
|
|
1354
1358
|
return w(l);
|
|
1355
1359
|
}
|
|
1356
|
-
const { latestContentHeightWhenLoaded: c, ...u } =
|
|
1360
|
+
const { latestContentHeightWhenLoaded: c, ...u } = on({
|
|
1357
1361
|
pageHeight: s,
|
|
1358
1362
|
pageWidth: o,
|
|
1359
1363
|
frameElement: r,
|
|
@@ -1425,14 +1429,14 @@ class on extends ht {
|
|
|
1425
1429
|
return this.getFrameElement();
|
|
1426
1430
|
}
|
|
1427
1431
|
}
|
|
1428
|
-
const
|
|
1432
|
+
const rn = (e) => (t) => {
|
|
1429
1433
|
const i = e({
|
|
1430
1434
|
...t,
|
|
1431
1435
|
getRenderer(o) {
|
|
1432
1436
|
var r;
|
|
1433
|
-
return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new
|
|
1437
|
+
return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new sn(a));
|
|
1434
1438
|
}
|
|
1435
|
-
}), n =
|
|
1439
|
+
}), n = Wi(i);
|
|
1436
1440
|
return n.pipe(F(i.$.destroy$)).subscribe(), {
|
|
1437
1441
|
...i,
|
|
1438
1442
|
links$: n
|
|
@@ -1441,7 +1445,7 @@ const sn = (e) => (t) => {
|
|
|
1441
1445
|
function ct(e) {
|
|
1442
1446
|
return e != null;
|
|
1443
1447
|
}
|
|
1444
|
-
let
|
|
1448
|
+
let an = class extends Le {
|
|
1445
1449
|
computeOutputSettings(t) {
|
|
1446
1450
|
return t;
|
|
1447
1451
|
}
|
|
@@ -1469,7 +1473,7 @@ let rn = class extends Le {
|
|
|
1469
1473
|
};
|
|
1470
1474
|
}
|
|
1471
1475
|
};
|
|
1472
|
-
const
|
|
1476
|
+
const cn = (e) => {
|
|
1473
1477
|
let t;
|
|
1474
1478
|
const i = e.context.state$.pipe(
|
|
1475
1479
|
_(({ containerElement: c }) => c ? new st(() => (t = c.ownerDocument.createElement("div"), t.style.cssText = `
|
|
@@ -1508,14 +1512,14 @@ const an = (e) => {
|
|
|
1508
1512
|
J(e.$.destroy$)
|
|
1509
1513
|
);
|
|
1510
1514
|
return x(i, a);
|
|
1511
|
-
},
|
|
1515
|
+
}, un = (e) => {
|
|
1512
1516
|
e.hookManager.register(
|
|
1513
1517
|
"item.onAfterLayout",
|
|
1514
1518
|
({ item: t, blankPagePosition: i, minimumWidth: n }) => {
|
|
1515
1519
|
const o = e.spineItemsManager.get(t.id), s = o == null ? void 0 : o.renderer.getDocumentFrame();
|
|
1516
1520
|
if ((o == null ? void 0 : o.renditionLayout) !== "reflowable" || !(s instanceof HTMLIFrameElement))
|
|
1517
1521
|
return;
|
|
1518
|
-
const { hasViewport: r } =
|
|
1522
|
+
const { hasViewport: r } = Bt(s), { width: a } = e.context.getPageSize(), c = o == null ? void 0 : o.renderer.getDocumentFrame();
|
|
1519
1523
|
if (r) {
|
|
1520
1524
|
const u = a < n;
|
|
1521
1525
|
i === "none" && u && c instanceof HTMLIFrameElement && (c == null || c.style.setProperty(
|
|
@@ -1536,7 +1540,7 @@ class kt extends Ae {
|
|
|
1536
1540
|
super(...arguments), this.__symbol = "SpineItemSpineLayout";
|
|
1537
1541
|
}
|
|
1538
1542
|
}
|
|
1539
|
-
class
|
|
1543
|
+
class dn extends Ae {
|
|
1540
1544
|
constructor() {
|
|
1541
1545
|
super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
|
|
1542
1546
|
}
|
|
@@ -1546,18 +1550,18 @@ class M {
|
|
|
1546
1550
|
this.__symbol = "SpinePosition", this.x = t.x, this.y = t.y;
|
|
1547
1551
|
}
|
|
1548
1552
|
}
|
|
1549
|
-
class
|
|
1553
|
+
class Yt {
|
|
1550
1554
|
constructor(t) {
|
|
1551
1555
|
this.__symbol = "UnsafeSpinePosition", this.x = t.x, this.y = t.y;
|
|
1552
1556
|
}
|
|
1553
1557
|
static from(t) {
|
|
1554
|
-
return new
|
|
1558
|
+
return new Yt(t);
|
|
1555
1559
|
}
|
|
1556
1560
|
}
|
|
1557
|
-
const
|
|
1561
|
+
const gn = ({
|
|
1558
1562
|
position: e,
|
|
1559
1563
|
pageSize: t
|
|
1560
|
-
}) => new
|
|
1564
|
+
}) => new dn({
|
|
1561
1565
|
x: e.x,
|
|
1562
1566
|
y: e.y,
|
|
1563
1567
|
left: e.x,
|
|
@@ -1566,7 +1570,7 @@ const dn = ({
|
|
|
1566
1570
|
height: t.height,
|
|
1567
1571
|
bottom: e.y + t.height,
|
|
1568
1572
|
right: e.x + t.width
|
|
1569
|
-
}),
|
|
1573
|
+
}), ln = (e) => {
|
|
1570
1574
|
const t = e.spine.spineLayout.layout$.pipe(
|
|
1571
1575
|
b(() => ({
|
|
1572
1576
|
pages: e.spine.spineItemsManager.items.reduce((s, r, a) => {
|
|
@@ -1578,7 +1582,7 @@ const dn = ({
|
|
|
1578
1582
|
spineItem: r,
|
|
1579
1583
|
spineItemPosition: p
|
|
1580
1584
|
});
|
|
1581
|
-
return
|
|
1585
|
+
return gn({
|
|
1582
1586
|
pageSize: e.context.getPageSize(),
|
|
1583
1587
|
position: h
|
|
1584
1588
|
});
|
|
@@ -1596,17 +1600,17 @@ const dn = ({
|
|
|
1596
1600
|
V()
|
|
1597
1601
|
), i = t.pipe(et({ refCount: !0, bufferSize: 1 }));
|
|
1598
1602
|
return i.pipe(F(e.$.destroy$)).subscribe(), { layout$: t, info$: i };
|
|
1599
|
-
},
|
|
1603
|
+
}, pn = (e, t) => t.pipe(
|
|
1600
1604
|
T((i) => {
|
|
1601
1605
|
e.viewport.value.element.style.transition = "transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275)", e.settings.values.computedPageTurnMode === "scrollable" ? e.viewport.value.element.style.transformOrigin = "top" : e.viewport.value.element.style.transformOrigin = "center", i === "thumbnails" ? e.viewport.value.element.style.transform = "scale(0.5)" : e.viewport.value.element.style.transform = "scale(1)", e.layout();
|
|
1602
1606
|
})
|
|
1603
|
-
),
|
|
1607
|
+
), hn = (e) => (t) => {
|
|
1604
1608
|
const {
|
|
1605
1609
|
pageHorizontalMargin: i,
|
|
1606
1610
|
pageVerticalMargin: n,
|
|
1607
1611
|
layoutAutoResize: o,
|
|
1608
1612
|
layoutLayerTransition: s
|
|
1609
|
-
} = t, r = e(t), a = new
|
|
1613
|
+
} = t, r = e(t), a = new an(
|
|
1610
1614
|
{
|
|
1611
1615
|
pageHorizontalMargin: i,
|
|
1612
1616
|
pageVerticalMargin: n,
|
|
@@ -1628,9 +1632,9 @@ const dn = ({
|
|
|
1628
1632
|
const O = L.height - $ * 2;
|
|
1629
1633
|
let B = L.width - P * 2, dt = P * 2;
|
|
1630
1634
|
f.isUsingVerticalWriting() && (B = L.width - P * 2, C = O, dt = $ * 2);
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
|
|
1635
|
+
const K = f == null ? void 0 : f.renderer.getDocumentFrame();
|
|
1636
|
+
K && ot(
|
|
1637
|
+
K,
|
|
1634
1638
|
"prose-layout-enhancer-css",
|
|
1635
1639
|
`
|
|
1636
1640
|
body {
|
|
@@ -1653,7 +1657,7 @@ const dn = ({
|
|
|
1653
1657
|
`
|
|
1654
1658
|
);
|
|
1655
1659
|
}
|
|
1656
|
-
}),
|
|
1660
|
+
}), un(r), r.hookManager.register(
|
|
1657
1661
|
"item.onDocumentCreated",
|
|
1658
1662
|
({ documentContainer: S }) => {
|
|
1659
1663
|
S.style.opacity = "0", a.values.layoutLayerTransition && (S.style.transition = "opacity 300ms");
|
|
@@ -1684,7 +1688,7 @@ const dn = ({
|
|
|
1684
1688
|
z(() => {
|
|
1685
1689
|
r == null || r.layout();
|
|
1686
1690
|
})
|
|
1687
|
-
), g =
|
|
1691
|
+
), g = cn(r);
|
|
1688
1692
|
a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
|
|
1689
1693
|
ai(1),
|
|
1690
1694
|
z(() => {
|
|
@@ -1697,7 +1701,7 @@ const dn = ({
|
|
|
1697
1701
|
const y = "prose-spineItem-ready";
|
|
1698
1702
|
f ? S.containerElement.classList.add(y) : S.containerElement.classList.remove(y);
|
|
1699
1703
|
})
|
|
1700
|
-
), { layout$: p, info$: h } =
|
|
1704
|
+
), { layout$: p, info$: h } = ln(r), m = pn(
|
|
1701
1705
|
r,
|
|
1702
1706
|
a.watch("viewportMode")
|
|
1703
1707
|
);
|
|
@@ -1716,7 +1720,7 @@ const dn = ({
|
|
|
1716
1720
|
layout$: p,
|
|
1717
1721
|
layoutInfo$: h
|
|
1718
1722
|
};
|
|
1719
|
-
},
|
|
1723
|
+
}, mn = `${lt}-enhancer-loading`, Oe = `${mn}-container`, fn = (e, t) => {
|
|
1720
1724
|
const i = e.ownerDocument.createElement("div");
|
|
1721
1725
|
return i.classList.add(Oe), i.style.cssText = `
|
|
1722
1726
|
height: 100%;
|
|
@@ -1734,7 +1738,7 @@ const dn = ({
|
|
|
1734
1738
|
background-color: white;
|
|
1735
1739
|
z-index: 1;
|
|
1736
1740
|
`, i;
|
|
1737
|
-
},
|
|
1741
|
+
}, yn = ({
|
|
1738
1742
|
container: e,
|
|
1739
1743
|
item: t
|
|
1740
1744
|
}) => {
|
|
@@ -1751,8 +1755,8 @@ const dn = ({
|
|
|
1751
1755
|
max-width: 300px;
|
|
1752
1756
|
width: 80%;
|
|
1753
1757
|
`, e.appendChild(i), e.appendChild(n), e;
|
|
1754
|
-
},
|
|
1755
|
-
const { loadingElementCreate: i =
|
|
1758
|
+
}, Sn = (e) => (t) => {
|
|
1759
|
+
const { loadingElementCreate: i = yn } = t, n = e(t), o = (c) => w(
|
|
1756
1760
|
c.reduce((u, { item: d, element: g }) => {
|
|
1757
1761
|
g.style.zIndex = "0";
|
|
1758
1762
|
const l = g.querySelector(
|
|
@@ -1761,7 +1765,7 @@ const dn = ({
|
|
|
1761
1765
|
if (l instanceof HTMLElement)
|
|
1762
1766
|
return u[d.id] = l, u;
|
|
1763
1767
|
const p = i({
|
|
1764
|
-
container:
|
|
1768
|
+
container: fn(g, n.context),
|
|
1765
1769
|
item: d
|
|
1766
1770
|
});
|
|
1767
1771
|
return g.appendChild(p), u[d.id] = p, u;
|
|
@@ -1816,7 +1820,7 @@ const dn = ({
|
|
|
1816
1820
|
}
|
|
1817
1821
|
};
|
|
1818
1822
|
};
|
|
1819
|
-
class
|
|
1823
|
+
class bn extends ht {
|
|
1820
1824
|
getImageElement() {
|
|
1821
1825
|
const t = this.documentContainer;
|
|
1822
1826
|
if (t instanceof HTMLImageElement)
|
|
@@ -1847,7 +1851,7 @@ class Sn extends ht {
|
|
|
1847
1851
|
}
|
|
1848
1852
|
onUnload() {
|
|
1849
1853
|
const t = this.getImageElement();
|
|
1850
|
-
return t && URL.revokeObjectURL(t.src), this.detach(),
|
|
1854
|
+
return t && URL.revokeObjectURL(t.src), this.detach(), Q;
|
|
1851
1855
|
}
|
|
1852
1856
|
onLayout({
|
|
1853
1857
|
spreadPosition: t
|
|
@@ -1863,18 +1867,18 @@ class Sn extends ht {
|
|
|
1863
1867
|
});
|
|
1864
1868
|
}
|
|
1865
1869
|
onRenderHeadless() {
|
|
1866
|
-
return
|
|
1870
|
+
return Q;
|
|
1867
1871
|
}
|
|
1868
1872
|
getDocumentFrame() {
|
|
1869
1873
|
}
|
|
1870
1874
|
}
|
|
1871
|
-
const
|
|
1875
|
+
const In = (e) => (t) => {
|
|
1872
1876
|
const i = e({
|
|
1873
1877
|
...t,
|
|
1874
1878
|
getRenderer(r) {
|
|
1875
1879
|
var d;
|
|
1876
1880
|
const a = (d = t.getRenderer) == null ? void 0 : d.call(t, r), c = r.mediaType ?? Lt(r.href), u = !!(c != null && c.startsWith("image/"));
|
|
1877
|
-
return !a && u ? (g) => new
|
|
1881
|
+
return !a && u ? (g) => new bn(g) : a;
|
|
1878
1882
|
}
|
|
1879
1883
|
}), n = new IntersectionObserver(
|
|
1880
1884
|
(r) => {
|
|
@@ -1924,40 +1928,40 @@ const bn = (e) => (t) => {
|
|
|
1924
1928
|
n.disconnect(), o.disconnect(), i.destroy();
|
|
1925
1929
|
}
|
|
1926
1930
|
};
|
|
1927
|
-
},
|
|
1931
|
+
}, wn = (e, t) => e.links$.pipe(
|
|
1928
1932
|
T((i) => {
|
|
1929
1933
|
var r;
|
|
1930
|
-
if (!
|
|
1934
|
+
if (!Mi(i.target, "a") || i.type !== "click") return;
|
|
1931
1935
|
const n = new URL(i.target.href), o = `${n.origin}${n.pathname}`;
|
|
1932
1936
|
((r = e.context.manifest) == null ? void 0 : r.spineItems.some(
|
|
1933
1937
|
(a) => a.href === o
|
|
1934
1938
|
)) && t.goToUrl(n);
|
|
1935
1939
|
})
|
|
1936
1940
|
), rt = j.namespace("navigation");
|
|
1937
|
-
class
|
|
1941
|
+
class R {
|
|
1938
1942
|
constructor(t) {
|
|
1939
1943
|
this.__symbol = Symbol("SpineItemPosition"), this.x = t.x, this.y = t.y;
|
|
1940
1944
|
}
|
|
1941
1945
|
}
|
|
1942
|
-
const
|
|
1946
|
+
const Pn = ({
|
|
1943
1947
|
position: e,
|
|
1944
1948
|
spineItem: t,
|
|
1945
1949
|
pageHeight: i,
|
|
1946
1950
|
pageWidth: n,
|
|
1947
1951
|
spineItemLocator: o
|
|
1948
1952
|
}) => {
|
|
1949
|
-
let s = new
|
|
1953
|
+
let s = new R({
|
|
1950
1954
|
x: e.x - n,
|
|
1951
1955
|
y: e.y
|
|
1952
1956
|
});
|
|
1953
|
-
return t.isUsingVerticalWriting() && (s = new
|
|
1957
|
+
return t.isUsingVerticalWriting() && (s = new R({
|
|
1954
1958
|
x: e.x,
|
|
1955
1959
|
y: e.y + i
|
|
1956
1960
|
})), o.getSpineItemClosestPositionFromUnsafePosition(
|
|
1957
1961
|
s,
|
|
1958
1962
|
t
|
|
1959
1963
|
);
|
|
1960
|
-
},
|
|
1964
|
+
}, se = ({
|
|
1961
1965
|
position: e,
|
|
1962
1966
|
navigationResolver: t,
|
|
1963
1967
|
computedPageTurnDirection: i,
|
|
@@ -1971,7 +1975,7 @@ const wn = ({
|
|
|
1971
1975
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
1972
1976
|
e,
|
|
1973
1977
|
a
|
|
1974
|
-
), d =
|
|
1978
|
+
), d = Pn({
|
|
1975
1979
|
position: u,
|
|
1976
1980
|
spineItem: a,
|
|
1977
1981
|
pageHeight: s.getPageSize().height,
|
|
@@ -1993,7 +1997,7 @@ const wn = ({
|
|
|
1993
1997
|
x: 0
|
|
1994
1998
|
})
|
|
1995
1999
|
);
|
|
1996
|
-
},
|
|
2000
|
+
}, vn = ({
|
|
1997
2001
|
position: e,
|
|
1998
2002
|
spineItem: t,
|
|
1999
2003
|
context: i,
|
|
@@ -2002,7 +2006,7 @@ const wn = ({
|
|
|
2002
2006
|
spineLocator: s,
|
|
2003
2007
|
computedPageTurnDirection: r
|
|
2004
2008
|
}) => {
|
|
2005
|
-
const a =
|
|
2009
|
+
const a = se({
|
|
2006
2010
|
position: e,
|
|
2007
2011
|
context: i,
|
|
2008
2012
|
navigationResolver: n,
|
|
@@ -2024,7 +2028,7 @@ const wn = ({
|
|
|
2024
2028
|
);
|
|
2025
2029
|
if (r === "vertical" && e.y !== a.y)
|
|
2026
2030
|
return n.getAdjustedPositionForSpread(a);
|
|
2027
|
-
const c =
|
|
2031
|
+
const c = se({
|
|
2028
2032
|
position: a,
|
|
2029
2033
|
context: i,
|
|
2030
2034
|
navigationResolver: n,
|
|
@@ -2035,25 +2039,25 @@ const wn = ({
|
|
|
2035
2039
|
return n.getAdjustedPositionForSpread(c);
|
|
2036
2040
|
}
|
|
2037
2041
|
return n.getAdjustedPositionForSpread(a);
|
|
2038
|
-
},
|
|
2042
|
+
}, xn = ({
|
|
2039
2043
|
position: e,
|
|
2040
2044
|
spineItem: t,
|
|
2041
2045
|
pageHeight: i,
|
|
2042
2046
|
pageWidth: n,
|
|
2043
2047
|
spineItemLocator: o
|
|
2044
2048
|
}) => {
|
|
2045
|
-
let s = new
|
|
2049
|
+
let s = new R({
|
|
2046
2050
|
x: e.x + n,
|
|
2047
2051
|
y: e.y
|
|
2048
2052
|
});
|
|
2049
|
-
return t.isUsingVerticalWriting() && (s = new
|
|
2053
|
+
return t.isUsingVerticalWriting() && (s = new R({
|
|
2050
2054
|
x: e.x,
|
|
2051
2055
|
y: e.y - i
|
|
2052
2056
|
})), o.getSpineItemClosestPositionFromUnsafePosition(
|
|
2053
2057
|
s,
|
|
2054
2058
|
t
|
|
2055
2059
|
);
|
|
2056
|
-
},
|
|
2060
|
+
}, re = ({
|
|
2057
2061
|
position: e,
|
|
2058
2062
|
navigationResolver: t,
|
|
2059
2063
|
computedPageTurnDirection: i,
|
|
@@ -2067,7 +2071,7 @@ const wn = ({
|
|
|
2067
2071
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2068
2072
|
e,
|
|
2069
2073
|
a
|
|
2070
|
-
), d =
|
|
2074
|
+
), d = xn({
|
|
2071
2075
|
position: u,
|
|
2072
2076
|
spineItem: a,
|
|
2073
2077
|
pageHeight: s.getPageSize().height,
|
|
@@ -2089,7 +2093,7 @@ const wn = ({
|
|
|
2089
2093
|
x: 0
|
|
2090
2094
|
})
|
|
2091
2095
|
);
|
|
2092
|
-
},
|
|
2096
|
+
}, $n = ({
|
|
2093
2097
|
position: e,
|
|
2094
2098
|
spineItem: t,
|
|
2095
2099
|
context: i,
|
|
@@ -2098,7 +2102,7 @@ const wn = ({
|
|
|
2098
2102
|
spineLocator: s,
|
|
2099
2103
|
computedPageTurnDirection: r
|
|
2100
2104
|
}) => {
|
|
2101
|
-
const a =
|
|
2105
|
+
const a = re({
|
|
2102
2106
|
position: e,
|
|
2103
2107
|
context: i,
|
|
2104
2108
|
navigationResolver: n,
|
|
@@ -2123,7 +2127,7 @@ const wn = ({
|
|
|
2123
2127
|
);
|
|
2124
2128
|
if (r === "vertical" && e.y !== a.y)
|
|
2125
2129
|
return n.getAdjustedPositionForSpread(a);
|
|
2126
|
-
const c =
|
|
2130
|
+
const c = re({
|
|
2127
2131
|
position: a,
|
|
2128
2132
|
context: i,
|
|
2129
2133
|
navigationResolver: n,
|
|
@@ -2135,7 +2139,7 @@ const wn = ({
|
|
|
2135
2139
|
}
|
|
2136
2140
|
return n.getAdjustedPositionForSpread(a);
|
|
2137
2141
|
};
|
|
2138
|
-
class
|
|
2142
|
+
class Tn {
|
|
2139
2143
|
constructor(t) {
|
|
2140
2144
|
this.reader = t, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2141
2145
|
}
|
|
@@ -2154,7 +2158,7 @@ class $n {
|
|
|
2154
2158
|
turnRightOrBottom() {
|
|
2155
2159
|
const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
|
|
2156
2160
|
if (!i) return;
|
|
2157
|
-
const n =
|
|
2161
|
+
const n = $n({
|
|
2158
2162
|
context: this.reader.context,
|
|
2159
2163
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2160
2164
|
position: t.position,
|
|
@@ -2170,7 +2174,7 @@ class $n {
|
|
|
2170
2174
|
turnLeftOrTop() {
|
|
2171
2175
|
const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
|
|
2172
2176
|
if (!i) return;
|
|
2173
|
-
const n =
|
|
2177
|
+
const n = vn({
|
|
2174
2178
|
context: this.reader.context,
|
|
2175
2179
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2176
2180
|
position: t.position,
|
|
@@ -2312,7 +2316,7 @@ class $n {
|
|
|
2312
2316
|
}
|
|
2313
2317
|
}
|
|
2314
2318
|
}
|
|
2315
|
-
class
|
|
2319
|
+
class Fn {
|
|
2316
2320
|
constructor(t) {
|
|
2317
2321
|
this.reader = t, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2318
2322
|
}
|
|
@@ -2352,7 +2356,7 @@ class Tn {
|
|
|
2352
2356
|
});
|
|
2353
2357
|
}
|
|
2354
2358
|
}
|
|
2355
|
-
const
|
|
2359
|
+
const Ln = (e) => e.pagination.state$.pipe(
|
|
2356
2360
|
D(e.context.manifest$, e.settings.values$),
|
|
2357
2361
|
b(
|
|
2358
2362
|
([
|
|
@@ -2372,7 +2376,7 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2372
2376
|
}
|
|
2373
2377
|
),
|
|
2374
2378
|
E(N)
|
|
2375
|
-
),
|
|
2379
|
+
), Mn = ({ reader: e, duration: t }) => (i) => {
|
|
2376
2380
|
let n;
|
|
2377
2381
|
const o = () => {
|
|
2378
2382
|
n == null || n(), n = void 0;
|
|
@@ -2388,18 +2392,18 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2388
2392
|
T(o),
|
|
2389
2393
|
ut(o)
|
|
2390
2394
|
);
|
|
2391
|
-
},
|
|
2392
|
-
const i = e(t), n =
|
|
2395
|
+
}, Cn = (e) => (t) => {
|
|
2396
|
+
const i = e(t), n = Ln(i), o = new Tn(i), s = new Fn(i), r = (c) => {
|
|
2393
2397
|
const { cfi: u, ...d } = c;
|
|
2394
2398
|
i.load(d), u && o.goToCfi(u, { animate: !1 });
|
|
2395
2399
|
};
|
|
2396
|
-
return
|
|
2400
|
+
return wn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
|
|
2397
2401
|
...i,
|
|
2398
2402
|
load: r,
|
|
2399
2403
|
navigation: {
|
|
2400
2404
|
...i.navigation,
|
|
2401
2405
|
state$: n,
|
|
2402
|
-
throttleLock: ({ duration: c, trigger: u }) => u.pipe(
|
|
2406
|
+
throttleLock: ({ duration: c, trigger: u }) => u.pipe(Mn({ duration: c, reader: i })),
|
|
2403
2407
|
moveTo: s.moveTo.bind(s),
|
|
2404
2408
|
turnBottom: o.turnBottom.bind(o),
|
|
2405
2409
|
turnTop: o.turnTop.bind(o),
|
|
@@ -2443,10 +2447,10 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2443
2447
|
n.offset,
|
|
2444
2448
|
t.item
|
|
2445
2449
|
).trim() : mt(t.item);
|
|
2446
|
-
},
|
|
2450
|
+
}, Rn = (e, t) => {
|
|
2447
2451
|
const i = ft(e.startContainer, e.startOffset, t), n = ft(e.endContainer, e.endOffset, t);
|
|
2448
2452
|
return { start: i, end: n };
|
|
2449
|
-
},
|
|
2453
|
+
}, An = ({
|
|
2450
2454
|
item: e,
|
|
2451
2455
|
selection: t
|
|
2452
2456
|
}) => {
|
|
@@ -2455,19 +2459,15 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2455
2459
|
anchorCfi: i,
|
|
2456
2460
|
focusCfi: n
|
|
2457
2461
|
};
|
|
2458
|
-
},
|
|
2462
|
+
}, ae = (e) => {
|
|
2459
2463
|
var t;
|
|
2460
2464
|
return ((t = e[0]) == null ? void 0 : t.index) === 6 && e.length > 1;
|
|
2461
|
-
},
|
|
2462
|
-
const t = we(e)
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
return zt(o);
|
|
2466
|
-
};
|
|
2467
|
-
return Array.isArray(t) ? i(t) : i(t.parent);
|
|
2468
|
-
}, An = (e) => Array.isArray(e) ? e[0] && zt(e[0]) ? e[0] : void 0 : e.parent[0] && zt(e.parent[0]) ? e.parent[0] : void 0, Gt = (e) => {
|
|
2465
|
+
}, zt = (e) => {
|
|
2466
|
+
const t = we(e);
|
|
2467
|
+
return gi(t);
|
|
2468
|
+
}, On = (e) => Array.isArray(e) ? e[0] && ae(e[0]) ? e[0] : void 0 : e.parent[0] && ae(e.parent[0]) ? e.parent[0] : void 0, Zt = (e) => {
|
|
2469
2469
|
var a, c, u, d;
|
|
2470
|
-
const t = we(e), n = (
|
|
2470
|
+
const t = we(e), n = (On(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = di(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
|
|
2471
2471
|
return {
|
|
2472
2472
|
cleanedCfi: e,
|
|
2473
2473
|
itemIndex: s,
|
|
@@ -2479,14 +2479,15 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2479
2479
|
}) => {
|
|
2480
2480
|
var s, r;
|
|
2481
2481
|
if (!e) return;
|
|
2482
|
-
const { itemIndex: i } =
|
|
2482
|
+
const { itemIndex: i } = Zt(e), n = t.get(i);
|
|
2483
2483
|
if (!n) return;
|
|
2484
2484
|
const o = n.renderer.getDocumentFrame();
|
|
2485
2485
|
if (o instanceof HTMLIFrameElement) {
|
|
2486
|
+
console.log("FIII", e);
|
|
2486
2487
|
const a = (s = o.contentWindow) == null ? void 0 : s.document;
|
|
2487
2488
|
if (a)
|
|
2488
2489
|
try {
|
|
2489
|
-
const c =
|
|
2490
|
+
const c = li(e, a, {
|
|
2490
2491
|
throwOnError: !0
|
|
2491
2492
|
});
|
|
2492
2493
|
return {
|
|
@@ -2503,7 +2504,7 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2503
2504
|
return {
|
|
2504
2505
|
spineItem: n
|
|
2505
2506
|
};
|
|
2506
|
-
},
|
|
2507
|
+
}, Dn = (e, t) => {
|
|
2507
2508
|
if ("cfi" in t)
|
|
2508
2509
|
return t;
|
|
2509
2510
|
const i = e.spineItemsManager.get(t);
|
|
@@ -2512,7 +2513,7 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2512
2513
|
return {
|
|
2513
2514
|
cfi: mt(i.item)
|
|
2514
2515
|
};
|
|
2515
|
-
},
|
|
2516
|
+
}, Nn = (e, t) => {
|
|
2516
2517
|
let i = e == null ? void 0 : e.itemPageIndex;
|
|
2517
2518
|
const { itemIndex: n } = t.cfi.parseCfi(e.cfi), o = t.spineItemsManager.get(n);
|
|
2518
2519
|
return o ? Fe().pipe(
|
|
@@ -2545,19 +2546,19 @@ const Fn = (e) => e.pagination.state$.pipe(
|
|
|
2545
2546
|
})
|
|
2546
2547
|
) : w({ ...e, itemIndex: n });
|
|
2547
2548
|
};
|
|
2548
|
-
class
|
|
2549
|
+
class Vn {
|
|
2549
2550
|
constructor(t) {
|
|
2550
2551
|
this.reader = t, this.locate = (i, n) => {
|
|
2551
2552
|
const o = {
|
|
2552
2553
|
resource: i,
|
|
2553
|
-
meta:
|
|
2554
|
+
meta: Dn(this.reader, i)
|
|
2554
2555
|
};
|
|
2555
|
-
return
|
|
2556
|
+
return ie(() => {
|
|
2556
2557
|
var d;
|
|
2557
2558
|
const s = this.reader.spine.spineLayout.layout$.pipe(
|
|
2558
2559
|
St(10),
|
|
2559
2560
|
nt(o),
|
|
2560
|
-
Je((g) =>
|
|
2561
|
+
Je((g) => Nn(g.meta, this.reader).pipe(
|
|
2561
2562
|
b((l) => ({
|
|
2562
2563
|
...g,
|
|
2563
2564
|
meta: l
|
|
@@ -2578,7 +2579,7 @@ class Nn {
|
|
|
2578
2579
|
};
|
|
2579
2580
|
}
|
|
2580
2581
|
locateResource(t, i) {
|
|
2581
|
-
return Array.isArray(t) ?
|
|
2582
|
+
return Array.isArray(t) ? ie(
|
|
2582
2583
|
() => q(t.map((n) => this.locate(n, i ?? {})))
|
|
2583
2584
|
) : this.locate(t, i ?? {});
|
|
2584
2585
|
}
|
|
@@ -2608,20 +2609,20 @@ const Ne = (e, t, i) => {
|
|
|
2608
2609
|
}
|
|
2609
2610
|
return o;
|
|
2610
2611
|
}, void 0);
|
|
2611
|
-
},
|
|
2612
|
+
}, jn = (e, t) => {
|
|
2612
2613
|
var n;
|
|
2613
2614
|
const { href: i } = t;
|
|
2614
2615
|
return Ne(i, ((n = e.nav) == null ? void 0 : n.toc) ?? [], e);
|
|
2615
|
-
},
|
|
2616
|
+
}, kn = (e) => {
|
|
2616
2617
|
const t = e.context.manifest, i = e.spineItemsManager.items;
|
|
2617
2618
|
return t ? i.reduce(
|
|
2618
|
-
(n, { item: o }) => (n[o.id] =
|
|
2619
|
+
(n, { item: o }) => (n[o.id] = jn(t, o), n),
|
|
2619
2620
|
{}
|
|
2620
2621
|
) : {};
|
|
2621
|
-
},
|
|
2622
|
+
}, Wn = (e) => e.spineItemsManager.items$.pipe(
|
|
2622
2623
|
nt([]),
|
|
2623
|
-
b(() =>
|
|
2624
|
-
),
|
|
2624
|
+
b(() => kn(e))
|
|
2625
|
+
), zn = (e, t, i) => e + t * i, Un = (e, t, i) => {
|
|
2625
2626
|
const n = e.context, { height: o, width: s } = i.layout.layoutInfo, { top: r, left: a } = e.spine.spineLayout.getSpineItemSpineLayoutInfo(i);
|
|
2626
2627
|
return e.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
|
|
2627
2628
|
0,
|
|
@@ -2636,7 +2637,7 @@ const Ne = (e, t, i) => {
|
|
|
2636
2637
|
(t.x - a + n.state.visibleAreaRect.width) / s
|
|
2637
2638
|
)
|
|
2638
2639
|
);
|
|
2639
|
-
},
|
|
2640
|
+
}, Hn = (e, t, i, n, o) => o.isReady$.pipe(
|
|
2640
2641
|
H(),
|
|
2641
2642
|
D(e.layoutInfo$),
|
|
2642
2643
|
b(([s, r]) => {
|
|
@@ -2647,17 +2648,17 @@ const Ne = (e, t, i) => {
|
|
|
2647
2648
|
let m = (i + 1) * (h / p);
|
|
2648
2649
|
!c && o.renditionLayout === "reflowable" && !s && (m = 0);
|
|
2649
2650
|
let S = d + m;
|
|
2650
|
-
return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m =
|
|
2651
|
+
return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m = Un(
|
|
2651
2652
|
e,
|
|
2652
2653
|
n,
|
|
2653
2654
|
o
|
|
2654
|
-
) : m = 0, S =
|
|
2655
|
+
) : m = 0, S = zn(
|
|
2655
2656
|
d,
|
|
2656
2657
|
h,
|
|
2657
2658
|
m
|
|
2658
2659
|
)), t === u - 1 && i === p - 1 && S > 0.99 ? 1 : S;
|
|
2659
2660
|
})
|
|
2660
|
-
),
|
|
2661
|
+
), En = (e) => e.spine.spineLayout.layout$.pipe(
|
|
2661
2662
|
St(10, at),
|
|
2662
2663
|
D(e.pagination.state$),
|
|
2663
2664
|
b(() => ({
|
|
@@ -2675,7 +2676,7 @@ const Ne = (e, t, i) => {
|
|
|
2675
2676
|
numberOfPagesPerItems: [],
|
|
2676
2677
|
numberOfTotalPages: 0
|
|
2677
2678
|
})
|
|
2678
|
-
),
|
|
2679
|
+
), Bn = (e, t, i, n) => {
|
|
2679
2680
|
const o = e.context, s = t.beginSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.beginSpineItemIndex) : void 0, r = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
|
|
2680
2681
|
return w({
|
|
2681
2682
|
...t,
|
|
@@ -2706,7 +2707,7 @@ const Ne = (e, t, i) => {
|
|
|
2706
2707
|
// hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
|
|
2707
2708
|
// numberOfSpineItems: context.manifest?.readingOrder.length,
|
|
2708
2709
|
});
|
|
2709
|
-
},
|
|
2710
|
+
}, _n = (e) => q([
|
|
2710
2711
|
e.pagination.state$,
|
|
2711
2712
|
// Usually pagination change if layout changes (number of pages) however it is especially
|
|
2712
2713
|
// useful for like webtoon where you still have one page but only the layout will give you the final size
|
|
@@ -2715,7 +2716,7 @@ const Ne = (e, t, i) => {
|
|
|
2715
2716
|
]).pipe(
|
|
2716
2717
|
v(([t]) => {
|
|
2717
2718
|
const i = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
|
|
2718
|
-
return i ?
|
|
2719
|
+
return i ? Hn(
|
|
2719
2720
|
e,
|
|
2720
2721
|
t.endSpineItemIndex ?? 0,
|
|
2721
2722
|
t.endPageIndexInSpineItem || 0,
|
|
@@ -2723,8 +2724,8 @@ const Ne = (e, t, i) => {
|
|
|
2723
2724
|
i
|
|
2724
2725
|
) : w(0);
|
|
2725
2726
|
})
|
|
2726
|
-
),
|
|
2727
|
-
const t =
|
|
2727
|
+
), Xn = (e) => {
|
|
2728
|
+
const t = Wn(e), i = En(e), n = new k({
|
|
2728
2729
|
...e.pagination.state,
|
|
2729
2730
|
beginChapterInfo: void 0,
|
|
2730
2731
|
beginCfi: void 0,
|
|
@@ -2742,10 +2743,10 @@ const Ne = (e, t, i) => {
|
|
|
2742
2743
|
}), o = q([
|
|
2743
2744
|
e.pagination.state$,
|
|
2744
2745
|
t,
|
|
2745
|
-
|
|
2746
|
+
_n(e)
|
|
2746
2747
|
]).pipe(
|
|
2747
2748
|
v(
|
|
2748
|
-
([r, a, c]) =>
|
|
2749
|
+
([r, a, c]) => Bn(
|
|
2749
2750
|
e,
|
|
2750
2751
|
r,
|
|
2751
2752
|
a,
|
|
@@ -2780,10 +2781,10 @@ const Ne = (e, t, i) => {
|
|
|
2780
2781
|
}),
|
|
2781
2782
|
et(1)
|
|
2782
2783
|
), getPaginationInfo: () => n.value };
|
|
2783
|
-
},
|
|
2784
|
-
const i = e(t), { paginationInfo$: n, getPaginationInfo: o } =
|
|
2784
|
+
}, qn = (e) => (t) => {
|
|
2785
|
+
const i = e(t), { paginationInfo$: n, getPaginationInfo: o } = Xn(i);
|
|
2785
2786
|
n.pipe(F(i.$.destroy$)).subscribe();
|
|
2786
|
-
const s = new
|
|
2787
|
+
const s = new Vn(i);
|
|
2787
2788
|
return {
|
|
2788
2789
|
...i,
|
|
2789
2790
|
locateResource: s.locateResource.bind(s),
|
|
@@ -2797,7 +2798,7 @@ const Ne = (e, t, i) => {
|
|
|
2797
2798
|
}
|
|
2798
2799
|
}
|
|
2799
2800
|
};
|
|
2800
|
-
},
|
|
2801
|
+
}, Yn = (e) => ({
|
|
2801
2802
|
put: (s, r) => new Promise((a, c) => {
|
|
2802
2803
|
const u = e.transaction(["store"], "readwrite");
|
|
2803
2804
|
u.onerror = (l) => {
|
|
@@ -2855,11 +2856,11 @@ const Ne = (e, t, i) => {
|
|
|
2855
2856
|
n.onerror = (o) => {
|
|
2856
2857
|
i(o);
|
|
2857
2858
|
}, n.onsuccess = () => {
|
|
2858
|
-
t(
|
|
2859
|
+
t(Yn(n.result));
|
|
2859
2860
|
}, n.onupgradeneeded = () => {
|
|
2860
2861
|
n.result.createObjectStore("store");
|
|
2861
2862
|
};
|
|
2862
|
-
}),
|
|
2863
|
+
}), Zn = (e) => {
|
|
2863
2864
|
let t = Date.now().toString();
|
|
2864
2865
|
const i = new U(), n = (c) => {
|
|
2865
2866
|
var u, d;
|
|
@@ -2886,8 +2887,8 @@ const Ne = (e, t, i) => {
|
|
|
2886
2887
|
Ke([At("prose-reader"), W(u.blob())])
|
|
2887
2888
|
).pipe(
|
|
2888
2889
|
_(([g, l]) => W(g.put(`${t}_${d.id}`, l))),
|
|
2889
|
-
|
|
2890
|
-
) :
|
|
2890
|
+
te((g) => (j.error(g), Q))
|
|
2891
|
+
) : Q;
|
|
2891
2892
|
}),
|
|
2892
2893
|
J(e.destroy$)
|
|
2893
2894
|
).subscribe();
|
|
@@ -2909,7 +2910,7 @@ const Ne = (e, t, i) => {
|
|
|
2909
2910
|
})
|
|
2910
2911
|
)
|
|
2911
2912
|
),
|
|
2912
|
-
|
|
2913
|
+
te((c) => (j.error(c), Q))
|
|
2913
2914
|
))),
|
|
2914
2915
|
J(e.destroy$)
|
|
2915
2916
|
).subscribe(), {
|
|
@@ -2918,8 +2919,8 @@ const Ne = (e, t, i) => {
|
|
|
2918
2919
|
i.complete();
|
|
2919
2920
|
}
|
|
2920
2921
|
};
|
|
2921
|
-
},
|
|
2922
|
-
const i = e(t), n =
|
|
2922
|
+
}, Gn = (e) => (t) => {
|
|
2923
|
+
const i = e(t), n = Zn(i.context);
|
|
2923
2924
|
return {
|
|
2924
2925
|
...i,
|
|
2925
2926
|
// $: {
|
|
@@ -2931,7 +2932,7 @@ const Ne = (e, t, i) => {
|
|
|
2931
2932
|
}
|
|
2932
2933
|
// load,
|
|
2933
2934
|
};
|
|
2934
|
-
},
|
|
2935
|
+
}, Jn = (e, t) => {
|
|
2935
2936
|
var o;
|
|
2936
2937
|
const i = (o = e.node.ownerDocument) == null ? void 0 : o.createRange(), n = e.node.compareDocumentPosition(t.node);
|
|
2937
2938
|
if (i) {
|
|
@@ -2952,14 +2953,14 @@ const Ne = (e, t, i) => {
|
|
|
2952
2953
|
}
|
|
2953
2954
|
return i;
|
|
2954
2955
|
}
|
|
2955
|
-
},
|
|
2956
|
+
}, Kn = ({
|
|
2956
2957
|
selection: e,
|
|
2957
2958
|
spineItem: t
|
|
2958
2959
|
}) => {
|
|
2959
2960
|
const { anchorNode: i, anchorOffset: n, focusNode: o, focusOffset: s } = e;
|
|
2960
2961
|
if (!(!i || !o))
|
|
2961
2962
|
try {
|
|
2962
|
-
return
|
|
2963
|
+
return Jn(
|
|
2963
2964
|
{ node: i, offset: n },
|
|
2964
2965
|
{ node: o, offset: s }
|
|
2965
2966
|
);
|
|
@@ -2971,7 +2972,7 @@ const Ne = (e, t, i) => {
|
|
|
2971
2972
|
return;
|
|
2972
2973
|
}
|
|
2973
2974
|
};
|
|
2974
|
-
class
|
|
2975
|
+
class Qn extends Y {
|
|
2975
2976
|
constructor(t) {
|
|
2976
2977
|
var n;
|
|
2977
2978
|
super();
|
|
@@ -2979,17 +2980,17 @@ class Kn extends Y {
|
|
|
2979
2980
|
if (!i)
|
|
2980
2981
|
this.selectionChange$ = gt, this.selectionOver$ = gt;
|
|
2981
2982
|
else {
|
|
2982
|
-
const o =
|
|
2983
|
+
const o = ne(i.body, {
|
|
2983
2984
|
childList: !0,
|
|
2984
2985
|
subtree: !0
|
|
2985
2986
|
}).pipe(
|
|
2986
|
-
|
|
2987
|
+
A(
|
|
2987
2988
|
(r) => !!r.find((a) => a.type === "childList" && a.removedNodes.length)
|
|
2988
2989
|
)
|
|
2989
|
-
), s = t.parentElement ?
|
|
2990
|
+
), s = t.parentElement ? ne(t.parentElement, {
|
|
2990
2991
|
childList: !0
|
|
2991
2992
|
}).pipe(
|
|
2992
|
-
|
|
2993
|
+
A(
|
|
2993
2994
|
(r) => !!r.find(
|
|
2994
2995
|
(a) => Array.from(a.removedNodes).includes(t)
|
|
2995
2996
|
)
|
|
@@ -3019,7 +3020,7 @@ class Kn extends Y {
|
|
|
3019
3020
|
const a = i.getSelection();
|
|
3020
3021
|
return a && !a.isCollapsed ? [r, a] : void 0;
|
|
3021
3022
|
}),
|
|
3022
|
-
|
|
3023
|
+
A(ct)
|
|
3023
3024
|
)
|
|
3024
3025
|
),
|
|
3025
3026
|
F(x(s, this.destroy$))
|
|
@@ -3027,12 +3028,12 @@ class Kn extends Y {
|
|
|
3027
3028
|
}
|
|
3028
3029
|
}
|
|
3029
3030
|
}
|
|
3030
|
-
const
|
|
3031
|
+
const to = (e) => e.loaded$.pipe(
|
|
3031
3032
|
v(() => {
|
|
3032
3033
|
var o;
|
|
3033
3034
|
const t = e.renderer.getDocumentFrame(), i = (t == null ? void 0 : t.contentDocument) || ((o = t == null ? void 0 : t.contentWindow) == null ? void 0 : o.document);
|
|
3034
3035
|
if (!t || !i) return gt;
|
|
3035
|
-
const n = new
|
|
3036
|
+
const n = new Qn(t);
|
|
3036
3037
|
return x(
|
|
3037
3038
|
n.selectionChange$.pipe(
|
|
3038
3039
|
b((s) => {
|
|
@@ -3059,14 +3060,14 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3059
3060
|
);
|
|
3060
3061
|
}),
|
|
3061
3062
|
E()
|
|
3062
|
-
),
|
|
3063
|
+
), eo = (e) => (t) => {
|
|
3063
3064
|
const i = e(t);
|
|
3064
3065
|
let n;
|
|
3065
3066
|
const o = i.spineItemsManager.items$.pipe(
|
|
3066
3067
|
v((d) => {
|
|
3067
3068
|
const g = d.map((l) => {
|
|
3068
3069
|
const p = i.spineItemsManager.getSpineItemIndex(l) ?? 0;
|
|
3069
|
-
return
|
|
3070
|
+
return to(l).pipe(
|
|
3070
3071
|
b((h) => {
|
|
3071
3072
|
if (h)
|
|
3072
3073
|
return {
|
|
@@ -3087,15 +3088,15 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3087
3088
|
), s = o, r = o.pipe(
|
|
3088
3089
|
b((d) => !!d),
|
|
3089
3090
|
E(),
|
|
3090
|
-
|
|
3091
|
+
A((d) => d),
|
|
3091
3092
|
V()
|
|
3092
3093
|
), a = r.pipe(
|
|
3093
3094
|
v(() => s),
|
|
3094
3095
|
E(),
|
|
3095
|
-
|
|
3096
|
+
A((d) => !d),
|
|
3096
3097
|
V()
|
|
3097
3098
|
), c = o.pipe(
|
|
3098
|
-
|
|
3099
|
+
A((d) => (d == null ? void 0 : d.type) === "over"),
|
|
3099
3100
|
V()
|
|
3100
3101
|
), u = i.context.containerElement$.pipe(
|
|
3101
3102
|
v((d) => G(d, "pointerdown")),
|
|
@@ -3113,7 +3114,7 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3113
3114
|
selectionOver$: c,
|
|
3114
3115
|
lastSelectionOnPointerdown$: u,
|
|
3115
3116
|
getSelection: () => n,
|
|
3116
|
-
createOrderedRangeFromSelection:
|
|
3117
|
+
createOrderedRangeFromSelection: Kn
|
|
3117
3118
|
}
|
|
3118
3119
|
};
|
|
3119
3120
|
}, ce = [
|
|
@@ -3131,7 +3132,7 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3131
3132
|
backgroundColor: "#191717",
|
|
3132
3133
|
foregroundColor: "#f1ebeb"
|
|
3133
3134
|
}
|
|
3134
|
-
],
|
|
3135
|
+
], io = (e) => (t) => {
|
|
3135
3136
|
const i = e(t), n = new k(
|
|
3136
3137
|
t.theme ?? "bright"
|
|
3137
3138
|
), o = () => {
|
|
@@ -3196,7 +3197,7 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3196
3197
|
}
|
|
3197
3198
|
}
|
|
3198
3199
|
};
|
|
3199
|
-
},
|
|
3200
|
+
}, no = (e) => (t) => ({
|
|
3200
3201
|
...e(t),
|
|
3201
3202
|
utils: {
|
|
3202
3203
|
isOrIsWithinValidLink: (o) => {
|
|
@@ -3210,13 +3211,13 @@ const Qn = (e) => e.loaded$.pipe(
|
|
|
3210
3211
|
}
|
|
3211
3212
|
});
|
|
3212
3213
|
navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
|
|
3213
|
-
const
|
|
3214
|
+
const oo = (e) => (t) => e(t);
|
|
3214
3215
|
class Ve {
|
|
3215
3216
|
constructor(t) {
|
|
3216
3217
|
this.reader = t;
|
|
3217
3218
|
}
|
|
3218
3219
|
}
|
|
3219
|
-
class
|
|
3220
|
+
class so extends Ve {
|
|
3220
3221
|
constructor() {
|
|
3221
3222
|
super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
|
|
3222
3223
|
}
|
|
@@ -3273,7 +3274,7 @@ const Tt = ({
|
|
|
3273
3274
|
const o = i * e / 2 - i + i / 2, s = i * t / 2 - i + i / 2, r = e / t, a = n - s;
|
|
3274
3275
|
return Math.max(o + a * r, 0);
|
|
3275
3276
|
};
|
|
3276
|
-
class
|
|
3277
|
+
class ro extends Ve {
|
|
3277
3278
|
constructor() {
|
|
3278
3279
|
super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
|
|
3279
3280
|
}
|
|
@@ -3306,8 +3307,8 @@ class so extends Ve {
|
|
|
3306
3307
|
}), this.currentScale = o;
|
|
3307
3308
|
}
|
|
3308
3309
|
}
|
|
3309
|
-
const
|
|
3310
|
-
const i = e(t), n = new
|
|
3310
|
+
const ao = (e) => (t) => {
|
|
3311
|
+
const i = e(t), n = new so(i), o = new ro(i), s = new k(o);
|
|
3311
3312
|
return {
|
|
3312
3313
|
...i,
|
|
3313
3314
|
destroy: () => {
|
|
@@ -3354,7 +3355,7 @@ class bt extends st {
|
|
|
3354
3355
|
N(this.value, i) || this.stateSubject.next(i);
|
|
3355
3356
|
}
|
|
3356
3357
|
watch(t) {
|
|
3357
|
-
return Array.isArray(t) ? this.stateSubject.pipe(
|
|
3358
|
+
return Array.isArray(t) ? this.stateSubject.pipe(Xt(t)) : this.stateSubject.pipe(
|
|
3358
3359
|
b((i) => i[t]),
|
|
3359
3360
|
E(N)
|
|
3360
3361
|
);
|
|
@@ -3366,19 +3367,19 @@ class bt extends st {
|
|
|
3366
3367
|
this.stateSubject.complete(), this.destroy$.complete();
|
|
3367
3368
|
}
|
|
3368
3369
|
}
|
|
3369
|
-
class
|
|
3370
|
+
class co {
|
|
3370
3371
|
constructor() {
|
|
3371
|
-
this.navigationSubject = new
|
|
3372
|
+
this.navigationSubject = new Jt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Jt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
|
|
3372
3373
|
E(),
|
|
3373
|
-
|
|
3374
|
+
A((t) => !t)
|
|
3374
3375
|
), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
|
|
3375
|
-
|
|
3376
|
+
A((t) => t === "free")
|
|
3376
3377
|
), this.viewportBusy$ = this.viewportState$.pipe(
|
|
3377
|
-
|
|
3378
|
+
A((t) => t === "busy")
|
|
3378
3379
|
), this.navigation$ = this.navigationSubject.asObservable();
|
|
3379
3380
|
}
|
|
3380
3381
|
}
|
|
3381
|
-
const
|
|
3382
|
+
const uo = ({
|
|
3382
3383
|
manifest: e,
|
|
3383
3384
|
visibleAreaRect: t,
|
|
3384
3385
|
forceSinglePageMode: i
|
|
@@ -3386,7 +3387,7 @@ const co = ({
|
|
|
3386
3387
|
const { height: n, width: o } = t, s = o > n;
|
|
3387
3388
|
return i || (e == null ? void 0 : e.renditionFlow) === "scrolled-continuous" ? !1 : !s && (e == null ? void 0 : e.renditionSpread) === "portrait" ? !0 : s && ((e == null ? void 0 : e.renditionSpread) === void 0 || (e == null ? void 0 : e.renditionSpread) === "auto" || (e == null ? void 0 : e.renditionSpread) === "landscape" || (e == null ? void 0 : e.renditionSpread) === "both");
|
|
3388
3389
|
};
|
|
3389
|
-
class
|
|
3390
|
+
class go extends bt {
|
|
3390
3391
|
constructor() {
|
|
3391
3392
|
super({
|
|
3392
3393
|
marginBottom: 0,
|
|
@@ -3399,7 +3400,7 @@ class uo extends bt {
|
|
|
3399
3400
|
x: 0,
|
|
3400
3401
|
y: 0
|
|
3401
3402
|
}
|
|
3402
|
-
}), this.bridgeEvent = new
|
|
3403
|
+
}), this.bridgeEvent = new co(), this.destroy$ = new U(), this.state$ = this.pipe(Z(N)), this.manifest$ = this.pipe(
|
|
3403
3404
|
X((t) => t.manifest),
|
|
3404
3405
|
tt(ct),
|
|
3405
3406
|
Z()
|
|
@@ -3434,7 +3435,7 @@ class uo extends bt {
|
|
|
3434
3435
|
isFullyPrePaginated: je(n),
|
|
3435
3436
|
assumedRenditionLayout: (n == null ? void 0 : n.renditionLayout) ?? "reflowable"
|
|
3436
3437
|
},
|
|
3437
|
-
isUsingSpreadMode:
|
|
3438
|
+
isUsingSpreadMode: uo({
|
|
3438
3439
|
manifest: n,
|
|
3439
3440
|
visibleAreaRect: s,
|
|
3440
3441
|
forceSinglePageMode: o
|
|
@@ -3466,7 +3467,7 @@ class uo extends bt {
|
|
|
3466
3467
|
};
|
|
3467
3468
|
}
|
|
3468
3469
|
}
|
|
3469
|
-
class
|
|
3470
|
+
class lo extends bt {
|
|
3470
3471
|
constructor(t, i) {
|
|
3471
3472
|
super({
|
|
3472
3473
|
supportedPageTurnAnimation: ["fade", "none", "slide"],
|
|
@@ -3502,7 +3503,7 @@ class go extends bt {
|
|
|
3502
3503
|
).subscribe(this.next.bind(this));
|
|
3503
3504
|
}
|
|
3504
3505
|
}
|
|
3505
|
-
class
|
|
3506
|
+
class po {
|
|
3506
3507
|
constructor() {
|
|
3507
3508
|
this._hooks = [], this._hookExecutions = [];
|
|
3508
3509
|
}
|
|
@@ -3578,7 +3579,7 @@ class ke {
|
|
|
3578
3579
|
};
|
|
3579
3580
|
}
|
|
3580
3581
|
}
|
|
3581
|
-
const
|
|
3582
|
+
const ho = () => (e) => e.pipe(
|
|
3582
3583
|
b(({ navigation: t, pagination: i, ...n }) => ({
|
|
3583
3584
|
navigation: {
|
|
3584
3585
|
...t,
|
|
@@ -3586,9 +3587,9 @@ const po = () => (e) => e.pipe(
|
|
|
3586
3587
|
},
|
|
3587
3588
|
...n
|
|
3588
3589
|
}))
|
|
3589
|
-
),
|
|
3590
|
+
), mo = (e, t, i) => e.bridgeEvent.pagination$.pipe(
|
|
3590
3591
|
D(t),
|
|
3591
|
-
|
|
3592
|
+
A(
|
|
3592
3593
|
([n, o]) => n.navigationId === o.id
|
|
3593
3594
|
),
|
|
3594
3595
|
/**
|
|
@@ -3599,14 +3600,14 @@ const po = () => (e) => e.pipe(
|
|
|
3599
3600
|
v(([n, o]) => {
|
|
3600
3601
|
const s = i.spineItemsManager.get(o.spineItem);
|
|
3601
3602
|
return ((s == null ? void 0 : s.isReady$.pipe(H())) ?? w(!1)).pipe(
|
|
3602
|
-
|
|
3603
|
+
A((r) => r),
|
|
3603
3604
|
b(() => ({
|
|
3604
3605
|
pagination: n,
|
|
3605
3606
|
navigation: o
|
|
3606
3607
|
}))
|
|
3607
3608
|
);
|
|
3608
3609
|
}),
|
|
3609
|
-
|
|
3610
|
+
ho(),
|
|
3610
3611
|
E(
|
|
3611
3612
|
(n, o) => n.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
|
|
3612
3613
|
),
|
|
@@ -3618,7 +3619,7 @@ const po = () => (e) => e.pipe(
|
|
|
3618
3619
|
}
|
|
3619
3620
|
})
|
|
3620
3621
|
)
|
|
3621
|
-
),
|
|
3622
|
+
), fo = (e) => e.pipe(
|
|
3622
3623
|
b(([t, i]) => {
|
|
3623
3624
|
const n = {
|
|
3624
3625
|
type: "api",
|
|
@@ -3634,7 +3635,7 @@ const po = () => (e) => e.pipe(
|
|
|
3634
3635
|
navigation: n
|
|
3635
3636
|
};
|
|
3636
3637
|
})
|
|
3637
|
-
),
|
|
3638
|
+
), yo = ({ navigationResolver: e }) => (t) => t.pipe(
|
|
3638
3639
|
b((i) => {
|
|
3639
3640
|
if (i.navigation.cfi) {
|
|
3640
3641
|
const n = e.getNavigationForCfi(
|
|
@@ -3651,16 +3652,16 @@ const po = () => (e) => e.pipe(
|
|
|
3651
3652
|
}
|
|
3652
3653
|
return i;
|
|
3653
3654
|
})
|
|
3654
|
-
),
|
|
3655
|
+
), So = ({
|
|
3655
3656
|
navigation: e,
|
|
3656
3657
|
previousNavigation: t,
|
|
3657
3658
|
settings: i
|
|
3658
|
-
}) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward",
|
|
3659
|
+
}) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward", bo = ({
|
|
3659
3660
|
context: e,
|
|
3660
3661
|
settings: t
|
|
3661
3662
|
}) => (i) => i.pipe(
|
|
3662
3663
|
b(({ navigation: n, previousNavigation: o }) => {
|
|
3663
|
-
const s =
|
|
3664
|
+
const s = So({
|
|
3664
3665
|
navigation: n,
|
|
3665
3666
|
previousNavigation: o,
|
|
3666
3667
|
settings: t
|
|
@@ -3674,7 +3675,7 @@ const po = () => (e) => e.pipe(
|
|
|
3674
3675
|
direction: s
|
|
3675
3676
|
};
|
|
3676
3677
|
})
|
|
3677
|
-
),
|
|
3678
|
+
), Io = ({
|
|
3678
3679
|
spineItemsManager: e,
|
|
3679
3680
|
navigationResolver: t
|
|
3680
3681
|
}) => (i) => i.pipe(
|
|
@@ -3826,7 +3827,7 @@ const po = () => (e) => e.pipe(
|
|
|
3826
3827
|
...a
|
|
3827
3828
|
}))
|
|
3828
3829
|
);
|
|
3829
|
-
},
|
|
3830
|
+
}, wo = ({ navigationResolver: e }) => (t) => t.pipe(
|
|
3830
3831
|
b((i) => {
|
|
3831
3832
|
if (i.navigation.url) {
|
|
3832
3833
|
const n = e.getNavigationForUrl(
|
|
@@ -3844,7 +3845,7 @@ const po = () => (e) => e.pipe(
|
|
|
3844
3845
|
}
|
|
3845
3846
|
return i;
|
|
3846
3847
|
})
|
|
3847
|
-
),
|
|
3848
|
+
), Po = ({
|
|
3848
3849
|
spineLocator: e,
|
|
3849
3850
|
navigation: t,
|
|
3850
3851
|
navigationResolver: i,
|
|
@@ -3870,7 +3871,7 @@ const po = () => (e) => e.pipe(
|
|
|
3870
3871
|
return m.position;
|
|
3871
3872
|
}
|
|
3872
3873
|
const l = t.cfi ?? t.paginationBeginCfi;
|
|
3873
|
-
if (l !== void 0 && !
|
|
3874
|
+
if (l !== void 0 && !zt(l) && (u || d || // when spine item is ready dimensions may have not changed but the position
|
|
3874
3875
|
// of dom elements may have!
|
|
3875
3876
|
r && !t.spineItemIsReady)) {
|
|
3876
3877
|
const m = i.getNavigationForCfi(l);
|
|
@@ -3878,7 +3879,7 @@ const po = () => (e) => e.pipe(
|
|
|
3878
3879
|
return m;
|
|
3879
3880
|
}
|
|
3880
3881
|
if (c && g && t.directionFromLastNavigation === "backward") {
|
|
3881
|
-
const m = new
|
|
3882
|
+
const m = new R({
|
|
3882
3883
|
x: (((p = t.positionInSpineItem) == null ? void 0 : p.x) ?? 0) + u,
|
|
3883
3884
|
y: (((h = t.positionInSpineItem) == null ? void 0 : h.y) ?? 0) + d
|
|
3884
3885
|
});
|
|
@@ -3902,7 +3903,7 @@ const po = () => (e) => e.pipe(
|
|
|
3902
3903
|
return c ? i.getNavigationForPosition(t.position) : i.getNavigationForSpineIndexOrId(s);
|
|
3903
3904
|
})
|
|
3904
3905
|
) : w(new M({ x: 0, y: 0 }));
|
|
3905
|
-
},
|
|
3906
|
+
}, vo = ({
|
|
3906
3907
|
navigation: e,
|
|
3907
3908
|
spineLocator: t,
|
|
3908
3909
|
spineItemsManager: i,
|
|
@@ -3915,7 +3916,7 @@ const po = () => (e) => e.pipe(
|
|
|
3915
3916
|
const { height: c, top: u } = s.getSpineItemSpineLayoutInfo(a), d = t.isPositionWithinSpineItem(
|
|
3916
3917
|
e.position,
|
|
3917
3918
|
a
|
|
3918
|
-
), g = e.positionInSpineItem ?? new
|
|
3919
|
+
), g = e.positionInSpineItem ?? new R({
|
|
3919
3920
|
y: 0,
|
|
3920
3921
|
x: 0
|
|
3921
3922
|
});
|
|
@@ -3926,7 +3927,7 @@ const po = () => (e) => e.pipe(
|
|
|
3926
3927
|
return o.getNavigationForSpineIndexOrId(a);
|
|
3927
3928
|
if (u !== e.spineItemTop) {
|
|
3928
3929
|
const l = t.getSafeSpineItemPositionFromUnsafeSpineItemPosition(
|
|
3929
|
-
e.positionInSpineItem ?? new
|
|
3930
|
+
e.positionInSpineItem ?? new R({
|
|
3930
3931
|
x: 0,
|
|
3931
3932
|
y: 0
|
|
3932
3933
|
}),
|
|
@@ -3938,7 +3939,7 @@ const po = () => (e) => e.pipe(
|
|
|
3938
3939
|
});
|
|
3939
3940
|
}
|
|
3940
3941
|
if (u === e.spineItemTop && c !== e.spineItemHeight) {
|
|
3941
|
-
const l = (e.spineItemHeight ?? g.y) - g.y, p = new
|
|
3942
|
+
const l = (e.spineItemHeight ?? g.y) - g.y, p = new R({
|
|
3942
3943
|
y: e.directionFromLastNavigation === "backward" ? c - l : g.y,
|
|
3943
3944
|
x: e.position.x
|
|
3944
3945
|
});
|
|
@@ -3954,7 +3955,7 @@ const po = () => (e) => e.pipe(
|
|
|
3954
3955
|
}
|
|
3955
3956
|
if (!d) {
|
|
3956
3957
|
if (!(e.position.y < u)) {
|
|
3957
|
-
const m = new
|
|
3958
|
+
const m = new R({
|
|
3958
3959
|
y: c - l,
|
|
3959
3960
|
x: e.position.x
|
|
3960
3961
|
});
|
|
@@ -3971,7 +3972,7 @@ const po = () => (e) => e.pipe(
|
|
|
3971
3972
|
}
|
|
3972
3973
|
}
|
|
3973
3974
|
return e.position;
|
|
3974
|
-
},
|
|
3975
|
+
}, xo = ({
|
|
3975
3976
|
navigation: e,
|
|
3976
3977
|
spineItemsManager: t,
|
|
3977
3978
|
settings: i,
|
|
@@ -3979,7 +3980,7 @@ const po = () => (e) => e.pipe(
|
|
|
3979
3980
|
navigationResolver: o,
|
|
3980
3981
|
spineLayout: s
|
|
3981
3982
|
}) => i.values.computedPageTurnMode === "scrollable" ? w(
|
|
3982
|
-
|
|
3983
|
+
vo({
|
|
3983
3984
|
navigation: e,
|
|
3984
3985
|
spineLocator: n,
|
|
3985
3986
|
navigationResolver: o,
|
|
@@ -3987,7 +3988,7 @@ const po = () => (e) => e.pipe(
|
|
|
3987
3988
|
spineItemsManager: t,
|
|
3988
3989
|
spineLayout: s
|
|
3989
3990
|
})
|
|
3990
|
-
) :
|
|
3991
|
+
) : Po({
|
|
3991
3992
|
navigation: e,
|
|
3992
3993
|
spineLocator: n,
|
|
3993
3994
|
navigationResolver: o,
|
|
@@ -3999,7 +4000,7 @@ const po = () => (e) => e.pipe(
|
|
|
3999
4000
|
context: i,
|
|
4000
4001
|
spine: n
|
|
4001
4002
|
}) => (o) => o.pipe(
|
|
4002
|
-
v((s) =>
|
|
4003
|
+
v((s) => xo({
|
|
4003
4004
|
spineLocator: n.locator,
|
|
4004
4005
|
navigation: s.navigation,
|
|
4005
4006
|
navigationResolver: t,
|
|
@@ -4016,8 +4017,8 @@ const po = () => (e) => e.pipe(
|
|
|
4016
4017
|
}
|
|
4017
4018
|
}))
|
|
4018
4019
|
))
|
|
4019
|
-
),
|
|
4020
|
-
class
|
|
4020
|
+
), $o = "navigation/InternalNavigator", To = j.namespace($o);
|
|
4021
|
+
class Fo extends Y {
|
|
4021
4022
|
constructor(t, i, n, o, s, r, a, c) {
|
|
4022
4023
|
super(), this.settings = t, this.context = i, this.userNavigation$ = n, this.viewportController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isUserLocked$ = c, this.navigationSubject = new k({
|
|
4023
4024
|
animation: !1,
|
|
@@ -4040,22 +4041,22 @@ class To extends Y {
|
|
|
4040
4041
|
), this.locker = new ke();
|
|
4041
4042
|
const u = n.pipe(
|
|
4042
4043
|
D(this.navigationSubject),
|
|
4043
|
-
|
|
4044
|
+
fo,
|
|
4044
4045
|
/**
|
|
4045
4046
|
* Url lookup is heavier so we start with it to fill
|
|
4046
4047
|
* as much information as needed to reduce later lookup
|
|
4047
4048
|
*/
|
|
4048
|
-
|
|
4049
|
+
wo({
|
|
4049
4050
|
navigationResolver: r
|
|
4050
4051
|
}),
|
|
4051
4052
|
/**
|
|
4052
4053
|
* Cfi lookup is heavier so we start with it to fill
|
|
4053
4054
|
* as much information as needed to reduce later lookup
|
|
4054
4055
|
*/
|
|
4055
|
-
|
|
4056
|
+
yo({
|
|
4056
4057
|
navigationResolver: r
|
|
4057
4058
|
}),
|
|
4058
|
-
|
|
4059
|
+
bo({ context: i, settings: t }),
|
|
4059
4060
|
ue({
|
|
4060
4061
|
navigationResolver: r,
|
|
4061
4062
|
settings: t,
|
|
@@ -4072,7 +4073,7 @@ class To extends Y {
|
|
|
4072
4073
|
spine: a
|
|
4073
4074
|
})
|
|
4074
4075
|
).pipe(
|
|
4075
|
-
|
|
4076
|
+
Io({
|
|
4076
4077
|
navigationResolver: r,
|
|
4077
4078
|
spineItemsManager: a.spineItemsManager
|
|
4078
4079
|
}),
|
|
@@ -4098,11 +4099,11 @@ class To extends Y {
|
|
|
4098
4099
|
V()
|
|
4099
4100
|
), d = u.pipe(
|
|
4100
4101
|
D(c),
|
|
4101
|
-
|
|
4102
|
+
A(([, f]) => f),
|
|
4102
4103
|
v(([f]) => {
|
|
4103
4104
|
const y = this.locker.lock();
|
|
4104
4105
|
return c.pipe(
|
|
4105
|
-
|
|
4106
|
+
A((I) => !I),
|
|
4106
4107
|
H(),
|
|
4107
4108
|
b(
|
|
4108
4109
|
() => ({
|
|
@@ -4124,7 +4125,7 @@ class To extends Y {
|
|
|
4124
4125
|
v(() => w(null).pipe(
|
|
4125
4126
|
v(
|
|
4126
4127
|
() => c.pipe(
|
|
4127
|
-
|
|
4128
|
+
A((f) => !f),
|
|
4128
4129
|
H()
|
|
4129
4130
|
)
|
|
4130
4131
|
),
|
|
@@ -4188,7 +4189,7 @@ class To extends Y {
|
|
|
4188
4189
|
}),
|
|
4189
4190
|
b(({ navigation: f }) => f),
|
|
4190
4191
|
V()
|
|
4191
|
-
), p =
|
|
4192
|
+
), p = mo(
|
|
4192
4193
|
i,
|
|
4193
4194
|
this.navigationSubject,
|
|
4194
4195
|
a
|
|
@@ -4198,7 +4199,7 @@ class To extends Y {
|
|
|
4198
4199
|
p
|
|
4199
4200
|
), m = (f) => f.pipe(
|
|
4200
4201
|
T(([y, I]) => {
|
|
4201
|
-
|
|
4202
|
+
To.info(
|
|
4202
4203
|
`navigation updated from ${y.meta.triggeredBy} of type ${y.type}`,
|
|
4203
4204
|
{
|
|
4204
4205
|
previousNavigation: I,
|
|
@@ -4262,8 +4263,8 @@ const We = ({
|
|
|
4262
4263
|
scrollOffset: t
|
|
4263
4264
|
})
|
|
4264
4265
|
});
|
|
4265
|
-
},
|
|
4266
|
-
class
|
|
4266
|
+
}, Lo = 500;
|
|
4267
|
+
class Mo extends Y {
|
|
4267
4268
|
constructor(t, i, n, o, s) {
|
|
4268
4269
|
super(), this.settings = t, this.context = i, this.spine = n, this.scrollNavigationController = o, this.locker = s, this.navigationSubject = new U(), this.navigation$ = this.navigationSubject.asObservable();
|
|
4269
4270
|
const r = this.scrollNavigationController.userScroll$.pipe(
|
|
@@ -4274,7 +4275,7 @@ class Lo extends Y {
|
|
|
4274
4275
|
w(a)
|
|
4275
4276
|
).pipe(
|
|
4276
4277
|
St(
|
|
4277
|
-
|
|
4278
|
+
Lo,
|
|
4278
4279
|
at
|
|
4279
4280
|
),
|
|
4280
4281
|
H(),
|
|
@@ -4302,17 +4303,17 @@ class Lo extends Y {
|
|
|
4302
4303
|
x(r).pipe(F(this.destroy$)).subscribe();
|
|
4303
4304
|
}
|
|
4304
4305
|
}
|
|
4305
|
-
const
|
|
4306
|
+
const Co = (e) => ({
|
|
4306
4307
|
x: -e.x,
|
|
4307
4308
|
y: -e.y
|
|
4308
|
-
}),
|
|
4309
|
+
}), Ro = (e) => e instanceof DOMMatrix ? new M({
|
|
4309
4310
|
x: -e.e,
|
|
4310
4311
|
y: -e.f
|
|
4311
4312
|
}) : new M({
|
|
4312
4313
|
x: -e.x,
|
|
4313
4314
|
y: -e.y
|
|
4314
|
-
}),
|
|
4315
|
-
class
|
|
4315
|
+
}), Ao = "navigation/ViewportNavigator", le = j.namespace(Ao);
|
|
4316
|
+
class Oo extends Y {
|
|
4316
4317
|
constructor(t, i, n, o, s) {
|
|
4317
4318
|
super(), this.settings = t, this.hookManager = i, this.context = n, this.spine = o, this.viewport = s, this.navigateSubject = new U(), this.element$ = new k(
|
|
4318
4319
|
document.createElement("div")
|
|
@@ -4423,7 +4424,7 @@ class Ao extends Y {
|
|
|
4423
4424
|
* for remark about flicker / fonts smoothing
|
|
4424
4425
|
*/
|
|
4425
4426
|
setViewportPosition(t) {
|
|
4426
|
-
const i = this.element$.getValue(), n =
|
|
4427
|
+
const i = this.element$.getValue(), n = Co(t);
|
|
4427
4428
|
i.style.transform = `translate(${n.x}px, ${n.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
4428
4429
|
}
|
|
4429
4430
|
navigate(t) {
|
|
@@ -4438,10 +4439,10 @@ class Ao extends Y {
|
|
|
4438
4439
|
if (!n || n === "none")
|
|
4439
4440
|
return new M({ x: 0, y: 0 });
|
|
4440
4441
|
const o = new DOMMatrix(n);
|
|
4441
|
-
return
|
|
4442
|
+
return Ro(o);
|
|
4442
4443
|
}
|
|
4443
4444
|
}
|
|
4444
|
-
class
|
|
4445
|
+
class Do extends bt {
|
|
4445
4446
|
constructor(t, i, n, o, s) {
|
|
4446
4447
|
super({
|
|
4447
4448
|
element: void 0
|
|
@@ -4451,7 +4452,7 @@ class Oo extends bt {
|
|
|
4451
4452
|
left: g.x,
|
|
4452
4453
|
top: g.y,
|
|
4453
4454
|
behavior: "instant"
|
|
4454
|
-
}),
|
|
4455
|
+
}), Kt(1).pipe(
|
|
4455
4456
|
T(() => {
|
|
4456
4457
|
this.scrollingSubject.next(!1);
|
|
4457
4458
|
}),
|
|
@@ -4459,7 +4460,7 @@ class Oo extends bt {
|
|
|
4459
4460
|
).subscribe(), this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
4460
4461
|
};
|
|
4461
4462
|
const r = this.context.pipe(
|
|
4462
|
-
|
|
4463
|
+
Xt(["rootElement"]),
|
|
4463
4464
|
T(({ rootElement: g }) => {
|
|
4464
4465
|
if (!g) return;
|
|
4465
4466
|
const l = document.createElement("div");
|
|
@@ -4490,7 +4491,7 @@ class Oo extends bt {
|
|
|
4490
4491
|
o.spineItemsObserver.itemResize$
|
|
4491
4492
|
).pipe(
|
|
4492
4493
|
v(
|
|
4493
|
-
() =>
|
|
4494
|
+
() => Kt(10).pipe(
|
|
4494
4495
|
b(() => !1),
|
|
4495
4496
|
nt(!0)
|
|
4496
4497
|
)
|
|
@@ -4507,13 +4508,13 @@ class Oo extends bt {
|
|
|
4507
4508
|
et(1)
|
|
4508
4509
|
);
|
|
4509
4510
|
this.userScroll$ = this.watch("element").pipe(
|
|
4510
|
-
|
|
4511
|
+
A(ct),
|
|
4511
4512
|
v(
|
|
4512
4513
|
(g) => i.watch(["computedPageTurnMode"]).pipe(
|
|
4513
4514
|
v(
|
|
4514
4515
|
({ computedPageTurnMode: l }) => l === "controlled" ? gt : G(g, "scroll").pipe(
|
|
4515
4516
|
D(d),
|
|
4516
|
-
|
|
4517
|
+
A(
|
|
4517
4518
|
([, p]) => !p
|
|
4518
4519
|
),
|
|
4519
4520
|
b(([p]) => p)
|
|
@@ -4545,10 +4546,10 @@ class Oo extends bt {
|
|
|
4545
4546
|
const pe = (e, t, i) => {
|
|
4546
4547
|
const n = i - e, o = i * (t * e) / (i || 1);
|
|
4547
4548
|
return Math.max(0, Math.min(n, o));
|
|
4548
|
-
},
|
|
4549
|
-
const n =
|
|
4549
|
+
}, Ut = (e, t) => (t || 0) === 0 || (e || 0) === 0 ? 1 : Math.floor(Math.max(1, e / t)), xt = (e, t, i) => {
|
|
4550
|
+
const n = Ut(i, t), o = [...Array(n)].map((s, r) => r * t);
|
|
4550
4551
|
return e >= n * t ? o[o.length - 1] || 0 : o.find((s) => e < s + t) || 0;
|
|
4551
|
-
},
|
|
4552
|
+
}, Gt = ({
|
|
4552
4553
|
itemHeight: e,
|
|
4553
4554
|
itemWidth: t,
|
|
4554
4555
|
isUsingVerticalWriting: i,
|
|
@@ -4556,11 +4557,11 @@ const pe = (e, t, i) => {
|
|
|
4556
4557
|
context: o
|
|
4557
4558
|
}) => {
|
|
4558
4559
|
const { pageTurnDirection: s, pageTurnMode: r } = n.values;
|
|
4559
|
-
return s === "vertical" && r === "scrollable" ? 1 : i || s === "vertical" ?
|
|
4560
|
+
return s === "vertical" && r === "scrollable" ? 1 : i || s === "vertical" ? Ut(
|
|
4560
4561
|
e,
|
|
4561
4562
|
o.getPageSize().height
|
|
4562
|
-
) :
|
|
4563
|
-
},
|
|
4563
|
+
) : Ut(t, o.getPageSize().width);
|
|
4564
|
+
}, Ht = ({
|
|
4564
4565
|
pageIndex: e,
|
|
4565
4566
|
itemLayout: t,
|
|
4566
4567
|
context: i,
|
|
@@ -4572,7 +4573,7 @@ const pe = (e, t, i) => {
|
|
|
4572
4573
|
e,
|
|
4573
4574
|
t.height
|
|
4574
4575
|
);
|
|
4575
|
-
return new
|
|
4576
|
+
return new R({
|
|
4576
4577
|
x: 0,
|
|
4577
4578
|
y: s
|
|
4578
4579
|
});
|
|
@@ -4582,20 +4583,20 @@ const pe = (e, t, i) => {
|
|
|
4582
4583
|
e,
|
|
4583
4584
|
t.width
|
|
4584
4585
|
);
|
|
4585
|
-
return i.isRTL() ? new
|
|
4586
|
+
return i.isRTL() ? new R({
|
|
4586
4587
|
x: t.width - o - i.getPageSize().width,
|
|
4587
4588
|
y: 0
|
|
4588
|
-
}) : new
|
|
4589
|
+
}) : new R({
|
|
4589
4590
|
x: o,
|
|
4590
4591
|
y: 0
|
|
4591
4592
|
});
|
|
4592
|
-
},
|
|
4593
|
+
}, No = ({
|
|
4593
4594
|
context: e,
|
|
4594
4595
|
isUsingVerticalWriting: t,
|
|
4595
4596
|
settings: i,
|
|
4596
4597
|
itemLayout: n
|
|
4597
4598
|
}) => {
|
|
4598
|
-
const o =
|
|
4599
|
+
const o = Gt({
|
|
4599
4600
|
context: e,
|
|
4600
4601
|
isUsingVerticalWriting: t,
|
|
4601
4602
|
itemHeight: n.height,
|
|
@@ -4603,7 +4604,7 @@ const pe = (e, t, i) => {
|
|
|
4603
4604
|
settings: i
|
|
4604
4605
|
});
|
|
4605
4606
|
return new Array(o).fill(void 0).map(
|
|
4606
|
-
(s, r) =>
|
|
4607
|
+
(s, r) => Ht({
|
|
4607
4608
|
context: e,
|
|
4608
4609
|
isUsingVerticalWriting: t,
|
|
4609
4610
|
itemLayout: n,
|
|
@@ -4618,7 +4619,7 @@ const pe = (e, t, i) => {
|
|
|
4618
4619
|
itemWidth: u,
|
|
4619
4620
|
itemHeight: d,
|
|
4620
4621
|
spineItemPosition: g
|
|
4621
|
-
}) => new
|
|
4622
|
+
}) => new R({
|
|
4622
4623
|
x: Math.min(u, Math.max(0, g.x)),
|
|
4623
4624
|
y: Math.min(d, Math.max(0, g.y))
|
|
4624
4625
|
}), n = ({
|
|
@@ -4631,7 +4632,7 @@ const pe = (e, t, i) => {
|
|
|
4631
4632
|
spineItemPosition: g,
|
|
4632
4633
|
itemHeight: d,
|
|
4633
4634
|
itemWidth: u
|
|
4634
|
-
}), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f =
|
|
4635
|
+
}), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f = Gt({
|
|
4635
4636
|
isUsingVerticalWriting: l,
|
|
4636
4637
|
itemHeight: d,
|
|
4637
4638
|
itemWidth: u,
|
|
@@ -4645,7 +4646,7 @@ const pe = (e, t, i) => {
|
|
|
4645
4646
|
if ((u == null ? void 0 : u.nodeName) === "img" || (u == null ? void 0 : u.textContent) === "" && u.nodeType === Node.ELEMENT_NODE)
|
|
4646
4647
|
l = u.getBoundingClientRect().x;
|
|
4647
4648
|
else if (u) {
|
|
4648
|
-
const S = u ?
|
|
4649
|
+
const S = u ? xi(u, d) : void 0;
|
|
4649
4650
|
l = (S == null ? void 0 : S.getBoundingClientRect().x) || l;
|
|
4650
4651
|
}
|
|
4651
4652
|
const p = ((m = g.layout.layoutInfo) == null ? void 0 : m.width) || 0, h = e.getPageSize().width;
|
|
@@ -4655,14 +4656,14 @@ const pe = (e, t, i) => {
|
|
|
4655
4656
|
h,
|
|
4656
4657
|
p
|
|
4657
4658
|
);
|
|
4658
|
-
return new
|
|
4659
|
+
return new R({ x: S, y: 0 });
|
|
4659
4660
|
}
|
|
4660
4661
|
}, s = (u, d) => {
|
|
4661
4662
|
var p, h;
|
|
4662
4663
|
const g = e.getPageSize(), l = (p = d.renderer) == null ? void 0 : p.getDocumentFrame();
|
|
4663
4664
|
if (l && ((h = l == null ? void 0 : l.contentWindow) != null && h.document) && // very important because it is being used by next functions
|
|
4664
4665
|
l.contentWindow.document.body !== null) {
|
|
4665
|
-
const { x: m, y: S } =
|
|
4666
|
+
const { x: m, y: S } = Ht({
|
|
4666
4667
|
pageIndex: u,
|
|
4667
4668
|
itemLayout: d.layout.layoutInfo,
|
|
4668
4669
|
context: e,
|
|
@@ -4672,14 +4673,14 @@ const pe = (e, t, i) => {
|
|
|
4672
4673
|
right: m + g.width,
|
|
4673
4674
|
bottom: S + g.height
|
|
4674
4675
|
};
|
|
4675
|
-
return
|
|
4676
|
+
return Pi(
|
|
4676
4677
|
l.contentWindow.document,
|
|
4677
4678
|
f
|
|
4678
4679
|
);
|
|
4679
4680
|
}
|
|
4680
4681
|
}, r = (u, d) => {
|
|
4681
4682
|
const { width: g, height: l } = d.layout.layoutInfo;
|
|
4682
|
-
return new
|
|
4683
|
+
return new R({
|
|
4683
4684
|
x: xt(
|
|
4684
4685
|
u.x,
|
|
4685
4686
|
e.getPageSize().width,
|
|
@@ -4711,7 +4712,7 @@ const pe = (e, t, i) => {
|
|
|
4711
4712
|
getSpineItemPositionFromPageIndex: ({
|
|
4712
4713
|
pageIndex: u,
|
|
4713
4714
|
spineItem: d
|
|
4714
|
-
}) =>
|
|
4715
|
+
}) => Ht({
|
|
4715
4716
|
context: e,
|
|
4716
4717
|
isUsingVerticalWriting: !!d.isUsingVerticalWriting(),
|
|
4717
4718
|
itemLayout: d.layout.layoutInfo,
|
|
@@ -4721,14 +4722,14 @@ const pe = (e, t, i) => {
|
|
|
4721
4722
|
getSpineItemPageIndexFromNode: a,
|
|
4722
4723
|
getSpineItemClosestPositionFromUnsafePosition: r,
|
|
4723
4724
|
getFirstNodeOrRangeAtPage: s,
|
|
4724
|
-
getSpineItemPagesPosition: ({ item: u }) =>
|
|
4725
|
+
getSpineItemPagesPosition: ({ item: u }) => No({
|
|
4725
4726
|
context: e,
|
|
4726
4727
|
isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
|
|
4727
4728
|
settings: t,
|
|
4728
4729
|
itemLayout: u.layout.layoutInfo
|
|
4729
4730
|
})
|
|
4730
4731
|
};
|
|
4731
|
-
},
|
|
4732
|
+
}, Vo = ({
|
|
4732
4733
|
context: e,
|
|
4733
4734
|
settings: t
|
|
4734
4735
|
}) => {
|
|
@@ -4749,7 +4750,7 @@ const pe = (e, t, i) => {
|
|
|
4749
4750
|
a,
|
|
4750
4751
|
c,
|
|
4751
4752
|
r
|
|
4752
|
-
) || new
|
|
4753
|
+
) || new R({ x: 0, y: 0 })
|
|
4753
4754
|
};
|
|
4754
4755
|
}, it = ({
|
|
4755
4756
|
position: { x: e, y: t },
|
|
@@ -4781,7 +4782,7 @@ const pe = (e, t, i) => {
|
|
|
4781
4782
|
x: Math.min(Math.max(0, e.x), d),
|
|
4782
4783
|
y: u
|
|
4783
4784
|
});
|
|
4784
|
-
},
|
|
4785
|
+
}, Et = ({
|
|
4785
4786
|
viewportPosition: e,
|
|
4786
4787
|
spineLocator: t,
|
|
4787
4788
|
context: i,
|
|
@@ -4806,7 +4807,7 @@ const pe = (e, t, i) => {
|
|
|
4806
4807
|
});
|
|
4807
4808
|
}
|
|
4808
4809
|
return new M({ x: 0, y: 0 });
|
|
4809
|
-
},
|
|
4810
|
+
}, jo = ({
|
|
4810
4811
|
pageIndex: e,
|
|
4811
4812
|
spineItemsManager: t,
|
|
4812
4813
|
spineItemId: i,
|
|
@@ -4817,7 +4818,7 @@ const pe = (e, t, i) => {
|
|
|
4817
4818
|
const r = t.get(i);
|
|
4818
4819
|
if (!r) {
|
|
4819
4820
|
const u = e * n.getPageSize().width;
|
|
4820
|
-
return
|
|
4821
|
+
return Et({
|
|
4821
4822
|
viewportPosition: new M({ x: u, y: 0 }),
|
|
4822
4823
|
context: n,
|
|
4823
4824
|
spineItemNavigationResolver: s,
|
|
@@ -4836,7 +4837,7 @@ const pe = (e, t, i) => {
|
|
|
4836
4837
|
pageSizeWidth: n.getPageSize().width,
|
|
4837
4838
|
visibleAreaRectWidth: n.state.visibleAreaRect.width
|
|
4838
4839
|
});
|
|
4839
|
-
},
|
|
4840
|
+
}, ko = ({
|
|
4840
4841
|
anchor: e,
|
|
4841
4842
|
spineItem: t,
|
|
4842
4843
|
context: i
|
|
@@ -4848,22 +4849,22 @@ const pe = (e, t, i) => {
|
|
|
4848
4849
|
o,
|
|
4849
4850
|
n
|
|
4850
4851
|
);
|
|
4851
|
-
},
|
|
4852
|
+
}, Wo = ({
|
|
4852
4853
|
anchor: e,
|
|
4853
4854
|
context: t,
|
|
4854
4855
|
spineItem: i,
|
|
4855
4856
|
spineLocator: n
|
|
4856
4857
|
}) => {
|
|
4857
|
-
const o =
|
|
4858
|
+
const o = ko({
|
|
4858
4859
|
anchor: e,
|
|
4859
4860
|
spineItem: i,
|
|
4860
4861
|
context: t
|
|
4861
4862
|
});
|
|
4862
4863
|
return n.getSpinePositionFromSpineItemPosition({
|
|
4863
|
-
spineItemPosition: new
|
|
4864
|
+
spineItemPosition: new R({ x: o, y: 0 }),
|
|
4864
4865
|
spineItem: i
|
|
4865
4866
|
});
|
|
4866
|
-
},
|
|
4867
|
+
}, zo = ({
|
|
4867
4868
|
anchor: e,
|
|
4868
4869
|
spineItem: t,
|
|
4869
4870
|
spineLocator: i,
|
|
@@ -4871,7 +4872,7 @@ const pe = (e, t, i) => {
|
|
|
4871
4872
|
pageSizeWidth: o,
|
|
4872
4873
|
visibleAreaRectWidth: s
|
|
4873
4874
|
}) => {
|
|
4874
|
-
const r =
|
|
4875
|
+
const r = Wo({
|
|
4875
4876
|
anchor: e,
|
|
4876
4877
|
context: n,
|
|
4877
4878
|
spineItem: t,
|
|
@@ -4882,7 +4883,7 @@ const pe = (e, t, i) => {
|
|
|
4882
4883
|
pageSizeWidth: o,
|
|
4883
4884
|
visibleAreaRectWidth: s
|
|
4884
4885
|
});
|
|
4885
|
-
},
|
|
4886
|
+
}, Uo = ({
|
|
4886
4887
|
context: e,
|
|
4887
4888
|
spineItemsManager: t,
|
|
4888
4889
|
spineLocator: i,
|
|
@@ -4898,7 +4899,7 @@ const pe = (e, t, i) => {
|
|
|
4898
4899
|
if (u) {
|
|
4899
4900
|
const d = t.get(u.id);
|
|
4900
4901
|
if (d) {
|
|
4901
|
-
const g =
|
|
4902
|
+
const g = zo({
|
|
4902
4903
|
anchor: a.hash,
|
|
4903
4904
|
spineItem: d,
|
|
4904
4905
|
context: e,
|
|
@@ -4921,7 +4922,7 @@ const pe = (e, t, i) => {
|
|
|
4921
4922
|
console.error(a);
|
|
4922
4923
|
return;
|
|
4923
4924
|
}
|
|
4924
|
-
},
|
|
4925
|
+
}, Ho = ({
|
|
4925
4926
|
spineItem: e,
|
|
4926
4927
|
spineItemPosition: t,
|
|
4927
4928
|
spineLocator: i,
|
|
@@ -4940,16 +4941,16 @@ const pe = (e, t, i) => {
|
|
|
4940
4941
|
pageSizeWidth: o.getPageSize().width,
|
|
4941
4942
|
visibleAreaRectWidth: o.state.visibleAreaRect.width
|
|
4942
4943
|
});
|
|
4943
|
-
},
|
|
4944
|
+
}, Eo = "spineNavigator", Bo = ({
|
|
4944
4945
|
context: e,
|
|
4945
4946
|
spineItemsManager: t,
|
|
4946
4947
|
locator: i,
|
|
4947
4948
|
settings: n,
|
|
4948
4949
|
spineLayout: o
|
|
4949
4950
|
}) => {
|
|
4950
|
-
const s =
|
|
4951
|
+
const s = Vo({ context: e, settings: n });
|
|
4951
4952
|
return {
|
|
4952
|
-
getNavigationForUrl: (l) =>
|
|
4953
|
+
getNavigationForUrl: (l) => Uo({
|
|
4953
4954
|
context: e,
|
|
4954
4955
|
spineItemsManager: t,
|
|
4955
4956
|
spineLocator: i,
|
|
@@ -4957,14 +4958,14 @@ const pe = (e, t, i) => {
|
|
|
4957
4958
|
pageSizeWidth: e.getPageSize().width,
|
|
4958
4959
|
visibleAreaRectWidth: e.state.visibleAreaRect.width
|
|
4959
4960
|
}),
|
|
4960
|
-
getNavigationForSpineItemPage: (l) =>
|
|
4961
|
+
getNavigationForSpineItemPage: (l) => jo({
|
|
4961
4962
|
...l,
|
|
4962
4963
|
context: e,
|
|
4963
4964
|
spineItemsManager: t,
|
|
4964
4965
|
spineItemNavigationResolver: s,
|
|
4965
4966
|
spineLocator: i
|
|
4966
4967
|
}),
|
|
4967
|
-
getNavigationFromSpineItemPosition: (l) =>
|
|
4968
|
+
getNavigationFromSpineItemPosition: (l) => Ho({
|
|
4968
4969
|
...l,
|
|
4969
4970
|
spineItemLocator: i.spineItemLocator,
|
|
4970
4971
|
spineLocator: i,
|
|
@@ -4976,10 +4977,10 @@ const pe = (e, t, i) => {
|
|
|
4976
4977
|
spineItemsManager: t
|
|
4977
4978
|
}) || {};
|
|
4978
4979
|
if (!p) {
|
|
4979
|
-
j.warn(
|
|
4980
|
+
j.warn(Eo, `unable to detect item id from cfi ${l}`);
|
|
4980
4981
|
return;
|
|
4981
4982
|
}
|
|
4982
|
-
const S = h ? s.getNavigationFromNode(p, h, m) : new
|
|
4983
|
+
const S = h ? s.getNavigationFromNode(p, h, m) : new R({ x: 0, y: 0 }), f = i.getSpinePositionFromSpineItemPosition({
|
|
4983
4984
|
spineItemPosition: S,
|
|
4984
4985
|
spineItem: p
|
|
4985
4986
|
});
|
|
@@ -5012,7 +5013,7 @@ const pe = (e, t, i) => {
|
|
|
5012
5013
|
}
|
|
5013
5014
|
return new M({ x: 0, y: 0 });
|
|
5014
5015
|
},
|
|
5015
|
-
getNavigationForPosition: (l) =>
|
|
5016
|
+
getNavigationForPosition: (l) => Et({
|
|
5016
5017
|
viewportPosition: l,
|
|
5017
5018
|
context: e,
|
|
5018
5019
|
spineItemNavigationResolver: s,
|
|
@@ -5030,7 +5031,7 @@ const pe = (e, t, i) => {
|
|
|
5030
5031
|
spineItemsManager: t,
|
|
5031
5032
|
spineLayout: o
|
|
5032
5033
|
});
|
|
5033
|
-
return
|
|
5034
|
+
return Et({
|
|
5034
5035
|
context: e,
|
|
5035
5036
|
spineItemNavigationResolver: s,
|
|
5036
5037
|
spineLocator: i,
|
|
@@ -5054,7 +5055,7 @@ const pe = (e, t, i) => {
|
|
|
5054
5055
|
}),
|
|
5055
5056
|
spineItemNavigator: s
|
|
5056
5057
|
};
|
|
5057
|
-
},
|
|
5058
|
+
}, _o = ({
|
|
5058
5059
|
spineItemsManager: e,
|
|
5059
5060
|
context: t,
|
|
5060
5061
|
hookManager: i,
|
|
@@ -5062,25 +5063,25 @@ const pe = (e, t, i) => {
|
|
|
5062
5063
|
settings: o,
|
|
5063
5064
|
viewport: s
|
|
5064
5065
|
}) => {
|
|
5065
|
-
const r = new U(), a = new ke(), c =
|
|
5066
|
+
const r = new U(), a = new ke(), c = Bo({
|
|
5066
5067
|
context: t,
|
|
5067
5068
|
settings: o,
|
|
5068
5069
|
spineItemsManager: e,
|
|
5069
5070
|
locator: n.locator,
|
|
5070
5071
|
spineLayout: n.spineLayout
|
|
5071
|
-
}), u = new
|
|
5072
|
+
}), u = new Oo(
|
|
5072
5073
|
o,
|
|
5073
5074
|
i,
|
|
5074
5075
|
t,
|
|
5075
5076
|
n,
|
|
5076
5077
|
s
|
|
5077
|
-
), d = new
|
|
5078
|
+
), d = new Do(
|
|
5078
5079
|
s,
|
|
5079
5080
|
o,
|
|
5080
5081
|
i,
|
|
5081
5082
|
n,
|
|
5082
5083
|
t
|
|
5083
|
-
), g = new
|
|
5084
|
+
), g = new Mo(
|
|
5084
5085
|
o,
|
|
5085
5086
|
t,
|
|
5086
5087
|
n,
|
|
@@ -5089,7 +5090,7 @@ const pe = (e, t, i) => {
|
|
|
5089
5090
|
), l = x(
|
|
5090
5091
|
r,
|
|
5091
5092
|
g.navigation$
|
|
5092
|
-
), p = new
|
|
5093
|
+
), p = new Fo(
|
|
5093
5094
|
o,
|
|
5094
5095
|
t,
|
|
5095
5096
|
l,
|
|
@@ -5128,7 +5129,7 @@ const pe = (e, t, i) => {
|
|
|
5128
5129
|
navigation$: p.navigation$
|
|
5129
5130
|
};
|
|
5130
5131
|
};
|
|
5131
|
-
class
|
|
5132
|
+
class Xo extends bt {
|
|
5132
5133
|
constructor(t, i) {
|
|
5133
5134
|
super({
|
|
5134
5135
|
beginPageIndexInSpineItem: void 0,
|
|
@@ -5146,7 +5147,7 @@ class _o extends bt {
|
|
|
5146
5147
|
this.mergeCompare(t);
|
|
5147
5148
|
}
|
|
5148
5149
|
}
|
|
5149
|
-
class
|
|
5150
|
+
class qo extends Y {
|
|
5150
5151
|
constructor(t, i, n, o, s) {
|
|
5151
5152
|
super(), this.context = t, this.pagination = i, this.spineItemsManager = n, this.spine = o, this.spineItemLocator = s;
|
|
5152
5153
|
const r = x(
|
|
@@ -5180,7 +5181,7 @@ class Xo extends Y {
|
|
|
5180
5181
|
}) ?? {}, { endPageIndex: I = 0 } = c({
|
|
5181
5182
|
spineItem: m,
|
|
5182
5183
|
position: d
|
|
5183
|
-
}) ?? {}, P = S === void 0 ||
|
|
5184
|
+
}) ?? {}, P = S === void 0 || zt(S) || g.beginSpineItemIndex !== l, $ = g.endSpineItemIndex !== p || f === void 0 || zt(f), L = P ? mt(h.item) : S, C = $ ? mt(m.item) : f, O = h.numberOfPages, B = m.numberOfPages;
|
|
5184
5185
|
this.pagination.update({
|
|
5185
5186
|
beginCfi: L,
|
|
5186
5187
|
beginNumberOfPagesInSpineItem: O,
|
|
@@ -5224,7 +5225,7 @@ class Xo extends Y {
|
|
|
5224
5225
|
x(r, a).pipe(F(this.destroy$)).subscribe();
|
|
5225
5226
|
}
|
|
5226
5227
|
}
|
|
5227
|
-
class
|
|
5228
|
+
class Yo extends Y {
|
|
5228
5229
|
constructor(t) {
|
|
5229
5230
|
super();
|
|
5230
5231
|
const i = {
|
|
@@ -5269,7 +5270,7 @@ class qo extends Y {
|
|
|
5269
5270
|
super.destroy(), this.outputSettingsUpdateSubject.complete();
|
|
5270
5271
|
}
|
|
5271
5272
|
}
|
|
5272
|
-
class
|
|
5273
|
+
class Zo extends Yo {
|
|
5273
5274
|
constructor(t, i) {
|
|
5274
5275
|
super(t), this.context = i;
|
|
5275
5276
|
const n = q([
|
|
@@ -5314,7 +5315,7 @@ class Yo extends qo {
|
|
|
5314
5315
|
};
|
|
5315
5316
|
}
|
|
5316
5317
|
}
|
|
5317
|
-
class
|
|
5318
|
+
class Go extends Y {
|
|
5318
5319
|
constructor(t, i, n, o, s, r) {
|
|
5319
5320
|
super(), this.item = t, this.containerElement = i, this.context = n, this.hookManager = o, this.renderer = s, this.settings = r, this.layoutTriggerSubject = new U(), this.lastLayout = null, this.applyDimsAfterLayout = ({
|
|
5320
5321
|
blankPagePosition: a,
|
|
@@ -5345,7 +5346,7 @@ class Zo extends Y {
|
|
|
5345
5346
|
}), { width: y, height: I };
|
|
5346
5347
|
})
|
|
5347
5348
|
), this.layout = (a) => {
|
|
5348
|
-
const c =
|
|
5349
|
+
const c = Di(this.layout$.pipe(H()));
|
|
5349
5350
|
return this.layoutTriggerSubject.next(a), c();
|
|
5350
5351
|
}, this.adjustPositionOfElement = ({
|
|
5351
5352
|
right: a,
|
|
@@ -5382,7 +5383,7 @@ class Zo extends Y {
|
|
|
5382
5383
|
}),
|
|
5383
5384
|
V()
|
|
5384
5385
|
), this.layout$ = this.layoutProcess$.pipe(
|
|
5385
|
-
|
|
5386
|
+
A((a) => a.type === "end"),
|
|
5386
5387
|
b((a) => a.data),
|
|
5387
5388
|
V()
|
|
5388
5389
|
);
|
|
@@ -5400,21 +5401,21 @@ class Zo extends Y {
|
|
|
5400
5401
|
};
|
|
5401
5402
|
}
|
|
5402
5403
|
}
|
|
5403
|
-
class
|
|
5404
|
+
class Jo extends ht {
|
|
5404
5405
|
onUnload() {
|
|
5405
|
-
return
|
|
5406
|
+
return Q;
|
|
5406
5407
|
}
|
|
5407
5408
|
onCreateDocument() {
|
|
5408
5409
|
return w(document.createElement("div"));
|
|
5409
5410
|
}
|
|
5410
5411
|
onLoadDocument() {
|
|
5411
|
-
return
|
|
5412
|
+
return Q;
|
|
5412
5413
|
}
|
|
5413
5414
|
onLayout() {
|
|
5414
5415
|
return w(void 0);
|
|
5415
5416
|
}
|
|
5416
5417
|
onRenderHeadless() {
|
|
5417
|
-
return
|
|
5418
|
+
return Q;
|
|
5418
5419
|
}
|
|
5419
5420
|
getDocumentFrame() {
|
|
5420
5421
|
}
|
|
@@ -5436,13 +5437,13 @@ class Ue extends Y {
|
|
|
5436
5437
|
}, this.isUsingVerticalWriting = () => {
|
|
5437
5438
|
var g;
|
|
5438
5439
|
return !!((g = this.renderer.writingMode) != null && g.startsWith("vertical"));
|
|
5439
|
-
}, this.containerElement =
|
|
5440
|
+
}, this.containerElement = Ko(
|
|
5440
5441
|
i,
|
|
5441
5442
|
t,
|
|
5442
5443
|
s
|
|
5443
5444
|
), i.appendChild(this.containerElement);
|
|
5444
5445
|
const a = (d = (u = this.settings.values).getRenderer) == null ? void 0 : d.call(u, t);
|
|
5445
|
-
this.resourcesHandler = new
|
|
5446
|
+
this.resourcesHandler = new qt(t, this.settings);
|
|
5446
5447
|
const c = {
|
|
5447
5448
|
context: n,
|
|
5448
5449
|
settings: o,
|
|
@@ -5451,7 +5452,7 @@ class Ue extends Y {
|
|
|
5451
5452
|
containerElement: this.containerElement,
|
|
5452
5453
|
resourcesHandler: this.resourcesHandler
|
|
5453
5454
|
};
|
|
5454
|
-
this.renderer = a ? a(c) : new
|
|
5455
|
+
this.renderer = a ? a(c) : new Jo(c), this.layout = new Go(
|
|
5455
5456
|
t,
|
|
5456
5457
|
this.containerElement,
|
|
5457
5458
|
n,
|
|
@@ -5514,7 +5515,7 @@ class Ue extends Y {
|
|
|
5514
5515
|
return this.renderer.renditionLayout;
|
|
5515
5516
|
}
|
|
5516
5517
|
get numberOfPages() {
|
|
5517
|
-
return
|
|
5518
|
+
return Gt({
|
|
5518
5519
|
isUsingVerticalWriting: !!this.isUsingVerticalWriting(),
|
|
5519
5520
|
itemHeight: this.layout.layoutInfo.height,
|
|
5520
5521
|
itemWidth: this.layout.layoutInfo.width,
|
|
@@ -5523,14 +5524,14 @@ class Ue extends Y {
|
|
|
5523
5524
|
});
|
|
5524
5525
|
}
|
|
5525
5526
|
}
|
|
5526
|
-
const
|
|
5527
|
+
const Ko = (e, t, i) => {
|
|
5527
5528
|
const n = e.ownerDocument.createElement("div");
|
|
5528
5529
|
return n.classList.add("spineItem"), n.classList.add(`spineItem-${t.renditionLayout ?? "reflowable"}`), n.style.cssText = `
|
|
5529
5530
|
position: absolute;
|
|
5530
5531
|
overflow: hidden;
|
|
5531
5532
|
`, n.dataset.isReady = "false", i.execute("item.onBeforeContainerCreated", void 0, { element: n }), n;
|
|
5532
5533
|
};
|
|
5533
|
-
class
|
|
5534
|
+
class Qo extends Y {
|
|
5534
5535
|
constructor(t, i) {
|
|
5535
5536
|
super(), this.spineItemsManager = t, this.spineLocator = i, this.itemIsReady$ = this.spineItemsManager.items$.pipe(
|
|
5536
5537
|
v((n) => {
|
|
@@ -5560,7 +5561,7 @@ class Ko extends Y {
|
|
|
5560
5561
|
);
|
|
5561
5562
|
}
|
|
5562
5563
|
}
|
|
5563
|
-
const
|
|
5564
|
+
const ts = ({
|
|
5564
5565
|
horizontalOffset: e,
|
|
5565
5566
|
verticalOffset: t,
|
|
5566
5567
|
context: i,
|
|
@@ -5630,7 +5631,7 @@ const Qo = ({
|
|
|
5630
5631
|
})
|
|
5631
5632
|
);
|
|
5632
5633
|
};
|
|
5633
|
-
class
|
|
5634
|
+
class es extends Y {
|
|
5634
5635
|
constructor(t, i, n, o) {
|
|
5635
5636
|
super(), this.spineItemsManager = t, this.context = i, this.settings = n, this.viewport = o, this.layoutSubject = new U(), this.spineItemsRelativeLayouts = [], t.items$.pipe(
|
|
5636
5637
|
T(() => {
|
|
@@ -5663,7 +5664,7 @@ class ts extends Y {
|
|
|
5663
5664
|
// queue layout until previous layout is done
|
|
5664
5665
|
Vt(
|
|
5665
5666
|
() => s.pipe(
|
|
5666
|
-
|
|
5667
|
+
A((r) => !r),
|
|
5667
5668
|
H()
|
|
5668
5669
|
)
|
|
5669
5670
|
),
|
|
@@ -5673,8 +5674,8 @@ class ts extends Y {
|
|
|
5673
5674
|
return W(this.spineItemsManager.items).pipe(
|
|
5674
5675
|
Qe(
|
|
5675
5676
|
(u, d, g) => u.pipe(
|
|
5676
|
-
|
|
5677
|
-
({ horizontalOffset: l, verticalOffset: p, pages: h }) =>
|
|
5677
|
+
Qt(
|
|
5678
|
+
({ horizontalOffset: l, verticalOffset: p, pages: h }) => ts({
|
|
5678
5679
|
context: this.context,
|
|
5679
5680
|
horizontalOffset: l,
|
|
5680
5681
|
index: g,
|
|
@@ -5701,7 +5702,7 @@ class ts extends Y {
|
|
|
5701
5702
|
),
|
|
5702
5703
|
w({ horizontalOffset: 0, verticalOffset: 0, pages: [] })
|
|
5703
5704
|
),
|
|
5704
|
-
|
|
5705
|
+
Qt((u) => u),
|
|
5705
5706
|
ut(() => {
|
|
5706
5707
|
s.next(!1);
|
|
5707
5708
|
})
|
|
@@ -5733,7 +5734,7 @@ class ts extends Y {
|
|
|
5733
5734
|
super.destroy(), this.layoutSubject.complete();
|
|
5734
5735
|
}
|
|
5735
5736
|
}
|
|
5736
|
-
class
|
|
5737
|
+
class is extends Y {
|
|
5737
5738
|
constructor(t, i, n, o, s) {
|
|
5738
5739
|
super(), this.context = t, this.spineItemsManager = i, this.spineLocator = n, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new k([]);
|
|
5739
5740
|
const r = this.forcedOpenSubject.pipe(
|
|
@@ -5786,7 +5787,7 @@ class es extends Y {
|
|
|
5786
5787
|
}
|
|
5787
5788
|
const He = (e, t, i) => {
|
|
5788
5789
|
const n = (i.width - t.width) / 2, o = (i.height - t.height) / 2;
|
|
5789
|
-
return new
|
|
5790
|
+
return new Yt({
|
|
5790
5791
|
x: e.x - n,
|
|
5791
5792
|
y: e.y - o
|
|
5792
5793
|
});
|
|
@@ -5809,17 +5810,17 @@ class yt extends DOMRect {
|
|
|
5809
5810
|
return new yt(n.x, n.y, n.width, n.height);
|
|
5810
5811
|
}
|
|
5811
5812
|
}
|
|
5812
|
-
class
|
|
5813
|
+
class ns {
|
|
5813
5814
|
constructor({ width: t, height: i }) {
|
|
5814
5815
|
this.__symbol = Symbol("AbsoluteViewport"), this.width = t, this.height = i;
|
|
5815
5816
|
}
|
|
5816
5817
|
}
|
|
5817
|
-
class
|
|
5818
|
+
class os {
|
|
5818
5819
|
constructor({ width: t, height: i }) {
|
|
5819
5820
|
this.__symbol = Symbol("RelativeViewport"), this.width = t, this.height = i;
|
|
5820
5821
|
}
|
|
5821
5822
|
}
|
|
5822
|
-
const
|
|
5823
|
+
const ss = ({
|
|
5823
5824
|
pageIndex: e,
|
|
5824
5825
|
spineItemOrId: t,
|
|
5825
5826
|
spineItemsManager: i
|
|
@@ -5841,7 +5842,7 @@ const os = ({
|
|
|
5841
5842
|
{ currentAbsolutePage: 0, found: !1 }
|
|
5842
5843
|
);
|
|
5843
5844
|
return s;
|
|
5844
|
-
},
|
|
5845
|
+
}, rs = ({
|
|
5845
5846
|
itemHeight: e,
|
|
5846
5847
|
itemWidth: t,
|
|
5847
5848
|
visibleWidthOfItem: i,
|
|
@@ -5850,7 +5851,7 @@ const os = ({
|
|
|
5850
5851
|
}) => {
|
|
5851
5852
|
const s = i / t, r = n / e;
|
|
5852
5853
|
return s >= o && r >= o;
|
|
5853
|
-
},
|
|
5854
|
+
}, as = ({
|
|
5854
5855
|
visibleWidthOfItem: e,
|
|
5855
5856
|
visibleHeightOfItem: t,
|
|
5856
5857
|
threshold: i,
|
|
@@ -5882,14 +5883,14 @@ const os = ({
|
|
|
5882
5883
|
Math.min(e, l) - Math.max(n, g)
|
|
5883
5884
|
);
|
|
5884
5885
|
if (p <= 0 || h <= 0) return { visible: !1 };
|
|
5885
|
-
const S =
|
|
5886
|
+
const S = as({
|
|
5886
5887
|
threshold: r,
|
|
5887
5888
|
visibleHeightOfItem: h,
|
|
5888
5889
|
visibleWidthOfItem: p,
|
|
5889
5890
|
viewportPosition: a
|
|
5890
5891
|
});
|
|
5891
5892
|
return c ? { visible: S } : {
|
|
5892
|
-
visible:
|
|
5893
|
+
visible: rs({
|
|
5893
5894
|
itemHeight: s,
|
|
5894
5895
|
itemWidth: o,
|
|
5895
5896
|
threshold: r,
|
|
@@ -5897,7 +5898,7 @@ const os = ({
|
|
|
5897
5898
|
visibleWidthOfItem: p
|
|
5898
5899
|
}) || S
|
|
5899
5900
|
};
|
|
5900
|
-
},
|
|
5901
|
+
}, cs = ({
|
|
5901
5902
|
absolutePageIndex: e,
|
|
5902
5903
|
spineItemsManager: t
|
|
5903
5904
|
}) => {
|
|
@@ -5940,7 +5941,7 @@ const os = ({
|
|
|
5940
5941
|
}) => new M({
|
|
5941
5942
|
x: t + e.x,
|
|
5942
5943
|
y: i + e.y
|
|
5943
|
-
}),
|
|
5944
|
+
}), us = ({
|
|
5944
5945
|
position: e,
|
|
5945
5946
|
threshold: t,
|
|
5946
5947
|
restrictToScreen: i,
|
|
@@ -5980,7 +5981,7 @@ const os = ({
|
|
|
5980
5981
|
beginIndex: l ?? 0,
|
|
5981
5982
|
endIndex: p ?? 0
|
|
5982
5983
|
};
|
|
5983
|
-
},
|
|
5984
|
+
}, ds = ({
|
|
5984
5985
|
spineItemsManager: e,
|
|
5985
5986
|
context: t,
|
|
5986
5987
|
spineItemLocator: i,
|
|
@@ -5990,7 +5991,7 @@ const os = ({
|
|
|
5990
5991
|
}) => {
|
|
5991
5992
|
const r = (p, h) => {
|
|
5992
5993
|
const { left: m, top: S } = o.getSpineItemSpineLayoutInfo(h);
|
|
5993
|
-
return new
|
|
5994
|
+
return new R({
|
|
5994
5995
|
/**
|
|
5995
5996
|
* when using spread the item could be on the right and therefore will be negative
|
|
5996
5997
|
* @example
|
|
@@ -6002,7 +6003,7 @@ const os = ({
|
|
|
6002
6003
|
y: Math.max(p.y - S, 0)
|
|
6003
6004
|
});
|
|
6004
6005
|
}, a = (p) => Dt({
|
|
6005
|
-
spineItemPosition: new
|
|
6006
|
+
spineItemPosition: new R({ x: 0, y: 0 }),
|
|
6006
6007
|
itemLayout: o.getSpineItemSpineLayoutInfo(p)
|
|
6007
6008
|
}), c = (p) => e.items.find((h) => h.renderer.getDocumentFrame() === p), u = (p, h, m) => {
|
|
6008
6009
|
if (typeof m == "number") {
|
|
@@ -6030,7 +6031,7 @@ const os = ({
|
|
|
6030
6031
|
const dt = i.getSpineItemPositionFromPageIndex({
|
|
6031
6032
|
pageIndex: B,
|
|
6032
6033
|
spineItem: m
|
|
6033
|
-
}),
|
|
6034
|
+
}), K = Dt({
|
|
6034
6035
|
spineItemPosition: dt,
|
|
6035
6036
|
itemLayout: o.getSpineItemSpineLayoutInfo(m)
|
|
6036
6037
|
});
|
|
@@ -6039,21 +6040,21 @@ const os = ({
|
|
|
6039
6040
|
absolutePosition: {
|
|
6040
6041
|
width: t.getPageSize().width,
|
|
6041
6042
|
height: t.getPageSize().height,
|
|
6042
|
-
left:
|
|
6043
|
-
top:
|
|
6044
|
-
bottom:
|
|
6045
|
-
right:
|
|
6043
|
+
left: K.x,
|
|
6044
|
+
top: K.y,
|
|
6045
|
+
bottom: K.y + t.getPageSize().height,
|
|
6046
|
+
right: K.x + t.getPageSize().width
|
|
6046
6047
|
}
|
|
6047
6048
|
};
|
|
6048
6049
|
}).reduce(
|
|
6049
6050
|
(O, { absolutePosition: B, index: dt }) => {
|
|
6050
|
-
const
|
|
6051
|
+
const K = f ? y.absoluteViewport : y.relativeViewport, _e = He(
|
|
6051
6052
|
p,
|
|
6052
6053
|
y.absoluteViewport,
|
|
6053
|
-
|
|
6054
|
+
K
|
|
6054
6055
|
), Xe = yt.from(
|
|
6055
6056
|
_e,
|
|
6056
|
-
|
|
6057
|
+
K
|
|
6057
6058
|
), { visible: qe } = Ee({
|
|
6058
6059
|
viewportPosition: Xe,
|
|
6059
6060
|
restrictToScreen: S,
|
|
@@ -6081,11 +6082,11 @@ const os = ({
|
|
|
6081
6082
|
spineItemPosition: h
|
|
6082
6083
|
});
|
|
6083
6084
|
},
|
|
6084
|
-
getAbsolutePageIndexFromPageIndex: (p) =>
|
|
6085
|
+
getAbsolutePageIndexFromPageIndex: (p) => ss({
|
|
6085
6086
|
...p,
|
|
6086
6087
|
spineItemsManager: e
|
|
6087
6088
|
}),
|
|
6088
|
-
getSpineInfoFromAbsolutePageIndex: (p) =>
|
|
6089
|
+
getSpineInfoFromAbsolutePageIndex: (p) => cs({
|
|
6089
6090
|
...p,
|
|
6090
6091
|
spineItemsManager: e
|
|
6091
6092
|
}),
|
|
@@ -6099,7 +6100,7 @@ const os = ({
|
|
|
6099
6100
|
}),
|
|
6100
6101
|
getSpineItemFromIframe: c,
|
|
6101
6102
|
getSpineItemPageIndexFromNode: u,
|
|
6102
|
-
getVisibleSpineItemsFromPosition: (p) =>
|
|
6103
|
+
getVisibleSpineItemsFromPosition: (p) => us({
|
|
6103
6104
|
settings: n,
|
|
6104
6105
|
spineItemsManager: e,
|
|
6105
6106
|
spineLayout: o,
|
|
@@ -6117,34 +6118,34 @@ const os = ({
|
|
|
6117
6118
|
spineItemLocator: i,
|
|
6118
6119
|
getSafeSpineItemPositionFromUnsafeSpineItemPosition: (p, h) => {
|
|
6119
6120
|
const { height: m, width: S } = o.getSpineItemSpineLayoutInfo(h);
|
|
6120
|
-
return new
|
|
6121
|
+
return new R({
|
|
6121
6122
|
x: Math.min(Math.max(0, p.x), S),
|
|
6122
6123
|
y: Math.min(Math.max(0, p.y), m)
|
|
6123
6124
|
});
|
|
6124
6125
|
}
|
|
6125
6126
|
};
|
|
6126
6127
|
};
|
|
6127
|
-
class
|
|
6128
|
+
class gs extends Y {
|
|
6128
6129
|
constructor(t, i, n, o, s, r, a, c) {
|
|
6129
|
-
super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(
|
|
6130
|
+
super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Fi()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new es(
|
|
6130
6131
|
o,
|
|
6131
6132
|
i,
|
|
6132
6133
|
r,
|
|
6133
6134
|
c
|
|
6134
|
-
), this.locator =
|
|
6135
|
+
), this.locator = ds({
|
|
6135
6136
|
context: i,
|
|
6136
6137
|
spineItemsManager: o,
|
|
6137
6138
|
spineItemLocator: s,
|
|
6138
6139
|
settings: r,
|
|
6139
6140
|
spineLayout: this.spineLayout,
|
|
6140
6141
|
viewport: c
|
|
6141
|
-
}), this.spineItemsLoader = new
|
|
6142
|
+
}), this.spineItemsLoader = new is(
|
|
6142
6143
|
this.context,
|
|
6143
6144
|
o,
|
|
6144
6145
|
this.locator,
|
|
6145
6146
|
r,
|
|
6146
6147
|
this.spineLayout
|
|
6147
|
-
), this.spineItemsObserver = new
|
|
6148
|
+
), this.spineItemsObserver = new Qo(
|
|
6148
6149
|
o,
|
|
6149
6150
|
this.locator
|
|
6150
6151
|
);
|
|
@@ -6184,7 +6185,7 @@ class ds extends Y {
|
|
|
6184
6185
|
super.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue().remove(), this.elementSubject.complete();
|
|
6185
6186
|
}
|
|
6186
6187
|
}
|
|
6187
|
-
class
|
|
6188
|
+
class ls extends Y {
|
|
6188
6189
|
constructor(t, i) {
|
|
6189
6190
|
super(), this.context = t, this.settings = i, this.orderedSpineItemsSubject = new k([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
|
|
6190
6191
|
}
|
|
@@ -6211,7 +6212,7 @@ class gs extends Y {
|
|
|
6211
6212
|
}
|
|
6212
6213
|
// @todo move
|
|
6213
6214
|
getSpineItemFromCfi(t) {
|
|
6214
|
-
const { itemIndex: i } =
|
|
6215
|
+
const { itemIndex: i } = Zt(t);
|
|
6215
6216
|
if (i !== void 0)
|
|
6216
6217
|
return this.get(i);
|
|
6217
6218
|
}
|
|
@@ -6225,7 +6226,7 @@ class gs extends Y {
|
|
|
6225
6226
|
this.orderedSpineItemsSubject.value.forEach((t) => t.destroy());
|
|
6226
6227
|
}
|
|
6227
6228
|
}
|
|
6228
|
-
class
|
|
6229
|
+
class ps extends bt {
|
|
6229
6230
|
constructor(t) {
|
|
6230
6231
|
const i = document.createElement("div");
|
|
6231
6232
|
i.style.cssText = `
|
|
@@ -6259,7 +6260,7 @@ class ls extends bt {
|
|
|
6259
6260
|
}
|
|
6260
6261
|
get absoluteViewport() {
|
|
6261
6262
|
const t = this.context.state.visibleAreaRect;
|
|
6262
|
-
return new
|
|
6263
|
+
return new ns({
|
|
6263
6264
|
width: t.width,
|
|
6264
6265
|
height: t.height
|
|
6265
6266
|
});
|
|
@@ -6274,19 +6275,19 @@ class ls extends bt {
|
|
|
6274
6275
|
*/
|
|
6275
6276
|
get relativeViewport() {
|
|
6276
6277
|
const t = this.absoluteViewport, i = this.value.element.getBoundingClientRect(), n = ((i == null ? void 0 : i.width) ?? t.width) / t.width;
|
|
6277
|
-
return new
|
|
6278
|
+
return new os({
|
|
6278
6279
|
width: t.width / n,
|
|
6279
6280
|
height: t.height / n
|
|
6280
6281
|
});
|
|
6281
6282
|
}
|
|
6282
6283
|
}
|
|
6283
|
-
const
|
|
6284
|
-
const t = new U(), i = new
|
|
6284
|
+
const hs = (e) => {
|
|
6285
|
+
const t = new U(), i = new po(), n = new go(), o = new Zo(e, n), s = new lo(n, o), r = new ls(n, o), a = new k(
|
|
6285
6286
|
void 0
|
|
6286
|
-
), c = new
|
|
6287
|
+
), c = new ps(n), u = a.pipe(tt(ct)), d = ze({
|
|
6287
6288
|
context: n,
|
|
6288
6289
|
settings: o
|
|
6289
|
-
}), g = new
|
|
6290
|
+
}), g = new Xo(n, r), l = new gs(
|
|
6290
6291
|
u,
|
|
6291
6292
|
n,
|
|
6292
6293
|
g,
|
|
@@ -6295,14 +6296,14 @@ const ps = (e) => {
|
|
|
6295
6296
|
o,
|
|
6296
6297
|
i,
|
|
6297
6298
|
c
|
|
6298
|
-
), p =
|
|
6299
|
+
), p = _o({
|
|
6299
6300
|
context: n,
|
|
6300
6301
|
spineItemsManager: r,
|
|
6301
6302
|
hookManager: i,
|
|
6302
6303
|
spine: l,
|
|
6303
6304
|
settings: o,
|
|
6304
6305
|
viewport: c
|
|
6305
|
-
}), h = new
|
|
6306
|
+
}), h = new qo(
|
|
6306
6307
|
n,
|
|
6307
6308
|
g,
|
|
6308
6309
|
r,
|
|
@@ -6338,7 +6339,7 @@ const ps = (e) => {
|
|
|
6338
6339
|
return;
|
|
6339
6340
|
}
|
|
6340
6341
|
j.log("load", { options: y });
|
|
6341
|
-
const $ =
|
|
6342
|
+
const $ = ms(I);
|
|
6342
6343
|
I !== ((L = a.getValue()) == null ? void 0 : L.parentElement) && (a.next($), I.appendChild($)), n.update({
|
|
6343
6344
|
manifest: P,
|
|
6344
6345
|
containerElement: I,
|
|
@@ -6354,9 +6355,9 @@ const ps = (e) => {
|
|
|
6354
6355
|
spine: l,
|
|
6355
6356
|
hookManager: i,
|
|
6356
6357
|
cfi: {
|
|
6357
|
-
generateCfiFromRange:
|
|
6358
|
-
generateCfiFromSelection:
|
|
6359
|
-
parseCfi:
|
|
6358
|
+
generateCfiFromRange: Rn,
|
|
6359
|
+
generateCfiFromSelection: An,
|
|
6360
|
+
parseCfi: Zt,
|
|
6360
6361
|
generateCfiForSpineItemPage: (y) => Wt({
|
|
6361
6362
|
...y,
|
|
6362
6363
|
spineItemLocator: d
|
|
@@ -6396,33 +6397,33 @@ const ps = (e) => {
|
|
|
6396
6397
|
destroy$: t
|
|
6397
6398
|
}
|
|
6398
6399
|
};
|
|
6399
|
-
},
|
|
6400
|
+
}, ms = (e) => {
|
|
6400
6401
|
const t = e.ownerDocument.createElement("div");
|
|
6401
6402
|
return t.style.cssText = `
|
|
6402
6403
|
background-color: white;
|
|
6403
6404
|
position: relative;
|
|
6404
6405
|
`, t.className = `${lt}-reader`, t;
|
|
6405
|
-
},
|
|
6406
|
+
}, vs = (
|
|
6406
6407
|
//__
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6408
|
+
eo(
|
|
6409
|
+
ki(
|
|
6410
|
+
Sn(
|
|
6411
|
+
oo(
|
|
6412
|
+
ji(
|
|
6413
|
+
yi(
|
|
6414
|
+
Gn(
|
|
6415
|
+
no(
|
|
6416
|
+
ao(
|
|
6417
|
+
Cn(
|
|
6418
|
+
rn(
|
|
6419
|
+
In(
|
|
6420
|
+
Si(
|
|
6421
|
+
io(
|
|
6422
|
+
qn(
|
|
6423
|
+
hn(
|
|
6424
|
+
Oi(
|
|
6424
6425
|
// __
|
|
6425
|
-
|
|
6426
|
+
hs
|
|
6426
6427
|
)
|
|
6427
6428
|
)
|
|
6428
6429
|
)
|
|
@@ -6444,29 +6445,29 @@ const ps = (e) => {
|
|
|
6444
6445
|
export {
|
|
6445
6446
|
Y as DestroyableClass,
|
|
6446
6447
|
ht as DocumentRenderer,
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6448
|
+
po as HookManager,
|
|
6449
|
+
qt as ResourceHandler,
|
|
6450
|
+
Yo as SettingsManager,
|
|
6450
6451
|
Ue as SpineItem,
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6452
|
+
vs as createReader,
|
|
6453
|
+
ie as deferIdle,
|
|
6454
|
+
Di as deferNextResult,
|
|
6455
|
+
ee as getAttributeValueFromString,
|
|
6456
|
+
Bt as getFrameViewportInfo,
|
|
6456
6457
|
Fe as idle,
|
|
6457
|
-
|
|
6458
|
+
pi as injectCSS,
|
|
6458
6459
|
Pe as isHtmlElement,
|
|
6459
|
-
|
|
6460
|
-
|
|
6460
|
+
Mi as isHtmlTagElement,
|
|
6461
|
+
Ts as isShallowEqual,
|
|
6461
6462
|
$e as mapKeysTo,
|
|
6462
|
-
|
|
6463
|
-
|
|
6463
|
+
Is as observeIntersection,
|
|
6464
|
+
ne as observeMutation,
|
|
6464
6465
|
Te as observeResize,
|
|
6465
|
-
|
|
6466
|
+
hi as removeCSS,
|
|
6466
6467
|
ot as upsertCSSToFrame,
|
|
6467
|
-
|
|
6468
|
-
|
|
6468
|
+
mi as waitForFrameLoad,
|
|
6469
|
+
fi as waitForFrameReady,
|
|
6469
6470
|
Ct as waitForSwitch,
|
|
6470
|
-
|
|
6471
|
+
Xt as watchKeys
|
|
6471
6472
|
};
|
|
6472
6473
|
//# sourceMappingURL=index.js.map
|