@prose-reader/core 1.272.0 → 1.273.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,6 +1,6 @@
1
1
  import { switchMap as w, of as v, fromEvent as X, take as $t, map as S, from as k, takeUntil as T, Observable as ce, defer as Tt, Subject as N, combineLatest as j, merge as P, EMPTY as _, NEVER as he, tap as x, share as D, BehaviorSubject as q, distinctUntilChanged as R, filter as C, mergeMap as ge, first as U, endWith as fe, catchError as ze, 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 Pe, timer as Te, skip as Ft, ReplaySubject as ot, identity as xe, concatMap as ln } from "rxjs";
2
2
  import { Report as dn, isShallowEqual as O, shallowMergeIfDefined as $e, getParentPath as pn, parseContentType as gn, detectMimeTypeFromName as Me, arrayEqual as hn } from "@prose-reader/shared";
3
- import { isShallowEqual as tr } from "@prose-reader/shared";
3
+ import { isShallowEqual as nr } from "@prose-reader/shared";
4
4
  import { switchMap as Y, first as mn, map as ie, distinctUntilChanged as be, startWith as fn, shareReplay as Ge, 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 st, share as vn } from "rxjs/operators";
5
5
  import { generate as We, parse as Mt, isIndirectionOnly as wn, isParsedCfiRange as Pn, resolve as xn } from "@prose-reader/cfi";
6
6
  const $n = "@prose-reader/core", A = dn.namespace($n, void 0, {
@@ -203,7 +203,7 @@ const Ce = (n, e, t, i) => {
203
203
  return i && Number.parseFloat(o) || 0;
204
204
  }, Vn = (n, e, t, i) => {
205
205
  n?.contentDocument?.head && Ce(n.contentDocument, e, t, i);
206
- }, Ws = (n, e) => {
206
+ }, _s = (n, e) => {
207
207
  n?.contentDocument && Ee(n.contentDocument, e);
208
208
  }, oe = (n, e, t, i) => {
209
209
  if (!n) return;
@@ -397,13 +397,24 @@ const Ce = (n, e, t, i) => {
397
397
  });
398
398
  }
399
399
  ), t;
