@prose-reader/react-reader 1.187.0 → 1.188.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.
Files changed (57) hide show
  1. package/dist/{src/ReactReader.d.ts → ReactReader.d.ts} +2 -3
  2. package/dist/annotations/AnnotationsDialog.d.ts +5 -0
  3. package/dist/annotations/AnnotationsDialogContent.d.ts +3 -0
  4. package/dist/bookmarks/BookmarksDialog.d.ts +5 -0
  5. package/dist/bookmarks/BookmarksDialogContent.d.ts +3 -0
  6. package/dist/context/useReader.d.ts +8 -0
  7. package/dist/index.js +695 -568
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.umd.cjs +1 -1
  10. package/dist/index.umd.cjs.map +1 -1
  11. package/dist/quickmenu/BottomBar.d.ts +4 -0
  12. package/dist/quickmenu/QuickMenu.d.ts +3 -0
  13. package/dist/quickmenu/Scrubber.d.ts +3 -0
  14. package/dist/quickmenu/TopBar.d.ts +4 -0
  15. package/dist/theme/config.d.ts +1 -0
  16. package/package.json +11 -2
  17. package/dist/src/context/useReader.d.ts +0 -4
  18. package/dist/src/navigation/QuickMenu/BottomBar.d.ts +0 -6
  19. package/dist/src/navigation/QuickMenu/QuickMenu.d.ts +0 -7
  20. package/dist/src/navigation/QuickMenu/Scrubber.d.ts +0 -1
  21. package/dist/src/navigation/QuickMenu/TopBar.d.ts +0 -5
  22. /package/dist/{src/common → common}/useFullscreen.d.ts +0 -0
  23. /package/dist/{src/components → components}/ui/accordion.d.ts +0 -0
  24. /package/dist/{src/components → components}/ui/avatar.d.ts +0 -0
  25. /package/dist/{src/components → components}/ui/checkbox.d.ts +0 -0
  26. /package/dist/{src/components → components}/ui/close-button.d.ts +0 -0
  27. /package/dist/{src/components → components}/ui/color-mode.d.ts +0 -0
  28. /package/dist/{src/components → components}/ui/dialog.d.ts +0 -0
  29. /package/dist/{src/components → components}/ui/drawer.d.ts +0 -0
  30. /package/dist/{src/components → components}/ui/field.d.ts +0 -0
  31. /package/dist/{src/components → components}/ui/input-group.d.ts +0 -0
  32. /package/dist/{src/components → components}/ui/popover.d.ts +0 -0
  33. /package/dist/{src/components → components}/ui/progress.d.ts +0 -0
  34. /package/dist/{src/components → components}/ui/provider.d.ts +0 -0
  35. /package/dist/{src/components → components}/ui/radio.d.ts +0 -0
  36. /package/dist/{src/components → components}/ui/slider.d.ts +0 -0
  37. /package/dist/{src/components → components}/ui/toggle-tip.d.ts +0 -0
  38. /package/dist/{src/components → components}/ui/tooltip.d.ts +0 -0
  39. /package/dist/{src/context → context}/ReactReaderProvider.d.ts +0 -0
  40. /package/dist/{src/context → context}/context.d.ts +0 -0
  41. /package/dist/{src/help → help}/HelpDialog.d.ts +0 -0
  42. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  43. /package/dist/{src/navigation → navigation}/FloatingProgress.d.ts +0 -0
  44. /package/dist/{src/navigation → navigation}/FloatingTime.d.ts +0 -0
  45. /package/dist/{src/navigation → navigation}/useNavigationContext.d.ts +0 -0
  46. /package/dist/{src/pagination → pagination}/usePagination.d.ts +0 -0
  47. /package/dist/{src/navigation/QuickMenu → quickmenu}/PaginationInfoSection.d.ts +0 -0
  48. /package/dist/{src/navigation/QuickMenu → quickmenu}/QuickBar.d.ts +0 -0
  49. /package/dist/{src/navigation/QuickMenu → quickmenu}/ThemedSlider.d.ts +0 -0
  50. /package/dist/{src/navigation/QuickMenu → quickmenu}/TimeIndicator.d.ts +0 -0
  51. /package/dist/{src/navigation/QuickMenu → quickmenu}/useQuickMenu.d.ts +0 -0
  52. /package/dist/{src/search → search}/SearchDialog.d.ts +0 -0
  53. /package/dist/{src/search → search}/SearchDialogContent.d.ts +0 -0
  54. /package/dist/{src/search → search}/SearchListItem.d.ts +0 -0
  55. /package/dist/{src/settings → settings}/useSettings.d.ts +0 -0
  56. /package/dist/{src/toc → toc}/TableOfContentsDialog.d.ts +0 -0
  57. /package/dist/{src/toc → toc}/TableOfContentsDialogContent.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,201 +1,337 @@
