@prose-reader/core 1.215.0 → 1.216.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,32 +1,32 @@
1
- import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as K, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as R, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, forkJoin as Ke, delay as wt, ReplaySubject as Kt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Qt, reduce as Qe, concatMap as te } from "rxjs";
1
+ import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as K, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as R, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, forkJoin as Ke, delay as wt, ReplaySubject as Jt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Kt, reduce as Qe, concatMap as Qt } from "rxjs";
2
2
  import { Report as ti, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ei, parseContentType as ii, detectMimeTypeFromName as Lt, arrayEqual as ni } from "@prose-reader/shared";
3
- import { isShallowEqual as $s } from "@prose-reader/shared";
4
- import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as ee, withLatestFrom as ui } from "rxjs/operators";
5
- import { generate as Ie, parse as we, isParsedCfiRange as di, resolve as gi } from "@prose-reader/cfi";
6
- const ie = (e, t) => {
3
+ import { isShallowEqual as Ts } from "@prose-reader/shared";
4
+ import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as te, withLatestFrom as ui } from "rxjs/operators";
5
+ import { generate as Ie, parse as we, isParsedCfiRange as di, isIndirectionOnly as gi, resolve as li } from "@prose-reader/cfi";
6
+ const ee = (e, t) => {
7
7
  const i = new RegExp(`${t}\\s*=\\s*([0-9.]+)`, "i"), n = e.match(i) || [], o = n[1] || "0";
8
8
  return n && Number.parseFloat(o) || 0;
9
- }, li = (e, t, i, n) => {
9
+ }, pi = (e, t, i, n) => {
10
10
  var o;
11
11
  if ((o = e == null ? void 0 : e.contentDocument) != null && o.head) {
12
12
  const s = e.contentDocument.createElement("style");
13
13
  s.id = t, s.innerHTML = i, n ? e.contentDocument.head.prepend(s) : e.contentDocument.head.appendChild(s);
14
14
  }
15
- }, pi = (e, t) => {
15
+ }, hi = (e, t) => {
16
16
  var i;
17
17
  if ((i = e == null ? void 0 : e.contentDocument) != null && i.head) {
18
18
  const n = e.contentDocument.getElementById(t);
19
19
  n && n.remove();
20
20
  }
21
21
  }, ot = (e, t, i, n) => {
22
- e && (pi(e, t), li(e, t, i, n));
23
- }, _t = (e) => {
22
+ e && (hi(e, t), pi(e, t, i, n));
23
+ }, Bt = (e) => {
24
24
  if (e != null && e.contentDocument) {
25
25
  const i = e.contentDocument.querySelector("meta[name='viewport']");
26
26
  if (i) {
27
27
  const n = i.getAttribute("content");
28
28
  if (n) {
29
- const o = ie(n, "width"), s = ie(n, "height");
29
+ const o = ee(n, "width"), s = ee(n, "height");
30
30
  return o > 0 && s > 0 ? {
31
31
  hasViewport: !0,
32
32
  width: o,
@@ -36,7 +36,7 @@ const ie = (e, t) => {
36
36
  }
37
37
  }
38
38
  return { hasViewport: !1 };
39
- }, hi = (e) => e.pipe(
39
+ }, mi = (e) => e.pipe(
40
40
  v((t) => {
41
41
  var i;
42
42
  return t.src === "about:blank" && ((i = t.contentDocument) == null ? void 0 : i.readyState) === "complete" && t.contentDocument.body ? w(t) : G(t, "load").pipe(
@@ -44,7 +44,7 @@ const ie = (e, t) => {
44
44
  b(() => t)
45
45
  );
46
46
  })
47
- ), mi = (e) => e.pipe(
47
+ ), fi = (e) => e.pipe(
48
48
  v(
49
49
  (t) => {
50
50
  var i;
@@ -53,7 +53,7 @@ const ie = (e, t) => {
53
53
  );
54
54
  }
55
55
  )
56
- ), fi = (e) => (t) => {
56
+ ), yi = (e) => (t) => {
57
57
  const i = e(t), n = new IntersectionObserver((o) => {
58
58
  o.forEach((s) => {
59
59
  s.isIntersecting ? s.target.removeAttribute("tab-index") : s.target.setAttribute("tab-index", "-1");
@@ -89,7 +89,7 @@ const ie = (e, t) => {
89
89
  ), {
90
90
  ...i
91
91
  };
92
- }, yi = (e) => (t) => {
92
+ }, Si = (e) => (t) => {
93
93
  const i = e(t);
94
94
  return i.context.state$.pipe(F(i.$.destroy$)).subscribe(({ containerElement: n }) => {
95
95
  if (!n) return;
@@ -102,7 +102,7 @@ const ie = (e, t) => {
102
102
  const o = i.spineItemsManager.get(n), s = o == null ? void 0 : o.renderer.getDocumentFrame();
103
103
  s && ((r = s.contentDocument) == null || r.body.setAttribute("tabindex", "-1"));
104
104
  }), i;
105
- }, Si = "@prose-reader/core", j = ti.namespace(Si), bi = [
105
+ }, bi = "@prose-reader/core", j = ti.namespace(bi), Ii = [
106
106
  "pointercancel",
107
107
  "pointerdown",
108
108
  "pointerenter",
@@ -114,24 +114,24 @@ const ie = (e, t) => {
114
114
  // `touchstart` as const,
115
115
  // `touchend` as const,
116
116
  ], Pe = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE;
117
- function Ii(e, t, i) {
117
+ function wi(e, t, i) {
118
118
  if ("caretPositionFromPoint" in e)
119
119
  return e.caretPositionFromPoint(t, i);
120
120
  if ("caretRangeFromPoint" in e && // @ts-expect-error limited availability
121
121
  typeof e.caretRangeFromPoint < "u")
122
122
  return e.caretRangeFromPoint(t, i);
123
123
  }
124
- const wi = (e, t) => {
124
+ const Pi = (e, t) => {
125
125
  const i = "body" in e ? jt(e.body, t) : jt(e, t), n = "createRange" in e ? e : e.ownerDocument;
126
126
  if (i) {
127
127
  let o, s = 0;
128
128
  const r = n.createRange();
129
129
  return Array.from(i.childNodes).some((a) => {
130
130
  r.selectNodeContents(a);
131
- const c = r.getClientRects(), u = Pi(c, t);
131
+ const c = r.getClientRects(), u = vi(c, t);
132
132
  if (u) {
133
133
  o = r.cloneRange();
134
- const d = Ii(
134
+ const d = wi(
135
135
  n,
136
136
  Math.ceil(u.left),
137
137
  Math.ceil(u.top)
@@ -155,13 +155,13 @@ const wi = (e, t) => {
155
155
  function ve(e, { left: t, right: i }) {
156
156
  return e.left <= t && e.right <= t ? "before" : e.left <= t && e.right > t && e.right <= i ? "partially-before" : e.left <= i && e.right > i ? "partially-after" : e.left > i ? "after" : "within";
157
157
  }
158
- function Pi(e, t) {
158
+ function vi(e, t) {
159
159
  return Array.from(e).find((i) => {
160
160
  const n = ve(i, t);
161
161
  return n !== "before" && n !== "after";
162
162
  });
163
163
  }
164
- const vi = (e, t) => {
164
+ const xi = (e, t) => {
165
165
  var i;
166
166
  if (e.nodeType !== Node.CDATA_SECTION_NODE && e.nodeType !== Node.DOCUMENT_TYPE_NODE) {
167
167
  const n = (i = e.ownerDocument) == null ? void 0 : i.createRange();
@@ -173,7 +173,7 @@ const vi = (e, t) => {
173
173
  }
174
174
  return n;
175
175
  }
176
- }, Xt = (e) => {
176
+ }, _t = (e) => {
177
177
  var t, i, n, o, s;
178
178
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
179
179
  const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
@@ -185,10 +185,10 @@ const vi = (e, t) => {
185
185
  if (r.PointerEvent && e instanceof r.PointerEvent)
186
186
  return !0;
187
187
  }
188
- return !!bi.includes(e.type);
189
- }, xi = (e) => {
188
+ return !!Ii.includes(e.type);
189
+ }, $i = (e) => {
190
190
  var t, i, n, o, s;
191
- if (Xt(e)) return !1;
191
+ if (_t(e)) return !1;
192
192
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
193
193
  const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
194
194
  if (r.MouseEvent)
@@ -200,7 +200,7 @@ const vi = (e, t) => {
200
200
  return e instanceof r.MouseEvent;
201
201
  }
202
202
  return !1;
203
- }, $i = (e) => {
203
+ }, Ti = (e) => {
204
204
  var t, i, n, o, s;
205
205
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
206
206
  const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
@@ -213,7 +213,7 @@ const vi = (e, t) => {
213
213
  return e instanceof r.TouchEvent;
214
214
  }
215
215
  return !1;
216
- }, Ti = () => document.createElement("div"), xe = (e) => {
216
+ }, Fi = () => document.createElement("div"), xe = (e) => {
217
217
  const t = [
218
218
  "img",
219
219
  // Images
@@ -229,7 +229,7 @@ const vi = (e, t) => {
229
229
  // JavaScript files
230
230
  ].join(",");
231
231
  return Array.from((e == null ? void 0 : e.querySelectorAll(t)) || []);
232
- }, Fi = (e) => {
232
+ }, Li = (e) => {
233
233
  if (xe(e).forEach((i) => {
234
234
  var o;
235
235
  const n = i.getAttribute("src") || i.getAttribute("href");
@@ -249,7 +249,7 @@ const vi = (e, t) => {
249
249
  }
250
250
  }
251
251
  };
252
- function Li(e, t) {
252
+ function Mi(e, t) {
253
253
  return Pe(e) && e.tagName.toLowerCase() === t.toLowerCase();
254
254
  }
255
255
  const Rt = ({
@@ -261,13 +261,13 @@ const Rt = ({
261
261
  clientX: a,
262
262
  clientY: c
263
263
  };
264
- }, Mi = (e, t, i, n) => {
264
+ }, Ci = (e, t, i, n) => {
265
265
  var u;
266
266
  const o = (u = t == null ? void 0 : t.view) == null ? void 0 : u.frameElement;
267
267
  if (!t || !o) return e;
268
268
  const s = i.getSpineItemFromIframe(o), r = o, { height: a, width: c } = n.getPageSize();
269
269
  if (!s || !(r instanceof HTMLIFrameElement)) return e;
270
- if (Xt(e)) {
270
+ if (_t(e)) {
271
271
  const { clientX: d, clientY: g } = Rt({
272
272
  position: e,
273
273
  frameElement: r
@@ -282,7 +282,7 @@ const Rt = ({
282
282
  enumerable: !0
283
283
  }), l;
284
284
  }
285
- if (xi(e)) {
285
+ if ($i(e)) {
286
286
  const { clientX: d, clientY: g } = Rt({
287
287
  position: e,
288
288
  frameElement: r
@@ -296,7 +296,7 @@ const Rt = ({
296
296
  enumerable: !0
297
297
  }), l;
298
298
  }
299
- if ($i(e)) {
299
+ if (Ti(e)) {
300
300
  const d = Array.from(e.touches).map((l) => {
301
301
  const { clientX: p, clientY: h } = Rt({
302
302
  position: l,
@@ -319,7 +319,7 @@ const Rt = ({
319
319
  }), g;
320
320
  }
321
321
  return e;
322
- }, Ci = [
322
+ }, Ri = [
323
323
  "pointercancel",
324
324
  "pointerdown",
325
325
  "pointerenter",
@@ -328,23 +328,23 @@ const Rt = ({
328
328
  "pointerout",
329
329
  "pointerover",
330
330
  "pointerup"
331
- ], Ri = [
332
- ...Ci
331
+ ], Ai = [
332
+ ...Ri
333
333
  /*, ...mouseEvents*/
334
- ], Ai = (e) => (t) => {
334
+ ], Oi = (e) => (t) => {
335
335
  const i = e(t);
336
336
  return i.hookManager.register(
337
337
  "item.onDocumentLoad",
338
338
  ({ destroy: n, itemId: o }) => {
339
339
  const s = i.spineItemsManager.get(o), r = s == null ? void 0 : s.renderer.getDocumentFrame();
340
340
  if (!r || !s) return;
341
- const a = Ri.map((c) => {
341
+ const a = Ai.map((c) => {
342
342
  var d;
343
343
  const u = (g) => {
344
344
  var p;
345
345
  let l = g;
346
- if (Xt(g) && (l = new PointerEvent(g.type, g)), l !== g) {
347
- const h = Mi(
346
+ if (_t(g) && (l = new PointerEvent(g.type, g)), l !== g) {
347
+ const h = Ci(
348
348
  l,
349
349
  g,
350
350
  i.spine.locator,
@@ -371,7 +371,7 @@ const Rt = ({
371
371
  [n]: o
372
372
  } : i,
373
373
  {}
374
- )), qt = (e) => (t) => t.pipe($e(e), Z(N));
374
+ )), Xt = (e) => (t) => t.pipe($e(e), Z(N));
375
375
  function Te(e) {
376
376
  return new st((t) => {
377
377
  const i = new ResizeObserver((n) => {
@@ -389,7 +389,7 @@ const Ct = (e) => (t) => t.pipe(
389
389
  X(() => i)
390
390
  )
391
391
  )
392
- ), Oi = (e) => {
392
+ ), Di = (e) => {
393
393
  let t;
394
394
  const i = e.subscribe((n) => {
395
395
  t = { result: n };
@@ -410,16 +410,16 @@ function Fe() {
410
410
  return () => clearTimeout(t);
411
411
  });
412
412
  }
413
- function ne(e) {
413
+ function ie(e) {
414
414
  return Nt(() => Fe().pipe(_(e)));
415
415
  }
416
- const oe = (e, t) => new st((i) => {
416
+ const ne = (e, t) => new st((i) => {
417
417
  const n = new MutationObserver((o) => {
418
418
  i.next(o);
419
419
  });
420
420
  return n.observe(e, t), () => n.disconnect();
421
421
  });
422
- function bs(e, t) {
422
+ function Is(e, t) {
423
423
  return new st((i) => {
424
424
  const n = new IntersectionObserver((o) => {
425
425
  i.next(o);
@@ -468,7 +468,7 @@ class Le {
468
468
  };
469
469
  }
470
470
  watch(t) {
471
- return Array.isArray(t) ? this.values$.pipe(qt(t)) : this.values$.pipe(
471
+ return Array.isArray(t) ? this.values$.pipe(Xt(t)) : this.values$.pipe(
472
472
  X((i) => i[t]),
473
473
  Z(N)
474
474
  );
@@ -477,7 +477,7 @@ class Le {
477
477
  this.outputSettingsUpdateSubject.complete();
478
478
  }
479
479
  }
480
- const Di = (e) => {
480
+ const Ni = (e) => {
481
481
  const t = new FileReader();
482
482
  return new Promise((i) => {
483
483
  t.addEventListener(
@@ -489,7 +489,7 @@ const Di = (e) => {
489
489
  ), t.readAsDataURL(e);
490
490
  });
491
491
  };
492
- let Ni = class extends Le {
492
+ let Vi = class extends Le {
493
493
  computeOutputSettings(t) {
494
494
  return t;
495
495
  }
@@ -509,8 +509,8 @@ let Ni = class extends Le {
509
509
  };
510
510
  }
511
511
  };
512
- const Vi = (e) => (t) => {
513
- const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new Ni(
512
+ const ji = (e) => (t) => {
513
+ const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new Vi(
514
514
  {
515
515
  fontScale: i,
516
516
  lineHeight: n,
@@ -556,7 +556,7 @@ const Vi = (e) => (t) => {
556
556
  },
557
557
  settings: c
558
558
  };
559
- }, ji = (e) => (t) => {
559
+ }, ki = (e) => (t) => {
560
560
  const i = e(t), n = (o) => G(o, "keyup").pipe(
561
561
  D(i.settings.values$),
562
562
  b(([s, { pageTurnDirection: r }]) => {
@@ -590,7 +590,7 @@ const Vi = (e) => (t) => {
590
590
  ),
591
591
  F(i.$.destroy$)
592
592
  ).subscribe(), i;
593
- }, ki = (e) => e.spine.spineItemsManager.items$.pipe(
593
+ }, Wi = (e) => e.spine.spineItemsManager.items$.pipe(
594
594
  v(
595
595
  (t) => x(
596
596
  ...t.map((i) => i.loaded$.pipe(
@@ -752,7 +752,7 @@ const Ft = class Ft extends Y {
752
752
  if (t) return t;
753
753
  const i = this.getDocumentFrame();
754
754
  if (i) {
755
- const { hasViewport: o } = _t(i);
755
+ const { hasViewport: o } = Bt(i);
756
756
  if (o) return "pre-paginated";
757
757
  }
758
758
  return ((n = this.context.manifest) == null ? void 0 : n.renditionLayout) ?? "reflowable";
@@ -760,8 +760,8 @@ const Ft = class Ft extends Y {
760
760
  };
761
761
  Ft.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
762
762
  let ht = Ft;
763
- const Wi = (e) => new URL(e.href);
764
- class Yt {
763
+ const zi = (e) => new URL(e.href);
764
+ class qt {
765
765
  constructor(t, i) {
766
766
  this.item = t, this.settings = i;
767
767
  }
@@ -769,7 +769,7 @@ class Yt {
769
769
  var i, n;
770
770
  return await Ye(
771
771
  ((n = (i = this.settings.values).getResource) == null ? void 0 : n.call(i, this.item)) ?? w(void 0)
772
- ) ?? Wi(this.item);
772
+ ) ?? zi(this.item);
773
773
  }
774
774
  async fetchResource() {
775
775
  const t = await this.getResource();
@@ -779,7 +779,7 @@ class Yt {
779
779
  const Me = (e, t) => {
780
780
  const i = e.startsWith("file://"), n = i ? e.replace("file://", "http://") : e, o = new URL(t, n).toString();
781
781
  return i ? o.replace("http://", "file://") : o;
782
- }, zi = async (e, t, i, n, o) => {
782
+ }, Ui = async (e, t, i, n, o) => {
783
783
  if (!e || !e.defaultView) return;
784
784
  const s = t.sheet;
785
785
  if (s)
@@ -801,7 +801,7 @@ const Me = (e, t) => {
801
801
  `${P.toLowerCase()}`
802
802
  ));
803
803
  if (f) {
804
- const P = new Yt(f, o);
804
+ const P = new qt(f, o);
805
805
  try {
806
806
  const $ = await P.getResource();
807
807
  if ($ instanceof Response) {
@@ -828,7 +828,7 @@ const Me = (e, t) => {
828
828
  } catch (r) {
829
829
  console.error("Could not access stylesheet rules:", r);
830
830
  }
831
- }, Ui = (e, t, i, n, o) => {
831
+ }, Hi = (e, t, i, n, o) => {
832
832
  var c;
833
833
  const s = t.getAttribute("src") || t.getAttribute("href");
834
834
  if (!s) return w(null);
@@ -836,7 +836,7 @@ const Me = (e, t) => {
836
836
  `${u.toLowerCase()}`
837
837
  ));
838
838
  if (!r) return w(null);
839
- const a = new Yt(r, o);
839
+ const a = new qt(r, o);
840
840
  return W(a.getResource()).pipe(
841
841
  $t(
842
842
  (u) => u instanceof Response ? W(u.blob()) : w(void 0)
@@ -852,7 +852,7 @@ const Me = (e, t) => {
852
852
  return new st((l) => {
853
853
  t.onload = async () => {
854
854
  try {
855
- t.sheet && await zi(
855
+ t.sheet && await Ui(
856
856
  e,
857
857
  t,
858
858
  i,
@@ -867,7 +867,7 @@ const Me = (e, t) => {
867
867
  return w(null);
868
868
  })
869
869
  );
870
- }, Hi = ({
870
+ }, Ei = ({
871
871
  settings: e,
872
872
  item: t,
873
873
  context: i
@@ -876,7 +876,7 @@ const Me = (e, t) => {
876
876
  const s = xe(
877
877
  o.contentDocument
878
878
  ), r = ei(t.href), a = s.map(
879
- (c) => Ui(
879
+ (c) => Hi(
880
880
  o.contentDocument,
881
881
  c,
882
882
  r,
@@ -886,20 +886,20 @@ const Me = (e, t) => {
886
886
  );
887
887
  return q(a).pipe(b(() => o));
888
888
  })
889
- ), Ei = (e) => {
890
- Fi(e == null ? void 0 : e.contentDocument);
891
- }, Bi = [".xhtml", ".html", ".htm"], lt = "prose-reader", _i = (e) => new Promise((t, i) => {
889
+ ), Bi = (e) => {
890
+ Li(e == null ? void 0 : e.contentDocument);
891
+ }, _i = [".xhtml", ".html", ".htm"], lt = "prose-reader", Xi = (e) => new Promise((t, i) => {
892
892
  const n = new Image();
893
893
  n.src = e, n.onload = () => {
894
894
  t({ height: n.naturalHeight, width: n.naturalWidth });
895
895
  }, n.onerror = i;
896
- }), Xi = async (e, t) => {
896
+ }), qi = async (e, t) => {
897
897
  if (typeof e == "string") return e;
898
898
  const i = ii(e.headers.get("Content-Type") || "") || Lt(t.href);
899
899
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
900
900
  (o) => o === i
901
901
  )) {
902
- const o = await Di(await e.blob()), { height: s, width: r } = await _i(o);
902
+ const o = await Ni(await e.blob()), { height: s, width: r } = await Xi(o);
903
903
  return `
904
904
  <html>
905
905
  <head>
@@ -931,11 +931,11 @@ const Me = (e, t) => {
931
931
  </body>
932
932
  </html>
933
933
  ` : await e.text();
934
- }, qi = ({
934
+ }, Yi = ({
935
935
  item: e,
936
936
  resourcesHandler: t
937
937
  }) => {
938
- const i = (n) => Xi(n, e);
938
+ const i = (n) => qi(n, e);
939
939
  return (n) => n.pipe(
940
940
  v((o) => W(t.getResource()).pipe(
941
941
  v((s) => s instanceof URL && e.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
@@ -945,7 +945,7 @@ const Me = (e, t) => {
945
945
  "text/html",
946
946
  "text/xml"
947
947
  ].includes(e.mediaType) || // no encoding ? then try to detect html
948
- !e.mediaType && Bi.some(
948
+ !e.mediaType && _i.some(
949
949
  (a) => e.href.endsWith(a)
950
950
  )) ? (o == null || o.setAttribute("src", e.href), w(o)) : (s instanceof URL ? W(t.fetchResource()) : s instanceof Response ? w(s) : K).pipe(
951
951
  R((a) => a instanceof Response),
@@ -963,7 +963,7 @@ const Me = (e, t) => {
963
963
  ))
964
964
  ))
965
965
  );
966
- }, Yi = () => {
966
+ }, Zi = () => {
967
967
  const e = document.createElement("iframe");
968
968
  return e.frameBorder = "no", e.tabIndex = 0, e.setAttribute(
969
969
  "sandbox",
@@ -988,7 +988,7 @@ const Me = (e, t) => {
988
988
  pageWidth: t,
989
989
  frameElement: i
990
990
  }) => {
991
- const n = _t(i);
991
+ const n = Bt(i);
992
992
  if (i != null && i.contentDocument && i.contentWindow && n) {
993
993
  const o = t / (n.width ?? 1);
994
994
  return { computedScale: Math.min(
@@ -996,7 +996,7 @@ const Me = (e, t) => {
996
996
  e / (n.height ?? 1)
997
997
  ), computedWidthScale: o, viewportDimensions: n };
998
998
  }
999
- }, Zi = ({
999
+ }, Gi = ({
1000
1000
  columnWidth: e,
1001
1001
  enableTouch: t,
1002
1002
  spreadPosition: i
@@ -1041,12 +1041,12 @@ const Me = (e, t) => {
1041
1041
  object-fit:contain;
1042
1042
  `}
1043
1043
  }
1044
- `, Gi = ({
1044
+ `, Ji = ({
1045
1045
  pageHeight: e,
1046
1046
  pageWidth: t
1047
- }) => ({ columnHeight: e, columnWidth: t }), se = (e, t) => {
1047
+ }) => ({ columnHeight: e, columnWidth: t }), oe = (e, t) => {
1048
1048
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1049
- }, Ji = ({
1049
+ }, Ki = ({
1050
1050
  minPageSpread: e,
1051
1051
  blankPagePosition: t,
1052
1052
  spreadPosition: i,
@@ -1058,18 +1058,18 @@ const Me = (e, t) => {
1058
1058
  }) => {
1059
1059
  const c = e * o;
1060
1060
  if (s != null && s.contentDocument && (s != null && s.contentWindow)) {
1061
- const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Zi(
1061
+ const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Gi(
1062
1062
  {
1063
- ...Gi({ pageHeight: n, pageWidth: o }),
1063
+ ...Ji({ pageHeight: n, pageWidth: o }),
1064
1064
  enableTouch: a,
1065
1065
  spreadPosition: i
1066
1066
  },
1067
1067
  u
1068
1068
  );
1069
- if (ot(s, "prose-reader-css", p), u ? se(s, {
1069
+ if (ot(s, "prose-reader-css", p), u ? oe(s, {
1070
1070
  width: u.width ?? 1,
1071
1071
  height: u.height ?? 1
1072
- }) : se(s, {
1072
+ }) : oe(s, {
1073
1073
  width: g,
1074
1074
  height: l
1075
1075
  }), u) {
@@ -1090,7 +1090,7 @@ const Me = (e, t) => {
1090
1090
  return { width: c, height: l };
1091
1091
  }
1092
1092
  return { width: c, height: n };
1093
- }, Ki = () => `
1093
+ }, Qi = () => `
1094
1094
  ${Ce()}
1095
1095
  html {
1096
1096
  width: 100%;
@@ -1105,7 +1105,7 @@ const Me = (e, t) => {
1105
1105
  html, body {
1106
1106
  touch-action: none;
1107
1107
  }
1108
- `, Qi = ({
1108
+ `, tn = ({
1109
1109
  isScrollable: e,
1110
1110
  enableTouch: t
1111
1111
  }) => `
@@ -1130,7 +1130,7 @@ const Me = (e, t) => {
1130
1130
  display: block;
1131
1131
  }
1132
1132
  ` : ""}
1133
- `, tn = ({
1133
+ `, en = ({
1134
1134
  width: e,
1135
1135
  columnHeight: t,
1136
1136
  columnWidth: i
@@ -1198,7 +1198,7 @@ const Me = (e, t) => {
1198
1198
  td {
1199
1199
  max-width: ${i}px;
1200
1200
  }
1201
- `, en = ({
1201
+ `, nn = ({
1202
1202
  isUsingVerticalWriting: e,
1203
1203
  minimumWidth: t,
1204
1204
  pageHeight: i,
@@ -1214,7 +1214,7 @@ const Me = (e, t) => {
1214
1214
  };
1215
1215
  }, It = (e, t) => {
1216
1216
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1217
- }, nn = ({
1217
+ }, on = ({
1218
1218
  pageHeight: e,
1219
1219
  pageWidth: t,
1220
1220
  frameElement: i,
@@ -1242,7 +1242,7 @@ const Me = (e, t) => {
1242
1242
  ot(
1243
1243
  i,
1244
1244
  "prose-reader-html-renderer-framce-css",
1245
- Ki()
1245
+ Qi()
1246
1246
  ), It(i, {
1247
1247
  width: m.width ?? 1,
1248
1248
  height: m.height ?? 1
@@ -1254,11 +1254,11 @@ const Me = (e, t) => {
1254
1254
  `translate(-50%, -50%) scale(${S})`
1255
1255
  ), i == null || i.style.setProperty("transform-origin", "center center");
1256
1256
  else {
1257
- const L = c ? Qi({
1257
+ const L = c ? tn({
1258
1258
  isScrollable: (n == null ? void 0 : n.renditionFlow) === "scrolled-continuous",
1259
1259
  enableTouch: u
1260
- }) : tn(
1261
- en({
1260
+ }) : en(
1261
+ nn({
1262
1262
  isUsingVerticalWriting: d,
1263
1263
  minimumWidth: g,
1264
1264
  pageHeight: h,
@@ -1295,7 +1295,7 @@ const Me = (e, t) => {
1295
1295
  latestContentHeightWhenLoaded: l
1296
1296
  };
1297
1297
  };
1298
- class on extends ht {
1298
+ class sn extends ht {
1299
1299
  constructor() {
1300
1300
  super(...arguments), this.isImageType = () => {
1301
1301
  const t = this.item.mediaType ?? Lt(this.item.href);
@@ -1303,14 +1303,14 @@ class on extends ht {
1303
1303
  };
1304
1304
  }
1305
1305
  onCreateDocument() {
1306
- const t = Yi();
1306
+ const t = Zi();
1307
1307
  return this.setDocumentContainer(t), w(t);
1308
1308
  }
1309
1309
  onLoadDocument() {
1310
1310
  const t = this.getFrameElement();
1311
1311
  if (!t) throw new Error("invalid frame");
1312
1312
  return w(t).pipe(
1313
- qi({
1313
+ Yi({
1314
1314
  item: this.item,
1315
1315
  resourcesHandler: this.resourcesHandler,
1316
1316
  settings: this.settings
@@ -1319,17 +1319,17 @@ class on extends ht {
1319
1319
  T(() => {
1320
1320
  this.attach();
1321
1321
  }),
1322
- hi,
1323
- Hi({
1322
+ mi,
1323
+ Ei({
1324
1324
  context: this.context,
1325
1325
  item: this.item,
1326
1326
  settings: this.settings
1327
1327
  }),
1328
- mi
1328
+ fi
1329
1329
  );
1330
1330
  }
1331
1331
  onUnload() {
1332
- return Ei(this.getFrameElement()), this.detach(), K;
1332
+ return Bi(this.getFrameElement()), this.detach(), K;
1333
1333
  }
1334
1334
  onLayout({
1335
1335
  minPageSpread: t,
@@ -1341,7 +1341,7 @@ class on extends ht {
1341
1341
  if (!r) return w(void 0);
1342
1342
  const a = !!((d = this.writingMode) != null && d.startsWith("vertical"));
1343
1343
  if (this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && ((g = this.context.manifest) == null ? void 0 : g.renditionLayout) === "pre-paginated") {
1344
- const l = Ji({
1344
+ const l = Ki({
1345
1345
  blankPagePosition: i,
1346
1346
  enableTouch: this.settings.values.computedPageTurnMode !== "scrollable",
1347
1347
  frameElement: r,
@@ -1353,7 +1353,7 @@ class on extends ht {
1353
1353
  });
1354
1354
  return w(l);
1355
1355
  }
1356
- const { latestContentHeightWhenLoaded: c, ...u } = nn({
1356
+ const { latestContentHeightWhenLoaded: c, ...u } = on({
1357
1357
  pageHeight: s,
1358
1358
  pageWidth: o,
1359
1359
  frameElement: r,
@@ -1425,14 +1425,14 @@ class on extends ht {
1425
1425
  return this.getFrameElement();
1426
1426
  }
1427
1427
  }
1428
- const sn = (e) => (t) => {
1428
+ const rn = (e) => (t) => {
1429
1429
  const i = e({
1430
1430
  ...t,
1431
1431
  getRenderer(o) {
1432
1432
  var r;
1433
- return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new on(a));
1433
+ return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new sn(a));
1434
1434
  }
1435
- }), n = ki(i);
1435
+ }), n = Wi(i);
1436
1436
  return n.pipe(F(i.$.destroy$)).subscribe(), {
1437
1437
  ...i,
1438
1438
  links$: n
@@ -1441,7 +1441,7 @@ const sn = (e) => (t) => {
1441
1441
  function ct(e) {
1442
1442
  return e != null;
1443
1443
  }
1444
- let rn = class extends Le {
1444
+ let an = class extends Le {
1445
1445
  computeOutputSettings(t) {
1446
1446
  return t;
1447
1447
  }
@@ -1469,7 +1469,7 @@ let rn = class extends Le {
1469
1469
  };
1470
1470
  }
1471
1471
  };
1472
- const an = (e) => {
1472
+ const cn = (e) => {
1473
1473
  let t;
1474
1474
  const i = e.context.state$.pipe(
1475
1475
  _(({ containerElement: c }) => c ? new st(() => (t = c.ownerDocument.createElement("div"), t.style.cssText = `
@@ -1508,14 +1508,14 @@ const an = (e) => {
1508
1508
  J(e.$.destroy$)
1509
1509
  );
1510
1510
  return x(i, a);
1511
- }, cn = (e) => {
1511
+ }, un = (e) => {
1512
1512
  e.hookManager.register(
1513
1513
  "item.onAfterLayout",
1514
1514
  ({ item: t, blankPagePosition: i, minimumWidth: n }) => {
1515
1515
  const o = e.spineItemsManager.get(t.id), s = o == null ? void 0 : o.renderer.getDocumentFrame();
1516
1516
  if ((o == null ? void 0 : o.renditionLayout) !== "reflowable" || !(s instanceof HTMLIFrameElement))
1517
1517
  return;
1518
- const { hasViewport: r } = _t(s), { width: a } = e.context.getPageSize(), c = o == null ? void 0 : o.renderer.getDocumentFrame();
1518
+ const { hasViewport: r } = Bt(s), { width: a } = e.context.getPageSize(), c = o == null ? void 0 : o.renderer.getDocumentFrame();
1519
1519
  if (r) {
1520
1520
  const u = a < n;
1521
1521
  i === "none" && u && c instanceof HTMLIFrameElement && (c == null || c.style.setProperty(
@@ -1536,7 +1536,7 @@ class kt extends Ae {
1536
1536
  super(...arguments), this.__symbol = "SpineItemSpineLayout";
1537
1537
  }
1538
1538
  }
1539
- class un extends Ae {
1539
+ class dn extends Ae {
1540
1540
  constructor() {
1541
1541
  super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
1542
1542
  }
@@ -1546,18 +1546,18 @@ class M {
1546
1546
  this.__symbol = "SpinePosition", this.x = t.x, this.y = t.y;
1547
1547
  }
1548
1548
  }
1549
- class Zt {
1549
+ class Yt {
1550
1550
  constructor(t) {
1551
1551
  this.__symbol = "UnsafeSpinePosition", this.x = t.x, this.y = t.y;
1552
1552
  }
1553
1553
  static from(t) {
1554
- return new Zt(t);
1554
+ return new Yt(t);
1555
1555
  }
1556
1556
  }
1557
- const dn = ({
1557
+ const gn = ({
1558
1558
  position: e,
1559
1559
  pageSize: t
1560
- }) => new un({
1560
+ }) => new dn({
1561
1561
  x: e.x,
1562
1562
  y: e.y,
1563
1563
  left: e.x,
@@ -1566,7 +1566,7 @@ const dn = ({
1566
1566
  height: t.height,
1567
1567
  bottom: e.y + t.height,
1568
1568
  right: e.x + t.width
1569
- }), gn = (e) => {
1569
+ }), ln = (e) => {
1570
1570
  const t = e.spine.spineLayout.layout$.pipe(
1571
1571
  b(() => ({
1572
1572
  pages: e.spine.spineItemsManager.items.reduce((s, r, a) => {
@@ -1578,7 +1578,7 @@ const dn = ({
1578
1578
  spineItem: r,
1579
1579
  spineItemPosition: p
1580
1580
  });
1581
- return dn({
1581
+ return gn({
1582
1582
  pageSize: e.context.getPageSize(),
1583
1583
  position: h
1584
1584
  });
@@ -1596,17 +1596,17 @@ const dn = ({
1596
1596
  V()
1597
1597
  ), i = t.pipe(et({ refCount: !0, bufferSize: 1 }));
1598
1598
  return i.pipe(F(e.$.destroy$)).subscribe(), { layout$: t, info$: i };
1599
- }, ln = (e, t) => t.pipe(
1599
+ }, pn = (e, t) => t.pipe(
1600
1600
  T((i) => {
1601
1601
  e.viewport.value.element.style.transition = "transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275)", e.settings.values.computedPageTurnMode === "scrollable" ? e.viewport.value.element.style.transformOrigin = "top" : e.viewport.value.element.style.transformOrigin = "center", i === "thumbnails" ? e.viewport.value.element.style.transform = "scale(0.5)" : e.viewport.value.element.style.transform = "scale(1)", e.layout();
1602
1602
  })
1603
- ), pn = (e) => (t) => {
1603
+ ), hn = (e) => (t) => {
1604
1604
  const {
1605
1605
  pageHorizontalMargin: i,
1606
1606
  pageVerticalMargin: n,
1607
1607
  layoutAutoResize: o,
1608
1608
  layoutLayerTransition: s
1609
- } = t, r = e(t), a = new rn(
1609
+ } = t, r = e(t), a = new an(
1610
1610
  {
1611
1611
  pageHorizontalMargin: i,
1612
1612
  pageVerticalMargin: n,
@@ -1653,7 +1653,7 @@ const dn = ({
1653
1653
  `
1654
1654
  );
1655
1655
  }
1656
- }), cn(r), r.hookManager.register(
1656
+ }), un(r), r.hookManager.register(
1657
1657
  "item.onDocumentCreated",
1658
1658
  ({ documentContainer: S }) => {
1659
1659
  S.style.opacity = "0", a.values.layoutLayerTransition && (S.style.transition = "opacity 300ms");
@@ -1684,7 +1684,7 @@ const dn = ({
1684
1684
  z(() => {
1685
1685
  r == null || r.layout();
1686
1686
  })
1687
- ), g = an(r);
1687
+ ), g = cn(r);
1688
1688
  a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
1689
1689
  ai(1),
1690
1690
  z(() => {
@@ -1697,7 +1697,7 @@ const dn = ({
1697
1697
  const y = "prose-spineItem-ready";
1698
1698
  f ? S.containerElement.classList.add(y) : S.containerElement.classList.remove(y);
1699
1699
  })
1700
- ), { layout$: p, info$: h } = gn(r), m = ln(
1700
+ ), { layout$: p, info$: h } = ln(r), m = pn(
1701
1701
  r,
1702
1702
  a.watch("viewportMode")
1703
1703
  );
@@ -1716,7 +1716,7 @@ const dn = ({
1716
1716
  layout$: p,
1717
1717
  layoutInfo$: h
1718
1718
  };
1719
- }, hn = `${lt}-enhancer-loading`, Oe = `${hn}-container`, mn = (e, t) => {
1719
+ }, mn = `${lt}-enhancer-loading`, Oe = `${mn}-container`, fn = (e, t) => {
1720
1720
  const i = e.ownerDocument.createElement("div");
1721
1721
  return i.classList.add(Oe), i.style.cssText = `
1722
1722
  height: 100%;
@@ -1734,7 +1734,7 @@ const dn = ({
1734
1734
  background-color: white;
1735
1735
  z-index: 1;
1736
1736
  `, i;
1737
- }, fn = ({
1737
+ }, yn = ({
1738
1738
  container: e,
1739
1739
  item: t
1740
1740
  }) => {
@@ -1751,8 +1751,8 @@ const dn = ({
1751
1751
  max-width: 300px;
1752
1752
  width: 80%;
1753
1753
  `, e.appendChild(i), e.appendChild(n), e;
1754
- }, yn = (e) => (t) => {
1755
- const { loadingElementCreate: i = fn } = t, n = e(t), o = (c) => w(
1754
+ }, Sn = (e) => (t) => {
1755
+ const { loadingElementCreate: i = yn } = t, n = e(t), o = (c) => w(
1756
1756
  c.reduce((u, { item: d, element: g }) => {
1757
1757
  g.style.zIndex = "0";
1758
1758
  const l = g.querySelector(
@@ -1761,7 +1761,7 @@ const dn = ({
1761
1761
  if (l instanceof HTMLElement)
1762
1762
  return u[d.id] = l, u;
1763
1763
  const p = i({
1764
- container: mn(g, n.context),
1764
+ container: fn(g, n.context),
1765
1765
  item: d
1766
1766
  });
1767
1767
  return g.appendChild(p), u[d.id] = p, u;
@@ -1816,7 +1816,7 @@ const dn = ({
1816
1816
  }
1817
1817
  };
1818
1818
  };
1819
- class Sn extends ht {
1819
+ class bn extends ht {
1820
1820
  getImageElement() {
1821
1821
  const t = this.documentContainer;
1822
1822
  if (t instanceof HTMLImageElement)
@@ -1868,13 +1868,13 @@ class Sn extends ht {
1868
1868
  getDocumentFrame() {
1869
1869
  }
1870
1870
  }
1871
- const bn = (e) => (t) => {
1871
+ const In = (e) => (t) => {
1872
1872
  const i = e({
1873
1873
  ...t,
1874
1874
  getRenderer(r) {
1875
1875
  var d;
1876
1876
  const a = (d = t.getRenderer) == null ? void 0 : d.call(t, r), c = r.mediaType ?? Lt(r.href), u = !!(c != null && c.startsWith("image/"));
1877
- return !a && u ? (g) => new Sn(g) : a;
1877
+ return !a && u ? (g) => new bn(g) : a;
1878
1878
  }
1879
1879
  }), n = new IntersectionObserver(
1880
1880
  (r) => {
@@ -1924,10 +1924,10 @@ const bn = (e) => (t) => {
1924
1924
  n.disconnect(), o.disconnect(), i.destroy();
1925
1925
  }
1926
1926
  };
1927
- }, In = (e, t) => e.links$.pipe(
1927
+ }, wn = (e, t) => e.links$.pipe(
1928
1928
  T((i) => {
1929
1929
  var r;
1930
- if (!Li(i.target, "a") || i.type !== "click") return;
1930
+ if (!Mi(i.target, "a") || i.type !== "click") return;
1931
1931
  const n = new URL(i.target.href), o = `${n.origin}${n.pathname}`;
1932
1932
  ((r = e.context.manifest) == null ? void 0 : r.spineItems.some(
1933
1933
  (a) => a.href === o
@@ -1939,7 +1939,7 @@ class A {
1939
1939
  this.__symbol = Symbol("SpineItemPosition"), this.x = t.x, this.y = t.y;
1940
1940
  }
1941
1941
  }
1942
- const wn = ({
1942
+ const Pn = ({
1943
1943
  position: e,
1944
1944
  spineItem: t,
1945
1945
  pageHeight: i,
@@ -1957,7 +1957,7 @@ const wn = ({
1957
1957
  s,
1958
1958
  t
1959
1959
  );
1960
- }, re = ({
1960
+ }, se = ({
1961
1961
  position: e,
1962
1962
  navigationResolver: t,
1963
1963
  computedPageTurnDirection: i,
@@ -1971,7 +1971,7 @@ const wn = ({
1971
1971
  const u = o.getSpineItemPositionFromSpinePosition(
1972
1972
  e,
1973
1973
  a
1974
- ), d = wn({
1974
+ ), d = Pn({
1975
1975
  position: u,
1976
1976
  spineItem: a,
1977
1977
  pageHeight: s.getPageSize().height,
@@ -1993,7 +1993,7 @@ const wn = ({
1993
1993
  x: 0
1994
1994
  })
1995
1995
  );
1996
- }, Pn = ({
1996
+ }, vn = ({
1997
1997
  position: e,
1998
1998
  spineItem: t,
1999
1999
  context: i,
@@ -2002,7 +2002,7 @@ const wn = ({
2002
2002
  spineLocator: s,
2003
2003
  computedPageTurnDirection: r
2004
2004
  }) => {
2005
- const a = re({
2005
+ const a = se({
2006
2006
  position: e,
2007
2007
  context: i,
2008
2008
  navigationResolver: n,
@@ -2024,7 +2024,7 @@ const wn = ({
2024
2024
  );
2025
2025
  if (r === "vertical" && e.y !== a.y)
2026
2026
  return n.getAdjustedPositionForSpread(a);
2027
- const c = re({
2027
+ const c = se({
2028
2028
  position: a,
2029
2029
  context: i,
2030
2030
  navigationResolver: n,
@@ -2035,7 +2035,7 @@ const wn = ({
2035
2035
  return n.getAdjustedPositionForSpread(c);
2036
2036
  }
2037
2037
  return n.getAdjustedPositionForSpread(a);
2038
- }, vn = ({
2038
+ }, xn = ({
2039
2039
  position: e,
2040
2040
  spineItem: t,
2041
2041
  pageHeight: i,
@@ -2053,7 +2053,7 @@ const wn = ({
2053
2053
  s,
2054
2054
  t
2055
2055
  );
2056
- }, ae = ({
2056
+ }, re = ({
2057
2057
  position: e,
2058
2058
  navigationResolver: t,
2059
2059
  computedPageTurnDirection: i,
@@ -2067,7 +2067,7 @@ const wn = ({
2067
2067
  const u = o.getSpineItemPositionFromSpinePosition(
2068
2068
  e,
2069
2069
  a
2070
- ), d = vn({
2070
+ ), d = xn({
2071
2071
  position: u,
2072
2072
  spineItem: a,
2073
2073
  pageHeight: s.getPageSize().height,
@@ -2089,7 +2089,7 @@ const wn = ({
2089
2089
  x: 0
2090
2090
  })
2091
2091
  );
2092
- }, xn = ({
2092
+ }, $n = ({
2093
2093
  position: e,
2094
2094
  spineItem: t,
2095
2095
  context: i,
@@ -2098,7 +2098,7 @@ const wn = ({
2098
2098
  spineLocator: s,
2099
2099
  computedPageTurnDirection: r
2100
2100
  }) => {
2101
- const a = ae({
2101
+ const a = re({
2102
2102
  position: e,
2103
2103
  context: i,
2104
2104
  navigationResolver: n,
@@ -2123,7 +2123,7 @@ const wn = ({
2123
2123
  );
2124
2124
  if (r === "vertical" && e.y !== a.y)
2125
2125
  return n.getAdjustedPositionForSpread(a);
2126
- const c = ae({
2126
+ const c = re({
2127
2127
  position: a,
2128
2128
  context: i,
2129
2129
  navigationResolver: n,
@@ -2135,7 +2135,7 @@ const wn = ({
2135
2135
  }
2136
2136
  return n.getAdjustedPositionForSpread(a);
2137
2137
  };
2138
- class $n {
2138
+ class Tn {
2139
2139
  constructor(t) {
2140
2140
  this.reader = t, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2141
2141
  }
@@ -2154,7 +2154,7 @@ class $n {
2154
2154
  turnRightOrBottom() {
2155
2155
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2156
2156
  if (!i) return;
2157
- const n = xn({
2157
+ const n = $n({
2158
2158
  context: this.reader.context,
2159
2159
  navigationResolver: this.reader.navigation.navigationResolver,
2160
2160
  position: t.position,
@@ -2170,7 +2170,7 @@ class $n {
2170
2170
  turnLeftOrTop() {
2171
2171
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2172
2172
  if (!i) return;
2173
- const n = Pn({
2173
+ const n = vn({
2174
2174
  context: this.reader.context,
2175
2175
  navigationResolver: this.reader.navigation.navigationResolver,
2176
2176
  position: t.position,
@@ -2312,7 +2312,7 @@ class $n {
2312
2312
  }
2313
2313
  }
2314
2314
  }
2315
- class Tn {
2315
+ class Fn {
2316
2316
  constructor(t) {
2317
2317
  this.reader = t, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2318
2318
  }
@@ -2352,7 +2352,7 @@ class Tn {
2352
2352
  });
2353
2353
  }
2354
2354
  }
2355
- const Fn = (e) => e.pagination.state$.pipe(
2355
+ const Ln = (e) => e.pagination.state$.pipe(
2356
2356
  D(e.context.manifest$, e.settings.values$),
2357
2357
  b(
2358
2358
  ([
@@ -2372,7 +2372,7 @@ const Fn = (e) => e.pagination.state$.pipe(
2372
2372
  }
2373
2373
  ),
2374
2374
  E(N)
2375
- ), Ln = ({ reader: e, duration: t }) => (i) => {
2375
+ ), Mn = ({ reader: e, duration: t }) => (i) => {
2376
2376
  let n;
2377
2377
  const o = () => {
2378
2378
  n == null || n(), n = void 0;
@@ -2388,18 +2388,18 @@ const Fn = (e) => e.pagination.state$.pipe(
2388
2388
  T(o),
2389
2389
  ut(o)
2390
2390
  );
2391
- }, Mn = (e) => (t) => {
2392
- const i = e(t), n = Fn(i), o = new $n(i), s = new Tn(i), r = (c) => {
2391
+ }, Cn = (e) => (t) => {
2392
+ const i = e(t), n = Ln(i), o = new Tn(i), s = new Fn(i), r = (c) => {
2393
2393
  const { cfi: u, ...d } = c;
2394
2394
  i.load(d), u && o.goToCfi(u, { animate: !1 });
2395
2395
  };
2396
- return In(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2396
+ return wn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2397
2397
  ...i,
2398
2398
  load: r,
2399
2399
  navigation: {
2400
2400
  ...i.navigation,
2401
2401
  state$: n,
2402
- throttleLock: ({ duration: c, trigger: u }) => u.pipe(Ln({ duration: c, reader: i })),
2402
+ throttleLock: ({ duration: c, trigger: u }) => u.pipe(Mn({ duration: c, reader: i })),
2403
2403
  moveTo: s.moveTo.bind(s),
2404
2404
  turnBottom: o.turnBottom.bind(o),
2405
2405
  turnTop: o.turnTop.bind(o),
@@ -2443,10 +2443,10 @@ const Fn = (e) => e.pagination.state$.pipe(
2443
2443
  n.offset,
2444
2444
  t.item
2445
2445
  ).trim() : mt(t.item);
2446
- }, Cn = (e, t) => {
2446
+ }, Rn = (e, t) => {
2447
2447
  const i = ft(e.startContainer, e.startOffset, t), n = ft(e.endContainer, e.endOffset, t);
2448
2448
  return { start: i, end: n };
2449
- }, Rn = ({
2449
+ }, An = ({
2450
2450
  item: e,
2451
2451
  selection: t
2452
2452
  }) => {
@@ -2455,19 +2455,15 @@ const Fn = (e) => e.pagination.state$.pipe(
2455
2455
  anchorCfi: i,
2456
2456
  focusCfi: n
2457
2457
  };
2458
- }, zt = (e) => {
2458
+ }, ae = (e) => {
2459
2459
  var t;
2460
2460
  return ((t = e[0]) == null ? void 0 : t.index) === 6 && e.length > 1;
2461
- }, Ut = (e) => {
2462
- const t = we(e), i = (n) => {
2463
- if (n.length !== 1) return !1;
2464
- const o = n[0] ?? [];
2465
- return zt(o);
2466
- };
2467
- return Array.isArray(t) ? i(t) : i(t.parent);
2468
- }, An = (e) => Array.isArray(e) ? e[0] && zt(e[0]) ? e[0] : void 0 : e.parent[0] && zt(e.parent[0]) ? e.parent[0] : void 0, Gt = (e) => {
2461
+ }, zt = (e) => {
2462
+ const t = we(e);
2463
+ return gi(t);
2464
+ }, On = (e) => Array.isArray(e) ? e[0] && ae(e[0]) ? e[0] : void 0 : e.parent[0] && ae(e.parent[0]) ? e.parent[0] : void 0, Zt = (e) => {
2469
2465
  var a, c, u, d;
2470
- const t = we(e), n = (An(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = di(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
2466
+ const t = we(e), n = (On(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = di(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
2471
2467
  return {
2472
2468
  cleanedCfi: e,
2473
2469
  itemIndex: s,
@@ -2479,14 +2475,15 @@ const Fn = (e) => e.pagination.state$.pipe(
2479
2475
  }) => {
2480
2476
  var s, r;
2481
2477
  if (!e) return;
2482
- const { itemIndex: i } = Gt(e), n = t.get(i);
2478
+ const { itemIndex: i } = Zt(e), n = t.get(i);
2483
2479
  if (!n) return;
2484
2480
  const o = n.renderer.getDocumentFrame();
2485
2481
  if (o instanceof HTMLIFrameElement) {
2482
+ console.log("FIII", e);
2486
2483
  const a = (s = o.contentWindow) == null ? void 0 : s.document;
2487
2484
  if (a)
2488
2485
  try {
2489
- const c = gi(e, a, {
2486
+ const c = li(e, a, {
2490
2487
  throwOnError: !0
2491
2488
  });
2492
2489
  return {
@@ -2503,7 +2500,7 @@ const Fn = (e) => e.pagination.state$.pipe(
2503
2500
  return {
2504
2501
  spineItem: n
2505
2502
  };
2506
- }, On = (e, t) => {
2503
+ }, Dn = (e, t) => {
2507
2504
  if ("cfi" in t)
2508
2505
  return t;
2509
2506
  const i = e.spineItemsManager.get(t);
@@ -2512,7 +2509,7 @@ const Fn = (e) => e.pagination.state$.pipe(
2512
2509
  return {
2513
2510
  cfi: mt(i.item)
2514
2511
  };
2515
- }, Dn = (e, t) => {
2512
+ }, Nn = (e, t) => {
2516
2513
  let i = e == null ? void 0 : e.itemPageIndex;
2517
2514
  const { itemIndex: n } = t.cfi.parseCfi(e.cfi), o = t.spineItemsManager.get(n);
2518
2515
  return o ? Fe().pipe(
@@ -2545,19 +2542,19 @@ const Fn = (e) => e.pagination.state$.pipe(
2545
2542
  })
2546
2543
  ) : w({ ...e, itemIndex: n });
2547
2544
  };
2548
- class Nn {
2545
+ class Vn {
2549
2546
  constructor(t) {
2550
2547
  this.reader = t, this.locate = (i, n) => {
2551
2548
  const o = {
2552
2549
  resource: i,
2553
- meta: On(this.reader, i)
2550
+ meta: Dn(this.reader, i)
2554
2551
  };
2555
- return ne(() => {
2552
+ return ie(() => {
2556
2553
  var d;
2557
2554
  const s = this.reader.spine.spineLayout.layout$.pipe(
2558
2555
  St(10),
2559
2556
  nt(o),
2560
- Je((g) => Dn(g.meta, this.reader).pipe(
2557
+ Je((g) => Nn(g.meta, this.reader).pipe(
2561
2558
  b((l) => ({
2562
2559
  ...g,
2563
2560
  meta: l
@@ -2578,7 +2575,7 @@ class Nn {
2578
2575
  };
2579
2576
  }
2580
2577
  locateResource(t, i) {
2581
- return Array.isArray(t) ? ne(
2578
+ return Array.isArray(t) ? ie(
2582
2579
  () => q(t.map((n) => this.locate(n, i ?? {})))
2583
2580
  ) : this.locate(t, i ?? {});
2584
2581
  }
@@ -2608,20 +2605,20 @@ const Ne = (e, t, i) => {
2608
2605
  }
2609
2606
  return o;
2610
2607
  }, void 0);
2611
- }, Vn = (e, t) => {
2608
+ }, jn = (e, t) => {
2612
2609
  var n;
2613
2610
  const { href: i } = t;
2614
2611
  return Ne(i, ((n = e.nav) == null ? void 0 : n.toc) ?? [], e);
2615
- }, jn = (e) => {
2612
+ }, kn = (e) => {
2616
2613
  const t = e.context.manifest, i = e.spineItemsManager.items;
2617
2614
  return t ? i.reduce(
2618
- (n, { item: o }) => (n[o.id] = Vn(t, o), n),
2615
+ (n, { item: o }) => (n[o.id] = jn(t, o), n),
2619
2616
  {}
2620
2617
  ) : {};
2621
- }, kn = (e) => e.spineItemsManager.items$.pipe(
2618
+ }, Wn = (e) => e.spineItemsManager.items$.pipe(
2622
2619
  nt([]),
2623
- b(() => jn(e))
2624
- ), Wn = (e, t, i) => e + t * i, zn = (e, t, i) => {
2620
+ b(() => kn(e))
2621
+ ), zn = (e, t, i) => e + t * i, Un = (e, t, i) => {
2625
2622
  const n = e.context, { height: o, width: s } = i.layout.layoutInfo, { top: r, left: a } = e.spine.spineLayout.getSpineItemSpineLayoutInfo(i);
2626
2623
  return e.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
2627
2624
  0,
@@ -2636,7 +2633,7 @@ const Ne = (e, t, i) => {
2636
2633
  (t.x - a + n.state.visibleAreaRect.width) / s
2637
2634
  )
2638
2635
  );
2639
- }, Un = (e, t, i, n, o) => o.isReady$.pipe(
2636
+ }, Hn = (e, t, i, n, o) => o.isReady$.pipe(
2640
2637
  H(),
2641
2638
  D(e.layoutInfo$),
2642
2639
  b(([s, r]) => {
@@ -2647,17 +2644,17 @@ const Ne = (e, t, i) => {
2647
2644
  let m = (i + 1) * (h / p);
2648
2645
  !c && o.renditionLayout === "reflowable" && !s && (m = 0);
2649
2646
  let S = d + m;
2650
- return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m = zn(
2647
+ return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m = Un(
2651
2648
  e,
2652
2649
  n,
2653
2650
  o
2654
- ) : m = 0, S = Wn(
2651
+ ) : m = 0, S = zn(
2655
2652
  d,
2656
2653
  h,
2657
2654
  m
2658
2655
  )), t === u - 1 && i === p - 1 && S > 0.99 ? 1 : S;
2659
2656
  })
2660
- ), Hn = (e) => e.spine.spineLayout.layout$.pipe(
2657
+ ), En = (e) => e.spine.spineLayout.layout$.pipe(
2661
2658
  St(10, at),
2662
2659
  D(e.pagination.state$),
2663
2660
  b(() => ({
@@ -2675,7 +2672,7 @@ const Ne = (e, t, i) => {
2675
2672
  numberOfPagesPerItems: [],
2676
2673
  numberOfTotalPages: 0
2677
2674
  })
2678
- ), En = (e, t, i, n) => {
2675
+ ), Bn = (e, t, i, n) => {
2679
2676
  const o = e.context, s = t.beginSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.beginSpineItemIndex) : void 0, r = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
2680
2677
  return w({
2681
2678
  ...t,
@@ -2706,7 +2703,7 @@ const Ne = (e, t, i) => {
2706
2703
  // hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
2707
2704
  // numberOfSpineItems: context.manifest?.readingOrder.length,
2708
2705
  });
2709
- }, Bn = (e) => q([
2706
+ }, _n = (e) => q([
2710
2707
  e.pagination.state$,
2711
2708
  // Usually pagination change if layout changes (number of pages) however it is especially
2712
2709
  // useful for like webtoon where you still have one page but only the layout will give you the final size
@@ -2715,7 +2712,7 @@ const Ne = (e, t, i) => {
2715
2712
  ]).pipe(
2716
2713
  v(([t]) => {
2717
2714
  const i = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
2718
- return i ? Un(
2715
+ return i ? Hn(
2719
2716
  e,
2720
2717
  t.endSpineItemIndex ?? 0,
2721
2718
  t.endPageIndexInSpineItem || 0,
@@ -2723,8 +2720,8 @@ const Ne = (e, t, i) => {
2723
2720
  i
2724
2721
  ) : w(0);
2725
2722
  })
2726
- ), _n = (e) => {
2727
- const t = kn(e), i = Hn(e), n = new k({
2723
+ ), Xn = (e) => {
2724
+ const t = Wn(e), i = En(e), n = new k({
2728
2725
  ...e.pagination.state,
2729
2726
  beginChapterInfo: void 0,
2730
2727
  beginCfi: void 0,
@@ -2742,10 +2739,10 @@ const Ne = (e, t, i) => {
2742
2739
  }), o = q([
2743
2740
  e.pagination.state$,
2744
2741
  t,
2745
- Bn(e)
2742
+ _n(e)
2746
2743
  ]).pipe(
2747
2744
  v(
2748
- ([r, a, c]) => En(
2745
+ ([r, a, c]) => Bn(
2749
2746
  e,
2750
2747
  r,
2751
2748
  a,
@@ -2780,10 +2777,10 @@ const Ne = (e, t, i) => {
2780
2777
  }),
2781
2778
  et(1)
2782
2779
  ), getPaginationInfo: () => n.value };
2783
- }, Xn = (e) => (t) => {
2784
- const i = e(t), { paginationInfo$: n, getPaginationInfo: o } = _n(i);
2780
+ }, qn = (e) => (t) => {
2781
+ const i = e(t), { paginationInfo$: n, getPaginationInfo: o } = Xn(i);
2785
2782
  n.pipe(F(i.$.destroy$)).subscribe();
2786
- const s = new Nn(i);
2783
+ const s = new Vn(i);
2787
2784
  return {
2788
2785
  ...i,
2789
2786
  locateResource: s.locateResource.bind(s),
@@ -2797,7 +2794,7 @@ const Ne = (e, t, i) => {
2797
2794
  }
2798
2795
  }
2799
2796
  };
2800
- }, qn = (e) => ({
2797
+ }, Yn = (e) => ({
2801
2798
  put: (s, r) => new Promise((a, c) => {
2802
2799
  const u = e.transaction(["store"], "readwrite");
2803
2800
  u.onerror = (l) => {
@@ -2855,11 +2852,11 @@ const Ne = (e, t, i) => {
2855
2852
  n.onerror = (o) => {
2856
2853
  i(o);
2857
2854
  }, n.onsuccess = () => {
2858
- t(qn(n.result));
2855
+ t(Yn(n.result));
2859
2856
  }, n.onupgradeneeded = () => {
2860
2857
  n.result.createObjectStore("store");
2861
2858
  };
2862
- }), Yn = (e) => {
2859
+ }), Zn = (e) => {
2863
2860
  let t = Date.now().toString();
2864
2861
  const i = new U(), n = (c) => {
2865
2862
  var u, d;
@@ -2886,7 +2883,7 @@ const Ne = (e, t, i) => {
2886
2883
  Ke([At("prose-reader"), W(u.blob())])
2887
2884
  ).pipe(
2888
2885
  _(([g, l]) => W(g.put(`${t}_${d.id}`, l))),
2889
- ee((g) => (j.error(g), K))
2886
+ te((g) => (j.error(g), K))
2890
2887
  ) : K;
2891
2888
  }),
2892
2889
  J(e.destroy$)
@@ -2909,7 +2906,7 @@ const Ne = (e, t, i) => {
2909
2906
  })
2910
2907
  )
2911
2908
  ),
2912
- ee((c) => (j.error(c), K))
2909
+ te((c) => (j.error(c), K))
2913
2910
  ))),
2914
2911
  J(e.destroy$)
2915
2912
  ).subscribe(), {
@@ -2918,8 +2915,8 @@ const Ne = (e, t, i) => {
2918
2915
  i.complete();
2919
2916
  }
2920
2917
  };
2921
- }, Zn = (e) => (t) => {
2922
- const i = e(t), n = Yn(i.context);
2918
+ }, Gn = (e) => (t) => {
2919
+ const i = e(t), n = Zn(i.context);
2923
2920
  return {
2924
2921
  ...i,
2925
2922
  // $: {
@@ -2931,7 +2928,7 @@ const Ne = (e, t, i) => {
2931
2928
  }
2932
2929
  // load,
2933
2930
  };
2934
- }, Gn = (e, t) => {
2931
+ }, Jn = (e, t) => {
2935
2932
  var o;
2936
2933
  const i = (o = e.node.ownerDocument) == null ? void 0 : o.createRange(), n = e.node.compareDocumentPosition(t.node);
2937
2934
  if (i) {
@@ -2952,14 +2949,14 @@ const Ne = (e, t, i) => {
2952
2949
  }
2953
2950
  return i;
2954
2951
  }
2955
- }, Jn = ({
2952
+ }, Kn = ({
2956
2953
  selection: e,
2957
2954
  spineItem: t
2958
2955
  }) => {
2959
2956
  const { anchorNode: i, anchorOffset: n, focusNode: o, focusOffset: s } = e;
2960
2957
  if (!(!i || !o))
2961
2958
  try {
2962
- return Gn(
2959
+ return Jn(
2963
2960
  { node: i, offset: n },
2964
2961
  { node: o, offset: s }
2965
2962
  );
@@ -2971,7 +2968,7 @@ const Ne = (e, t, i) => {
2971
2968
  return;
2972
2969
  }
2973
2970
  };
2974
- class Kn extends Y {
2971
+ class Qn extends Y {
2975
2972
  constructor(t) {
2976
2973
  var n;
2977
2974
  super();
@@ -2979,14 +2976,14 @@ class Kn extends Y {
2979
2976
  if (!i)
2980
2977
  this.selectionChange$ = gt, this.selectionOver$ = gt;
2981
2978
  else {
2982
- const o = oe(i.body, {
2979
+ const o = ne(i.body, {
2983
2980
  childList: !0,
2984
2981
  subtree: !0
2985
2982
  }).pipe(
2986
2983
  R(
2987
2984
  (r) => !!r.find((a) => a.type === "childList" && a.removedNodes.length)
2988
2985
  )
2989
- ), s = t.parentElement ? oe(t.parentElement, {
2986
+ ), s = t.parentElement ? ne(t.parentElement, {
2990
2987
  childList: !0
2991
2988
  }).pipe(
2992
2989
  R(
@@ -3027,12 +3024,12 @@ class Kn extends Y {
3027
3024
  }
3028
3025
  }
3029
3026
  }
3030
- const Qn = (e) => e.loaded$.pipe(
3027
+ const to = (e) => e.loaded$.pipe(
3031
3028
  v(() => {
3032
3029
  var o;
3033
3030
  const t = e.renderer.getDocumentFrame(), i = (t == null ? void 0 : t.contentDocument) || ((o = t == null ? void 0 : t.contentWindow) == null ? void 0 : o.document);
3034
3031
  if (!t || !i) return gt;
3035
- const n = new Kn(t);
3032
+ const n = new Qn(t);
3036
3033
  return x(
3037
3034
  n.selectionChange$.pipe(
3038
3035
  b((s) => {
@@ -3059,14 +3056,14 @@ const Qn = (e) => e.loaded$.pipe(
3059
3056
  );
3060
3057
  }),
3061
3058
  E()
3062
- ), to = (e) => (t) => {
3059
+ ), eo = (e) => (t) => {
3063
3060
  const i = e(t);
3064
3061
  let n;
3065
3062
  const o = i.spineItemsManager.items$.pipe(
3066
3063
  v((d) => {
3067
3064
  const g = d.map((l) => {
3068
3065
  const p = i.spineItemsManager.getSpineItemIndex(l) ?? 0;
3069
- return Qn(l).pipe(
3066
+ return to(l).pipe(
3070
3067
  b((h) => {
3071
3068
  if (h)
3072
3069
  return {
@@ -3113,7 +3110,7 @@ const Qn = (e) => e.loaded$.pipe(
3113
3110
  selectionOver$: c,
3114
3111
  lastSelectionOnPointerdown$: u,
3115
3112
  getSelection: () => n,
3116
- createOrderedRangeFromSelection: Jn
3113
+ createOrderedRangeFromSelection: Kn
3117
3114
  }
3118
3115
  };
3119
3116
  }, ce = [
@@ -3131,7 +3128,7 @@ const Qn = (e) => e.loaded$.pipe(
3131
3128
  backgroundColor: "#191717",
3132
3129
  foregroundColor: "#f1ebeb"
3133
3130
  }
3134
- ], eo = (e) => (t) => {
3131
+ ], io = (e) => (t) => {
3135
3132
  const i = e(t), n = new k(
3136
3133
  t.theme ?? "bright"
3137
3134
  ), o = () => {
@@ -3196,7 +3193,7 @@ const Qn = (e) => e.loaded$.pipe(
3196
3193
  }
3197
3194
  }
3198
3195
  };
3199
- }, io = (e) => (t) => ({
3196
+ }, no = (e) => (t) => ({
3200
3197
  ...e(t),
3201
3198
  utils: {
3202
3199
  isOrIsWithinValidLink: (o) => {
@@ -3210,13 +3207,13 @@ const Qn = (e) => e.loaded$.pipe(
3210
3207
  }
3211
3208
  });
3212
3209
  navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
3213
- const no = (e) => (t) => e(t);
3210
+ const oo = (e) => (t) => e(t);
3214
3211
  class Ve {
3215
3212
  constructor(t) {
3216
3213
  this.reader = t;
3217
3214
  }
3218
3215
  }
3219
- class oo extends Ve {
3216
+ class so extends Ve {
3220
3217
  constructor() {
3221
3218
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3222
3219
  }
@@ -3273,7 +3270,7 @@ const Tt = ({
3273
3270
  const o = i * e / 2 - i + i / 2, s = i * t / 2 - i + i / 2, r = e / t, a = n - s;
3274
3271
  return Math.max(o + a * r, 0);
3275
3272
  };
3276
- class so extends Ve {
3273
+ class ro extends Ve {
3277
3274
  constructor() {
3278
3275
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3279
3276
  }
@@ -3306,8 +3303,8 @@ class so extends Ve {
3306
3303
  }), this.currentScale = o;
3307
3304
  }
3308
3305
  }
3309
- const ro = (e) => (t) => {
3310
- const i = e(t), n = new oo(i), o = new so(i), s = new k(o);
3306
+ const ao = (e) => (t) => {
3307
+ const i = e(t), n = new so(i), o = new ro(i), s = new k(o);
3311
3308
  return {
3312
3309
  ...i,
3313
3310
  destroy: () => {
@@ -3354,7 +3351,7 @@ class bt extends st {
3354
3351
  N(this.value, i) || this.stateSubject.next(i);
3355
3352
  }
3356
3353
  watch(t) {
3357
- return Array.isArray(t) ? this.stateSubject.pipe(qt(t)) : this.stateSubject.pipe(
3354
+ return Array.isArray(t) ? this.stateSubject.pipe(Xt(t)) : this.stateSubject.pipe(
3358
3355
  b((i) => i[t]),
3359
3356
  E(N)
3360
3357
  );
@@ -3366,9 +3363,9 @@ class bt extends st {
3366
3363
  this.stateSubject.complete(), this.destroy$.complete();
3367
3364
  }
3368
3365
  }
3369
- class ao {
3366
+ class co {
3370
3367
  constructor() {
3371
- this.navigationSubject = new Kt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Kt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3368
+ this.navigationSubject = new Jt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Jt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3372
3369
  E(),
3373
3370
  R((t) => !t)
3374
3371
  ), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
@@ -3378,7 +3375,7 @@ class ao {
3378
3375
  ), this.navigation$ = this.navigationSubject.asObservable();
3379
3376
  }
3380
3377
  }
3381
- const co = ({
3378
+ const uo = ({
3382
3379
  manifest: e,
3383
3380
  visibleAreaRect: t,
3384
3381
  forceSinglePageMode: i
@@ -3386,7 +3383,7 @@ const co = ({
3386
3383
  const { height: n, width: o } = t, s = o > n;
3387
3384
  return i || (e == null ? void 0 : e.renditionFlow) === "scrolled-continuous" ? !1 : !s && (e == null ? void 0 : e.renditionSpread) === "portrait" ? !0 : s && ((e == null ? void 0 : e.renditionSpread) === void 0 || (e == null ? void 0 : e.renditionSpread) === "auto" || (e == null ? void 0 : e.renditionSpread) === "landscape" || (e == null ? void 0 : e.renditionSpread) === "both");
3388
3385
  };
3389
- class uo extends bt {
3386
+ class go extends bt {
3390
3387
  constructor() {
3391
3388
  super({
3392
3389
  marginBottom: 0,
@@ -3399,7 +3396,7 @@ class uo extends bt {
3399
3396
  x: 0,
3400
3397
  y: 0
3401
3398
  }
3402
- }), this.bridgeEvent = new ao(), this.destroy$ = new U(), this.state$ = this.pipe(Z(N)), this.manifest$ = this.pipe(
3399
+ }), this.bridgeEvent = new co(), this.destroy$ = new U(), this.state$ = this.pipe(Z(N)), this.manifest$ = this.pipe(
3403
3400
  X((t) => t.manifest),
3404
3401
  tt(ct),
3405
3402
  Z()
@@ -3434,7 +3431,7 @@ class uo extends bt {
3434
3431
  isFullyPrePaginated: je(n),
3435
3432
  assumedRenditionLayout: (n == null ? void 0 : n.renditionLayout) ?? "reflowable"
3436
3433
  },
3437
- isUsingSpreadMode: co({
3434
+ isUsingSpreadMode: uo({
3438
3435
  manifest: n,
3439
3436
  visibleAreaRect: s,
3440
3437
  forceSinglePageMode: o
@@ -3466,7 +3463,7 @@ class uo extends bt {
3466
3463
  };
3467
3464
  }
3468
3465
  }
3469
- class go extends bt {
3466
+ class lo extends bt {
3470
3467
  constructor(t, i) {
3471
3468
  super({
3472
3469
  supportedPageTurnAnimation: ["fade", "none", "slide"],
@@ -3502,7 +3499,7 @@ class go extends bt {
3502
3499
  ).subscribe(this.next.bind(this));
3503
3500
  }
3504
3501
  }
3505
- class lo {
3502
+ class po {
3506
3503
  constructor() {
3507
3504
  this._hooks = [], this._hookExecutions = [];
3508
3505
  }
@@ -3578,7 +3575,7 @@ class ke {
3578
3575
  };
3579
3576
  }
3580
3577
  }
3581
- const po = () => (e) => e.pipe(
3578
+ const ho = () => (e) => e.pipe(
3582
3579
  b(({ navigation: t, pagination: i, ...n }) => ({
3583
3580
  navigation: {
3584
3581
  ...t,
@@ -3586,7 +3583,7 @@ const po = () => (e) => e.pipe(
3586
3583
  },
3587
3584
  ...n
3588
3585
  }))
3589
- ), ho = (e, t, i) => e.bridgeEvent.pagination$.pipe(
3586
+ ), mo = (e, t, i) => e.bridgeEvent.pagination$.pipe(
3590
3587
  D(t),
3591
3588
  R(
3592
3589
  ([n, o]) => n.navigationId === o.id
@@ -3606,7 +3603,7 @@ const po = () => (e) => e.pipe(
3606
3603
  }))
3607
3604
  );
3608
3605
  }),
3609
- po(),
3606
+ ho(),
3610
3607
  E(
3611
3608
  (n, o) => n.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
3612
3609
  ),
@@ -3618,7 +3615,7 @@ const po = () => (e) => e.pipe(
3618
3615
  }
3619
3616
  })
3620
3617
  )
3621
- ), mo = (e) => e.pipe(
3618
+ ), fo = (e) => e.pipe(
3622
3619
  b(([t, i]) => {
3623
3620
  const n = {
3624
3621
  type: "api",
@@ -3634,7 +3631,7 @@ const po = () => (e) => e.pipe(
3634
3631
  navigation: n
3635
3632
  };
3636
3633
  })
3637
- ), fo = ({ navigationResolver: e }) => (t) => t.pipe(
3634
+ ), yo = ({ navigationResolver: e }) => (t) => t.pipe(
3638
3635
  b((i) => {
3639
3636
  if (i.navigation.cfi) {
3640
3637
  const n = e.getNavigationForCfi(
@@ -3651,16 +3648,16 @@ const po = () => (e) => e.pipe(
3651
3648
  }
3652
3649
  return i;
3653
3650
  })
3654
- ), yo = ({
3651
+ ), So = ({
3655
3652
  navigation: e,
3656
3653
  previousNavigation: t,
3657
3654
  settings: i
3658
- }) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward", So = ({
3655
+ }) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward", bo = ({
3659
3656
  context: e,
3660
3657
  settings: t
3661
3658
  }) => (i) => i.pipe(
3662
3659
  b(({ navigation: n, previousNavigation: o }) => {
3663
- const s = yo({
3660
+ const s = So({
3664
3661
  navigation: n,
3665
3662
  previousNavigation: o,
3666
3663
  settings: t
@@ -3674,7 +3671,7 @@ const po = () => (e) => e.pipe(
3674
3671
  direction: s
3675
3672
  };
3676
3673
  })
3677
- ), bo = ({
3674
+ ), Io = ({
3678
3675
  spineItemsManager: e,
3679
3676
  navigationResolver: t
3680
3677
  }) => (i) => i.pipe(
@@ -3826,7 +3823,7 @@ const po = () => (e) => e.pipe(
3826
3823
  ...a
3827
3824
  }))
3828
3825
  );
3829
- }, Io = ({ navigationResolver: e }) => (t) => t.pipe(
3826
+ }, wo = ({ navigationResolver: e }) => (t) => t.pipe(
3830
3827
  b((i) => {
3831
3828
  if (i.navigation.url) {
3832
3829
  const n = e.getNavigationForUrl(
@@ -3844,7 +3841,7 @@ const po = () => (e) => e.pipe(
3844
3841
  }
3845
3842
  return i;
3846
3843
  })
3847
- ), wo = ({
3844
+ ), Po = ({
3848
3845
  spineLocator: e,
3849
3846
  navigation: t,
3850
3847
  navigationResolver: i,
@@ -3870,7 +3867,7 @@ const po = () => (e) => e.pipe(
3870
3867
  return m.position;
3871
3868
  }
3872
3869
  const l = t.cfi ?? t.paginationBeginCfi;
3873
- if (l !== void 0 && !Ut(l) && (u || d || // when spine item is ready dimensions may have not changed but the position
3870
+ if (l !== void 0 && !zt(l) && (u || d || // when spine item is ready dimensions may have not changed but the position
3874
3871
  // of dom elements may have!
3875
3872
  r && !t.spineItemIsReady)) {
3876
3873
  const m = i.getNavigationForCfi(l);
@@ -3902,7 +3899,7 @@ const po = () => (e) => e.pipe(
3902
3899
  return c ? i.getNavigationForPosition(t.position) : i.getNavigationForSpineIndexOrId(s);
3903
3900
  })
3904
3901
  ) : w(new M({ x: 0, y: 0 }));
3905
- }, Po = ({
3902
+ }, vo = ({
3906
3903
  navigation: e,
3907
3904
  spineLocator: t,
3908
3905
  spineItemsManager: i,
@@ -3971,7 +3968,7 @@ const po = () => (e) => e.pipe(
3971
3968
  }
3972
3969
  }
3973
3970
  return e.position;
3974
- }, vo = ({
3971
+ }, xo = ({
3975
3972
  navigation: e,
3976
3973
  spineItemsManager: t,
3977
3974
  settings: i,
@@ -3979,7 +3976,7 @@ const po = () => (e) => e.pipe(
3979
3976
  navigationResolver: o,
3980
3977
  spineLayout: s
3981
3978
  }) => i.values.computedPageTurnMode === "scrollable" ? w(
3982
- Po({
3979
+ vo({
3983
3980
  navigation: e,
3984
3981
  spineLocator: n,
3985
3982
  navigationResolver: o,
@@ -3987,7 +3984,7 @@ const po = () => (e) => e.pipe(
3987
3984
  spineItemsManager: t,
3988
3985
  spineLayout: s
3989
3986
  })
3990
- ) : wo({
3987
+ ) : Po({
3991
3988
  navigation: e,
3992
3989
  spineLocator: n,
3993
3990
  navigationResolver: o,
@@ -3999,7 +3996,7 @@ const po = () => (e) => e.pipe(
3999
3996
  context: i,
4000
3997
  spine: n
4001
3998
  }) => (o) => o.pipe(
4002
- v((s) => vo({
3999
+ v((s) => xo({
4003
4000
  spineLocator: n.locator,
4004
4001
  navigation: s.navigation,
4005
4002
  navigationResolver: t,
@@ -4016,8 +4013,8 @@ const po = () => (e) => e.pipe(
4016
4013
  }
4017
4014
  }))
4018
4015
  ))
4019
- ), xo = "navigation/InternalNavigator", $o = j.namespace(xo);
4020
- class To extends Y {
4016
+ ), $o = "navigation/InternalNavigator", To = j.namespace($o);
4017
+ class Fo extends Y {
4021
4018
  constructor(t, i, n, o, s, r, a, c) {
4022
4019
  super(), this.settings = t, this.context = i, this.userNavigation$ = n, this.viewportController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isUserLocked$ = c, this.navigationSubject = new k({
4023
4020
  animation: !1,
@@ -4040,22 +4037,22 @@ class To extends Y {
4040
4037
  ), this.locker = new ke();
4041
4038
  const u = n.pipe(
4042
4039
  D(this.navigationSubject),
4043
- mo,
4040
+ fo,
4044
4041
  /**
4045
4042
  * Url lookup is heavier so we start with it to fill
4046
4043
  * as much information as needed to reduce later lookup
4047
4044
  */
4048
- Io({
4045
+ wo({
4049
4046
  navigationResolver: r
4050
4047
  }),
4051
4048
  /**
4052
4049
  * Cfi lookup is heavier so we start with it to fill
4053
4050
  * as much information as needed to reduce later lookup
4054
4051
  */
4055
- fo({
4052
+ yo({
4056
4053
  navigationResolver: r
4057
4054
  }),
4058
- So({ context: i, settings: t }),
4055
+ bo({ context: i, settings: t }),
4059
4056
  ue({
4060
4057
  navigationResolver: r,
4061
4058
  settings: t,
@@ -4072,7 +4069,7 @@ class To extends Y {
4072
4069
  spine: a
4073
4070
  })
4074
4071
  ).pipe(
4075
- bo({
4072
+ Io({
4076
4073
  navigationResolver: r,
4077
4074
  spineItemsManager: a.spineItemsManager
4078
4075
  }),
@@ -4188,7 +4185,7 @@ class To extends Y {
4188
4185
  }),
4189
4186
  b(({ navigation: f }) => f),
4190
4187
  V()
4191
- ), p = ho(
4188
+ ), p = mo(
4192
4189
  i,
4193
4190
  this.navigationSubject,
4194
4191
  a
@@ -4198,7 +4195,7 @@ class To extends Y {
4198
4195
  p
4199
4196
  ), m = (f) => f.pipe(
4200
4197
  T(([y, I]) => {
4201
- $o.info(
4198
+ To.info(
4202
4199
  `navigation updated from ${y.meta.triggeredBy} of type ${y.type}`,
4203
4200
  {
4204
4201
  previousNavigation: I,
@@ -4262,8 +4259,8 @@ const We = ({
4262
4259
  scrollOffset: t
4263
4260
  })
4264
4261
  });
4265
- }, Fo = 500;
4266
- class Lo extends Y {
4262
+ }, Lo = 500;
4263
+ class Mo extends Y {
4267
4264
  constructor(t, i, n, o, s) {
4268
4265
  super(), this.settings = t, this.context = i, this.spine = n, this.scrollNavigationController = o, this.locker = s, this.navigationSubject = new U(), this.navigation$ = this.navigationSubject.asObservable();
4269
4266
  const r = this.scrollNavigationController.userScroll$.pipe(
@@ -4274,7 +4271,7 @@ class Lo extends Y {
4274
4271
  w(a)
4275
4272
  ).pipe(
4276
4273
  St(
4277
- Fo,
4274
+ Lo,
4278
4275
  at
4279
4276
  ),
4280
4277
  H(),
@@ -4302,17 +4299,17 @@ class Lo extends Y {
4302
4299
  x(r).pipe(F(this.destroy$)).subscribe();
4303
4300
  }
4304
4301
  }
4305
- const Mo = (e) => ({
4302
+ const Co = (e) => ({
4306
4303
  x: -e.x,
4307
4304
  y: -e.y
4308
- }), Co = (e) => e instanceof DOMMatrix ? new M({
4305
+ }), Ro = (e) => e instanceof DOMMatrix ? new M({
4309
4306
  x: -e.e,
4310
4307
  y: -e.f
4311
4308
  }) : new M({
4312
4309
  x: -e.x,
4313
4310
  y: -e.y
4314
- }), Ro = "navigation/ViewportNavigator", le = j.namespace(Ro);
4315
- class Ao extends Y {
4311
+ }), Ao = "navigation/ViewportNavigator", le = j.namespace(Ao);
4312
+ class Oo extends Y {
4316
4313
  constructor(t, i, n, o, s) {
4317
4314
  super(), this.settings = t, this.hookManager = i, this.context = n, this.spine = o, this.viewport = s, this.navigateSubject = new U(), this.element$ = new k(
4318
4315
  document.createElement("div")
@@ -4423,7 +4420,7 @@ class Ao extends Y {
4423
4420
  * for remark about flicker / fonts smoothing
4424
4421
  */
4425
4422
  setViewportPosition(t) {
4426
- const i = this.element$.getValue(), n = Mo(t);
4423
+ const i = this.element$.getValue(), n = Co(t);
4427
4424
  i.style.transform = `translate(${n.x}px, ${n.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
4428
4425
  }
4429
4426
  navigate(t) {
@@ -4438,10 +4435,10 @@ class Ao extends Y {
4438
4435
  if (!n || n === "none")
4439
4436
  return new M({ x: 0, y: 0 });
4440
4437
  const o = new DOMMatrix(n);
4441
- return Co(o);
4438
+ return Ro(o);
4442
4439
  }
4443
4440
  }
4444
- class Oo extends bt {
4441
+ class Do extends bt {
4445
4442
  constructor(t, i, n, o, s) {
4446
4443
  super({
4447
4444
  element: void 0
@@ -4451,7 +4448,7 @@ class Oo extends bt {
4451
4448
  left: g.x,
4452
4449
  top: g.y,
4453
4450
  behavior: "instant"
4454
- }), Qt(1).pipe(
4451
+ }), Kt(1).pipe(
4455
4452
  T(() => {
4456
4453
  this.scrollingSubject.next(!1);
4457
4454
  }),
@@ -4459,7 +4456,7 @@ class Oo extends bt {
4459
4456
  ).subscribe(), this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
4460
4457
  };
4461
4458
  const r = this.context.pipe(
4462
- qt(["rootElement"]),
4459
+ Xt(["rootElement"]),
4463
4460
  T(({ rootElement: g }) => {
4464
4461
  if (!g) return;
4465
4462
  const l = document.createElement("div");
@@ -4490,7 +4487,7 @@ class Oo extends bt {
4490
4487
  o.spineItemsObserver.itemResize$
4491
4488
  ).pipe(
4492
4489
  v(
4493
- () => Qt(10).pipe(
4490
+ () => Kt(10).pipe(
4494
4491
  b(() => !1),
4495
4492
  nt(!0)
4496
4493
  )
@@ -4545,10 +4542,10 @@ class Oo extends bt {
4545
4542
  const pe = (e, t, i) => {
4546
4543
  const n = i - e, o = i * (t * e) / (i || 1);
4547
4544
  return Math.max(0, Math.min(n, o));
4548
- }, Ht = (e, t) => (t || 0) === 0 || (e || 0) === 0 ? 1 : Math.floor(Math.max(1, e / t)), xt = (e, t, i) => {
4549
- const n = Ht(i, t), o = [...Array(n)].map((s, r) => r * t);
4545
+ }, Ut = (e, t) => (t || 0) === 0 || (e || 0) === 0 ? 1 : Math.floor(Math.max(1, e / t)), xt = (e, t, i) => {
4546
+ const n = Ut(i, t), o = [...Array(n)].map((s, r) => r * t);
4550
4547
  return e >= n * t ? o[o.length - 1] || 0 : o.find((s) => e < s + t) || 0;
4551
- }, Jt = ({
4548
+ }, Gt = ({
4552
4549
  itemHeight: e,
4553
4550
  itemWidth: t,
4554
4551
  isUsingVerticalWriting: i,
@@ -4556,11 +4553,11 @@ const pe = (e, t, i) => {
4556
4553
  context: o
4557
4554
  }) => {
4558
4555
  const { pageTurnDirection: s, pageTurnMode: r } = n.values;
4559
- return s === "vertical" && r === "scrollable" ? 1 : i || s === "vertical" ? Ht(
4556
+ return s === "vertical" && r === "scrollable" ? 1 : i || s === "vertical" ? Ut(
4560
4557
  e,
4561
4558
  o.getPageSize().height
4562
- ) : Ht(t, o.getPageSize().width);
4563
- }, Et = ({
4559
+ ) : Ut(t, o.getPageSize().width);
4560
+ }, Ht = ({
4564
4561
  pageIndex: e,
4565
4562
  itemLayout: t,
4566
4563
  context: i,
@@ -4589,13 +4586,13 @@ const pe = (e, t, i) => {
4589
4586
  x: o,
4590
4587
  y: 0
4591
4588
  });
4592
- }, Do = ({
4589
+ }, No = ({
4593
4590
  context: e,
4594
4591
  isUsingVerticalWriting: t,
4595
4592
  settings: i,
4596
4593
  itemLayout: n
4597
4594
  }) => {
4598
- const o = Jt({
4595
+ const o = Gt({
4599
4596
  context: e,
4600
4597
  isUsingVerticalWriting: t,
4601
4598
  itemHeight: n.height,
@@ -4603,7 +4600,7 @@ const pe = (e, t, i) => {
4603
4600
  settings: i
4604
4601
  });
4605
4602
  return new Array(o).fill(void 0).map(
4606
- (s, r) => Et({
4603
+ (s, r) => Ht({
4607
4604
  context: e,
4608
4605
  isUsingVerticalWriting: t,
4609
4606
  itemLayout: n,
@@ -4631,7 +4628,7 @@ const pe = (e, t, i) => {
4631
4628
  spineItemPosition: g,
4632
4629
  itemHeight: d,
4633
4630
  itemWidth: u
4634
- }), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f = Jt({
4631
+ }), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f = Gt({
4635
4632
  isUsingVerticalWriting: l,
4636
4633
  itemHeight: d,
4637
4634
  itemWidth: u,
@@ -4645,7 +4642,7 @@ const pe = (e, t, i) => {
4645
4642
  if ((u == null ? void 0 : u.nodeName) === "img" || (u == null ? void 0 : u.textContent) === "" && u.nodeType === Node.ELEMENT_NODE)
4646
4643
  l = u.getBoundingClientRect().x;
4647
4644
  else if (u) {
4648
- const S = u ? vi(u, d) : void 0;
4645
+ const S = u ? xi(u, d) : void 0;
4649
4646
  l = (S == null ? void 0 : S.getBoundingClientRect().x) || l;
4650
4647
  }
4651
4648
  const p = ((m = g.layout.layoutInfo) == null ? void 0 : m.width) || 0, h = e.getPageSize().width;
@@ -4662,7 +4659,7 @@ const pe = (e, t, i) => {
4662
4659
  const g = e.getPageSize(), l = (p = d.renderer) == null ? void 0 : p.getDocumentFrame();
4663
4660
  if (l && ((h = l == null ? void 0 : l.contentWindow) != null && h.document) && // very important because it is being used by next functions
4664
4661
  l.contentWindow.document.body !== null) {
4665
- const { x: m, y: S } = Et({
4662
+ const { x: m, y: S } = Ht({
4666
4663
  pageIndex: u,
4667
4664
  itemLayout: d.layout.layoutInfo,
4668
4665
  context: e,
@@ -4672,7 +4669,7 @@ const pe = (e, t, i) => {
4672
4669
  right: m + g.width,
4673
4670
  bottom: S + g.height
4674
4671
  };
4675
- return wi(
4672
+ return Pi(
4676
4673
  l.contentWindow.document,
4677
4674
  f
4678
4675
  );
@@ -4711,7 +4708,7 @@ const pe = (e, t, i) => {
4711
4708
  getSpineItemPositionFromPageIndex: ({
4712
4709
  pageIndex: u,
4713
4710
  spineItem: d
4714
- }) => Et({
4711
+ }) => Ht({
4715
4712
  context: e,
4716
4713
  isUsingVerticalWriting: !!d.isUsingVerticalWriting(),
4717
4714
  itemLayout: d.layout.layoutInfo,
@@ -4721,14 +4718,14 @@ const pe = (e, t, i) => {
4721
4718
  getSpineItemPageIndexFromNode: a,
4722
4719
  getSpineItemClosestPositionFromUnsafePosition: r,
4723
4720
  getFirstNodeOrRangeAtPage: s,
4724
- getSpineItemPagesPosition: ({ item: u }) => Do({
4721
+ getSpineItemPagesPosition: ({ item: u }) => No({
4725
4722
  context: e,
4726
4723
  isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
4727
4724
  settings: t,
4728
4725
  itemLayout: u.layout.layoutInfo
4729
4726
  })
4730
4727
  };
4731
- }, No = ({
4728
+ }, Vo = ({
4732
4729
  context: e,
4733
4730
  settings: t
4734
4731
  }) => {
@@ -4781,7 +4778,7 @@ const pe = (e, t, i) => {
4781
4778
  x: Math.min(Math.max(0, e.x), d),
4782
4779
  y: u
4783
4780
  });
4784
- }, Bt = ({
4781
+ }, Et = ({
4785
4782
  viewportPosition: e,
4786
4783
  spineLocator: t,
4787
4784
  context: i,
@@ -4806,7 +4803,7 @@ const pe = (e, t, i) => {
4806
4803
  });
4807
4804
  }
4808
4805
  return new M({ x: 0, y: 0 });
4809
- }, Vo = ({
4806
+ }, jo = ({
4810
4807
  pageIndex: e,
4811
4808
  spineItemsManager: t,
4812
4809
  spineItemId: i,
@@ -4817,7 +4814,7 @@ const pe = (e, t, i) => {
4817
4814
  const r = t.get(i);
4818
4815
  if (!r) {
4819
4816
  const u = e * n.getPageSize().width;
4820
- return Bt({
4817
+ return Et({
4821
4818
  viewportPosition: new M({ x: u, y: 0 }),
4822
4819
  context: n,
4823
4820
  spineItemNavigationResolver: s,
@@ -4836,7 +4833,7 @@ const pe = (e, t, i) => {
4836
4833
  pageSizeWidth: n.getPageSize().width,
4837
4834
  visibleAreaRectWidth: n.state.visibleAreaRect.width
4838
4835
  });
4839
- }, jo = ({
4836
+ }, ko = ({
4840
4837
  anchor: e,
4841
4838
  spineItem: t,
4842
4839
  context: i
@@ -4848,13 +4845,13 @@ const pe = (e, t, i) => {
4848
4845
  o,
4849
4846
  n
4850
4847
  );
4851
- }, ko = ({
4848
+ }, Wo = ({
4852
4849
  anchor: e,
4853
4850
  context: t,
4854
4851
  spineItem: i,
4855
4852
  spineLocator: n
4856
4853
  }) => {
4857
- const o = jo({
4854
+ const o = ko({
4858
4855
  anchor: e,
4859
4856
  spineItem: i,
4860
4857
  context: t
@@ -4863,7 +4860,7 @@ const pe = (e, t, i) => {
4863
4860
  spineItemPosition: new A({ x: o, y: 0 }),
4864
4861
  spineItem: i
4865
4862
  });
4866
- }, Wo = ({
4863
+ }, zo = ({
4867
4864
  anchor: e,
4868
4865
  spineItem: t,
4869
4866
  spineLocator: i,
@@ -4871,7 +4868,7 @@ const pe = (e, t, i) => {
4871
4868
  pageSizeWidth: o,
4872
4869
  visibleAreaRectWidth: s
4873
4870
  }) => {
4874
- const r = ko({
4871
+ const r = Wo({
4875
4872
  anchor: e,
4876
4873
  context: n,
4877
4874
  spineItem: t,
@@ -4882,7 +4879,7 @@ const pe = (e, t, i) => {
4882
4879
  pageSizeWidth: o,
4883
4880
  visibleAreaRectWidth: s
4884
4881
  });
4885
- }, zo = ({
4882
+ }, Uo = ({
4886
4883
  context: e,
4887
4884
  spineItemsManager: t,
4888
4885
  spineLocator: i,
@@ -4898,7 +4895,7 @@ const pe = (e, t, i) => {
4898
4895
  if (u) {
4899
4896
  const d = t.get(u.id);
4900
4897
  if (d) {
4901
- const g = Wo({
4898
+ const g = zo({
4902
4899
  anchor: a.hash,
4903
4900
  spineItem: d,
4904
4901
  context: e,
@@ -4921,7 +4918,7 @@ const pe = (e, t, i) => {
4921
4918
  console.error(a);
4922
4919
  return;
4923
4920
  }
4924
- }, Uo = ({
4921
+ }, Ho = ({
4925
4922
  spineItem: e,
4926
4923
  spineItemPosition: t,
4927
4924
  spineLocator: i,
@@ -4940,16 +4937,16 @@ const pe = (e, t, i) => {
4940
4937
  pageSizeWidth: o.getPageSize().width,
4941
4938
  visibleAreaRectWidth: o.state.visibleAreaRect.width
4942
4939
  });
4943
- }, Ho = "spineNavigator", Eo = ({
4940
+ }, Eo = "spineNavigator", Bo = ({
4944
4941
  context: e,
4945
4942
  spineItemsManager: t,
4946
4943
  locator: i,
4947
4944
  settings: n,
4948
4945
  spineLayout: o
4949
4946
  }) => {
4950
- const s = No({ context: e, settings: n });
4947
+ const s = Vo({ context: e, settings: n });
4951
4948
  return {
4952
- getNavigationForUrl: (l) => zo({
4949
+ getNavigationForUrl: (l) => Uo({
4953
4950
  context: e,
4954
4951
  spineItemsManager: t,
4955
4952
  spineLocator: i,
@@ -4957,14 +4954,14 @@ const pe = (e, t, i) => {
4957
4954
  pageSizeWidth: e.getPageSize().width,
4958
4955
  visibleAreaRectWidth: e.state.visibleAreaRect.width
4959
4956
  }),
4960
- getNavigationForSpineItemPage: (l) => Vo({
4957
+ getNavigationForSpineItemPage: (l) => jo({
4961
4958
  ...l,
4962
4959
  context: e,
4963
4960
  spineItemsManager: t,
4964
4961
  spineItemNavigationResolver: s,
4965
4962
  spineLocator: i
4966
4963
  }),
4967
- getNavigationFromSpineItemPosition: (l) => Uo({
4964
+ getNavigationFromSpineItemPosition: (l) => Ho({
4968
4965
  ...l,
4969
4966
  spineItemLocator: i.spineItemLocator,
4970
4967
  spineLocator: i,
@@ -4976,7 +4973,7 @@ const pe = (e, t, i) => {
4976
4973
  spineItemsManager: t
4977
4974
  }) || {};
4978
4975
  if (!p) {
4979
- j.warn(Ho, `unable to detect item id from cfi ${l}`);
4976
+ j.warn(Eo, `unable to detect item id from cfi ${l}`);
4980
4977
  return;
4981
4978
  }
4982
4979
  const S = h ? s.getNavigationFromNode(p, h, m) : new A({ x: 0, y: 0 }), f = i.getSpinePositionFromSpineItemPosition({
@@ -5012,7 +5009,7 @@ const pe = (e, t, i) => {
5012
5009
  }
5013
5010
  return new M({ x: 0, y: 0 });
5014
5011
  },
5015
- getNavigationForPosition: (l) => Bt({
5012
+ getNavigationForPosition: (l) => Et({
5016
5013
  viewportPosition: l,
5017
5014
  context: e,
5018
5015
  spineItemNavigationResolver: s,
@@ -5030,7 +5027,7 @@ const pe = (e, t, i) => {
5030
5027
  spineItemsManager: t,
5031
5028
  spineLayout: o
5032
5029
  });
5033
- return Bt({
5030
+ return Et({
5034
5031
  context: e,
5035
5032
  spineItemNavigationResolver: s,
5036
5033
  spineLocator: i,
@@ -5054,7 +5051,7 @@ const pe = (e, t, i) => {
5054
5051
  }),
5055
5052
  spineItemNavigator: s
5056
5053
  };
5057
- }, Bo = ({
5054
+ }, _o = ({
5058
5055
  spineItemsManager: e,
5059
5056
  context: t,
5060
5057
  hookManager: i,
@@ -5062,25 +5059,25 @@ const pe = (e, t, i) => {
5062
5059
  settings: o,
5063
5060
  viewport: s
5064
5061
  }) => {
5065
- const r = new U(), a = new ke(), c = Eo({
5062
+ const r = new U(), a = new ke(), c = Bo({
5066
5063
  context: t,
5067
5064
  settings: o,
5068
5065
  spineItemsManager: e,
5069
5066
  locator: n.locator,
5070
5067
  spineLayout: n.spineLayout
5071
- }), u = new Ao(
5068
+ }), u = new Oo(
5072
5069
  o,
5073
5070
  i,
5074
5071
  t,
5075
5072
  n,
5076
5073
  s
5077
- ), d = new Oo(
5074
+ ), d = new Do(
5078
5075
  s,
5079
5076
  o,
5080
5077
  i,
5081
5078
  n,
5082
5079
  t
5083
- ), g = new Lo(
5080
+ ), g = new Mo(
5084
5081
  o,
5085
5082
  t,
5086
5083
  n,
@@ -5089,7 +5086,7 @@ const pe = (e, t, i) => {
5089
5086
  ), l = x(
5090
5087
  r,
5091
5088
  g.navigation$
5092
- ), p = new To(
5089
+ ), p = new Fo(
5093
5090
  o,
5094
5091
  t,
5095
5092
  l,
@@ -5128,7 +5125,7 @@ const pe = (e, t, i) => {
5128
5125
  navigation$: p.navigation$
5129
5126
  };
5130
5127
  };
5131
- class _o extends bt {
5128
+ class Xo extends bt {
5132
5129
  constructor(t, i) {
5133
5130
  super({
5134
5131
  beginPageIndexInSpineItem: void 0,
@@ -5146,7 +5143,7 @@ class _o extends bt {
5146
5143
  this.mergeCompare(t);
5147
5144
  }
5148
5145
  }
5149
- class Xo extends Y {
5146
+ class qo extends Y {
5150
5147
  constructor(t, i, n, o, s) {
5151
5148
  super(), this.context = t, this.pagination = i, this.spineItemsManager = n, this.spine = o, this.spineItemLocator = s;
5152
5149
  const r = x(
@@ -5180,7 +5177,7 @@ class Xo extends Y {
5180
5177
  }) ?? {}, { endPageIndex: I = 0 } = c({
5181
5178
  spineItem: m,
5182
5179
  position: d
5183
- }) ?? {}, P = S === void 0 || Ut(S) || g.beginSpineItemIndex !== l, $ = g.endSpineItemIndex !== p || f === void 0 || Ut(f), L = P ? mt(h.item) : S, C = $ ? mt(m.item) : f, O = h.numberOfPages, B = m.numberOfPages;
5180
+ }) ?? {}, P = S === void 0 || zt(S) || g.beginSpineItemIndex !== l, $ = g.endSpineItemIndex !== p || f === void 0 || zt(f), L = P ? mt(h.item) : S, C = $ ? mt(m.item) : f, O = h.numberOfPages, B = m.numberOfPages;
5184
5181
  this.pagination.update({
5185
5182
  beginCfi: L,
5186
5183
  beginNumberOfPagesInSpineItem: O,
@@ -5224,7 +5221,7 @@ class Xo extends Y {
5224
5221
  x(r, a).pipe(F(this.destroy$)).subscribe();
5225
5222
  }
5226
5223
  }
5227
- class qo extends Y {
5224
+ class Yo extends Y {
5228
5225
  constructor(t) {
5229
5226
  super();
5230
5227
  const i = {
@@ -5269,7 +5266,7 @@ class qo extends Y {
5269
5266
  super.destroy(), this.outputSettingsUpdateSubject.complete();
5270
5267
  }
5271
5268
  }
5272
- class Yo extends qo {
5269
+ class Zo extends Yo {
5273
5270
  constructor(t, i) {
5274
5271
  super(t), this.context = i;
5275
5272
  const n = q([
@@ -5314,7 +5311,7 @@ class Yo extends qo {
5314
5311
  };
5315
5312
  }
5316
5313
  }
5317
- class Zo extends Y {
5314
+ class Go extends Y {
5318
5315
  constructor(t, i, n, o, s, r) {
5319
5316
  super(), this.item = t, this.containerElement = i, this.context = n, this.hookManager = o, this.renderer = s, this.settings = r, this.layoutTriggerSubject = new U(), this.lastLayout = null, this.applyDimsAfterLayout = ({
5320
5317
  blankPagePosition: a,
@@ -5345,7 +5342,7 @@ class Zo extends Y {
5345
5342
  }), { width: y, height: I };
5346
5343
  })
5347
5344
  ), this.layout = (a) => {
5348
- const c = Oi(this.layout$.pipe(H()));
5345
+ const c = Di(this.layout$.pipe(H()));
5349
5346
  return this.layoutTriggerSubject.next(a), c();
5350
5347
  }, this.adjustPositionOfElement = ({
5351
5348
  right: a,
@@ -5400,7 +5397,7 @@ class Zo extends Y {
5400
5397
  };
5401
5398
  }
5402
5399
  }
5403
- class Go extends ht {
5400
+ class Jo extends ht {
5404
5401
  onUnload() {
5405
5402
  return K;
5406
5403
  }
@@ -5436,13 +5433,13 @@ class Ue extends Y {
5436
5433
  }, this.isUsingVerticalWriting = () => {
5437
5434
  var g;
5438
5435
  return !!((g = this.renderer.writingMode) != null && g.startsWith("vertical"));
5439
- }, this.containerElement = Jo(
5436
+ }, this.containerElement = Ko(
5440
5437
  i,
5441
5438
  t,
5442
5439
  s
5443
5440
  ), i.appendChild(this.containerElement);
5444
5441
  const a = (d = (u = this.settings.values).getRenderer) == null ? void 0 : d.call(u, t);
5445
- this.resourcesHandler = new Yt(t, this.settings);
5442
+ this.resourcesHandler = new qt(t, this.settings);
5446
5443
  const c = {
5447
5444
  context: n,
5448
5445
  settings: o,
@@ -5451,7 +5448,7 @@ class Ue extends Y {
5451
5448
  containerElement: this.containerElement,
5452
5449
  resourcesHandler: this.resourcesHandler
5453
5450
  };
5454
- this.renderer = a ? a(c) : new Go(c), this.layout = new Zo(
5451
+ this.renderer = a ? a(c) : new Jo(c), this.layout = new Go(
5455
5452
  t,
5456
5453
  this.containerElement,
5457
5454
  n,
@@ -5514,7 +5511,7 @@ class Ue extends Y {
5514
5511
  return this.renderer.renditionLayout;
5515
5512
  }
5516
5513
  get numberOfPages() {
5517
- return Jt({
5514
+ return Gt({
5518
5515
  isUsingVerticalWriting: !!this.isUsingVerticalWriting(),
5519
5516
  itemHeight: this.layout.layoutInfo.height,
5520
5517
  itemWidth: this.layout.layoutInfo.width,
@@ -5523,14 +5520,14 @@ class Ue extends Y {
5523
5520
  });
5524
5521
  }
5525
5522
  }
5526
- const Jo = (e, t, i) => {
5523
+ const Ko = (e, t, i) => {
5527
5524
  const n = e.ownerDocument.createElement("div");
5528
5525
  return n.classList.add("spineItem"), n.classList.add(`spineItem-${t.renditionLayout ?? "reflowable"}`), n.style.cssText = `
5529
5526
  position: absolute;
5530
5527
  overflow: hidden;
5531
5528
  `, n.dataset.isReady = "false", i.execute("item.onBeforeContainerCreated", void 0, { element: n }), n;
5532
5529
  };
5533
- class Ko extends Y {
5530
+ class Qo extends Y {
5534
5531
  constructor(t, i) {
5535
5532
  super(), this.spineItemsManager = t, this.spineLocator = i, this.itemIsReady$ = this.spineItemsManager.items$.pipe(
5536
5533
  v((n) => {
@@ -5560,7 +5557,7 @@ class Ko extends Y {
5560
5557
  );
5561
5558
  }
5562
5559
  }
5563
- const Qo = ({
5560
+ const ts = ({
5564
5561
  horizontalOffset: e,
5565
5562
  verticalOffset: t,
5566
5563
  context: i,
@@ -5630,7 +5627,7 @@ const Qo = ({
5630
5627
  })
5631
5628
  );
5632
5629
  };
5633
- class ts extends Y {
5630
+ class es extends Y {
5634
5631
  constructor(t, i, n, o) {
5635
5632
  super(), this.spineItemsManager = t, this.context = i, this.settings = n, this.viewport = o, this.layoutSubject = new U(), this.spineItemsRelativeLayouts = [], t.items$.pipe(
5636
5633
  T(() => {
@@ -5673,8 +5670,8 @@ class ts extends Y {
5673
5670
  return W(this.spineItemsManager.items).pipe(
5674
5671
  Qe(
5675
5672
  (u, d, g) => u.pipe(
5676
- te(
5677
- ({ horizontalOffset: l, verticalOffset: p, pages: h }) => Qo({
5673
+ Qt(
5674
+ ({ horizontalOffset: l, verticalOffset: p, pages: h }) => ts({
5678
5675
  context: this.context,
5679
5676
  horizontalOffset: l,
5680
5677
  index: g,
@@ -5701,7 +5698,7 @@ class ts extends Y {
5701
5698
  ),
5702
5699
  w({ horizontalOffset: 0, verticalOffset: 0, pages: [] })
5703
5700
  ),
5704
- te((u) => u),
5701
+ Qt((u) => u),
5705
5702
  ut(() => {
5706
5703
  s.next(!1);
5707
5704
  })
@@ -5733,7 +5730,7 @@ class ts extends Y {
5733
5730
  super.destroy(), this.layoutSubject.complete();
5734
5731
  }
5735
5732
  }
5736
- class es extends Y {
5733
+ class is extends Y {
5737
5734
  constructor(t, i, n, o, s) {
5738
5735
  super(), this.context = t, this.spineItemsManager = i, this.spineLocator = n, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new k([]);
5739
5736
  const r = this.forcedOpenSubject.pipe(
@@ -5786,7 +5783,7 @@ class es extends Y {
5786
5783
  }
5787
5784
  const He = (e, t, i) => {
5788
5785
  const n = (i.width - t.width) / 2, o = (i.height - t.height) / 2;
5789
- return new Zt({
5786
+ return new Yt({
5790
5787
  x: e.x - n,
5791
5788
  y: e.y - o
5792
5789
  });
@@ -5809,17 +5806,17 @@ class yt extends DOMRect {
5809
5806
  return new yt(n.x, n.y, n.width, n.height);
5810
5807
  }
5811
5808
  }
5812
- class is {
5809
+ class ns {
5813
5810
  constructor({ width: t, height: i }) {
5814
5811
  this.__symbol = Symbol("AbsoluteViewport"), this.width = t, this.height = i;
5815
5812
  }
5816
5813
  }
5817
- class ns {
5814
+ class os {
5818
5815
  constructor({ width: t, height: i }) {
5819
5816
  this.__symbol = Symbol("RelativeViewport"), this.width = t, this.height = i;
5820
5817
  }
5821
5818
  }
5822
- const os = ({
5819
+ const ss = ({
5823
5820
  pageIndex: e,
5824
5821
  spineItemOrId: t,
5825
5822
  spineItemsManager: i
@@ -5841,7 +5838,7 @@ const os = ({
5841
5838
  { currentAbsolutePage: 0, found: !1 }
5842
5839
  );
5843
5840
  return s;
5844
- }, ss = ({
5841
+ }, rs = ({
5845
5842
  itemHeight: e,
5846
5843
  itemWidth: t,
5847
5844
  visibleWidthOfItem: i,
@@ -5850,7 +5847,7 @@ const os = ({
5850
5847
  }) => {
5851
5848
  const s = i / t, r = n / e;
5852
5849
  return s >= o && r >= o;
5853
- }, rs = ({
5850
+ }, as = ({
5854
5851
  visibleWidthOfItem: e,
5855
5852
  visibleHeightOfItem: t,
5856
5853
  threshold: i,
@@ -5882,14 +5879,14 @@ const os = ({
5882
5879
  Math.min(e, l) - Math.max(n, g)
5883
5880
  );
5884
5881
  if (p <= 0 || h <= 0) return { visible: !1 };
5885
- const S = rs({
5882
+ const S = as({
5886
5883
  threshold: r,
5887
5884
  visibleHeightOfItem: h,
5888
5885
  visibleWidthOfItem: p,
5889
5886
  viewportPosition: a
5890
5887
  });
5891
5888
  return c ? { visible: S } : {
5892
- visible: ss({
5889
+ visible: rs({
5893
5890
  itemHeight: s,
5894
5891
  itemWidth: o,
5895
5892
  threshold: r,
@@ -5897,7 +5894,7 @@ const os = ({
5897
5894
  visibleWidthOfItem: p
5898
5895
  }) || S
5899
5896
  };
5900
- }, as = ({
5897
+ }, cs = ({
5901
5898
  absolutePageIndex: e,
5902
5899
  spineItemsManager: t
5903
5900
  }) => {
@@ -5940,7 +5937,7 @@ const os = ({
5940
5937
  }) => new M({
5941
5938
  x: t + e.x,
5942
5939
  y: i + e.y
5943
- }), cs = ({
5940
+ }), us = ({
5944
5941
  position: e,
5945
5942
  threshold: t,
5946
5943
  restrictToScreen: i,
@@ -5980,7 +5977,7 @@ const os = ({
5980
5977
  beginIndex: l ?? 0,
5981
5978
  endIndex: p ?? 0
5982
5979
  };
5983
- }, us = ({
5980
+ }, ds = ({
5984
5981
  spineItemsManager: e,
5985
5982
  context: t,
5986
5983
  spineItemLocator: i,
@@ -6081,11 +6078,11 @@ const os = ({
6081
6078
  spineItemPosition: h
6082
6079
  });
6083
6080
  },
6084
- getAbsolutePageIndexFromPageIndex: (p) => os({
6081
+ getAbsolutePageIndexFromPageIndex: (p) => ss({
6085
6082
  ...p,
6086
6083
  spineItemsManager: e
6087
6084
  }),
6088
- getSpineInfoFromAbsolutePageIndex: (p) => as({
6085
+ getSpineInfoFromAbsolutePageIndex: (p) => cs({
6089
6086
  ...p,
6090
6087
  spineItemsManager: e
6091
6088
  }),
@@ -6099,7 +6096,7 @@ const os = ({
6099
6096
  }),
6100
6097
  getSpineItemFromIframe: c,
6101
6098
  getSpineItemPageIndexFromNode: u,
6102
- getVisibleSpineItemsFromPosition: (p) => cs({
6099
+ getVisibleSpineItemsFromPosition: (p) => us({
6103
6100
  settings: n,
6104
6101
  spineItemsManager: e,
6105
6102
  spineLayout: o,
@@ -6124,27 +6121,27 @@ const os = ({
6124
6121
  }
6125
6122
  };
6126
6123
  };
6127
- class ds extends Y {
6124
+ class gs extends Y {
6128
6125
  constructor(t, i, n, o, s, r, a, c) {
6129
- super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Ti()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new ts(
6126
+ super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Fi()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new es(
6130
6127
  o,
6131
6128
  i,
6132
6129
  r,
6133
6130
  c
6134
- ), this.locator = us({
6131
+ ), this.locator = ds({
6135
6132
  context: i,
6136
6133
  spineItemsManager: o,
6137
6134
  spineItemLocator: s,
6138
6135
  settings: r,
6139
6136
  spineLayout: this.spineLayout,
6140
6137
  viewport: c
6141
- }), this.spineItemsLoader = new es(
6138
+ }), this.spineItemsLoader = new is(
6142
6139
  this.context,
6143
6140
  o,
6144
6141
  this.locator,
6145
6142
  r,
6146
6143
  this.spineLayout
6147
- ), this.spineItemsObserver = new Ko(
6144
+ ), this.spineItemsObserver = new Qo(
6148
6145
  o,
6149
6146
  this.locator
6150
6147
  );
@@ -6184,7 +6181,7 @@ class ds extends Y {
6184
6181
  super.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue().remove(), this.elementSubject.complete();
6185
6182
  }
6186
6183
  }
6187
- class gs extends Y {
6184
+ class ls extends Y {
6188
6185
  constructor(t, i) {
6189
6186
  super(), this.context = t, this.settings = i, this.orderedSpineItemsSubject = new k([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
6190
6187
  }
@@ -6211,7 +6208,7 @@ class gs extends Y {
6211
6208
  }
6212
6209
  // @todo move
6213
6210
  getSpineItemFromCfi(t) {
6214
- const { itemIndex: i } = Gt(t);
6211
+ const { itemIndex: i } = Zt(t);
6215
6212
  if (i !== void 0)
6216
6213
  return this.get(i);
6217
6214
  }
@@ -6225,7 +6222,7 @@ class gs extends Y {
6225
6222
  this.orderedSpineItemsSubject.value.forEach((t) => t.destroy());
6226
6223
  }
6227
6224
  }
6228
- class ls extends bt {
6225
+ class ps extends bt {
6229
6226
  constructor(t) {
6230
6227
  const i = document.createElement("div");
6231
6228
  i.style.cssText = `
@@ -6259,7 +6256,7 @@ class ls extends bt {
6259
6256
  }
6260
6257
  get absoluteViewport() {
6261
6258
  const t = this.context.state.visibleAreaRect;
6262
- return new is({
6259
+ return new ns({
6263
6260
  width: t.width,
6264
6261
  height: t.height
6265
6262
  });
@@ -6274,19 +6271,19 @@ class ls extends bt {
6274
6271
  */
6275
6272
  get relativeViewport() {
6276
6273
  const t = this.absoluteViewport, i = this.value.element.getBoundingClientRect(), n = ((i == null ? void 0 : i.width) ?? t.width) / t.width;
6277
- return new ns({
6274
+ return new os({
6278
6275
  width: t.width / n,
6279
6276
  height: t.height / n
6280
6277
  });
6281
6278
  }
6282
6279
  }
6283
- const ps = (e) => {
6284
- const t = new U(), i = new lo(), n = new uo(), o = new Yo(e, n), s = new go(n, o), r = new gs(n, o), a = new k(
6280
+ const hs = (e) => {
6281
+ const t = new U(), i = new po(), n = new go(), o = new Zo(e, n), s = new lo(n, o), r = new ls(n, o), a = new k(
6285
6282
  void 0
6286
- ), c = new ls(n), u = a.pipe(tt(ct)), d = ze({
6283
+ ), c = new ps(n), u = a.pipe(tt(ct)), d = ze({
6287
6284
  context: n,
6288
6285
  settings: o
6289
- }), g = new _o(n, r), l = new ds(
6286
+ }), g = new Xo(n, r), l = new gs(
6290
6287
  u,
6291
6288
  n,
6292
6289
  g,
@@ -6295,14 +6292,14 @@ const ps = (e) => {
6295
6292
  o,
6296
6293
  i,
6297
6294
  c
6298
- ), p = Bo({
6295
+ ), p = _o({
6299
6296
  context: n,
6300
6297
  spineItemsManager: r,
6301
6298
  hookManager: i,
6302
6299
  spine: l,
6303
6300
  settings: o,
6304
6301
  viewport: c
6305
- }), h = new Xo(
6302
+ }), h = new qo(
6306
6303
  n,
6307
6304
  g,
6308
6305
  r,
@@ -6338,7 +6335,7 @@ const ps = (e) => {
6338
6335
  return;
6339
6336
  }
6340
6337
  j.log("load", { options: y });
6341
- const $ = hs(I);
6338
+ const $ = ms(I);
6342
6339
  I !== ((L = a.getValue()) == null ? void 0 : L.parentElement) && (a.next($), I.appendChild($)), n.update({
6343
6340
  manifest: P,
6344
6341
  containerElement: I,
@@ -6354,9 +6351,9 @@ const ps = (e) => {
6354
6351
  spine: l,
6355
6352
  hookManager: i,
6356
6353
  cfi: {
6357
- generateCfiFromRange: Cn,
6358
- generateCfiFromSelection: Rn,
6359
- parseCfi: Gt,
6354
+ generateCfiFromRange: Rn,
6355
+ generateCfiFromSelection: An,
6356
+ parseCfi: Zt,
6360
6357
  generateCfiForSpineItemPage: (y) => Wt({
6361
6358
  ...y,
6362
6359
  spineItemLocator: d
@@ -6396,33 +6393,33 @@ const ps = (e) => {
6396
6393
  destroy$: t
6397
6394
  }
6398
6395
  };
6399
- }, hs = (e) => {
6396
+ }, ms = (e) => {
6400
6397
  const t = e.ownerDocument.createElement("div");
6401
6398
  return t.style.cssText = `
6402
6399
  background-color: white;
6403
6400
  position: relative;
6404
6401
  `, t.className = `${lt}-reader`, t;
6405
- }, Ps = (
6402
+ }, vs = (
6406
6403
  //__
6407
- to(
6408
- ji(
6409
- yn(
6410
- no(
6411
- Vi(
6412
- fi(
6413
- Zn(
6414
- io(
6415
- ro(
6416
- Mn(
6417
- sn(
6418
- bn(
6419
- yi(
6420
- eo(
6421
- Xn(
6422
- pn(
6423
- Ai(
6404
+ eo(
6405
+ ki(
6406
+ Sn(
6407
+ oo(
6408
+ ji(
6409
+ yi(
6410
+ Gn(
6411
+ no(
6412
+ ao(
6413
+ Cn(
6414
+ rn(
6415
+ In(
6416
+ Si(
6417
+ io(
6418
+ qn(
6419
+ hn(
6420
+ Oi(
6424
6421
  // __
6425
- ps
6422
+ hs
6426
6423
  )
6427
6424
  )
6428
6425
  )
@@ -6444,29 +6441,29 @@ const ps = (e) => {
6444
6441
  export {
6445
6442
  Y as DestroyableClass,
6446
6443
  ht as DocumentRenderer,
6447
- lo as HookManager,
6448
- Yt as ResourceHandler,
6449
- qo as SettingsManager,
6444
+ po as HookManager,
6445
+ qt as ResourceHandler,
6446
+ Yo as SettingsManager,
6450
6447
  Ue as SpineItem,
6451
- Ps as createReader,
6452
- ne as deferIdle,
6453
- Oi as deferNextResult,
6454
- ie as getAttributeValueFromString,
6455
- _t as getFrameViewportInfo,
6448
+ vs as createReader,
6449
+ ie as deferIdle,
6450
+ Di as deferNextResult,
6451
+ ee as getAttributeValueFromString,
6452
+ Bt as getFrameViewportInfo,
6456
6453
  Fe as idle,
6457
- li as injectCSS,
6454
+ pi as injectCSS,
6458
6455
  Pe as isHtmlElement,
6459
- Li as isHtmlTagElement,
6460
- $s as isShallowEqual,
6456
+ Mi as isHtmlTagElement,
6457
+ Ts as isShallowEqual,
6461
6458
  $e as mapKeysTo,
6462
- bs as observeIntersection,
6463
- oe as observeMutation,
6459
+ Is as observeIntersection,
6460
+ ne as observeMutation,
6464
6461
  Te as observeResize,
6465
- pi as removeCSS,
6462
+ hi as removeCSS,
6466
6463
  ot as upsertCSSToFrame,
6467
- hi as waitForFrameLoad,
6468
- mi as waitForFrameReady,
6464
+ mi as waitForFrameLoad,
6465
+ fi as waitForFrameReady,
6469
6466
  Ct as waitForSwitch,
6470
- qt as watchKeys
6467
+ Xt as watchKeys
6471
6468
  };
6472
6469
  //# sourceMappingURL=index.js.map