400
- }, Nt = (n) => ie((e) => Object.entries(e).reduce(
401
- (t, [i, o]) => n.includes(i) ? {
400
+ }, Hs = (n) => {
401
+ const e = new FileReader();
402
+ return new Promise((t) => {
403
+ e.addEventListener(
404
+ "load",
405
+ () => {
406
+ t(e.result);
407
+ },
408
+ !1
409
+ ), e.readAsDataURL(n);
410
+ });
411
+ }, Xn = (n, e) => Object.entries(n).reduce(
412
+ (t, [i, o]) => e.includes(i) ? {
402
413
  ...t,
403
414
  [i]: o
404
415
  } : t,
405
416
  {}
406
- )), Ke = (n) => (e) => e.pipe(Nt(n), be(O));
417
+ ), Nt = (n) => ie((e) => Xn(e, n)), Ke = (n) => (e) => e.pipe(Nt(n), be(O));
407
418
  function Qe(n) {
408
419
  return new ce((e) => {
409
420
  const t = new ResizeObserver((i) => {
@@ -421,7 +432,7 @@ const De = (n) => (e) => e.pipe(
421
432
  ie(() => t)
422
433
  )
423
434
  )
424
- ), Xn = (n) => {
435
+ ), Yn = (n) => {
425
436
  let e;
426
437
  const t = n.subscribe((i) => {
427
438
  e = { result: i };
@@ -451,7 +462,7 @@ const ct = (n, e) => new ce((t) => {
451
462
  });
452
463
  return i.observe(n, e), () => i.disconnect();
453
464
  });
454
- function _s(n, e) {
465
+ function Bs(n, e) {
455
466
  return new ce((t) => {
456
467
  const i = new IntersectionObserver((o) => {
457
468
  t.next(o);
@@ -509,19 +520,7 @@ class Rt {
509
520
  this.outputSettingsUpdateSubject.complete();
510
521
  }
511
522
  }
512
- const Hs = (n) => {
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 {
523
+ let qn = class extends Rt {
525
524
  computeOutputSettings(e) {
526
525
  return e;
527
526
  }
@@ -547,8 +546,8 @@ let Yn = class extends Rt {
547
546
  };
548
547
  }
549
548
  };
550
- const qn = (n) => (e) => {
551
- const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new N(), a = n(e), c = new Yn(
549
+ const Gn = (n) => (e) => {
550
+ const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new N(), a = n(e), c = new qn(
552
551
  {
553
552
  fontScale: t,
554
553
  lineHeight: i,
@@ -594,7 +593,7 @@ const qn = (n) => (e) => {
594
593
  },
595
594
  settings: c
596
595
  };
597
- }, Gn = (n) => (e) => {
596
+ }, Zn = (n) => (e) => {
598
597
  const t = n(e), i = (o) => X(o, "keyup").pipe(
599
598
  S((s) => {
600
599
  const { pageTurnDirection: r, computedPageTurnMode: a } = t.settings.values;
@@ -630,7 +629,7 @@ const qn = (n) => (e) => {
630
629
  ),
631
630
  T(t.$.destroy$)
632
631
  ).subscribe(), t;
633
- }, Zn = (n) => n.spine.spineItemsManager.items$.pipe(
632
+ }, Jn = (n) => n.spine.spineItemsManager.items$.pipe(
634
633
  w(
635
634
  (e) => P(
636
635
  ...e.map((t) => t.watch("isLoaded").pipe(
@@ -803,7 +802,7 @@ const Le = class Le extends Q {
803
802
  };
804
803
  Le.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
805
804
  let ye = Le;
806
- const Jn = (n) => new URL(n.href);
805
+ const Kn = (n) => new URL(n.href);
807
806
  class tt {
808
807
  constructor(e, t) {
809
808
  this.item = e, this.settings = t;
@@ -811,7 +810,7 @@ class tt {
811
810
  async getResource() {
812
811
  return await nn(
813
812
  this.settings.values.getResource?.(this.item) ?? v(void 0)
814
- ) ?? Jn(this.item);
813
+ ) ?? Kn(this.item);
815
814
  }
816
815
  async fetchResource() {
817
816
  const e = await this.getResource();
@@ -821,7 +820,7 @@ class tt {
821
820
  const Ot = (n, e) => {
822
821
  const t = n.startsWith("file://"), i = t ? n.replace("file://", "http://") : n, o = new URL(e, i).toString();
823
822
  return t ? o.replace("http://", "file://") : o;
824
- }, Kn = async (n, e, t, i, o) => {
823
+ }, Qn = async (n, e, t, i, o) => {
825
824
  if (!n || !n.defaultView) return;
826
825
  const s = e.sheet;
827
826
  if (s)
@@ -869,7 +868,7 @@ const Ot = (n, e) => {
869
868
  } catch (r) {
870
869
  console.error("Could not access stylesheet rules:", r);
871
870
  }
872
- }, Qn = (n, e, t, i, o) => {
871
+ }, ei = (n, e, t, i, o) => {
873
872
  const s = e.getAttribute("src") || e.getAttribute("href");
874
873
  if (!s) return v(null);
875
874
  const r = i.manifest?.items.find(({ href: c }) => `${Ot(t, s).toLowerCase()}`.endsWith(
@@ -891,7 +890,7 @@ const Ot = (n, e) => {
891
890
  return new ce((l) => {
892
891
  e.onload = async () => {
893
892
  try {
894
- e.sheet && await Kn(
893
+ e.sheet && await Qn(
895
894
  n,
896
895
  e,
897
896
  t,
@@ -906,7 +905,7 @@ const Ot = (n, e) => {
906
905
  return v(null);
907
906
  })
908
907
  );
909
- }, ei = ({
908
+ }, ti = ({
910
909
  settings: n,
911
910
  item: e,
912
911
  context: t
@@ -915,7 +914,7 @@ const Ot = (n, e) => {
915
914
  const s = Et(
916
915
  o.contentDocument
917
916
  ), r = pn(e.href), a = s.map(
918
- (c) => Qn(
917
+ (c) => ei(
919
918
  o.contentDocument,
920
919
  c,
921
920
  r,
@@ -925,9 +924,9 @@ const Ot = (n, e) => {
925
924
  );
926
925
  return j(a).pipe(S(() => o));
927
926
  })
928
- ), ti = (n) => {
927
+ ), ni = (n) => {
929
928
  Nn(n?.contentDocument);
930
- }, Xs = "@prose-reader/core", Ys = 0, qs = 200, ni = [".xhtml", ".html", ".htm"], W = "prose-reader", Vt = `${W}-style`, ii = `data-${W}-id`, oi = `${W}-viewport`, si = `${W}-scroll-navigator`, ri = async (n, e) => {
929
+ }, 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
930
  if (typeof n == "string") return n;
932
931
  const t = gn(n.headers.get("Content-Type") || "") || Me(e.href);
933
932
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
@@ -965,11 +964,11 @@ const Ot = (n, e) => {
965
964
  </body>
966
965
  </html>
967
966
  ` : await n.text();
968
- }, ai = ({
967
+ }, ci = ({
969
968
  item: n,
970
969
  resourcesHandler: e
971
970
  }) => {
972
- const t = (i) => ri(i, n);
971
+ const t = (i) => ai(i, n);
973
972
  return (i) => i.pipe(
974
973
  w((o) => k(e.getResource()).pipe(
975
974
  w((s) => s instanceof URL && n.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
@@ -979,7 +978,7 @@ const Ot = (n, e) => {
979
978
  "text/html",
980
979
  "text/xml"
981
980
  ].includes(n.mediaType) || // no encoding ? then try to detect html
982
- !n.mediaType && ni.some(
981
+ !n.mediaType && ii.some(
983
982
  (a) => n.href.endsWith(a)
984
983
  )) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? k(e.fetchResource()) : v(s)).pipe(
985
984
  w((a) => {
@@ -1001,7 +1000,7 @@ const Ot = (n, e) => {
1001
1000
  ))
1002
1001
  ))
1003
1002
  );
1004
- }, ci = () => {
1003
+ }, ui = () => {
1005
1004
  const n = document.createElement("iframe");
1006
1005
  return n.frameBorder = "no", n.tabIndex = 0, n.setAttribute(
1007
1006
  "sandbox",
@@ -1016,7 +1015,7 @@ const Ot = (n, e) => {
1016
1015
  border: 0px none transparent;
1017
1016
  padding: 0px;
1018
1017
  `, n.setAttribute("role", "main"), n;
1019
- }, ui = "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 = ({
1018
+ }, 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
1019
  pageHeight: n,
1021
1020
  pageWidth: e,
1022
1021
  frameElement: t
@@ -1031,7 +1030,7 @@ const Ot = (n, e) => {
1031
1030
  }
1032
1031
  }, ut = (n, e) => {
1033
1032
  n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
1034
- }, li = ({
1033
+ }, di = ({
1035
1034
  minPageSpread: n,
1036
1035
  blankPagePosition: e,
1037
1036
  spreadPosition: t,
@@ -1070,7 +1069,7 @@ const Ot = (n, e) => {
1070
1069
  return { width: a, height: g };
1071
1070
  }
1072
1071
  return { width: a, height: i };
1073
- }, di = () => `
1072
+ }, pi = () => `
1074
1073
  body {
1075
1074
  margin: 0;
1076
1075
  }
@@ -1087,7 +1086,7 @@ const Ot = (n, e) => {
1087
1086
  html, body {
1088
1087
  touch-action: none;
1089
1088
  }
1090
- `, pi = ({
1089
+ `, gi = ({
1091
1090
  isScrollable: n,
1092
1091
  enableTouch: e
1093
1092
  }) => `
@@ -1112,7 +1111,7 @@ const Ot = (n, e) => {
1112
1111
  display: block;
1113
1112
  }
1114
1113
  ` : ""}
1115
- `, gi = ({
1114
+ `, hi = ({
1116
1115
  width: n,
1117
1116
  columnHeight: e,
1118
1117
  columnWidth: t
@@ -1180,7 +1179,7 @@ const Ot = (n, e) => {
1180
1179
  td {
1181
1180
  max-width: ${t}px;
1182
1181
  }
1183
- `, hi = ({
1182
+ `, mi = ({
1184
1183
  isUsingVerticalWriting: n,
1185
1184
  minimumWidth: e,
1186
1185
  pageHeight: t,
@@ -1196,7 +1195,7 @@ const Ot = (n, e) => {
1196
1195
  };
1197
1196
  }, ve = (n, e) => {
1198
1197
  n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
1199
- }, mi = ({
1198
+ }, fi = ({
1200
1199
  pageHeight: n,
1201
1200
  pageWidth: e,
1202
1201
  frameElement: t,
@@ -1221,7 +1220,7 @@ const Ot = (n, e) => {
1221
1220
  oe(
1222
1221
  t,
1223
1222
  "prose-reader-html-renderer-framce-css",
1224
- di()
1223
+ pi()
1225
1224
  ), ve(t, {
1226
1225
  width: p.width ?? 1,
1227
1226
  height: p.height ?? 1
@@ -1233,11 +1232,11 @@ const Ot = (n, e) => {
1233
1232
  `translate(-50%, -50%) scale(${h})`
1234
1233
  ), t?.style.setProperty("transform-origin", "center center");
1235
1234
  else {
1236
- const b = a ? pi({
1235
+ const b = a ? gi({
1237
1236
  isScrollable: i?.renditionFlow === "scrolled-continuous",
1238
1237
  enableTouch: c
1239
- }) : gi(
1240
- hi({
1238
+ }) : hi(
1239
+ mi({
1241
1240
  isUsingVerticalWriting: u,
1242
1241
  minimumWidth: l,
1243
1242
  pageHeight: g,
@@ -1269,19 +1268,19 @@ const Ot = (n, e) => {
1269
1268
  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
1269
  }
1271
1270
  };
1272
- class fi extends ye {
1271
+ class yi extends ye {
1273
1272
  constructor() {
1274
1273
  super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ?? Me(this.item.href))?.startsWith("image/");
1275
1274
  }
1276
1275
  onCreateDocument() {
1277
- const e = ci();
1276
+ const e = ui();
1278
1277
  return this.setDocumentContainer(e), v(e);
1279
1278
  }
1280
1279
  onLoadDocument() {
1281
1280
  const e = this.getFrameElement();
1282
1281
  if (!e) throw new Error("invalid frame");
1283
1282
  return v(e).pipe(
1284
- ai({
1283
+ ci({
1285
1284
  item: this.item,
1286
1285
  resourcesHandler: this.resourcesHandler,
1287
1286
  settings: this.settings
@@ -1292,9 +1291,9 @@ class fi extends ye {
1292
1291
  }),
1293
1292
  jn,
1294
1293
  x((t) => {
1295
- this.isPrePaginated() ? oe(t, "prose-reader-css", ui) : this.isImageType();
1294
+ this.isPrePaginated() ? oe(t, "prose-reader-css", li) : this.isImageType();
1296
1295
  }),
1297
- ei({
1296
+ ti({
1298
1297
  context: this.context,
1299
1298
  item: this.item,
1300
1299
  settings: this.settings
@@ -1303,7 +1302,7 @@ class fi extends ye {
1303
1302
  );
1304
1303
  }
1305
1304
  onUnload() {
1306
- return ti(this.getFrameElement()), this.detach(), _;
1305
+ return ni(this.getFrameElement()), this.detach(), _;
1307
1306
  }
1308
1307
  onLayout({
1309
1308
  minPageSpread: e,
@@ -1321,7 +1320,7 @@ class fi extends ye {
1321
1320
  ) : r.contentDocument?.documentElement.classList.remove(
1322
1321
  "prose-reader-html-renderer-touch-enabled"
1323
1322
  )), this.isPrePaginated()) {
1324
- const l = li({
1323
+ const l = di({
1325
1324
  blankPagePosition: t,
1326
1325
  frameElement: r,
1327
1326
  isRTL: this.context.isRTL(),
@@ -1332,7 +1331,7 @@ class fi extends ye {
1332
1331
  });
1333
1332
  return v(l);
1334
1333
  }
1335
- const u = mi({
1334
+ const u = fi({
1336
1335
  pageHeight: s,
1337
1336
  pageWidth: o,
1338
1337
  frameElement: r,
@@ -1405,13 +1404,13 @@ class fi extends ye {
1405
1404
  return this.getFrameElement();
1406
1405
  }
1407
1406
  }
1408
- const yi = (n) => (e) => {
1407
+ const Si = (n) => (e) => {
1409
1408
  const t = n({
1410
1409
  ...e,
1411
1410
  getRenderer(o) {
1412
- return e.getRenderer?.(o) ?? ((r) => new fi(r));
1411
+ return e.getRenderer?.(o) ?? ((r) => new yi(r));
1413
1412
  }
1414
- }), i = Zn(t);
1413
+ }), i = Jn(t);
1415
1414
  return i.pipe(T(t.$.destroy$)).subscribe(), {
1416
1415
  ...t,
1417
1416
  links$: i
@@ -1435,7 +1434,7 @@ class Re {
1435
1434
  this.__symbol = /* @__PURE__ */ Symbol("SpineItemPagePosition"), this.x = e.x, this.y = e.y;
1436
1435
  }
1437
1436
  }
1438
- class Si extends nt {
1437
+ class Ii extends nt {
1439
1438
  constructor() {
1440
1439
  super(...arguments), this.__symbol = "SpineItemPageLayout";
1441
1440
  }
@@ -1445,7 +1444,7 @@ class Oe extends nt {
1445
1444
  super(...arguments), this.__symbol = "SpineItemSpineLayout";
1446
1445
  }
1447
1446
  }
1448
- class Ii extends nt {
1447
+ class bi extends nt {
1449
1448
  constructor() {
1450
1449
  super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
1451
1450
  }
@@ -1471,17 +1470,17 @@ class ae extends kt {
1471
1470
  return new ae(e);
1472
1471
  }
1473
1472
  }
1474
- const bi = (n, e) => {
1473
+ const vi = (n, e) => {
1475
1474
  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
1475
  return {
1477
1476
  x: u / a,
1478
1477
  y: l / c
1479
1478
  };
1480
- }, vi = (n, e) => new ae(
1481
- bi(n, e)
1482
- ), wi = (n) => ({
1483
- getSpinePositionFromClientPosition: (e) => n.spine.element ? vi(e, n.spine.element) : void 0
1484
- }), Pi = (n) => {
1479
+ }, wi = (n, e) => new ae(
1480
+ vi(n, e)
1481
+ ), Pi = (n) => ({
1482
+ getSpinePositionFromClientPosition: (e) => n.spine.element ? wi(e, n.spine.element) : void 0
1483
+ }), xi = (n) => {
1485
1484
  let e;
1486
1485
  const t = n.context.watch("rootElement").pipe(
1487
1486
  Y((c) => c ? new ce(() => (e = c.ownerDocument.createElement("div"), e.style.cssText = `
@@ -1520,7 +1519,7 @@ const bi = (n, e) => {
1520
1519
  K(n.$.destroy$)
1521
1520
  );
1522
1521
  return P(t, a);
1523
- }, xi = `${W}-enhancer-loading`, Ut = `${xi}-container`, $i = ({
1522
+ }, $i = `${W}-enhancer-loading`, Ut = `${$i}-container`, Ti = ({
1524
1523
  container: n,
1525
1524
  item: e,
1526
1525
  viewport: t
@@ -1555,14 +1554,14 @@ const bi = (n, e) => {
1555
1554
  max-width: 300px;
1556
1555
  width: 80%;
1557
1556
  `, i.appendChild(o), i.appendChild(s), i;
1558
- }, Ti = (n) => n.spineItemsManager.items$.pipe(
1557
+ }, Fi = (n) => n.spineItemsManager.items$.pipe(
1559
1558
  Y(
1560
1559
  (e) => P(
1561
1560
  ...e.map((t) => {
1562
1561
  t.containerElement.style.zIndex = "0";
1563
1562
  const i = t.containerElement.querySelector(
1564
1563
  `.${Ut}`
1565
- ), o = i instanceof HTMLElement ? i : $i({
1564
+ ), o = i instanceof HTMLElement ? i : Ti({
1566
1565
  container: t.containerElement,
1567
1566
  item: t.item,
1568
1567
  viewport: n.viewport
@@ -1600,11 +1599,11 @@ const bi = (n, e) => {
1600
1599
  })
1601
1600
  )
1602
1601
  )
1603
- ), Fi = (n) => {
1602
+ ), Li = (n) => {
1604
1603
  n.hookManager.register("item.onDocumentLoad", ({ itemId: e }) => {
1605
1604
  n.spineItemsManager.get(e)?.renderer.getDocumentFrame()?.setAttribute("scrolling", "no");
1606
1605
  });
1607
- }, Li = (n) => {
1606
+ }, Mi = (n) => {
1608
1607
  n.hookManager.register(
1609
1608
  "item.onAfterLayout",
1610
1609
  ({ item: e, blankPagePosition: t, minimumWidth: i }) => {
@@ -1621,12 +1620,12 @@ const bi = (n, e) => {
1621
1620
  }
1622
1621
  }
1623
1622
  );
1624
- }, Mi = (n) => n.spineItemsObserver.states$.pipe(
1623
+ }, Ci = (n) => n.spineItemsObserver.states$.pipe(
1625
1624
  x(({ item: e, isReady: t, isDirty: i }) => {
1626
1625
  e.containerElement.dataset.isDirty = i.toString(), e.containerElement.dataset.isReady = t.toString();
1627
1626
  })
1628
1627
  );
1629
- let Ci = class extends Rt {
1628
+ let Ei = class extends Rt {
1630
1629
  computeOutputSettings(e) {
1631
1630
  return e;
1632
1631
  }
@@ -1652,7 +1651,7 @@ let Ci = class extends Rt {
1652
1651
  };
1653
1652
  }
1654
1653
  };
1655
- const Ei = (n) => j([
1654
+ const Di = (n) => j([
1656
1655
  n.viewport.watch(["width", "height"]),
1657
1656
  n.context.watch("manifest")
1658
1657
  ]).pipe(
@@ -1660,13 +1659,13 @@ const Ei = (n) => j([
1660
1659
  const o = e > t;
1661
1660
  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
1661
  })
1663
- ), Di = (n) => (e) => {
1662
+ ), Ai = (n) => (e) => {
1664
1663
  const {
1665
1664
  pageHorizontalMargin: t,
1666
1665
  pageVerticalMargin: i,
1667
1666
  layoutAutoResize: o,
1668
1667
  layoutLayerTransition: s
1669
- } = e, r = n(e), a = new Ci(
1668
+ } = e, r = n(e), a = new Ei(
1670
1669
  {
1671
1670
  pageHorizontalMargin: t,
1672
1671
  pageVerticalMargin: i,
@@ -1713,7 +1712,7 @@ const Ei = (n) => j([
1713
1712
  `
1714
1713
  );
1715
1714
  }
1716
- }), Li(r), Fi(r), r.hookManager.register(
1715
+ }), Mi(r), Li(r), r.hookManager.register(
1717
1716
  "item.onDocumentCreated",
1718
1717
  ({ documentContainer: m }) => {
1719
1718
  m.style.opacity = "0", a.values.layoutLayerTransition && (m.style.transition = "opacity 300ms");
@@ -1738,7 +1737,7 @@ const Ei = (n) => j([
1738
1737
  V(() => {
1739
1738
  r?.layout();
1740
1739
  })
1741
- ), l = Pi(r);
1740
+ ), l = xi(r);
1742
1741
  a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
1743
1742
  Lt(1),
1744
1743
  V(() => {
@@ -1748,7 +1747,7 @@ const Ei = (n) => j([
1748
1747
  ).subscribe();
1749
1748
  const d = r.spine.pages.pipe(
1750
1749
  Ge({ refCount: !0, bufferSize: 1 })
1751
- ), g = Mi(r), p = Ei(r), h = Ti(r);
1750
+ ), g = Ci(r), p = Di(r), h = Fi(r);
1752
1751
  return P(
1753
1752
  c,
1754
1753
  l,
@@ -1765,10 +1764,10 @@ const Ei = (n) => j([
1765
1764
  settings: a,
1766
1765
  layout$: r.spine.layout$,
1767
1766
  layoutInfo$: d,
1768
- coordinates: wi(r)
1767
+ coordinates: Pi(r)
1769
1768
  };
1770
1769
  };
1771
- class Ai extends ye {
1770
+ class Ni extends ye {
1772
1771
  getImageElement() {
1773
1772
  const e = this.documentContainer;
1774
1773
  if (e instanceof HTMLImageElement)
@@ -1820,12 +1819,12 @@ class Ai extends ye {
1820
1819
  getDocumentFrame() {
1821
1820
  }
1822
1821
  }
1823
- const Ni = (n) => (e) => {
1822
+ const Ri = (n) => (e) => {
1824
1823
  const t = n({
1825
1824
  ...e,
1826
1825
  getRenderer(r) {
1827
1826
  const a = e.getRenderer?.(r), u = !!(r.mediaType ?? Me(r.href))?.startsWith("image/");
1828
- return !a && u ? (l) => new Ai(l) : a;
1827
+ return !a && u ? (l) => new Ni(l) : a;
1829
1828
  }
1830
1829
  }), i = new IntersectionObserver(
1831
1830
  (r) => {
@@ -1875,7 +1874,7 @@ const Ni = (n) => (e) => {
1875
1874
  i.disconnect(), o.disconnect(), t.destroy();
1876
1875
  }
1877
1876
  };
1878
- }, Ri = (n, e) => n.links$.pipe(
1877
+ }, Oi = (n, e) => n.links$.pipe(
1879
1878
  x((t) => {
1880
1879
  if (!Rn(t.target, "a") || t.type !== "click") return;
1881
1880
  const i = new URL(t.target.href), o = `${i.origin}${i.pathname}`;
@@ -1883,7 +1882,7 @@ const Ni = (n) => (e) => {
1883
1882
  (r) => r.href === o
1884
1883
  ) && e.goToUrl(i);
1885
1884
  })
1886
- ), ee = A.namespace("navigation"), Oi = ({
1885
+ ), ee = A.namespace("navigation"), Vi = ({
1887
1886
  position: n,
1888
1887
  spineItem: e,
1889
1888
  pageHeight: t,
@@ -1915,7 +1914,7 @@ const Ni = (n) => (e) => {
1915
1914
  const u = o.getSpineItemPositionFromSpinePosition(
1916
1915
  n,
1917
1916
  a
1918
- ), l = Oi({
1917
+ ), l = Vi({
1919
1918
  position: u,
1920
1919
  spineItem: a,
1921
1920
  pageHeight: s.pageSize.height,
@@ -1937,7 +1936,7 @@ const Ni = (n) => (e) => {
1937
1936
  x: 0
1938
1937
  })
1939
1938
  );
1940
- }, Vi = ({
1939
+ }, ji = ({
1941
1940
  position: n,
1942
1941
  spineItem: e,
1943
1942
  context: t,
@@ -1981,7 +1980,7 @@ const Ni = (n) => (e) => {
1981
1980
  return i.getAdjustedPositionForSpread(l);
1982
1981
  }
1983
1982
  return i.getAdjustedPositionForSpread(u);
1984
- }, ji = ({
1983
+ }, ki = ({
1985
1984
  position: n,
1986
1985
  spineItem: e,
1987
1986
  pageHeight: t,
@@ -2013,7 +2012,7 @@ const Ni = (n) => (e) => {
2013
2012
  const u = o.getSpineItemPositionFromSpinePosition(
2014
2013
  n,
2015
2014
  a
2016
- ), l = ji({
2015
+ ), l = ki({
2017
2016
  position: u,
2018
2017
  spineItem: a,
2019
2018
  pageHeight: s.pageSize.height,
@@ -2035,7 +2034,7 @@ const Ni = (n) => (e) => {
2035
2034
  x: 0
2036
2035
  })
2037
2036
  );
2038
- }, ki = ({
2037
+ }, Ui = ({
2039
2038
  position: n,
2040
2039
  spineItem: e,
2041
2040
  context: t,
@@ -2083,7 +2082,7 @@ const Ni = (n) => (e) => {
2083
2082
  }
2084
2083
  return i.getAdjustedPositionForSpread(u);
2085
2084
  };
2086
- class Ui {
2085
+ class zi {
2087
2086
  constructor(e) {
2088
2087
  this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2089
2088
  }
@@ -2102,7 +2101,7 @@ class Ui {
2102
2101
  turnRightOrBottom() {
2103
2102
  const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
2104
2103
  if (!t) return;
2105
- const i = ki({
2104
+ const i = Ui({
2106
2105
  context: this.reader.context,
2107
2106
  navigationResolver: this.reader.navigation.navigationResolver,
2108
2107
  position: e.position,
@@ -2120,7 +2119,7 @@ class Ui {
2120
2119
  turnLeftOrTop() {
2121
2120
  const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
2122
2121
  if (!t) return;
2123
- const i = Vi({
2122
+ const i = ji({
2124
2123
  context: this.reader.context,
2125
2124
  navigationResolver: this.reader.navigation.navigationResolver,
2126
2125
  position: e.position,
@@ -2262,7 +2261,7 @@ class Ui {
2262
2261
  }
2263
2262
  }
2264
2263
  }
2265
- class zi extends Q {
2264
+ class Wi extends Q {
2266
2265
  constructor(e) {
2267
2266
  super({
2268
2267
  lastDelta: { x: 0, y: 0 },
@@ -2327,8 +2326,8 @@ class G {
2327
2326
  this.isDestroyed || (this.isDestroyed = !0, this.destroySubject.next(), this.destroySubject.complete());
2328
2327
  }
2329
2328
  }
2330
- const Wi = 500;
2331
- class _i extends G {
2329
+ const _i = 500;
2330
+ class Hi extends G {
2332
2331
  constructor(e, t) {
2333
2332
  super(), this.scrollNavigationController = e, this.locker = t, this.navigationSubject = new N(), this.navigation$ = this.navigationSubject.asObservable();
2334
2333
  const i = this.scrollNavigationController.userScroll$.pipe(
@@ -2339,7 +2338,7 @@ class _i extends G {
2339
2338
  v(o)
2340
2339
  ).pipe(
2341
2340
  Ie(
2342
- Wi,
2341
+ _i,
2343
2342
  re
2344
2343
  ),
2345
2344
  U(),
@@ -2362,7 +2361,7 @@ class _i extends G {
2362
2361
  P(i).pipe(T(this.destroy$)).subscribe();
2363
2362
  }
2364
2363
  }
2365
- const Hi = (n) => n.pagination.state$.pipe(
2364
+ const Bi = (n) => n.pagination.state$.pipe(
2366
2365
  z(n.context.manifest$, n.settings.values$),
2367
2366
  S(
2368
2367
  ([
@@ -2382,7 +2381,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2382
2381
  }
2383
2382
  ),
2384
2383
  R(O)
2385
- ), Bi = ({ reader: n, duration: e }) => (t) => {
2384
+ ), Xi = ({ reader: n, duration: e }) => (t) => {
2386
2385
  let i;
2387
2386
  const o = () => {
2388
2387
  i?.(), i = void 0;
@@ -2398,11 +2397,11 @@ const Hi = (n) => n.pagination.state$.pipe(
2398
2397
  x(o),
2399
2398
  me(o)
2400
2399
  );
2401
- }, Xi = (n) => (e) => {
2402
- const t = n(e), i = Hi(t), o = new Ui(t), s = new zi(t), r = new _i(
2400
+ }, Yi = (n) => (e) => {
2401
+ const t = n(e), i = Bi(t), o = new zi(t), s = new Wi(t), r = new Hi(
2403
2402
  t.navigation.scrollNavigationController,
2404
2403
  t.navigation.locker
2405
- ), a = Ri(t, o), c = r.navigation$.pipe(
2404
+ ), a = Oi(t, o), c = r.navigation$.pipe(
2406
2405
  x((d) => {
2407
2406
  t.navigation.navigate(d);
2408
2407
  })
@@ -2419,7 +2418,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2419
2418
  navigation: {
2420
2419
  ...t.navigation,
2421
2420
  state$: i,
2422
- throttleLock: ({ duration: d, trigger: g }) => g.pipe(Bi({ duration: d, reader: t })),
2421
+ throttleLock: ({ duration: d, trigger: g }) => g.pipe(Xi({ duration: d, reader: t })),
2423
2422
  panNavigator: s,
2424
2423
  turnBottom: o.turnBottom.bind(o),
2425
2424
  turnTop: o.turnTop.bind(o),
@@ -2467,19 +2466,19 @@ const Hi = (n) => n.pagination.state$.pipe(
2467
2466
  }
2468
2467
  return o;
2469
2468
  }, void 0);
2470
- }, Yi = (n, e) => {
2469
+ }, qi = (n, e) => {
2471
2470
  const { href: t } = e;
2472
2471
  return zt(t, n.nav?.toc ?? [], n);
2473
- }, qi = (n) => {
2472
+ }, Gi = (n) => {
2474
2473
  const e = n.context.manifest, t = n.spineItemsManager.items;
2475
2474
  return e ? t.reduce(
2476
- (i, { item: o }) => (i[o.id] = Yi(e, o), i),
2475
+ (i, { item: o }) => (i[o.id] = qi(e, o), i),
2477
2476
  {}
2478
2477
  ) : {};
2479
- }, Gi = (n) => n.spineItemsManager.items$.pipe(
2478
+ }, Zi = (n) => n.spineItemsManager.items$.pipe(
2480
2479
  ne([]),
2481
- S(() => qi(n))
2482
- ), Zi = (n, e, t) => n + e * t, Ji = (n, e, t) => {
2480
+ S(() => Gi(n))
2481
+ ), Ji = (n, e, t) => n + e * t, Ki = (n, e, t) => {
2483
2482
  const { height: i, width: o } = t.layoutInfo, { top: s, left: r } = n.spine.getSpineItemSpineLayoutInfo(t);
2484
2483
  return n.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
2485
2484
  0,
@@ -2494,7 +2493,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2494
2493
  (e.x - r + n.viewport.absoluteViewport.width) / o
2495
2494
  )
2496
2495
  );
2497
- }, Ki = (n, e, t, i, o) => o.isReady$.pipe(
2496
+ }, Qi = (n, e, t, i, o) => o.isReady$.pipe(
2498
2497
  U(),
2499
2498
  z(n.layoutInfo$),
2500
2499
  S(([s, r]) => {
@@ -2504,17 +2503,17 @@ const Hi = (n) => n.pagination.state$.pipe(
2504
2503
  let m = (t + 1) * (h / p);
2505
2504
  !c && o.renditionLayout === "reflowable" && !s && (m = 0);
2506
2505
  let y = l + m;
2507
- return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m = Ji(
2506
+ return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m = Ki(
2508
2507
  n,
2509
2508
  i,
2510
2509
  o
2511
- ) : m = 0, y = Zi(
2510
+ ) : m = 0, y = Ji(
2512
2511
  l,
2513
2512
  h,
2514
2513
  m
2515
2514
  )), e === u - 1 && t === p - 1 && y > 0.99 ? 1 : y;
2516
2515
  })
2517
- ), Qi = (n) => n.spine.layout$.pipe(
2516
+ ), eo = (n) => n.spine.layout$.pipe(
2518
2517
  Ie(10, re),
2519
2518
  z(n.pagination.state$),
2520
2519
  S(() => ({
@@ -2532,7 +2531,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2532
2531
  numberOfPagesPerItems: [],
2533
2532
  numberOfTotalPages: 0
2534
2533
  })
2535
- ), eo = (n, e, t, i) => {
2534
+ ), to = (n, e, t, i) => {
2536
2535
  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
2536
  return v({
2538
2537
  ...e,
@@ -2563,7 +2562,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2563
2562
  // hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
2564
2563
  // numberOfSpineItems: context.manifest?.readingOrder.length,
2565
2564
  });
2566
- }, to = (n) => j([
2565
+ }, no = (n) => j([
2567
2566
  n.pagination.state$,
2568
2567
  // Usually pagination change if layout changes (number of pages) however it is especially
2569
2568
  // useful for like webtoon where you still have one page but only the layout will give you the final size
@@ -2572,7 +2571,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2572
2571
  ]).pipe(
2573
2572
  w(([e]) => {
2574
2573
  const t = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
2575
- return t ? Ki(
2574
+ return t ? Qi(
2576
2575
  n,
2577
2576
  e.endSpineItemIndex ?? 0,
2578
2577
  e.endPageIndexInSpineItem || 0,
@@ -2580,8 +2579,8 @@ const Hi = (n) => n.pagination.state$.pipe(
2580
2579
  t
2581
2580
  ) : v(0);
2582
2581
  })
2583
- ), no = (n) => {
2584
- const e = Gi(n), t = Qi(n), i = new q({
2582
+ ), io = (n) => {
2583
+ const e = Zi(n), t = eo(n), i = new q({
2585
2584
  ...n.pagination.state,
2586
2585
  beginChapterInfo: void 0,
2587
2586
  beginCfi: void 0,
@@ -2599,10 +2598,10 @@ const Hi = (n) => n.pagination.state$.pipe(
2599
2598
  }), o = j([
2600
2599
  n.pagination.state$,
2601
2600
  e,
2602
- to(n)
2601
+ no(n)
2603
2602
  ]).pipe(
2604
2603
  w(
2605
- ([r, a, c]) => eo(
2604
+ ([r, a, c]) => to(
2606
2605
  n,
2607
2606
  r,
2608
2607
  a,
@@ -2672,14 +2671,14 @@ const Hi = (n) => n.pagination.state$.pipe(
2672
2671
  nodeOrRange: e.node,
2673
2672
  offset: e.offset,
2674
2673
  item: n
2675
- }).trim(), io = (n, e) => Wt({
2674
+ }).trim(), oo = (n, e) => Wt({
2676
2675
  nodeOrRange: n,
2677
2676
  item: e
2678
- }), Zs = (n) => n.index.toString(), pt = (n) => n[0]?.index === 6 && n.length > 1, Be = (n) => {
2677
+ }), Js = (n) => n.index.toString(), pt = (n) => n[0]?.index === 6 && n.length > 1, Be = (n) => {
2679
2678
  const e = Mt(n);
2680
2679
  return wn(e);
2681
- }, oo = (n) => Array.isArray(n) ? n[0] && pt(n[0]) ? n[0] : void 0 : n.parent[0] && pt(n.parent[0]) ? n.parent[0] : void 0, it = (n) => {
2682
- const e = Mt(n), s = ((oo(e) ?? [])[1]?.index ?? 2) / 2 - 1, r = Pn(e), a = r ? e.end.at(-1)?.at(-1)?.offset : e.at(-1)?.at(-1)?.offset;
2680
+ }, so = (n) => Array.isArray(n) ? n[0] && pt(n[0]) ? n[0] : void 0 : n.parent[0] && pt(n.parent[0]) ? n.parent[0] : void 0, it = (n) => {
2681
+ 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
2682
  return {
2684
2683
  isCfiRange: r,
2685
2684
  itemIndex: s,
@@ -2728,7 +2727,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2728
2727
  spineItem: o,
2729
2728
  node: null
2730
2729
  };
2731
- }, so = (n, e) => {
2730
+ }, ro = (n, e) => {
2732
2731
  if ("cfi" in e) {
2733
2732
  const { itemIndex: s, ...r } = n.cfi.parseCfi(e.cfi);
2734
2733
  return {
@@ -2748,7 +2747,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2748
2747
  itemIndex: t.index,
2749
2748
  node: null
2750
2749
  };
2751
- }, ro = (n, e) => {
2750
+ }, ao = (n, e) => {
2752
2751
  let t = n?.itemPageIndex;
2753
2752
  const { itemIndex: i, ...o } = e.cfi.parseCfi(n.cfi), s = e.spineItemsManager.get(i);
2754
2753
  return s ? et().pipe(
@@ -2781,7 +2780,7 @@ const Hi = (n) => n.pagination.state$.pipe(
2781
2780
  })
2782
2781
  ) : v({ ...n, itemIndex: i, ...o });
2783
2782
  };
2784
- class ao {
2783
+ class co {
2785
2784
  constructor(e) {
2786
2785
  this.reader = e, this.locatorsByKey = /* @__PURE__ */ new Map(), this.deregisterMemoizedStream = (t) => {
2787
2786
  const i = this.locatorsByKey.get(t);
@@ -2789,7 +2788,7 @@ class ao {
2789
2788
  }, this.locate = (t, i) => {
2790
2789
  const o = {
2791
2790
  resource: t,
2792
- meta: so(this.reader, t)
2791
+ meta: ro(this.reader, t)
2793
2792
  };
2794
2793
  return at(() => {
2795
2794
  const s = this.reader.spineItemsManager.get(
@@ -2814,7 +2813,7 @@ class ao {
2814
2813
  const d = this.reader.spine.layout$.pipe(
2815
2814
  Ie(10),
2816
2815
  ne(o),
2817
- an((g) => ro(g.meta, this.reader).pipe(
2816
+ an((g) => ao(g.meta, this.reader).pipe(
2818
2817
  S((p) => ({
2819
2818
  ...g,
2820
2819
  meta: p
@@ -2837,10 +2836,10 @@ class ao {
2837
2836
  ) : this.locate(e, t ?? {});
2838
2837
  }
2839
2838
  }
2840
- const co = (n) => (e) => {
2841
- const t = n(e), { paginationInfo$: i, getPaginationInfo: o } = no(t);
2839
+ const uo = (n) => (e) => {
2840
+ const t = n(e), { paginationInfo$: i, getPaginationInfo: o } = io(t);
2842
2841
  i.pipe(T(t.$.destroy$)).subscribe();
2843
- const s = new ao(t);
2842
+ const s = new co(t);
2844
2843
  return {
2845
2844
  ...t,
2846
2845
  locateResource: s.locateResource.bind(s),
@@ -2854,7 +2853,7 @@ const co = (n) => (e) => {
2854
2853
  }
2855
2854
  }
2856
2855
  };
2857
- }, uo = (n) => ({
2856
+ }, lo = (n) => ({
2858
2857
  put: (s, r) => new Promise((a, c) => {
2859
2858
  const u = n.transaction(["store"], "readwrite");
2860
2859
  u.onerror = (g) => {
@@ -2911,11 +2910,11 @@ const co = (n) => (e) => {
2911
2910
  i.onerror = (o) => {
2912
2911
  t(o);
2913
2912
  }, i.onsuccess = () => {
2914
- e(uo(i.result));
2913
+ e(lo(i.result));
2915
2914
  }, i.onupgradeneeded = () => {
2916
2915
  i.result.createObjectStore("store");
2917
2916
  };
2918
- }), lo = (n) => {
2917
+ }), po = (n) => {
2919
2918
  let e = Date.now().toString();
2920
2919
  const t = new N(), i = (c) => {
2921
2920
  if (typeof c == "string" || typeof c == "object") {
@@ -2973,8 +2972,8 @@ const co = (n) => (e) => {
2973
2972
  t.complete();
2974
2973
  }
2975
2974
  };
2976
- }, po = (n) => (e) => {
2977
- const t = n(e), i = lo(t.context);
2975
+ }, go = (n) => (e) => {
2976
+ const t = n(e), i = po(t.context);
2978
2977
  return {
2979
2978
  ...t,
2980
2979
  // $: {
@@ -2986,7 +2985,7 @@ const co = (n) => (e) => {
2986
2985
  }
2987
2986
  // load,
2988
2987
  };
2989
- }, go = (n, e) => {
2988
+ }, ho = (n, e) => {
2990
2989
  const t = n.node.ownerDocument?.createRange(), i = n.node.compareDocumentPosition(e.node);
2991
2990
  if (t) {
2992
2991
  try {
@@ -3006,14 +3005,14 @@ const co = (n) => (e) => {
3006
3005
  }
3007
3006
  return t;
3008
3007
  }
3009
- }, ho = ({
3008
+ }, mo = ({
3010
3009
  selection: n,
3011
3010
  spineItem: e
3012
3011
  }) => {
3013
3012
  const { anchorNode: t, anchorOffset: i, focusNode: o, focusOffset: s } = n;
3014
3013
  if (!(!t || !o))
3015
3014
  try {
3016
- return go(
3015
+ return ho(
3017
3016
  { node: t, offset: i },
3018
3017
  { node: o, offset: s }
3019
3018
  );
@@ -3025,7 +3024,7 @@ const co = (n) => (e) => {
3025
3024
  return;
3026
3025
  }
3027
3026
  };
3028
- class mo extends G {
3027
+ class fo extends G {
3029
3028
  constructor(e) {
3030
3029
  super();
3031
3030
  const t = e.contentDocument || e.contentWindow?.document;
@@ -3080,11 +3079,11 @@ class mo extends G {
3080
3079
  }
3081
3080
  }
3082
3081
  }
3083
- const fo = (n) => n.watch("isLoaded").pipe(
3082
+ const yo = (n) => n.watch("isLoaded").pipe(
3084
3083
  w(() => {
3085
3084
  const e = n.renderer.getDocumentFrame(), t = e?.contentDocument || e?.contentWindow?.document;
3086
3085
  if (!e || !t) return he;
3087
- const i = new mo(e);
3086
+ const i = new fo(e);
3088
3087
  return P(
3089
3088
  i.selectionChange$.pipe(
3090
3089
  S((o) => {
@@ -3111,14 +3110,14 @@ const fo = (n) => n.watch("isLoaded").pipe(
3111
3110
  );
3112
3111
  }),
3113
3112
  R()
3114
- ), yo = (n) => (e) => {
3113
+ ), So = (n) => (e) => {
3115
3114
  const t = n(e);
3116
3115
  let i;
3117
3116
  const o = t.spineItemsManager.items$.pipe(
3118
3117
  w((l) => {
3119
3118
  const d = l.map((g) => {
3120
3119
  const p = t.spineItemsManager.getSpineItemIndex(g) ?? 0;
3121
- return fo(g).pipe(
3120
+ return yo(g).pipe(
3122
3121
  S((h) => {
3123
3122
  if (h)
3124
3123
  return {
@@ -3166,7 +3165,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
3166
3165
  selectionOver$: c,
3167
3166
  lastSelectionOnPointerdown$: u,
3168
3167
  getSelection: () => i,
3169
- createOrderedRangeFromSelection: ho
3168
+ createOrderedRangeFromSelection: mo
3170
3169
  }
3171
3170
  };
3172
3171
  }, gt = [
@@ -3184,7 +3183,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
3184
3183
  backgroundColor: "#191717",
3185
3184
  foregroundColor: "#f1ebeb"
3186
3185
  }
3187
- ], So = (n) => (e) => {
3186
+ ], Io = (n) => (e) => {
3188
3187
  const t = n(e), i = new q(
3189
3188
  e.theme ?? "bright"
3190
3189
  ), o = () => {
@@ -3249,7 +3248,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
3249
3248
  }
3250
3249
  }
3251
3250
  };
3252
- }, Io = (n) => (e) => {
3251
+ }, bo = (n) => (e) => {
3253
3252
  const t = n(e);
3254
3253
  return {
3255
3254
  ...t,
@@ -3263,7 +3262,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
3263
3262
  };
3264
3263
  };
3265
3264
  navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
3266
- const bo = (n) => (e) => n(e), vo = "[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}", ht = (n, e, t) => {
3265
+ 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}", ht = (n, e, t) => {
3267
3266
  const { clientWidth: i, clientHeight: o } = t.value.element, s = {
3268
3267
  maxX: 0,
3269
3268
  minX: i * (1 - e),
@@ -3274,11 +3273,11 @@ const bo = (n) => (e) => n(e), vo = "[data-prose-reader-scroll-navigator][data-p
3274
3273
  x: Math.min(Math.max(n.x, s.minX), s.maxX),
3275
3274
  y: Math.min(Math.max(n.y, s.minY), s.maxY)
3276
3275
  };
3277
- }, wo = (n, e, t) => {
3276
+ }, Po = (n, e, t) => {
3278
3277
  t.style.transformOrigin = "0 0";
3279
3278
  const i = `translate3d(${e.x}px, ${e.y}px, 0px)`, o = `scale(${n})`;
3280
3279
  t.style.transform = `${i} ${o}`;
3281
- }, Po = (n, e, t, i) => {
3280
+ }, xo = (n, e, t, i) => {
3282
3281
  const o = e / n, s = t.clientWidth, r = t.clientHeight, a = s / 2 - i.x, c = r / 2 - i.y;
3283
3282
  return {
3284
3283
  x: i.x + a * (1 - o),
@@ -3292,12 +3291,12 @@ class Ht {
3292
3291
  }
3293
3292
  class mt extends Ht {
3294
3293
  }
3295
- class xo extends Ht {
3294
+ class $o extends Ht {
3296
3295
  constructor() {
3297
3296
  super(...arguments), this.__symbol = /* @__PURE__ */ Symbol("UnboundScrollPosition");
3298
3297
  }
3299
3298
  }
3300
- class $o extends Q {
3299
+ class To extends Q {
3301
3300
  constructor(e, t, i, o, s) {
3302
3301
  super({
3303
3302
  element: void 0
@@ -3323,7 +3322,7 @@ class $o extends Q {
3323
3322
  x(({ rootElement: d }) => {
3324
3323
  if (!d) return;
3325
3324
  const g = document.createElement("div");
3326
- g.setAttribute(`data-${si}`, ""), g.appendChild(this.viewport.value.element), d.appendChild(g), this.update({ element: g });
3325
+ g.setAttribute(`data-${ri}`, ""), g.appendChild(this.viewport.value.element), d.appendChild(g), this.update({ element: g });
3327
3326
  })
3328
3327
  ), a = j([
3329
3328
  t.watch(["computedPageTurnMode"]),
@@ -3412,14 +3411,14 @@ class $o extends Q {
3412
3411
  });
3413
3412
  }
3414
3413
  }
3415
- const To = (n, e, t, i, o) => {
3414
+ const Fo = (n, e, t, i, o) => {
3416
3415
  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 xo({
3416
+ return new $o({
3418
3417
  x: h,
3419
3418
  y: m
3420
3419
  });
3421
- }, Fo = (n, e) => {
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 = To(
3420
+ }, Lo = (n, e) => {
3421
+ 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
3422
  s ?? An(),
3424
3423
  a,
3425
3424
  n,
@@ -3437,7 +3436,7 @@ const To = (n, e, t, i, o) => {
3437
3436
  position: g
3438
3437
  });
3439
3438
  }, we = 200;
3440
- class Lo extends Q {
3439
+ class Mo extends Q {
3441
3440
  constructor(e) {
3442
3441
  super({
3443
3442
  isZooming: !1,
@@ -3507,7 +3506,7 @@ class Lo extends Q {
3507
3506
  }
3508
3507
  updateZoom(e, t, i) {
3509
3508
  if (this.isControlled) {
3510
- const o = t || Po(
3509
+ const o = t || xo(
3511
3510
  this.value.currentScale,
3512
3511
  e,
3513
3512
  this.viewport.element,
@@ -3523,11 +3522,11 @@ class Lo extends Q {
3523
3522
  });
3524
3523
  }
3525
3524
  applyZoom(e, t) {
3526
- this.isControlled ? wo(
3525
+ this.isControlled ? Po(
3527
3526
  e,
3528
3527
  t,
3529
3528
  this.viewport.element
3530
- ) : Fo(e, this.reader);
3529
+ ) : Lo(e, this.reader);
3531
3530
  }
3532
3531
  get isControlled() {
3533
3532
  return this.reader.settings.values.computedPageTurnMode === "controlled";
@@ -3539,9 +3538,9 @@ class Lo extends Q {
3539
3538
  return this.reader.viewport.value;
3540
3539
  }
3541
3540
  }
3542
- const ft = `${Vt}-enhancer-zoom`, Mo = (n) => (e) => {
3543
- const t = n(e), i = new Lo(t);
3544
- Ce(document, ft, vo);
3541
+ const ft = `${Vt}-enhancer-zoom`, Co = (n) => (e) => {
3542
+ const t = n(e), i = new Mo(t);
3543
+ Ce(document, ft, wo);
3545
3544
  const o = () => {
3546
3545
  Ee(document, ft), i.destroy(), t.destroy();
3547
3546
  }, s = i;
@@ -3560,7 +3559,7 @@ const ft = `${Vt}-enhancer-zoom`, Mo = (n) => (e) => {
3560
3559
  }
3561
3560
  };
3562
3561
  }, Bt = (n) => n?.renditionLayout === "pre-paginated" || n?.spineItems.every((e) => e.renditionLayout === "pre-paginated");
3563
- class Co {
3562
+ class Eo {
3564
3563
  constructor() {
3565
3564
  this.navigationSubject = new ot(1), this.viewportStateSubject = new q("free"), this.paginationSubject = new ot(), this.navigationIsLockedSubject = new q(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3566
3565
  R(),
@@ -3572,11 +3571,11 @@ class Co {
3572
3571
  ), this.navigation$ = this.navigationSubject.asObservable();
3573
3572
  }
3574
3573
  }
3575
- class Eo extends Q {
3574
+ class Do extends Q {
3576
3575
  constructor() {
3577
3576
  super({
3578
3577
  assumedRenditionLayout: "reflowable"
3579
- }), this.bridgeEvent = new Co(), this.manifest$ = this.pipe(
3578
+ }), this.bridgeEvent = new Eo(), this.manifest$ = this.pipe(
3580
3579
  ie((e) => e.manifest),
3581
3580
  pe(Z),
3582
3581
  be()
@@ -3600,7 +3599,7 @@ class Eo extends Q {
3600
3599
  return this.manifest?.readingDirection;
3601
3600
  }
3602
3601
  }
3603
- class Do extends Q {
3602
+ class Ao extends Q {
3604
3603
  constructor(e, t) {
3605
3604
  super({
3606
3605
  supportedPageTurnAnimation: ["fade", "none", "slide"],
@@ -3635,7 +3634,7 @@ class Do extends Q {
3635
3634
  ).subscribe(this.next.bind(this));
3636
3635
  }
3637
3636
  }
3638
- class Ao {
3637
+ class No {
3639
3638
  constructor() {
3640
3639
  this._hooks = [], this._hookExecutions = [];
3641
3640
  }
@@ -3697,17 +3696,17 @@ class Ao {
3697
3696
  return j(s);
3698
3697
  }
3699
3698
  }
3700
- const No = "[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%}", Ro = (n) => ({
3699
+ 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
3700
  x: -n.x,
3702
3701
  y: -n.y
3703
- }), Oo = (n) => n instanceof DOMMatrix ? new M({
3702
+ }), Vo = (n) => n instanceof DOMMatrix ? new M({
3704
3703
  x: -n.e,
3705
3704
  y: -n.f
3706
3705
  }) : new M({
3707
3706
  x: -n.x,
3708
3707
  y: -n.y
3709
- }), Vo = "navigation/ViewportNavigator", yt = A.namespace(Vo);
3710
- class jo extends G {
3708
+ }), jo = "navigation/ViewportNavigator", yt = A.namespace(jo);
3709
+ class ko extends G {
3711
3710
  constructor(e, t, i, o, s) {
3712
3711
  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
3712
  document.createElement("div")
@@ -3819,7 +3818,7 @@ class jo extends G {
3819
3818
  * for remark about flicker / fonts smoothing
3820
3819
  */
3821
3820
  setViewportPosition(e) {
3822
- const t = this.element$.getValue(), i = Ro(e);
3821
+ const t = this.element$.getValue(), i = Oo(e);
3823
3822
  t.style.transform = `translate(${i.x}px, ${i.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
3824
3823
  }
3825
3824
  navigate(e) {
@@ -3834,10 +3833,10 @@ class jo extends G {
3834
3833
  if (!i || i === "none")
3835
3834
  return new M({ x: 0, y: 0 });
3836
3835
  const o = new DOMMatrix(i);
3837
- return Oo(o);
3836
+ return Vo(o);
3838
3837
  }
3839
3838
  }
3840
- const ko = () => (n) => n.pipe(
3839
+ const Uo = () => (n) => n.pipe(
3841
3840
  S(({ navigation: e, pagination: t, ...i }) => ({
3842
3841
  navigation: {
3843
3842
  ...e,
@@ -3845,7 +3844,7 @@ const ko = () => (n) => n.pipe(
3845
3844
  },
3846
3845
  ...i
3847
3846
  }))
3848
- ), Uo = (n, e, t) => n.bridgeEvent.pagination$.pipe(
3847
+ ), zo = (n, e, t) => n.bridgeEvent.pagination$.pipe(
3849
3848
  z(e),
3850
3849
  C(
3851
3850
  ([i, o]) => i.navigationId === o.id
@@ -3862,7 +3861,7 @@ const ko = () => (n) => n.pipe(
3862
3861
  navigation: o
3863
3862
  }))
3864
3863
  )),
3865
- ko(),
3864
+ Uo(),
3866
3865
  R(
3867
3866
  (i, o) => i.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
3868
3867
  ),
@@ -3874,7 +3873,7 @@ const ko = () => (n) => n.pipe(
3874
3873
  }
3875
3874
  })
3876
3875
  )
3877
- ), zo = ({ navigationResolver: n }) => (e) => e.pipe(
3876
+ ), Wo = ({ navigationResolver: n }) => (e) => e.pipe(
3878
3877
  S(([t, i]) => {
3879
3878
  const o = {
3880
3879
  type: "api",
@@ -3911,7 +3910,7 @@ const ko = () => (n) => n.pipe(
3911
3910
  navigation: o
3912
3911
  };
3913
3912
  })
3914
- ), Wo = ({ navigationResolver: n }) => (e) => e.pipe(
3913
+ ), _o = ({ navigationResolver: n }) => (e) => e.pipe(
3915
3914
  S((t) => {
3916
3915
  if (t.navigation.cfi) {
3917
3916
  const i = n.getNavigationForCfi(
@@ -3928,16 +3927,16 @@ const ko = () => (n) => n.pipe(
3928
3927
  }
3929
3928
  return t;
3930
3929
  })
3931
- ), _o = ({
3930
+ ), Ho = ({
3932
3931
  navigation: n,
3933
3932
  previousNavigation: e,
3934
3933
  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", Ho = ({
3934
+ }) => 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
3935
  context: n,
3937
3936
  settings: e
3938
3937
  }) => (t) => t.pipe(
3939
3938
  S(({ navigation: i, previousNavigation: o }) => {
3940
- const s = _o({
3939
+ const s = Ho({
3941
3940
  navigation: i,
3942
3941
  previousNavigation: o,
3943
3942
  settings: e
@@ -3951,7 +3950,7 @@ const ko = () => (n) => n.pipe(
3951
3950
  direction: s
3952
3951
  };
3953
3952
  })
3954
- ), Bo = ({
3953
+ ), Xo = ({
3955
3954
  spineItemsManager: n,
3956
3955
  navigationResolver: e,
3957
3956
  settings: t
@@ -4120,7 +4119,7 @@ const ko = () => (n) => n.pipe(
4120
4119
  ...a
4121
4120
  }))
4122
4121
  );
4123
- }, Xo = ({ navigationResolver: n }) => (e) => e.pipe(
4122
+ }, Yo = ({ navigationResolver: n }) => (e) => e.pipe(
4124
4123
  S((t) => {
4125
4124
  if (t.navigation.url) {
4126
4125
  const i = n.getNavigationForUrl(
@@ -4153,7 +4152,7 @@ class Xt {
4153
4152
  };
4154
4153
  }
4155
4154
  }
4156
- const Yo = ({
4155
+ const qo = ({
4157
4156
  spineLocator: n,
4158
4157
  navigation: e,
4159
4158
  navigationResolver: t,
@@ -4210,7 +4209,7 @@ const Yo = ({
4210
4209
  return c ? t.getNavigationForPosition(e.position) : t.getNavigationForSpineIndexOrId(s);
4211
4210
  })
4212
4211
  ) : v(new M({ x: 0, y: 0 }));
4213
- }, qo = ({
4212
+ }, Go = ({
4214
4213
  navigation: n,
4215
4214
  spineLocator: e,
4216
4215
  spineItemsManager: t,
@@ -4279,7 +4278,7 @@ const Yo = ({
4279
4278
  }
4280
4279
  }
4281
4280
  return n.position;
4282
- }, Go = ({
4281
+ }, Zo = ({
4283
4282
  navigation: n,
4284
4283
  spineItemsManager: e,
4285
4284
  settings: t,
@@ -4287,7 +4286,7 @@ const Yo = ({
4287
4286
  navigationResolver: o,
4288
4287
  spine: s
4289
4288
  }) => t.values.computedPageTurnMode === "scrollable" ? v(
4290
- qo({
4289
+ Go({
4291
4290
  navigation: n,
4292
4291
  spineLocator: i,
4293
4292
  navigationResolver: o,
@@ -4295,7 +4294,7 @@ const Yo = ({
4295
4294
  spineItemsManager: e,
4296
4295
  spine: s
4297
4296
  })
4298
- ) : Yo({
4297
+ ) : qo({
4299
4298
  navigation: n,
4300
4299
  spineLocator: i,
4301
4300
  navigationResolver: o,
@@ -4307,7 +4306,7 @@ const Yo = ({
4307
4306
  context: t,
4308
4307
  spine: i
4309
4308
  }) => (o) => o.pipe(
4310
- w((s) => Go({
4309
+ w((s) => Zo({
4311
4310
  spineLocator: i.locator,
4312
4311
  navigation: s.navigation,
4313
4312
  navigationResolver: e,
@@ -4324,8 +4323,8 @@ const Yo = ({
4324
4323
  }
4325
4324
  }))
4326
4325
  ))
4327
- ), Zo = "navigation/InternalNavigator", Jo = A.namespace(Zo);
4328
- class Ko extends G {
4326
+ ), Jo = "navigation/InternalNavigator", Ko = A.namespace(Jo);
4327
+ class Qo extends G {
4329
4328
  constructor(e, t, i, o, s, r, a, c) {
4330
4329
  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
4330
  animation: !1,
@@ -4348,24 +4347,24 @@ class Ko extends G {
4348
4347
  ), this.locker = new Xt();
4349
4348
  const u = i.pipe(
4350
4349
  z(this.navigationSubject),
4351
- zo({
4350
+ Wo({
4352
4351
  navigationResolver: r
4353
4352
  }),
4354
4353
  /**
4355
4354
  * Url lookup is heavier so we start with it to fill
4356
4355
  * as much information as needed to reduce later lookup
4357
4356
  */
4358
- Xo({
4357
+ Yo({
4359
4358
  navigationResolver: r
4360
4359
  }),
4361
4360
  /**
4362
4361
  * Cfi lookup is heavier so we start with it to fill
4363
4362
  * as much information as needed to reduce later lookup
4364
4363
  */
4365
- Wo({
4364
+ _o({
4366
4365
  navigationResolver: r
4367
4366
  }),
4368
- Ho({ context: t, settings: e }),
4367
+ Bo({ context: t, settings: e }),
4369
4368
  St({
4370
4369
  navigationResolver: r,
4371
4370
  settings: e,
@@ -4382,7 +4381,7 @@ class Ko extends G {
4382
4381
  spine: a
4383
4382
  })
4384
4383
  ).pipe(
4385
- Bo({
4384
+ Xo({
4386
4385
  navigationResolver: r,
4387
4386
  spineItemsManager: a.spineItemsManager,
4388
4387
  settings: e
@@ -4499,7 +4498,7 @@ class Ko extends G {
4499
4498
  }),
4500
4499
  S(({ navigation: f }) => f),
4501
4500
  D()
4502
- ), p = Uo(
4501
+ ), p = zo(
4503
4502
  t,
4504
4503
  this.navigationSubject,
4505
4504
  a
@@ -4509,7 +4508,7 @@ class Ko extends G {
4509
4508
  p
4510
4509
  ), m = (f) => f.pipe(
4511
4510
  x(([I, b]) => {
4512
- Jo.info(
4511
+ Ko.info(
4513
4512
  `navigation updated from ${I.meta.triggeredBy} of type ${I.type}`,
4514
4513
  {
4515
4514
  previousNavigation: b,
@@ -4567,7 +4566,7 @@ const Fe = (n, e, t) => {
4567
4566
  }, vt = (n, e, t) => {
4568
4567
  const i = [...Array(t)].map((o, s) => s * e);
4569
4568
  return n <= 0 || t === 0 ? 0 : n >= t * e ? t - 1 : i.findIndex((o) => n < o + e) ?? 0;
4570
- }, Qo = ({
4569
+ }, es = ({
4571
4570
  itemWidth: n,
4572
4571
  itemHeight: e,
4573
4572
  spineItemPosition: t
@@ -4593,7 +4592,7 @@ const Fe = (n, e, t) => {
4593
4592
  pageTurnMode: a,
4594
4593
  isRTL: c
4595
4594
  }) => {
4596
- const l = Qo({
4595
+ const l = es({
4597
4596
  spineItemPosition: t,
4598
4597
  itemHeight: e,
4599
4598
  itemWidth: n
@@ -4610,7 +4609,7 @@ const Fe = (n, e, t) => {
4610
4609
  return vt(t.y, s, d);
4611
4610
  const g = vt(l, o, d);
4612
4611
  return c ? d - 1 - g : g;
4613
- }, es = ({
4612
+ }, ts = ({
4614
4613
  pageIndex: n,
4615
4614
  itemLayout: e,
4616
4615
  context: t,
@@ -4663,7 +4662,7 @@ const Fe = (n, e, t) => {
4663
4662
  getSpineItemPositionFromPageIndex: ({
4664
4663
  pageIndex: a,
4665
4664
  spineItem: c
4666
- }) => es({
4665
+ }) => ts({
4667
4666
  context: n,
4668
4667
  isUsingVerticalWriting: !!c.isUsingVerticalWriting(),
4669
4668
  itemLayout: c.layoutInfo,
@@ -4734,7 +4733,7 @@ const Fe = (n, e, t) => {
4734
4733
  });
4735
4734
  }
4736
4735
  };
4737
- }, ts = ({
4736
+ }, ns = ({
4738
4737
  context: n,
4739
4738
  settings: e,
4740
4739
  viewport: t
@@ -4849,7 +4848,7 @@ const Pt = ({
4849
4848
  });
4850
4849
  }
4851
4850
  return new M({ x: 0, y: 0 });
4852
- }, ns = ({
4851
+ }, is = ({
4853
4852
  pageIndex: n,
4854
4853
  spineItemsManager: e,
4855
4854
  spineItemId: t,
@@ -4879,28 +4878,28 @@ const Pt = ({
4879
4878
  pageSizeWidth: s.pageSize.width,
4880
4879
  visibleAreaRectWidth: s.absoluteViewport.width
4881
4880
  });
4882
- }, is = (n, e) => {
4881
+ }, os = (n, e) => {
4883
4882
  if (e && e instanceof HTMLIFrameElement)
4884
4883
  return n.startsWith("#") ? e.contentDocument?.getElementById(
4885
4884
  n.replace("#", "")
4886
4885
  ) : e.contentDocument?.querySelector(n);
4887
- }, os = ({
4886
+ }, ss = ({
4888
4887
  anchor: n,
4889
4888
  spineItem: e,
4890
4889
  spine: t
4891
4890
  }) => {
4892
- const i = is(
4891
+ const i = os(
4893
4892
  n,
4894
4893
  e.renderer.getDocumentFrame()
4895
4894
  );
4896
4895
  return i ? t.spineItemLocator.getSpineItemPositionFromNode(i, 0, e)?.x ?? 0 : 0;
4897
- }, ss = ({
4896
+ }, rs = ({
4898
4897
  anchor: n,
4899
4898
  spineItem: e,
4900
4899
  spineLocator: t,
4901
4900
  spine: i
4902
4901
  }) => {
4903
- const o = os({
4902
+ const o = ss({
4904
4903
  anchor: n,
4905
4904
  spineItem: e,
4906
4905
  spine: i
@@ -4909,7 +4908,7 @@ const Pt = ({
4909
4908
  spineItemPosition: new E({ x: o, y: 0 }),
4910
4909
  spineItem: e
4911
4910
  });
4912
- }, rs = ({
4911
+ }, as = ({
4913
4912
  anchor: n,
4914
4913
  spineItem: e,
4915
4914
  spineLocator: t,
@@ -4917,7 +4916,7 @@ const Pt = ({
4917
4916
  pageSizeWidth: o,
4918
4917
  visibleAreaRectWidth: s
4919
4918
  }) => {
4920
- const r = ss({
4919
+ const r = rs({
4921
4920
  anchor: n,
4922
4921
  spineItem: e,
4923
4922
  spineLocator: t,
@@ -4928,7 +4927,7 @@ const Pt = ({
4928
4927
  pageSizeWidth: o,
4929
4928
  visibleAreaRectWidth: s
4930
4929
  });
4931
- }, as = ({
4930
+ }, cs = ({
4932
4931
  spine: n,
4933
4932
  spineItemsManager: e,
4934
4933
  spineLocator: t,
@@ -4944,7 +4943,7 @@ const Pt = ({
4944
4943
  if (u) {
4945
4944
  const l = e.get(u.id);
4946
4945
  if (l) {
4947
- const d = rs({
4946
+ const d = as({
4948
4947
  anchor: a.hash,
4949
4948
  spineItem: l,
4950
4949
  spine: n,
@@ -4967,7 +4966,7 @@ const Pt = ({
4967
4966
  console.error(a);
4968
4967
  return;
4969
4968
  }
4970
- }, cs = ({
4969
+ }, us = ({
4971
4970
  spineItem: n,
4972
4971
  spineItemPosition: e,
4973
4972
  spineLocator: t,
@@ -4986,7 +4985,7 @@ const Pt = ({
4986
4985
  pageSizeWidth: o.pageSize.width,
4987
4986
  visibleAreaRectWidth: o.absoluteViewport.width
4988
4987
  });
4989
- }, us = "spineNavigator", ls = ({
4988
+ }, ls = "spineNavigator", ds = ({
4990
4989
  context: n,
4991
4990
  spineItemsManager: e,
4992
4991
  locator: t,
@@ -4994,13 +4993,13 @@ const Pt = ({
4994
4993
  spine: o,
4995
4994
  viewport: s
4996
4995
  }) => {
4997
- const r = ts({
4996
+ const r = ns({
4998
4997
  context: n,
4999
4998
  settings: i,
5000
4999
  viewport: s
5001
5000
  });
5002
5001
  return {
5003
- getNavigationForUrl: (p) => as({
5002
+ getNavigationForUrl: (p) => cs({
5004
5003
  context: n,
5005
5004
  spineItemsManager: e,
5006
5005
  spineLocator: t,
@@ -5009,14 +5008,14 @@ const Pt = ({
5009
5008
  visibleAreaRectWidth: s.absoluteViewport.width,
5010
5009
  spine: o
5011
5010
  }),
5012
- getNavigationForSpineItemPage: (p) => ns({
5011
+ getNavigationForSpineItemPage: (p) => is({
5013
5012
  ...p,
5014
5013
  spineItemsManager: e,
5015
5014
  spineItemNavigationResolver: r,
5016
5015
  spineLocator: t,
5017
5016
  viewport: s
5018
5017
  }),
5019
- getNavigationFromSpineItemPosition: (p) => cs({
5018
+ getNavigationFromSpineItemPosition: (p) => us({
5020
5019
  ...p,
5021
5020
  spineItemLocator: t.spineItemLocator,
5022
5021
  spineLocator: t,
@@ -5028,7 +5027,7 @@ const Pt = ({
5028
5027
  spineItemsManager: e
5029
5028
  });
5030
5029
  if (!h) {
5031
- A.warn(us, `unable to detect item id from cfi ${p}`);
5030
+ A.warn(ls, `unable to detect item id from cfi ${p}`);
5032
5031
  return;
5033
5032
  }
5034
5033
  const f = m ? r.getNavigationFromNode(h, m, y) : new E({ x: 0, y: 0 }), I = t.getSpinePositionFromSpineItemPosition({
@@ -5113,7 +5112,7 @@ const Pt = ({
5113
5112
  }),
5114
5113
  spineItemNavigator: r
5115
5114
  };
5116
- }, ds = ({
5115
+ }, ps = ({
5117
5116
  spineItemsManager: n,
5118
5117
  context: e,
5119
5118
  hookManager: t,
@@ -5121,26 +5120,26 @@ const Pt = ({
5121
5120
  settings: o,
5122
5121
  viewport: s
5123
5122
  }) => {
5124
- const r = new N(), a = r.asObservable(), c = new Xt(), u = ls({
5123
+ const r = new N(), a = r.asObservable(), c = new Xt(), u = ds({
5125
5124
  context: e,
5126
5125
  settings: o,
5127
5126
  spineItemsManager: n,
5128
5127
  locator: i.locator,
5129
5128
  spine: i,
5130
5129
  viewport: s
5131
- }), l = new jo(
5130
+ }), l = new ko(
5132
5131
  o,
5133
5132
  t,
5134
5133
  e,
5135
5134
  i,
5136
5135
  s
5137
- ), d = new $o(
5136
+ ), d = new To(
5138
5137
  s,
5139
5138
  o,
5140
5139
  t,
5141
5140
  i,
5142
5141
  e
5143
- ), g = new Ko(
5142
+ ), g = new Qo(
5144
5143
  o,
5145
5144
  e,
5146
5145
  a,
@@ -5183,7 +5182,7 @@ const Pt = ({
5183
5182
  navigation$: g.navigation$
5184
5183
  };
5185
5184
  };
5186
- class ps extends Q {
5185
+ class gs extends Q {
5187
5186
  constructor(e, t) {
5188
5187
  super({
5189
5188
  beginPageIndexInSpineItem: void 0,
@@ -5201,7 +5200,7 @@ class ps extends Q {
5201
5200
  this.mergeCompare(e);
5202
5201
  }
5203
5202
  }
5204
- class gs extends G {
5203
+ class hs extends G {
5205
5204
  constructor(e, t, i, o, s) {
5206
5205
  super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spine = o, this.spineItemLocator = s;
5207
5206
  const r = P(
@@ -5285,11 +5284,11 @@ class gs extends G {
5285
5284
  P(r, a).pipe(T(this.destroy$)).subscribe();
5286
5285
  }
5287
5286
  }
5288
- const hs = ({
5287
+ const ms = ({
5289
5288
  manifest: n,
5290
5289
  spreadMode: e
5291
5290
  }) => n?.renditionFlow === "scrolled-continuous" ? !1 : e;
5292
- class ms extends G {
5291
+ class fs extends G {
5293
5292
  constructor(e) {
5294
5293
  super();
5295
5294
  const t = {
@@ -5334,7 +5333,7 @@ class ms extends G {
5334
5333
  super.destroy(), this.outputSettingsUpdateSubject.complete();
5335
5334
  }
5336
5335
  }
5337
- class fs extends ms {
5336
+ class ys extends fs {
5338
5337
  constructor(e, t) {
5339
5338
  super(e), this.context = t, t.watch(["manifest", "hasVerticalWriting"]).pipe(
5340
5339
  x(() => this.update(this.values)),
@@ -5347,7 +5346,7 @@ class fs extends ms {
5347
5346
  computedPageTurnAnimation: e.pageTurnAnimation,
5348
5347
  computedPageTurnMode: e.pageTurnMode,
5349
5348
  computedPageTurnAnimationDuration: 0,
5350
- computedSpreadMode: hs({
5349
+ computedSpreadMode: ms({
5351
5350
  spreadMode: e.spreadMode,
5352
5351
  manifest: t
5353
5352
  })
@@ -5373,7 +5372,7 @@ class fs extends ms {
5373
5372
  };
5374
5373
  }
5375
5374
  }
5376
- class ys extends ye {
5375
+ class Ss extends ye {
5377
5376
  onUnload() {
5378
5377
  return _;
5379
5378
  }
@@ -5392,7 +5391,7 @@ class ys extends ye {
5392
5391
  getDocumentFrame() {
5393
5392
  }
5394
5393
  }
5395
- class Ss extends G {
5394
+ class Is extends G {
5396
5395
  constructor(e, t, i, o, s, r, a) {
5397
5396
  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
5397
  isLastItem: u,
@@ -5445,7 +5444,7 @@ class Ss extends G {
5445
5444
  ), { width: $, height: L });
5446
5445
  })
5447
5446
  ), this.layout = (u) => {
5448
- const l = Xn(this.didLayout$.pipe(U()));
5447
+ const l = Yn(this.didLayout$.pipe(U()));
5449
5448
  return this.layoutTriggerSubject.next(u), l();
5450
5449
  };
5451
5450
  const c = this.layoutTriggerSubject.pipe(
@@ -5526,7 +5525,7 @@ class Zt extends Q {
5526
5525
  });
5527
5526
  }, this.destroy = () => {
5528
5527
  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 = Is(
5528
+ }, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (d) => this._layout.layout(d), this.containerElement = bs(
5530
5529
  t,
5531
5530
  e,
5532
5531
  s
@@ -5542,7 +5541,7 @@ class Zt extends Q {
5542
5541
  resourcesHandler: this.resourcesHandler,
5543
5542
  viewport: this.viewport
5544
5543
  };
5545
- this.renderer = c ? c(u) : new ys(u), this._layout = new Ss(
5544
+ this.renderer = c ? c(u) : new Ss(u), this._layout = new Is(
5546
5545
  e,
5547
5546
  this.containerElement,
5548
5547
  i,
@@ -5630,14 +5629,14 @@ class Zt extends Q {
5630
5629
  });
5631
5630
  }
5632
5631
  }
5633
- const Is = (n, e, t) => {
5632
+ const bs = (n, e, t) => {
5634
5633
  const i = n.ownerDocument.createElement("div");
5635
5634
  return i.classList.add("spineItem"), i.classList.add(`spineItem-${e.renditionLayout ?? "reflowable"}`), i.style.cssText = `
5636
5635
  position: absolute;
5637
5636
  overflow: hidden;
5638
5637
  `, i.dataset.isReady = "false", t.execute("item.onBeforeContainerCreated", void 0, { element: i }), i;
5639
5638
  };
5640
- class bs extends G {
5639
+ class vs extends G {
5641
5640
  constructor(e, t, i, o, s) {
5642
5641
  super(), this.context = e, this.spineItemsManager = t, this.spineLocator = i, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new q(
5643
5642
  /* @__PURE__ */ new Map()
@@ -5717,17 +5716,17 @@ class Se extends DOMRect {
5717
5716
  return new Se(i.x, i.y, i.width, i.height);
5718
5717
  }
5719
5718
  }
5720
- class vs {
5719
+ class ws {
5721
5720
  constructor({ width: e, height: t }) {
5722
5721
  this.__symbol = /* @__PURE__ */ Symbol("AbsoluteViewport"), this.width = e, this.height = t;
5723
5722
  }
5724
5723
  }
5725
- class ws {
5724
+ class Ps {
5726
5725
  constructor({ width: e, height: t }) {
5727
5726
  this.__symbol = /* @__PURE__ */ Symbol("RelativeViewport"), this.width = e, this.height = t;
5728
5727
  }
5729
5728
  }
5730
- const Ps = ({
5729
+ const xs = ({
5731
5730
  pageIndex: n,
5732
5731
  spineItemOrId: e,
5733
5732
  spineItemsManager: t
@@ -5749,7 +5748,7 @@ const Ps = ({
5749
5748
  { currentAbsolutePage: 0, found: !1 }
5750
5749
  );
5751
5750
  return s;
5752
- }, xs = ({
5751
+ }, $s = ({
5753
5752
  itemHeight: n,
5754
5753
  itemWidth: e,
5755
5754
  visibleWidthOfItem: t,
@@ -5758,7 +5757,7 @@ const Ps = ({
5758
5757
  }) => {
5759
5758
  const s = t / e, r = i / n;
5760
5759
  return o.type === "percentage" ? s >= o.value && r >= o.value : t >= o.value && i >= o.value;
5761
- }, $s = ({
5760
+ }, Ts = ({
5762
5761
  visibleWidthOfItem: n,
5763
5762
  visibleHeightOfItem: e,
5764
5763
  threshold: t,
@@ -5790,14 +5789,14 @@ const Ps = ({
5790
5789
  Math.min(n, g) - Math.max(i, d)
5791
5790
  );
5792
5791
  if (p <= 0 || h <= 0) return { visible: !1 };
5793
- const y = $s({
5792
+ const y = Ts({
5794
5793
  threshold: r,
5795
5794
  visibleHeightOfItem: h,
5796
5795
  visibleWidthOfItem: p,
5797
5796
  viewportPosition: a
5798
5797
  });
5799
5798
  return c ? { visible: y } : {
5800
- visible: xs({
5799
+ visible: $s({
5801
5800
  itemHeight: s,
5802
5801
  itemWidth: o,
5803
5802
  threshold: r,
@@ -5821,7 +5820,7 @@ const Ps = ({
5821
5820
  }) => new M({
5822
5821
  x: e + n.x,
5823
5822
  y: t + n.y
5824
- }), Ts = ({
5823
+ }), Fs = ({
5825
5824
  position: n,
5826
5825
  threshold: e,
5827
5826
  restrictToScreen: t,
@@ -5859,7 +5858,7 @@ const Ps = ({
5859
5858
  beginIndex: d ?? 0,
5860
5859
  endIndex: g ?? 0
5861
5860
  };
5862
- }, Fs = ({
5861
+ }, Ls = ({
5863
5862
  spineItemsManager: n,
5864
5863
  context: e,
5865
5864
  spineItemLocator: t,
@@ -5963,7 +5962,7 @@ const Ps = ({
5963
5962
  /**
5964
5963
  * @deprecated use Pages
5965
5964
  */
5966
- _getAbsolutePageIndexFromPageIndex: (h) => Ps({
5965
+ _getAbsolutePageIndexFromPageIndex: (h) => xs({
5967
5966
  ...h,
5968
5967
  spineItemsManager: n
5969
5968
  }),
@@ -6004,7 +6003,7 @@ const Ps = ({
6004
6003
  }),
6005
6004
  getSpineItemFromIframe: c,
6006
6005
  getSpineItemPageIndexFromNode: u,
6007
- getVisibleSpineItemsFromPosition: (h) => Ts({
6006
+ getVisibleSpineItemsFromPosition: (h) => Fs({
6008
6007
  spineItemsManager: n,
6009
6008
  spineLayout: o,
6010
6009
  viewport: s,
@@ -6027,10 +6026,10 @@ const Ps = ({
6027
6026
  });
6028
6027
  }
6029
6028
  };
6030
- }, Ls = A.namespace("spine"), Ms = ({
6029
+ }, Ms = A.namespace("spine"), Cs = ({
6031
6030
  position: n,
6032
6031
  pageSize: e
6033
- }) => new Ii({
6032
+ }) => new bi({
6034
6033
  ...n,
6035
6034
  left: n.x,
6036
6035
  top: n.y,
@@ -6039,7 +6038,7 @@ const Ps = ({
6039
6038
  bottom: n.y + e.height,
6040
6039
  right: n.x + e.width
6041
6040
  });
6042
- class Cs extends Q {
6041
+ class Es extends Q {
6043
6042
  constructor(e, t, i, o, s, r) {
6044
6043
  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
6044
  (u) => u.itemIndex === a.index && u.pageIndex === c
@@ -6059,11 +6058,11 @@ class Cs extends Q {
6059
6058
  spineItemPosition: f
6060
6059
  });
6061
6060
  return {
6062
- absoluteLayout: Ms({
6061
+ absoluteLayout: Cs({
6063
6062
  pageSize: a,
6064
6063
  position: I
6065
6064
  }),
6066
- layout: new Si({
6065
+ layout: new Ii({
6067
6066
  left: f.x,
6068
6067
  right: f.x + a.width,
6069
6068
  top: f.y,
@@ -6108,12 +6107,12 @@ class Cs extends Q {
6108
6107
  })
6109
6108
  );
6110
6109
  }),
6111
- S((a) => (Ls.info("Pages layout", a), { pages: a })),
6110
+ S((a) => (Ms.info("Pages layout", a), { pages: a })),
6112
6111
  D()
6113
6112
  ), this.layout$.pipe(T(this.destroy$)).subscribe(this.next.bind(this));
6114
6113
  }
6115
6114
  }
6116
- class Es extends G {
6115
+ class Ds extends G {
6117
6116
  constructor(e) {
6118
6117
  super(), this.spineItemsManager = e, this.states$ = this.spineItemsManager.items$.pipe(
6119
6118
  w((t) => P(
@@ -6146,7 +6145,7 @@ class Es extends G {
6146
6145
  );
6147
6146
  }
6148
6147
  }
6149
- class Ds extends G {
6148
+ class As extends G {
6150
6149
  constructor(e, t, i, o, s) {
6151
6150
  super(), this.spineItemsManager = e, this.spineItemsObserver = t, this.context = i, this.settings = o, this.viewport = s, this.externalLayoutTrigger = new N(), this.spineItemsRelativeLayouts = [];
6152
6151
  const r = P(
@@ -6280,30 +6279,30 @@ class Ds extends G {
6280
6279
  });
6281
6280
  }
6282
6281
  }
6283
- class As extends G {
6282
+ class Ns extends G {
6284
6283
  constructor(e, t, i, o, s, r, a) {
6285
6284
  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
6285
  void 0
6287
- ), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new Es(i), this.spineLayout = new Ds(
6286
+ ), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new Ds(i), this.spineLayout = new As(
6288
6287
  i,
6289
6288
  this.spineItemsObserver,
6290
6289
  e,
6291
6290
  s,
6292
6291
  a
6293
- ), this.locator = Fs({
6292
+ ), this.locator = Ls({
6294
6293
  context: e,
6295
6294
  spineItemsManager: i,
6296
6295
  spineItemLocator: o,
6297
6296
  settings: s,
6298
6297
  spineLayout: this.spineLayout,
6299
6298
  viewport: a
6300
- }), this.spineItemsLoader = new bs(
6299
+ }), this.spineItemsLoader = new vs(
6301
6300
  this.context,
6302
6301
  i,
6303
6302
  this.locator,
6304
6303
  s,
6305
6304
  this.spineLayout
6306
- ), this.pages = new Cs(
6305
+ ), this.pages = new Es(
6307
6306
  this.spineLayout,
6308
6307
  this.spineItemsManager,
6309
6308
  this.spineItemLocator,
@@ -6359,7 +6358,7 @@ class As extends G {
6359
6358
  super.destroy(), this.pages.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue()?.remove(), this.elementSubject.complete();
6360
6359
  }
6361
6360
  }
6362
- class Ns extends G {
6361
+ class Rs extends G {
6363
6362
  constructor(e, t) {
6364
6363
  super(), this.context = e, this.settings = t, this.orderedSpineItemsSubject = new q([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
6365
6364
  }
@@ -6402,10 +6401,10 @@ class Ns extends G {
6402
6401
  });
6403
6402
  }
6404
6403
  }
6405
- class Rs extends Q {
6404
+ class Os extends Q {
6406
6405
  constructor(e, t) {
6407
6406
  const i = document.createElement("div");
6408
- i.setAttribute(`data-${oi}`, ""), super({
6407
+ i.setAttribute(`data-${si}`, ""), super({
6409
6408
  element: i,
6410
6409
  pageSize: {
6411
6410
  width: 1,
@@ -6445,7 +6444,7 @@ class Rs extends Q {
6445
6444
  });
6446
6445
  }
6447
6446
  get absoluteViewport() {
6448
- return new vs({
6447
+ return new ws({
6449
6448
  width: this.value.width,
6450
6449
  height: this.value.height
6451
6450
  });
@@ -6473,18 +6472,18 @@ class Rs extends Q {
6473
6472
  */
6474
6473
  get relativeViewport() {
6475
6474
  const e = this.absoluteViewport, t = this.scaleFactor;
6476
- return new ws({
6475
+ return new Ps({
6477
6476
  width: e.width / t,
6478
6477
  height: e.height / t
6479
6478
  });
6480
6479
  }
6481
6480
  }
6482
- const xt = `${Vt}-core`, Os = (n) => {
6483
- const e = crypto.randomUUID(), t = new N(), i = new N(), o = new Ao(), s = new Eo(), r = new fs(n, s), a = new Do(s, r), c = new Ns(s, r), u = new Rs(s, r), l = qt({
6481
+ const xt = `${Vt}-core`, Vs = (n) => {
6482
+ 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
6483
  context: s,
6485
6484
  settings: r,
6486
6485
  viewport: u
6487
- }), d = new ps(s, c), g = new As(
6486
+ }), d = new gs(s, c), g = new Ns(
6488
6487
  s,
6489
6488
  d,
6490
6489
  c,
@@ -6492,14 +6491,14 @@ const xt = `${Vt}-core`, Os = (n) => {
6492
6491
  r,
6493
6492
  o,
6494
6493
  u
6495
- ), p = ds({
6494
+ ), p = ps({
6496
6495
  context: s,
6497
6496
  spineItemsManager: c,
6498
6497
  hookManager: o,
6499
6498
  spine: g,
6500
6499
  settings: r,
6501
6500
  viewport: u
6502
- }), h = new gs(
6501
+ }), h = new hs(
6503
6502
  s,
6504
6503
  d,
6505
6504
  c,
@@ -6518,7 +6517,7 @@ const xt = `${Vt}-core`, Os = (n) => {
6518
6517
  return;
6519
6518
  }
6520
6519
  A.log("load", { options: $ });
6521
- const B = Vs(L, e);
6520
+ const B = js(L, e);
6522
6521
  s.update({
6523
6522
  manifest: H,
6524
6523
  rootElement: B
@@ -6530,7 +6529,7 @@ const xt = `${Vt}-core`, Os = (n) => {
6530
6529
  }),
6531
6530
  K(i)
6532
6531
  ), b = P(I, f).subscribe();
6533
- Ce(document, xt, No);
6532
+ Ce(document, xt, Ro);
6534
6533
  const F = () => {
6535
6534
  Ee(document, xt), 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
6535
  };
@@ -6540,7 +6539,7 @@ const xt = `${Vt}-core`, Os = (n) => {
6540
6539
  spine: g,
6541
6540
  hookManager: o,
6542
6541
  cfi: {
6543
- generateCfiFromRange: io,
6542
+ generateCfiFromRange: oo,
6544
6543
  parseCfi: it,
6545
6544
  generateCfiForSpineItemPage: He,
6546
6545
  resolveCfi: ($) => _t({ ...$, spineItemsManager: c })
@@ -6578,30 +6577,30 @@ const xt = `${Vt}-core`, Os = (n) => {
6578
6577
  destroy$: i
6579
6578
  }
6580
6579
  };
6581
- }, Vs = (n, e) => (n.style.cssText = `
6580
+ }, js = (n, e) => (n.style.cssText = `
6582
6581
  ${n.style.cssText}
6583
6582
  background-color: white;
6584
6583
  position: relative;
6585
- `, n.classList.add(`${W}-reader`), n.setAttribute(ii, e), n.setAttribute("data-prose-reader-container", e), n), Js = (
6584
+ `, n.classList.add(`${W}-reader`), n.setAttribute(oi, e), n.setAttribute("data-prose-reader-container", e), n), Ks = (
6586
6585
  //__
6587
- yo(
6588
- Gn(
6589
- bo(
6590
- qn(
6586
+ So(
6587
+ Zn(
6588
+ vo(
6589
+ Gn(
6591
6590
  Un(
6592
- po(
6593
- Io(
6594
- Mo(
6595
- Xi(
6596
- yi(
6597
- Ni(
6591
+ go(
6592
+ bo(
6593
+ Co(
6594
+ Yi(
6595
+ Si(
6596
+ Ri(
6598
6597
  zn(
6599
6598
  Bn(
6600
- co(
6601
- Di(
6602
- So(
6599
+ uo(
6600
+ Ai(
6601
+ Io(
6603
6602
  // __
6604
- Os
6603
+ Vs
6605
6604
  )
6606
6605
  )
6607
6606
  )
@@ -6618,79 +6617,80 @@ const xt = `${Vt}-core`, Os = (n) => {
6618
6617
  )
6619
6618
  )
6620
6619
  )
6621
- ), Ks = (n) => (e) => n(e);
6620
+ ), Qs = (n) => (e) => n(e);
6622
6621
  export {
6623
6622
  kt as AbstractSpinePosition,
6624
- Eo as Context,
6625
- jo as ControlledNavigationController,
6623
+ Do as Context,
6624
+ ko as ControlledNavigationController,
6626
6625
  G as DestroyableClass,
6627
6626
  ye as DocumentRenderer,
6628
- Do as Features,
6629
- ii as HTML_ATTRIBUTE_DATA_READER_ID,
6627
+ Ao as Features,
6628
+ oi as HTML_ATTRIBUTE_DATA_READER_ID,
6630
6629
  W as HTML_PREFIX,
6631
- si as HTML_PREFIX_SCROLL_NAVIGATOR,
6632
- oi as HTML_PREFIX_VIEWPORT,
6630
+ ri as HTML_PREFIX_SCROLL_NAVIGATOR,
6631
+ si as HTML_PREFIX_VIEWPORT,
6633
6632
  Vt as HTML_STYLE_PREFIX,
6634
- Ao as HookManager,
6635
- ni as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
6636
- Ko as InternalNavigator,
6633
+ No as HookManager,
6634
+ ii as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
6635
+ Qo as InternalNavigator,
6637
6636
  nt as LayoutEntry,
6638
6637
  Xt as Locker,
6639
- qs as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
6640
- Xs as PROSE_READER_NAMESPACE,
6641
- Cs as Pages,
6642
- ps as Pagination,
6643
- gs as PaginationController,
6638
+ Gs as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
6639
+ Ys as PROSE_READER_NAMESPACE,
6640
+ Es as Pages,
6641
+ gs as Pagination,
6642
+ hs as PaginationController,
6644
6643
  Q as ReactiveEntity,
6645
6644
  tt as ResourceHandler,
6646
- ao as ResourcesLocator,
6647
- $o as ScrollNavigationController,
6645
+ co as ResourcesLocator,
6646
+ To as ScrollNavigationController,
6648
6647
  mt as ScrollPosition,
6649
- ms as SettingsManager,
6650
- As as Spine,
6648
+ fs as SettingsManager,
6649
+ Ns as Spine,
6651
6650
  Zt as SpineItem,
6652
- Si as SpineItemPageLayout,
6653
- Ii as SpineItemPageSpineLayout,
6651
+ Ii as SpineItemPageLayout,
6652
+ bi as SpineItemPageSpineLayout,
6654
6653
  E as SpineItemPosition,
6655
6654
  Oe as SpineItemSpineLayout,
6656
- Ns as SpineItemsManager,
6657
- Es as SpineItemsObserver,
6655
+ Rs as SpineItemsManager,
6656
+ Ds as SpineItemsObserver,
6658
6657
  M as SpinePosition,
6659
- xo as UnboundScrollPosition,
6658
+ $o as UnboundScrollPosition,
6660
6659
  Re as UnboundSpineItemPagePosition,
6661
6660
  ae as UnboundSpinePosition,
6662
- Ys as VIEWPORT_ADJUSTMENT_THROTTLE,
6663
- Rs as Viewport,
6664
- ro as consolidate,
6665
- Js as createReader,
6661
+ qs as VIEWPORT_ADJUSTMENT_THROTTLE,
6662
+ Os as Viewport,
6663
+ ao as consolidate,
6664
+ Ks as createReader,
6666
6665
  at as deferIdle,
6667
- Xn as deferNextResult,
6666
+ Yn as deferNextResult,
6668
6667
  He as generateCfiForSpineItemPage,
6669
- io as generateCfiFromRange,
6668
+ oo as generateCfiFromRange,
6670
6669
  de as generateRootCfi,
6671
6670
  rt as getAttributeValueFromString,
6672
6671
  Hs as getBase64FromBlob,
6673
6672
  Je as getFrameViewportInfo,
6674
- Zs as getItemAnchor,
6675
- yi as htmlEnhancer,
6673
+ Js as getItemAnchor,
6674
+ Si as htmlEnhancer,
6676
6675
  et as idle,
6677
6676
  Vn as injectCSSToFrame,
6678
6677
  Z as isDefined,
6679
6678
  At as isHtmlElement,
6680
6679
  Rn as isHtmlTagElement,
6681
6680
  Be as isRootCfi,
6682
- tr as isShallowEqual,
6683
- Di as layoutEnhancer,
6681
+ nr as isShallowEqual,
6682
+ Ai as layoutEnhancer,
6684
6683
  Nt as mapKeysTo,
6685
- _s as observeIntersection,
6684
+ Bs as observeIntersection,
6686
6685
  ct as observeMutation,
6687
6686
  Qe as observeResize,
6688
- co as paginationEnhancer,
6687
+ uo as paginationEnhancer,
6689
6688
  it as parseCfi,
6690
- Ws as removeCSS,
6689
+ Xn as pick,
6690
+ _s as removeCSS,
6691
6691
  _t as resolveCfi,
6692
- Ks as rootEnhancer,
6693
- Ms as spinePositionToSpineItemSpineLayout,
6692
+ Qs as rootEnhancer,
6693
+ Cs as spinePositionToSpineItemSpineLayout,
6694
6694
  oe as upsertCSSToFrame,
6695
6695
  jn as waitForFrameLoad,
6696
6696
  kn as waitForFrameReady,