@prose-reader/react-reader 1.205.0 → 1.207.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.
@@ -1,2 +1,2 @@
1
- export declare const toaster: import('@ark-ui/react').CreateToasterReturn;
1
+ export declare const toaster: import('@zag-js/toast').Store<any>;
2
2
  export declare const Toaster: () => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { Context } from 'react';
3
3
  import { Signal } from 'reactjrx';
4
4
  type ContextType = {
5
5
  reader: Reader | undefined;
6
- quickMenuSignal: Signal<boolean, boolean, undefined>;
6
+ quickMenuSignal: Signal<boolean, undefined>;
7
7
  };
8
8
  export declare const ReaderContext: Context<ContextType>;
9
9
  export {};
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx as t, jsxs as d, Fragment as Z } from "react/jsx-runtime";
2
2
  import * as A from "react";
3
- import Oe, { createContext as ze, memo as m, useMemo as be, useEffect as J, useContext as xe, useState as I, useLayoutEffect as De, useCallback as q } from "react";
4
- import { signal as Ce, useSignal as ve, useLiveRef as Ee, useSubscribe as M, useObserve as x, useSignalValue as Ae, isDefined as Me } from "reactjrx";
5
- import { tap as ce, switchMap as Q, NEVER as ee, startWith as ye, distinctUntilChanged as Ie, map as te, throttleTime as _e, filter as re, first as ke, combineLatest as Le, EMPTY as Be, Subject as $e, finalize as Se, skip as ie, mergeMap as Ne, merge as Fe, timer as He } from "rxjs";
6
- import { IconButton as b, Portal as de, Dialog as y, List as S, Link as ne, Stack as P, Text as p, Button as _, Presence as W, Box as R, createToaster as je, Toaster as Ve, Toast as L, Spinner as Ge, Heading as le, HStack as E, Kbd as me, Popover as B, Progress as K, chakra as Ye, Collapsible as oe, Input as Ue } from "@chakra-ui/react";
7
- import { LuX as qe, LuNotebookPen as se, LuArrowBigRight as Qe, LuArrowBigLeft as Ke, LuChevronDown as We, LuCircleHelp as Xe, LuTableOfContents as Ze, LuSearch as Je, LuGalleryHorizontal as et, LuCircleCheck as fe } from "react-icons/lu";
3
+ import Oe, { createContext as ze, memo as m, useMemo as xe, useEffect as J, useContext as Ce, useState as I, useLayoutEffect as De, useCallback as q } from "react";
4
+ import { signal as ee, useSignalState as ve, useLiveRef as Ee, useSubscribe as M, useObserve as x, useSignalValue as Ae, isDefined as Me } from "reactjrx";
5
+ import { tap as de, switchMap as Q, NEVER as te, startWith as ye, distinctUntilChanged as Ie, map as ne, throttleTime as _e, filter as ie, first as ke, combineLatest as Le, EMPTY as Be, Subject as $e, finalize as Se, skip as le, mergeMap as Ne, merge as Fe, timer as He } from "rxjs";
6
+ import { IconButton as b, Portal as he, Dialog as y, List as S, Link as oe, Stack as P, Text as p, Button as _, Presence as W, Box as R, createToaster as je, Toaster as Ge, Toast as L, Spinner as Ve, Heading as se, HStack as E, Kbd as fe, Popover as B, Progress as K, chakra as Ye, Collapsible as re, Input as Ue } from "@chakra-ui/react";
7
+ import { LuX as qe, LuNotebookPen as ae, LuArrowBigRight as Qe, LuArrowBigLeft as Ke, LuChevronDown as We, LuCircleHelp as Xe, LuTableOfContents as Ze, LuSearch as Je, LuGalleryHorizontal as et, LuCircleCheck as be } from "react-icons/lu";
8
8
  import { createPortal as tt } from "react-dom";
9
9
  import { BsBookmarkPlus as nt, BsBookmarkXFill as ot, BsBookmarks as rt } from "react-icons/bs";
