@prose-reader/core 1.246.0 → 1.247.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 CHANGED
@@ -1,7 +1,7 @@
1
- import { switchMap as w, of as v, fromEvent as Y, take as wt, map as S, from as N, takeUntil as T, Observable as te, defer as ke, Subject as j, combineLatest as k, merge as x, EMPTY as G, withLatestFrom as D, NEVER as de, tap as P, share as R, BehaviorSubject as W, filter as M, first as U, mergeMap as Pe, endWith as me, finalize as ue, catchError as xt, lastValueFrom as tn, scheduled as nn, animationFrameScheduler as se, exhaustMap as Ue, debounceTime as Se, distinctUntilChanged as z, throttleTime as on, startWith as Q, shareReplay as Z, switchScan as sn, defaultIfEmpty as rn, forkJoin as an, delay as ve, timer as $e, ReplaySubject as it, identity as we, skip as Pt, reduce as cn, concatMap as ot } from "rxjs";
2
- import { Report as un, isShallowEqual as O, shallowMergeIfDefined as xe, getParentPath as ln, parseContentType as pn, detectMimeTypeFromName as Le, arrayEqual as dn } from "@prose-reader/shared";
1
+ import { switchMap as w, of as v, fromEvent as Y, take as wt, map as S, from as O, takeUntil as T, Observable as te, defer as ke, Subject as j, combineLatest as k, merge as x, EMPTY as G, withLatestFrom as D, NEVER as ge, tap as P, share as R, BehaviorSubject as W, filter as L, first as U, mergeMap as Pe, endWith as me, finalize as le, catchError as xt, lastValueFrom as tn, scheduled as nn, animationFrameScheduler as se, exhaustMap as Ue, debounceTime as Se, distinctUntilChanged as z, throttleTime as on, startWith as Q, shareReplay as Z, switchScan as sn, defaultIfEmpty as rn, forkJoin as an, delay as ve, timer as $e, ReplaySubject as it, identity as we, skip as Pt, reduce as cn, concatMap as ot } from "rxjs";
2
+ import { Report as un, isShallowEqual as N, shallowMergeIfDefined as xe, getParentPath as ln, parseContentType as pn, detectMimeTypeFromName as Le, arrayEqual as dn } from "@prose-reader/shared";
3
3
  import { isShallowEqual as Zs } from "@prose-reader/shared";
4
- import { switchMap as _, first as $t, map as J, distinctUntilChanged as le, startWith as gn, shareReplay as Me, tap as V, pairwise as hn, take as mn, takeUntil as q, filter as oe, debounceTime as fn, skip as Tt, mergeMap as yn, catchError as st } from "rxjs/operators";
4
+ import { switchMap as _, first as $t, map as J, distinctUntilChanged as pe, startWith as gn, shareReplay as Me, tap as V, pairwise as hn, take as mn, takeUntil as q, filter as oe, debounceTime as fn, skip as Tt, mergeMap as yn, catchError as st } from "rxjs/operators";
5
5
  import { generate as ze, parse as Ft, isIndirectionOnly as Sn, isParsedCfiRange as In, resolve as bn } from "@prose-reader/cfi";
6
6
  import { isDefined as Ge } from "reactjrx";
