@prose-reader/core 1.272.0 → 1.274.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 +574 -564
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +20 -20
- package/dist/index.umd.cjs.map +1 -1
- package/dist/utils/objects.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { switchMap as w, of as v, fromEvent as X, take as
|
|
2
|
-
import { Report as dn, isShallowEqual as O, shallowMergeIfDefined as
|
|
3
|
-
import { isShallowEqual as
|
|
4
|
-
import { switchMap as Y, first as mn, map as ie, distinctUntilChanged as be, startWith as fn, shareReplay as
|
|
5
|
-
import { generate as
|
|
6
|
-
const $n = "@prose-reader/core",
|
|
1
|
+
import { switchMap as w, of as v, fromEvent as X, take as Tt, map as S, from as k, takeUntil as T, Observable as ce, defer as We, Subject as N, combineLatest as j, merge as P, EMPTY as _, NEVER as he, tap as x, share as A, BehaviorSubject as q, distinctUntilChanged as R, filter as C, mergeMap as ge, first as U, endWith as fe, catchError as Pe, finalize as me, lastValueFrom as nn, scheduled as on, animationFrameScheduler as re, exhaustMap as sn, debounceTime as Ie, withLatestFrom as z, throttleTime as rn, startWith as ne, shareReplay as J, switchScan as an, defaultIfEmpty as cn, forkJoin as un, delay as xe, timer as Fe, skip as Ft, ReplaySubject as st, identity as $e, concatMap as ln } from "rxjs";
|
|
2
|
+
import { Report as dn, isShallowEqual as O, shallowMergeIfDefined as Te, getParentPath as pn, parseContentType as gn, detectMimeTypeFromName as Ce, arrayEqual as hn } from "@prose-reader/shared";
|
|
3
|
+
import { isShallowEqual as nr } from "@prose-reader/shared";
|
|
4
|
+
import { switchMap as Y, first as mn, map as ie, distinctUntilChanged as be, startWith as fn, shareReplay as Ze, tap as V, pairwise as yn, take as Sn, takeUntil as K, filter as pe, debounceTime as In, skip as Lt, mergeMap as bn, catchError as rt, share as vn } from "rxjs/operators";
|
|
5
|
+
import { generate as _e, parse as Mt, isIndirectionOnly as wn, isParsedCfiRange as Pn, resolve as xn } from "@prose-reader/cfi";
|
|
6
|
+
const $n = "@prose-reader/core", D = dn.namespace($n, void 0, {
|
|
7
7
|
color: "#98cde7"
|
|
8
8
|
}), Tn = [
|
|
9
9
|
"pointercancel",
|
|
@@ -27,7 +27,7 @@ function Fn(n, e, t) {
|
|
|
27
27
|
const Ln = (n, e) => {
|
|
28
28
|
const t = "createRange" in n ? n : n.ownerDocument;
|
|
29
29
|
if (!t) return;
|
|
30
|
-
const i = "body" in n ?
|
|
30
|
+
const i = "body" in n ? He(n.body, e) : He(n, e);
|
|
31
31
|
if (i) {
|
|
32
32
|
let o, s = 0;
|
|
33
33
|
const r = t.createRange();
|
|
@@ -49,7 +49,7 @@ const Ln = (n, e) => {
|
|
|
49
49
|
offset: s
|
|
50
50
|
} : { node: i, offset: 0 };
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, He = (n, e) => {
|
|
53
53
|
const t = n.getBoundingClientRect(), i = Ct(
|
|
54
54
|
t,
|
|
55
55
|
e
|
|
@@ -57,7 +57,7 @@ const Ln = (n, e) => {
|
|
|
57
57
|
let o;
|
|
58
58
|
i !== "before" && i !== "after" && (o = n);
|
|
59
59
|
for (const s of n.children) {
|
|
60
|
-
const r =
|
|
60
|
+
const r = He(s, e);
|
|
61
61
|
if (r)
|
|
62
62
|
return r;
|
|
63
63
|
}
|
|
@@ -79,11 +79,11 @@ const Cn = (n, e) => {
|
|
|
79
79
|
try {
|
|
80
80
|
e <= (t?.endOffset || 0) && t?.setStart(n, e || 0);
|
|
81
81
|
} catch (i) {
|
|
82
|
-
|
|
82
|
+
D.error(i);
|
|
83
83
|
}
|
|
84
84
|
return t;
|
|
85
85
|
}
|
|
86
|
-
},
|
|
86
|
+
}, Je = (n) => {
|
|
87
87
|
if (n?.target && n?.target?.ownerDocument?.defaultView) {
|
|
88
88
|
const e = n?.target?.ownerDocument?.defaultView;
|
|
89
89
|
if (e.PointerEvent && n instanceof e.PointerEvent)
|
|
@@ -96,7 +96,7 @@ const Cn = (n, e) => {
|
|
|
96
96
|
}
|
|
97
97
|
return !!Tn.includes(n.type);
|
|
98
98
|
}, En = (n) => {
|
|
99
|
-
if (
|
|
99
|
+
if (Je(n)) return !1;
|
|
100
100
|
if (n?.target && n?.target?.ownerDocument?.defaultView) {
|
|
101
101
|
const e = n?.target?.ownerDocument?.defaultView;
|
|
102
102
|
if (e.MouseEvent)
|
|
@@ -143,12 +143,18 @@ const Cn = (n, e) => {
|
|
|
143
143
|
}), n) {
|
|
144
144
|
const t = Array.from(n.styleSheets || []);
|
|
145
145
|
for (const i of t) {
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
const s = (() => {
|
|
147
|
+
try {
|
|
148
|
+
return Array.from(i.cssRules || []);
|
|
149
|
+
} catch (r) {
|
|
150
|
+
return D.warn(`Error getting rules for sheet: ${i.href}`, r), [];
|
|
151
|
+
}
|
|
152
|
+
})();
|
|
153
|
+
for (const r of s)
|
|
154
|
+
if (n.defaultView && r instanceof n.defaultView.CSSFontFaceRule) {
|
|
155
|
+
const c = r.style.getPropertyValue("src").match(/blob:[^,\s'")]+/g);
|
|
156
|
+
c && c.forEach((u) => {
|
|
157
|
+
n?.defaultView?.URL.revokeObjectURL(u);
|
|
152
158
|
});
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -188,23 +194,23 @@ function On(n) {
|
|
|
188
194
|
["setStart", "setEnd", "selectNodeContents"]
|
|
189
195
|
);
|
|
190
196
|
}
|
|
191
|
-
const
|
|
197
|
+
const Ee = (n, e, t, i) => {
|
|
192
198
|
const o = n.createElement("style");
|
|
193
199
|
return o.id = e, o.innerHTML = t, i ? n.head.prepend(o) : n.head.appendChild(o), () => {
|
|
194
|
-
|
|
200
|
+
De(n, e);
|
|
195
201
|
};
|
|
196
|
-
},
|
|
202
|
+
}, De = (n, e) => {
|
|
197
203
|
if (n?.head) {
|
|
198
204
|
const t = n.getElementById(e);
|
|
199
205
|
t && t.remove();
|
|
200
206
|
}
|
|
201
|
-
},
|
|
207
|
+
}, at = (n, e) => {
|
|
202
208
|
const t = new RegExp(`${e}\\s*=\\s*([0-9.]+)`, "i"), i = n.match(t) || [], o = i[1] || "0";
|
|
203
209
|
return i && Number.parseFloat(o) || 0;
|
|
204
210
|
}, Vn = (n, e, t, i) => {
|
|
205
|
-
n?.contentDocument?.head &&
|
|
206
|
-
},
|
|
207
|
-
n?.contentDocument &&
|
|
211
|
+
n?.contentDocument?.head && Ee(n.contentDocument, e, t, i);
|
|
212
|
+
}, _s = (n, e) => {
|
|
213
|
+
n?.contentDocument && De(n.contentDocument, e);
|
|
208
214
|
}, oe = (n, e, t, i) => {
|
|
209
215
|
if (!n) return;
|
|
210
216
|
const o = n?.contentDocument?.getElementById(
|
|
@@ -215,13 +221,13 @@ const Ce = (n, e, t, i) => {
|
|
|
215
221
|
return;
|
|
216
222
|
}
|
|
217
223
|
Vn(n, e, t, i);
|
|
218
|
-
},
|
|
224
|
+
}, Ke = (n) => {
|
|
219
225
|
if (n?.contentDocument) {
|
|
220
226
|
const t = n.contentDocument.querySelector("meta[name='viewport']");
|
|
221
227
|
if (t) {
|
|
222
228
|
const i = t.getAttribute("content");
|
|
223
229
|
if (i) {
|
|
224
|
-
const o =
|
|
230
|
+
const o = at(i, "width"), s = at(i, "height");
|
|
225
231
|
return o > 0 && s > 0 ? {
|
|
226
232
|
hasViewport: !0,
|
|
227
233
|
width: o,
|
|
@@ -233,7 +239,7 @@ const Ce = (n, e, t, i) => {
|
|
|
233
239
|
return { hasViewport: !1 };
|
|
234
240
|
}, jn = (n) => n.pipe(
|
|
235
241
|
w((e) => e.src === "about:blank" && e.contentDocument?.readyState === "complete" && e.contentDocument.body ? v(e) : X(e, "load").pipe(
|
|
236
|
-
|
|
242
|
+
Tt(1),
|
|
237
243
|
S(() => e)
|
|
238
244
|
))
|
|
239
245
|
), kn = (n) => n.pipe(
|
|
@@ -288,7 +294,7 @@ const Ce = (n, e, t, i) => {
|
|
|
288
294
|
const s = t.spineItemsManager.get(i)?.renderer.getDocumentFrame();
|
|
289
295
|
s && s.contentDocument?.body.setAttribute("tabindex", "-1");
|
|
290
296
|
}), t;
|
|
291
|
-
},
|
|
297
|
+
}, Re = ({
|
|
292
298
|
position: n,
|
|
293
299
|
frameElement: e
|
|
294
300
|
}) => {
|
|
@@ -302,8 +308,8 @@ const Ce = (n, e, t, i) => {
|
|
|
302
308
|
if (!e || !o) return n;
|
|
303
309
|
const s = t.getSpineItemFromIframe(o), r = o, { height: a, width: c } = i.pageSize;
|
|
304
310
|
if (!s || !(r instanceof HTMLIFrameElement)) return n;
|
|
305
|
-
if (
|
|
306
|
-
const { clientX: u, clientY: l } =
|
|
311
|
+
if (Je(n)) {
|
|
312
|
+
const { clientX: u, clientY: l } = Re({
|
|
307
313
|
position: n,
|
|
308
314
|
frameElement: r
|
|
309
315
|
}), d = new PointerEvent(n.type, {
|
|
@@ -318,7 +324,7 @@ const Ce = (n, e, t, i) => {
|
|
|
318
324
|
}), d;
|
|
319
325
|
}
|
|
320
326
|
if (En(n)) {
|
|
321
|
-
const { clientX: u, clientY: l } =
|
|
327
|
+
const { clientX: u, clientY: l } = Re({
|
|
322
328
|
position: n,
|
|
323
329
|
frameElement: r
|
|
324
330
|
}), d = new MouseEvent(n.type, {
|
|
@@ -333,7 +339,7 @@ const Ce = (n, e, t, i) => {
|
|
|
333
339
|
}
|
|
334
340
|
if (Dn(n)) {
|
|
335
341
|
const u = Array.from(n.touches).map((d) => {
|
|
336
|
-
const { clientX: g, clientY: p } =
|
|
342
|
+
const { clientX: g, clientY: p } = Re({
|
|
337
343
|
position: d,
|
|
338
344
|
frameElement: r
|
|
339
345
|
});
|
|
@@ -376,7 +382,7 @@ const Ce = (n, e, t, i) => {
|
|
|
376
382
|
const a = Hn.map((c) => {
|
|
377
383
|
const u = (l) => {
|
|
378
384
|
let d = l;
|
|
379
|
-
if (
|
|
385
|
+
if (Je(l) && (d = new PointerEvent(l.type, l)), d !== l) {
|
|
380
386
|
const g = Wn(
|
|
381
387
|
d,
|
|
382
388
|
l,
|
|
@@ -397,14 +403,25 @@ const Ce = (n, e, t, i) => {
|
|
|
397
403
|
});
|
|
398
404
|
}
|
|
399
405
|
), t;
|
|
400
|
-
},
|
|
401
|
-
|
|
406
|
+
}, Hs = (n) => {
|
|
407
|
+
const e = new FileReader();
|
|
408
|
+
return new Promise((t) => {
|
|
409
|
+
e.addEventListener(
|
|
410
|
+
"load",
|
|
411
|
+
() => {
|
|
412
|
+
t(e.result);
|
|
413
|
+
},
|
|
414
|
+
!1
|
|
415
|
+
), e.readAsDataURL(n);
|
|
416
|
+
});
|
|
417
|
+
}, Xn = (n, e) => Object.entries(n).reduce(
|
|
418
|
+
(t, [i, o]) => e.includes(i) ? {
|
|
402
419
|
...t,
|
|
403
420
|
[i]: o
|
|
404
421
|
} : t,
|
|
405
422
|
{}
|
|
406
|
-
)),
|
|
407
|
-
function
|
|
423
|
+
), Nt = (n) => ie((e) => Xn(e, n)), Qe = (n) => (e) => e.pipe(Nt(n), be(O));
|
|
424
|
+
function et(n) {
|
|
408
425
|
return new ce((e) => {
|
|
409
426
|
const t = new ResizeObserver((i) => {
|
|
410
427
|
e.next(i);
|
|
@@ -414,21 +431,21 @@ function Qe(n) {
|
|
|
414
431
|
};
|
|
415
432
|
});
|
|
416
433
|
}
|
|
417
|
-
const
|
|
434
|
+
const Ae = (n) => (e) => e.pipe(
|
|
418
435
|
Y(
|
|
419
436
|
(t) => n.pipe(
|
|
420
437
|
mn(),
|
|
421
438
|
ie(() => t)
|
|
422
439
|
)
|
|
423
440
|
)
|
|
424
|
-
),
|
|
441
|
+
), Yn = (n) => {
|
|
425
442
|
let e;
|
|
426
443
|
const t = n.subscribe((i) => {
|
|
427
444
|
e = { result: i };
|
|
428
445
|
});
|
|
429
446
|
return () => (t.unsubscribe(), e ? v(e.result) : n);
|
|
430
447
|
};
|
|
431
|
-
function
|
|
448
|
+
function tt() {
|
|
432
449
|
return new ce((n) => {
|
|
433
450
|
if (window.requestIdleCallback) {
|
|
434
451
|
const t = window.requestIdleCallback(() => {
|
|
@@ -442,16 +459,16 @@ function et() {
|
|
|
442
459
|
return () => clearTimeout(e);
|
|
443
460
|
});
|
|
444
461
|
}
|
|
445
|
-
function
|
|
446
|
-
return
|
|
462
|
+
function ct(n) {
|
|
463
|
+
return We(() => tt().pipe(Y(n)));
|
|
447
464
|
}
|
|
448
|
-
const
|
|
465
|
+
const ut = (n, e) => new ce((t) => {
|
|
449
466
|
const i = new MutationObserver((o) => {
|
|
450
467
|
t.next(o);
|
|
451
468
|
});
|
|
452
469
|
return i.observe(n, e), () => i.disconnect();
|
|
453
470
|
});
|
|
454
|
-
function
|
|
471
|
+
function Bs(n, e) {
|
|
455
472
|
return new ce((t) => {
|
|
456
473
|
const i = new IntersectionObserver((o) => {
|
|
457
474
|
t.next(o);
|
|
@@ -464,11 +481,11 @@ function _s(n, e) {
|
|
|
464
481
|
class Rt {
|
|
465
482
|
constructor(e, t) {
|
|
466
483
|
this.settingsManager = t;
|
|
467
|
-
const i =
|
|
484
|
+
const i = Te(
|
|
468
485
|
this.getDefaultSettings(),
|
|
469
486
|
e
|
|
470
487
|
);
|
|
471
|
-
this.outputSettings = this.computeOutputSettings(i), this.inputSettings =
|
|
488
|
+
this.outputSettings = this.computeOutputSettings(i), this.inputSettings = Te(
|
|
472
489
|
this.getDefaultSettings(),
|
|
473
490
|
e
|
|
474
491
|
), this.outputSettingsUpdateSubject = new N(), this.values$ = j([
|
|
@@ -476,11 +493,11 @@ class Rt {
|
|
|
476
493
|
this.outputSettingsUpdateSubject.pipe(fn(this.outputSettings))
|
|
477
494
|
]).pipe(
|
|
478
495
|
ie(([o, s]) => ({ ...o, ...s })),
|
|
479
|
-
|
|
496
|
+
Ze(1)
|
|
480
497
|
), this.values$.subscribe();
|
|
481
498
|
}
|
|
482
499
|
_prepareUpdate(e) {
|
|
483
|
-
const t = this.getCleanedParentInputSettings(e), i = this.settingsManager._prepareUpdate(t), o =
|
|
500
|
+
const t = this.getCleanedParentInputSettings(e), i = this.settingsManager._prepareUpdate(t), o = Te(this.inputSettings, e), s = this.computeOutputSettings(o), r = this.hasSettingsChanged(s);
|
|
484
501
|
return {
|
|
485
502
|
hasChanged: r || i.hasChanged,
|
|
486
503
|
commit: () => (this.inputSettings = o, this.outputSettings = s, !i.hasChanged && r && this.outputSettingsUpdateSubject.next(s), {
|
|
@@ -500,7 +517,7 @@ class Rt {
|
|
|
500
517
|
};
|
|
501
518
|
}
|
|
502
519
|
watch(e) {
|
|
503
|
-
return Array.isArray(e) ? this.values$.pipe(
|
|
520
|
+
return Array.isArray(e) ? this.values$.pipe(Qe(e)) : this.values$.pipe(
|
|
504
521
|
ie((t) => t[e]),
|
|
505
522
|
be(O)
|
|
506
523
|
);
|
|
@@ -509,19 +526,7 @@ class Rt {
|
|
|
509
526
|
this.outputSettingsUpdateSubject.complete();
|
|
510
527
|
}
|
|
511
528
|
}
|
|
512
|
-
|
|
513
|
-
const e = new FileReader();
|
|
514
|
-
return new Promise((t) => {
|
|
515
|
-
e.addEventListener(
|
|
516
|
-
"load",
|
|
517
|
-
() => {
|
|
518
|
-
t(e.result);
|
|
519
|
-
},
|
|
520
|
-
!1
|
|
521
|
-
), e.readAsDataURL(n);
|
|
522
|
-
});
|
|
523
|
-
};
|
|
524
|
-
let Yn = class extends Rt {
|
|
529
|
+
let qn = class extends Rt {
|
|
525
530
|
computeOutputSettings(e) {
|
|
526
531
|
return e;
|
|
527
532
|
}
|
|
@@ -547,8 +552,8 @@ let Yn = class extends Rt {
|
|
|
547
552
|
};
|
|
548
553
|
}
|
|
549
554
|
};
|
|
550
|
-
const
|
|
551
|
-
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new N(), a = n(e), c = new
|
|
555
|
+
const Gn = (n) => (e) => {
|
|
556
|
+
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new N(), a = n(e), c = new qn(
|
|
552
557
|
{
|
|
553
558
|
fontScale: t,
|
|
554
559
|
lineHeight: i,
|
|
@@ -594,7 +599,7 @@ const qn = (n) => (e) => {
|
|
|
594
599
|
},
|
|
595
600
|
settings: c
|
|
596
601
|
};
|
|
597
|
-
},
|
|
602
|
+
}, Zn = (n) => (e) => {
|
|
598
603
|
const t = n(e), i = (o) => X(o, "keyup").pipe(
|
|
599
604
|
S((s) => {
|
|
600
605
|
const { pageTurnDirection: r, computedPageTurnMode: a } = t.settings.values;
|
|
@@ -630,7 +635,7 @@ const qn = (n) => (e) => {
|
|
|
630
635
|
),
|
|
631
636
|
T(t.$.destroy$)
|
|
632
637
|
).subscribe(), t;
|
|
633
|
-
},
|
|
638
|
+
}, Jn = (n) => n.spine.spineItemsManager.items$.pipe(
|
|
634
639
|
w(
|
|
635
640
|
(e) => P(
|
|
636
641
|
...e.map((t) => t.watch("isLoaded").pipe(
|
|
@@ -650,7 +655,7 @@ const qn = (n) => (e) => {
|
|
|
650
655
|
x((e) => {
|
|
651
656
|
e.preventDefault();
|
|
652
657
|
}),
|
|
653
|
-
|
|
658
|
+
A()
|
|
654
659
|
);
|
|
655
660
|
class Q extends ce {
|
|
656
661
|
constructor(e) {
|
|
@@ -667,7 +672,7 @@ class Q extends ce {
|
|
|
667
672
|
O(this.value, t) || this.stateSubject.next(t);
|
|
668
673
|
}
|
|
669
674
|
watch(e) {
|
|
670
|
-
return Array.isArray(e) ? this.stateSubject.pipe(
|
|
675
|
+
return Array.isArray(e) ? this.stateSubject.pipe(Qe(e)) : this.stateSubject.pipe(
|
|
671
676
|
S((t) => t[e]),
|
|
672
677
|
R(O)
|
|
673
678
|
);
|
|
@@ -679,7 +684,7 @@ class Q extends ce {
|
|
|
679
684
|
this.stateSubject.complete(), this._destroy$.complete();
|
|
680
685
|
}
|
|
681
686
|
}
|
|
682
|
-
const
|
|
687
|
+
const Me = class Me extends Q {
|
|
683
688
|
constructor(e) {
|
|
684
689
|
super({
|
|
685
690
|
state: "idle",
|
|
@@ -699,7 +704,7 @@ const Le = class Le extends Q {
|
|
|
699
704
|
fe(null),
|
|
700
705
|
U()
|
|
701
706
|
).pipe(
|
|
702
|
-
|
|
707
|
+
Ae(this.context.bridgeEvent.viewportFree$),
|
|
703
708
|
w(() => {
|
|
704
709
|
const c = this.hookManager.execute("item.onDocumentLoad", this.item.id, {
|
|
705
710
|
itemId: this.item.id,
|
|
@@ -715,25 +720,29 @@ const Le = class Le extends Q {
|
|
|
715
720
|
}),
|
|
716
721
|
T(t)
|
|
717
722
|
))),
|
|
718
|
-
|
|
723
|
+
A()
|
|
719
724
|
), this.unloaded$ = t.pipe(
|
|
720
725
|
ge(() => this.value.state === "unloading" || this.value.state === "idle" ? _ : (this.next({ state: "unloading", error: void 0 }), this.context.bridgeEvent.viewportFree$.pipe(
|
|
721
726
|
U(),
|
|
722
|
-
w(() => (this.hookManager.destroy("item.onDocumentLoad", this.item.id), this.onUnload().pipe(
|
|
727
|
+
w(() => (this.hookManager.destroy("item.onDocumentLoad", this.item.id), We(() => this.onUnload()).pipe(
|
|
728
|
+
fe(null),
|
|
729
|
+
U(),
|
|
730
|
+
Pe((r) => (D.error("Error unloading document", r), v(null)))
|
|
731
|
+
))),
|
|
723
732
|
S(() => {
|
|
724
733
|
this.next({ state: "idle", error: void 0 });
|
|
725
734
|
}),
|
|
726
735
|
T(i)
|
|
727
736
|
))),
|
|
728
|
-
|
|
737
|
+
A()
|
|
729
738
|
), P(this.loaded$, this.unloaded$).pipe(
|
|
730
|
-
|
|
739
|
+
Pe((o) => (this.next({ state: "error", error: o }), _)),
|
|
731
740
|
T(this.destroy$)
|
|
732
741
|
).subscribe();
|
|
733
742
|
}
|
|
734
743
|
setDocumentContainer(e) {
|
|
735
744
|
this._documentContainer = e, this._documentContainer.classList.add(
|
|
736
|
-
|
|
745
|
+
Me.DOCUMENT_CONTAINER_CLASS_NAME
|
|
737
746
|
);
|
|
738
747
|
}
|
|
739
748
|
attach() {
|
|
@@ -759,7 +768,7 @@ const Le = class Le extends Q {
|
|
|
759
768
|
*/
|
|
760
769
|
renderHeadless() {
|
|
761
770
|
const e = new N();
|
|
762
|
-
return
|
|
771
|
+
return We(() => this.onRenderHeadless({ release: e })).pipe(
|
|
763
772
|
fe(void 0),
|
|
764
773
|
U(),
|
|
765
774
|
S((t) => {
|
|
@@ -774,7 +783,7 @@ const Le = class Le extends Q {
|
|
|
774
783
|
me(() => {
|
|
775
784
|
e.complete();
|
|
776
785
|
}),
|
|
777
|
-
|
|
786
|
+
Pe((t) => (D.error(t), v(void 0)))
|
|
778
787
|
);
|
|
779
788
|
}
|
|
780
789
|
layout(e) {
|
|
@@ -795,23 +804,23 @@ const Le = class Le extends Q {
|
|
|
795
804
|
if (e) return e;
|
|
796
805
|
const t = this.getDocumentFrame();
|
|
797
806
|
if (t) {
|
|
798
|
-
const { hasViewport: i } =
|
|
807
|
+
const { hasViewport: i } = Ke(t);
|
|
799
808
|
if (i) return "pre-paginated";
|
|
800
809
|
}
|
|
801
810
|
return this.context.manifest?.renditionLayout ?? "reflowable";
|
|
802
811
|
}
|
|
803
812
|
};
|
|
804
|
-
|
|
805
|
-
let ye =
|
|
806
|
-
const
|
|
807
|
-
class
|
|
813
|
+
Me.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
|
|
814
|
+
let ye = Me;
|
|
815
|
+
const Kn = (n) => new URL(n.href);
|
|
816
|
+
class nt {
|
|
808
817
|
constructor(e, t) {
|
|
809
818
|
this.item = e, this.settings = t;
|
|
810
819
|
}
|
|
811
820
|
async getResource() {
|
|
812
821
|
return await nn(
|
|
813
822
|
this.settings.values.getResource?.(this.item) ?? v(void 0)
|
|
814
|
-
) ??
|
|
823
|
+
) ?? Kn(this.item);
|
|
815
824
|
}
|
|
816
825
|
async fetchResource() {
|
|
817
826
|
const e = await this.getResource();
|
|
@@ -821,7 +830,7 @@ class tt {
|
|
|
821
830
|
const Ot = (n, e) => {
|
|
822
831
|
const t = n.startsWith("file://"), i = t ? n.replace("file://", "http://") : n, o = new URL(e, i).toString();
|
|
823
832
|
return t ? o.replace("http://", "file://") : o;
|
|
824
|
-
},
|
|
833
|
+
}, Qn = async (n, e, t, i, o) => {
|
|
825
834
|
if (!n || !n.defaultView) return;
|
|
826
835
|
const s = e.sheet;
|
|
827
836
|
if (s)
|
|
@@ -842,7 +851,7 @@ const Ot = (n, e) => {
|
|
|
842
851
|
`${I.toLowerCase()}`
|
|
843
852
|
));
|
|
844
853
|
if (f) {
|
|
845
|
-
const I = new
|
|
854
|
+
const I = new nt(f, o);
|
|
846
855
|
try {
|
|
847
856
|
const b = await I.getResource();
|
|
848
857
|
if (b instanceof Response) {
|
|
@@ -869,14 +878,14 @@ const Ot = (n, e) => {
|
|
|
869
878
|
} catch (r) {
|
|
870
879
|
console.error("Could not access stylesheet rules:", r);
|
|
871
880
|
}
|
|
872
|
-
},
|
|
881
|
+
}, ei = (n, e, t, i, o) => {
|
|
873
882
|
const s = e.getAttribute("src") || e.getAttribute("href");
|
|
874
883
|
if (!s) return v(null);
|
|
875
884
|
const r = i.manifest?.items.find(({ href: c }) => `${Ot(t, s).toLowerCase()}`.endsWith(
|
|
876
885
|
`${c.toLowerCase()}`
|
|
877
886
|
));
|
|
878
887
|
if (!r) return v(null);
|
|
879
|
-
const a = new
|
|
888
|
+
const a = new nt(r, o);
|
|
880
889
|
return k(a.getResource()).pipe(
|
|
881
890
|
ge(
|
|
882
891
|
(c) => c instanceof Response ? k(c.blob()) : v(void 0)
|
|
@@ -891,7 +900,7 @@ const Ot = (n, e) => {
|
|
|
891
900
|
return new ce((l) => {
|
|
892
901
|
e.onload = async () => {
|
|
893
902
|
try {
|
|
894
|
-
e.sheet && await
|
|
903
|
+
e.sheet && await Qn(
|
|
895
904
|
n,
|
|
896
905
|
e,
|
|
897
906
|
t,
|
|
@@ -906,7 +915,7 @@ const Ot = (n, e) => {
|
|
|
906
915
|
return v(null);
|
|
907
916
|
})
|
|
908
917
|
);
|
|
909
|
-
},
|
|
918
|
+
}, ti = ({
|
|
910
919
|
settings: n,
|
|
911
920
|
item: e,
|
|
912
921
|
context: t
|
|
@@ -915,7 +924,7 @@ const Ot = (n, e) => {
|
|
|
915
924
|
const s = Et(
|
|
916
925
|
o.contentDocument
|
|
917
926
|
), r = pn(e.href), a = s.map(
|
|
918
|
-
(c) =>
|
|
927
|
+
(c) => ei(
|
|
919
928
|
o.contentDocument,
|
|
920
929
|
c,
|
|
921
930
|
r,
|
|
@@ -925,11 +934,11 @@ const Ot = (n, e) => {
|
|
|
925
934
|
);
|
|
926
935
|
return j(a).pipe(S(() => o));
|
|
927
936
|
})
|
|
928
|
-
),
|
|
937
|
+
), ni = (n) => {
|
|
929
938
|
Nn(n?.contentDocument);
|
|
930
|
-
},
|
|
939
|
+
}, Ys = "@prose-reader/core", qs = 0, Gs = 200, ii = [".xhtml", ".html", ".htm"], W = "prose-reader", Vt = `${W}-style`, oi = `data-${W}-id`, si = `${W}-viewport`, ri = `${W}-scroll-navigator`, ai = async (n, e) => {
|
|
931
940
|
if (typeof n == "string") return n;
|
|
932
|
-
const t = gn(n.headers.get("Content-Type") || "") ||
|
|
941
|
+
const t = gn(n.headers.get("Content-Type") || "") || Ce(e.href);
|
|
933
942
|
if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
|
|
934
943
|
(o) => o === t
|
|
935
944
|
)) {
|
|
@@ -965,11 +974,11 @@ const Ot = (n, e) => {
|
|
|
965
974
|
</body>
|
|
966
975
|
</html>
|
|
967
976
|
` : await n.text();
|
|
968
|
-
},
|
|
977
|
+
}, ci = ({
|
|
969
978
|
item: n,
|
|
970
979
|
resourcesHandler: e
|
|
971
980
|
}) => {
|
|
972
|
-
const t = (i) =>
|
|
981
|
+
const t = (i) => ai(i, n);
|
|
973
982
|
return (i) => i.pipe(
|
|
974
983
|
w((o) => k(e.getResource()).pipe(
|
|
975
984
|
w((s) => s instanceof URL && n.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
|
|
@@ -979,7 +988,7 @@ const Ot = (n, e) => {
|
|
|
979
988
|
"text/html",
|
|
980
989
|
"text/xml"
|
|
981
990
|
].includes(n.mediaType) || // no encoding ? then try to detect html
|
|
982
|
-
!n.mediaType &&
|
|
991
|
+
!n.mediaType && ii.some(
|
|
983
992
|
(a) => n.href.endsWith(a)
|
|
984
993
|
)) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? k(e.fetchResource()) : v(s)).pipe(
|
|
985
994
|
w((a) => {
|
|
@@ -994,14 +1003,14 @@ const Ot = (n, e) => {
|
|
|
994
1003
|
}
|
|
995
1004
|
}),
|
|
996
1005
|
S(() => o),
|
|
997
|
-
|
|
1006
|
+
Pe((a) => (D.error(
|
|
998
1007
|
`Error while trying to fetch or load resource for item ${n.id}`,
|
|
999
1008
|
s
|
|
1000
|
-
),
|
|
1009
|
+
), D.error(a), v(o)))
|
|
1001
1010
|
))
|
|
1002
1011
|
))
|
|
1003
1012
|
);
|
|
1004
|
-
},
|
|
1013
|
+
}, ui = () => {
|
|
1005
1014
|
const n = document.createElement("iframe");
|
|
1006
1015
|
return n.frameBorder = "no", n.tabIndex = 0, n.setAttribute(
|
|
1007
1016
|
"sandbox",
|
|
@@ -1016,12 +1025,12 @@ const Ot = (n, e) => {
|
|
|
1016
1025
|
border: 0px none transparent;
|
|
1017
1026
|
padding: 0px;
|
|
1018
1027
|
`, n.setAttribute("role", "main"), n;
|
|
1019
|
-
},
|
|
1028
|
+
}, li = "body{margin:0}html,body{height:100%;width:100%}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] body{display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=left] body{justify-content:flex-end}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=right] body{justify-content:flex-start}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=none] body{justify-content:center}:not(html.prose-reader-html-renderer-touch-enabled),:not(html.prose-reader-html-renderer-touch-enabled) body{touch-action:none}img{-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] img{max-width:100%;height:100%;object-fit:contain}", jt = ({
|
|
1020
1029
|
pageHeight: n,
|
|
1021
1030
|
pageWidth: e,
|
|
1022
1031
|
frameElement: t
|
|
1023
1032
|
}) => {
|
|
1024
|
-
const i =
|
|
1033
|
+
const i = Ke(t);
|
|
1025
1034
|
if (t?.contentDocument && t.contentWindow && i) {
|
|
1026
1035
|
const o = e / (i.width ?? 1);
|
|
1027
1036
|
return { computedScale: Math.min(
|
|
@@ -1029,9 +1038,9 @@ const Ot = (n, e) => {
|
|
|
1029
1038
|
n / (i.height ?? 1)
|
|
1030
1039
|
), computedWidthScale: o, viewportDimensions: i };
|
|
1031
1040
|
}
|
|
1032
|
-
},
|
|
1041
|
+
}, lt = (n, e) => {
|
|
1033
1042
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1034
|
-
},
|
|
1043
|
+
}, di = ({
|
|
1035
1044
|
minPageSpread: n,
|
|
1036
1045
|
blankPagePosition: e,
|
|
1037
1046
|
spreadPosition: t,
|
|
@@ -1046,10 +1055,10 @@ const Ot = (n, e) => {
|
|
|
1046
1055
|
if (s.contentDocument?.documentElement && s.contentDocument?.documentElement.setAttribute(
|
|
1047
1056
|
"data-prose-reader-html-renderer-has-viewport-dimensions",
|
|
1048
1057
|
l.toString()
|
|
1049
|
-
), c ?
|
|
1058
|
+
), c ? lt(s, {
|
|
1050
1059
|
width: c.width ?? 1,
|
|
1051
1060
|
height: c.height ?? 1
|
|
1052
|
-
}) :
|
|
1061
|
+
}) : lt(s, {
|
|
1053
1062
|
width: d,
|
|
1054
1063
|
height: g
|
|
1055
1064
|
}), c) {
|
|
@@ -1070,7 +1079,7 @@ const Ot = (n, e) => {
|
|
|
1070
1079
|
return { width: a, height: g };
|
|
1071
1080
|
}
|
|
1072
1081
|
return { width: a, height: i };
|
|
1073
|
-
},
|
|
1082
|
+
}, pi = () => `
|
|
1074
1083
|
body {
|
|
1075
1084
|
margin: 0;
|
|
1076
1085
|
}
|
|
@@ -1087,7 +1096,7 @@ const Ot = (n, e) => {
|
|
|
1087
1096
|
html, body {
|
|
1088
1097
|
touch-action: none;
|
|
1089
1098
|
}
|
|
1090
|
-
`,
|
|
1099
|
+
`, gi = ({
|
|
1091
1100
|
isScrollable: n,
|
|
1092
1101
|
enableTouch: e
|
|
1093
1102
|
}) => `
|
|
@@ -1112,7 +1121,7 @@ const Ot = (n, e) => {
|
|
|
1112
1121
|
display: block;
|
|
1113
1122
|
}
|
|
1114
1123
|
` : ""}
|
|
1115
|
-
`,
|
|
1124
|
+
`, hi = ({
|
|
1116
1125
|
width: n,
|
|
1117
1126
|
columnHeight: e,
|
|
1118
1127
|
columnWidth: t
|
|
@@ -1180,7 +1189,7 @@ const Ot = (n, e) => {
|
|
|
1180
1189
|
td {
|
|
1181
1190
|
max-width: ${t}px;
|
|
1182
1191
|
}
|
|
1183
|
-
`,
|
|
1192
|
+
`, mi = ({
|
|
1184
1193
|
isUsingVerticalWriting: n,
|
|
1185
1194
|
minimumWidth: e,
|
|
1186
1195
|
pageHeight: t,
|
|
@@ -1196,7 +1205,7 @@ const Ot = (n, e) => {
|
|
|
1196
1205
|
};
|
|
1197
1206
|
}, ve = (n, e) => {
|
|
1198
1207
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1199
|
-
},
|
|
1208
|
+
}, fi = ({
|
|
1200
1209
|
pageHeight: n,
|
|
1201
1210
|
pageWidth: e,
|
|
1202
1211
|
frameElement: t,
|
|
@@ -1221,7 +1230,7 @@ const Ot = (n, e) => {
|
|
|
1221
1230
|
oe(
|
|
1222
1231
|
t,
|
|
1223
1232
|
"prose-reader-html-renderer-framce-css",
|
|
1224
|
-
|
|
1233
|
+
pi()
|
|
1225
1234
|
), ve(t, {
|
|
1226
1235
|
width: p.width ?? 1,
|
|
1227
1236
|
height: p.height ?? 1
|
|
@@ -1233,11 +1242,11 @@ const Ot = (n, e) => {
|
|
|
1233
1242
|
`translate(-50%, -50%) scale(${h})`
|
|
1234
1243
|
), t?.style.setProperty("transform-origin", "center center");
|
|
1235
1244
|
else {
|
|
1236
|
-
const b = a ?
|
|
1245
|
+
const b = a ? gi({
|
|
1237
1246
|
isScrollable: i?.renditionFlow === "scrolled-continuous",
|
|
1238
1247
|
enableTouch: c
|
|
1239
|
-
}) :
|
|
1240
|
-
|
|
1248
|
+
}) : hi(
|
|
1249
|
+
mi({
|
|
1241
1250
|
isUsingVerticalWriting: u,
|
|
1242
1251
|
minimumWidth: l,
|
|
1243
1252
|
pageHeight: g,
|
|
@@ -1269,32 +1278,32 @@ const Ot = (n, e) => {
|
|
|
1269
1278
|
return y % l === 0 ? t?.style.setProperty("margin-left", "0px") : (y = y + e, s && !u && t?.style.setProperty("margin-left", `${e}px`)), { width: y, height: f };
|
|
1270
1279
|
}
|
|
1271
1280
|
};
|
|
1272
|
-
class
|
|
1281
|
+
class yi extends ye {
|
|
1273
1282
|
constructor() {
|
|
1274
|
-
super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ??
|
|
1283
|
+
super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ?? Ce(this.item.href))?.startsWith("image/");
|
|
1275
1284
|
}
|
|
1276
1285
|
onCreateDocument() {
|
|
1277
|
-
const e =
|
|
1286
|
+
const e = ui();
|
|
1278
1287
|
return this.setDocumentContainer(e), v(e);
|
|
1279
1288
|
}
|
|
1280
1289
|
onLoadDocument() {
|
|
1281
1290
|
const e = this.getFrameElement();
|
|
1282
1291
|
if (!e) throw new Error("invalid frame");
|
|
1283
1292
|
return v(e).pipe(
|
|
1284
|
-
|
|
1293
|
+
ci({
|
|
1285
1294
|
item: this.item,
|
|
1286
1295
|
resourcesHandler: this.resourcesHandler,
|
|
1287
1296
|
settings: this.settings
|
|
1288
1297
|
}),
|
|
1289
|
-
|
|
1298
|
+
Ae(this.context.bridgeEvent.viewportFree$),
|
|
1290
1299
|
x(() => {
|
|
1291
1300
|
this.attach();
|
|
1292
1301
|
}),
|
|
1293
1302
|
jn,
|
|
1294
1303
|
x((t) => {
|
|
1295
|
-
this.isPrePaginated() ? oe(t, "prose-reader-css",
|
|
1304
|
+
this.isPrePaginated() ? oe(t, "prose-reader-css", li) : this.isImageType();
|
|
1296
1305
|
}),
|
|
1297
|
-
|
|
1306
|
+
ti({
|
|
1298
1307
|
context: this.context,
|
|
1299
1308
|
item: this.item,
|
|
1300
1309
|
settings: this.settings
|
|
@@ -1303,7 +1312,7 @@ class fi extends ye {
|
|
|
1303
1312
|
);
|
|
1304
1313
|
}
|
|
1305
1314
|
onUnload() {
|
|
1306
|
-
return
|
|
1315
|
+
return ni(this.getFrameElement()), this.detach(), _;
|
|
1307
1316
|
}
|
|
1308
1317
|
onLayout({
|
|
1309
1318
|
minPageSpread: e,
|
|
@@ -1321,7 +1330,7 @@ class fi extends ye {
|
|
|
1321
1330
|
) : r.contentDocument?.documentElement.classList.remove(
|
|
1322
1331
|
"prose-reader-html-renderer-touch-enabled"
|
|
1323
1332
|
)), this.isPrePaginated()) {
|
|
1324
|
-
const l =
|
|
1333
|
+
const l = di({
|
|
1325
1334
|
blankPagePosition: t,
|
|
1326
1335
|
frameElement: r,
|
|
1327
1336
|
isRTL: this.context.isRTL(),
|
|
@@ -1332,7 +1341,7 @@ class fi extends ye {
|
|
|
1332
1341
|
});
|
|
1333
1342
|
return v(l);
|
|
1334
1343
|
}
|
|
1335
|
-
const u =
|
|
1344
|
+
const u = fi({
|
|
1336
1345
|
pageHeight: s,
|
|
1337
1346
|
pageWidth: o,
|
|
1338
1347
|
frameElement: r,
|
|
@@ -1405,13 +1414,13 @@ class fi extends ye {
|
|
|
1405
1414
|
return this.getFrameElement();
|
|
1406
1415
|
}
|
|
1407
1416
|
}
|
|
1408
|
-
const
|
|
1417
|
+
const Si = (n) => (e) => {
|
|
1409
1418
|
const t = n({
|
|
1410
1419
|
...e,
|
|
1411
1420
|
getRenderer(o) {
|
|
1412
|
-
return e.getRenderer?.(o) ?? ((r) => new
|
|
1421
|
+
return e.getRenderer?.(o) ?? ((r) => new yi(r));
|
|
1413
1422
|
}
|
|
1414
|
-
}), i =
|
|
1423
|
+
}), i = Jn(t);
|
|
1415
1424
|
return i.pipe(T(t.$.destroy$)).subscribe(), {
|
|
1416
1425
|
...t,
|
|
1417
1426
|
links$: i
|
|
@@ -1420,7 +1429,7 @@ const yi = (n) => (e) => {
|
|
|
1420
1429
|
function Z(n) {
|
|
1421
1430
|
return n != null;
|
|
1422
1431
|
}
|
|
1423
|
-
class
|
|
1432
|
+
class it {
|
|
1424
1433
|
constructor(e) {
|
|
1425
1434
|
this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.width = e.width, this.height = e.height, this.x = e.x, this.y = e.y;
|
|
1426
1435
|
}
|
|
@@ -1430,22 +1439,22 @@ class E {
|
|
|
1430
1439
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPosition"), this.x = e.x, this.y = e.y;
|
|
1431
1440
|
}
|
|
1432
1441
|
}
|
|
1433
|
-
class
|
|
1442
|
+
class Oe {
|
|
1434
1443
|
constructor(e) {
|
|
1435
1444
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPagePosition"), this.x = e.x, this.y = e.y;
|
|
1436
1445
|
}
|
|
1437
1446
|
}
|
|
1438
|
-
class
|
|
1447
|
+
class Ii extends it {
|
|
1439
1448
|
constructor() {
|
|
1440
1449
|
super(...arguments), this.__symbol = "SpineItemPageLayout";
|
|
1441
1450
|
}
|
|
1442
1451
|
}
|
|
1443
|
-
class
|
|
1452
|
+
class Ve extends it {
|
|
1444
1453
|
constructor() {
|
|
1445
1454
|
super(...arguments), this.__symbol = "SpineItemSpineLayout";
|
|
1446
1455
|
}
|
|
1447
1456
|
}
|
|
1448
|
-
class
|
|
1457
|
+
class bi extends it {
|
|
1449
1458
|
constructor() {
|
|
1450
1459
|
super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
|
|
1451
1460
|
}
|
|
@@ -1471,17 +1480,17 @@ class ae extends kt {
|
|
|
1471
1480
|
return new ae(e);
|
|
1472
1481
|
}
|
|
1473
1482
|
}
|
|
1474
|
-
const
|
|
1483
|
+
const vi = (n, e) => {
|
|
1475
1484
|
const t = e.getBoundingClientRect(), { x: i, y: o } = n, { left: s, top: r } = t, a = t.width / e.offsetWidth, c = t.height / e.offsetHeight, u = i - s, l = o - r;
|
|
1476
1485
|
return {
|
|
1477
1486
|
x: u / a,
|
|
1478
1487
|
y: l / c
|
|
1479
1488
|
};
|
|
1480
|
-
},
|
|
1481
|
-
|
|
1482
|
-
),
|
|
1483
|
-
getSpinePositionFromClientPosition: (e) => n.spine.element ?
|
|
1484
|
-
}),
|
|
1489
|
+
}, wi = (n, e) => new ae(
|
|
1490
|
+
vi(n, e)
|
|
1491
|
+
), Pi = (n) => ({
|
|
1492
|
+
getSpinePositionFromClientPosition: (e) => n.spine.element ? wi(e, n.spine.element) : void 0
|
|
1493
|
+
}), xi = (n) => {
|
|
1485
1494
|
let e;
|
|
1486
1495
|
const t = n.context.watch("rootElement").pipe(
|
|
1487
1496
|
Y((c) => c ? new ce(() => (e = c.ownerDocument.createElement("div"), e.style.cssText = `
|
|
@@ -1520,7 +1529,7 @@ const bi = (n, e) => {
|
|
|
1520
1529
|
K(n.$.destroy$)
|
|
1521
1530
|
);
|
|
1522
1531
|
return P(t, a);
|
|
1523
|
-
},
|
|
1532
|
+
}, $i = `${W}-enhancer-loading`, Ut = `${$i}-container`, Ti = ({
|
|
1524
1533
|
container: n,
|
|
1525
1534
|
item: e,
|
|
1526
1535
|
viewport: t
|
|
@@ -1555,14 +1564,14 @@ const bi = (n, e) => {
|
|
|
1555
1564
|
max-width: 300px;
|
|
1556
1565
|
width: 80%;
|
|
1557
1566
|
`, i.appendChild(o), i.appendChild(s), i;
|
|
1558
|
-
},
|
|
1567
|
+
}, Fi = (n) => n.spineItemsManager.items$.pipe(
|
|
1559
1568
|
Y(
|
|
1560
1569
|
(e) => P(
|
|
1561
1570
|
...e.map((t) => {
|
|
1562
1571
|
t.containerElement.style.zIndex = "0";
|
|
1563
1572
|
const i = t.containerElement.querySelector(
|
|
1564
1573
|
`.${Ut}`
|
|
1565
|
-
), o = i instanceof HTMLElement ? i :
|
|
1574
|
+
), o = i instanceof HTMLElement ? i : Ti({
|
|
1566
1575
|
container: t.containerElement,
|
|
1567
1576
|
item: t.item,
|
|
1568
1577
|
viewport: n.viewport
|
|
@@ -1600,18 +1609,18 @@ const bi = (n, e) => {
|
|
|
1600
1609
|
})
|
|
1601
1610
|
)
|
|
1602
1611
|
)
|
|
1603
|
-
),
|
|
1612
|
+
), Li = (n) => {
|
|
1604
1613
|
n.hookManager.register("item.onDocumentLoad", ({ itemId: e }) => {
|
|
1605
1614
|
n.spineItemsManager.get(e)?.renderer.getDocumentFrame()?.setAttribute("scrolling", "no");
|
|
1606
1615
|
});
|
|
1607
|
-
},
|
|
1616
|
+
}, Mi = (n) => {
|
|
1608
1617
|
n.hookManager.register(
|
|
1609
1618
|
"item.onAfterLayout",
|
|
1610
1619
|
({ item: e, blankPagePosition: t, minimumWidth: i }) => {
|
|
1611
1620
|
const o = n.spineItemsManager.get(e.id), s = o?.renderer.getDocumentFrame();
|
|
1612
1621
|
if (o?.renditionLayout !== "reflowable" || !(s instanceof HTMLIFrameElement))
|
|
1613
1622
|
return;
|
|
1614
|
-
const { hasViewport: r } =
|
|
1623
|
+
const { hasViewport: r } = Ke(s), { width: a } = n.viewport.pageSize, c = o?.renderer.getDocumentFrame();
|
|
1615
1624
|
if (r) {
|
|
1616
1625
|
const u = a < i;
|
|
1617
1626
|
t === "none" && u && c instanceof HTMLIFrameElement && c?.style.setProperty(
|
|
@@ -1621,12 +1630,12 @@ const bi = (n, e) => {
|
|
|
1621
1630
|
}
|
|
1622
1631
|
}
|
|
1623
1632
|
);
|
|
1624
|
-
},
|
|
1633
|
+
}, Ci = (n) => n.spineItemsObserver.states$.pipe(
|
|
1625
1634
|
x(({ item: e, isReady: t, isDirty: i }) => {
|
|
1626
1635
|
e.containerElement.dataset.isDirty = i.toString(), e.containerElement.dataset.isReady = t.toString();
|
|
1627
1636
|
})
|
|
1628
1637
|
);
|
|
1629
|
-
let
|
|
1638
|
+
let Ei = class extends Rt {
|
|
1630
1639
|
computeOutputSettings(e) {
|
|
1631
1640
|
return e;
|
|
1632
1641
|
}
|
|
@@ -1652,7 +1661,7 @@ let Ci = class extends Rt {
|
|
|
1652
1661
|
};
|
|
1653
1662
|
}
|
|
1654
1663
|
};
|
|
1655
|
-
const
|
|
1664
|
+
const Di = (n) => j([
|
|
1656
1665
|
n.viewport.watch(["width", "height"]),
|
|
1657
1666
|
n.context.watch("manifest")
|
|
1658
1667
|
]).pipe(
|
|
@@ -1660,13 +1669,13 @@ const Ei = (n) => j([
|
|
|
1660
1669
|
const o = e > t;
|
|
1661
1670
|
return !o && i?.renditionSpread === "portrait" ? n.settings.update({ spreadMode: !0 }) : o && (i?.renditionSpread === void 0 || i?.renditionSpread === "auto" || i?.renditionSpread === "landscape" || i?.renditionSpread === "both") ? n.settings.update({ spreadMode: !0 }) : n.settings.update({ spreadMode: !1 });
|
|
1662
1671
|
})
|
|
1663
|
-
),
|
|
1672
|
+
), Ai = (n) => (e) => {
|
|
1664
1673
|
const {
|
|
1665
1674
|
pageHorizontalMargin: t,
|
|
1666
1675
|
pageVerticalMargin: i,
|
|
1667
1676
|
layoutAutoResize: o,
|
|
1668
1677
|
layoutLayerTransition: s
|
|
1669
|
-
} = e, r = n(e), a = new
|
|
1678
|
+
} = e, r = n(e), a = new Ei(
|
|
1670
1679
|
{
|
|
1671
1680
|
pageHorizontalMargin: t,
|
|
1672
1681
|
pageVerticalMargin: i,
|
|
@@ -1682,7 +1691,7 @@ const Ei = (n) => j([
|
|
|
1682
1691
|
!m && f && (f.getBoundingClientRect().left, m = !0);
|
|
1683
1692
|
});
|
|
1684
1693
|
}), r.hookManager.register("item.onBeforeLayout", ({ item: m }) => {
|
|
1685
|
-
const y = r.spineItemsManager.get(m.id), I = !!(m.mediaType ??
|
|
1694
|
+
const y = r.spineItemsManager.get(m.id), I = !!(m.mediaType ?? Ce(m.href))?.startsWith("image/"), { pageHorizontalMargin: b = 0, pageVerticalMargin: F = 0 } = a.values, $ = r.viewport.pageSize;
|
|
1686
1695
|
if (y?.renditionLayout === "reflowable" && !I) {
|
|
1687
1696
|
let L = $.width - b * 2;
|
|
1688
1697
|
const H = $.height - F * 2;
|
|
@@ -1713,7 +1722,7 @@ const Ei = (n) => j([
|
|
|
1713
1722
|
`
|
|
1714
1723
|
);
|
|
1715
1724
|
}
|
|
1716
|
-
}),
|
|
1725
|
+
}), Mi(r), Li(r), r.hookManager.register(
|
|
1717
1726
|
"item.onDocumentCreated",
|
|
1718
1727
|
({ documentContainer: m }) => {
|
|
1719
1728
|
m.style.opacity = "0", a.values.layoutLayerTransition && (m.style.transition = "opacity 300ms");
|
|
@@ -1732,13 +1741,13 @@ const Ei = (n) => j([
|
|
|
1732
1741
|
pe(({ layoutAutoResize: m }) => m === "container"),
|
|
1733
1742
|
Y(() => r.context.watch("rootElement")),
|
|
1734
1743
|
pe(Z),
|
|
1735
|
-
Y((m) =>
|
|
1744
|
+
Y((m) => et(m)),
|
|
1736
1745
|
In(100),
|
|
1737
1746
|
pe(Z),
|
|
1738
1747
|
V(() => {
|
|
1739
1748
|
r?.layout();
|
|
1740
1749
|
})
|
|
1741
|
-
), l =
|
|
1750
|
+
), l = xi(r);
|
|
1742
1751
|
a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
|
|
1743
1752
|
Lt(1),
|
|
1744
1753
|
V(() => {
|
|
@@ -1747,8 +1756,8 @@ const Ei = (n) => j([
|
|
|
1747
1756
|
K(r.$.destroy$)
|
|
1748
1757
|
).subscribe();
|
|
1749
1758
|
const d = r.spine.pages.pipe(
|
|
1750
|
-
|
|
1751
|
-
), g =
|
|
1759
|
+
Ze({ refCount: !0, bufferSize: 1 })
|
|
1760
|
+
), g = Ci(r), p = Di(r), h = Fi(r);
|
|
1752
1761
|
return P(
|
|
1753
1762
|
c,
|
|
1754
1763
|
l,
|
|
@@ -1765,10 +1774,10 @@ const Ei = (n) => j([
|
|
|
1765
1774
|
settings: a,
|
|
1766
1775
|
layout$: r.spine.layout$,
|
|
1767
1776
|
layoutInfo$: d,
|
|
1768
|
-
coordinates:
|
|
1777
|
+
coordinates: Pi(r)
|
|
1769
1778
|
};
|
|
1770
1779
|
};
|
|
1771
|
-
class
|
|
1780
|
+
class Ni extends ye {
|
|
1772
1781
|
getImageElement() {
|
|
1773
1782
|
const e = this.documentContainer;
|
|
1774
1783
|
if (e instanceof HTMLImageElement)
|
|
@@ -1820,12 +1829,12 @@ class Ai extends ye {
|
|
|
1820
1829
|
getDocumentFrame() {
|
|
1821
1830
|
}
|
|
1822
1831
|
}
|
|
1823
|
-
const
|
|
1832
|
+
const Ri = (n) => (e) => {
|
|
1824
1833
|
const t = n({
|
|
1825
1834
|
...e,
|
|
1826
1835
|
getRenderer(r) {
|
|
1827
|
-
const a = e.getRenderer?.(r), u = !!(r.mediaType ??
|
|
1828
|
-
return !a && u ? (l) => new
|
|
1836
|
+
const a = e.getRenderer?.(r), u = !!(r.mediaType ?? Ce(r.href))?.startsWith("image/");
|
|
1837
|
+
return !a && u ? (l) => new Ni(l) : a;
|
|
1829
1838
|
}
|
|
1830
1839
|
}), i = new IntersectionObserver(
|
|
1831
1840
|
(r) => {
|
|
@@ -1875,7 +1884,7 @@ const Ni = (n) => (e) => {
|
|
|
1875
1884
|
i.disconnect(), o.disconnect(), t.destroy();
|
|
1876
1885
|
}
|
|
1877
1886
|
};
|
|
1878
|
-
},
|
|
1887
|
+
}, Oi = (n, e) => n.links$.pipe(
|
|
1879
1888
|
x((t) => {
|
|
1880
1889
|
if (!Rn(t.target, "a") || t.type !== "click") return;
|
|
1881
1890
|
const i = new URL(t.target.href), o = `${i.origin}${i.pathname}`;
|
|
@@ -1883,7 +1892,7 @@ const Ni = (n) => (e) => {
|
|
|
1883
1892
|
(r) => r.href === o
|
|
1884
1893
|
) && e.goToUrl(i);
|
|
1885
1894
|
})
|
|
1886
|
-
), ee =
|
|
1895
|
+
), ee = D.namespace("navigation"), Vi = ({
|
|
1887
1896
|
position: n,
|
|
1888
1897
|
spineItem: e,
|
|
1889
1898
|
pageHeight: t,
|
|
@@ -1901,7 +1910,7 @@ const Ni = (n) => (e) => {
|
|
|
1901
1910
|
s,
|
|
1902
1911
|
e
|
|
1903
1912
|
);
|
|
1904
|
-
},
|
|
1913
|
+
}, dt = ({
|
|
1905
1914
|
position: n,
|
|
1906
1915
|
navigationResolver: e,
|
|
1907
1916
|
computedPageTurnDirection: t,
|
|
@@ -1915,7 +1924,7 @@ const Ni = (n) => (e) => {
|
|
|
1915
1924
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
1916
1925
|
n,
|
|
1917
1926
|
a
|
|
1918
|
-
), l =
|
|
1927
|
+
), l = Vi({
|
|
1919
1928
|
position: u,
|
|
1920
1929
|
spineItem: a,
|
|
1921
1930
|
pageHeight: s.pageSize.height,
|
|
@@ -1937,7 +1946,7 @@ const Ni = (n) => (e) => {
|
|
|
1937
1946
|
x: 0
|
|
1938
1947
|
})
|
|
1939
1948
|
);
|
|
1940
|
-
},
|
|
1949
|
+
}, ji = ({
|
|
1941
1950
|
position: n,
|
|
1942
1951
|
spineItem: e,
|
|
1943
1952
|
context: t,
|
|
@@ -1948,7 +1957,7 @@ const Ni = (n) => (e) => {
|
|
|
1948
1957
|
viewport: a,
|
|
1949
1958
|
settings: c
|
|
1950
1959
|
}) => {
|
|
1951
|
-
const u =
|
|
1960
|
+
const u = dt({
|
|
1952
1961
|
position: n,
|
|
1953
1962
|
viewport: a,
|
|
1954
1963
|
navigationResolver: i,
|
|
@@ -1970,7 +1979,7 @@ const Ni = (n) => (e) => {
|
|
|
1970
1979
|
);
|
|
1971
1980
|
if (r === "vertical" && n.y !== u.y)
|
|
1972
1981
|
return i.getAdjustedPositionForSpread(u);
|
|
1973
|
-
const l =
|
|
1982
|
+
const l = dt({
|
|
1974
1983
|
position: u,
|
|
1975
1984
|
viewport: a,
|
|
1976
1985
|
navigationResolver: i,
|
|
@@ -1981,7 +1990,7 @@ const Ni = (n) => (e) => {
|
|
|
1981
1990
|
return i.getAdjustedPositionForSpread(l);
|
|
1982
1991
|
}
|
|
1983
1992
|
return i.getAdjustedPositionForSpread(u);
|
|
1984
|
-
},
|
|
1993
|
+
}, ki = ({
|
|
1985
1994
|
position: n,
|
|
1986
1995
|
spineItem: e,
|
|
1987
1996
|
pageHeight: t,
|
|
@@ -1999,7 +2008,7 @@ const Ni = (n) => (e) => {
|
|
|
1999
2008
|
s,
|
|
2000
2009
|
e
|
|
2001
2010
|
);
|
|
2002
|
-
},
|
|
2011
|
+
}, pt = ({
|
|
2003
2012
|
position: n,
|
|
2004
2013
|
navigationResolver: e,
|
|
2005
2014
|
computedPageTurnDirection: t,
|
|
@@ -2013,7 +2022,7 @@ const Ni = (n) => (e) => {
|
|
|
2013
2022
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2014
2023
|
n,
|
|
2015
2024
|
a
|
|
2016
|
-
), l =
|
|
2025
|
+
), l = ki({
|
|
2017
2026
|
position: u,
|
|
2018
2027
|
spineItem: a,
|
|
2019
2028
|
pageHeight: s.pageSize.height,
|
|
@@ -2035,7 +2044,7 @@ const Ni = (n) => (e) => {
|
|
|
2035
2044
|
x: 0
|
|
2036
2045
|
})
|
|
2037
2046
|
);
|
|
2038
|
-
},
|
|
2047
|
+
}, Ui = ({
|
|
2039
2048
|
position: n,
|
|
2040
2049
|
spineItem: e,
|
|
2041
2050
|
context: t,
|
|
@@ -2046,7 +2055,7 @@ const Ni = (n) => (e) => {
|
|
|
2046
2055
|
viewport: a,
|
|
2047
2056
|
settings: c
|
|
2048
2057
|
}) => {
|
|
2049
|
-
const u =
|
|
2058
|
+
const u = pt({
|
|
2050
2059
|
position: n,
|
|
2051
2060
|
viewport: a,
|
|
2052
2061
|
navigationResolver: i,
|
|
@@ -2071,7 +2080,7 @@ const Ni = (n) => (e) => {
|
|
|
2071
2080
|
);
|
|
2072
2081
|
if (r === "vertical" && n.y !== u.y)
|
|
2073
2082
|
return i.getAdjustedPositionForSpread(u);
|
|
2074
|
-
const l =
|
|
2083
|
+
const l = pt({
|
|
2075
2084
|
position: u,
|
|
2076
2085
|
viewport: a,
|
|
2077
2086
|
navigationResolver: i,
|
|
@@ -2083,7 +2092,7 @@ const Ni = (n) => (e) => {
|
|
|
2083
2092
|
}
|
|
2084
2093
|
return i.getAdjustedPositionForSpread(u);
|
|
2085
2094
|
};
|
|
2086
|
-
class
|
|
2095
|
+
class zi {
|
|
2087
2096
|
constructor(e) {
|
|
2088
2097
|
this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2089
2098
|
}
|
|
@@ -2102,7 +2111,7 @@ class Ui {
|
|
|
2102
2111
|
turnRightOrBottom() {
|
|
2103
2112
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2104
2113
|
if (!t) return;
|
|
2105
|
-
const i =
|
|
2114
|
+
const i = Ui({
|
|
2106
2115
|
context: this.reader.context,
|
|
2107
2116
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2108
2117
|
position: e.position,
|
|
@@ -2120,7 +2129,7 @@ class Ui {
|
|
|
2120
2129
|
turnLeftOrTop() {
|
|
2121
2130
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2122
2131
|
if (!t) return;
|
|
2123
|
-
const i =
|
|
2132
|
+
const i = ji({
|
|
2124
2133
|
context: this.reader.context,
|
|
2125
2134
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2126
2135
|
position: e.position,
|
|
@@ -2262,7 +2271,7 @@ class Ui {
|
|
|
2262
2271
|
}
|
|
2263
2272
|
}
|
|
2264
2273
|
}
|
|
2265
|
-
class
|
|
2274
|
+
class Wi extends Q {
|
|
2266
2275
|
constructor(e) {
|
|
2267
2276
|
super({
|
|
2268
2277
|
lastDelta: { x: 0, y: 0 },
|
|
@@ -2327,8 +2336,8 @@ class G {
|
|
|
2327
2336
|
this.isDestroyed || (this.isDestroyed = !0, this.destroySubject.next(), this.destroySubject.complete());
|
|
2328
2337
|
}
|
|
2329
2338
|
}
|
|
2330
|
-
const
|
|
2331
|
-
class
|
|
2339
|
+
const _i = 500;
|
|
2340
|
+
class Hi extends G {
|
|
2332
2341
|
constructor(e, t) {
|
|
2333
2342
|
super(), this.scrollNavigationController = e, this.locker = t, this.navigationSubject = new N(), this.navigation$ = this.navigationSubject.asObservable();
|
|
2334
2343
|
const i = this.scrollNavigationController.userScroll$.pipe(
|
|
@@ -2339,7 +2348,7 @@ class _i extends G {
|
|
|
2339
2348
|
v(o)
|
|
2340
2349
|
).pipe(
|
|
2341
2350
|
Ie(
|
|
2342
|
-
|
|
2351
|
+
_i,
|
|
2343
2352
|
re
|
|
2344
2353
|
),
|
|
2345
2354
|
U(),
|
|
@@ -2362,7 +2371,7 @@ class _i extends G {
|
|
|
2362
2371
|
P(i).pipe(T(this.destroy$)).subscribe();
|
|
2363
2372
|
}
|
|
2364
2373
|
}
|
|
2365
|
-
const
|
|
2374
|
+
const Bi = (n) => n.pagination.state$.pipe(
|
|
2366
2375
|
z(n.context.manifest$, n.settings.values$),
|
|
2367
2376
|
S(
|
|
2368
2377
|
([
|
|
@@ -2382,7 +2391,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2382
2391
|
}
|
|
2383
2392
|
),
|
|
2384
2393
|
R(O)
|
|
2385
|
-
),
|
|
2394
|
+
), Xi = ({ reader: n, duration: e }) => (t) => {
|
|
2386
2395
|
let i;
|
|
2387
2396
|
const o = () => {
|
|
2388
2397
|
i?.(), i = void 0;
|
|
@@ -2398,11 +2407,11 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2398
2407
|
x(o),
|
|
2399
2408
|
me(o)
|
|
2400
2409
|
);
|
|
2401
|
-
},
|
|
2402
|
-
const t = n(e), i =
|
|
2410
|
+
}, Yi = (n) => (e) => {
|
|
2411
|
+
const t = n(e), i = Bi(t), o = new zi(t), s = new Wi(t), r = new Hi(
|
|
2403
2412
|
t.navigation.scrollNavigationController,
|
|
2404
2413
|
t.navigation.locker
|
|
2405
|
-
), a =
|
|
2414
|
+
), a = Oi(t, o), c = r.navigation$.pipe(
|
|
2406
2415
|
x((d) => {
|
|
2407
2416
|
t.navigation.navigate(d);
|
|
2408
2417
|
})
|
|
@@ -2419,7 +2428,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2419
2428
|
navigation: {
|
|
2420
2429
|
...t.navigation,
|
|
2421
2430
|
state$: i,
|
|
2422
|
-
throttleLock: ({ duration: d, trigger: g }) => g.pipe(
|
|
2431
|
+
throttleLock: ({ duration: d, trigger: g }) => g.pipe(Xi({ duration: d, reader: t })),
|
|
2423
2432
|
panNavigator: s,
|
|
2424
2433
|
turnBottom: o.turnBottom.bind(o),
|
|
2425
2434
|
turnTop: o.turnTop.bind(o),
|
|
@@ -2467,19 +2476,19 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2467
2476
|
}
|
|
2468
2477
|
return o;
|
|
2469
2478
|
}, void 0);
|
|
2470
|
-
},
|
|
2479
|
+
}, qi = (n, e) => {
|
|
2471
2480
|
const { href: t } = e;
|
|
2472
2481
|
return zt(t, n.nav?.toc ?? [], n);
|
|
2473
|
-
},
|
|
2482
|
+
}, Gi = (n) => {
|
|
2474
2483
|
const e = n.context.manifest, t = n.spineItemsManager.items;
|
|
2475
2484
|
return e ? t.reduce(
|
|
2476
|
-
(i, { item: o }) => (i[o.id] =
|
|
2485
|
+
(i, { item: o }) => (i[o.id] = qi(e, o), i),
|
|
2477
2486
|
{}
|
|
2478
2487
|
) : {};
|
|
2479
|
-
},
|
|
2488
|
+
}, Zi = (n) => n.spineItemsManager.items$.pipe(
|
|
2480
2489
|
ne([]),
|
|
2481
|
-
S(() =>
|
|
2482
|
-
),
|
|
2490
|
+
S(() => Gi(n))
|
|
2491
|
+
), Ji = (n, e, t) => n + e * t, Ki = (n, e, t) => {
|
|
2483
2492
|
const { height: i, width: o } = t.layoutInfo, { top: s, left: r } = n.spine.getSpineItemSpineLayoutInfo(t);
|
|
2484
2493
|
return n.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
|
|
2485
2494
|
0,
|
|
@@ -2494,7 +2503,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2494
2503
|
(e.x - r + n.viewport.absoluteViewport.width) / o
|
|
2495
2504
|
)
|
|
2496
2505
|
);
|
|
2497
|
-
},
|
|
2506
|
+
}, Qi = (n, e, t, i, o) => o.isReady$.pipe(
|
|
2498
2507
|
U(),
|
|
2499
2508
|
z(n.layoutInfo$),
|
|
2500
2509
|
S(([s, r]) => {
|
|
@@ -2504,17 +2513,17 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2504
2513
|
let m = (t + 1) * (h / p);
|
|
2505
2514
|
!c && o.renditionLayout === "reflowable" && !s && (m = 0);
|
|
2506
2515
|
let y = l + m;
|
|
2507
|
-
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m =
|
|
2516
|
+
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m = Ki(
|
|
2508
2517
|
n,
|
|
2509
2518
|
i,
|
|
2510
2519
|
o
|
|
2511
|
-
) : m = 0, y =
|
|
2520
|
+
) : m = 0, y = Ji(
|
|
2512
2521
|
l,
|
|
2513
2522
|
h,
|
|
2514
2523
|
m
|
|
2515
2524
|
)), e === u - 1 && t === p - 1 && y > 0.99 ? 1 : y;
|
|
2516
2525
|
})
|
|
2517
|
-
),
|
|
2526
|
+
), eo = (n) => n.spine.layout$.pipe(
|
|
2518
2527
|
Ie(10, re),
|
|
2519
2528
|
z(n.pagination.state$),
|
|
2520
2529
|
S(() => ({
|
|
@@ -2532,7 +2541,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2532
2541
|
numberOfPagesPerItems: [],
|
|
2533
2542
|
numberOfTotalPages: 0
|
|
2534
2543
|
})
|
|
2535
|
-
),
|
|
2544
|
+
), to = (n, e, t, i) => {
|
|
2536
2545
|
const o = e.beginSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.beginSpineItemIndex) : void 0, s = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2537
2546
|
return v({
|
|
2538
2547
|
...e,
|
|
@@ -2563,7 +2572,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2563
2572
|
// hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
|
|
2564
2573
|
// numberOfSpineItems: context.manifest?.readingOrder.length,
|
|
2565
2574
|
});
|
|
2566
|
-
},
|
|
2575
|
+
}, no = (n) => j([
|
|
2567
2576
|
n.pagination.state$,
|
|
2568
2577
|
// Usually pagination change if layout changes (number of pages) however it is especially
|
|
2569
2578
|
// useful for like webtoon where you still have one page but only the layout will give you the final size
|
|
@@ -2572,7 +2581,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2572
2581
|
]).pipe(
|
|
2573
2582
|
w(([e]) => {
|
|
2574
2583
|
const t = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2575
|
-
return t ?
|
|
2584
|
+
return t ? Qi(
|
|
2576
2585
|
n,
|
|
2577
2586
|
e.endSpineItemIndex ?? 0,
|
|
2578
2587
|
e.endPageIndexInSpineItem || 0,
|
|
@@ -2580,8 +2589,8 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2580
2589
|
t
|
|
2581
2590
|
) : v(0);
|
|
2582
2591
|
})
|
|
2583
|
-
),
|
|
2584
|
-
const e =
|
|
2592
|
+
), io = (n) => {
|
|
2593
|
+
const e = Zi(n), t = eo(n), i = new q({
|
|
2585
2594
|
...n.pagination.state,
|
|
2586
2595
|
beginChapterInfo: void 0,
|
|
2587
2596
|
beginCfi: void 0,
|
|
@@ -2599,10 +2608,10 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2599
2608
|
}), o = j([
|
|
2600
2609
|
n.pagination.state$,
|
|
2601
2610
|
e,
|
|
2602
|
-
|
|
2611
|
+
no(n)
|
|
2603
2612
|
]).pipe(
|
|
2604
2613
|
w(
|
|
2605
|
-
([r, a, c]) =>
|
|
2614
|
+
([r, a, c]) => to(
|
|
2606
2615
|
n,
|
|
2607
2616
|
r,
|
|
2608
2617
|
a,
|
|
@@ -2637,7 +2646,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2637
2646
|
}),
|
|
2638
2647
|
J(1)
|
|
2639
2648
|
), getPaginationInfo: () => i.value };
|
|
2640
|
-
}, de = (n) =>
|
|
2649
|
+
}, de = (n) => _e({
|
|
2641
2650
|
spineIndex: n.index,
|
|
2642
2651
|
spineId: n.id
|
|
2643
2652
|
}), Wt = ({
|
|
@@ -2646,7 +2655,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2646
2655
|
item: t
|
|
2647
2656
|
}) => {
|
|
2648
2657
|
const i = "ownerDocument" in n ? n.ownerDocument : n.startContainer.ownerDocument;
|
|
2649
|
-
return !i || !i?.documentElement || n === i ? de(t) : On(n) ?
|
|
2658
|
+
return !i || !i?.documentElement || n === i ? de(t) : On(n) ? _e({
|
|
2650
2659
|
start: {
|
|
2651
2660
|
node: n.startContainer,
|
|
2652
2661
|
offset: n.startOffset,
|
|
@@ -2659,27 +2668,27 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2659
2668
|
spineIndex: t.index,
|
|
2660
2669
|
spineId: t.id
|
|
2661
2670
|
}
|
|
2662
|
-
}) :
|
|
2671
|
+
}) : _e({
|
|
2663
2672
|
node: n,
|
|
2664
2673
|
offset: e,
|
|
2665
2674
|
spineIndex: t.index,
|
|
2666
2675
|
spineId: t.id
|
|
2667
2676
|
});
|
|
2668
|
-
},
|
|
2677
|
+
}, Be = ({
|
|
2669
2678
|
spineItem: n,
|
|
2670
2679
|
pageNode: e
|
|
2671
2680
|
}) => Wt({
|
|
2672
2681
|
nodeOrRange: e.node,
|
|
2673
2682
|
offset: e.offset,
|
|
2674
2683
|
item: n
|
|
2675
|
-
}).trim(),
|
|
2684
|
+
}).trim(), oo = (n, e) => Wt({
|
|
2676
2685
|
nodeOrRange: n,
|
|
2677
2686
|
item: e
|
|
2678
|
-
}),
|
|
2687
|
+
}), Js = (n) => n.index.toString(), gt = (n) => n[0]?.index === 6 && n.length > 1, Xe = (n) => {
|
|
2679
2688
|
const e = Mt(n);
|
|
2680
2689
|
return wn(e);
|
|
2681
|
-
},
|
|
2682
|
-
const e = Mt(n), s = ((
|
|
2690
|
+
}, so = (n) => Array.isArray(n) ? n[0] && gt(n[0]) ? n[0] : void 0 : n.parent[0] && gt(n.parent[0]) ? n.parent[0] : void 0, ot = (n) => {
|
|
2691
|
+
const e = Mt(n), s = ((so(e) ?? [])[1]?.index ?? 2) / 2 - 1, r = Pn(e), a = r ? e.end.at(-1)?.at(-1)?.offset : e.at(-1)?.at(-1)?.offset;
|
|
2683
2692
|
return {
|
|
2684
2693
|
isCfiRange: r,
|
|
2685
2694
|
itemIndex: s,
|
|
@@ -2689,7 +2698,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2689
2698
|
cfi: n,
|
|
2690
2699
|
spineItemsManager: e
|
|
2691
2700
|
}) => {
|
|
2692
|
-
const { itemIndex: t, ...i } =
|
|
2701
|
+
const { itemIndex: t, ...i } = ot(n), o = e.get(t);
|
|
2693
2702
|
if (!o)
|
|
2694
2703
|
return {
|
|
2695
2704
|
...i,
|
|
@@ -2714,7 +2723,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2714
2723
|
spineItem: o
|
|
2715
2724
|
};
|
|
2716
2725
|
} catch (a) {
|
|
2717
|
-
return
|
|
2726
|
+
return D.warn(`Error resolving cfi: ${n}.`), D.warn(a), {
|
|
2718
2727
|
...i,
|
|
2719
2728
|
spineItem: o,
|
|
2720
2729
|
itemIndex: t,
|
|
@@ -2728,7 +2737,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2728
2737
|
spineItem: o,
|
|
2729
2738
|
node: null
|
|
2730
2739
|
};
|
|
2731
|
-
},
|
|
2740
|
+
}, ro = (n, e) => {
|
|
2732
2741
|
if ("cfi" in e) {
|
|
2733
2742
|
const { itemIndex: s, ...r } = n.cfi.parseCfi(e.cfi);
|
|
2734
2743
|
return {
|
|
@@ -2748,10 +2757,10 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2748
2757
|
itemIndex: t.index,
|
|
2749
2758
|
node: null
|
|
2750
2759
|
};
|
|
2751
|
-
},
|
|
2760
|
+
}, ao = (n, e) => {
|
|
2752
2761
|
let t = n?.itemPageIndex;
|
|
2753
2762
|
const { itemIndex: i, ...o } = e.cfi.parseCfi(n.cfi), s = e.spineItemsManager.get(i);
|
|
2754
|
-
return s ?
|
|
2763
|
+
return s ? tt().pipe(
|
|
2755
2764
|
z(s.isReady$),
|
|
2756
2765
|
S(([, r]) => {
|
|
2757
2766
|
const {
|
|
@@ -2781,7 +2790,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2781
2790
|
})
|
|
2782
2791
|
) : v({ ...n, itemIndex: i, ...o });
|
|
2783
2792
|
};
|
|
2784
|
-
class
|
|
2793
|
+
class co {
|
|
2785
2794
|
constructor(e) {
|
|
2786
2795
|
this.reader = e, this.locatorsByKey = /* @__PURE__ */ new Map(), this.deregisterMemoizedStream = (t) => {
|
|
2787
2796
|
const i = this.locatorsByKey.get(t);
|
|
@@ -2789,9 +2798,9 @@ class ao {
|
|
|
2789
2798
|
}, this.locate = (t, i) => {
|
|
2790
2799
|
const o = {
|
|
2791
2800
|
resource: t,
|
|
2792
|
-
meta:
|
|
2801
|
+
meta: ro(this.reader, t)
|
|
2793
2802
|
};
|
|
2794
|
-
return
|
|
2803
|
+
return ct(() => {
|
|
2795
2804
|
const s = this.reader.spineItemsManager.get(
|
|
2796
2805
|
o.meta.itemIndex ?? 0
|
|
2797
2806
|
), r = s?.renditionLayout === "reflowable", a = i.mode === "shallow" || !r || !s ? () => {
|
|
@@ -2814,7 +2823,7 @@ class ao {
|
|
|
2814
2823
|
const d = this.reader.spine.layout$.pipe(
|
|
2815
2824
|
Ie(10),
|
|
2816
2825
|
ne(o),
|
|
2817
|
-
an((g) =>
|
|
2826
|
+
an((g) => ao(g.meta, this.reader).pipe(
|
|
2818
2827
|
S((p) => ({
|
|
2819
2828
|
...g,
|
|
2820
2829
|
meta: p
|
|
@@ -2830,17 +2839,17 @@ class ao {
|
|
|
2830
2839
|
};
|
|
2831
2840
|
}
|
|
2832
2841
|
locateResource(e, t) {
|
|
2833
|
-
return Array.isArray(e) ?
|
|
2842
|
+
return Array.isArray(e) ? ct(
|
|
2834
2843
|
() => j(
|
|
2835
2844
|
e.map((i) => this.locate(i, t ?? {}))
|
|
2836
2845
|
).pipe(cn([]))
|
|
2837
2846
|
) : this.locate(e, t ?? {});
|
|
2838
2847
|
}
|
|
2839
2848
|
}
|
|
2840
|
-
const
|
|
2841
|
-
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } =
|
|
2849
|
+
const uo = (n) => (e) => {
|
|
2850
|
+
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } = io(t);
|
|
2842
2851
|
i.pipe(T(t.$.destroy$)).subscribe();
|
|
2843
|
-
const s = new
|
|
2852
|
+
const s = new co(t);
|
|
2844
2853
|
return {
|
|
2845
2854
|
...t,
|
|
2846
2855
|
locateResource: s.locateResource.bind(s),
|
|
@@ -2854,7 +2863,7 @@ const co = (n) => (e) => {
|
|
|
2854
2863
|
}
|
|
2855
2864
|
}
|
|
2856
2865
|
};
|
|
2857
|
-
},
|
|
2866
|
+
}, lo = (n) => ({
|
|
2858
2867
|
put: (s, r) => new Promise((a, c) => {
|
|
2859
2868
|
const u = n.transaction(["store"], "readwrite");
|
|
2860
2869
|
u.onerror = (g) => {
|
|
@@ -2906,16 +2915,16 @@ const co = (n) => (e) => {
|
|
|
2906
2915
|
a(d);
|
|
2907
2916
|
};
|
|
2908
2917
|
})
|
|
2909
|
-
}),
|
|
2918
|
+
}), je = async (n) => new Promise((e, t) => {
|
|
2910
2919
|
const i = window.indexedDB.open(n);
|
|
2911
2920
|
i.onerror = (o) => {
|
|
2912
2921
|
t(o);
|
|
2913
2922
|
}, i.onsuccess = () => {
|
|
2914
|
-
e(
|
|
2923
|
+
e(lo(i.result));
|
|
2915
2924
|
}, i.onupgradeneeded = () => {
|
|
2916
2925
|
i.result.createObjectStore("store");
|
|
2917
2926
|
};
|
|
2918
|
-
}),
|
|
2927
|
+
}), po = (n) => {
|
|
2919
2928
|
let e = Date.now().toString();
|
|
2920
2929
|
const t = new N(), i = (c) => {
|
|
2921
2930
|
if (typeof c == "string" || typeof c == "object") {
|
|
@@ -2926,7 +2935,7 @@ const co = (n) => (e) => {
|
|
|
2926
2935
|
}, o = async (c, u) => {
|
|
2927
2936
|
const l = i(c);
|
|
2928
2937
|
if (!l) return new Response("Item not found", { status: 404 });
|
|
2929
|
-
const g = await (await
|
|
2938
|
+
const g = await (await je("prose-reader")).get(`${e}_${l.id}`);
|
|
2930
2939
|
if (g)
|
|
2931
2940
|
return new Response(g, { status: 200 });
|
|
2932
2941
|
const p = u && await u(l) || await fetch(l.href);
|
|
@@ -2938,10 +2947,10 @@ const co = (n) => (e) => {
|
|
|
2938
2947
|
bn(({ id: c, data: u }) => {
|
|
2939
2948
|
const l = i(c);
|
|
2940
2949
|
return l ? k(
|
|
2941
|
-
un([
|
|
2950
|
+
un([je("prose-reader"), k(u.blob())])
|
|
2942
2951
|
).pipe(
|
|
2943
2952
|
Y(([d, g]) => k(d.put(`${e}_${l.id}`, g))),
|
|
2944
|
-
|
|
2953
|
+
rt((d) => (D.error(d), _))
|
|
2945
2954
|
) : _;
|
|
2946
2955
|
}),
|
|
2947
2956
|
K(n.destroy$)
|
|
@@ -2952,7 +2961,7 @@ const co = (n) => (e) => {
|
|
|
2952
2961
|
})
|
|
2953
2962
|
);
|
|
2954
2963
|
return P(r).pipe(
|
|
2955
|
-
Y(() => (
|
|
2964
|
+
Y(() => (D.debug("Cleanup up old cache..."), k(je("prose-reader")).pipe(
|
|
2956
2965
|
Y(
|
|
2957
2966
|
(c) => k(c.keys()).pipe(
|
|
2958
2967
|
ie(
|
|
@@ -2964,7 +2973,7 @@ const co = (n) => (e) => {
|
|
|
2964
2973
|
})
|
|
2965
2974
|
)
|
|
2966
2975
|
),
|
|
2967
|
-
|
|
2976
|
+
rt((c) => (D.error(c), _))
|
|
2968
2977
|
))),
|
|
2969
2978
|
K(n.destroy$)
|
|
2970
2979
|
).subscribe(), {
|
|
@@ -2973,8 +2982,8 @@ const co = (n) => (e) => {
|
|
|
2973
2982
|
t.complete();
|
|
2974
2983
|
}
|
|
2975
2984
|
};
|
|
2976
|
-
},
|
|
2977
|
-
const t = n(e), i =
|
|
2985
|
+
}, go = (n) => (e) => {
|
|
2986
|
+
const t = n(e), i = po(t.context);
|
|
2978
2987
|
return {
|
|
2979
2988
|
...t,
|
|
2980
2989
|
// $: {
|
|
@@ -2986,7 +2995,7 @@ const co = (n) => (e) => {
|
|
|
2986
2995
|
}
|
|
2987
2996
|
// load,
|
|
2988
2997
|
};
|
|
2989
|
-
},
|
|
2998
|
+
}, ho = (n, e) => {
|
|
2990
2999
|
const t = n.node.ownerDocument?.createRange(), i = n.node.compareDocumentPosition(e.node);
|
|
2991
3000
|
if (t) {
|
|
2992
3001
|
try {
|
|
@@ -2999,47 +3008,47 @@ const co = (n) => (e) => {
|
|
|
2999
3008
|
t.setStart(n.node, o), t.setEnd(n.node, s);
|
|
3000
3009
|
}
|
|
3001
3010
|
} catch (o) {
|
|
3002
|
-
|
|
3011
|
+
D.warn("Failed to create range from selection", o, {
|
|
3003
3012
|
anchor: n,
|
|
3004
3013
|
focus: e
|
|
3005
3014
|
});
|
|
3006
3015
|
}
|
|
3007
3016
|
return t;
|
|
3008
3017
|
}
|
|
3009
|
-
},
|
|
3018
|
+
}, mo = ({
|
|
3010
3019
|
selection: n,
|
|
3011
3020
|
spineItem: e
|
|
3012
3021
|
}) => {
|
|
3013
3022
|
const { anchorNode: t, anchorOffset: i, focusNode: o, focusOffset: s } = n;
|
|
3014
3023
|
if (!(!t || !o))
|
|
3015
3024
|
try {
|
|
3016
|
-
return
|
|
3025
|
+
return ho(
|
|
3017
3026
|
{ node: t, offset: i },
|
|
3018
3027
|
{ node: o, offset: s }
|
|
3019
3028
|
);
|
|
3020
3029
|
} catch (r) {
|
|
3021
|
-
|
|
3030
|
+
D.warn("Failed to create range from selection", r, {
|
|
3022
3031
|
selection: n,
|
|
3023
3032
|
spineItem: e
|
|
3024
3033
|
});
|
|
3025
3034
|
return;
|
|
3026
3035
|
}
|
|
3027
3036
|
};
|
|
3028
|
-
class
|
|
3037
|
+
class fo extends G {
|
|
3029
3038
|
constructor(e) {
|
|
3030
3039
|
super();
|
|
3031
3040
|
const t = e.contentDocument || e.contentWindow?.document;
|
|
3032
3041
|
if (!t)
|
|
3033
3042
|
this.selectionChange$ = he, this.selectionOver$ = he;
|
|
3034
3043
|
else {
|
|
3035
|
-
const i =
|
|
3044
|
+
const i = ut(t.body, {
|
|
3036
3045
|
childList: !0,
|
|
3037
3046
|
subtree: !0
|
|
3038
3047
|
}).pipe(
|
|
3039
3048
|
C(
|
|
3040
3049
|
(s) => !!s.find((r) => r.type === "childList" && r.removedNodes.length)
|
|
3041
3050
|
)
|
|
3042
|
-
), o = e.parentElement ?
|
|
3051
|
+
), o = e.parentElement ? ut(e.parentElement, {
|
|
3043
3052
|
childList: !0
|
|
3044
3053
|
}).pipe(
|
|
3045
3054
|
C(
|
|
@@ -3067,7 +3076,7 @@ class mo extends G {
|
|
|
3067
3076
|
* The selection is still valid during the event even if it will
|
|
3068
3077
|
* be discarded. The timeout make sure to detect this edge case.
|
|
3069
3078
|
*/
|
|
3070
|
-
|
|
3079
|
+
xe(0),
|
|
3071
3080
|
S((s) => {
|
|
3072
3081
|
const r = t.getSelection();
|
|
3073
3082
|
return r && !r.isCollapsed ? [s, r] : void 0;
|
|
@@ -3080,11 +3089,11 @@ class mo extends G {
|
|
|
3080
3089
|
}
|
|
3081
3090
|
}
|
|
3082
3091
|
}
|
|
3083
|
-
const
|
|
3092
|
+
const yo = (n) => n.watch("isLoaded").pipe(
|
|
3084
3093
|
w(() => {
|
|
3085
3094
|
const e = n.renderer.getDocumentFrame(), t = e?.contentDocument || e?.contentWindow?.document;
|
|
3086
3095
|
if (!e || !t) return he;
|
|
3087
|
-
const i = new
|
|
3096
|
+
const i = new fo(e);
|
|
3088
3097
|
return P(
|
|
3089
3098
|
i.selectionChange$.pipe(
|
|
3090
3099
|
S((o) => {
|
|
@@ -3111,14 +3120,14 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3111
3120
|
);
|
|
3112
3121
|
}),
|
|
3113
3122
|
R()
|
|
3114
|
-
),
|
|
3123
|
+
), So = (n) => (e) => {
|
|
3115
3124
|
const t = n(e);
|
|
3116
3125
|
let i;
|
|
3117
3126
|
const o = t.spineItemsManager.items$.pipe(
|
|
3118
3127
|
w((l) => {
|
|
3119
3128
|
const d = l.map((g) => {
|
|
3120
3129
|
const p = t.spineItemsManager.getSpineItemIndex(g) ?? 0;
|
|
3121
|
-
return
|
|
3130
|
+
return yo(g).pipe(
|
|
3122
3131
|
S((h) => {
|
|
3123
3132
|
if (h)
|
|
3124
3133
|
return {
|
|
@@ -3140,15 +3149,15 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3140
3149
|
S((l) => !!l),
|
|
3141
3150
|
R(),
|
|
3142
3151
|
C((l) => l),
|
|
3143
|
-
|
|
3152
|
+
A()
|
|
3144
3153
|
), a = r.pipe(
|
|
3145
3154
|
w(() => s),
|
|
3146
3155
|
R(),
|
|
3147
3156
|
C((l) => !l),
|
|
3148
|
-
|
|
3157
|
+
A()
|
|
3149
3158
|
), c = o.pipe(
|
|
3150
3159
|
C((l) => l?.type === "over"),
|
|
3151
|
-
|
|
3160
|
+
A()
|
|
3152
3161
|
), u = t.context.watch("rootElement").pipe(
|
|
3153
3162
|
C(Z),
|
|
3154
3163
|
w((l) => X(l, "pointerdown")),
|
|
@@ -3166,10 +3175,10 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3166
3175
|
selectionOver$: c,
|
|
3167
3176
|
lastSelectionOnPointerdown$: u,
|
|
3168
3177
|
getSelection: () => i,
|
|
3169
|
-
createOrderedRangeFromSelection:
|
|
3178
|
+
createOrderedRangeFromSelection: mo
|
|
3170
3179
|
}
|
|
3171
3180
|
};
|
|
3172
|
-
},
|
|
3181
|
+
}, ht = [
|
|
3173
3182
|
{
|
|
3174
3183
|
name: "bright",
|
|
3175
3184
|
backgroundColor: "white"
|
|
@@ -3184,11 +3193,11 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3184
3193
|
backgroundColor: "#191717",
|
|
3185
3194
|
foregroundColor: "#f1ebeb"
|
|
3186
3195
|
}
|
|
3187
|
-
],
|
|
3196
|
+
], Io = (n) => (e) => {
|
|
3188
3197
|
const t = n(e), i = new q(
|
|
3189
3198
|
e.theme ?? "bright"
|
|
3190
3199
|
), o = () => {
|
|
3191
|
-
const a =
|
|
3200
|
+
const a = ht.find(
|
|
3192
3201
|
(c) => c.name === i.value
|
|
3193
3202
|
);
|
|
3194
3203
|
return `
|
|
@@ -3205,7 +3214,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3205
3214
|
}, s = ({
|
|
3206
3215
|
container: a
|
|
3207
3216
|
}) => {
|
|
3208
|
-
const c =
|
|
3217
|
+
const c = ht.find(
|
|
3209
3218
|
(u) => u.name === i.value
|
|
3210
3219
|
);
|
|
3211
3220
|
return c && a.style.setProperty(
|
|
@@ -3249,7 +3258,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3249
3258
|
}
|
|
3250
3259
|
}
|
|
3251
3260
|
};
|
|
3252
|
-
},
|
|
3261
|
+
}, bo = (n) => (e) => {
|
|
3253
3262
|
const t = n(e);
|
|
3254
3263
|
return {
|
|
3255
3264
|
...t,
|
|
@@ -3257,13 +3266,13 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3257
3266
|
isOrIsWithinValidLink: (s) => !!(At(s) && (s.nodeName === "a" ? s : s.closest("a"))?.getAttribute("href")),
|
|
3258
3267
|
injectScopedCSS: (s, r, a) => {
|
|
3259
3268
|
const c = a.replace("${id}", t.id);
|
|
3260
|
-
return
|
|
3269
|
+
return Ee(s, `${r}-${t.id}`, c);
|
|
3261
3270
|
}
|
|
3262
3271
|
}
|
|
3263
3272
|
};
|
|
3264
3273
|
};
|
|
3265
3274
|
navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
|
|
3266
|
-
const
|
|
3275
|
+
const vo = (n) => (e) => n(e), wo = "[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true]{overflow:scroll}[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true][data-prose-reader-zooming-direction=down]{overflow-x:auto}", mt = (n, e, t) => {
|
|
3267
3276
|
const { clientWidth: i, clientHeight: o } = t.value.element, s = {
|
|
3268
3277
|
maxX: 0,
|
|
3269
3278
|
minX: i * (1 - e),
|
|
@@ -3274,11 +3283,11 @@ const bo = (n) => (e) => n(e), vo = "[data-prose-reader-scroll-navigator][data-p
|
|
|
3274
3283
|
x: Math.min(Math.max(n.x, s.minX), s.maxX),
|
|
3275
3284
|
y: Math.min(Math.max(n.y, s.minY), s.maxY)
|
|
3276
3285
|
};
|
|
3277
|
-
},
|
|
3286
|
+
}, Po = (n, e, t) => {
|
|
3278
3287
|
t.style.transformOrigin = "0 0";
|
|
3279
3288
|
const i = `translate3d(${e.x}px, ${e.y}px, 0px)`, o = `scale(${n})`;
|
|
3280
3289
|
t.style.transform = `${i} ${o}`;
|
|
3281
|
-
},
|
|
3290
|
+
}, xo = (n, e, t, i) => {
|
|
3282
3291
|
const o = e / n, s = t.clientWidth, r = t.clientHeight, a = s / 2 - i.x, c = r / 2 - i.y;
|
|
3283
3292
|
return {
|
|
3284
3293
|
x: i.x + a * (1 - o),
|
|
@@ -3290,14 +3299,14 @@ class Ht {
|
|
|
3290
3299
|
this.x = e.x, this.y = e.y;
|
|
3291
3300
|
}
|
|
3292
3301
|
}
|
|
3293
|
-
class
|
|
3302
|
+
class ft extends Ht {
|
|
3294
3303
|
}
|
|
3295
|
-
class
|
|
3304
|
+
class $o extends Ht {
|
|
3296
3305
|
constructor() {
|
|
3297
3306
|
super(...arguments), this.__symbol = /* @__PURE__ */ Symbol("UnboundScrollPosition");
|
|
3298
3307
|
}
|
|
3299
3308
|
}
|
|
3300
|
-
class
|
|
3309
|
+
class To extends Q {
|
|
3301
3310
|
constructor(e, t, i, o, s) {
|
|
3302
3311
|
super({
|
|
3303
3312
|
element: void 0
|
|
@@ -3311,7 +3320,7 @@ class $o extends Q {
|
|
|
3311
3320
|
left: p.x,
|
|
3312
3321
|
top: p.y,
|
|
3313
3322
|
behavior: "instant"
|
|
3314
|
-
}),
|
|
3323
|
+
}), Fe(1).pipe(
|
|
3315
3324
|
x(() => {
|
|
3316
3325
|
this.scrollingSubject.next(!1);
|
|
3317
3326
|
}),
|
|
@@ -3319,11 +3328,11 @@ class $o extends Q {
|
|
|
3319
3328
|
).subscribe(), this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
3320
3329
|
};
|
|
3321
3330
|
const r = this.context.pipe(
|
|
3322
|
-
|
|
3331
|
+
Qe(["rootElement"]),
|
|
3323
3332
|
x(({ rootElement: d }) => {
|
|
3324
3333
|
if (!d) return;
|
|
3325
3334
|
const g = document.createElement("div");
|
|
3326
|
-
g.setAttribute(`data-${
|
|
3335
|
+
g.setAttribute(`data-${ri}`, ""), g.appendChild(this.viewport.value.element), d.appendChild(g), this.update({ element: g });
|
|
3327
3336
|
})
|
|
3328
3337
|
), a = j([
|
|
3329
3338
|
t.watch(["computedPageTurnMode"]),
|
|
@@ -3341,7 +3350,7 @@ class $o extends Q {
|
|
|
3341
3350
|
const u = P(
|
|
3342
3351
|
o.element$.pipe(
|
|
3343
3352
|
C(Z),
|
|
3344
|
-
w((d) =>
|
|
3353
|
+
w((d) => et(d))
|
|
3345
3354
|
),
|
|
3346
3355
|
o.element$.pipe(
|
|
3347
3356
|
C(Z),
|
|
@@ -3350,7 +3359,7 @@ class $o extends Q {
|
|
|
3350
3359
|
o.spineItemsObserver.itemResize$
|
|
3351
3360
|
).pipe(
|
|
3352
3361
|
w(
|
|
3353
|
-
() =>
|
|
3362
|
+
() => Fe(10).pipe(
|
|
3354
3363
|
S(() => !1),
|
|
3355
3364
|
ne(!0)
|
|
3356
3365
|
)
|
|
@@ -3381,7 +3390,7 @@ class $o extends Q {
|
|
|
3381
3390
|
)
|
|
3382
3391
|
)
|
|
3383
3392
|
),
|
|
3384
|
-
|
|
3393
|
+
A()
|
|
3385
3394
|
), P(r, a, c).pipe(T(this.destroy$)).subscribe();
|
|
3386
3395
|
}
|
|
3387
3396
|
update(e) {
|
|
@@ -3399,27 +3408,27 @@ class $o extends Q {
|
|
|
3399
3408
|
}
|
|
3400
3409
|
fromSpinePosition(e) {
|
|
3401
3410
|
const t = this.viewport.scaleFactor;
|
|
3402
|
-
return new
|
|
3411
|
+
return new ft({
|
|
3403
3412
|
x: e.x * t,
|
|
3404
3413
|
y: e.y * t
|
|
3405
3414
|
});
|
|
3406
3415
|
}
|
|
3407
3416
|
get scrollPosition() {
|
|
3408
3417
|
const e = this.value.element;
|
|
3409
|
-
return new
|
|
3418
|
+
return new ft({
|
|
3410
3419
|
x: e?.scrollLeft ?? 0,
|
|
3411
3420
|
y: e?.scrollTop ?? 0
|
|
3412
3421
|
});
|
|
3413
3422
|
}
|
|
3414
3423
|
}
|
|
3415
|
-
const
|
|
3424
|
+
const Fo = (n, e, t, i, o) => {
|
|
3416
3425
|
const s = n.clientWidth, r = n.clientHeight, a = n.scrollLeft, c = n.scrollTop, u = a + s / 2 - i, l = c + r / 2 - o, d = t / e, g = u * d, p = l * d, h = g - s / 2 + i, m = p - r / 2 + o;
|
|
3417
|
-
return new
|
|
3426
|
+
return new $o({
|
|
3418
3427
|
x: h,
|
|
3419
3428
|
y: m
|
|
3420
3429
|
});
|
|
3421
|
-
},
|
|
3422
|
-
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l =
|
|
3430
|
+
}, Lo = (n, e) => {
|
|
3431
|
+
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l = Fo(
|
|
3423
3432
|
s ?? An(),
|
|
3424
3433
|
a,
|
|
3425
3434
|
n,
|
|
@@ -3437,7 +3446,7 @@ const To = (n, e, t, i, o) => {
|
|
|
3437
3446
|
position: g
|
|
3438
3447
|
});
|
|
3439
3448
|
}, we = 200;
|
|
3440
|
-
class
|
|
3449
|
+
class Mo extends Q {
|
|
3441
3450
|
constructor(e) {
|
|
3442
3451
|
super({
|
|
3443
3452
|
isZooming: !1,
|
|
@@ -3457,7 +3466,7 @@ class Lo extends Q {
|
|
|
3457
3466
|
isZooming: !0,
|
|
3458
3467
|
currentScale: 1,
|
|
3459
3468
|
currentPosition: { x: 0, y: 0 }
|
|
3460
|
-
}), this.updateZoom(s), s !== 1 && this.isControlled ?
|
|
3469
|
+
}), this.updateZoom(s), s !== 1 && this.isControlled ? Fe(o?.animate ? we : 0).pipe(
|
|
3461
3470
|
x(() => {
|
|
3462
3471
|
this.reader.layout();
|
|
3463
3472
|
})
|
|
@@ -3476,7 +3485,7 @@ class Lo extends Q {
|
|
|
3476
3485
|
"false"
|
|
3477
3486
|
), o?.animate && this.isControlled && (s.style.transition = `transform ${we}ms`), this.updateZoom(1, { x: 0, y: 0 }), s.style.transform = "", this.mergeCompare({
|
|
3478
3487
|
isZooming: !1
|
|
3479
|
-
}),
|
|
3488
|
+
}), Fe(o?.animate ? we : 0).pipe(
|
|
3480
3489
|
x(() => {
|
|
3481
3490
|
const r = this.reader.viewport.value.element;
|
|
3482
3491
|
r.style.transformOrigin = "", r.style.transition = "", this.isControlled && this.reader.layout();
|
|
@@ -3495,19 +3504,19 @@ class Lo extends Q {
|
|
|
3495
3504
|
}
|
|
3496
3505
|
move(e, t) {
|
|
3497
3506
|
this.isControlled && (this.viewport.element.style.transition = "", this.updateZoom(this.value.currentScale, e, {
|
|
3498
|
-
constraints: t?.constrain === "within-viewport" ? (...i) =>
|
|
3507
|
+
constraints: t?.constrain === "within-viewport" ? (...i) => mt(...i, this.reader.viewport) : void 0
|
|
3499
3508
|
}));
|
|
3500
3509
|
}
|
|
3501
3510
|
scaleAt(e, t) {
|
|
3502
3511
|
this.viewport.element.style.transition = "";
|
|
3503
3512
|
const o = Math.ceil(e * 100) / 100;
|
|
3504
3513
|
this.updateZoom(o, void 0, {
|
|
3505
|
-
constraints: t?.constrain === "within-viewport" ? (...s) =>
|
|
3514
|
+
constraints: t?.constrain === "within-viewport" ? (...s) => mt(...s, this.reader.viewport) : void 0
|
|
3506
3515
|
});
|
|
3507
3516
|
}
|
|
3508
3517
|
updateZoom(e, t, i) {
|
|
3509
3518
|
if (this.isControlled) {
|
|
3510
|
-
const o = t ||
|
|
3519
|
+
const o = t || xo(
|
|
3511
3520
|
this.value.currentScale,
|
|
3512
3521
|
e,
|
|
3513
3522
|
this.viewport.element,
|
|
@@ -3523,11 +3532,11 @@ class Lo extends Q {
|
|
|
3523
3532
|
});
|
|
3524
3533
|
}
|
|
3525
3534
|
applyZoom(e, t) {
|
|
3526
|
-
this.isControlled ?
|
|
3535
|
+
this.isControlled ? Po(
|
|
3527
3536
|
e,
|
|
3528
3537
|
t,
|
|
3529
3538
|
this.viewport.element
|
|
3530
|
-
) :
|
|
3539
|
+
) : Lo(e, this.reader);
|
|
3531
3540
|
}
|
|
3532
3541
|
get isControlled() {
|
|
3533
3542
|
return this.reader.settings.values.computedPageTurnMode === "controlled";
|
|
@@ -3539,11 +3548,11 @@ class Lo extends Q {
|
|
|
3539
3548
|
return this.reader.viewport.value;
|
|
3540
3549
|
}
|
|
3541
3550
|
}
|
|
3542
|
-
const
|
|
3543
|
-
const t = n(e), i = new
|
|
3544
|
-
|
|
3551
|
+
const yt = `${Vt}-enhancer-zoom`, Co = (n) => (e) => {
|
|
3552
|
+
const t = n(e), i = new Mo(t);
|
|
3553
|
+
Ee(document, yt, wo);
|
|
3545
3554
|
const o = () => {
|
|
3546
|
-
|
|
3555
|
+
De(document, yt), i.destroy(), t.destroy();
|
|
3547
3556
|
}, s = i;
|
|
3548
3557
|
return {
|
|
3549
3558
|
...t,
|
|
@@ -3560,9 +3569,9 @@ const ft = `${Vt}-enhancer-zoom`, Mo = (n) => (e) => {
|
|
|
3560
3569
|
}
|
|
3561
3570
|
};
|
|
3562
3571
|
}, Bt = (n) => n?.renditionLayout === "pre-paginated" || n?.spineItems.every((e) => e.renditionLayout === "pre-paginated");
|
|
3563
|
-
class
|
|
3572
|
+
class Eo {
|
|
3564
3573
|
constructor() {
|
|
3565
|
-
this.navigationSubject = new
|
|
3574
|
+
this.navigationSubject = new st(1), this.viewportStateSubject = new q("free"), this.paginationSubject = new st(), this.navigationIsLockedSubject = new q(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
|
|
3566
3575
|
R(),
|
|
3567
3576
|
C((e) => !e)
|
|
3568
3577
|
), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
|
|
@@ -3572,11 +3581,11 @@ class Co {
|
|
|
3572
3581
|
), this.navigation$ = this.navigationSubject.asObservable();
|
|
3573
3582
|
}
|
|
3574
3583
|
}
|
|
3575
|
-
class
|
|
3584
|
+
class Do extends Q {
|
|
3576
3585
|
constructor() {
|
|
3577
3586
|
super({
|
|
3578
3587
|
assumedRenditionLayout: "reflowable"
|
|
3579
|
-
}), this.bridgeEvent = new
|
|
3588
|
+
}), this.bridgeEvent = new Eo(), this.manifest$ = this.pipe(
|
|
3580
3589
|
ie((e) => e.manifest),
|
|
3581
3590
|
pe(Z),
|
|
3582
3591
|
be()
|
|
@@ -3600,7 +3609,7 @@ class Eo extends Q {
|
|
|
3600
3609
|
return this.manifest?.readingDirection;
|
|
3601
3610
|
}
|
|
3602
3611
|
}
|
|
3603
|
-
class
|
|
3612
|
+
class Ao extends Q {
|
|
3604
3613
|
constructor(e, t) {
|
|
3605
3614
|
super({
|
|
3606
3615
|
supportedPageTurnAnimation: ["fade", "none", "slide"],
|
|
@@ -3635,7 +3644,7 @@ class Do extends Q {
|
|
|
3635
3644
|
).subscribe(this.next.bind(this));
|
|
3636
3645
|
}
|
|
3637
3646
|
}
|
|
3638
|
-
class
|
|
3647
|
+
class No {
|
|
3639
3648
|
constructor() {
|
|
3640
3649
|
this._hooks = [], this._hookExecutions = [];
|
|
3641
3650
|
}
|
|
@@ -3697,17 +3706,17 @@ class Ao {
|
|
|
3697
3706
|
return j(s);
|
|
3698
3707
|
}
|
|
3699
3708
|
}
|
|
3700
|
-
const
|
|
3709
|
+
const Ro = "[data-prose-reader-scroll-navigator]{height:100%;width:100%;position:relative;overflow-y:scroll;overflow-x:hidden}[data-prose-reader-viewport]{background-color:#fff;position:relative;height:100%;width:100%}", Oo = (n) => ({
|
|
3701
3710
|
x: -n.x,
|
|
3702
3711
|
y: -n.y
|
|
3703
|
-
}),
|
|
3712
|
+
}), Vo = (n) => n instanceof DOMMatrix ? new M({
|
|
3704
3713
|
x: -n.e,
|
|
3705
3714
|
y: -n.f
|
|
3706
3715
|
}) : new M({
|
|
3707
3716
|
x: -n.x,
|
|
3708
3717
|
y: -n.y
|
|
3709
|
-
}),
|
|
3710
|
-
class
|
|
3718
|
+
}), jo = "navigation/ViewportNavigator", St = D.namespace(jo);
|
|
3719
|
+
class ko extends G {
|
|
3711
3720
|
constructor(e, t, i, o, s) {
|
|
3712
3721
|
super(), this.settings = e, this.hookManager = t, this.context = i, this.spine = o, this.viewport = s, this.navigateSubject = new N(), this.element$ = new q(
|
|
3713
3722
|
document.createElement("div")
|
|
@@ -3736,13 +3745,13 @@ class jo extends G {
|
|
|
3736
3745
|
);
|
|
3737
3746
|
this.layout$ = c.pipe(
|
|
3738
3747
|
x(() => {
|
|
3739
|
-
|
|
3748
|
+
St.info("layout", e.values);
|
|
3740
3749
|
}),
|
|
3741
|
-
|
|
3750
|
+
A()
|
|
3742
3751
|
);
|
|
3743
3752
|
const u = this.navigateSubject.pipe(
|
|
3744
3753
|
x((l) => {
|
|
3745
|
-
|
|
3754
|
+
St.info("Navigation requested", l);
|
|
3746
3755
|
})
|
|
3747
3756
|
);
|
|
3748
3757
|
this.isNavigating$ = u.pipe(
|
|
@@ -3769,7 +3778,7 @@ class jo extends G {
|
|
|
3769
3778
|
* anything for x ms while we effectively adjust. We want it to be immediate.
|
|
3770
3779
|
* However when user is repeatedly turning page, we can improve smoothness by delaying a bit the adjustment
|
|
3771
3780
|
*/
|
|
3772
|
-
l.shouldAnimate ?
|
|
3781
|
+
l.shouldAnimate ? xe(1, re) : $e,
|
|
3773
3782
|
x((h) => {
|
|
3774
3783
|
const m = this.element$.getValue();
|
|
3775
3784
|
h.shouldAnimate ? p === "fade" ? (m.style.setProperty(
|
|
@@ -3791,12 +3800,12 @@ class jo extends G {
|
|
|
3791
3800
|
x((h) => {
|
|
3792
3801
|
p !== "fade" && this.setViewportPosition(h.position);
|
|
3793
3802
|
}),
|
|
3794
|
-
l.shouldAnimate ?
|
|
3803
|
+
l.shouldAnimate ? xe(g / 2, re) : $e,
|
|
3795
3804
|
x((h) => {
|
|
3796
3805
|
const m = this.element$.getValue();
|
|
3797
3806
|
p === "fade" && (this.setViewportPosition(h.position), m.style.setProperty("opacity", "1"));
|
|
3798
3807
|
}),
|
|
3799
|
-
l.shouldAnimate ?
|
|
3808
|
+
l.shouldAnimate ? xe(g / 2, re) : $e,
|
|
3800
3809
|
x((h) => {
|
|
3801
3810
|
p === "fade" && this.setViewportPosition(h.position);
|
|
3802
3811
|
})
|
|
@@ -3819,7 +3828,7 @@ class jo extends G {
|
|
|
3819
3828
|
* for remark about flicker / fonts smoothing
|
|
3820
3829
|
*/
|
|
3821
3830
|
setViewportPosition(e) {
|
|
3822
|
-
const t = this.element$.getValue(), i =
|
|
3831
|
+
const t = this.element$.getValue(), i = Oo(e);
|
|
3823
3832
|
t.style.transform = `translate(${i.x}px, ${i.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
3824
3833
|
}
|
|
3825
3834
|
navigate(e) {
|
|
@@ -3834,10 +3843,10 @@ class jo extends G {
|
|
|
3834
3843
|
if (!i || i === "none")
|
|
3835
3844
|
return new M({ x: 0, y: 0 });
|
|
3836
3845
|
const o = new DOMMatrix(i);
|
|
3837
|
-
return
|
|
3846
|
+
return Vo(o);
|
|
3838
3847
|
}
|
|
3839
3848
|
}
|
|
3840
|
-
const
|
|
3849
|
+
const Uo = () => (n) => n.pipe(
|
|
3841
3850
|
S(({ navigation: e, pagination: t, ...i }) => ({
|
|
3842
3851
|
navigation: {
|
|
3843
3852
|
...e,
|
|
@@ -3845,7 +3854,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3845
3854
|
},
|
|
3846
3855
|
...i
|
|
3847
3856
|
}))
|
|
3848
|
-
),
|
|
3857
|
+
), zo = (n, e, t) => n.bridgeEvent.pagination$.pipe(
|
|
3849
3858
|
z(e),
|
|
3850
3859
|
C(
|
|
3851
3860
|
([i, o]) => i.navigationId === o.id
|
|
@@ -3862,7 +3871,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3862
3871
|
navigation: o
|
|
3863
3872
|
}))
|
|
3864
3873
|
)),
|
|
3865
|
-
|
|
3874
|
+
Uo(),
|
|
3866
3875
|
R(
|
|
3867
3876
|
(i, o) => i.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
|
|
3868
3877
|
),
|
|
@@ -3874,7 +3883,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3874
3883
|
}
|
|
3875
3884
|
})
|
|
3876
3885
|
)
|
|
3877
|
-
),
|
|
3886
|
+
), Wo = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3878
3887
|
S(([t, i]) => {
|
|
3879
3888
|
const o = {
|
|
3880
3889
|
type: "api",
|
|
@@ -3911,7 +3920,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3911
3920
|
navigation: o
|
|
3912
3921
|
};
|
|
3913
3922
|
})
|
|
3914
|
-
),
|
|
3923
|
+
), _o = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3915
3924
|
S((t) => {
|
|
3916
3925
|
if (t.navigation.cfi) {
|
|
3917
3926
|
const i = n.getNavigationForCfi(
|
|
@@ -3928,16 +3937,16 @@ const ko = () => (n) => n.pipe(
|
|
|
3928
3937
|
}
|
|
3929
3938
|
return t;
|
|
3930
3939
|
})
|
|
3931
|
-
),
|
|
3940
|
+
), Ho = ({
|
|
3932
3941
|
navigation: n,
|
|
3933
3942
|
previousNavigation: e,
|
|
3934
3943
|
settings: t
|
|
3935
|
-
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward",
|
|
3944
|
+
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward", Bo = ({
|
|
3936
3945
|
context: n,
|
|
3937
3946
|
settings: e
|
|
3938
3947
|
}) => (t) => t.pipe(
|
|
3939
3948
|
S(({ navigation: i, previousNavigation: o }) => {
|
|
3940
|
-
const s =
|
|
3949
|
+
const s = Ho({
|
|
3941
3950
|
navigation: i,
|
|
3942
3951
|
previousNavigation: o,
|
|
3943
3952
|
settings: e
|
|
@@ -3951,7 +3960,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3951
3960
|
direction: s
|
|
3952
3961
|
};
|
|
3953
3962
|
})
|
|
3954
|
-
),
|
|
3963
|
+
), Xo = ({
|
|
3955
3964
|
spineItemsManager: n,
|
|
3956
3965
|
navigationResolver: e,
|
|
3957
3966
|
settings: t
|
|
@@ -3994,7 +4003,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3994
4003
|
...s
|
|
3995
4004
|
};
|
|
3996
4005
|
})
|
|
3997
|
-
),
|
|
4006
|
+
), It = ({
|
|
3998
4007
|
settings: n,
|
|
3999
4008
|
spineItemsManager: e,
|
|
4000
4009
|
navigationResolver: t,
|
|
@@ -4053,7 +4062,7 @@ const ko = () => (n) => n.pipe(
|
|
|
4053
4062
|
};
|
|
4054
4063
|
})
|
|
4055
4064
|
);
|
|
4056
|
-
},
|
|
4065
|
+
}, bt = ({ spine: n }) => (e) => e.pipe(
|
|
4057
4066
|
w(({ navigation: t, ...i }) => {
|
|
4058
4067
|
const o = n.getSpineItemSpineLayoutInfo(
|
|
4059
4068
|
t.spineItem
|
|
@@ -4076,7 +4085,7 @@ const ko = () => (n) => n.pipe(
|
|
|
4076
4085
|
)
|
|
4077
4086
|
);
|
|
4078
4087
|
})
|
|
4079
|
-
),
|
|
4088
|
+
), ke = ({
|
|
4080
4089
|
settings: n,
|
|
4081
4090
|
spineItemsManager: e,
|
|
4082
4091
|
spineLocator: t,
|
|
@@ -4120,7 +4129,7 @@ const ko = () => (n) => n.pipe(
|
|
|
4120
4129
|
...a
|
|
4121
4130
|
}))
|
|
4122
4131
|
);
|
|
4123
|
-
},
|
|
4132
|
+
}, Yo = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
4124
4133
|
S((t) => {
|
|
4125
4134
|
if (t.navigation.url) {
|
|
4126
4135
|
const i = n.getNavigationForUrl(
|
|
@@ -4153,7 +4162,7 @@ class Xt {
|
|
|
4153
4162
|
};
|
|
4154
4163
|
}
|
|
4155
4164
|
}
|
|
4156
|
-
const
|
|
4165
|
+
const qo = ({
|
|
4157
4166
|
spineLocator: n,
|
|
4158
4167
|
navigation: e,
|
|
4159
4168
|
navigationResolver: t,
|
|
@@ -4178,7 +4187,7 @@ const Yo = ({
|
|
|
4178
4187
|
return p.position;
|
|
4179
4188
|
}
|
|
4180
4189
|
const g = e.cfi ?? e.paginationBeginCfi;
|
|
4181
|
-
if (g !== void 0 && !
|
|
4190
|
+
if (g !== void 0 && !Xe(g) && (u || l || // when spine item is ready dimensions may have not changed but the position
|
|
4182
4191
|
// of dom elements may have!
|
|
4183
4192
|
r && !e.spineItemIsReady)) {
|
|
4184
4193
|
const p = t.getNavigationForCfi(g);
|
|
@@ -4210,7 +4219,7 @@ const Yo = ({
|
|
|
4210
4219
|
return c ? t.getNavigationForPosition(e.position) : t.getNavigationForSpineIndexOrId(s);
|
|
4211
4220
|
})
|
|
4212
4221
|
) : v(new M({ x: 0, y: 0 }));
|
|
4213
|
-
},
|
|
4222
|
+
}, Go = ({
|
|
4214
4223
|
navigation: n,
|
|
4215
4224
|
spineLocator: e,
|
|
4216
4225
|
spineItemsManager: t,
|
|
@@ -4279,7 +4288,7 @@ const Yo = ({
|
|
|
4279
4288
|
}
|
|
4280
4289
|
}
|
|
4281
4290
|
return n.position;
|
|
4282
|
-
},
|
|
4291
|
+
}, Zo = ({
|
|
4283
4292
|
navigation: n,
|
|
4284
4293
|
spineItemsManager: e,
|
|
4285
4294
|
settings: t,
|
|
@@ -4287,7 +4296,7 @@ const Yo = ({
|
|
|
4287
4296
|
navigationResolver: o,
|
|
4288
4297
|
spine: s
|
|
4289
4298
|
}) => t.values.computedPageTurnMode === "scrollable" ? v(
|
|
4290
|
-
|
|
4299
|
+
Go({
|
|
4291
4300
|
navigation: n,
|
|
4292
4301
|
spineLocator: i,
|
|
4293
4302
|
navigationResolver: o,
|
|
@@ -4295,19 +4304,19 @@ const Yo = ({
|
|
|
4295
4304
|
spineItemsManager: e,
|
|
4296
4305
|
spine: s
|
|
4297
4306
|
})
|
|
4298
|
-
) :
|
|
4307
|
+
) : qo({
|
|
4299
4308
|
navigation: n,
|
|
4300
4309
|
spineLocator: i,
|
|
4301
4310
|
navigationResolver: o,
|
|
4302
4311
|
spineItemsManager: e,
|
|
4303
4312
|
spine: s
|
|
4304
|
-
}),
|
|
4313
|
+
}), vt = ({
|
|
4305
4314
|
settings: n,
|
|
4306
4315
|
navigationResolver: e,
|
|
4307
4316
|
context: t,
|
|
4308
4317
|
spine: i
|
|
4309
4318
|
}) => (o) => o.pipe(
|
|
4310
|
-
w((s) =>
|
|
4319
|
+
w((s) => Zo({
|
|
4311
4320
|
spineLocator: i.locator,
|
|
4312
4321
|
navigation: s.navigation,
|
|
4313
4322
|
navigationResolver: e,
|
|
@@ -4324,8 +4333,8 @@ const Yo = ({
|
|
|
4324
4333
|
}
|
|
4325
4334
|
}))
|
|
4326
4335
|
))
|
|
4327
|
-
),
|
|
4328
|
-
class
|
|
4336
|
+
), Jo = "navigation/InternalNavigator", Ko = D.namespace(Jo);
|
|
4337
|
+
class Qo extends G {
|
|
4329
4338
|
constructor(e, t, i, o, s, r, a, c) {
|
|
4330
4339
|
super(), this.settings = e, this.context = t, this.userNavigation$ = i, this.controlledNavigationController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isRestorationLocked$ = c, this.navigationSubject = new q({
|
|
4331
4340
|
animation: !1,
|
|
@@ -4348,41 +4357,41 @@ class Ko extends G {
|
|
|
4348
4357
|
), this.locker = new Xt();
|
|
4349
4358
|
const u = i.pipe(
|
|
4350
4359
|
z(this.navigationSubject),
|
|
4351
|
-
|
|
4360
|
+
Wo({
|
|
4352
4361
|
navigationResolver: r
|
|
4353
4362
|
}),
|
|
4354
4363
|
/**
|
|
4355
4364
|
* Url lookup is heavier so we start with it to fill
|
|
4356
4365
|
* as much information as needed to reduce later lookup
|
|
4357
4366
|
*/
|
|
4358
|
-
|
|
4367
|
+
Yo({
|
|
4359
4368
|
navigationResolver: r
|
|
4360
4369
|
}),
|
|
4361
4370
|
/**
|
|
4362
4371
|
* Cfi lookup is heavier so we start with it to fill
|
|
4363
4372
|
* as much information as needed to reduce later lookup
|
|
4364
4373
|
*/
|
|
4365
|
-
|
|
4374
|
+
_o({
|
|
4366
4375
|
navigationResolver: r
|
|
4367
4376
|
}),
|
|
4368
|
-
|
|
4369
|
-
|
|
4377
|
+
Bo({ context: t, settings: e }),
|
|
4378
|
+
It({
|
|
4370
4379
|
navigationResolver: r,
|
|
4371
4380
|
settings: e,
|
|
4372
4381
|
spineItemsManager: a.spineItemsManager,
|
|
4373
4382
|
spineLocator: a.locator
|
|
4374
4383
|
}),
|
|
4375
|
-
|
|
4384
|
+
ke({
|
|
4376
4385
|
navigationResolver: r,
|
|
4377
4386
|
settings: e,
|
|
4378
4387
|
spineItemsManager: a.spineItemsManager,
|
|
4379
4388
|
spineLocator: a.locator
|
|
4380
4389
|
}),
|
|
4381
|
-
|
|
4390
|
+
bt({
|
|
4382
4391
|
spine: a
|
|
4383
4392
|
})
|
|
4384
4393
|
).pipe(
|
|
4385
|
-
|
|
4394
|
+
Xo({
|
|
4386
4395
|
navigationResolver: r,
|
|
4387
4396
|
spineItemsManager: a.spineItemsManager,
|
|
4388
4397
|
settings: e
|
|
@@ -4391,7 +4400,7 @@ class Ko extends G {
|
|
|
4391
4400
|
w(([f, I]) => {
|
|
4392
4401
|
const b = f.navigation.cfi || f.navigation.url || e.values.computedPageTurnMode === "scrollable" || I;
|
|
4393
4402
|
return v(f).pipe(
|
|
4394
|
-
b ?
|
|
4403
|
+
b ? $e : vt({
|
|
4395
4404
|
navigationResolver: r,
|
|
4396
4405
|
settings: e,
|
|
4397
4406
|
spine: a,
|
|
@@ -4399,14 +4408,14 @@ class Ko extends G {
|
|
|
4399
4408
|
})
|
|
4400
4409
|
);
|
|
4401
4410
|
}),
|
|
4402
|
-
|
|
4411
|
+
ke({
|
|
4403
4412
|
spineItemsManager: a.spineItemsManager,
|
|
4404
4413
|
spineLocator: a.locator,
|
|
4405
4414
|
settings: e,
|
|
4406
4415
|
navigationResolver: r
|
|
4407
4416
|
}),
|
|
4408
4417
|
S((f) => f.navigation),
|
|
4409
|
-
|
|
4418
|
+
A()
|
|
4410
4419
|
), l = u.pipe(
|
|
4411
4420
|
z(c),
|
|
4412
4421
|
C(([, f]) => f),
|
|
@@ -4427,7 +4436,7 @@ class Ko extends G {
|
|
|
4427
4436
|
T(u)
|
|
4428
4437
|
);
|
|
4429
4438
|
}),
|
|
4430
|
-
|
|
4439
|
+
A()
|
|
4431
4440
|
), d = P(
|
|
4432
4441
|
o.layout$,
|
|
4433
4442
|
a.layout$
|
|
@@ -4459,7 +4468,7 @@ class Ko extends G {
|
|
|
4459
4468
|
l
|
|
4460
4469
|
).pipe(
|
|
4461
4470
|
S((f) => ({ navigation: f })),
|
|
4462
|
-
|
|
4471
|
+
vt({
|
|
4463
4472
|
navigationResolver: r,
|
|
4464
4473
|
settings: e,
|
|
4465
4474
|
context: t,
|
|
@@ -4482,24 +4491,24 @@ class Ko extends G {
|
|
|
4482
4491
|
* eg: after the reader load and the user has never navigated
|
|
4483
4492
|
* yet.
|
|
4484
4493
|
*/
|
|
4485
|
-
|
|
4494
|
+
It({
|
|
4486
4495
|
navigationResolver: r,
|
|
4487
4496
|
settings: e,
|
|
4488
4497
|
spineItemsManager: a.spineItemsManager,
|
|
4489
4498
|
spineLocator: a.locator
|
|
4490
4499
|
}),
|
|
4491
|
-
|
|
4500
|
+
bt({
|
|
4492
4501
|
spine: a
|
|
4493
4502
|
}),
|
|
4494
|
-
|
|
4503
|
+
ke({
|
|
4495
4504
|
spineItemsManager: a.spineItemsManager,
|
|
4496
4505
|
spineLocator: a.locator,
|
|
4497
4506
|
settings: e,
|
|
4498
4507
|
navigationResolver: r
|
|
4499
4508
|
}),
|
|
4500
4509
|
S(({ navigation: f }) => f),
|
|
4501
|
-
|
|
4502
|
-
), p =
|
|
4510
|
+
A()
|
|
4511
|
+
), p = zo(
|
|
4503
4512
|
t,
|
|
4504
4513
|
this.navigationSubject,
|
|
4505
4514
|
a
|
|
@@ -4509,7 +4518,7 @@ class Ko extends G {
|
|
|
4509
4518
|
p
|
|
4510
4519
|
), m = (f) => f.pipe(
|
|
4511
4520
|
x(([I, b]) => {
|
|
4512
|
-
|
|
4521
|
+
Ko.info(
|
|
4513
4522
|
`navigation updated from ${I.meta.triggeredBy} of type ${I.type}`,
|
|
4514
4523
|
{
|
|
4515
4524
|
previousNavigation: b,
|
|
@@ -4558,16 +4567,16 @@ class Ko extends G {
|
|
|
4558
4567
|
return this.navigationSubject.getValue();
|
|
4559
4568
|
}
|
|
4560
4569
|
}
|
|
4561
|
-
const
|
|
4570
|
+
const Le = (n, e, t) => {
|
|
4562
4571
|
const i = t - n, o = t * (e * n) / (t || 1);
|
|
4563
4572
|
return Math.max(0, Math.min(i, o));
|
|
4564
|
-
},
|
|
4565
|
-
const i =
|
|
4573
|
+
}, Ye = (n, e) => (e || 0) === 0 || (n || 0) === 0 ? 1 : Math.floor(Math.max(1, n / e)), Ue = (n, e, t) => {
|
|
4574
|
+
const i = Ye(t, e), o = [...Array(i)].map((s, r) => r * e);
|
|
4566
4575
|
return n >= i * e ? o[o.length - 1] || 0 : o.find((s) => n < s + e) || 0;
|
|
4567
|
-
},
|
|
4576
|
+
}, wt = (n, e, t) => {
|
|
4568
4577
|
const i = [...Array(t)].map((o, s) => s * e);
|
|
4569
4578
|
return n <= 0 || t === 0 ? 0 : n >= t * e ? t - 1 : i.findIndex((o) => n < o + e) ?? 0;
|
|
4570
|
-
},
|
|
4579
|
+
}, es = ({
|
|
4571
4580
|
itemWidth: n,
|
|
4572
4581
|
itemHeight: e,
|
|
4573
4582
|
spineItemPosition: t
|
|
@@ -4582,7 +4591,7 @@ const Fe = (n, e, t) => {
|
|
|
4582
4591
|
pageHeight: o,
|
|
4583
4592
|
pageTurnDirection: s,
|
|
4584
4593
|
pageTurnMode: r
|
|
4585
|
-
}) => s === "vertical" && r === "scrollable" ? 1 : t || s === "vertical" ?
|
|
4594
|
+
}) => s === "vertical" && r === "scrollable" ? 1 : t || s === "vertical" ? Ye(n, o) : Ye(e, i), Pt = ({
|
|
4586
4595
|
itemWidth: n,
|
|
4587
4596
|
itemHeight: e,
|
|
4588
4597
|
position: t,
|
|
@@ -4593,7 +4602,7 @@ const Fe = (n, e, t) => {
|
|
|
4593
4602
|
pageTurnMode: a,
|
|
4594
4603
|
isRTL: c
|
|
4595
4604
|
}) => {
|
|
4596
|
-
const l =
|
|
4605
|
+
const l = es({
|
|
4597
4606
|
spineItemPosition: t,
|
|
4598
4607
|
itemHeight: e,
|
|
4599
4608
|
itemWidth: n
|
|
@@ -4607,10 +4616,10 @@ const Fe = (n, e, t) => {
|
|
|
4607
4616
|
pageTurnMode: a
|
|
4608
4617
|
});
|
|
4609
4618
|
if (i)
|
|
4610
|
-
return
|
|
4611
|
-
const g =
|
|
4619
|
+
return wt(t.y, s, d);
|
|
4620
|
+
const g = wt(l, o, d);
|
|
4612
4621
|
return c ? d - 1 - g : g;
|
|
4613
|
-
},
|
|
4622
|
+
}, ts = ({
|
|
4614
4623
|
pageIndex: n,
|
|
4615
4624
|
itemLayout: e,
|
|
4616
4625
|
context: t,
|
|
@@ -4618,7 +4627,7 @@ const Fe = (n, e, t) => {
|
|
|
4618
4627
|
viewport: o
|
|
4619
4628
|
}) => {
|
|
4620
4629
|
if (i) {
|
|
4621
|
-
const r =
|
|
4630
|
+
const r = Le(
|
|
4622
4631
|
o.pageSize.height,
|
|
4623
4632
|
n,
|
|
4624
4633
|
e.height
|
|
@@ -4628,7 +4637,7 @@ const Fe = (n, e, t) => {
|
|
|
4628
4637
|
y: r
|
|
4629
4638
|
});
|
|
4630
4639
|
}
|
|
4631
|
-
const s =
|
|
4640
|
+
const s = Le(
|
|
4632
4641
|
o.pageSize.width,
|
|
4633
4642
|
n,
|
|
4634
4643
|
e.width
|
|
@@ -4650,7 +4659,7 @@ const Fe = (n, e, t) => {
|
|
|
4650
4659
|
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? l = a.getBoundingClientRect().x : a && (l = (a ? Cn(a, c) : void 0)?.getBoundingClientRect().x || l);
|
|
4651
4660
|
const d = u.layoutInfo?.width || 0, g = t.pageSize.width;
|
|
4652
4661
|
if (l !== void 0) {
|
|
4653
|
-
const p =
|
|
4662
|
+
const p = Ue(
|
|
4654
4663
|
l,
|
|
4655
4664
|
g,
|
|
4656
4665
|
d
|
|
@@ -4663,14 +4672,14 @@ const Fe = (n, e, t) => {
|
|
|
4663
4672
|
getSpineItemPositionFromPageIndex: ({
|
|
4664
4673
|
pageIndex: a,
|
|
4665
4674
|
spineItem: c
|
|
4666
|
-
}) =>
|
|
4675
|
+
}) => ts({
|
|
4667
4676
|
context: n,
|
|
4668
4677
|
isUsingVerticalWriting: !!c.isUsingVerticalWriting(),
|
|
4669
4678
|
itemLayout: c.layoutInfo,
|
|
4670
4679
|
pageIndex: a,
|
|
4671
4680
|
viewport: t
|
|
4672
4681
|
}),
|
|
4673
|
-
getSpineItemPageIndexFromPosition: (a) =>
|
|
4682
|
+
getSpineItemPageIndexFromPosition: (a) => Pt({
|
|
4674
4683
|
...a,
|
|
4675
4684
|
isRTL: n.isRTL(),
|
|
4676
4685
|
pageWidth: t.pageSize.width,
|
|
@@ -4680,7 +4689,7 @@ const Fe = (n, e, t) => {
|
|
|
4680
4689
|
}),
|
|
4681
4690
|
getSpineItemPageIndexFromNode: (a, c, u) => {
|
|
4682
4691
|
const l = i(a, c, u), { height: d, width: g } = u.layoutInfo;
|
|
4683
|
-
return l ?
|
|
4692
|
+
return l ? Pt({
|
|
4684
4693
|
isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
|
|
4685
4694
|
position: l,
|
|
4686
4695
|
itemHeight: d,
|
|
@@ -4695,12 +4704,12 @@ const Fe = (n, e, t) => {
|
|
|
4695
4704
|
getSpineItemClosestPositionFromUnsafePosition: (a, c) => {
|
|
4696
4705
|
const { width: u, height: l } = c.layoutInfo;
|
|
4697
4706
|
return new E({
|
|
4698
|
-
x:
|
|
4707
|
+
x: Ue(
|
|
4699
4708
|
a.x,
|
|
4700
4709
|
t.pageSize.width,
|
|
4701
4710
|
u
|
|
4702
4711
|
),
|
|
4703
|
-
y:
|
|
4712
|
+
y: Ue(
|
|
4704
4713
|
a.y,
|
|
4705
4714
|
t.pageSize.height,
|
|
4706
4715
|
l
|
|
@@ -4710,31 +4719,31 @@ const Fe = (n, e, t) => {
|
|
|
4710
4719
|
getSpineItemPagePositionFromSpineItemPosition: (a, c, u) => {
|
|
4711
4720
|
const { width: l, height: d } = u.layoutInfo, g = t.pageSize.width, p = t.pageSize.height;
|
|
4712
4721
|
if (!!u.isUsingVerticalWriting()) {
|
|
4713
|
-
const y =
|
|
4722
|
+
const y = Le(
|
|
4714
4723
|
p,
|
|
4715
4724
|
c,
|
|
4716
4725
|
d
|
|
4717
4726
|
);
|
|
4718
|
-
return new
|
|
4727
|
+
return new Oe({
|
|
4719
4728
|
x: a.x,
|
|
4720
4729
|
y: a.y - y
|
|
4721
4730
|
});
|
|
4722
4731
|
}
|
|
4723
|
-
const m =
|
|
4732
|
+
const m = Le(g, c, l);
|
|
4724
4733
|
if (n.isRTL()) {
|
|
4725
4734
|
const y = l - (c + 1) * g;
|
|
4726
|
-
return new
|
|
4735
|
+
return new Oe({
|
|
4727
4736
|
x: a.x - Math.max(0, y),
|
|
4728
4737
|
y: a.y
|
|
4729
4738
|
});
|
|
4730
4739
|
}
|
|
4731
|
-
return new
|
|
4740
|
+
return new Oe({
|
|
4732
4741
|
x: a.x - m,
|
|
4733
4742
|
y: a.y
|
|
4734
4743
|
});
|
|
4735
4744
|
}
|
|
4736
4745
|
};
|
|
4737
|
-
},
|
|
4746
|
+
}, ns = ({
|
|
4738
4747
|
context: n,
|
|
4739
4748
|
settings: e,
|
|
4740
4749
|
viewport: t
|
|
@@ -4788,7 +4797,7 @@ function Gt({
|
|
|
4788
4797
|
y: u
|
|
4789
4798
|
});
|
|
4790
4799
|
}
|
|
4791
|
-
const
|
|
4800
|
+
const xt = ({
|
|
4792
4801
|
position: n,
|
|
4793
4802
|
isRTL: e,
|
|
4794
4803
|
pageSizeHeight: t,
|
|
@@ -4824,7 +4833,7 @@ const Pt = ({
|
|
|
4824
4833
|
}) => {
|
|
4825
4834
|
const s = n % i !== 0 ? n - t : n;
|
|
4826
4835
|
return new M({ x: s, y: e });
|
|
4827
|
-
},
|
|
4836
|
+
}, qe = ({
|
|
4828
4837
|
viewportPosition: n,
|
|
4829
4838
|
spineLocator: e,
|
|
4830
4839
|
spineItemNavigationResolver: t,
|
|
@@ -4849,7 +4858,7 @@ const Pt = ({
|
|
|
4849
4858
|
});
|
|
4850
4859
|
}
|
|
4851
4860
|
return new M({ x: 0, y: 0 });
|
|
4852
|
-
},
|
|
4861
|
+
}, is = ({
|
|
4853
4862
|
pageIndex: n,
|
|
4854
4863
|
spineItemsManager: e,
|
|
4855
4864
|
spineItemId: t,
|
|
@@ -4860,7 +4869,7 @@ const Pt = ({
|
|
|
4860
4869
|
const r = e.get(t);
|
|
4861
4870
|
if (!r) {
|
|
4862
4871
|
const u = n * s.pageSize.width;
|
|
4863
|
-
return
|
|
4872
|
+
return qe({
|
|
4864
4873
|
viewportPosition: new M({ x: u, y: 0 }),
|
|
4865
4874
|
spineItemNavigationResolver: o,
|
|
4866
4875
|
spineLocator: i,
|
|
@@ -4879,28 +4888,28 @@ const Pt = ({
|
|
|
4879
4888
|
pageSizeWidth: s.pageSize.width,
|
|
4880
4889
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
4881
4890
|
});
|
|
4882
|
-
},
|
|
4891
|
+
}, os = (n, e) => {
|
|
4883
4892
|
if (e && e instanceof HTMLIFrameElement)
|
|
4884
4893
|
return n.startsWith("#") ? e.contentDocument?.getElementById(
|
|
4885
4894
|
n.replace("#", "")
|
|
4886
4895
|
) : e.contentDocument?.querySelector(n);
|
|
4887
|
-
},
|
|
4896
|
+
}, ss = ({
|
|
4888
4897
|
anchor: n,
|
|
4889
4898
|
spineItem: e,
|
|
4890
4899
|
spine: t
|
|
4891
4900
|
}) => {
|
|
4892
|
-
const i =
|
|
4901
|
+
const i = os(
|
|
4893
4902
|
n,
|
|
4894
4903
|
e.renderer.getDocumentFrame()
|
|
4895
4904
|
);
|
|
4896
4905
|
return i ? t.spineItemLocator.getSpineItemPositionFromNode(i, 0, e)?.x ?? 0 : 0;
|
|
4897
|
-
},
|
|
4906
|
+
}, rs = ({
|
|
4898
4907
|
anchor: n,
|
|
4899
4908
|
spineItem: e,
|
|
4900
4909
|
spineLocator: t,
|
|
4901
4910
|
spine: i
|
|
4902
4911
|
}) => {
|
|
4903
|
-
const o =
|
|
4912
|
+
const o = ss({
|
|
4904
4913
|
anchor: n,
|
|
4905
4914
|
spineItem: e,
|
|
4906
4915
|
spine: i
|
|
@@ -4909,7 +4918,7 @@ const Pt = ({
|
|
|
4909
4918
|
spineItemPosition: new E({ x: o, y: 0 }),
|
|
4910
4919
|
spineItem: e
|
|
4911
4920
|
});
|
|
4912
|
-
},
|
|
4921
|
+
}, as = ({
|
|
4913
4922
|
anchor: n,
|
|
4914
4923
|
spineItem: e,
|
|
4915
4924
|
spineLocator: t,
|
|
@@ -4917,7 +4926,7 @@ const Pt = ({
|
|
|
4917
4926
|
pageSizeWidth: o,
|
|
4918
4927
|
visibleAreaRectWidth: s
|
|
4919
4928
|
}) => {
|
|
4920
|
-
const r =
|
|
4929
|
+
const r = rs({
|
|
4921
4930
|
anchor: n,
|
|
4922
4931
|
spineItem: e,
|
|
4923
4932
|
spineLocator: t,
|
|
@@ -4928,7 +4937,7 @@ const Pt = ({
|
|
|
4928
4937
|
pageSizeWidth: o,
|
|
4929
4938
|
visibleAreaRectWidth: s
|
|
4930
4939
|
});
|
|
4931
|
-
},
|
|
4940
|
+
}, cs = ({
|
|
4932
4941
|
spine: n,
|
|
4933
4942
|
spineItemsManager: e,
|
|
4934
4943
|
spineLocator: t,
|
|
@@ -4944,7 +4953,7 @@ const Pt = ({
|
|
|
4944
4953
|
if (u) {
|
|
4945
4954
|
const l = e.get(u.id);
|
|
4946
4955
|
if (l) {
|
|
4947
|
-
const d =
|
|
4956
|
+
const d = as({
|
|
4948
4957
|
anchor: a.hash,
|
|
4949
4958
|
spineItem: l,
|
|
4950
4959
|
spine: n,
|
|
@@ -4967,7 +4976,7 @@ const Pt = ({
|
|
|
4967
4976
|
console.error(a);
|
|
4968
4977
|
return;
|
|
4969
4978
|
}
|
|
4970
|
-
},
|
|
4979
|
+
}, us = ({
|
|
4971
4980
|
spineItem: n,
|
|
4972
4981
|
spineItemPosition: e,
|
|
4973
4982
|
spineLocator: t,
|
|
@@ -4986,7 +4995,7 @@ const Pt = ({
|
|
|
4986
4995
|
pageSizeWidth: o.pageSize.width,
|
|
4987
4996
|
visibleAreaRectWidth: o.absoluteViewport.width
|
|
4988
4997
|
});
|
|
4989
|
-
},
|
|
4998
|
+
}, ls = "spineNavigator", ds = ({
|
|
4990
4999
|
context: n,
|
|
4991
5000
|
spineItemsManager: e,
|
|
4992
5001
|
locator: t,
|
|
@@ -4994,13 +5003,13 @@ const Pt = ({
|
|
|
4994
5003
|
spine: o,
|
|
4995
5004
|
viewport: s
|
|
4996
5005
|
}) => {
|
|
4997
|
-
const r =
|
|
5006
|
+
const r = ns({
|
|
4998
5007
|
context: n,
|
|
4999
5008
|
settings: i,
|
|
5000
5009
|
viewport: s
|
|
5001
5010
|
});
|
|
5002
5011
|
return {
|
|
5003
|
-
getNavigationForUrl: (p) =>
|
|
5012
|
+
getNavigationForUrl: (p) => cs({
|
|
5004
5013
|
context: n,
|
|
5005
5014
|
spineItemsManager: e,
|
|
5006
5015
|
spineLocator: t,
|
|
@@ -5009,14 +5018,14 @@ const Pt = ({
|
|
|
5009
5018
|
visibleAreaRectWidth: s.absoluteViewport.width,
|
|
5010
5019
|
spine: o
|
|
5011
5020
|
}),
|
|
5012
|
-
getNavigationForSpineItemPage: (p) =>
|
|
5021
|
+
getNavigationForSpineItemPage: (p) => is({
|
|
5013
5022
|
...p,
|
|
5014
5023
|
spineItemsManager: e,
|
|
5015
5024
|
spineItemNavigationResolver: r,
|
|
5016
5025
|
spineLocator: t,
|
|
5017
5026
|
viewport: s
|
|
5018
5027
|
}),
|
|
5019
|
-
getNavigationFromSpineItemPosition: (p) =>
|
|
5028
|
+
getNavigationFromSpineItemPosition: (p) => us({
|
|
5020
5029
|
...p,
|
|
5021
5030
|
spineItemLocator: t.spineItemLocator,
|
|
5022
5031
|
spineLocator: t,
|
|
@@ -5028,7 +5037,7 @@ const Pt = ({
|
|
|
5028
5037
|
spineItemsManager: e
|
|
5029
5038
|
});
|
|
5030
5039
|
if (!h) {
|
|
5031
|
-
|
|
5040
|
+
D.warn(ls, `unable to detect item id from cfi ${p}`);
|
|
5032
5041
|
return;
|
|
5033
5042
|
}
|
|
5034
5043
|
const f = m ? r.getNavigationFromNode(h, m, y) : new E({ x: 0, y: 0 }), I = t.getSpinePositionFromSpineItemPosition({
|
|
@@ -5064,14 +5073,14 @@ const Pt = ({
|
|
|
5064
5073
|
}
|
|
5065
5074
|
return new M({ x: 0, y: 0 });
|
|
5066
5075
|
},
|
|
5067
|
-
getNavigationForPosition: (p) =>
|
|
5076
|
+
getNavigationForPosition: (p) => qe({
|
|
5068
5077
|
viewportPosition: p,
|
|
5069
5078
|
spineItemNavigationResolver: r,
|
|
5070
5079
|
spineLocator: t,
|
|
5071
5080
|
viewport: s
|
|
5072
5081
|
}),
|
|
5073
5082
|
getMostPredominantNavigationForPosition: (p) => {
|
|
5074
|
-
const h = i.values.computedPageTurnDirection, m = 0.5, y = h === "horizontal" ? p.x + s.absoluteViewport.width * m : 0, f = h === "horizontal" ? 0 : p.y + s.absoluteViewport.height * m, I =
|
|
5083
|
+
const h = i.values.computedPageTurnDirection, m = 0.5, y = h === "horizontal" ? p.x + s.absoluteViewport.width * m : 0, f = h === "horizontal" ? 0 : p.y + s.absoluteViewport.height * m, I = xt({
|
|
5075
5084
|
position: new M({
|
|
5076
5085
|
x: y,
|
|
5077
5086
|
y: f
|
|
@@ -5082,14 +5091,14 @@ const Pt = ({
|
|
|
5082
5091
|
spineItemsManager: e,
|
|
5083
5092
|
spine: o
|
|
5084
5093
|
});
|
|
5085
|
-
return
|
|
5094
|
+
return qe({
|
|
5086
5095
|
spineItemNavigationResolver: r,
|
|
5087
5096
|
spineLocator: t,
|
|
5088
5097
|
viewportPosition: I,
|
|
5089
5098
|
viewport: s
|
|
5090
5099
|
});
|
|
5091
5100
|
},
|
|
5092
|
-
fromUnboundSpinePosition: (p) =>
|
|
5101
|
+
fromUnboundSpinePosition: (p) => xt({
|
|
5093
5102
|
position: p,
|
|
5094
5103
|
isRTL: n.isRTL(),
|
|
5095
5104
|
pageSizeHeight: s.pageSize.height,
|
|
@@ -5113,7 +5122,7 @@ const Pt = ({
|
|
|
5113
5122
|
}),
|
|
5114
5123
|
spineItemNavigator: r
|
|
5115
5124
|
};
|
|
5116
|
-
},
|
|
5125
|
+
}, ps = ({
|
|
5117
5126
|
spineItemsManager: n,
|
|
5118
5127
|
context: e,
|
|
5119
5128
|
hookManager: t,
|
|
@@ -5121,26 +5130,26 @@ const Pt = ({
|
|
|
5121
5130
|
settings: o,
|
|
5122
5131
|
viewport: s
|
|
5123
5132
|
}) => {
|
|
5124
|
-
const r = new N(), a = r.asObservable(), c = new Xt(), u =
|
|
5133
|
+
const r = new N(), a = r.asObservable(), c = new Xt(), u = ds({
|
|
5125
5134
|
context: e,
|
|
5126
5135
|
settings: o,
|
|
5127
5136
|
spineItemsManager: n,
|
|
5128
5137
|
locator: i.locator,
|
|
5129
5138
|
spine: i,
|
|
5130
5139
|
viewport: s
|
|
5131
|
-
}), l = new
|
|
5140
|
+
}), l = new ko(
|
|
5132
5141
|
o,
|
|
5133
5142
|
t,
|
|
5134
5143
|
e,
|
|
5135
5144
|
i,
|
|
5136
5145
|
s
|
|
5137
|
-
), d = new
|
|
5146
|
+
), d = new To(
|
|
5138
5147
|
s,
|
|
5139
5148
|
o,
|
|
5140
5149
|
t,
|
|
5141
5150
|
i,
|
|
5142
5151
|
e
|
|
5143
|
-
), g = new
|
|
5152
|
+
), g = new Qo(
|
|
5144
5153
|
o,
|
|
5145
5154
|
e,
|
|
5146
5155
|
a,
|
|
@@ -5157,7 +5166,7 @@ const Pt = ({
|
|
|
5157
5166
|
]).pipe(
|
|
5158
5167
|
ie((y) => y.some((f) => f) ? "busy" : "free"),
|
|
5159
5168
|
be(),
|
|
5160
|
-
|
|
5169
|
+
Ze(1)
|
|
5161
5170
|
);
|
|
5162
5171
|
return {
|
|
5163
5172
|
destroy: () => {
|
|
@@ -5183,7 +5192,7 @@ const Pt = ({
|
|
|
5183
5192
|
navigation$: g.navigation$
|
|
5184
5193
|
};
|
|
5185
5194
|
};
|
|
5186
|
-
class
|
|
5195
|
+
class gs extends Q {
|
|
5187
5196
|
constructor(e, t) {
|
|
5188
5197
|
super({
|
|
5189
5198
|
beginPageIndexInSpineItem: void 0,
|
|
@@ -5201,7 +5210,7 @@ class ps extends Q {
|
|
|
5201
5210
|
this.mergeCompare(e);
|
|
5202
5211
|
}
|
|
5203
5212
|
}
|
|
5204
|
-
class
|
|
5213
|
+
class hs extends G {
|
|
5205
5214
|
constructor(e, t, i, o, s) {
|
|
5206
5215
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spine = o, this.spineItemLocator = s;
|
|
5207
5216
|
const r = P(
|
|
@@ -5218,7 +5227,7 @@ class gs extends G {
|
|
|
5218
5227
|
threshold: { type: "percentage", value: 0.5 }
|
|
5219
5228
|
});
|
|
5220
5229
|
return this.context.bridgeEvent.navigationUnlocked$.pipe(
|
|
5221
|
-
|
|
5230
|
+
Tt(1),
|
|
5222
5231
|
z(this.context.bridgeEvent.navigation$),
|
|
5223
5232
|
x(([, u]) => {
|
|
5224
5233
|
const { position: l } = u, d = this.pagination.value, {
|
|
@@ -5235,7 +5244,7 @@ class gs extends G {
|
|
|
5235
5244
|
}) ?? {}, { endPageIndex: b = 0 } = c({
|
|
5236
5245
|
spineItem: m,
|
|
5237
5246
|
position: l
|
|
5238
|
-
}) ?? {}, F = y === void 0 ||
|
|
5247
|
+
}) ?? {}, F = y === void 0 || Xe(y) || d.beginSpineItemIndex !== g, $ = d.endSpineItemIndex !== p || f === void 0 || Xe(f), L = F ? de(h.item) : y, H = $ ? de(m.item) : f, B = h.numberOfPages, se = m.numberOfPages;
|
|
5239
5248
|
this.pagination.update({
|
|
5240
5249
|
beginCfi: L,
|
|
5241
5250
|
beginNumberOfPagesInSpineItem: B,
|
|
@@ -5251,7 +5260,7 @@ class gs extends G {
|
|
|
5251
5260
|
);
|
|
5252
5261
|
})
|
|
5253
5262
|
), a = r.pipe(
|
|
5254
|
-
|
|
5263
|
+
Ae(this.context.bridgeEvent.viewportFree$),
|
|
5255
5264
|
x(() => {
|
|
5256
5265
|
const {
|
|
5257
5266
|
beginSpineItemIndex: c,
|
|
@@ -5271,11 +5280,11 @@ class gs extends G {
|
|
|
5271
5280
|
d
|
|
5272
5281
|
);
|
|
5273
5282
|
this.pagination.update({
|
|
5274
|
-
beginCfi: h?.firstVisibleNode ?
|
|
5283
|
+
beginCfi: h?.firstVisibleNode ? Be({
|
|
5275
5284
|
spineItem: g.item,
|
|
5276
5285
|
pageNode: h?.firstVisibleNode
|
|
5277
5286
|
}) : de(g.item),
|
|
5278
|
-
endCfi: m?.firstVisibleNode ?
|
|
5287
|
+
endCfi: m?.firstVisibleNode ? Be({
|
|
5279
5288
|
spineItem: p.item,
|
|
5280
5289
|
pageNode: m?.firstVisibleNode
|
|
5281
5290
|
}) : de(p.item)
|
|
@@ -5285,11 +5294,11 @@ class gs extends G {
|
|
|
5285
5294
|
P(r, a).pipe(T(this.destroy$)).subscribe();
|
|
5286
5295
|
}
|
|
5287
5296
|
}
|
|
5288
|
-
const
|
|
5297
|
+
const ms = ({
|
|
5289
5298
|
manifest: n,
|
|
5290
5299
|
spreadMode: e
|
|
5291
5300
|
}) => n?.renditionFlow === "scrolled-continuous" ? !1 : e;
|
|
5292
|
-
class
|
|
5301
|
+
class fs extends G {
|
|
5293
5302
|
constructor(e) {
|
|
5294
5303
|
super();
|
|
5295
5304
|
const t = {
|
|
@@ -5299,7 +5308,7 @@ class ms extends G {
|
|
|
5299
5308
|
this.inputSettings = t, this.outputSettingsUpdateSubject = new N(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(J(1)), this._settings$.subscribe();
|
|
5300
5309
|
}
|
|
5301
5310
|
_prepareUpdate(e) {
|
|
5302
|
-
const t =
|
|
5311
|
+
const t = Te(this.inputSettings, e), i = this.getOutputSettings(t), o = !O(this.outputSettings, i);
|
|
5303
5312
|
return {
|
|
5304
5313
|
hasChanged: o,
|
|
5305
5314
|
state: i,
|
|
@@ -5334,7 +5343,7 @@ class ms extends G {
|
|
|
5334
5343
|
super.destroy(), this.outputSettingsUpdateSubject.complete();
|
|
5335
5344
|
}
|
|
5336
5345
|
}
|
|
5337
|
-
class
|
|
5346
|
+
class ys extends fs {
|
|
5338
5347
|
constructor(e, t) {
|
|
5339
5348
|
super(e), this.context = t, t.watch(["manifest", "hasVerticalWriting"]).pipe(
|
|
5340
5349
|
x(() => this.update(this.values)),
|
|
@@ -5347,12 +5356,12 @@ class fs extends ms {
|
|
|
5347
5356
|
computedPageTurnAnimation: e.pageTurnAnimation,
|
|
5348
5357
|
computedPageTurnMode: e.pageTurnMode,
|
|
5349
5358
|
computedPageTurnAnimationDuration: 0,
|
|
5350
|
-
computedSpreadMode:
|
|
5359
|
+
computedSpreadMode: ms({
|
|
5351
5360
|
spreadMode: e.spreadMode,
|
|
5352
5361
|
manifest: t
|
|
5353
5362
|
})
|
|
5354
5363
|
};
|
|
5355
|
-
return t?.renditionFlow === "scrolled-continuous" && (o.computedPageTurnMode = "scrollable"), o.computedPageTurnMode === "scrollable" && (o.computedPageTurnDirection = "vertical"), i && o.computedPageTurnAnimation === "slide" && (
|
|
5364
|
+
return t?.renditionFlow === "scrolled-continuous" && (o.computedPageTurnMode = "scrollable"), o.computedPageTurnMode === "scrollable" && (o.computedPageTurnDirection = "vertical"), i && o.computedPageTurnAnimation === "slide" && (D.warn(
|
|
5356
5365
|
`pageTurnAnimation ${o.computedPageTurnAnimation} incompatible with current book, switching back to default`
|
|
5357
5366
|
), o.computedPageTurnAnimation = "none"), o.computedPageTurnMode === "scrollable" ? (o.computedPageTurnAnimationDuration = 0, o.computedPageTurnAnimation = "none") : o.computedPageTurnAnimationDuration = e.pageTurnAnimationDuration !== void 0 ? e.pageTurnAnimationDuration : 300, o;
|
|
5358
5367
|
}
|
|
@@ -5373,7 +5382,7 @@ class fs extends ms {
|
|
|
5373
5382
|
};
|
|
5374
5383
|
}
|
|
5375
5384
|
}
|
|
5376
|
-
class
|
|
5385
|
+
class Ss extends ye {
|
|
5377
5386
|
onUnload() {
|
|
5378
5387
|
return _;
|
|
5379
5388
|
}
|
|
@@ -5392,7 +5401,7 @@ class ys extends ye {
|
|
|
5392
5401
|
getDocumentFrame() {
|
|
5393
5402
|
}
|
|
5394
5403
|
}
|
|
5395
|
-
class
|
|
5404
|
+
class Is extends G {
|
|
5396
5405
|
constructor(e, t, i, o, s, r, a) {
|
|
5397
5406
|
super(), this.item = e, this.containerElement = t, this.context = i, this.hookManager = o, this.renderer = s, this.settings = r, this.viewport = a, this.layoutTriggerSubject = new N(), this.lastLayout = null, this.computeLayoutInformation = ({
|
|
5398
5407
|
isLastItem: u,
|
|
@@ -5445,7 +5454,7 @@ class Ss extends G {
|
|
|
5445
5454
|
), { width: $, height: L });
|
|
5446
5455
|
})
|
|
5447
5456
|
), this.layout = (u) => {
|
|
5448
|
-
const l =
|
|
5457
|
+
const l = Yn(this.didLayout$.pipe(U()));
|
|
5449
5458
|
return this.layoutTriggerSubject.next(u), l();
|
|
5450
5459
|
};
|
|
5451
5460
|
const c = this.layoutTriggerSubject.pipe(
|
|
@@ -5487,12 +5496,12 @@ class Ss extends G {
|
|
|
5487
5496
|
);
|
|
5488
5497
|
}
|
|
5489
5498
|
),
|
|
5490
|
-
|
|
5499
|
+
A()
|
|
5491
5500
|
);
|
|
5492
5501
|
this.didLayout$ = c.pipe(
|
|
5493
5502
|
C((u) => u.type === "end"),
|
|
5494
5503
|
S((u) => u.data),
|
|
5495
|
-
|
|
5504
|
+
A()
|
|
5496
5505
|
);
|
|
5497
5506
|
}
|
|
5498
5507
|
validateDimension(e, t, i) {
|
|
@@ -5526,13 +5535,13 @@ class Zt extends Q {
|
|
|
5526
5535
|
});
|
|
5527
5536
|
}, this.destroy = () => {
|
|
5528
5537
|
super.destroy(), this.containerElement.remove(), this.renderer.destroy();
|
|
5529
|
-
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (d) => this._layout.layout(d), this.containerElement =
|
|
5538
|
+
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (d) => this._layout.layout(d), this.containerElement = bs(
|
|
5530
5539
|
t,
|
|
5531
5540
|
e,
|
|
5532
5541
|
s
|
|
5533
5542
|
), t.appendChild(this.containerElement);
|
|
5534
5543
|
const c = this.settings.values.getRenderer?.(e);
|
|
5535
|
-
this.resourcesHandler = new
|
|
5544
|
+
this.resourcesHandler = new nt(e, this.settings);
|
|
5536
5545
|
const u = {
|
|
5537
5546
|
context: i,
|
|
5538
5547
|
settings: o,
|
|
@@ -5542,7 +5551,7 @@ class Zt extends Q {
|
|
|
5542
5551
|
resourcesHandler: this.resourcesHandler,
|
|
5543
5552
|
viewport: this.viewport
|
|
5544
5553
|
};
|
|
5545
|
-
this.renderer = c ? c(u) : new
|
|
5554
|
+
this.renderer = c ? c(u) : new Ss(u), this._layout = new Is(
|
|
5546
5555
|
e,
|
|
5547
5556
|
this.containerElement,
|
|
5548
5557
|
i,
|
|
@@ -5630,14 +5639,14 @@ class Zt extends Q {
|
|
|
5630
5639
|
});
|
|
5631
5640
|
}
|
|
5632
5641
|
}
|
|
5633
|
-
const
|
|
5642
|
+
const bs = (n, e, t) => {
|
|
5634
5643
|
const i = n.ownerDocument.createElement("div");
|
|
5635
5644
|
return i.classList.add("spineItem"), i.classList.add(`spineItem-${e.renditionLayout ?? "reflowable"}`), i.style.cssText = `
|
|
5636
5645
|
position: absolute;
|
|
5637
5646
|
overflow: hidden;
|
|
5638
5647
|
`, i.dataset.isReady = "false", t.execute("item.onBeforeContainerCreated", void 0, { element: i }), i;
|
|
5639
5648
|
};
|
|
5640
|
-
class
|
|
5649
|
+
class vs extends G {
|
|
5641
5650
|
constructor(e, t, i, o, s) {
|
|
5642
5651
|
super(), this.context = e, this.spineItemsManager = t, this.spineLocator = i, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new q(
|
|
5643
5652
|
/* @__PURE__ */ new Map()
|
|
@@ -5657,7 +5666,7 @@ class bs extends G {
|
|
|
5657
5666
|
// Ideally loading faster is better but loading too close to user navigating can
|
|
5658
5667
|
// be dangerous.
|
|
5659
5668
|
Ie(100, re),
|
|
5660
|
-
|
|
5669
|
+
Ae(this.context.bridgeEvent.viewportFree$),
|
|
5661
5670
|
z(this.context.bridgeEvent.navigation$, r),
|
|
5662
5671
|
S(([, u, l]) => {
|
|
5663
5672
|
const { numberOfAdjacentSpineItemToPreLoad: d } = o.values, { beginIndex: g = 0, endIndex: p = 0 } = i.getVisibleSpineItemsFromPosition({
|
|
@@ -5717,17 +5726,17 @@ class Se extends DOMRect {
|
|
|
5717
5726
|
return new Se(i.x, i.y, i.width, i.height);
|
|
5718
5727
|
}
|
|
5719
5728
|
}
|
|
5720
|
-
class
|
|
5729
|
+
class ws {
|
|
5721
5730
|
constructor({ width: e, height: t }) {
|
|
5722
5731
|
this.__symbol = /* @__PURE__ */ Symbol("AbsoluteViewport"), this.width = e, this.height = t;
|
|
5723
5732
|
}
|
|
5724
5733
|
}
|
|
5725
|
-
class
|
|
5734
|
+
class Ps {
|
|
5726
5735
|
constructor({ width: e, height: t }) {
|
|
5727
5736
|
this.__symbol = /* @__PURE__ */ Symbol("RelativeViewport"), this.width = e, this.height = t;
|
|
5728
5737
|
}
|
|
5729
5738
|
}
|
|
5730
|
-
const
|
|
5739
|
+
const xs = ({
|
|
5731
5740
|
pageIndex: n,
|
|
5732
5741
|
spineItemOrId: e,
|
|
5733
5742
|
spineItemsManager: t
|
|
@@ -5749,7 +5758,7 @@ const Ps = ({
|
|
|
5749
5758
|
{ currentAbsolutePage: 0, found: !1 }
|
|
5750
5759
|
);
|
|
5751
5760
|
return s;
|
|
5752
|
-
},
|
|
5761
|
+
}, $s = ({
|
|
5753
5762
|
itemHeight: n,
|
|
5754
5763
|
itemWidth: e,
|
|
5755
5764
|
visibleWidthOfItem: t,
|
|
@@ -5758,7 +5767,7 @@ const Ps = ({
|
|
|
5758
5767
|
}) => {
|
|
5759
5768
|
const s = t / e, r = i / n;
|
|
5760
5769
|
return o.type === "percentage" ? s >= o.value && r >= o.value : t >= o.value && i >= o.value;
|
|
5761
|
-
},
|
|
5770
|
+
}, Ts = ({
|
|
5762
5771
|
visibleWidthOfItem: n,
|
|
5763
5772
|
visibleHeightOfItem: e,
|
|
5764
5773
|
threshold: t,
|
|
@@ -5790,14 +5799,14 @@ const Ps = ({
|
|
|
5790
5799
|
Math.min(n, g) - Math.max(i, d)
|
|
5791
5800
|
);
|
|
5792
5801
|
if (p <= 0 || h <= 0) return { visible: !1 };
|
|
5793
|
-
const y =
|
|
5802
|
+
const y = Ts({
|
|
5794
5803
|
threshold: r,
|
|
5795
5804
|
visibleHeightOfItem: h,
|
|
5796
5805
|
visibleWidthOfItem: p,
|
|
5797
5806
|
viewportPosition: a
|
|
5798
5807
|
});
|
|
5799
5808
|
return c ? { visible: y } : {
|
|
5800
|
-
visible:
|
|
5809
|
+
visible: $s({
|
|
5801
5810
|
itemHeight: s,
|
|
5802
5811
|
itemWidth: o,
|
|
5803
5812
|
threshold: r,
|
|
@@ -5805,7 +5814,7 @@ const Ps = ({
|
|
|
5805
5814
|
visibleWidthOfItem: p
|
|
5806
5815
|
}) || y
|
|
5807
5816
|
};
|
|
5808
|
-
},
|
|
5817
|
+
}, Ge = ({
|
|
5809
5818
|
position: n,
|
|
5810
5819
|
spineItemsManager: e,
|
|
5811
5820
|
spineLayout: t
|
|
@@ -5815,13 +5824,13 @@ const Ps = ({
|
|
|
5815
5824
|
return u && l;
|
|
5816
5825
|
});
|
|
5817
5826
|
return n.x === 0 && !i ? e.items[0] : i;
|
|
5818
|
-
},
|
|
5827
|
+
}, ze = ({
|
|
5819
5828
|
spineItemPosition: n,
|
|
5820
5829
|
itemLayout: { left: e, top: t }
|
|
5821
5830
|
}) => new M({
|
|
5822
5831
|
x: e + n.x,
|
|
5823
5832
|
y: t + n.y
|
|
5824
|
-
}),
|
|
5833
|
+
}), Fs = ({
|
|
5825
5834
|
position: n,
|
|
5826
5835
|
threshold: e,
|
|
5827
5836
|
restrictToScreen: t,
|
|
@@ -5830,7 +5839,7 @@ const Ps = ({
|
|
|
5830
5839
|
useAbsoluteViewport: s = !0,
|
|
5831
5840
|
viewport: r
|
|
5832
5841
|
}) => {
|
|
5833
|
-
const a =
|
|
5842
|
+
const a = Ge({
|
|
5834
5843
|
position: n,
|
|
5835
5844
|
spineItemsManager: i,
|
|
5836
5845
|
spineLayout: o
|
|
@@ -5859,7 +5868,7 @@ const Ps = ({
|
|
|
5859
5868
|
beginIndex: d ?? 0,
|
|
5860
5869
|
endIndex: g ?? 0
|
|
5861
5870
|
};
|
|
5862
|
-
},
|
|
5871
|
+
}, Ls = ({
|
|
5863
5872
|
spineItemsManager: n,
|
|
5864
5873
|
context: e,
|
|
5865
5874
|
spineItemLocator: t,
|
|
@@ -5880,7 +5889,7 @@ const Ps = ({
|
|
|
5880
5889
|
x: Math.max(h.x - y, 0),
|
|
5881
5890
|
y: Math.max(h.y - f, 0)
|
|
5882
5891
|
});
|
|
5883
|
-
}, a = (h) =>
|
|
5892
|
+
}, a = (h) => ze({
|
|
5884
5893
|
spineItemPosition: new E({ x: 0, y: 0 }),
|
|
5885
5894
|
itemLayout: o.getSpineItemSpineLayoutInfo(h)
|
|
5886
5895
|
}), c = (h) => n.items.find((m) => m.renderer.getDocumentFrame() === h), u = (h, m, y) => {
|
|
@@ -5906,11 +5915,11 @@ const Ps = ({
|
|
|
5906
5915
|
viewport: b
|
|
5907
5916
|
}) => {
|
|
5908
5917
|
const F = y.numberOfPages, L = Array.from(Array(F)).map((se, ue) => {
|
|
5909
|
-
const
|
|
5918
|
+
const Ne = t.getSpineItemPositionFromPageIndex({
|
|
5910
5919
|
pageIndex: ue,
|
|
5911
5920
|
spineItem: y
|
|
5912
|
-
}), le =
|
|
5913
|
-
spineItemPosition:
|
|
5921
|
+
}), le = ze({
|
|
5922
|
+
spineItemPosition: Ne,
|
|
5914
5923
|
itemLayout: o.getSpineItemSpineLayoutInfo(y)
|
|
5915
5924
|
});
|
|
5916
5925
|
return {
|
|
@@ -5925,7 +5934,7 @@ const Ps = ({
|
|
|
5925
5934
|
}
|
|
5926
5935
|
};
|
|
5927
5936
|
}).reduce(
|
|
5928
|
-
(se, { absolutePosition: ue, index:
|
|
5937
|
+
(se, { absolutePosition: ue, index: Ne }) => {
|
|
5929
5938
|
const le = I ? b.absoluteViewport : b.relativeViewport, Qt = Jt(
|
|
5930
5939
|
h,
|
|
5931
5940
|
b.absoluteViewport,
|
|
@@ -5939,7 +5948,7 @@ const Ps = ({
|
|
|
5939
5948
|
threshold: m,
|
|
5940
5949
|
itemPosition: ue
|
|
5941
5950
|
});
|
|
5942
|
-
return tn ? [...se,
|
|
5951
|
+
return tn ? [...se, Ne] : se;
|
|
5943
5952
|
},
|
|
5944
5953
|
[]
|
|
5945
5954
|
), H = L[0], B = L[L.length - 1] ?? H;
|
|
@@ -5955,7 +5964,7 @@ const Ps = ({
|
|
|
5955
5964
|
spineItemPosition: m
|
|
5956
5965
|
}) => {
|
|
5957
5966
|
const y = o.getSpineItemSpineLayoutInfo(h);
|
|
5958
|
-
return
|
|
5967
|
+
return ze({
|
|
5959
5968
|
itemLayout: y,
|
|
5960
5969
|
spineItemPosition: m
|
|
5961
5970
|
});
|
|
@@ -5963,12 +5972,12 @@ const Ps = ({
|
|
|
5963
5972
|
/**
|
|
5964
5973
|
* @deprecated use Pages
|
|
5965
5974
|
*/
|
|
5966
|
-
_getAbsolutePageIndexFromPageIndex: (h) =>
|
|
5975
|
+
_getAbsolutePageIndexFromPageIndex: (h) => xs({
|
|
5967
5976
|
...h,
|
|
5968
5977
|
spineItemsManager: n
|
|
5969
5978
|
}),
|
|
5970
5979
|
getSpineItemPagePositionFromSpinePosition: (h) => {
|
|
5971
|
-
const m =
|
|
5980
|
+
const m = Ge({
|
|
5972
5981
|
position: h,
|
|
5973
5982
|
spineItemsManager: n,
|
|
5974
5983
|
spineLayout: o
|
|
@@ -5997,14 +6006,14 @@ const Ps = ({
|
|
|
5997
6006
|
},
|
|
5998
6007
|
getSpinePositionFromSpineItem: a,
|
|
5999
6008
|
getSpineItemPositionFromSpinePosition: r,
|
|
6000
|
-
getSpineItemFromPosition: (h) =>
|
|
6009
|
+
getSpineItemFromPosition: (h) => Ge({
|
|
6001
6010
|
position: h,
|
|
6002
6011
|
spineItemsManager: n,
|
|
6003
6012
|
spineLayout: o
|
|
6004
6013
|
}),
|
|
6005
6014
|
getSpineItemFromIframe: c,
|
|
6006
6015
|
getSpineItemPageIndexFromNode: u,
|
|
6007
|
-
getVisibleSpineItemsFromPosition: (h) =>
|
|
6016
|
+
getVisibleSpineItemsFromPosition: (h) => Fs({
|
|
6008
6017
|
spineItemsManager: n,
|
|
6009
6018
|
spineLayout: o,
|
|
6010
6019
|
viewport: s,
|
|
@@ -6027,10 +6036,10 @@ const Ps = ({
|
|
|
6027
6036
|
});
|
|
6028
6037
|
}
|
|
6029
6038
|
};
|
|
6030
|
-
},
|
|
6039
|
+
}, Ms = D.namespace("spine"), Cs = ({
|
|
6031
6040
|
position: n,
|
|
6032
6041
|
pageSize: e
|
|
6033
|
-
}) => new
|
|
6042
|
+
}) => new bi({
|
|
6034
6043
|
...n,
|
|
6035
6044
|
left: n.x,
|
|
6036
6045
|
top: n.y,
|
|
@@ -6039,7 +6048,7 @@ const Ps = ({
|
|
|
6039
6048
|
bottom: n.y + e.height,
|
|
6040
6049
|
right: n.x + e.width
|
|
6041
6050
|
});
|
|
6042
|
-
class
|
|
6051
|
+
class Es extends Q {
|
|
6043
6052
|
constructor(e, t, i, o, s, r) {
|
|
6044
6053
|
super({ pages: [] }), this.spineLayout = e, this.spineItemsManager = t, this.spineItemLocator = i, this.context = o, this.locator = s, this.viewport = r, this.fromSpineItemPageIndex = (a, c) => this.value.pages.find(
|
|
6045
6054
|
(u) => u.itemIndex === a.index && u.pageIndex === c
|
|
@@ -6059,11 +6068,11 @@ class Cs extends Q {
|
|
|
6059
6068
|
spineItemPosition: f
|
|
6060
6069
|
});
|
|
6061
6070
|
return {
|
|
6062
|
-
absoluteLayout:
|
|
6071
|
+
absoluteLayout: Cs({
|
|
6063
6072
|
pageSize: a,
|
|
6064
6073
|
position: I
|
|
6065
6074
|
}),
|
|
6066
|
-
layout: new
|
|
6075
|
+
layout: new Ii({
|
|
6067
6076
|
left: f.x,
|
|
6068
6077
|
right: f.x + a.width,
|
|
6069
6078
|
top: f.y,
|
|
@@ -6090,7 +6099,7 @@ class Cs extends Q {
|
|
|
6090
6099
|
const p = l.spineItem.renderer?.getDocumentFrame();
|
|
6091
6100
|
if (p && p?.contentWindow?.document && p.contentWindow.document.body !== null) {
|
|
6092
6101
|
const h = p.contentWindow.document;
|
|
6093
|
-
return
|
|
6102
|
+
return tt().pipe(
|
|
6094
6103
|
S(() => {
|
|
6095
6104
|
const m = Ln(
|
|
6096
6105
|
h,
|
|
@@ -6108,12 +6117,12 @@ class Cs extends Q {
|
|
|
6108
6117
|
})
|
|
6109
6118
|
);
|
|
6110
6119
|
}),
|
|
6111
|
-
S((a) => (
|
|
6112
|
-
|
|
6120
|
+
S((a) => (Ms.info("Pages layout", a), { pages: a })),
|
|
6121
|
+
A()
|
|
6113
6122
|
), this.layout$.pipe(T(this.destroy$)).subscribe(this.next.bind(this));
|
|
6114
6123
|
}
|
|
6115
6124
|
}
|
|
6116
|
-
class
|
|
6125
|
+
class Ds extends G {
|
|
6117
6126
|
constructor(e) {
|
|
6118
6127
|
super(), this.spineItemsManager = e, this.states$ = this.spineItemsManager.items$.pipe(
|
|
6119
6128
|
w((t) => P(
|
|
@@ -6124,29 +6133,29 @@ class Es extends G {
|
|
|
6124
6133
|
)
|
|
6125
6134
|
)
|
|
6126
6135
|
)),
|
|
6127
|
-
|
|
6136
|
+
A()
|
|
6128
6137
|
), this.itemResize$ = this.spineItemsManager.items$.pipe(
|
|
6129
6138
|
w((t) => {
|
|
6130
6139
|
const i = t.map(
|
|
6131
|
-
(o) =>
|
|
6140
|
+
(o) => et(o.element).pipe(
|
|
6132
6141
|
S((s) => ({ entries: s, item: o }))
|
|
6133
6142
|
)
|
|
6134
6143
|
);
|
|
6135
6144
|
return P(...i);
|
|
6136
6145
|
}),
|
|
6137
|
-
|
|
6146
|
+
A()
|
|
6138
6147
|
), this.itemLoad$ = this.spineItemsManager.items$.pipe(
|
|
6139
6148
|
w((t) => P(...t.map((i) => i.loaded$.pipe(S(() => i))))),
|
|
6140
|
-
|
|
6149
|
+
A()
|
|
6141
6150
|
), this.itemUnload$ = this.spineItemsManager.items$.pipe(
|
|
6142
6151
|
w((t) => P(
|
|
6143
6152
|
...t.map((i) => i.unloaded$.pipe(S(() => i)))
|
|
6144
6153
|
)),
|
|
6145
|
-
|
|
6154
|
+
A()
|
|
6146
6155
|
);
|
|
6147
6156
|
}
|
|
6148
6157
|
}
|
|
6149
|
-
class
|
|
6158
|
+
class As extends G {
|
|
6150
6159
|
constructor(e, t, i, o, s) {
|
|
6151
6160
|
super(), this.spineItemsManager = e, this.spineItemsObserver = t, this.context = i, this.settings = o, this.viewport = s, this.externalLayoutTrigger = new N(), this.spineItemsRelativeLayouts = [];
|
|
6152
6161
|
const r = P(
|
|
@@ -6206,7 +6215,7 @@ class Ds extends G {
|
|
|
6206
6215
|
)
|
|
6207
6216
|
),
|
|
6208
6217
|
T(this.destroy$),
|
|
6209
|
-
|
|
6218
|
+
A()
|
|
6210
6219
|
), this.layout$.subscribe(), this.watchForVerticalWritingUpdate();
|
|
6211
6220
|
}
|
|
6212
6221
|
watchForVerticalWritingUpdate() {
|
|
@@ -6224,7 +6233,7 @@ class Ds extends G {
|
|
|
6224
6233
|
}
|
|
6225
6234
|
getSpineItemSpineLayoutInfo(e) {
|
|
6226
6235
|
const t = this.spineItemsManager.getSpineItemIndex(e) ?? 0;
|
|
6227
|
-
return this.spineItemsRelativeLayouts[t] || new
|
|
6236
|
+
return this.spineItemsRelativeLayouts[t] || new Ve({
|
|
6228
6237
|
left: 0,
|
|
6229
6238
|
right: 0,
|
|
6230
6239
|
top: 0,
|
|
@@ -6256,7 +6265,7 @@ class Ds extends G {
|
|
|
6256
6265
|
createSpineItemLayout(e, t, i, o, s, r, a) {
|
|
6257
6266
|
if (e) {
|
|
6258
6267
|
const u = s + i, l = r + o;
|
|
6259
|
-
return new
|
|
6268
|
+
return new Ve({
|
|
6260
6269
|
left: i,
|
|
6261
6270
|
right: u,
|
|
6262
6271
|
top: o,
|
|
@@ -6268,7 +6277,7 @@ class Ds extends G {
|
|
|
6268
6277
|
});
|
|
6269
6278
|
}
|
|
6270
6279
|
const c = t ? a - i - s : i;
|
|
6271
|
-
return new
|
|
6280
|
+
return new Ve({
|
|
6272
6281
|
right: t ? a - i : i + s,
|
|
6273
6282
|
left: c,
|
|
6274
6283
|
x: c,
|
|
@@ -6280,30 +6289,30 @@ class Ds extends G {
|
|
|
6280
6289
|
});
|
|
6281
6290
|
}
|
|
6282
6291
|
}
|
|
6283
|
-
class
|
|
6292
|
+
class Ns extends G {
|
|
6284
6293
|
constructor(e, t, i, o, s, r, a) {
|
|
6285
6294
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spineItemLocator = o, this.settings = s, this.hookManager = r, this.viewport = a, this.elementSubject = new q(
|
|
6286
6295
|
void 0
|
|
6287
|
-
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new
|
|
6296
|
+
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new Ds(i), this.spineLayout = new As(
|
|
6288
6297
|
i,
|
|
6289
6298
|
this.spineItemsObserver,
|
|
6290
6299
|
e,
|
|
6291
6300
|
s,
|
|
6292
6301
|
a
|
|
6293
|
-
), this.locator =
|
|
6302
|
+
), this.locator = Ls({
|
|
6294
6303
|
context: e,
|
|
6295
6304
|
spineItemsManager: i,
|
|
6296
6305
|
spineItemLocator: o,
|
|
6297
6306
|
settings: s,
|
|
6298
6307
|
spineLayout: this.spineLayout,
|
|
6299
6308
|
viewport: a
|
|
6300
|
-
}), this.spineItemsLoader = new
|
|
6309
|
+
}), this.spineItemsLoader = new vs(
|
|
6301
6310
|
this.context,
|
|
6302
6311
|
i,
|
|
6303
6312
|
this.locator,
|
|
6304
6313
|
s,
|
|
6305
6314
|
this.spineLayout
|
|
6306
|
-
), this.pages = new
|
|
6315
|
+
), this.pages = new Es(
|
|
6307
6316
|
this.spineLayout,
|
|
6308
6317
|
this.spineItemsManager,
|
|
6309
6318
|
this.spineItemLocator,
|
|
@@ -6359,7 +6368,7 @@ class As extends G {
|
|
|
6359
6368
|
super.destroy(), this.pages.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue()?.remove(), this.elementSubject.complete();
|
|
6360
6369
|
}
|
|
6361
6370
|
}
|
|
6362
|
-
class
|
|
6371
|
+
class Rs extends G {
|
|
6363
6372
|
constructor(e, t) {
|
|
6364
6373
|
super(), this.context = e, this.settings = t, this.orderedSpineItemsSubject = new q([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
|
|
6365
6374
|
}
|
|
@@ -6386,7 +6395,7 @@ class Ns extends G {
|
|
|
6386
6395
|
}
|
|
6387
6396
|
// @todo move
|
|
6388
6397
|
getSpineItemFromCfi(e) {
|
|
6389
|
-
const { itemIndex: t } =
|
|
6398
|
+
const { itemIndex: t } = ot(e);
|
|
6390
6399
|
if (t !== void 0)
|
|
6391
6400
|
return this.get(t);
|
|
6392
6401
|
}
|
|
@@ -6402,10 +6411,10 @@ class Ns extends G {
|
|
|
6402
6411
|
});
|
|
6403
6412
|
}
|
|
6404
6413
|
}
|
|
6405
|
-
class
|
|
6414
|
+
class Os extends Q {
|
|
6406
6415
|
constructor(e, t) {
|
|
6407
6416
|
const i = document.createElement("div");
|
|
6408
|
-
i.setAttribute(`data-${
|
|
6417
|
+
i.setAttribute(`data-${si}`, ""), super({
|
|
6409
6418
|
element: i,
|
|
6410
6419
|
pageSize: {
|
|
6411
6420
|
width: 1,
|
|
@@ -6445,7 +6454,7 @@ class Rs extends Q {
|
|
|
6445
6454
|
});
|
|
6446
6455
|
}
|
|
6447
6456
|
get absoluteViewport() {
|
|
6448
|
-
return new
|
|
6457
|
+
return new ws({
|
|
6449
6458
|
width: this.value.width,
|
|
6450
6459
|
height: this.value.height
|
|
6451
6460
|
});
|
|
@@ -6473,18 +6482,18 @@ class Rs extends Q {
|
|
|
6473
6482
|
*/
|
|
6474
6483
|
get relativeViewport() {
|
|
6475
6484
|
const e = this.absoluteViewport, t = this.scaleFactor;
|
|
6476
|
-
return new
|
|
6485
|
+
return new Ps({
|
|
6477
6486
|
width: e.width / t,
|
|
6478
6487
|
height: e.height / t
|
|
6479
6488
|
});
|
|
6480
6489
|
}
|
|
6481
6490
|
}
|
|
6482
|
-
const
|
|
6483
|
-
const e = crypto.randomUUID(), t = new N(), i = new N(), o = new
|
|
6491
|
+
const $t = `${Vt}-core`, Vs = (n) => {
|
|
6492
|
+
const e = crypto.randomUUID(), t = new N(), i = new N(), o = new No(), s = new Do(), r = new ys(n, s), a = new Ao(s, r), c = new Rs(s, r), u = new Os(s, r), l = qt({
|
|
6484
6493
|
context: s,
|
|
6485
6494
|
settings: r,
|
|
6486
6495
|
viewport: u
|
|
6487
|
-
}), d = new
|
|
6496
|
+
}), d = new gs(s, c), g = new Ns(
|
|
6488
6497
|
s,
|
|
6489
6498
|
d,
|
|
6490
6499
|
c,
|
|
@@ -6492,14 +6501,14 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6492
6501
|
r,
|
|
6493
6502
|
o,
|
|
6494
6503
|
u
|
|
6495
|
-
), p =
|
|
6504
|
+
), p = ps({
|
|
6496
6505
|
context: s,
|
|
6497
6506
|
spineItemsManager: c,
|
|
6498
6507
|
hookManager: o,
|
|
6499
6508
|
spine: g,
|
|
6500
6509
|
settings: r,
|
|
6501
6510
|
viewport: u
|
|
6502
|
-
}), h = new
|
|
6511
|
+
}), h = new hs(
|
|
6503
6512
|
s,
|
|
6504
6513
|
d,
|
|
6505
6514
|
c,
|
|
@@ -6514,11 +6523,11 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6514
6523
|
}, y = ($) => {
|
|
6515
6524
|
const { containerElement: L, manifest: H } = $;
|
|
6516
6525
|
if (s.manifest) {
|
|
6517
|
-
|
|
6526
|
+
D.warn("loading a new book is not supported yet");
|
|
6518
6527
|
return;
|
|
6519
6528
|
}
|
|
6520
|
-
|
|
6521
|
-
const B =
|
|
6529
|
+
D.log("load", { options: $ });
|
|
6530
|
+
const B = js(L, e);
|
|
6522
6531
|
s.update({
|
|
6523
6532
|
manifest: H,
|
|
6524
6533
|
rootElement: B
|
|
@@ -6530,9 +6539,9 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6530
6539
|
}),
|
|
6531
6540
|
K(i)
|
|
6532
6541
|
), b = P(I, f).subscribe();
|
|
6533
|
-
|
|
6542
|
+
Ee(document, $t, Ro);
|
|
6534
6543
|
const F = () => {
|
|
6535
|
-
|
|
6544
|
+
De(document, $t), b.unsubscribe(), c.destroy(), h.destroy(), r.destroy(), d.destroy(), s.destroy(), p.destroy(), g.destroy(), a.destroy(), i.next(), i.complete(), u.destroy();
|
|
6536
6545
|
};
|
|
6537
6546
|
return {
|
|
6538
6547
|
id: e,
|
|
@@ -6540,9 +6549,9 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6540
6549
|
spine: g,
|
|
6541
6550
|
hookManager: o,
|
|
6542
6551
|
cfi: {
|
|
6543
|
-
generateCfiFromRange:
|
|
6544
|
-
parseCfi:
|
|
6545
|
-
generateCfiForSpineItemPage:
|
|
6552
|
+
generateCfiFromRange: oo,
|
|
6553
|
+
parseCfi: ot,
|
|
6554
|
+
generateCfiForSpineItemPage: Be,
|
|
6546
6555
|
resolveCfi: ($) => _t({ ...$, spineItemsManager: c })
|
|
6547
6556
|
},
|
|
6548
6557
|
navigation: p,
|
|
@@ -6578,30 +6587,30 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6578
6587
|
destroy$: i
|
|
6579
6588
|
}
|
|
6580
6589
|
};
|
|
6581
|
-
},
|
|
6590
|
+
}, js = (n, e) => (n.style.cssText = `
|
|
6582
6591
|
${n.style.cssText}
|
|
6583
6592
|
background-color: white;
|
|
6584
6593
|
position: relative;
|
|
6585
|
-
`, n.classList.add(`${W}-reader`), n.setAttribute(
|
|
6594
|
+
`, n.classList.add(`${W}-reader`), n.setAttribute(oi, e), n.setAttribute("data-prose-reader-container", e), n), Ks = (
|
|
6586
6595
|
//__
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6596
|
+
So(
|
|
6597
|
+
Zn(
|
|
6598
|
+
vo(
|
|
6599
|
+
Gn(
|
|
6591
6600
|
Un(
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6601
|
+
go(
|
|
6602
|
+
bo(
|
|
6603
|
+
Co(
|
|
6604
|
+
Yi(
|
|
6605
|
+
Si(
|
|
6606
|
+
Ri(
|
|
6598
6607
|
zn(
|
|
6599
6608
|
Bn(
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6609
|
+
uo(
|
|
6610
|
+
Ai(
|
|
6611
|
+
Io(
|
|
6603
6612
|
// __
|
|
6604
|
-
|
|
6613
|
+
Vs
|
|
6605
6614
|
)
|
|
6606
6615
|
)
|
|
6607
6616
|
)
|
|
@@ -6618,83 +6627,84 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6618
6627
|
)
|
|
6619
6628
|
)
|
|
6620
6629
|
)
|
|
6621
|
-
),
|
|
6630
|
+
), Qs = (n) => (e) => n(e);
|
|
6622
6631
|
export {
|
|
6623
6632
|
kt as AbstractSpinePosition,
|
|
6624
|
-
|
|
6625
|
-
|
|
6633
|
+
Do as Context,
|
|
6634
|
+
ko as ControlledNavigationController,
|
|
6626
6635
|
G as DestroyableClass,
|
|
6627
6636
|
ye as DocumentRenderer,
|
|
6628
|
-
|
|
6629
|
-
|
|
6637
|
+
Ao as Features,
|
|
6638
|
+
oi as HTML_ATTRIBUTE_DATA_READER_ID,
|
|
6630
6639
|
W as HTML_PREFIX,
|
|
6631
|
-
|
|
6632
|
-
|
|
6640
|
+
ri as HTML_PREFIX_SCROLL_NAVIGATOR,
|
|
6641
|
+
si as HTML_PREFIX_VIEWPORT,
|
|
6633
6642
|
Vt as HTML_STYLE_PREFIX,
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6643
|
+
No as HookManager,
|
|
6644
|
+
ii as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
|
|
6645
|
+
Qo as InternalNavigator,
|
|
6646
|
+
it as LayoutEntry,
|
|
6638
6647
|
Xt as Locker,
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6648
|
+
Gs as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
|
|
6649
|
+
Ys as PROSE_READER_NAMESPACE,
|
|
6650
|
+
Es as Pages,
|
|
6651
|
+
gs as Pagination,
|
|
6652
|
+
hs as PaginationController,
|
|
6644
6653
|
Q as ReactiveEntity,
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6654
|
+
nt as ResourceHandler,
|
|
6655
|
+
co as ResourcesLocator,
|
|
6656
|
+
To as ScrollNavigationController,
|
|
6657
|
+
ft as ScrollPosition,
|
|
6658
|
+
fs as SettingsManager,
|
|
6659
|
+
Ns as Spine,
|
|
6651
6660
|
Zt as SpineItem,
|
|
6652
|
-
|
|
6653
|
-
|
|
6661
|
+
Ii as SpineItemPageLayout,
|
|
6662
|
+
bi as SpineItemPageSpineLayout,
|
|
6654
6663
|
E as SpineItemPosition,
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6664
|
+
Ve as SpineItemSpineLayout,
|
|
6665
|
+
Rs as SpineItemsManager,
|
|
6666
|
+
Ds as SpineItemsObserver,
|
|
6658
6667
|
M as SpinePosition,
|
|
6659
|
-
|
|
6660
|
-
|
|
6668
|
+
$o as UnboundScrollPosition,
|
|
6669
|
+
Oe as UnboundSpineItemPagePosition,
|
|
6661
6670
|
ae as UnboundSpinePosition,
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6671
|
+
qs as VIEWPORT_ADJUSTMENT_THROTTLE,
|
|
6672
|
+
Os as Viewport,
|
|
6673
|
+
ao as consolidate,
|
|
6674
|
+
Ks as createReader,
|
|
6675
|
+
ct as deferIdle,
|
|
6676
|
+
Yn as deferNextResult,
|
|
6677
|
+
Be as generateCfiForSpineItemPage,
|
|
6678
|
+
oo as generateCfiFromRange,
|
|
6670
6679
|
de as generateRootCfi,
|
|
6671
|
-
|
|
6680
|
+
at as getAttributeValueFromString,
|
|
6672
6681
|
Hs as getBase64FromBlob,
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6682
|
+
Ke as getFrameViewportInfo,
|
|
6683
|
+
Js as getItemAnchor,
|
|
6684
|
+
Si as htmlEnhancer,
|
|
6685
|
+
tt as idle,
|
|
6677
6686
|
Vn as injectCSSToFrame,
|
|
6678
6687
|
Z as isDefined,
|
|
6679
6688
|
At as isHtmlElement,
|
|
6680
6689
|
Rn as isHtmlTagElement,
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6690
|
+
Xe as isRootCfi,
|
|
6691
|
+
nr as isShallowEqual,
|
|
6692
|
+
Ai as layoutEnhancer,
|
|
6684
6693
|
Nt as mapKeysTo,
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6694
|
+
Bs as observeIntersection,
|
|
6695
|
+
ut as observeMutation,
|
|
6696
|
+
et as observeResize,
|
|
6697
|
+
uo as paginationEnhancer,
|
|
6698
|
+
ot as parseCfi,
|
|
6699
|
+
Xn as pick,
|
|
6700
|
+
_s as removeCSS,
|
|
6691
6701
|
_t as resolveCfi,
|
|
6692
|
-
|
|
6693
|
-
|
|
6702
|
+
Qs as rootEnhancer,
|
|
6703
|
+
Cs as spinePositionToSpineItemSpineLayout,
|
|
6694
6704
|
oe as upsertCSSToFrame,
|
|
6695
6705
|
jn as waitForFrameLoad,
|
|
6696
6706
|
kn as waitForFrameReady,
|
|
6697
|
-
|
|
6698
|
-
|
|
6707
|
+
Ae as waitForSwitch,
|
|
6708
|
+
Qe as watchKeys
|
|
6699
6709
|
};
|
|
6700
6710
|
//# sourceMappingURL=index.js.map
|