10
10
  import { isShallowEqual as it, observeIntersection as lt, isHtmlTagElement as st } from "@prose-reader/core";
@@ -15,9 +15,9 @@ import pt from "rc-slider";
15
15
  import "rc-slider/assets/index.css";
16
16
  import { IoIosArrowBack as mt, IoMdMore as ft } from "react-icons/io";
17
17
  import { MdFullscreenExit as bt, MdFullscreen as xt } from "react-icons/md";
18
- const he = ze({
18
+ const ue = ze({
19
19
  reader: void 0,
20
- quickMenuSignal: Ce({ default: !1 })
20
+ quickMenuSignal: ee({ default: !1 })
21
21
  }), Sn = m(
22
22
  ({
23
23
  children: e,
@@ -25,9 +25,11 @@ const he = ze({
25
25
  quickMenuOpen: o,
26
26
  onQuickMenuOpenChange: r
27
27
  }) => {
28
- const [, i] = ve({
29
- default: o
30
- }), l = Ee(r), s = be(
28
+ const [, i] = ve(
29
+ () => ee({
30
+ default: o
31
+ })
32
+ ), l = Ee(r), s = xe(
31
33
  () => ({
32
34
  quickMenuSignal: i,
33
35
  reader: n
@@ -37,9 +39,9 @@ const he = ze({
37
39
  return J(() => {
38
40
  i.setValue(o);
39
41
  }, [o, i]), M(
40
- () => i.subject.pipe(ce(l.current)),
42
+ () => i.subject.pipe(de(l.current)),
41
43
  [i, l]
42
- ), /* @__PURE__ */ t(he.Provider, { value: s, children: e });
44
+ ), /* @__PURE__ */ t(ue.Provider, { value: s, children: e });
43
45
  }
44
46
  ), Ct = A.forwardRef(function(n, o) {
45
47
  return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(qe, {}) });
@@ -51,7 +53,7 @@ const he = ze({
51
53
  backdrop: s = !0,
52
54
  ...c
53
55
  } = n;
54
- return /* @__PURE__ */ d(de, { disabled: !i, container: l, children: [
56
+ return /* @__PURE__ */ d(he, { disabled: !i, container: l, children: [
55
57
  s && /* @__PURE__ */ t(y.Backdrop, {}),
56
58
  /* @__PURE__ */ t(y.Positioner, { children: /* @__PURE__ */ t(y.Content, { ref: o, ...c, asChild: !1, children: r }) })
57
59
  ] });
@@ -67,15 +69,15 @@ const he = ze({
67
69
  children: /* @__PURE__ */ t(Ct, { size: "sm", ref: o, children: n.children })
68
70
  }
69
71
  );
70
- }), F = y.Root, H = y.Footer, j = y.Header, V = y.Body;
72
+ }), F = y.Root, H = y.Footer, j = y.Header, G = y.Body;
71
73
  y.Backdrop;
72
- const G = y.Title;
74
+ const V = y.Title;
73
75
  y.Description;
74
76
  y.Trigger;
75
77
  const Y = y.ActionTrigger, C = () => {
76
- const { reader: e } = xe(he);
78
+ const { reader: e } = Ce(ue);
77
79
  return e;
78
- }, we = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, ue = (e) => !!e && "__PROSE_READER_ENHANCER_BOOKMARKS" in e, Te = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Pe = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, vt = m(
80
+ }, we = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, ge = (e) => !!e && "__PROSE_READER_ENHANCER_BOOKMARKS" in e, Te = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Pe = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, vt = m(
79
81
  ({ onNavigate: e }) => {
80
82
  const n = C(), o = Te(n) ? n : void 0, r = x(
81
83
  () => o == null ? void 0 : o.annotations.highlights$.pipe(
@@ -87,14 +89,14 @@ const Y = y.ActionTrigger, C = () => {
87
89
  ), i = (l, s) => {
88
90
  var c, u, a;
89
91
  return /* @__PURE__ */ t(S.Item, { children: /* @__PURE__ */ d(
90
- ne,
92
+ oe,
91
93
  {
92
94
  href: "#",
93
95
  onClick: () => {
94
96
  e(), n == null || n.navigation.goToCfi(l.meta.cfi ?? "");
95
97
  },
96
98
  children: [
97
- (((c = l.resource) == null ? void 0 : c.contents) ?? [])[0] ? /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(se, {}) }) : /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(se, {}) }),
99
+ (((c = l.resource) == null ? void 0 : c.contents) ?? [])[0] ? /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ae, {}) }) : /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ae, {}) }),
98
100
  /* @__PURE__ */ d(P, { gap: 0, children: [
99
101
  /* @__PURE__ */ t(p, { lineClamp: 2, fontSize: "md", children: (u = l.resource) != null && u.selectionAsText ? l.resource.selectionAsText ?? "" : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
100
102
  /* @__PURE__ */ t(
@@ -130,15 +132,15 @@ const Y = y.ActionTrigger, C = () => {
130
132
  size: { mdDown: "full", md: "lg" },
131
133
  scrollBehavior: "inside",
132
134
  children: /* @__PURE__ */ d($, { height: "100%", children: [
133
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Annotations" }) }),
134
- /* @__PURE__ */ t(V, { flex: 1, children: /* @__PURE__ */ t(vt, { onNavigate: o }) }),
135
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Annotations" }) }),
136
+ /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(vt, { onNavigate: o }) }),
135
137
  /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
136
138
  /* @__PURE__ */ t(N, {})
137
139
  ] })
138
140
  }
139
141
  )
140
142
  ), It = m(() => {
141
- const e = C(), n = ue(e) ? e : void 0, o = x(() => e == null ? void 0 : e.spine.element$, [e]), r = x(
143
+ const e = C(), n = ge(e) ? e : void 0, o = x(() => e == null ? void 0 : e.spine.element$, [e]), r = x(
142
144
  () => n == null ? void 0 : n.bookmarks.pages$,
143
145
  [n]
144
146
  ), i = x(
@@ -216,7 +218,7 @@ const Y = y.ActionTrigger, C = () => {
216
218
  ) }) : null;
217
219
  }), kt = m(
218
220
  ({ onNavigate: e }) => {
219
- const n = C(), o = ue(n) ? n : void 0, r = x(
221
+ const n = C(), o = ge(n) ? n : void 0, r = x(
220
222
  () => o == null ? void 0 : o.bookmarks.bookmarks$.pipe(
221
223
  Q((l) => o.locateResource(l))
222
224
  ),
@@ -225,7 +227,7 @@ const Y = y.ActionTrigger, C = () => {
225
227
  var c, u, a, g, h;
226
228
  return /* @__PURE__ */ d(S.Item, { justifyContent: "space-between", alignItems: "center", children: [
227
229
  /* @__PURE__ */ t(
228
- ne,
230
+ oe,
229
231
  {
230
232
  href: "#",
231
233
  onClick: () => {
@@ -280,20 +282,20 @@ const Y = y.ActionTrigger, C = () => {
280
282
  size: { mdDown: "full", md: "lg" },
281
283
  scrollBehavior: "inside",
282
284
  children: /* @__PURE__ */ d($, { height: "100%", children: [
283
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Bookmarks" }) }),
284
- /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(kt, { onNavigate: o }) }),
285
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Bookmarks" }) }),
286
+ /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(kt, { onNavigate: o }) }),
285
287
  /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
286
288
  /* @__PURE__ */ t(N, {})
287
289
  ] })
288
290
  }
289
291
  )
290
- ), ae = je({
292
+ ), ce = je({
291
293
  placement: "bottom-end",
292
294
  pauseOnPageIdle: !0
293
- }), wt = () => /* @__PURE__ */ t(de, { children: /* @__PURE__ */ t(Ve, { toaster: ae, insetInline: { mdDown: "4" }, children: (e) => {
295
+ }), wt = () => /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(Ge, { toaster: ce, insetInline: { mdDown: "4" }, children: (e) => {
294
296
  var n;
295
297
  return /* @__PURE__ */ d(L.Root, { width: { md: "sm" }, children: [
296
- e.type === "loading" ? /* @__PURE__ */ t(Ge, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(L.Indicator, {}),
298
+ e.type === "loading" ? /* @__PURE__ */ t(Ve, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(L.Indicator, {}),
297
299
  /* @__PURE__ */ d(P, { gap: "1", flex: "1", maxWidth: "100%", children: [
298
300
  e.title && /* @__PURE__ */ t(L.Title, { children: e.title }),
299
301
  e.description && /* @__PURE__ */ t(L.Description, { children: e.description })
@@ -312,7 +314,7 @@ const Y = y.ActionTrigger, C = () => {
312
314
  right: 0
313
315
  };
314
316
  function Pt() {
315
- const [e, n] = I(null), [o, r] = I(Tt), i = be(
317
+ const [e, n] = I(null), [o, r] = I(Tt), i = xe(
316
318
  () => new ResizeObserver((l) => {
317
319
  if (l[0]) {
318
320
  const { x: s, y: c, width: u, height: a, top: g, left: h, bottom: f, right: v } = l[0].contentRect;
@@ -331,20 +333,20 @@ function Pt() {
331
333
  const Rt = (e, n, o) => {
332
334
  const r = C(), i = Pe(r) ? r : void 0;
333
335
  M(() => {
334
- if (!i || !e) return ee;
336
+ if (!i || !e) return te;
335
337
  const l = n.layout.layout$.pipe(
336
338
  ye(n.layout.layoutInfo),
337
339
  Ie(it)
338
340
  ), s = lt(
339
341
  e
340
- ).pipe(te((c) => c.some((u) => u.isIntersecting)));
342
+ ).pipe(ne((c) => c.some((u) => u.isIntersecting)));
341
343
  return l.pipe(
342
344
  _e(100, void 0, { trailing: !0 }),
343
345
  Q(() => s.pipe(
344
- ce((c) => {
346
+ de((c) => {
345
347
  c || (e.innerHTML = "");
346
348
  }),
347
- re((c) => c),
349
+ ie((c) => c),
348
350
  ke()
349
351
  ).pipe(
350
352
  Q(() => (e.innerHTML = "", i == null ? void 0 : i.gallery.snapshot(
@@ -430,8 +432,8 @@ const Rt = (e, n, o) => {
430
432
  size: { mdDown: "full", md: "lg" },
431
433
  scrollBehavior: "inside",
432
434
  children: /* @__PURE__ */ d($, { height: "100%", children: [
433
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Gallery" }) }),
434
- /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(
435
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Gallery" }) }),
436
+ /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
435
437
  R,
436
438
  {
437
439
  gridTemplateColumns: [
@@ -460,7 +462,7 @@ const Rt = (e, n, o) => {
460
462
  }
461
463
  );
462
464
  }
463
- ), Dt = "@prose-reader/react-reader", Et = "1.204.0", At = m(
465
+ ), Dt = "@prose-reader/react-reader", Et = "1.206.0", At = m(
464
466
  ({
465
467
  open: e,
466
468
  setOpen: n
@@ -474,20 +476,20 @@ const Rt = (e, n, o) => {
474
476
  size: { mdDown: "full", md: "lg" },
475
477
  scrollBehavior: "inside",
476
478
  children: /* @__PURE__ */ d($, { children: [
477
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Help" }) }),
478
- /* @__PURE__ */ d(V, { overflowY: "auto", flex: 1, children: [
479
- /* @__PURE__ */ t(le, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
479
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Help" }) }),
480
+ /* @__PURE__ */ d(G, { overflowY: "auto", flex: 1, children: [
481
+ /* @__PURE__ */ t(se, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
480
482
  /* @__PURE__ */ d(E, { mb: 1, children: [
481
- /* @__PURE__ */ t(me, { children: /* @__PURE__ */ t(Qe, {}) }),
483
+ /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(Qe, {}) }),
482
484
  " ",
483
485
  /* @__PURE__ */ t(p, { children: "Navigate to right page" })
484
486
  ] }),
485
487
  /* @__PURE__ */ d(E, { mb: 1, children: [
486
- /* @__PURE__ */ t(me, { children: /* @__PURE__ */ t(Ke, {}) }),
488
+ /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(Ke, {}) }),
487
489
  " ",
488
490
  /* @__PURE__ */ t(p, { children: "Navigate to left page" })
489
491
  ] }),
490
- /* @__PURE__ */ t(le, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
492
+ /* @__PURE__ */ t(se, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
491
493
  /* @__PURE__ */ d(p, { children: [
492
494
  Dt,
493
495
  " version: ",
@@ -503,7 +505,7 @@ const Rt = (e, n, o) => {
503
505
  const e = C();
504
506
  return x(
505
507
  () => e ? Le([e.pagination.state$, e.context.state$]).pipe(
506
- te(([n, o]) => {
508
+ ne(([n, o]) => {
507
509
  var i;
508
510
  const r = (i = o.manifest) == null ? void 0 : i.spineItems.every(
509
511
  (l) => {
@@ -516,7 +518,7 @@ const Rt = (e, n, o) => {
516
518
  hasChapters: !o.isFullyPrePaginated && !r
517
519
  };
518
520
  })
519
- ) : ee,
521
+ ) : te,
520
522
  [e]
521
523
  );
522
524
  }, Mt = () => {
@@ -541,11 +543,11 @@ const Rt = (e, n, o) => {
541
543
  hour: "2-digit",
542
544
  minute: "2-digit"
543
545
  }) });
544
- }, ge = () => {
545
- const { quickMenuSignal: e } = xe(he);
546
+ }, pe = () => {
547
+ const { quickMenuSignal: e } = Ce(ue);
546
548
  return [Ae(e), e.setValue, e];
547
549
  }, Bt = () => {
548
- const [e] = ge();
550
+ const [e] = pe();
549
551
  return /* @__PURE__ */ t(
550
552
  R,
551
553
  {
@@ -571,7 +573,7 @@ const Rt = (e, n, o) => {
571
573
  }),
572
574
  [e]
573
575
  );
574
- }, X = Ce({
576
+ }, X = ee({
575
577
  default: void 0
576
578
  }), Nt = () => {
577
579
  const e = C();
@@ -585,7 +587,7 @@ const Rt = (e, n, o) => {
585
587
  title: "Zooming",
586
588
  duration: 999999,
587
589
  abort: o
588
- }), ee.pipe(
590
+ }), te.pipe(
589
591
  Se(() => {
590
592
  o.next(), o.complete();
591
593
  })
@@ -598,10 +600,10 @@ const Rt = (e, n, o) => {
598
600
  const e = C();
599
601
  M(
600
602
  () => e == null ? void 0 : e.settings.values$.pipe(
601
- te(({ fontScale: n }) => n),
603
+ ne(({ fontScale: n }) => n),
602
604
  Ie(),
603
- ie(1),
604
- ce((n) => {
605
+ le(1),
606
+ de((n) => {
605
607
  X.setValue({
606
608
  key: "fontScaleChange",
607
609
  title: "Font size changed",
@@ -615,25 +617,25 @@ const Rt = (e, n, o) => {
615
617
  Ft(), Nt(), M(
616
618
  () => X.subject.pipe(
617
619
  // @todo implement Signal / BehaviorSignal / ReplaySignal
618
- ie(1),
619
- re(Me),
620
+ le(1),
621
+ ie(Me),
620
622
  Ne((e) => {
621
- const n = e.duration ?? 3e3, o = ae.create({
623
+ const n = e.duration ?? 3e3, o = ce.create({
622
624
  title: e.title,
623
625
  description: e.description,
624
626
  duration: n
625
627
  }), r = X.subject.pipe(
626
- ie(1),
627
- re((i) => !!e.key && (i == null ? void 0 : i.key) === e.key)
628
+ le(1),
629
+ ie((i) => !!e.key && (i == null ? void 0 : i.key) === e.key)
628
630
  );
629
631
  return Fe(
630
632
  He(n),
631
- e.abort ?? ee,
633
+ e.abort ?? te,
632
634
  r
633
635
  ).pipe(
634
636
  ke(),
635
637
  Se(() => {
636
- ae.dismiss(o);
638
+ ce.dismiss(o);
637
639
  })
638
640
  );
639
641
  })
@@ -656,7 +658,7 @@ const Rt = (e, n, o) => {
656
658
  positioning: { ...u.positioning, gutter: 4 },
657
659
  children: [
658
660
  /* @__PURE__ */ t(B.Trigger, { asChild: !0, children: i }),
659
- /* @__PURE__ */ t(de, { disabled: !l, container: c, children: /* @__PURE__ */ t(B.Positioner, { children: /* @__PURE__ */ d(
661
+ /* @__PURE__ */ t(he, { disabled: !l, container: c, children: /* @__PURE__ */ t(B.Positioner, { children: /* @__PURE__ */ d(
660
662
  B.Content,
661
663
  {
662
664
  width: "auto",
@@ -675,7 +677,7 @@ const Rt = (e, n, o) => {
675
677
  }
676
678
  );
677
679
  }
678
- ), Vt = A.forwardRef(function(n, o) {
680
+ ), Gt = A.forwardRef(function(n, o) {
679
681
  const { children: r, ...i } = n;
680
682
  return /* @__PURE__ */ t(jt, { content: r, ...i, ref: o, children: /* @__PURE__ */ t(
681
683
  b,
@@ -687,17 +689,17 @@ const Rt = (e, n, o) => {
687
689
  children: /* @__PURE__ */ t(gt, {})
688
690
  }
689
691
  ) });
690
- }), Gt = A.forwardRef(function(n, o) {
692
+ }), Vt = A.forwardRef(function(n, o) {
691
693
  return /* @__PURE__ */ t(K.Track, { ...n, ref: o, children: /* @__PURE__ */ t(K.Range, {}) });
692
694
  });
693
695
  A.forwardRef(function(n, o) {
694
696
  const { children: r, info: i, ...l } = n;
695
697
  return /* @__PURE__ */ d(K.Label, { ...l, ref: o, children: [
696
698
  r,
697
- i && /* @__PURE__ */ t(Vt, { children: i })
699
+ i && /* @__PURE__ */ t(Gt, { children: i })
698
700
  ] });
699
701
  });
700
- const Yt = K.Root, Ut = K.ValueText, pe = () => {
702
+ const Yt = K.Root, Ut = K.ValueText, me = () => {
701
703
  const e = U(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, i = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, l = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [s = 0, c = 0] = [
702
704
  i,
703
705
  l
@@ -720,10 +722,10 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
720
722
  rightPageIndex: r,
721
723
  totalApproximatePages: i,
722
724
  beginAndEndAreDifferent: l
723
- } = pe(), s = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), c = (a) => a != null && a.subChapter ? `${a.title} / ${c(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = c(e == null ? void 0 : e.beginChapterInfo);
725
+ } = me(), s = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), c = (a) => a != null && a.subChapter ? `${a.title} / ${c(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = c(e == null ? void 0 : e.beginChapterInfo);
724
726
  return /* @__PURE__ */ d(P, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
725
727
  /* @__PURE__ */ t(Yt, { value: s, size: "xs", width: 150, children: /* @__PURE__ */ d(E, { justifyContent: "space-between", children: [
726
- /* @__PURE__ */ t(Gt, { width: 110 }),
728
+ /* @__PURE__ */ t(Vt, { width: 110 }),
727
729
  /* @__PURE__ */ t(Ut, { children: `${s}%` })
728
730
  ] }) }),
729
731
  /* @__PURE__ */ t(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
@@ -824,14 +826,16 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
824
826
  )
825
827
  }
826
828
  )), Wt = () => {
827
- const e = U(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = pe(), i = n ? Math.floor((o || 0) / 2) : o, [l, s] = ve({
828
- default: i || 0
829
- }), c = 0, u = Math.max(
829
+ const e = U(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = me(), i = n ? Math.floor((o || 0) / 2) : o, [l, s] = ve(
830
+ () => ee({
831
+ default: i || 0
832
+ })
833
+ ), c = 0, u = Math.max(
830
834
  0,
831
835
  n ? Math.floor((r - 1) / 2) : r - 1
832
836
  );
833
837
  return J(() => {
834
- s.setValue(i || 0);
838
+ s.update(i || 0);
835
839
  }, [i, s]), {
836
840
  value: l,
837
841
  valueSignal: s,
@@ -839,14 +843,14 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
839
843
  max: u
840
844
  };
841
845
  }, Xt = (e) => {
842
- const n = C(), o = U(), { manifest: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, i = (r == null ? void 0 : r.readingDirection) === "rtl", l = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = pe(), u = 1, a = c, { value: g, valueSignal: h, min: f, max: v } = Wt(), w = q(
846
+ const n = C(), o = U(), { manifest: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, i = (r == null ? void 0 : r.readingDirection) === "rtl", l = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = me(), u = 1, a = c, { value: g, valueSignal: h, min: f, max: v } = Wt(), w = q(
843
847
  (O) => {
844
848
  const [k = 0] = Array.isArray(O) ? O : [O];
845
849
  h.setValue(k);
846
850
  const D = l ? Math.floor(k) * 2 : Math.floor(k);
847
851
  a ? n == null || n.navigation.goToPageOfSpineItem({
848
852
  pageIndex: D,
849
- spineItemId: n.pagination.getState().beginSpineItemIndex ?? 0,
853
+ spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
850
854
  animation: !1
851
855
  }) : n == null || n.navigation.goToAbsolutePageIndex({
852
856
  absolutePageIndex: D,
@@ -942,7 +946,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
942
946
  )
943
947
  ] }),
944
948
  /* @__PURE__ */ t(E, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ d(
945
- oe.Root,
949
+ re.Root,
946
950
  {
947
951
  open: s,
948
952
  flex: 1,
@@ -951,7 +955,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
951
955
  },
952
956
  children: [
953
957
  /* @__PURE__ */ t(
954
- oe.Trigger,
958
+ re.Trigger,
955
959
  {
956
960
  paddingY: "3",
957
961
  width: "100%",
@@ -967,7 +971,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
967
971
  )
968
972
  }
969
973
  ),
970
- /* @__PURE__ */ d(oe.Content, { display: "flex", justifyContent: "center", children: [
974
+ /* @__PURE__ */ d(re.Content, { display: "flex", justifyContent: "center", children: [
971
975
  /* @__PURE__ */ t(
972
976
  b,
973
977
  {
@@ -998,7 +1002,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
998
1002
  children: /* @__PURE__ */ t(Je, {})
999
1003
  }
1000
1004
  ),
1001
- ue(o) && /* @__PURE__ */ t(
1005
+ ge(o) && /* @__PURE__ */ t(
1002
1006
  b,
1003
1007
  {
1004
1008
  "aria-label": "Search",
@@ -1015,7 +1019,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1015
1019
  size: "lg",
1016
1020
  variant: "ghost",
1017
1021
  onClick: () => n("annotations"),
1018
- children: /* @__PURE__ */ t(se, {})
1022
+ children: /* @__PURE__ */ t(ae, {})
1019
1023
  }
1020
1024
  ),
1021
1025
  /* @__PURE__ */ t(
@@ -1136,7 +1140,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1136
1140
  ({
1137
1141
  onItemClick: e
1138
1142
  }) => {
1139
- const [n] = ge();
1143
+ const [n] = pe();
1140
1144
  return /* @__PURE__ */ d(Z, { children: [
1141
1145
  /* @__PURE__ */ t(en, { open: n, onItemClick: e }),
1142
1146
  /* @__PURE__ */ t(Zt, { open: n, onItemClick: e })
@@ -1162,7 +1166,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1162
1166
  )
1163
1167
  );
1164
1168
  return /* @__PURE__ */ d(
1165
- ne,
1169
+ oe,
1166
1170
  {
1167
1171
  href: r,
1168
1172
  style: { margin: 5, overflow: "hidden" },
@@ -1199,7 +1203,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1199
1203
  [r, e]
1200
1204
  ), c = x(
1201
1205
  () => i == null ? void 0 : i.search.search(n).pipe(
1202
- te((h) => ({ type: "end", data: h })),
1206
+ ne((h) => ({ type: "end", data: h })),
1203
1207
  ye({ type: "start" })
1204
1208
  ),
1205
1209
  [r, n]
@@ -1229,7 +1233,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1229
1233
  u && /* @__PURE__ */ t(p, { children: "Searching ..." }),
1230
1234
  !u && a.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
1231
1235
  !u && a.length >= 0 && /* @__PURE__ */ d(P, { children: [
1232
- /* @__PURE__ */ d(le, { as: "h2", size: "md", children: [
1236
+ /* @__PURE__ */ d(se, { as: "h2", size: "md", children: [
1233
1237
  a.length,
1234
1238
  " result(s)"
1235
1239
  ] }),
@@ -1270,8 +1274,8 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1270
1274
  size: { mdDown: "full", md: "lg" },
1271
1275
  scrollBehavior: "inside",
1272
1276
  children: /* @__PURE__ */ d($, { height: "100%", children: [
1273
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Search" }) }),
1274
- /* @__PURE__ */ t(V, { flex: 1, children: /* @__PURE__ */ t(on, { onNavigate: o }) }),
1277
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Search" }) }),
1278
+ /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(on, { onNavigate: o }) }),
1275
1279
  /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1276
1280
  /* @__PURE__ */ t(N, {})
1277
1281
  ] })
@@ -1298,15 +1302,15 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1298
1302
  alignItems: "center"
1299
1303
  },
1300
1304
  children: /* @__PURE__ */ d(
1301
- ne,
1305
+ oe,
1302
1306
  {
1303
1307
  onClick: () => {
1304
1308
  e(), n == null || n.navigation.goToUrl(h.href);
1305
1309
  },
1306
1310
  href: "#",
1307
1311
  children: [
1308
- (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(fe, {}) }),
1309
- (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(fe, {}) }),
1312
+ (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(be, {}) }),
1313
+ (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(be, {}) }),
1310
1314
  /* @__PURE__ */ d(P, { gap: 0, children: [
1311
1315
  /* @__PURE__ */ t(p, { fontSize: "md", children: h.title || h.path }),
1312
1316
  (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(
@@ -1345,8 +1349,8 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1345
1349
  size: { mdDown: "full", md: "lg" },
1346
1350
  scrollBehavior: "inside",
1347
1351
  children: /* @__PURE__ */ d($, { children: [
1348
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(G, { children: "Table of Contents" }) }),
1349
- /* @__PURE__ */ t(V, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ln, { onNavigate: o }) }),
1352
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Table of Contents" }) }),
1353
+ /* @__PURE__ */ t(G, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ln, { onNavigate: o }) }),
1350
1354
  /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1351
1355
  /* @__PURE__ */ t(N, {})
1352
1356
  ] })
@@ -1357,7 +1361,7 @@ const Yt = K.Root, Ut = K.ValueText, pe = () => {
1357
1361
  enableFloatingProgress: n = !0,
1358
1362
  onItemClick: o
1359
1363
  }) => {
1360
- const [r, i] = I(!1), [l, s] = I(!1), [c, u] = I(!1), [a, g] = I(!1), [h, f] = I(!1), [v, w] = I(!1), [z, O] = ge(), k = q(() => {
1364
+ const [r, i] = I(!1), [l, s] = I(!1), [c, u] = I(!1), [a, g] = I(!1), [h, f] = I(!1), [v, w] = I(!1), [z, O] = pe(), k = q(() => {
1361
1365
  i(!1), s(!1), u(!1), g(!1), f(!1), O(!1), w(!1);
1362
1366
  }, [O]), D = q(
1363
1367
  (T) => {