7
7
  const rt = (n, e) => {
@@ -50,7 +50,7 @@ const rt = (n, e) => {
50
50
  ), xn = (n) => n.pipe(
51
51
  w((e) => {
52
52
  const t = e?.contentDocument?.fonts.ready;
53
- return t ? N(t).pipe(S(() => e)) : v(void 0);
53
+ return t ? O(t).pipe(S(() => e)) : v(void 0);
54
54
  })
55
55
  ), Pn = (n) => (e) => {
56
56
  const t = n(e), i = new IntersectionObserver((o) => {
@@ -224,7 +224,7 @@ const En = (n, e) => {
224
224
  // JavaScript files
225
225
  ].join(",");
226
226
  return Array.from(n?.querySelectorAll(e) || []);
227
- }, Nn = (n) => {
227
+ }, On = (n) => {
228
228
  if (Mt(n).forEach((t) => {
229
229
  const i = t.getAttribute("src") || t.getAttribute("href");
230
230
  i?.startsWith("blob:") && n?.defaultView?.URL.revokeObjectURL(i);
@@ -259,7 +259,7 @@ function Et(n) {
259
259
  // biome-ignore lint/suspicious/noExplicitAny: TODO
260
260
  ) && n.nodeType === Node.ELEMENT_NODE;
261
261
  }
262
- function On(n, e) {
262
+ function Nn(n, e) {
263
263
  return Et(n) && n.tagName.toLowerCase() === e.toLowerCase();
264
264
  }
265
265
  function Vn(n) {
@@ -389,7 +389,7 @@ const De = ({
389
389
  [i]: o
390
390
  } : t,
391
391
  {}
392
- )), Ke = (n) => (e) => e.pipe(Dt(n), le(O));
392
+ )), Ke = (n) => (e) => e.pipe(Dt(n), pe(N));
393
393
  function Qe(n) {
394
394
  return new te((e) => {
395
395
  const t = new ResizeObserver((i) => {
@@ -488,7 +488,7 @@ class At {
488
488
  watch(e) {
489
489
  return Array.isArray(e) ? this.values$.pipe(Ke(e)) : this.values$.pipe(
490
490
  J((t) => t[e]),
491
- le(O)
491
+ pe(N)
492
492
  );
493
493
  }
494
494
  destroy() {
@@ -512,7 +512,7 @@ let _n = class extends At {
512
512
  return e;
513
513
  }
514
514
  hasSettingsChanged(e) {
515
- return !O(this.outputSettings, e);
515
+ return !N(this.outputSettings, e);
516
516
  }
517
517
  getCleanedParentInputSettings(e) {
518
518
  const {
@@ -620,7 +620,7 @@ const Hn = (n) => (e) => {
620
620
  ...e.map((t) => t.watch("isLoaded").pipe(
621
621
  w(() => {
622
622
  const i = t.renderer.getDocumentFrame();
623
- if (!i || !i?.contentDocument) return de;
623
+ if (!i || !i?.contentDocument) return ge;
624
624
  const s = Array.from(
625
625
  i.contentDocument.querySelectorAll("a")
626
626
  ).map(
@@ -648,7 +648,7 @@ const Fe = class Fe extends B {
648
648
  constructor(e) {
649
649
  super(), this.triggerSubject = new j(), this.stateSubject = new W("idle"), this.unload$ = this.triggerSubject.pipe(
650
650
  D(this.stateSubject),
651
- M(
651
+ L(
652
652
  ([o, s]) => o.type === "unload" && s !== "idle" && s !== "unloading"
653
653
  ),
654
654
  S(() => {
@@ -656,7 +656,7 @@ const Fe = class Fe extends B {
656
656
  R()
657
657
  ), this.load$ = this.triggerSubject.pipe(
658
658
  D(this.stateSubject),
659
- M(
659
+ L(
660
660
  ([o, s]) => o.type === "load" && s !== "loaded" && s !== "loading"
661
661
  ),
662
662
  S(() => {
@@ -665,7 +665,7 @@ const Fe = class Fe extends B {
665
665
  ), this.context = e.context, this.settings = e.settings, this.hookManager = e.hookManager, this.item = e.item, this.containerElement = e.containerElement, this.resourcesHandler = e.resourcesHandler, this.viewport = e.viewport;
666
666
  const t = this.triggerSubject.pipe(
667
667
  D(this.stateSubject),
668
- M(
668
+ L(
669
669
  ([o, s]) => o.type === "unload" && s !== "idle" && s !== "unloading"
670
670
  ),
671
671
  S(() => {
@@ -751,7 +751,7 @@ const Fe = class Fe extends B {
751
751
  }
752
752
  };
753
753
  }),
754
- ue(() => {
754
+ le(() => {
755
755
  e.complete();
756
756
  }),
757
757
  xt((t) => (E.error(t), v(void 0)))
@@ -798,7 +798,7 @@ class et {
798
798
  return e instanceof Response ? e : e instanceof URL ? fetch(e) : e;
799
799
  }
800
800
  }
801
- const Nt = (n, e) => {
801
+ const Ot = (n, e) => {
802
802
  const t = n.startsWith("file://"), i = t ? n.replace("file://", "http://") : n, o = new URL(e, i).toString();
803
803
  return t ? o.replace("http://", "file://") : o;
804
804
  }, qn = async (n, e, t, i, o) => {
@@ -818,7 +818,7 @@ const Nt = (n, e) => {
818
818
  return d;
819
819
  const m = d.match(/url\(['"]?([^'"]+)['"]?\)/);
820
820
  if (!m) return d;
821
- const y = m[1] ?? "", f = i.manifest?.items.find(({ href: I }) => `${Nt(t, y).toLowerCase()}`.endsWith(
821
+ const y = m[1] ?? "", f = i.manifest?.items.find(({ href: I }) => `${Ot(t, y).toLowerCase()}`.endsWith(
822
822
  `${I.toLowerCase()}`
823
823
  ));
824
824
  if (f) {
@@ -852,14 +852,14 @@ const Nt = (n, e) => {
852
852
  }, Gn = (n, e, t, i, o) => {
853
853
  const s = e.getAttribute("src") || e.getAttribute("href");
854
854
  if (!s) return v(null);
855
- const r = i.manifest?.items.find(({ href: c }) => `${Nt(t, s).toLowerCase()}`.endsWith(
855
+ const r = i.manifest?.items.find(({ href: c }) => `${Ot(t, s).toLowerCase()}`.endsWith(
856
856
  `${c.toLowerCase()}`
857
857
  ));
858
858
  if (!r) return v(null);
859
859
  const a = new et(r, o);
860
- return N(a.getResource()).pipe(
860
+ return O(a.getResource()).pipe(
861
861
  Pe(
862
- (c) => c instanceof Response ? N(c.blob()) : v(void 0)
862
+ (c) => c instanceof Response ? O(c.blob()) : v(void 0)
863
863
  ),
864
864
  Pe((c) => {
865
865
  if (!c)
@@ -906,8 +906,8 @@ const Nt = (n, e) => {
906
906
  return k(a).pipe(S(() => o));
907
907
  })
908
908
  ), Jn = (n) => {
909
- Nn(n?.contentDocument);
910
- }, zs = "@prose-reader/core", Ws = 0, _s = 200, Kn = [".xhtml", ".html", ".htm"], pe = "prose-reader", Qn = `data-${pe}-id`, ei = `${pe}-viewport`, ti = async (n, e) => {
909
+ On(n?.contentDocument);
910
+ }, zs = "@prose-reader/core", Ws = 0, _s = 200, Kn = [".xhtml", ".html", ".htm"], de = "prose-reader", Qn = `data-${de}-id`, ei = `${de}-viewport`, ti = async (n, e) => {
911
911
  if (typeof n == "string") return n;
912
912
  const t = pn(n.headers.get("Content-Type") || "") || Le(e.href);
913
913
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
@@ -951,7 +951,7 @@ const Nt = (n, e) => {
951
951
  }) => {
952
952
  const t = (i) => ti(i, n);
953
953
  return (i) => i.pipe(
954
- w((o) => N(e.getResource()).pipe(
954
+ w((o) => O(e.getResource()).pipe(
955
955
  w((s) => s instanceof URL && n.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
956
956
  (n.mediaType && [
957
957
  "application/xhtml+xml",
@@ -961,11 +961,11 @@ const Nt = (n, e) => {
961
961
  ].includes(n.mediaType) || // no encoding ? then try to detect html
962
962
  !n.mediaType && Kn.some(
963
963
  (a) => n.href.endsWith(a)
964
- )) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? N(e.fetchResource()) : v(s)).pipe(
964
+ )) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? O(e.fetchResource()) : v(s)).pipe(
965
965
  w((a) => {
966
966
  if (!(a instanceof Response))
967
967
  throw new Error("Invalid resource");
968
- return N(t(a));
968
+ return O(t(a));
969
969
  }),
970
970
  P((a) => {
971
971
  if (a) {
@@ -996,7 +996,7 @@ const Nt = (n, e) => {
996
996
  border: 0px none transparent;
997
997
  padding: 0px;
998
998
  `, n.setAttribute("role", "main"), n;
999
- }, Ot = () => `
999
+ }, Nt = () => `
1000
1000
  body {
1001
1001
  margin: 0;
1002
1002
  }
@@ -1019,7 +1019,7 @@ const Nt = (n, e) => {
1019
1019
  enableTouch: e,
1020
1020
  spreadPosition: t
1021
1021
  }, i) => `
1022
- ${Ot()}
1022
+ ${Nt()}
1023
1023
  body {
1024
1024
  ${i ? "" : `
1025
1025
  display: flex;
@@ -1109,7 +1109,7 @@ const Nt = (n, e) => {
1109
1109
  }
1110
1110
  return { width: c, height: i };
1111
1111
  }, ai = () => `
1112
- ${Ot()}
1112
+ ${Nt()}
1113
1113
  html {
1114
1114
  width: 100%;
1115
1115
  height: 100%;
@@ -1374,7 +1374,7 @@ class di extends fe {
1374
1374
  return v(c);
1375
1375
  }
1376
1376
  onRenderHeadless() {
1377
- return N(this.resourcesHandler.fetchResource()).pipe(
1377
+ return O(this.resourcesHandler.fetchResource()).pipe(
1378
1378
  w((e) => {
1379
1379
  if (e instanceof Response) {
1380
1380
  const t = e.headers.get("content-type") ?? "";
@@ -1384,7 +1384,7 @@ class di extends fe {
1384
1384
  "text/html",
1385
1385
  "text/xml"
1386
1386
  ].includes(t))
1387
- return N(e.text()).pipe(
1387
+ return O(e.text()).pipe(
1388
1388
  S((o) => new DOMParser().parseFromString(
1389
1389
  o,
1390
1390
  t
@@ -1439,7 +1439,7 @@ const gi = (n) => (e) => {
1439
1439
  links$: i
1440
1440
  };
1441
1441
  };
1442
- function ce(n) {
1442
+ function ue(n) {
1443
1443
  return n != null;
1444
1444
  }
1445
1445
  class tt {
@@ -1477,20 +1477,20 @@ class jt {
1477
1477
  this.x = e.x, this.y = e.y;
1478
1478
  }
1479
1479
  }
1480
- class L extends jt {
1480
+ class M extends jt {
1481
1481
  constructor() {
1482
1482
  super(...arguments), this.__symbol = "SpinePosition";
1483
1483
  }
1484
1484
  static from(e) {
1485
- return new L(e);
1485
+ return new M(e);
1486
1486
  }
1487
1487
  }
1488
- class he extends jt {
1488
+ class re extends jt {
1489
1489
  constructor() {
1490
1490
  super(...arguments), this.__symbol = "UnboundSpinePosition";
1491
1491
  }
1492
1492
  static from(e) {
1493
- return new he(e);
1493
+ return new re(e);
1494
1494
  }
1495
1495
  }
1496
1496
  const fi = (n, e) => {
@@ -1499,7 +1499,7 @@ const fi = (n, e) => {
1499
1499
  x: u / a,
1500
1500
  y: l / c
1501
1501
  };
1502
- }, yi = (n, e) => new he(
1502
+ }, yi = (n, e) => new re(
1503
1503
  fi(n, e)
1504
1504
  ), Si = (n) => ({
1505
1505
  getSpinePositionFromClientPosition: (e) => n.spine.element ? yi(e, n.spine.element) : void 0
@@ -1515,7 +1515,7 @@ const fi = (n, e) => {
1515
1515
  visibility: hidden;
1516
1516
  `, c.appendChild(e), () => {
1517
1517
  e?.remove(), e = void 0;
1518
- })) : de)
1518
+ })) : ge)
1519
1519
  ), i = (c) => nn(c, se).pipe(
1520
1520
  V(() => {
1521
1521
  e?.style.setProperty(
@@ -1534,7 +1534,7 @@ const fi = (n, e) => {
1534
1534
  mn(1)
1535
1535
  ), a = n.settings.values$.pipe(
1536
1536
  J(() => n.settings.values.computedPageTurnMode),
1537
- le()
1537
+ pe()
1538
1538
  ).pipe(
1539
1539
  _(
1540
1540
  (c) => c === "controlled" ? o.pipe(_(() => s)) : i(v(void 0))
@@ -1581,7 +1581,7 @@ let xi = class extends At {
1581
1581
  return e;
1582
1582
  }
1583
1583
  hasSettingsChanged(e) {
1584
- return !O(this.outputSettings, e);
1584
+ return !N(this.outputSettings, e);
1585
1585
  }
1586
1586
  getCleanedParentInputSettings(e) {
1587
1587
  const {
@@ -1681,10 +1681,10 @@ const Pi = (n) => k([
1681
1681
  ), u = a.values$.pipe(
1682
1682
  oe(({ layoutAutoResize: d }) => d === "container"),
1683
1683
  _(() => r.context.watch("rootElement")),
1684
- oe(ce),
1684
+ oe(ue),
1685
1685
  _((d) => Qe(d)),
1686
1686
  fn(100),
1687
- oe(ce),
1687
+ oe(ue),
1688
1688
  V(() => {
1689
1689
  r?.layout();
1690
1690
  })
@@ -1716,7 +1716,7 @@ const Pi = (n) => k([
1716
1716
  layoutInfo$: p,
1717
1717
  coordinates: Si(r)
1718
1718
  };
1719
- }, Ti = `${pe}-enhancer-loading`, kt = `${Ti}-container`, Fi = (n, e) => {
1719
+ }, Ti = `${de}-enhancer-loading`, kt = `${Ti}-container`, Fi = (n, e) => {
1720
1720
  const t = n.ownerDocument.createElement("div");
1721
1721
  return t.classList.add(kt), t.style.cssText = `
1722
1722
  height: 100%;
@@ -1771,7 +1771,7 @@ const Pi = (n) => k([
1771
1771
  width: i.viewport.absoluteViewport.width,
1772
1772
  theme: u
1773
1773
  })),
1774
- le(O),
1774
+ pe(N),
1775
1775
  V(({ width: u, theme: l }) => {
1776
1776
  Object.values(c).forEach((p) => {
1777
1777
  p.style.setProperty("max-width", `${u}px`), p.style.setProperty(
@@ -1820,12 +1820,12 @@ class Ci extends fe {
1820
1820
  }
1821
1821
  onCreateDocument() {
1822
1822
  const e = this.containerElement.ownerDocument.createElement("img");
1823
- return N(this.resourcesHandler.getResource()).pipe(
1823
+ return O(this.resourcesHandler.getResource()).pipe(
1824
1824
  w((t) => {
1825
1825
  if (this.setDocumentContainer(e), e.style.objectFit = "contain", e.style.userSelect = "none", t instanceof URL)
1826
1826
  return v(t.href);
1827
1827
  if (t instanceof Response)
1828
- return N(t.blob()).pipe(
1828
+ return O(t.blob()).pipe(
1829
1829
  S((i) => URL.createObjectURL(i))
1830
1830
  );
1831
1831
  throw new Error("Invalid resource");
@@ -1919,7 +1919,7 @@ const Ei = (n) => (e) => {
1919
1919
  };
1920
1920
  }, Di = (n, e) => n.links$.pipe(
1921
1921
  P((t) => {
1922
- if (!On(t.target, "a") || t.type !== "click") return;
1922
+ if (!Nn(t.target, "a") || t.type !== "click") return;
1923
1923
  const i = new URL(t.target.href), o = `${i.origin}${i.pathname}`;
1924
1924
  n.context.manifest?.spineItems.some(
1925
1925
  (r) => r.href === o
@@ -1971,10 +1971,10 @@ const Ei = (n) => (e) => {
1971
1971
  spineItemPosition: l,
1972
1972
  spineItem: a
1973
1973
  }) : e.fromUnboundSpinePosition(
1974
- r === "horizontal" ? new L({
1974
+ r === "horizontal" ? new M({
1975
1975
  x: n.x - s.pageSize.width,
1976
1976
  y: 0
1977
- }) : new L({
1977
+ }) : new M({
1978
1978
  y: n.y - s.pageSize.height,
1979
1979
  x: 0
1980
1980
  })
@@ -2023,7 +2023,7 @@ const Ei = (n) => (e) => {
2023
2023
  return i.getAdjustedPositionForSpread(l);
2024
2024
  }
2025
2025
  return i.getAdjustedPositionForSpread(u);
2026
- }, Ni = ({
2026
+ }, Oi = ({
2027
2027
  position: n,
2028
2028
  spineItem: e,
2029
2029
  pageHeight: t,
@@ -2055,7 +2055,7 @@ const Ei = (n) => (e) => {
2055
2055
  const u = o.getSpineItemPositionFromSpinePosition(
2056
2056
  n,
2057
2057
  a
2058
- ), l = Ni({
2058
+ ), l = Oi({
2059
2059
  position: u,
2060
2060
  spineItem: a,
2061
2061
  pageHeight: s.pageSize.height,
@@ -2069,15 +2069,15 @@ const Ei = (n) => (e) => {
2069
2069
  spineItemPosition: l,
2070
2070
  spineItem: a
2071
2071
  }) : e.fromUnboundSpinePosition(
2072
- r === "horizontal" ? new L({
2072
+ r === "horizontal" ? new re({
2073
2073
  x: n.x + s.pageSize.width,
2074
2074
  y: 0
2075
- }) : new L({
2075
+ }) : new re({
2076
2076
  y: n.y + s.pageSize.height,
2077
2077
  x: 0
2078
2078
  })
2079
2079
  );
2080
- }, Oi = ({
2080
+ }, Ni = ({
2081
2081
  position: n,
2082
2082
  spineItem: e,
2083
2083
  context: t,
@@ -2127,7 +2127,7 @@ const Ei = (n) => (e) => {
2127
2127
  };
2128
2128
  class Vi {
2129
2129
  constructor(e) {
2130
- this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new L({ x: 0, y: 0 }), this.unlock = void 0;
2130
+ this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2131
2131
  }
2132
2132
  turnRight() {
2133
2133
  return this.turnRightOrBottom();
@@ -2144,7 +2144,7 @@ class Vi {
2144
2144
  turnRightOrBottom() {
2145
2145
  const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
2146
2146
  if (!t) return;
2147
- const i = Oi({
2147
+ const i = Ni({
2148
2148
  context: this.reader.context,
2149
2149
  navigationResolver: this.reader.navigation.navigationResolver,
2150
2150
  position: e.position,
@@ -2306,7 +2306,7 @@ class Vi {
2306
2306
  }
2307
2307
  class ji {
2308
2308
  constructor(e) {
2309
- this.reader = e, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new L({ x: 0, y: 0 }), this.lastStartPosition = new L({ x: 0, y: 0 }), this.unlock = void 0;
2309
+ this.reader = e, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2310
2310
  }
2311
2311
  moveTo(e, { final: t, start: i } = {}) {
2312
2312
  if (this.reader.settings.values.computedPageTurnMode === "scrollable") {
@@ -2324,7 +2324,7 @@ class ji {
2324
2324
  ), l = Math.floor(
2325
2325
  o === "horizontal" ? 0 : this.lastPosition.y - c / r
2326
2326
  );
2327
- s = new L({
2327
+ s = new M({
2328
2328
  x: u,
2329
2329
  y: l
2330
2330
  }), this.lastDelta = e;
@@ -2369,7 +2369,7 @@ class Ui extends B {
2369
2369
  position: r
2370
2370
  });
2371
2371
  }),
2372
- ue(() => {
2372
+ le(() => {
2373
2373
  s();
2374
2374
  })
2375
2375
  );
@@ -2397,7 +2397,7 @@ const zi = (n) => n.pagination.state$.pipe(
2397
2397
  };
2398
2398
  }
2399
2399
  ),
2400
- z(O)
2400
+ z(N)
2401
2401
  ), Wi = ({ reader: n, duration: e }) => (t) => {
2402
2402
  let i;
2403
2403
  const o = () => {
@@ -2412,7 +2412,7 @@ const zi = (n) => n.pagination.state$.pipe(
2412
2412
  leading: !0
2413
2413
  }),
2414
2414
  P(o),
2415
- ue(o)
2415
+ le(o)
2416
2416
  );
2417
2417
  }, _i = (n) => (e) => {
2418
2418
  const t = n(e), i = zi(t), o = new Vi(t), s = new ji(t), r = new Ui(
@@ -2543,7 +2543,7 @@ const zi = (n) => n.pagination.state$.pipe(
2543
2543
  */
2544
2544
  numberOfTotalPages: n.spine.pages.value.pages.length
2545
2545
  })),
2546
- z(O),
2546
+ z(N),
2547
2547
  Q({
2548
2548
  numberOfPagesPerItems: [],
2549
2549
  numberOfTotalPages: 0
@@ -2630,7 +2630,7 @@ const zi = (n) => n.pagination.state$.pipe(
2630
2630
  }))
2631
2631
  )
2632
2632
  ),
2633
- z(O)
2633
+ z(N)
2634
2634
  );
2635
2635
  return { paginationInfo$: k([
2636
2636
  o,
@@ -2653,7 +2653,7 @@ const zi = (n) => n.pagination.state$.pipe(
2653
2653
  }),
2654
2654
  Z(1)
2655
2655
  ), getPaginationInfo: () => i.value };
2656
- }, ge = (n) => ze({
2656
+ }, he = (n) => ze({
2657
2657
  spineIndex: n.index,
2658
2658
  spineId: n.id
2659
2659
  }), zt = ({
@@ -2662,7 +2662,7 @@ const zi = (n) => n.pagination.state$.pipe(
2662
2662
  item: t
2663
2663
  }) => {
2664
2664
  const i = "ownerDocument" in n ? n.ownerDocument : n.startContainer.ownerDocument;
2665
- return !i || !i?.documentElement || n === i ? ge(t) : Vn(n) ? ze({
2665
+ return !i || !i?.documentElement || n === i ? he(t) : Vn(n) ? ze({
2666
2666
  start: {
2667
2667
  node: n.startContainer,
2668
2668
  offset: n.startOffset,
@@ -2693,7 +2693,7 @@ const zi = (n) => n.pagination.state$.pipe(
2693
2693
  nodeOrRange: o.node,
2694
2694
  offset: o.offset,
2695
2695
  item: e.item
2696
- }).trim() : ge(e.item);
2696
+ }).trim() : he(e.item);
2697
2697
  }, eo = (n, e) => zt({
2698
2698
  nodeOrRange: n,
2699
2699
  item: e
@@ -2764,10 +2764,10 @@ const zi = (n) => n.pagination.state$.pipe(
2764
2764
  const t = n.spineItemsManager.get(e);
2765
2765
  if (!t)
2766
2766
  throw new Error("Spine item not found");
2767
- const i = ge(t.item);
2767
+ const i = he(t.item);
2768
2768
  return {
2769
2769
  ...n.cfi.parseCfi(i),
2770
- cfi: ge(t.item),
2770
+ cfi: he(t.item),
2771
2771
  itemIndex: t.index,
2772
2772
  node: null
2773
2773
  };
@@ -2819,7 +2819,7 @@ class oo {
2819
2819
  o.meta.itemIndex ?? 0
2820
2820
  ), r = s?.renditionLayout === "reflowable", a = i.mode === "shallow" || !r || !s ? () => {
2821
2821
  } : this.reader.spine.spineItemsLoader.forceOpen([s.index]), c = "cfi" in t ? t.cfi : void 0, u = c ? this.locatorsByKey.get(c) : void 0, l = (g) => g.pipe(
2822
- ue(() => {
2822
+ le(() => {
2823
2823
  c && this.deregisterMemoizedStream(c), setTimeout(() => {
2824
2824
  a();
2825
2825
  }, 1e3);
@@ -2960,10 +2960,10 @@ const so = (n) => (e) => {
2960
2960
  t.asObservable().pipe(
2961
2961
  yn(({ id: c, data: u }) => {
2962
2962
  const l = i(c);
2963
- return l ? N(
2964
- an([Ae("prose-reader"), N(u.blob())])
2963
+ return l ? O(
2964
+ an([Ae("prose-reader"), O(u.blob())])
2965
2965
  ).pipe(
2966
- _(([p, g]) => N(p.put(`${e}_${l.id}`, g))),
2966
+ _(([p, g]) => O(p.put(`${e}_${l.id}`, g))),
2967
2967
  st((p) => (E.error(p), G))
2968
2968
  ) : G;
2969
2969
  }),
@@ -2975,15 +2975,15 @@ const so = (n) => (e) => {
2975
2975
  })
2976
2976
  );
2977
2977
  return x(r).pipe(
2978
- _(() => (E.debug("Cleanup up old cache..."), N(Ae("prose-reader")).pipe(
2978
+ _(() => (E.debug("Cleanup up old cache..."), O(Ae("prose-reader")).pipe(
2979
2979
  _(
2980
- (c) => N(c.keys()).pipe(
2980
+ (c) => O(c.keys()).pipe(
2981
2981
  J(
2982
2982
  (u) => u.filter((l) => !l.toString().startsWith(e))
2983
2983
  ),
2984
2984
  _((u) => {
2985
2985
  const l = u.map((p) => c.remove(p));
2986
- return N(Promise.all(l));
2986
+ return O(Promise.all(l));
2987
2987
  })
2988
2988
  )
2989
2989
  ),
@@ -3053,19 +3053,19 @@ class po extends B {
3053
3053
  super();
3054
3054
  const t = e.contentDocument || e.contentWindow?.document;
3055
3055
  if (!t)
3056
- this.selectionChange$ = de, this.selectionOver$ = de;
3056
+ this.selectionChange$ = ge, this.selectionOver$ = ge;
3057
3057
  else {
3058
3058
  const i = ct(t.body, {
3059
3059
  childList: !0,
3060
3060
  subtree: !0
3061
3061
  }).pipe(
3062
- M(
3062
+ L(
3063
3063
  (s) => !!s.find((r) => r.type === "childList" && r.removedNodes.length)
3064
3064
  )
3065
3065
  ), o = e.parentElement ? ct(e.parentElement, {
3066
3066
  childList: !0
3067
3067
  }).pipe(
3068
- M(
3068
+ L(
3069
3069
  (s) => !!s.find(
3070
3070
  (r) => Array.from(r.removedNodes).includes(e)
3071
3071
  )
@@ -3095,7 +3095,7 @@ class po extends B {
3095
3095
  const r = t.getSelection();
3096
3096
  return r && !r.isCollapsed ? [s, r] : void 0;
3097
3097
  }),
3098
- M(ce)
3098
+ L(ue)
3099
3099
  )
3100
3100
  ),
3101
3101
  T(x(o, this.destroy$))
@@ -3106,7 +3106,7 @@ class po extends B {
3106
3106
  const go = (n) => n.watch("isLoaded").pipe(
3107
3107
  w(() => {
3108
3108
  const e = n.renderer.getDocumentFrame(), t = e?.contentDocument || e?.contentWindow?.document;
3109
- if (!e || !t) return de;
3109
+ if (!e || !t) return ge;
3110
3110
  const i = new po(e);
3111
3111
  return x(
3112
3112
  i.selectionChange$.pipe(
@@ -3128,7 +3128,7 @@ const go = (n) => n.watch("isLoaded").pipe(
3128
3128
  ).pipe(
3129
3129
  T(n.unloaded$),
3130
3130
  me(void 0),
3131
- ue(() => {
3131
+ le(() => {
3132
3132
  i.destroy();
3133
3133
  })
3134
3134
  );
@@ -3162,18 +3162,18 @@ const go = (n) => n.watch("isLoaded").pipe(
3162
3162
  ), s = o, r = o.pipe(
3163
3163
  S((l) => !!l),
3164
3164
  z(),
3165
- M((l) => l),
3165
+ L((l) => l),
3166
3166
  R()
3167
3167
  ), a = r.pipe(
3168
3168
  w(() => s),
3169
3169
  z(),
3170
- M((l) => !l),
3170
+ L((l) => !l),
3171
3171
  R()
3172
3172
  ), c = o.pipe(
3173
- M((l) => l?.type === "over"),
3173
+ L((l) => l?.type === "over"),
3174
3174
  R()
3175
3175
  ), u = t.context.watch("rootElement").pipe(
3176
- M(Ge),
3176
+ L(Ge),
3177
3177
  w((l) => Y(l, "pointerdown")),
3178
3178
  D(s),
3179
3179
  S(([, l]) => l),
@@ -3280,7 +3280,7 @@ const go = (n) => n.watch("isLoaded").pipe(
3280
3280
  });
3281
3281
  navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
3282
3282
  const yo = (n) => (e) => n(e);
3283
- class re extends te {
3283
+ class ae extends te {
3284
3284
  constructor(e) {
3285
3285
  super((t) => this.stateSubject.pipe(T(this._destroy$)).subscribe(t)), this._destroy$ = new j(), this.destroy$ = this._destroy$.asObservable(), this.stateSubject = new W(e);
3286
3286
  }
@@ -3292,12 +3292,12 @@ class re extends te {
3292
3292
  */
3293
3293
  mergeCompare(e) {
3294
3294
  const t = { ...this.value, ...e };
3295
- O(this.value, t) || this.stateSubject.next(t);
3295
+ N(this.value, t) || this.stateSubject.next(t);
3296
3296
  }
3297
3297
  watch(e) {
3298
3298
  return Array.isArray(e) ? this.stateSubject.pipe(Ke(e)) : this.stateSubject.pipe(
3299
3299
  S((t) => t[e]),
3300
- z(O)
3300
+ z(N)
3301
3301
  );
3302
3302
  }
3303
3303
  get value() {
@@ -3307,7 +3307,7 @@ class re extends te {
3307
3307
  this.stateSubject.complete(), this._destroy$.complete();
3308
3308
  }
3309
3309
  }
3310
- class _t extends re {
3310
+ class _t extends ae {
3311
3311
  constructor(e) {
3312
3312
  super({
3313
3313
  element: void 0,
@@ -3317,13 +3317,13 @@ class _t extends re {
3317
3317
  }), this.reader = e;
3318
3318
  }
3319
3319
  }
3320
- const Ne = 200;
3320
+ const Oe = 200;
3321
3321
  class So extends _t {
3322
3322
  constructor(e) {
3323
3323
  super(e), this.watch("isZooming").pipe(
3324
- M((t) => !t),
3324
+ L((t) => !t),
3325
3325
  w(
3326
- () => $e(Ne).pipe(
3326
+ () => $e(Oe).pipe(
3327
3327
  P(() => {
3328
3328
  this.reader.viewport.value.element.style.transition = "";
3329
3329
  })
@@ -3331,7 +3331,7 @@ class So extends _t {
3331
3331
  )
3332
3332
  ), this.watch("currentScale").pipe(
3333
3333
  w(
3334
- () => $e(Ne).pipe(
3334
+ () => $e(Oe).pipe(
3335
3335
  P(() => {
3336
3336
  this.reader.layout();
3337
3337
  })
@@ -3362,7 +3362,7 @@ class So extends _t {
3362
3362
  const a = e.cloneNode();
3363
3363
  a.src = e.src, a.style.setProperty("height", "100%"), a.style.setProperty("width", "100%"), a.style.setProperty("object-fit", "contain"), a.style.setProperty("pointer-events", "none"), r.appendChild(a), o.appendChild(r);
3364
3364
  }
3365
- i && !e && (s.style.transition = `transform ${Ne}ms`), this.setScale(t), this.mergeCompare({
3365
+ i && !e && (s.style.transition = `transform ${Oe}ms`), this.setScale(t), this.mergeCompare({
3366
3366
  element: r,
3367
3367
  isZooming: !0,
3368
3368
  currentScale: t,
@@ -3482,22 +3482,22 @@ class wo {
3482
3482
  constructor() {
3483
3483
  this.navigationSubject = new it(1), this.viewportStateSubject = new W("free"), this.paginationSubject = new it(), this.navigationIsLockedSubject = new W(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3484
3484
  z(),
3485
- M((e) => !e)
3485
+ L((e) => !e)
3486
3486
  ), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
3487
- M((e) => e === "free")
3487
+ L((e) => e === "free")
3488
3488
  ), this.viewportBusy$ = this.viewportState$.pipe(
3489
- M((e) => e === "busy")
3489
+ L((e) => e === "busy")
3490
3490
  ), this.navigation$ = this.navigationSubject.asObservable();
3491
3491
  }
3492
3492
  }
3493
- class xo extends re {
3493
+ class xo extends ae {
3494
3494
  constructor() {
3495
3495
  super({
3496
3496
  assumedRenditionLayout: "reflowable"
3497
3497
  }), this.bridgeEvent = new wo(), this.manifest$ = this.pipe(
3498
3498
  J((e) => e.manifest),
3499
- oe(ce),
3500
- le()
3499
+ oe(ue),
3500
+ pe()
3501
3501
  ), this.isRTL = () => this.value.manifest?.readingDirection === "rtl";
3502
3502
  }
3503
3503
  update(e) {
@@ -3518,7 +3518,7 @@ class xo extends re {
3518
3518
  return this.manifest?.readingDirection;
3519
3519
  }
3520
3520
  }
3521
- class Po extends re {
3521
+ class Po extends ae {
3522
3522
  constructor(e, t) {
3523
3523
  super({
3524
3524
  supportedPageTurnAnimation: ["fade", "none", "slide"],
@@ -3535,7 +3535,7 @@ class Po extends re {
3535
3535
  renditionLayout: i?.renditionLayout,
3536
3536
  computedPageTurnMode: s
3537
3537
  })),
3538
- z(O),
3538
+ z(N),
3539
3539
  S(
3540
3540
  ({
3541
3541
  hasVerticalWriting: i,
@@ -3618,10 +3618,10 @@ class $o {
3618
3618
  const To = (n) => ({
3619
3619
  x: -n.x,
3620
3620
  y: -n.y
3621
- }), Fo = (n) => n instanceof DOMMatrix ? new L({
3621
+ }), Fo = (n) => n instanceof DOMMatrix ? new M({
3622
3622
  x: -n.e,
3623
3623
  y: -n.f
3624
- }) : new L({
3624
+ }) : new M({
3625
3625
  x: -n.x,
3626
3626
  y: -n.y
3627
3627
  }), Lo = "navigation/ViewportNavigator", ht = E.namespace(Lo);
@@ -3631,14 +3631,14 @@ class Mo extends B {
3631
3631
  document.createElement("div")
3632
3632
  );
3633
3633
  const r = this.spine.element$.pipe(
3634
- M(Ge),
3634
+ L(Ge),
3635
3635
  D(this.element$),
3636
3636
  P(([l, p]) => {
3637
3637
  p.style.cssText = `
3638
3638
  height: 100%;
3639
3639
  width: 100%;
3640
3640
  position: relative;
3641
- `, p.className = `${pe}-controlled-navigator`, p.innerHTML = "", p.appendChild(l), this.viewport.value.element.appendChild(p), this.element$.next(p);
3641
+ `, p.className = `${de}-controlled-navigator`, p.innerHTML = "", p.appendChild(l), this.viewport.value.element.appendChild(p), this.element$.next(p);
3642
3642
  })
3643
3643
  ), a = e.watch([
3644
3644
  "computedPageTurnDirection",
@@ -3750,7 +3750,7 @@ class Mo extends B {
3750
3750
  get viewportPosition() {
3751
3751
  const e = this.element$.getValue(), t = window.getComputedStyle(e), i = t.transform || t.webkitTransform;
3752
3752
  if (!i || i === "none")
3753
- return new L({ x: 0, y: 0 });
3753
+ return new M({ x: 0, y: 0 });
3754
3754
  const o = new DOMMatrix(i);
3755
3755
  return Fo(o);
3756
3756
  }
@@ -3762,7 +3762,7 @@ class Co {
3762
3762
  }
3763
3763
  class mt extends Co {
3764
3764
  }
3765
- class Eo extends re {
3765
+ class Eo extends ae {
3766
3766
  constructor(e, t, i, o, s) {
3767
3767
  super({
3768
3768
  element: void 0
@@ -3794,7 +3794,7 @@ class Eo extends re {
3794
3794
  position: relative;
3795
3795
  overflow-y: scroll;
3796
3796
  overflow-x: hidden;
3797
- `, g.className = `${pe}-scroll-navigator`, g.appendChild(this.viewport.value.element), p.appendChild(g), this.update({ element: g });
3797
+ `, g.className = `${de}-scroll-navigator`, g.appendChild(this.viewport.value.element), p.appendChild(g), this.update({ element: g });
3798
3798
  })
3799
3799
  ), a = k([
3800
3800
  t.watch(["computedPageTurnMode"]),
@@ -3811,11 +3811,11 @@ class Eo extends re {
3811
3811
  );
3812
3812
  const u = x(
3813
3813
  o.element$.pipe(
3814
- M(ce),
3814
+ L(ue),
3815
3815
  w((p) => Qe(p))
3816
3816
  ),
3817
3817
  o.element$.pipe(
3818
- M(ce),
3818
+ L(ue),
3819
3819
  w((p) => Y(p, "scroll"))
3820
3820
  ),
3821
3821
  o.spineItemsObserver.itemResize$
@@ -3838,13 +3838,13 @@ class Eo extends re {
3838
3838
  Z(1)
3839
3839
  );
3840
3840
  this.userScroll$ = this.watch("element").pipe(
3841
- M(ce),
3841
+ L(ue),
3842
3842
  w(
3843
3843
  (p) => t.watch(["computedPageTurnMode"]).pipe(
3844
3844
  w(
3845
- ({ computedPageTurnMode: g }) => g === "controlled" ? de : Y(p, "scroll").pipe(
3845
+ ({ computedPageTurnMode: g }) => g === "controlled" ? ge : Y(p, "scroll").pipe(
3846
3846
  D(l),
3847
- M(
3847
+ L(
3848
3848
  ([, h]) => !h
3849
3849
  ),
3850
3850
  S(([h]) => h)
@@ -3863,7 +3863,7 @@ class Eo extends re {
3863
3863
  }
3864
3864
  fromScrollPosition(e) {
3865
3865
  const t = this.viewport.scaleFactor;
3866
- return new he({
3866
+ return new re({
3867
3867
  x: e.x / t,
3868
3868
  y: e.y / t
3869
3869
  });
@@ -3893,7 +3893,7 @@ const Do = () => (n) => n.pipe(
3893
3893
  }))
3894
3894
  ), Ro = (n, e, t) => n.bridgeEvent.pagination$.pipe(
3895
3895
  D(e),
3896
- M(
3896
+ L(
3897
3897
  ([i, o]) => i.navigationId === o.id
3898
3898
  ),
3899
3899
  /**
@@ -3902,7 +3902,7 @@ const Do = () => (n) => n.pipe(
3902
3902
  * the user to an invalid location.
3903
3903
  */
3904
3904
  w(([i, o]) => (t.spineItemsManager.get(o.spineItem)?.isReady$.pipe(U()) ?? v(!1)).pipe(
3905
- M((r) => r),
3905
+ L((r) => r),
3906
3906
  S(() => ({
3907
3907
  pagination: i,
3908
3908
  navigation: o
@@ -3952,7 +3952,7 @@ const Do = () => (n) => n.pipe(
3952
3952
  navigation: o
3953
3953
  };
3954
3954
  })
3955
- ), No = ({ navigationResolver: n }) => (e) => e.pipe(
3955
+ ), Oo = ({ navigationResolver: n }) => (e) => e.pipe(
3956
3956
  S((t) => {
3957
3957
  if (t.navigation.cfi) {
3958
3958
  const i = n.getNavigationForCfi(
@@ -3969,7 +3969,7 @@ const Do = () => (n) => n.pipe(
3969
3969
  }
3970
3970
  return t;
3971
3971
  })
3972
- ), Oo = ({
3972
+ ), No = ({
3973
3973
  navigation: n,
3974
3974
  previousNavigation: e,
3975
3975
  settings: t
@@ -3978,7 +3978,7 @@ const Do = () => (n) => n.pipe(
3978
3978
  settings: e
3979
3979
  }) => (t) => t.pipe(
3980
3980
  S(({ navigation: i, previousNavigation: o }) => {
3981
- const s = Oo({
3981
+ const s = No({
3982
3982
  navigation: i,
3983
3983
  previousNavigation: o,
3984
3984
  settings: e
@@ -4023,7 +4023,7 @@ const Do = () => (n) => n.pipe(
4023
4023
  },
4024
4024
  ...s
4025
4025
  };
4026
- const a = e.getNavigationForSpineIndexOrId(r), c = t.values.computedPageTurnMode === "scrollable" ? new he({
4026
+ const a = e.getNavigationForSpineIndexOrId(r), c = t.values.computedPageTurnMode === "scrollable" ? new re({
4027
4027
  x: a.x + s.previousNavigation.position.x,
4028
4028
  y: a.y
4029
4029
  }) : e.fromUnboundSpinePosition(a);
@@ -4117,7 +4117,7 @@ const Do = () => (n) => n.pipe(
4117
4117
  )
4118
4118
  );
4119
4119
  })
4120
- ), Oe = ({
4120
+ ), Ne = ({
4121
4121
  settings: n,
4122
4122
  spineItemsManager: e,
4123
4123
  spineLocator: t,
@@ -4250,7 +4250,7 @@ const Uo = ({
4250
4250
  }
4251
4251
  return c ? t.getNavigationForPosition(e.position) : t.getNavigationForSpineIndexOrId(s);
4252
4252
  })
4253
- ) : v(new L({ x: 0, y: 0 }));
4253
+ ) : v(new M({ x: 0, y: 0 }));
4254
4254
  }, zo = ({
4255
4255
  navigation: n,
4256
4256
  spineLocator: e,
@@ -4260,7 +4260,7 @@ const Uo = ({
4260
4260
  spine: s
4261
4261
  }) => {
4262
4262
  const { spineItem: r } = n, a = t.get(r);
4263
- if (!a) return new L({ x: 0, y: 0 });
4263
+ if (!a) return new M({ x: 0, y: 0 });
4264
4264
  const { height: c, top: u } = s.getSpineItemSpineLayoutInfo(a), l = e.isPositionWithinSpineItem(
4265
4265
  n.position,
4266
4266
  a
@@ -4370,7 +4370,7 @@ class Bo extends B {
4370
4370
  constructor(e, t, i, o, s, r, a, c) {
4371
4371
  super(), this.settings = e, this.context = t, this.userNavigation$ = i, this.controlledNavigationController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isUserLocked$ = c, this.navigationSubject = new W({
4372
4372
  animation: !1,
4373
- position: new L({ x: 0, y: 0 }),
4373
+ position: new M({ x: 0, y: 0 }),
4374
4374
  meta: {
4375
4375
  triggeredBy: "user"
4376
4376
  },
@@ -4383,7 +4383,7 @@ class Bo extends B {
4383
4383
  id: I
4384
4384
  })),
4385
4385
  z(
4386
- ({ position: f, ...I }, { position: b, ...F }) => O(I, F) && O(f, b)
4386
+ ({ position: f, ...I }, { position: b, ...F }) => N(I, F) && N(f, b)
4387
4387
  ),
4388
4388
  Z(1)
4389
4389
  ), this.locker = new Bt();
@@ -4403,7 +4403,7 @@ class Bo extends B {
4403
4403
  * Cfi lookup is heavier so we start with it to fill
4404
4404
  * as much information as needed to reduce later lookup
4405
4405
  */
4406
- No({
4406
+ Oo({
4407
4407
  navigationResolver: r
4408
4408
  }),
4409
4409
  Vo({ context: t, settings: e }),
@@ -4413,7 +4413,7 @@ class Bo extends B {
4413
4413
  spineItemsManager: a.spineItemsManager,
4414
4414
  spineLocator: a.locator
4415
4415
  }),
4416
- Oe({
4416
+ Ne({
4417
4417
  navigationResolver: r,
4418
4418
  settings: e,
4419
4419
  spineItemsManager: a.spineItemsManager,
@@ -4440,7 +4440,7 @@ class Bo extends B {
4440
4440
  })
4441
4441
  );
4442
4442
  }),
4443
- Oe({
4443
+ Ne({
4444
4444
  spineItemsManager: a.spineItemsManager,
4445
4445
  spineLocator: a.locator,
4446
4446
  settings: e,
@@ -4450,11 +4450,11 @@ class Bo extends B {
4450
4450
  R()
4451
4451
  ), l = u.pipe(
4452
4452
  D(c),
4453
- M(([, f]) => f),
4453
+ L(([, f]) => f),
4454
4454
  w(([f]) => {
4455
4455
  const I = this.locker.lock();
4456
4456
  return c.pipe(
4457
- M((b) => !b),
4457
+ L((b) => !b),
4458
4458
  U(),
4459
4459
  S(
4460
4460
  () => ({
@@ -4462,7 +4462,7 @@ class Bo extends B {
4462
4462
  animation: "snap"
4463
4463
  })
4464
4464
  ),
4465
- ue(() => {
4465
+ le(() => {
4466
4466
  I();
4467
4467
  }),
4468
4468
  T(u)
@@ -4476,7 +4476,7 @@ class Bo extends B {
4476
4476
  w(() => v(null).pipe(
4477
4477
  w(
4478
4478
  () => c.pipe(
4479
- M((f) => !f),
4479
+ L((f) => !f),
4480
4480
  U()
4481
4481
  )
4482
4482
  ),
@@ -4532,7 +4532,7 @@ class Bo extends B {
4532
4532
  yt({
4533
4533
  spine: a
4534
4534
  }),
4535
- Oe({
4535
+ Ne({
4536
4536
  spineItemsManager: a.spineItemsManager,
4537
4537
  spineLocator: a.locator,
4538
4538
  settings: e,
@@ -4560,7 +4560,7 @@ class Bo extends B {
4560
4560
  })
4561
4561
  ), y = (f) => f.pipe(
4562
4562
  P(([I, b]) => {
4563
- const F = I.type === "scroll", $ = I.meta.triggeredBy === "pagination", A = I.meta.triggeredBy === "restoration", X = O(
4563
+ const F = I.type === "scroll", $ = I.meta.triggeredBy === "pagination", A = I.meta.triggeredBy === "restoration", X = N(
4564
4564
  b.position,
4565
4565
  I.position
4566
4566
  );
@@ -4577,7 +4577,7 @@ class Bo extends B {
4577
4577
  * Explicitly trust the unbound position to be valid at this point.
4578
4578
  * Thanks to consolidation and restoration.
4579
4579
  */
4580
- position: L.from(H.position)
4580
+ position: M.from(H.position)
4581
4581
  });
4582
4582
  })
4583
4583
  );
@@ -4818,13 +4818,13 @@ function qt({
4818
4818
  ), a = r.bottom, c = Math.max(0, n.y), u = Math.min(c, a);
4819
4819
  if (e) {
4820
4820
  const h = Math.min(o, n.x), d = Math.max(h, r.left);
4821
- return new L({
4821
+ return new M({
4822
4822
  x: d,
4823
4823
  y: u
4824
4824
  });
4825
4825
  }
4826
4826
  const l = r.right, p = Math.max(0, n.x), g = Math.min(p, l);
4827
- return new L({
4827
+ return new M({
4828
4828
  x: g,
4829
4829
  y: u
4830
4830
  });
@@ -4845,16 +4845,16 @@ const vt = ({
4845
4845
  viewportWidth: o
4846
4846
  }), a = i.get(
4847
4847
  i.items.length - 1
4848
- ), c = s.getSpineItemSpineLayoutInfo(a), u = c.bottom - t, l = Math.min(r.x, u);
4848
+ ), c = s.getSpineItemSpineLayoutInfo(a), u = c.bottom - t, l = Math.min(r.y, u);
4849
4849
  if (e) {
4850
4850
  const g = Math.min(0, r.x);
4851
- return new L({
4851
+ return new M({
4852
4852
  x: g,
4853
4853
  y: l
4854
4854
  });
4855
4855
  }
4856
4856
  const p = c.right - o;
4857
- return new L({
4857
+ return new M({
4858
4858
  x: Math.min(r.x, p),
4859
4859
  y: l
4860
4860
  });
@@ -4864,7 +4864,7 @@ const vt = ({
4864
4864
  visibleAreaRectWidth: i
4865
4865
  }) => {
4866
4866
  const s = n % i !== 0 ? n - t : n;
4867
- return new L({ x: s, y: e });
4867
+ return new M({ x: s, y: e });
4868
4868
  }, Ye = ({
4869
4869
  viewportPosition: n,
4870
4870
  spineLocator: e,
@@ -4889,7 +4889,7 @@ const vt = ({
4889
4889
  visibleAreaRectWidth: i.absoluteViewport.width
4890
4890
  });
4891
4891
  }
4892
- return new L({ x: 0, y: 0 });
4892
+ return new M({ x: 0, y: 0 });
4893
4893
  }, Go = ({
4894
4894
  pageIndex: n,
4895
4895
  spineItemsManager: e,
@@ -4902,7 +4902,7 @@ const vt = ({
4902
4902
  if (!r) {
4903
4903
  const u = n * s.pageSize.width;
4904
4904
  return Ye({
4905
- viewportPosition: new L({ x: u, y: 0 }),
4905
+ viewportPosition: new M({ x: u, y: 0 }),
4906
4906
  spineItemNavigationResolver: o,
4907
4907
  spineLocator: i,
4908
4908
  viewport: s
@@ -5103,7 +5103,7 @@ const vt = ({
5103
5103
  visibleAreaRectWidth: s.absoluteViewport.width
5104
5104
  });
5105
5105
  }
5106
- return new L({ x: 0, y: 0 });
5106
+ return new M({ x: 0, y: 0 });
5107
5107
  },
5108
5108
  getNavigationForPosition: (h) => Ye({
5109
5109
  viewportPosition: h,
@@ -5113,7 +5113,7 @@ const vt = ({
5113
5113
  }),
5114
5114
  getMostPredominantNavigationForPosition: (h) => {
5115
5115
  const d = i.values.computedPageTurnDirection, m = 0.5, y = d === "horizontal" ? h.x + s.absoluteViewport.width * m : 0, f = d === "horizontal" ? 0 : h.y + s.absoluteViewport.height * m, I = vt({
5116
- position: new L({
5116
+ position: new M({
5117
5117
  x: y,
5118
5118
  y: f
5119
5119
  }),
@@ -5197,7 +5197,7 @@ const vt = ({
5197
5197
  g.locker.isLocked$
5198
5198
  ]).pipe(
5199
5199
  J((y) => y.some((f) => f) ? "busy" : "free"),
5200
- le(),
5200
+ pe(),
5201
5201
  Me(1)
5202
5202
  );
5203
5203
  return {
@@ -5220,7 +5220,7 @@ const vt = ({
5220
5220
  navigation$: g.navigation$
5221
5221
  };
5222
5222
  };
5223
- class ss extends re {
5223
+ class ss extends ae {
5224
5224
  constructor(e, t) {
5225
5225
  super({
5226
5226
  beginPageIndexInSpineItem: void 0,
@@ -5272,7 +5272,7 @@ class rs extends B {
5272
5272
  }) ?? {}, { endPageIndex: b = 0 } = c({
5273
5273
  spineItem: m,
5274
5274
  position: l
5275
- }) ?? {}, F = y === void 0 || Be(y) || p.beginSpineItemIndex !== g, $ = p.endSpineItemIndex !== h || f === void 0 || Be(f), A = F ? ge(d.item) : y, X = $ ? ge(m.item) : f, H = d.numberOfPages, ne = m.numberOfPages;
5275
+ }) ?? {}, F = y === void 0 || Be(y) || p.beginSpineItemIndex !== g, $ = p.endSpineItemIndex !== h || f === void 0 || Be(f), A = F ? he(d.item) : y, X = $ ? he(m.item) : f, H = d.numberOfPages, ne = m.numberOfPages;
5276
5276
  this.pagination.update({
5277
5277
  beginCfi: A,
5278
5278
  beginNumberOfPagesInSpineItem: H,
@@ -5330,7 +5330,7 @@ class cs extends B {
5330
5330
  this.inputSettings = t, this.outputSettingsUpdateSubject = new j(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(Z(1)), this._settings$.subscribe();
5331
5331
  }
5332
5332
  _prepareUpdate(e) {
5333
- const t = xe(this.inputSettings, e), i = this.getOutputSettings(t), o = !O(this.outputSettings, i);
5333
+ const t = xe(this.inputSettings, e), i = this.getOutputSettings(t), o = !N(this.outputSettings, i);
5334
5334
  return {
5335
5335
  hasChanged: o,
5336
5336
  state: i,
@@ -5358,7 +5358,7 @@ class cs extends B {
5358
5358
  watch(e) {
5359
5359
  return this.values$.pipe(
5360
5360
  Dt(e),
5361
- z(O)
5361
+ z(N)
5362
5362
  );
5363
5363
  }
5364
5364
  destroy() {
@@ -5430,7 +5430,7 @@ class ps extends B {
5430
5430
  minimumWidth: u
5431
5431
  }) => (l) => l.pipe(
5432
5432
  S((p) => {
5433
- const g = O(
5433
+ const g = N(
5434
5434
  this.lastLayout?.pageSize,
5435
5435
  this.viewport.pageSize
5436
5436
  ) ? this.lastLayout : void 0, { width: h, height: d } = g ?? {}, { width: m = h, height: y = d } = p ?? {}, { width: f, height: I } = this.viewport.pageSize, b = this.validateDimension(
@@ -5490,7 +5490,7 @@ class ps extends B {
5490
5490
  }),
5491
5491
  R()
5492
5492
  ), this.layout$ = this.layoutProcess$.pipe(
5493
- M((c) => c.type === "end"),
5493
+ L((c) => c.type === "end"),
5494
5494
  S((c) => c.data),
5495
5495
  R()
5496
5496
  );
@@ -5508,7 +5508,7 @@ class ps extends B {
5508
5508
  };
5509
5509
  }
5510
5510
  }
5511
- class Gt extends re {
5511
+ class Gt extends ae {
5512
5512
  constructor(e, t, i, o, s, r, a) {
5513
5513
  super({
5514
5514
  isLoaded: !1,
@@ -5601,7 +5601,7 @@ class Gt extends re {
5601
5601
  }
5602
5602
  get unloaded$() {
5603
5603
  return this.renderer.state$.pipe(
5604
- le(),
5604
+ pe(),
5605
5605
  oe((e) => e !== "idle"),
5606
5606
  _(
5607
5607
  () => this.renderer.state$.pipe(
@@ -5686,7 +5686,7 @@ class gs extends B {
5686
5686
  }
5687
5687
  const Zt = (n, e, t) => {
5688
5688
  const i = (t.width - e.width) / 2, o = (t.height - e.height) / 2;
5689
- return new he({
5689
+ return new re({
5690
5690
  x: n.x - i,
5691
5691
  y: n.y - o
5692
5692
  });
@@ -5810,7 +5810,7 @@ const fs = ({
5810
5810
  }, je = ({
5811
5811
  spineItemPosition: n,
5812
5812
  itemLayout: { left: e, top: t }
5813
- }) => new L({
5813
+ }) => new M({
5814
5814
  x: e + n.x,
5815
5815
  y: t + n.y
5816
5816
  }), Is = ({
@@ -5901,7 +5901,7 @@ const fs = ({
5901
5901
  const Ee = t.getSpineItemPositionFromPageIndex({
5902
5902
  pageIndex: Ie,
5903
5903
  spineItem: y
5904
- }), ae = je({
5904
+ }), ce = je({
5905
5905
  spineItemPosition: Ee,
5906
5906
  itemLayout: o.getSpineItemSpineLayoutInfo(y)
5907
5907
  });
@@ -5910,21 +5910,21 @@ const fs = ({
5910
5910
  absolutePosition: {
5911
5911
  width: b.pageSize.width,
5912
5912
  height: b.pageSize.height,
5913
- left: ae.x,
5914
- top: ae.y,
5915
- bottom: ae.y + b.pageSize.height,
5916
- right: ae.x + b.pageSize.width
5913
+ left: ce.x,
5914
+ top: ce.y,
5915
+ bottom: ce.y + b.pageSize.height,
5916
+ right: ce.x + b.pageSize.width
5917
5917
  }
5918
5918
  };
5919
5919
  }).reduce(
5920
5920
  (ne, { absolutePosition: Ie, index: Ee }) => {
5921
- const ae = I ? b.absoluteViewport : b.relativeViewport, Kt = Zt(
5921
+ const ce = I ? b.absoluteViewport : b.relativeViewport, Kt = Zt(
5922
5922
  d,
5923
5923
  b.absoluteViewport,
5924
- ae
5924
+ ce
5925
5925
  ), Qt = ye.from(
5926
5926
  Kt,
5927
- ae
5927
+ ce
5928
5928
  ), { visible: en } = Jt({
5929
5929
  viewportPosition: Qt,
5930
5930
  restrictToScreen: f,
@@ -6031,7 +6031,7 @@ const fs = ({
6031
6031
  bottom: n.y + e.height,
6032
6032
  right: n.x + e.width
6033
6033
  });
6034
- class xs extends re {
6034
+ class xs extends ae {
6035
6035
  constructor(e, t, i, o, s, r) {
6036
6036
  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(
6037
6037
  (u) => u.itemIndex === a.index && u.pageIndex === c
@@ -6224,14 +6224,14 @@ class Ts extends B {
6224
6224
  // queue layout until previous layout is done
6225
6225
  Ue(
6226
6226
  () => s.pipe(
6227
- M((r) => !r),
6227
+ L((r) => !r),
6228
6228
  U()
6229
6229
  )
6230
6230
  ),
6231
6231
  Ue(() => {
6232
6232
  s.next(!0);
6233
6233
  const r = this.context.manifest, a = Ht(r) ?? !1;
6234
- return N(this.spineItemsManager.items).pipe(
6234
+ return O(this.spineItemsManager.items).pipe(
6235
6235
  cn(
6236
6236
  (u, l, p) => u.pipe(
6237
6237
  ot(
@@ -6262,7 +6262,7 @@ class Ts extends B {
6262
6262
  v({ horizontalOffset: 0, verticalOffset: 0 })
6263
6263
  ),
6264
6264
  ot((u) => u),
6265
- ue(() => {
6265
+ le(() => {
6266
6266
  s.next(!1);
6267
6267
  })
6268
6268
  );
@@ -6333,7 +6333,7 @@ class Fs extends B {
6333
6333
  p.style.cssText = `
6334
6334
  height: 100%;
6335
6335
  position: relative;
6336
- `, p.className = `${pe}-spine`, this.elementSubject.next(p);
6336
+ `, p.className = `${de}-spine`, this.elementSubject.next(p);
6337
6337
  })
6338
6338
  ), u = k([
6339
6339
  this.context.manifest$,
@@ -6415,7 +6415,7 @@ class Ls extends B {
6415
6415
  this.orderedSpineItemsSubject.value.forEach((e) => e.destroy());
6416
6416
  }
6417
6417
  }
6418
- class Ms extends re {
6418
+ class Ms extends ae {
6419
6419
  constructor(e, t) {
6420
6420
  const i = document.createElement("div");
6421
6421
  i.style.cssText = `
@@ -6601,7 +6601,7 @@ const Cs = (n) => {
6601
6601
  ${n.style.cssText}
6602
6602
  background-color: white;
6603
6603
  position: relative;
6604
- `, n.classList.add(`${pe}-reader`), n.setAttribute(Qn, e), n), Xs = (
6604
+ `, n.classList.add(`${de}-reader`), n.setAttribute(Qn, e), n), Xs = (
6605
6605
  //__
6606
6606
  ho(
6607
6607
  Bn(
@@ -6649,7 +6649,7 @@ export {
6649
6649
  Po as Features,
6650
6650
  Qn as HTML_ATTRIBUTE_DATA_READER_ID,
6651
6651
  ei as HTML_ATTRIBUTE_VIEWPORT_CLASSNAME,
6652
- pe as HTML_PREFIX,
6652
+ de as HTML_PREFIX,
6653
6653
  $o as HookManager,
6654
6654
  Kn as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
6655
6655
  Bo as InternalNavigator,
@@ -6660,7 +6660,7 @@ export {
6660
6660
  xs as Pages,
6661
6661
  ss as Pagination,
6662
6662
  rs as PaginationController,
6663
- re as ReactiveEntity,
6663
+ ae as ReactiveEntity,
6664
6664
  et as ResourceHandler,
6665
6665
  oo as ResourcesLocator,
6666
6666
  Eo as ScrollNavigationController,
@@ -6674,9 +6674,9 @@ export {
6674
6674
  _e as SpineItemSpineLayout,
6675
6675
  Ls as SpineItemsManager,
6676
6676
  Ps as SpineItemsObserver,
6677
- L as SpinePosition,
6677
+ M as SpinePosition,
6678
6678
  Re as UnboundSpineItemPagePosition,
6679
- he as UnboundSpinePosition,
6679
+ re as UnboundSpinePosition,
6680
6680
  Ws as VIEWPORT_ADJUSTMENT_THROTTLE,
6681
6681
  Ms as Viewport,
6682
6682
  io as consolidate,
@@ -6685,7 +6685,7 @@ export {
6685
6685
  Wn as deferNextResult,
6686
6686
  He as generateCfiForSpineItemPage,
6687
6687
  eo as generateCfiFromRange,
6688
- ge as generateRootCfi,
6688
+ he as generateRootCfi,
6689
6689
  rt as getAttributeValueFromString,
6690
6690
  ks as getBase64FromBlob,
6691
6691
  Ze as getFrameViewportInfo,
@@ -6694,7 +6694,7 @@ export {
6694
6694
  Rt as idle,
6695
6695
  vn as injectCSS,
6696
6696
  Et as isHtmlElement,
6697
- On as isHtmlTagElement,
6697
+ Nn as isHtmlTagElement,
6698
6698
  Be as isRootCfi,
6699
6699
  Zs as isShallowEqual,
6700
6700
  $i as layoutEnhancer,