1
- import { jsx as t, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import he, { createContext as ue, memo as p, useMemo as ge, useEffect as M, useContext as oe, useState as T, useCallback as H } from "react";
4
- import { signal as me, useSignal as re, useLiveRef as fe, useSubscribe as le, useObserve as I, useSignalValue as pe } from "reactjrx";
5
- import { tap as be, NEVER as xe, combineLatest as Ce, map as ie, startWith as ve } from "rxjs";
6
- import { IconButton as b, Portal as se, Dialog as f, Heading as L, HStack as k, Kbd as te, Text as m, Button as _, Box as R, Popover as y, Progress as B, Stack as v, Presence as $, chakra as Ie, Collapsible as E, Link as ae, Input as Se, List as z } from "@chakra-ui/react";
7
- import { LuX as Pe, LuArrowBigRight as Te, LuArrowBigLeft as ke, LuChevronDown as we, LuCircleHelp as ye, LuTableOfContents as Re, LuSearch as Oe, LuCircleCheck as ne } from "react-icons/lu";
8
- import { RxDoubleArrowUp as De, RxDoubleArrowLeft as Ae, RxDoubleArrowDown as ze, RxDoubleArrowRight as Be } from "react-icons/rx";
9
- import { HiOutlineInformationCircle as Me } from "react-icons/hi";
10
- import Ee from "rc-slider";
1
+ import { jsx as e, jsxs as a, Fragment as X } from "react/jsx-runtime";
2
+ import * as D from "react";
3
+ import fe, { createContext as me, memo as f, useMemo as be, useEffect as Y, useContext as ie, useState as w, useCallback as B } from "react";
4
+ import { signal as xe, useSignal as le, useLiveRef as Ce, useSubscribe as se, useObserve as P, useSignalValue as ve } from "reactjrx";
5
+ import { tap as Ie, switchMap as ae, NEVER as Se, combineLatest as ke, map as ce, startWith as Pe } from "rxjs";
6
+ import { IconButton as C, Portal as de, Dialog as b, List as I, Link as q, Stack as k, Text as g, Button as z, Heading as Q, HStack as O, Kbd as oe, Box as M, Popover as A, Progress as L, Presence as G, chakra as Te, Collapsible as U, Input as we } from "@chakra-ui/react";
7
+ import { LuX as ye, LuNotebookPen as K, LuArrowBigRight as Re, LuArrowBigLeft as Oe, LuChevronDown as De, LuCircleHelp as Ae, LuTableOfContents as ze, LuSearch as Ee, LuCircleCheck as re } from "react-icons/lu";
8
+ import { BsBookmarks as Be } from "react-icons/bs";
9
+ import { RxDoubleArrowUp as Me, RxDoubleArrowLeft as Le, RxDoubleArrowDown as _e, RxDoubleArrowRight as $e } from "react-icons/rx";
10
+ import { HiOutlineInformationCircle as Ne } from "react-icons/hi";
11
+ import Fe from "rc-slider";
11
12
  import "rc-slider/assets/index.css";
12
- import { IoIosArrowBack as Le, IoMdMore as $e } from "react-icons/io";
13
- import { MdFullscreenExit as Fe, MdFullscreen as He } from "react-icons/md";
14
- const N = ue({
13
+ import { IoIosArrowBack as He, IoMdMore as je } from "react-icons/io";
14
+ import { MdFullscreenExit as Ve, MdFullscreen as We } from "react-icons/md";
15
+ const J = me({
15
16
  reader: void 0,
16
- quickMenuSignal: me({ default: !1 })
17
- }), kt = p(
17
+ quickMenuSignal: xe({ default: !1 })
18
+ }), Ln = f(
18
19
  ({
19
- children: e,
20
- reader: n,
21
- quickMenuOpen: r,
22
- onQuickMenuOpenChange: l
20
+ children: n,
21
+ reader: t,
22
+ quickMenuOpen: o,
23
+ onQuickMenuOpenChange: r
23
24
  }) => {
24
- const [, o] = re({
25
- default: r
26
- }), i = fe(l), c = ge(
25
+ const [, l] = le({
26
+ default: o
27
+ }), i = Ce(r), c = be(
27
28
  () => ({
28
- quickMenuSignal: o,
29
- reader: n
29
+ quickMenuSignal: l,
30
+ reader: t
30
31
  }),
31
- [o, n]
32
+ [l, t]
32
33
  );
33
- return M(() => {
34
- o.setValue(r);
35
- }, [r, o]), le(
36
- () => o.subject.pipe(be(i.current)),
37
- [o, i]
38
- ), /* @__PURE__ */ t(N.Provider, { value: c, children: e });
34
+ return Y(() => {
35
+ l.setValue(o);
36
+ }, [o, l]), se(
37
+ () => l.subject.pipe(Ie(i.current)),
38
+ [l, i]
39
+ ), /* @__PURE__ */ e(J.Provider, { value: c, children: n });
39
40
  }
40
- ), _e = "@prose-reader/react-reader", Ne = "1.186.0", We = w.forwardRef(function(n, r) {
41
- return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: r, ...n, children: n.children ?? /* @__PURE__ */ t(Pe, {}) });
42
- }), W = w.forwardRef(function(n, r) {
41
+ ), Ye = D.forwardRef(function(t, o) {
42
+ return /* @__PURE__ */ e(C, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(ye, {}) });
43
+ }), _ = D.forwardRef(function(t, o) {
43
44
  const {
44
- children: l,
45
- portalled: o = !0,
45
+ children: r,
46
+ portalled: l = !0,
46
47
  portalRef: i,
47
48
  backdrop: c = !0,
48
49
  ...d
49
- } = n;
50
- return /* @__PURE__ */ a(se, { disabled: !o, container: i, children: [
51
- c && /* @__PURE__ */ t(f.Backdrop, {}),
52
- /* @__PURE__ */ t(f.Positioner, { children: /* @__PURE__ */ t(f.Content, { ref: r, ...d, asChild: !1, children: l }) })
50
+ } = t;
51
+ return /* @__PURE__ */ a(de, { disabled: !l, container: i, children: [
52
+ c && /* @__PURE__ */ e(b.Backdrop, {}),
53
+ /* @__PURE__ */ e(b.Positioner, { children: /* @__PURE__ */ e(b.Content, { ref: o, ...d, asChild: !1, children: r }) })
53
54
  ] });
54
- }), j = w.forwardRef(function(n, r) {
55
- return /* @__PURE__ */ t(
56
- f.CloseTrigger,
55
+ }), $ = D.forwardRef(function(t, o) {
56
+ return /* @__PURE__ */ e(
57
+ b.CloseTrigger,
57
58
  {
58
59
  position: "absolute",
59
60
  top: "2",
60
61
  insetEnd: "2",
61
- ...n,
62
+ ...t,
62
63
  asChild: !0,
63
- children: /* @__PURE__ */ t(We, { size: "sm", ref: r, children: n.children })
64
+ children: /* @__PURE__ */ e(Ye, { size: "sm", ref: o, children: t.children })
64
65
  }
65
66
  );
66
- }), V = f.Root, q = f.Footer, U = f.Header, Y = f.Body;
67
- f.Backdrop;
68
- const Q = f.Title;
69
- f.Description;
70
- f.Trigger;
71
- const G = f.ActionTrigger, je = p(
67
+ }), N = b.Root, F = b.Footer, H = b.Header, j = b.Body;
68
+ b.Backdrop;
69
+ const V = b.Title;
70
+ b.Description;
71
+ b.Trigger;
72
+ const W = b.ActionTrigger, R = () => {
73
+ const { reader: n } = ie(J);
74
+ return n;
75
+ }, he = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, ue = (n) => !!n && "__PROSE_READER_ENHANCER_BOOKMARKS" in n, ge = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, qe = f(
76
+ ({ onNavigate: n }) => {
77
+ const t = R(), o = ge(t) ? t : void 0, r = P(
78
+ () => o == null ? void 0 : o.annotations.highlights$.pipe(
79
+ ae(
80
+ (i) => o.pagination.locate(i)
81
+ )
82
+ ),
83
+ [o]
84
+ ), l = (i, c) => {
85
+ var d;
86
+ return /* @__PURE__ */ e(I.Item, { children: /* @__PURE__ */ a(
87
+ q,
88
+ {
89
+ href: "#",
90
+ onClick: () => {
91
+ n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
92
+ },
93
+ children: [
94
+ (i.contents ?? [])[0] ? /* @__PURE__ */ e(I.Indicator, { asChild: !0, children: /* @__PURE__ */ e(K, {}) }) : /* @__PURE__ */ e(I.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(K, {}) }),
95
+ /* @__PURE__ */ a(k, { gap: 0, children: [
96
+ /* @__PURE__ */ e(g, { lineClamp: 2, fontSize: "md", children: i.selectionAsText ? i.selectionAsText ?? "" : /* @__PURE__ */ e("i", { children: /* @__PURE__ */ e("b", { children: "unknown (not loaded)" }) }) }),
97
+ /* @__PURE__ */ e(
98
+ g,
99
+ {
100
+ fontStyle: "italic",
101
+ fontWeight: "bold",
102
+ fontSize: "sm",
103
+ children: `Book page: ${((d = i.meta) == null ? void 0 : d.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
104
+ }
105
+ )
106
+ ] })
107
+ ]
108
+ }
109
+ ) }, c);
110
+ };
111
+ return /* @__PURE__ */ e(I.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: r == null ? void 0 : r.map(
112
+ (i, c) => l(i, c)
113
+ ) });
114
+ }
115
+ ), Ue = f(
116
+ ({
117
+ open: n,
118
+ setOpen: t,
119
+ onNavigate: o
120
+ }) => /* @__PURE__ */ e(
121
+ N,
122
+ {
123
+ lazyMount: !0,
124
+ placement: "center",
125
+ open: n,
126
+ onOpenChange: (r) => t(r.open),
127
+ size: { mdDown: "full", md: "lg" },
128
+ scrollBehavior: "inside",
129
+ children: /* @__PURE__ */ a(_, { height: "100%", children: [
130
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Annotations" }) }),
131
+ /* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(qe, { onNavigate: o }) }),
132
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
133
+ /* @__PURE__ */ e($, {})
134
+ ] })
135
+ }
136
+ )
137
+ ), Qe = f(
138
+ ({ onNavigate: n }) => {
139
+ const t = R(), o = ue(t) ? t : void 0, r = P(
140
+ () => o == null ? void 0 : o.bookmarks.bookmarks$.pipe(
141
+ ae((i) => o.pagination.locate(i))
142
+ ),
143
+ [o]
144
+ ), l = (i, c) => {
145
+ var d, u, s, p, h;
146
+ return /* @__PURE__ */ a(I.Item, { justifyContent: "space-between", alignItems: "center", children: [
147
+ /* @__PURE__ */ e(
148
+ q,
149
+ {
150
+ href: "#",
151
+ onClick: () => {
152
+ n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
153
+ },
154
+ children: /* @__PURE__ */ a(k, { gap: 0, children: [
155
+ /* @__PURE__ */ e(g, { fontSize: "md", children: `Book page: ${((d = i.meta) == null ? void 0 : d.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown"}` }),
156
+ /* @__PURE__ */ e(
157
+ g,
158
+ {
159
+ fontStyle: "italic",
160
+ fontWeight: "bold",
161
+ fontSize: "sm",
162
+ truncate: !0,
163
+ lineClamp: 2,
164
+ children: (s = (u = i.meta) == null ? void 0 : u.startNode) != null && s.textContent ? (h = (p = i.meta) == null ? void 0 : p.startNode) == null ? void 0 : h.textContent : "..."
165
+ }
166
+ )
167
+ ] })
168
+ }
169
+ ),
170
+ /* @__PURE__ */ e(
171
+ z,
172
+ {
173
+ colorPalette: "red",
174
+ variant: "solid",
175
+ size: "xs",
176
+ onClick: () => {
177
+ o == null || o.bookmarks.delete(i.id);
178
+ },
179
+ children: "Delete"
180
+ }
181
+ )
182
+ ] }, c);
183
+ };
184
+ return /* @__PURE__ */ e(I.Root, { overflowY: "auto", gap: 3, variant: "plain", overflow: "auto", children: r == null ? void 0 : r.map(
185
+ (i, c) => l(i, c)
186
+ ) });
187
+ }
188
+ ), Ge = f(
189
+ ({
190
+ open: n,
191
+ setOpen: t,
192
+ onNavigate: o
193
+ }) => /* @__PURE__ */ e(
194
+ N,
195
+ {
196
+ lazyMount: !0,
197
+ placement: "center",
198
+ open: n,
199
+ onOpenChange: (r) => t(r.open),
200
+ size: { mdDown: "full", md: "lg" },
201
+ scrollBehavior: "inside",
202
+ children: /* @__PURE__ */ a(_, { height: "100%", children: [
203
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Bookmarks" }) }),
204
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(Qe, { onNavigate: o }) }),
205
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
206
+ /* @__PURE__ */ e($, {})
207
+ ] })
208
+ }
209
+ )
210
+ ), Ke = "@prose-reader/react-reader", Xe = "1.187.0", Je = f(
72
211
  ({
73
- open: e,
74
- setOpen: n
75
- }) => /* @__PURE__ */ t(
76
- V,
212
+ open: n,
213
+ setOpen: t
214
+ }) => /* @__PURE__ */ e(
215
+ N,
77
216
  {
78
217
  lazyMount: !0,
79
218
  placement: "center",
80
- open: e,
81
- onOpenChange: (r) => n(r.open),
219
+ open: n,
220
+ onOpenChange: (o) => t(o.open),
82
221
  size: { mdDown: "full", md: "lg" },
83
222
  scrollBehavior: "inside",
84
- children: /* @__PURE__ */ a(W, { children: [
85
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Help" }) }),
86
- /* @__PURE__ */ a(Y, { overflowY: "auto", flex: 1, children: [
87
- /* @__PURE__ */ t(L, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
88
- /* @__PURE__ */ a(k, { mb: 1, children: [
89
- /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(Te, {}) }),
223
+ children: /* @__PURE__ */ a(_, { children: [
224
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Help" }) }),
225
+ /* @__PURE__ */ a(j, { overflowY: "auto", flex: 1, children: [
226
+ /* @__PURE__ */ e(Q, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
227
+ /* @__PURE__ */ a(O, { mb: 1, children: [
228
+ /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Re, {}) }),
90
229
  " ",
91
- /* @__PURE__ */ t(m, { children: "Navigate to right page" })
230
+ /* @__PURE__ */ e(g, { children: "Navigate to right page" })
92
231
  ] }),
93
- /* @__PURE__ */ a(k, { mb: 1, children: [
94
- /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(ke, {}) }),
232
+ /* @__PURE__ */ a(O, { mb: 1, children: [
233
+ /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Oe, {}) }),
95
234
  " ",
96
- /* @__PURE__ */ t(m, { children: "Navigate to left page" })
235
+ /* @__PURE__ */ e(g, { children: "Navigate to left page" })
97
236
  ] }),
98
- /* @__PURE__ */ t(L, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
99
- /* @__PURE__ */ a(m, { children: [
100
- _e,
237
+ /* @__PURE__ */ e(Q, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
238
+ /* @__PURE__ */ a(g, { children: [
239
+ Ke,
101
240
  " version: ",
102
- Ne
241
+ Xe
103
242
  ] })
104
243
  ] }),
105
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
106
- /* @__PURE__ */ t(j, {})
244
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
245
+ /* @__PURE__ */ e($, {})
107
246
  ] })
108
247
  }
109
248
  )
110
- ), O = () => {
111
- const { reader: e } = oe(N);
112
- return e;
113
- }, ce = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, D = () => {
114
- const e = O();
115
- return I(
116
- () => e ? Ce([e.pagination.state$, e.context.state$]).pipe(
117
- ie(([n, r]) => {
118
- var o;
119
- const l = (o = r.manifest) == null ? void 0 : o.spineItems.every(
249
+ ), E = () => {
250
+ const n = R();
251
+ return P(
252
+ () => n ? ke([n.pagination.state$, n.context.state$]).pipe(
253
+ ce(([t, o]) => {
254
+ var l;
255
+ const r = (l = o.manifest) == null ? void 0 : l.spineItems.every(
120
256
  (i) => {
121
257
  var c;
122
258
  return (c = i.mediaType) == null ? void 0 : c.startsWith("image/");
123
259
  }
124
260
  );
125
261
  return {
126
- ...n,
127
- hasChapters: !r.isFullyPrePaginated && !l
262
+ ...t,
263
+ hasChapters: !o.isFullyPrePaginated && !r
128
264
  };
129
265
  })
130
- ) : xe,
131
- [e]
266
+ ) : Se,
267
+ [n]
132
268
  );
133
- }, Ve = () => {
134
- const e = D(), n = Math.floor(
135
- ((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
136
- ), r = n > 0 ? n : 1;
137
- return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(R, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(m, { fontSize: "sm", children: [
138
- r,
269
+ }, Ze = () => {
270
+ const n = E(), t = Math.floor(
271
+ ((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100
272
+ ), o = t > 0 ? t : 1;
273
+ return (n == null ? void 0 : n.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ e(M, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(g, { fontSize: "sm", children: [
274
+ o,
139
275
  " %"
140
276
  ] }) });
141
- }, qe = () => {
142
- const [e, n] = T(/* @__PURE__ */ new Date());
143
- return M(() => {
144
- const r = setInterval(() => {
145
- n(/* @__PURE__ */ new Date());
277
+ }, en = () => {
278
+ const [n, t] = w(/* @__PURE__ */ new Date());
279
+ return Y(() => {
280
+ const o = setInterval(() => {
281
+ t(/* @__PURE__ */ new Date());
146
282
  }, 6e4);
147
- return () => clearInterval(r);
148
- }, []), e;
149
- }, Ue = (e) => {
150
- const n = qe();
151
- return /* @__PURE__ */ t(m, { fontSize: "xs", ...e, children: n.toLocaleTimeString(navigator.language, {
283
+ return () => clearInterval(o);
284
+ }, []), n;
285
+ }, nn = (n) => {
286
+ const t = en();
287
+ return /* @__PURE__ */ e(g, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
152
288
  hour: "2-digit",
153
289
  minute: "2-digit"
154
290
  }) });
155
- }, K = () => {
156
- const { quickMenuSignal: e } = oe(N);
157
- return [pe(e), e.setValue, e];
158
- }, Ye = () => {
159
- const [e] = K();
160
- return /* @__PURE__ */ t(
161
- R,
291
+ }, Z = () => {
292
+ const { quickMenuSignal: n } = ie(J);
293
+ return [ve(n), n.setValue, n];
294
+ }, tn = () => {
295
+ const [n] = Z();
296
+ return /* @__PURE__ */ e(
297
+ M,
162
298
  {
163
299
  position: "absolute",
164
300
  left: 0,
165
301
  bottom: 0,
166
302
  p: 2,
167
- color: e ? void 0 : "colorPalette.contrast",
168
- children: /* @__PURE__ */ t(Ue, {})
303
+ color: n ? void 0 : "colorPalette.contrast",
304
+ children: /* @__PURE__ */ e(nn, {})
169
305
  }
170
306
  );
171
- }, Qe = w.forwardRef(
172
- function(n, r) {
307
+ }, on = D.forwardRef(
308
+ function(t, o) {
173
309
  const {
174
- showArrow: l,
175
- children: o,
310
+ showArrow: r,
311
+ children: l,
176
312
  portalled: i = !0,
177
313
  content: c,
178
314
  portalRef: d,
179
315
  ...u
180
- } = n;
316
+ } = t;
181
317
  return /* @__PURE__ */ a(
182
- y.Root,
318
+ A.Root,
183
319
  {
184
320
  ...u,
185
321
  positioning: { ...u.positioning, gutter: 4 },
186
322
  children: [
187
- /* @__PURE__ */ t(y.Trigger, { asChild: !0, children: o }),
188
- /* @__PURE__ */ t(se, { disabled: !i, container: d, children: /* @__PURE__ */ t(y.Positioner, { children: /* @__PURE__ */ a(
189
- y.Content,
323
+ /* @__PURE__ */ e(A.Trigger, { asChild: !0, children: l }),
324
+ /* @__PURE__ */ e(de, { disabled: !i, container: d, children: /* @__PURE__ */ e(A.Positioner, { children: /* @__PURE__ */ a(
325
+ A.Content,
190
326
  {
191
327
  width: "auto",
192
328
  px: "2",
193
329
  py: "1",
194
330
  textStyle: "xs",
195
331
  rounded: "sm",
196
- ref: r,
332
+ ref: o,
197
333
  children: [
198
- l && /* @__PURE__ */ t(y.Arrow, { children: /* @__PURE__ */ t(y.ArrowTip, {}) }),
334
+ r && /* @__PURE__ */ e(A.Arrow, { children: /* @__PURE__ */ e(A.ArrowTip, {}) }),
199
335
  c
200
336
  ]
201
337
  }
@@ -204,84 +340,84 @@ const G = f.ActionTrigger, je = p(
204
340
  }
205
341
  );
206
342
  }
207
- ), Ge = w.forwardRef(function(n, r) {
208
- const { children: l, ...o } = n;
209
- return /* @__PURE__ */ t(Qe, { content: l, ...o, ref: r, children: /* @__PURE__ */ t(
210
- b,
343
+ ), rn = D.forwardRef(function(t, o) {
344
+ const { children: r, ...l } = t;
345
+ return /* @__PURE__ */ e(on, { content: r, ...l, ref: o, children: /* @__PURE__ */ e(
346
+ C,
211
347
  {
212
348
  variant: "ghost",
213
349
  "aria-label": "info",
214
350
  size: "2xs",
215
351
  colorPalette: "gray",
216
- children: /* @__PURE__ */ t(Me, {})
352
+ children: /* @__PURE__ */ e(Ne, {})
217
353
  }
218
354
  ) });
219
- }), Ke = w.forwardRef(function(n, r) {
220
- return /* @__PURE__ */ t(B.Track, { ...n, ref: r, children: /* @__PURE__ */ t(B.Range, {}) });
355
+ }), ln = D.forwardRef(function(t, o) {
356
+ return /* @__PURE__ */ e(L.Track, { ...t, ref: o, children: /* @__PURE__ */ e(L.Range, {}) });
221
357
  });
222
- w.forwardRef(function(n, r) {
223
- const { children: l, info: o, ...i } = n;
224
- return /* @__PURE__ */ a(B.Label, { ...i, ref: r, children: [
225
- l,
226
- o && /* @__PURE__ */ t(Ge, { children: o })
358
+ D.forwardRef(function(t, o) {
359
+ const { children: r, info: l, ...i } = t;
360
+ return /* @__PURE__ */ a(L.Label, { ...i, ref: o, children: [
361
+ r,
362
+ l && /* @__PURE__ */ e(rn, { children: l })
227
363
  ] });
228
364
  });
229
- const Xe = B.Root, Je = B.ValueText, X = () => {
230
- const e = D(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, r = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, l = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, o = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, i = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
231
- o,
365
+ const sn = L.Root, an = L.ValueText, ee = () => {
366
+ const n = E(), t = (n == null ? void 0 : n.numberOfTotalPages) === 1, o = ((n == null ? void 0 : n.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((n == null ? void 0 : n.endNumberOfPagesInSpineItem) ?? 0) > 1, l = (n != null && n.hasChapters ? n == null ? void 0 : n.beginPageIndexInSpineItem : n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0, i = (n != null && n.hasChapters ? n == null ? void 0 : n.endPageIndexInSpineItem : n == null ? void 0 : n.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
367
+ l,
232
368
  i
233
- ].sort((g, h) => g - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), s = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
369
+ ].sort((p, h) => p - h), u = (n == null ? void 0 : n.beginPageIndexInSpineItem) !== (n == null ? void 0 : n.endPageIndexInSpineItem) || (n == null ? void 0 : n.beginSpineItemIndex) !== (n == null ? void 0 : n.endSpineItemIndex), s = n != null && n.hasChapters ? n == null ? void 0 : n.beginNumberOfPagesInSpineItem : n == null ? void 0 : n.numberOfTotalPages;
234
370
  return {
235
- hasOnlyOnePage: n,
236
- beginPageIndex: o,
371
+ hasOnlyOnePage: t,
372
+ beginPageIndex: l,
237
373
  endPageIndex: i,
238
- isBeginWithinChapter: r,
239
- isEndWithinChapter: l,
374
+ isBeginWithinChapter: o,
375
+ isEndWithinChapter: r,
240
376
  beginAndEndAreDifferent: u,
241
377
  totalApproximatePages: s,
242
378
  leftPageIndex: c,
243
379
  rightPageIndex: d
244
380
  };
245
- }, Ze = () => {
246
- const e = D(), {
247
- hasOnlyOnePage: n,
248
- leftPageIndex: r,
249
- rightPageIndex: l,
250
- totalApproximatePages: o,
381
+ }, cn = () => {
382
+ const n = E(), {
383
+ hasOnlyOnePage: t,
384
+ leftPageIndex: o,
385
+ rightPageIndex: r,
386
+ totalApproximatePages: l,
251
387
  beginAndEndAreDifferent: i
252
- } = X(), c = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (s) => s != null && s.subChapter ? `${s.title} / ${d(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = d(e == null ? void 0 : e.beginChapterInfo);
253
- return /* @__PURE__ */ a(v, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
254
- /* @__PURE__ */ t(Xe, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(k, { justifyContent: "space-between", children: [
255
- /* @__PURE__ */ t(Ke, { width: 110 }),
256
- /* @__PURE__ */ t(Je, { children: `${c}%` })
388
+ } = ee(), c = Math.round(((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100), d = (s) => s != null && s.subChapter ? `${s.title} / ${d(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = d(n == null ? void 0 : n.beginChapterInfo);
389
+ return /* @__PURE__ */ a(k, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
390
+ /* @__PURE__ */ e(sn, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(O, { justifyContent: "space-between", children: [
391
+ /* @__PURE__ */ e(ln, { width: 110 }),
392
+ /* @__PURE__ */ e(an, { children: `${c}%` })
257
393
  ] }) }),
258
- /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
259
- !n && /* @__PURE__ */ a(k, { children: [
260
- /* @__PURE__ */ t(m, { fontSize: "xs", children: i ? `${r + 1} - ${l + 1} of ${o}` : `${r + 1} of ${o}` }),
261
- !!(e != null && e.hasChapters) && /* @__PURE__ */ a(F, { children: [
262
- /* @__PURE__ */ t(m, { children: "-" }),
263
- /* @__PURE__ */ a(m, { fontSize: "xs", children: [
394
+ /* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
395
+ !t && /* @__PURE__ */ a(O, { children: [
396
+ /* @__PURE__ */ e(g, { fontSize: "xs", children: i ? `${o + 1} - ${r + 1} of ${l}` : `${o + 1} of ${l}` }),
397
+ !!(n != null && n.hasChapters) && /* @__PURE__ */ a(X, { children: [
398
+ /* @__PURE__ */ e(g, { children: "-" }),
399
+ /* @__PURE__ */ a(g, { fontSize: "xs", children: [
264
400
  "(",
265
- ((e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0) + 1,
401
+ ((n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0) + 1,
266
402
  ")"
267
403
  ] })
268
404
  ] })
269
405
  ] })
270
406
  ] });
271
- }, de = p(
407
+ }, pe = f(
272
408
  ({
273
- children: e,
274
- position: n,
275
- ...r
276
- }) => /* @__PURE__ */ t(
277
- $,
409
+ children: n,
410
+ position: t,
411
+ ...o
412
+ }) => /* @__PURE__ */ e(
413
+ G,
278
414
  {
279
415
  display: "flex",
280
416
  flexDirection: "row",
281
417
  width: "100%",
282
418
  position: "absolute",
283
- ...n === "bottom" ? { bottom: 0 } : { top: 0 },
284
- animationName: n === "bottom" ? {
419
+ ...t === "bottom" ? { bottom: 0 } : { top: 0 },
420
+ animationName: t === "bottom" ? {
285
421
  _open: "slide-from-bottom, fade-in",
286
422
  _closed: "slide-to-bottom, fade-out"
287
423
  } : {
@@ -294,12 +430,12 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
294
430
  justifyContent: "center",
295
431
  shadow: "md",
296
432
  p: 4,
297
- ...r,
298
- children: e
433
+ ...o,
434
+ children: n
299
435
  }
300
436
  )
301
- ), et = Ie(Ee), tt = p((e) => /* @__PURE__ */ t(
302
- R,
437
+ ), dn = Te(Fe), hn = f((n) => /* @__PURE__ */ e(
438
+ M,
303
439
  {
304
440
  display: "contents",
305
441
  css: {
@@ -307,8 +443,8 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
307
443
  "--bg-emphasized": "colors.bg.emphasized",
308
444
  "--color-solid": "colors.colorPalette.solid"
309
445
  },
310
- children: /* @__PURE__ */ t(
311
- et,
446
+ children: /* @__PURE__ */ e(
447
+ dn,
312
448
  {
313
449
  keyboard: !1,
314
450
  style: {
@@ -343,394 +479,376 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
343
479
  height: "24px",
344
480
  top: "50%",
345
481
  borderColor: "var(--color-solid)",
346
- transform: `translate(${e.reverse ? "50%" : "-50%"}, -50%)`,
482
+ transform: `translate(${n.reverse ? "50%" : "-50%"}, -50%)`,
347
483
  backgroundColor: "var(--bg)",
348
484
  marginTop: "0px"
349
485
  }
350
486
  },
351
- ...e
487
+ ...n
352
488
  }
353
489
  )
354
490
  }
355
- )), nt = () => {
356
- const e = D(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: r, totalApproximatePages: l = 0 } = X(), o = n ? Math.floor((r || 0) / 2) : r, [i, c] = re({
357
- default: o || 0
491
+ )), un = () => {
492
+ const n = E(), t = n == null ? void 0 : n.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = ee(), l = t ? Math.floor((o || 0) / 2) : o, [i, c] = le({
493
+ default: l || 0
358
494
  }), d = 0, u = Math.max(
359
495
  0,
360
- n ? Math.floor((l - 1) / 2) : l - 1
496
+ t ? Math.floor((r - 1) / 2) : r - 1
361
497
  );
362
- return M(() => {
363
- c.setValue(o || 0);
364
- }, [o, c]), {
498
+ return Y(() => {
499
+ c.setValue(l || 0);
500
+ }, [l, c]), {
365
501
  value: i,
366
502
  valueSignal: c,
367
503
  min: d,
368
504
  max: u
369
505
  };
370
- }, ot = () => {
371
- const e = O(), n = D(), { manifest: r } = I(() => e == null ? void 0 : e.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", o = n == null ? void 0 : n.isUsingSpread, { totalApproximatePages: i = 0, isBeginWithinChapter: c } = X(), d = 1, u = c, { value: s, valueSignal: g, min: h, max: S } = nt(), P = H(
372
- (x) => {
373
- const [C = 0] = Array.isArray(x) ? x : [x];
374
- g.setValue(C);
375
- const A = o ? Math.floor(C) * 2 : Math.floor(C);
376
- u ? e == null || e.navigation.goToPageOfSpineItem({
377
- pageIndex: A,
378
- spineItemId: e.pagination.getState().beginSpineItemIndex ?? 0,
506
+ }, gn = (n) => {
507
+ const t = R(), o = E(), { manifest: r } = P(() => t == null ? void 0 : t.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", i = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: c = 0, isBeginWithinChapter: d } = ee(), u = 1, s = d, { value: p, valueSignal: h, min: v, max: S } = un(), T = B(
508
+ (m) => {
509
+ const [y = 0] = Array.isArray(m) ? m : [m];
510
+ h.setValue(y);
511
+ const x = i ? Math.floor(y) * 2 : Math.floor(y);
512
+ s ? t == null || t.navigation.goToPageOfSpineItem({
513
+ pageIndex: x,
514
+ spineItemId: t.pagination.getState().beginSpineItemIndex ?? 0,
379
515
  animation: !1
380
- }) : e == null || e.navigation.goToAbsolutePageIndex({
381
- absolutePageIndex: A,
516
+ }) : t == null || t.navigation.goToAbsolutePageIndex({
517
+ absolutePageIndex: x,
382
518
  animation: !1
383
519
  });
384
520
  },
385
- [e, o, g, u]
521
+ [t, i, h, s]
386
522
  );
387
- return le(
388
- () => e == null ? void 0 : e.navigation.throttleLock({
523
+ return se(
524
+ () => t == null ? void 0 : t.navigation.throttleLock({
389
525
  duration: 100,
390
- trigger: g.subject
526
+ trigger: h.subject
391
527
  }),
392
- [e, g]
393
- ), i === 1 || o && i === 2 ? null : /* @__PURE__ */ t(
394
- tt,
528
+ [t, h]
529
+ ), c === 1 || i && c === 2 ? null : /* @__PURE__ */ e(
530
+ hn,
395
531
  {
396
- value: [s],
532
+ value: [p],
397
533
  max: S,
398
- min: h,
534
+ min: v,
399
535
  reverse: l,
400
- step: d,
401
- onChange: P
536
+ step: u,
537
+ onChange: T,
538
+ ...n
402
539
  }
403
540
  );
404
- }, rt = p(
541
+ }, pn = f(
405
542
  ({
406
- open: e,
407
- onTableOfContentsClick: n,
408
- onHelpClick: r,
409
- onSearchClick: l
543
+ open: n,
544
+ onItemClick: t
410
545
  }) => {
411
- const o = O(), i = I(() => o == null ? void 0 : o.navigation.state$, [o]), c = I(() => o == null ? void 0 : o.settings.values$, [o]), d = (c == null ? void 0 : c.computedPageTurnDirection) === "vertical", [u, s] = T(!0);
412
- return /* @__PURE__ */ t(
413
- de,
414
- {
415
- present: e,
416
- position: "bottom",
417
- children: /* @__PURE__ */ a(
418
- v,
546
+ const o = R(), r = P(() => o == null ? void 0 : o.navigation.state$, [o]), l = P(() => o == null ? void 0 : o.settings.values$, [o]), i = (l == null ? void 0 : l.computedPageTurnDirection) === "vertical", [c, d] = w(!0);
547
+ return /* @__PURE__ */ e(pe, { present: n, position: "bottom", children: /* @__PURE__ */ a(k, { flex: 1, overflow: "auto", children: [
548
+ /* @__PURE__ */ a(O, { flex: 1, alignItems: "center", justifyContent: "center", children: [
549
+ /* @__PURE__ */ e(
550
+ C,
551
+ {
552
+ "aria-label": "left",
553
+ size: "lg",
554
+ variant: "ghost",
555
+ flexShrink: 0,
556
+ onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
557
+ disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
558
+ children: i ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(Le, {})
559
+ }
560
+ ),
561
+ /* @__PURE__ */ a(
562
+ k,
419
563
  {
420
564
  flex: 1,
565
+ maxW: 400,
566
+ gap: 2,
567
+ alignItems: "center",
568
+ overflow: "auto",
569
+ px: 4,
421
570
  children: [
422
- /* @__PURE__ */ a(k, { flex: 1, alignItems: "center", justifyContent: "center", children: [
423
- /* @__PURE__ */ t(
424
- b,
425
- {
426
- "aria-label": "left",
427
- size: "lg",
428
- variant: "ghost",
429
- flexShrink: 0,
430
- onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
431
- disabled: !(i != null && i.canGoLeftSpineItem) && !(i != null && i.canGoTopSpineItem),
432
- children: d ? /* @__PURE__ */ t(De, {}) : /* @__PURE__ */ t(Ae, {})
433
- }
434
- ),
435
- /* @__PURE__ */ a(
436
- v,
437
- {
438
- flex: 1,
439
- maxW: 400,
440
- gap: 2,
441
- alignItems: "center",
442
- overflow: "visible",
443
- px: 4,
444
- children: [
445
- /* @__PURE__ */ t(Ze, {}),
446
- /* @__PURE__ */ t(R, { height: 5, maxW: 300, width: "100%", overflow: "visible", children: /* @__PURE__ */ t(ot, {}) })
447
- ]
571
+ /* @__PURE__ */ e(cn, {}),
572
+ /* @__PURE__ */ e(
573
+ gn,
574
+ {
575
+ style: {
576
+ width: "100%",
577
+ maxWidth: "300px",
578
+ height: "35px"
448
579
  }
449
- ),
450
- /* @__PURE__ */ t(
451
- b,
580
+ }
581
+ )
582
+ ]
583
+ }
584
+ ),
585
+ /* @__PURE__ */ e(
586
+ C,
587
+ {
588
+ "aria-label": "right",
589
+ size: "lg",
590
+ flexShrink: 0,
591
+ variant: "ghost",
592
+ disabled: !(r != null && r.canGoRightSpineItem) && !(r != null && r.canGoBottomSpineItem),
593
+ onClick: () => {
594
+ o == null || o.navigation.goToRightOrBottomSpineItem();
595
+ },
596
+ children: i ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e($e, {})
597
+ }
598
+ )
599
+ ] }),
600
+ /* @__PURE__ */ e(O, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ a(
601
+ U.Root,
602
+ {
603
+ open: c,
604
+ flex: 1,
605
+ onOpenChange: ({ open: u }) => {
606
+ d(u);
607
+ },
608
+ children: [
609
+ /* @__PURE__ */ e(
610
+ U.Trigger,
611
+ {
612
+ paddingY: "3",
613
+ width: "100%",
614
+ display: "flex",
615
+ justifyContent: "center",
616
+ children: /* @__PURE__ */ e(
617
+ De,
452
618
  {
453
- "aria-label": "right",
454
- size: "lg",
455
- flexShrink: 0,
456
- variant: "ghost",
457
- disabled: !(i != null && i.canGoRightSpineItem) && !(i != null && i.canGoBottomSpineItem),
458
- onClick: () => {
459
- o == null || o.navigation.goToRightOrBottomSpineItem();
460
- },
461
- children: d ? /* @__PURE__ */ t(ze, {}) : /* @__PURE__ */ t(Be, {})
619
+ style: {
620
+ transform: c ? "rotate(0deg)" : "rotate(180deg)"
621
+ }
462
622
  }
463
623
  )
464
- ] }),
465
- /* @__PURE__ */ t(
466
- k,
624
+ }
625
+ ),
626
+ /* @__PURE__ */ a(U.Content, { display: "flex", justifyContent: "center", children: [
627
+ /* @__PURE__ */ e(
628
+ C,
467
629
  {
468
- alignItems: "center",
469
- justifyContent: "center",
470
- children: /* @__PURE__ */ a(
471
- E.Root,
472
- {
473
- open: u,
474
- flex: 1,
475
- onOpenChange: ({ open: g }) => {
476
- s(g);
477
- },
478
- children: [
479
- /* @__PURE__ */ t(
480
- E.Trigger,
481
- {
482
- paddingY: "3",
483
- width: "100%",
484
- display: "flex",
485
- justifyContent: "center",
486
- children: /* @__PURE__ */ t(
487
- we,
488
- {
489
- style: {
490
- transform: u ? "rotate(0deg)" : "rotate(180deg)"
491
- }
492
- }
493
- )
494
- }
495
- ),
496
- /* @__PURE__ */ a(
497
- E.Content,
498
- {
499
- display: "flex",
500
- justifyContent: "center",
501
- gap: 2,
502
- children: [
503
- /* @__PURE__ */ t(
504
- b,
505
- {
506
- "aria-label": "Help",
507
- size: "lg",
508
- variant: "ghost",
509
- onClick: r,
510
- children: /* @__PURE__ */ t(ye, {})
511
- }
512
- ),
513
- /* @__PURE__ */ t(
514
- b,
515
- {
516
- "aria-label": "Table of contents",
517
- size: "lg",
518
- variant: "ghost",
519
- onClick: n,
520
- children: /* @__PURE__ */ t(Re, {})
521
- }
522
- ),
523
- ce(o) && /* @__PURE__ */ t(
524
- b,
525
- {
526
- "aria-label": "Search",
527
- size: "lg",
528
- variant: "ghost",
529
- onClick: l,
530
- children: /* @__PURE__ */ t(Oe, {})
531
- }
532
- )
533
- ]
534
- }
535
- )
536
- ]
537
- }
538
- )
630
+ "aria-label": "Help",
631
+ size: "lg",
632
+ variant: "ghost",
633
+ onClick: () => t("help"),
634
+ children: /* @__PURE__ */ e(Ae, {})
635
+ }
636
+ ),
637
+ /* @__PURE__ */ e(
638
+ C,
639
+ {
640
+ "aria-label": "Table of contents",
641
+ size: "lg",
642
+ variant: "ghost",
643
+ onClick: () => t("toc"),
644
+ children: /* @__PURE__ */ e(ze, {})
645
+ }
646
+ ),
647
+ he(o) && /* @__PURE__ */ e(
648
+ C,
649
+ {
650
+ "aria-label": "Search",
651
+ size: "lg",
652
+ variant: "ghost",
653
+ onClick: () => t("search"),
654
+ children: /* @__PURE__ */ e(Ee, {})
655
+ }
656
+ ),
657
+ ue(o) && /* @__PURE__ */ e(
658
+ C,
659
+ {
660
+ "aria-label": "Search",
661
+ size: "lg",
662
+ variant: "ghost",
663
+ onClick: () => t("bookmarks"),
664
+ children: /* @__PURE__ */ e(Be, {})
665
+ }
666
+ ),
667
+ ge(o) && /* @__PURE__ */ e(
668
+ C,
669
+ {
670
+ "aria-label": "Search",
671
+ size: "lg",
672
+ variant: "ghost",
673
+ onClick: () => t("annotations"),
674
+ children: /* @__PURE__ */ e(K, {})
539
675
  }
540
676
  )
541
- ]
542
- }
543
- )
544
- }
545
- );
677
+ ] })
678
+ ]
679
+ }
680
+ ) })
681
+ ] }) });
546
682
  }
547
- ), lt = () => {
548
- const [e, n] = T(!1), r = H(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
549
- n(!1);
683
+ ), fn = () => {
684
+ const [n, t] = w(!1), o = B(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
685
+ t(!1);
550
686
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
551
- n(!0);
687
+ t(!0);
552
688
  }), []);
553
- return M(() => {
554
- function l() {
555
- n(!!document.fullscreenElement);
689
+ return Y(() => {
690
+ function r() {
691
+ t(!!document.fullscreenElement);
556
692
  }
557
- return document.addEventListener("fullscreenchange", l), () => {
558
- document.removeEventListener("fullscreenchange", l);
693
+ return document.addEventListener("fullscreenchange", r), () => {
694
+ document.removeEventListener("fullscreenchange", r);
559
695
  };
560
696
  }, []), {
561
- isFullscreen: e,
562
- onToggleFullscreenClick: r
697
+ isFullscreen: n,
698
+ onToggleFullscreenClick: o
563
699
  };
564
- }, it = ({
565
- open: e,
566
- onBackClick: n,
567
- onMoreClick: r
568
- }) => {
569
- const l = O(), o = I(() => l == null ? void 0 : l.context.manifest$, [l]), { isFullscreen: i, onToggleFullscreenClick: c } = lt();
570
- return /* @__PURE__ */ a(
571
- de,
572
- {
573
- present: e,
574
- position: "top",
575
- height: "80px",
576
- justifyContent: "space-between",
577
- children: [
578
- /* @__PURE__ */ t(
579
- b,
580
- {
581
- "aria-label": "left",
582
- size: "lg",
583
- variant: "ghost",
584
- flexShrink: 0,
585
- onClick: n,
586
- children: /* @__PURE__ */ t(Le, {})
587
- }
588
- ),
589
- /* @__PURE__ */ t(
590
- v,
591
- {
592
- flex: 1,
593
- maxW: 600,
594
- gap: 1,
595
- alignItems: "center",
596
- overflow: "auto",
597
- px: 4,
598
- children: /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", children: o == null ? void 0 : o.title })
599
- }
600
- ),
601
- /* @__PURE__ */ a(k, { children: [
602
- /* @__PURE__ */ t(
603
- b,
700
+ }, mn = f(
701
+ ({
702
+ open: n,
703
+ onItemClick: t
704
+ }) => {
705
+ const o = R(), r = P(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: l, onToggleFullscreenClick: i } = fn();
706
+ return /* @__PURE__ */ a(
707
+ pe,
708
+ {
709
+ present: n,
710
+ position: "top",
711
+ height: "80px",
712
+ justifyContent: "space-between",
713
+ children: [
714
+ /* @__PURE__ */ e(
715
+ C,
604
716
  {
605
- "aria-label": "right",
717
+ "aria-label": "left",
606
718
  size: "lg",
607
- flexShrink: 0,
608
719
  variant: "ghost",
609
- onClick: r,
610
- children: /* @__PURE__ */ t($e, {})
720
+ flexShrink: 0,
721
+ onClick: () => t("back"),
722
+ children: /* @__PURE__ */ e(He, {})
611
723
  }
612
724
  ),
613
- /* @__PURE__ */ t(
614
- b,
725
+ /* @__PURE__ */ e(
726
+ k,
615
727
  {
616
- "aria-label": "right",
617
- size: "lg",
618
- flexShrink: 0,
619
- variant: "ghost",
620
- onClick: c,
621
- children: i ? /* @__PURE__ */ t(Fe, {}) : /* @__PURE__ */ t(He, {})
728
+ flex: 1,
729
+ maxW: 600,
730
+ gap: 1,
731
+ alignItems: "center",
732
+ overflow: "auto",
733
+ px: 4,
734
+ children: /* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", children: r == null ? void 0 : r.title })
622
735
  }
623
- )
624
- ] })
625
- ]
626
- }
627
- );
628
- }, st = p(
736
+ ),
737
+ /* @__PURE__ */ a(O, { children: [
738
+ /* @__PURE__ */ e(
739
+ C,
740
+ {
741
+ "aria-label": "right",
742
+ size: "lg",
743
+ flexShrink: 0,
744
+ variant: "ghost",
745
+ onClick: () => t("more"),
746
+ children: /* @__PURE__ */ e(je, {})
747
+ }
748
+ ),
749
+ /* @__PURE__ */ e(
750
+ C,
751
+ {
752
+ "aria-label": "right",
753
+ size: "lg",
754
+ flexShrink: 0,
755
+ variant: "ghost",
756
+ onClick: i,
757
+ children: l ? /* @__PURE__ */ e(Ve, {}) : /* @__PURE__ */ e(We, {})
758
+ }
759
+ )
760
+ ] })
761
+ ]
762
+ }
763
+ );
764
+ }
765
+ ), bn = f(
629
766
  ({
630
- onBackClick: e,
631
- onMoreClick: n,
632
- onTableOfContentsClick: r,
633
- onHelpClick: l,
634
- onSearchClick: o
767
+ onItemClick: n
635
768
  }) => {
636
- const [i] = K();
637
- return /* @__PURE__ */ a(F, { children: [
638
- /* @__PURE__ */ t(
639
- it,
640
- {
641
- open: i,
642
- onBackClick: e,
643
- onMoreClick: n
644
- }
645
- ),
646
- /* @__PURE__ */ t(
647
- rt,
648
- {
649
- open: i,
650
- onTableOfContentsClick: r,
651
- onHelpClick: l,
652
- onSearchClick: o
653
- }
654
- )
769
+ const [t] = Z();
770
+ return /* @__PURE__ */ a(X, { children: [
771
+ /* @__PURE__ */ e(mn, { open: t, onItemClick: n }),
772
+ /* @__PURE__ */ e(pn, { open: t, onItemClick: n })
655
773
  ] });
656
774
  }
657
- ), at = p(
775
+ ), xn = f(
658
776
  ({
659
- contextText: e = "",
660
- startOffset: n = 0,
661
- text: r,
662
- cfi: l = "#",
663
- onClick: o,
777
+ contextText: n = "",
778
+ startOffset: t = 0,
779
+ text: o,
780
+ cfi: r = "#",
781
+ onClick: l,
664
782
  absolutePageIndex: i
665
783
  }) => {
666
- const d = e.substring(
667
- Math.max(n - 15, 0),
668
- Math.max(n, 0)
669
- ), u = e.substring(
670
- Math.min(n + r.length, e.length - 1),
784
+ const d = n.substring(
785
+ Math.max(t - 15, 0),
786
+ Math.max(t, 0)
787
+ ), u = n.substring(
788
+ Math.min(t + o.length, n.length - 1),
671
789
  Math.min(
672
- n + r.length + 15,
673
- e.length - 1
790
+ t + o.length + 15,
791
+ n.length - 1
674
792
  )
675
793
  );
676
794
  return /* @__PURE__ */ a(
677
- ae,
795
+ q,
678
796
  {
679
- href: l,
797
+ href: r,
680
798
  style: { margin: 5, overflow: "hidden" },
681
799
  onClick: (s) => {
682
- s.preventDefault(), o(l);
800
+ s.preventDefault(), l(r);
683
801
  },
684
802
  display: "flex",
685
803
  flexDirection: "column",
686
804
  alignItems: "flex-start",
687
805
  gap: 0,
688
806
  children: [
689
- /* @__PURE__ */ a(m, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
807
+ /* @__PURE__ */ a(g, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
690
808
  '"',
691
809
  d,
692
- /* @__PURE__ */ t("b", { children: r }),
810
+ /* @__PURE__ */ e("b", { children: o }),
693
811
  u,
694
812
  '"'
695
813
  ] }),
696
- /* @__PURE__ */ t(m, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
814
+ /* @__PURE__ */ e(g, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
697
815
  ]
698
816
  }
699
817
  );
700
818
  }
701
- ), ct = p(
819
+ ), Cn = f(
702
820
  ({
703
- onNavigate: e
821
+ onNavigate: n
704
822
  }) => {
705
- const [n, r] = T(""), l = O(), o = ce(l) ? l : void 0, i = (h) => {
706
- r(h.target.value);
707
- }, c = H(
823
+ const [t, o] = w(""), r = R(), l = he(r) ? r : void 0, i = (h) => {
824
+ o(h.target.value);
825
+ }, c = B(
708
826
  (h) => {
709
- e(), l == null || l.navigation.goToCfi(h);
827
+ n(), r == null || r.navigation.goToCfi(h);
710
828
  },
711
- [l, e]
712
- ), d = I(
713
- () => o == null ? void 0 : o.search.search(n).pipe(
714
- ie((h) => ({ type: "end", data: h })),
715
- ve({ type: "start" })
829
+ [r, n]
830
+ ), d = P(
831
+ () => l == null ? void 0 : l.search.search(t).pipe(
832
+ ce((h) => ({ type: "end", data: h })),
833
+ Pe({ type: "start" })
716
834
  ),
717
- [l, n]
718
- ), u = (d == null ? void 0 : d.type) === "start", s = (d == null ? void 0 : d.type) === "end" ? d.data : [], g = I(
719
- () => l == null ? void 0 : l.pagination.locate(s.slice(0, 100)),
835
+ [r, t]
836
+ ), u = (d == null ? void 0 : d.type) === "start", s = (d == null ? void 0 : d.type) === "end" ? d.data : [], p = P(
837
+ () => r == null ? void 0 : r.pagination.locate(s.slice(0, 100)),
720
838
  [s]
721
839
  );
722
- return /* @__PURE__ */ a(v, { flex: 1, height: "100%", children: [
723
- /* @__PURE__ */ t(R, { px: 4, children: /* @__PURE__ */ t(
724
- Se,
840
+ return /* @__PURE__ */ a(k, { flex: 1, height: "100%", children: [
841
+ /* @__PURE__ */ e(M, { px: 4, children: /* @__PURE__ */ e(
842
+ we,
725
843
  {
726
844
  placeholder: "Type something...",
727
- value: n,
845
+ value: t,
728
846
  onChange: i,
729
847
  borderRadius: 0
730
848
  }
731
849
  ) }),
732
850
  /* @__PURE__ */ a(
733
- R,
851
+ M,
734
852
  {
735
853
  px: 4,
736
854
  pb: 4,
@@ -738,27 +856,27 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
738
856
  flex: 1,
739
857
  style: { overflow: "hidden", overflowY: "auto" },
740
858
  children: [
741
- u && /* @__PURE__ */ t(m, { children: "Searching ..." }),
742
- !u && s.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
743
- !u && s.length >= 0 && /* @__PURE__ */ a(v, { children: [
744
- /* @__PURE__ */ a(L, { as: "h2", size: "md", children: [
859
+ u && /* @__PURE__ */ e(g, { children: "Searching ..." }),
860
+ !u && s.length === 0 && /* @__PURE__ */ e("p", { children: "There are no results" }),
861
+ !u && s.length >= 0 && /* @__PURE__ */ a(k, { children: [
862
+ /* @__PURE__ */ a(Q, { as: "h2", size: "md", children: [
745
863
  s.length,
746
864
  " result(s)"
747
865
  ] }),
748
- /* @__PURE__ */ t(v, { gap: 0, children: g == null ? void 0 : g.map((h, S) => {
749
- var P, x, C, A, J, Z, ee;
750
- return /* @__PURE__ */ t(
751
- at,
866
+ /* @__PURE__ */ e(k, { gap: 0, children: p == null ? void 0 : p.map((h, v) => {
867
+ var S, T, m, y, x, ne, te;
868
+ return /* @__PURE__ */ e(
869
+ xn,
752
870
  {
753
- contextText: ((C = (x = (P = h.meta) == null ? void 0 : P.range) == null ? void 0 : x.startContainer.parentElement) == null ? void 0 : C.textContent) ?? "",
754
- pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
755
- startOffset: ((Z = (J = h.meta) == null ? void 0 : J.range) == null ? void 0 : Z.startOffset) ?? 0,
756
- text: n,
871
+ contextText: ((m = (T = (S = h.meta) == null ? void 0 : S.range) == null ? void 0 : T.startContainer.parentElement) == null ? void 0 : m.textContent) ?? "",
872
+ pageIndex: (y = h.meta) == null ? void 0 : y.itemPageIndex,
873
+ startOffset: ((ne = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : ne.startOffset) ?? 0,
874
+ text: t,
757
875
  cfi: h.cfi,
758
876
  onClick: c,
759
- absolutePageIndex: (ee = h.meta) == null ? void 0 : ee.absolutePageIndex
877
+ absolutePageIndex: (te = h.meta) == null ? void 0 : te.absolutePageIndex
760
878
  },
761
- S
879
+ v
762
880
  );
763
881
  }) })
764
882
  ] })
@@ -767,62 +885,62 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
767
885
  )
768
886
  ] });
769
887
  }
770
- ), dt = p(
888
+ ), vn = f(
771
889
  ({
772
- open: e,
773
- setOpen: n,
774
- onNavigate: r
775
- }) => /* @__PURE__ */ t(
776
- V,
890
+ open: n,
891
+ setOpen: t,
892
+ onNavigate: o
893
+ }) => /* @__PURE__ */ e(
894
+ N,
777
895
  {
778
896
  lazyMount: !0,
779
897
  placement: "center",
780
- open: e,
781
- onOpenChange: (l) => n(l.open),
898
+ open: n,
899
+ onOpenChange: (r) => t(r.open),
782
900
  size: { mdDown: "full", md: "lg" },
783
901
  scrollBehavior: "inside",
784
- children: /* @__PURE__ */ a(W, { height: "100%", children: [
785
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Search" }) }),
786
- /* @__PURE__ */ t(Y, { flex: 1, children: /* @__PURE__ */ t(ct, { onNavigate: r }) }),
787
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
788
- /* @__PURE__ */ t(j, {})
902
+ children: /* @__PURE__ */ a(_, { height: "100%", children: [
903
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Search" }) }),
904
+ /* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(Cn, { onNavigate: o }) }),
905
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
906
+ /* @__PURE__ */ e($, {})
789
907
  ] })
790
908
  }
791
909
  )
792
- ), ht = p(
910
+ ), In = f(
793
911
  ({
794
- onNavigate: e
912
+ onNavigate: n
795
913
  }) => {
796
- const n = O(), { manifest: r, assumedRenditionLayout: l } = I(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: o } = r ?? {}, i = D();
797
- o != null && o.toc;
798
- const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = i ?? {}, u = (l === "reflowable" ? d : c) || 0;
799
- console.log({ assumedRenditionLayout: l, currentSpineItemOrChapterPageIndex: u });
914
+ const t = R(), { manifest: o, assumedRenditionLayout: r } = P(() => t == null ? void 0 : t.context.state$, [t]) ?? {}, { nav: l } = o ?? {}, i = E();
915
+ l != null && l.toc;
916
+ const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = i ?? {}, u = (r === "reflowable" ? d : c) || 0;
917
+ console.log({ assumedRenditionLayout: r, currentSpineItemOrChapterPageIndex: u });
800
918
  let s = i == null ? void 0 : i.beginChapterInfo;
801
919
  for (; s != null && s.subChapter; )
802
920
  s = s == null ? void 0 : s.subChapter;
803
- const g = (h, S, P) => /* @__PURE__ */ a(he.Fragment, { children: [
804
- /* @__PURE__ */ t(
805
- z.Item,
921
+ const p = (h, v, S) => /* @__PURE__ */ a(fe.Fragment, { children: [
922
+ /* @__PURE__ */ e(
923
+ I.Item,
806
924
  {
807
- pl: 4 * (P + 1),
925
+ pl: 4 * (S + 1),
808
926
  style: {
809
927
  display: "flex",
810
928
  alignItems: "center"
811
929
  },
812
930
  children: /* @__PURE__ */ a(
813
- ae,
931
+ q,
814
932
  {
815
933
  onClick: () => {
816
- e(), n == null || n.navigation.goToUrl(h.href);
934
+ n(), t == null || t.navigation.goToUrl(h.href);
817
935
  },
818
936
  href: "#",
819
937
  children: [
820
- (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ne, {}) }),
821
- (s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ne, {}) }),
822
- /* @__PURE__ */ a(v, { gap: 0, children: [
823
- /* @__PURE__ */ t(m, { fontSize: "md", children: h.title || h.path }),
824
- (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(
825
- m,
938
+ (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ e(I.Indicator, { asChild: !0, children: /* @__PURE__ */ e(re, {}) }),
939
+ (s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ e(I.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(re, {}) }),
940
+ /* @__PURE__ */ a(k, { gap: 0, children: [
941
+ /* @__PURE__ */ e(g, { fontSize: "md", children: h.title || h.path }),
942
+ (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ e(
943
+ g,
826
944
  {
827
945
  fontStyle: "italic",
828
946
  fontWeight: "bold",
@@ -836,96 +954,105 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
836
954
  )
837
955
  }
838
956
  ),
839
- h.contents.length > 0 && /* @__PURE__ */ t(z.Root, { as: "div", gap: 2, children: h.contents.map(
840
- (x, C) => g(x, C, P + 1)
957
+ h.contents.length > 0 && /* @__PURE__ */ e(I.Root, { as: "div", gap: 2, children: h.contents.map(
958
+ (T, m) => p(T, m, S + 1)
841
959
  ) })
842
- ] }, S);
843
- return /* @__PURE__ */ t(z.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: o == null ? void 0 : o.toc.map((h, S) => g(h, S, 0)) });
960
+ ] }, v);
961
+ return /* @__PURE__ */ e(I.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: l == null ? void 0 : l.toc.map((h, v) => p(h, v, 0)) });
844
962
  }
845
- ), ut = p(
963
+ ), Sn = f(
846
964
  ({
847
- open: e,
848
- setOpen: n,
849
- onNavigate: r
850
- }) => /* @__PURE__ */ t(
851
- V,
965
+ open: n,
966
+ setOpen: t,
967
+ onNavigate: o
968
+ }) => /* @__PURE__ */ e(
969
+ N,
852
970
  {
853
971
  lazyMount: !0,
854
972
  placement: "center",
855
- open: e,
856
- onOpenChange: (l) => n(l.open),
973
+ open: n,
974
+ onOpenChange: (r) => t(r.open),
857
975
  size: { mdDown: "full", md: "lg" },
858
976
  scrollBehavior: "inside",
859
- children: /* @__PURE__ */ a(W, { children: [
860
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Table of Contents" }) }),
861
- /* @__PURE__ */ t(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ht, { onNavigate: r }) }),
862
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
863
- /* @__PURE__ */ t(j, {})
977
+ children: /* @__PURE__ */ a(_, { children: [
978
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Table of Contents" }) }),
979
+ /* @__PURE__ */ e(j, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(In, { onNavigate: o }) }),
980
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
981
+ /* @__PURE__ */ e($, {})
864
982
  ] })
865
983
  }
866
984
  )
867
- ), wt = ({
868
- enableFloatingTime: e = !0,
869
- enableFloatingProgress: n = !0,
870
- onBackClick: r,
871
- onMoreClick: l
985
+ ), _n = ({
986
+ enableFloatingTime: n = !0,
987
+ enableFloatingProgress: t = !0,
988
+ onItemClick: o
872
989
  }) => {
873
- const [o, i] = T(!1), [c, d] = T(!1), [u, s] = T(!1), [g, h] = K();
874
- return /* @__PURE__ */ a(F, { children: [
875
- n && /* @__PURE__ */ t(
876
- $,
990
+ const [r, l] = w(!1), [i, c] = w(!1), [d, u] = w(!1), [s, p] = w(!1), [h, v] = w(!1), [S, T] = Z(), m = B(() => {
991
+ l(!1), c(!1), u(!1), p(!1), v(!1), T(!1);
992
+ }, [T]), y = B(
993
+ (x) => {
994
+ x === "annotations" ? p(!0) : x === "search" ? u(!0) : x === "help" ? c(!0) : x === "toc" ? l(!0) : x === "bookmarks" && v(!0), o == null || o(x);
995
+ },
996
+ [o]
997
+ );
998
+ return /* @__PURE__ */ a(X, { children: [
999
+ t && /* @__PURE__ */ e(
1000
+ G,
877
1001
  {
878
- present: !g,
1002
+ present: !S,
879
1003
  animationName: { _open: "fade-in", _closed: "fade-out" },
880
1004
  animationDuration: "moderate",
881
- children: /* @__PURE__ */ t(Ve, {})
1005
+ children: /* @__PURE__ */ e(Ze, {})
882
1006
  }
883
1007
  ),
884
- /* @__PURE__ */ t(
885
- st,
1008
+ /* @__PURE__ */ e(bn, { onItemClick: y }),
1009
+ /* @__PURE__ */ e(Je, { open: i, setOpen: c }),
1010
+ /* @__PURE__ */ e(
1011
+ Sn,
886
1012
  {
887
- onBackClick: r,
888
- onMoreClick: l,
889
- onTableOfContentsClick: () => i(!0),
890
- onHelpClick: () => d(!0),
891
- onSearchClick: () => s(!0)
1013
+ open: r,
1014
+ setOpen: l,
1015
+ onNavigate: m
892
1016
  }
893
1017
  ),
894
- /* @__PURE__ */ t(je, { open: c, setOpen: d }),
895
- /* @__PURE__ */ t(
896
- ut,
1018
+ /* @__PURE__ */ e(
1019
+ vn,
897
1020
  {
898
- open: o,
899
- setOpen: i,
900
- onNavigate: () => {
901
- i(!1), h(!1);
902
- }
1021
+ open: d,
1022
+ setOpen: u,
1023
+ onNavigate: m
903
1024
  }
904
1025
  ),
905
- /* @__PURE__ */ t(
906
- dt,
1026
+ /* @__PURE__ */ e(
1027
+ Ue,
907
1028
  {
908
- open: u,
909
- setOpen: s,
910
- onNavigate: () => {
911
- s(!1), h(!1);
912
- }
1029
+ open: s,
1030
+ setOpen: p,
1031
+ onNavigate: m
1032
+ }
1033
+ ),
1034
+ /* @__PURE__ */ e(
1035
+ Ge,
1036
+ {
1037
+ open: h,
1038
+ setOpen: v,
1039
+ onNavigate: m
913
1040
  }
914
1041
  ),
915
- /* @__PURE__ */ t(
916
- $,
1042
+ /* @__PURE__ */ e(
1043
+ G,
917
1044
  {
918
- present: e || g,
1045
+ present: n || S,
919
1046
  animationName: { _open: "fade-in", _closed: "fade-out" },
920
1047
  animationDuration: "slow",
921
1048
  overflow: "hidden",
922
- children: /* @__PURE__ */ t(Ye, {})
1049
+ children: /* @__PURE__ */ e(tn, {})
923
1050
  }
924
1051
  )
925
1052
  ] });
926
1053
  };
927
1054
  export {
928
- wt as ReactReader,
929
- kt as ReactReaderProvider
1055
+ _n as ReactReader,
1056
+ Ln as ReactReaderProvider
930
1057
  };
931
1058
  //# sourceMappingURL=index.js.map