@prose-reader/react-reader 1.228.0 → 1.230.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,93 +1,94 @@
1
- import { jsx as t, jsxs as a, Fragment as ne } from "react/jsx-runtime";
2
- import * as D from "react";
3
- import Be, { createContext as Ee, memo as p, useMemo as ae, useEffect as oe, useContext as Me, useState as I, useLayoutEffect as Le, useCallback as N } from "react";
4
- import { signal as ce, useSignalState as Ce, useConstant as _e, useLiveRef as $e, useSubscribe as B, useObserve as b, isDefined as ke, useSignalValue as Ne } from "reactjrx";
5
- import { Subject as de, tap as he, map as L, filter as J, switchMap as H, of as He, NEVER as ie, startWith as ye, distinctUntilChanged as Ie, throttleTime as Fe, first as Se, combineLatest as je, EMPTY as We, finalize as we, mergeMap as Ge, skip as Te, merge as Ve, timer as Ye } from "rxjs";
6
- import { IconButton as v, Portal as ue, Dialog as k, List as S, Link as ge, Stack as P, Text as f, Tabs as O, Button as W, Presence as ee, Box as w, createToaster as Ue, Toaster as qe, Toast as E, Spinner as Qe, Heading as se, HStack as z, Kbd as xe, Popover as M, Progress as F, chakra as Ke, Collapsible as re, Input as Xe } from "@chakra-ui/react";
7
- import { LuX as Ze, LuNotebookPen as te, LuBookmark as Je, LuArrowBigRight as et, LuArrowBigLeft as tt, LuChevronDown as nt, LuCircleHelp as ot, LuTableOfContents as it, LuSearch as rt, LuGalleryHorizontal as st, LuCircleCheck as ve } from "react-icons/lu";
1
+ import { jsx as t, jsxs as c, Fragment as oe } from "react/jsx-runtime";
2
+ import * as z from "react";
3
+ import ze, { createContext as Ee, memo as g, useMemo as ce, useEffect as W, useContext as Be, useState as k, useLayoutEffect as Me, useCallback as N } from "react";
4
+ import { signal as de, useSignalState as Ce, useConstant as Le, useLiveRef as $e, useSubscribe as E, useObserve as v, isDefined as Ie, useSignalValue as _e } from "reactjrx";
5
+ import { Subject as he, tap as ue, map as L, filter as ee, switchMap as F, of as Ne, withLatestFrom as Fe, NEVER as re, startWith as ye, distinctUntilChanged as Se, throttleTime as He, first as Te, combineLatest as je, EMPTY as We, finalize as ke, mergeMap as Ge, skip as we, merge as Ve, timer as Ye } from "rxjs";
6
+ import { IconButton as I, Portal as ge, Dialog as S, List as w, Link as pe, Stack as R, Text as f, Tabs as O, Button as G, Presence as te, Box as P, createToaster as Ue, Toaster as qe, Toast as B, Spinner as Qe, Heading as le, HStack as D, Kbd as xe, Popover as M, Progress as H, chakra as Ke, Collapsible as se, Input as Ze } from "@chakra-ui/react";
7
+ import { LuX as Xe, LuNotebookPen as ne, LuBookmark as Je, LuArrowBigRight as et, LuArrowBigLeft as tt, LuChevronDown as nt, LuCircleHelp as ot, LuTableOfContents as rt, LuSearch as it, LuGalleryHorizontal as st, LuCircleCheck as ve } from "react-icons/lu";
8
8
  import { createPortal as lt } from "react-dom";
9
- import { BsBookmarkPlus as at, BsBookmarkXFill as ct, BsBookmarks as dt } from "react-icons/bs";
10
- import { isShallowEqual as ht, observeIntersection as ut, isHtmlTagElement as gt } from "@prose-reader/core";
11
- import { RiGalleryView2 as pt } from "react-icons/ri";
12
- import { RxDoubleArrowUp as mt, RxDoubleArrowLeft as ft, RxDoubleArrowDown as bt, RxDoubleArrowRight as xt } from "react-icons/rx";
13
- import { HiOutlineInformationCircle as vt } from "react-icons/hi";
14
- import Ct from "rc-slider";
9
+ import { isPositionInArea as at } from "@prose-reader/enhancer-gestures";
10
+ import { isShallowEqual as ct, observeIntersection as dt, isHtmlTagElement as ht } from "@prose-reader/core";
11
+ import { BsBookmarks as ut } from "react-icons/bs";
12
+ import { RiGalleryView2 as gt } from "react-icons/ri";
13
+ import { RxDoubleArrowUp as pt, RxDoubleArrowLeft as mt, RxDoubleArrowDown as ft, RxDoubleArrowRight as bt } from "react-icons/rx";
14
+ import { HiOutlineInformationCircle as xt } from "react-icons/hi";
15
+ import vt from "rc-slider";
15
16
  import "rc-slider/assets/index.css";
16
- import { IoIosArrowBack as kt, IoMdMore as yt } from "react-icons/io";
17
- import { MdFullscreenExit as It, MdFullscreen as St } from "react-icons/md";
18
- const Re = Ee({
17
+ import { IoIosArrowBack as Ct, IoMdMore as It } from "react-icons/io";
18
+ import { MdFullscreenExit as yt, MdFullscreen as St } from "react-icons/md";
19
+ const Pe = Ee({
19
20
  reader: void 0,
20
- quickMenuSignal: ce({ default: !1 }),
21
- notificationsSubject: new de()
22
- }), $n = p(
21
+ quickMenuSignal: de({ default: !1 }),
22
+ notificationsSubject: new he()
23
+ }), Nn = g(
23
24
  ({
24
25
  children: e,
25
26
  reader: n,
26
27
  quickMenuOpen: o,
27
- onQuickMenuOpenChange: i
28
+ onQuickMenuOpenChange: r
28
29
  }) => {
29
- const [, r] = Ce(
30
- () => ce({
30
+ const [, i] = Ce(
31
+ () => de({
31
32
  default: o
32
33
  })
33
- ), s = _e(
34
- () => new de()
35
- ), c = $e(i), d = ae(
34
+ ), s = Le(
35
+ () => new he()
36
+ ), d = $e(r), l = ce(
36
37
  () => ({
37
- quickMenuSignal: r,
38
+ quickMenuSignal: i,
38
39
  reader: n,
39
40
  notificationsSubject: s
40
41
  }),
41
- [r, n, s]
42
+ [i, n, s]
42
43
  );
43
- return oe(() => {
44
- r.setValue(o);
45
- }, [o, r]), B(
46
- () => r.pipe(he(c.current)),
47
- [r, c]
48
- ), /* @__PURE__ */ t(Re.Provider, { value: d, children: e });
44
+ return W(() => {
45
+ i.setValue(o);
46
+ }, [o, i]), E(
47
+ () => i.pipe(ue(d.current)),
48
+ [i, d]
49
+ ), /* @__PURE__ */ t(Pe.Provider, { value: l, children: e });
49
50
  }
50
- ), wt = D.forwardRef(function(n, o) {
51
- return /* @__PURE__ */ t(v, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(Ze, {}) });
52
- }), G = D.forwardRef(function(n, o) {
51
+ ), Tt = z.forwardRef(function(n, o) {
52
+ return /* @__PURE__ */ t(I, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(Xe, {}) });
53
+ }), V = z.forwardRef(function(n, o) {
53
54
  const {
54
- children: i,
55
- portalled: r = !0,
55
+ children: r,
56
+ portalled: i = !0,
56
57
  portalRef: s,
57
- backdrop: c = !0,
58
- ...d
58
+ backdrop: d = !0,
59
+ ...l
59
60
  } = n;
60
- return /* @__PURE__ */ a(ue, { disabled: !r, container: s, children: [
61
- c && /* @__PURE__ */ t(k.Backdrop, {}),
62
- /* @__PURE__ */ t(k.Positioner, { children: /* @__PURE__ */ t(k.Content, { ref: o, ...d, asChild: !1, children: i }) })
61
+ return /* @__PURE__ */ c(ge, { disabled: !i, container: s, children: [
62
+ d && /* @__PURE__ */ t(S.Backdrop, {}),
63
+ /* @__PURE__ */ t(S.Positioner, { children: /* @__PURE__ */ t(S.Content, { ref: o, ...l, asChild: !1, children: r }) })
63
64
  ] });
64
- }), V = D.forwardRef(function(n, o) {
65
+ }), Y = z.forwardRef(function(n, o) {
65
66
  return /* @__PURE__ */ t(
66
- k.CloseTrigger,
67
+ S.CloseTrigger,
67
68
  {
68
69
  position: "absolute",
69
70
  top: "2",
70
71
  insetEnd: "2",
71
72
  ...n,
72
73
  asChild: !0,
73
- children: /* @__PURE__ */ t(wt, { size: "sm", ref: o, children: n.children })
74
+ children: /* @__PURE__ */ t(Tt, { size: "sm", ref: o, children: n.children })
74
75
  }
75
76
  );
76
- }), Y = k.Root, U = k.Footer, q = k.Header, Q = k.Body;
77
- k.Backdrop;
78
- const K = k.Title;
79
- k.Description;
80
- k.Trigger;
81
- const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
82
- const { reader: e } = Z();
77
+ }), U = S.Root, q = S.Footer, Q = S.Header, K = S.Body;
78
+ S.Backdrop;
79
+ const Z = S.Title;
80
+ S.Description;
81
+ S.Trigger;
82
+ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
83
+ const { reader: e } = J();
83
84
  return e;
84
- }, Pe = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, j = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Ae = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, Tt = (e) => {
85
- const n = m(), o = j(n) ? n : void 0;
86
- return { data: b(
85
+ }, Re = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, j = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Ae = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, kt = (e) => {
86
+ const n = p(), o = j(n) ? n : void 0;
87
+ return { data: v(
87
88
  () => o == null ? void 0 : o.annotations.annotations$.pipe(
88
- L((r) => r.find((s) => s.id === e)),
89
- J(ke),
90
- H((r) => o.locateResource(r))
89
+ L((i) => i.find((s) => s.id === e)),
90
+ ee(Ie),
91
+ F((i) => o.locateResource(i))
91
92
  ),
92
93
  [o]
93
94
  ) };
@@ -95,45 +96,45 @@ const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
95
96
  id: e,
96
97
  onNavigate: n
97
98
  }) => {
98
- var r, s;
99
- const o = m(), { data: i } = Tt(e);
100
- return /* @__PURE__ */ t(S.Item, { children: /* @__PURE__ */ a(
101
- ge,
99
+ var i, s;
100
+ const o = p(), { data: r } = kt(e);
101
+ return /* @__PURE__ */ t(w.Item, { children: /* @__PURE__ */ c(
102
+ pe,
102
103
  {
103
104
  href: "#",
104
105
  onClick: () => {
105
- n(), o == null || o.navigation.goToCfi((i == null ? void 0 : i.meta.cfi) ?? "");
106
+ n(), o == null || o.navigation.goToCfi((r == null ? void 0 : r.meta.cfi) ?? "");
106
107
  },
107
108
  children: [
108
- (r = i == null ? void 0 : i.resource) != null && r.notes ? /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(te, {}) }) : /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(te, {}) }),
109
- /* @__PURE__ */ a(P, { gap: 0, children: [
110
- /* @__PURE__ */ t(f, { lineClamp: 2, fontSize: "md", children: i != null && i.meta.range ? i == null ? void 0 : i.meta.range.toString() : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
109
+ (i = r == null ? void 0 : r.resource) != null && i.notes ? /* @__PURE__ */ t(w.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ne, {}) }) : /* @__PURE__ */ t(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ne, {}) }),
110
+ /* @__PURE__ */ c(R, { gap: 0, children: [
111
+ /* @__PURE__ */ t(f, { lineClamp: 2, fontSize: "md", children: r != null && r.meta.range ? r == null ? void 0 : r.meta.range.toString() : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
111
112
  /* @__PURE__ */ t(
112
113
  f,
113
114
  {
114
115
  fontStyle: "italic",
115
116
  fontWeight: "bold",
116
117
  fontSize: "sm",
117
- children: `Book page: ${((s = i == null ? void 0 : i.meta) == null ? void 0 : s.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
118
+ children: `Book page: ${((s = r == null ? void 0 : r.meta) == null ? void 0 : s.absolutePageIndex) !== void 0 ? r.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
118
119
  }
119
120
  )
120
121
  ] })
121
122
  ]
122
123
  }
123
124
  ) });
124
- }, pe = () => {
125
- const e = m(), n = j(e) ? e : void 0;
126
- return { data: b(
125
+ }, ie = () => {
126
+ const e = p(), n = j(e) ? e : void 0;
127
+ return { data: v(
127
128
  () => n == null ? void 0 : n.annotations.annotations$.pipe(
128
- H(
129
- (i) => n.locateResource(i)
129
+ F(
130
+ (r) => n.locateResource(r)
130
131
  )
131
132
  ),
132
133
  [n]
133
134
  ) };
134
- }, Rt = ({ onNavigate: e }) => {
135
- const { data: n } = pe();
136
- return /* @__PURE__ */ t(S.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
135
+ }, wt = ({ onNavigate: e }) => {
136
+ const { data: n } = ie();
137
+ return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
137
138
  Oe,
138
139
  {
139
140
  id: o.resource.id,
@@ -142,13 +143,13 @@ const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
142
143
  o.resource.id
143
144
  )) });
144
145
  }, Pt = () => {
145
- const { data: e } = pe();
146
+ const { data: e } = ie();
146
147
  return {
147
148
  data: e == null ? void 0 : e.filter((n) => !n.meta.range)
148
149
  };
149
- }, At = ({ onNavigate: e }) => {
150
+ }, Rt = ({ onNavigate: e }) => {
150
151
  const { data: n } = Pt();
151
- return /* @__PURE__ */ t(S.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
152
+ return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
152
153
  Oe,
153
154
  {
154
155
  id: o.resource.id,
@@ -156,76 +157,76 @@ const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
156
157
  },
157
158
  o.resource.id
158
159
  )) });
159
- }, Ot = p(
160
+ }, At = g(
160
161
  ({
161
162
  onNavigate: e,
162
163
  defaultTab: n
163
164
  }) => {
164
- const [o, i] = I(n ?? "bookmarks");
165
- return /* @__PURE__ */ a(
165
+ const [o, r] = k(n ?? "bookmarks");
166
+ return /* @__PURE__ */ c(
166
167
  O.Root,
167
168
  {
168
169
  value: o,
169
- onValueChange: (r) => i(r.value),
170
+ onValueChange: (i) => r(i.value),
170
171
  children: [
171
- /* @__PURE__ */ a(O.List, { children: [
172
- /* @__PURE__ */ a(O.Trigger, { value: "bookmarks", children: [
172
+ /* @__PURE__ */ c(O.List, { children: [
173
+ /* @__PURE__ */ c(O.Trigger, { value: "bookmarks", children: [
173
174
  /* @__PURE__ */ t(Je, {}),
174
175
  "Bookmarks"
175
176
  ] }),
176
- /* @__PURE__ */ a(O.Trigger, { value: "annotations", children: [
177
- /* @__PURE__ */ t(te, {}),
177
+ /* @__PURE__ */ c(O.Trigger, { value: "annotations", children: [
178
+ /* @__PURE__ */ t(ne, {}),
178
179
  "Annotations"
179
180
  ] }),
180
181
  /* @__PURE__ */ t(O.Indicator, {})
181
182
  ] }),
182
- /* @__PURE__ */ t(O.Content, { value: "bookmarks", children: /* @__PURE__ */ t(At, { onNavigate: e }) }),
183
- /* @__PURE__ */ t(O.Content, { value: "annotations", children: /* @__PURE__ */ t(Rt, { onNavigate: e }) })
183
+ /* @__PURE__ */ t(O.Content, { value: "bookmarks", children: /* @__PURE__ */ t(Rt, { onNavigate: e }) }),
184
+ /* @__PURE__ */ t(O.Content, { value: "annotations", children: /* @__PURE__ */ t(wt, { onNavigate: e }) })
184
185
  ]
185
186
  }
186
187
  );
187
188
  }
188
- ), zt = p(
189
+ ), Ot = g(
189
190
  ({
190
191
  openWith: e,
191
192
  setOpen: n,
192
193
  onNavigate: o
193
194
  }) => /* @__PURE__ */ t(
194
- Y,
195
+ U,
195
196
  {
196
197
  lazyMount: !0,
197
198
  placement: "center",
198
199
  open: !!e,
199
- onOpenChange: (i) => n(i.open),
200
+ onOpenChange: (r) => n(r.open),
200
201
  size: { mdDown: "full", md: "lg" },
201
202
  scrollBehavior: "inside",
202
- children: /* @__PURE__ */ a(G, { height: "100%", children: [
203
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(K, { children: "Annotations" }) }),
204
- /* @__PURE__ */ t(Q, { flex: 1, children: /* @__PURE__ */ t(
205
- Ot,
203
+ children: /* @__PURE__ */ c(V, { height: "100%", children: [
204
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Annotations" }) }),
205
+ /* @__PURE__ */ t(K, { flex: 1, children: /* @__PURE__ */ t(
206
+ At,
206
207
  {
207
208
  onNavigate: o,
208
209
  defaultTab: e
209
210
  }
210
211
  ) }),
211
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(W, { variant: "outline", children: "Cancel" }) }) }),
212
- /* @__PURE__ */ t(V, {})
212
+ /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
213
+ /* @__PURE__ */ t(Y, {})
213
214
  ] })
214
215
  }
215
216
  )
216
- ), Dt = p(({ children: e }) => {
217
- const n = m(), o = b(() => n == null ? void 0 : n.spine.element$, [n]);
218
- return o ? /* @__PURE__ */ t(ne, { children: lt(e, o) }) : null;
219
- }), Bt = ({
217
+ ), Dt = g(({ children: e }) => {
218
+ const n = p(), o = v(() => n == null ? void 0 : n.spine.element$, [n]);
219
+ return o ? /* @__PURE__ */ t(oe, { children: lt(e, o) }) : null;
220
+ }), zt = ({
220
221
  absolutePageIndex: e,
221
222
  itemIndex: n
222
223
  }) => {
223
- const o = m(), i = b(
224
+ const o = p(), r = v(
224
225
  () => o == null ? void 0 : o.spine.spineItemsManager.items$,
225
226
  [o]
226
227
  );
227
228
  return {
228
- spineItem: ae(() => {
229
+ spineItem: ce(() => {
229
230
  if (n !== void 0)
230
231
  return o == null ? void 0 : o.spine.spineItemsManager.get(n);
231
232
  if (e !== void 0) {
@@ -234,123 +235,143 @@ const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
234
235
  })) ?? {};
235
236
  return o == null ? void 0 : o.spine.spineItemsManager.get(s);
236
237
  }
237
- }, [n, e, o, i])
238
+ }, [n, e, o, r])
238
239
  };
239
240
  }, Et = ({
240
241
  absolutePageIndex: e,
241
242
  itemIndex: n
242
243
  }) => {
243
- const { spineItem: o } = Bt({ absolutePageIndex: e, itemIndex: n });
244
- return b(
245
- () => (o == null ? void 0 : o.isReady$) ?? He(!1),
244
+ const { spineItem: o } = zt({ absolutePageIndex: e, itemIndex: n });
245
+ return v(
246
+ () => (o == null ? void 0 : o.isReady$) ?? Ne(!1),
246
247
  [o]
247
248
  );
248
- }, Mt = "data-bookmark-area", ze = () => {
249
- const e = m();
250
- return j(e) ? e : void 0;
251
- }, Lt = (e) => {
252
- const n = ze();
253
- return b(
254
- () => n == null ? void 0 : n.annotations.candidates$.pipe(
255
- L((o) => o[e])
256
- ),
257
- [n]
258
- );
259
- }, _t = p(
249
+ }, Bt = "data-bookmark-area", Mt = g(
260
250
  ({
261
251
  absolutePageIndex: e,
262
252
  left: n,
263
253
  top: o,
264
- width: i
254
+ width: r
265
255
  }) => {
266
- const r = ze(), s = Et({ absolutePageIndex: e }), { data: c } = pe(), d = c == null ? void 0 : c.find(
267
- (l) => {
268
- var g;
269
- return ((g = l == null ? void 0 : l.meta) == null ? void 0 : g.absolutePageIndex) === e && l.meta.range === void 0;
256
+ const i = Et({ absolutePageIndex: e }), { data: s } = ie(), d = s == null ? void 0 : s.find(
257
+ (u) => {
258
+ var a;
259
+ return ((a = u == null ? void 0 : u.meta) == null ? void 0 : a.absolutePageIndex) === e && u.meta.range === void 0;
270
260
  }
271
- ), u = Lt(e);
272
- return !s || !u ? null : /* @__PURE__ */ t(
273
- ee,
261
+ );
262
+ if (!i) return null;
263
+ const l = r * 0.1 / 2;
264
+ return /* @__PURE__ */ t(
265
+ te,
274
266
  {
275
- present: !0,
267
+ present: !!d,
276
268
  lazyMount: !0,
277
269
  animationName: { _open: "fade-in", _closed: "fade-out" },
278
270
  animationDuration: "moderate",
279
271
  children: /* @__PURE__ */ t(
280
- w,
272
+ P,
281
273
  {
282
- "data-bookmark-area": Mt,
274
+ "data-bookmark-area": Bt,
283
275
  position: "absolute",
284
- left: n + i,
276
+ left: n + r,
285
277
  transform: "translateX(-100%)",
278
+ pointerEvents: "none",
286
279
  top: o,
287
- p: 2,
288
- children: d ? /* @__PURE__ */ t(
289
- v,
290
- {
291
- "aria-label": "bookmark",
292
- opacity: 0.5,
293
- _hover: { opacity: 1 },
294
- onClick: () => {
295
- r == null || r.annotations.delete(d.resource.id);
296
- },
297
- size: "lg",
298
- variant: "ghost",
299
- _icon: { boxSize: "36px" },
300
- children: /* @__PURE__ */ t(ct, {})
301
- }
302
- ) : /* @__PURE__ */ t(
303
- v,
304
- {
305
- "aria-label": "bookmark",
306
- onClick: () => {
307
- r == null || r.annotations.annotateAbsolutePage({
308
- absolutePageIndex: e
309
- });
310
- },
311
- size: "lg",
312
- bgColor: "white",
313
- opacity: 0.5,
314
- _hover: { opacity: 1 },
315
- variant: "ghost",
316
- _icon: { boxSize: "36px" },
317
- children: /* @__PURE__ */ t(at, {})
318
- }
319
- )
280
+ width: l,
281
+ height: l,
282
+ _before: {
283
+ content: '""',
284
+ position: "absolute",
285
+ top: 0,
286
+ left: 0,
287
+ width: 0,
288
+ height: 0,
289
+ borderTop: `${l}px solid #03030373`,
290
+ borderLeft: `${l}px solid transparent`
291
+ }
320
292
  }
321
293
  )
322
294
  }
323
295
  );
324
296
  }
325
- ), $t = p(() => {
326
- const e = m(), n = b(() => e == null ? void 0 : e.layoutInfo$, [e]);
297
+ ), Lt = g(() => {
298
+ const e = p(), n = v(() => e == null ? void 0 : e.layoutInfo$, [e]);
327
299
  return /* @__PURE__ */ t(Dt, { children: n == null ? void 0 : n.pages.map(
328
- ({ absoluteLayout: { left: o, top: i, width: r } }, s) => /* @__PURE__ */ t(
329
- _t,
300
+ ({ absoluteLayout: { left: o, top: r, width: i } }, s) => /* @__PURE__ */ t(
301
+ Mt,
330
302
  {
331
303
  absolutePageIndex: s,
332
304
  left: o,
333
- top: i,
334
- width: r
305
+ top: r,
306
+ width: i
335
307
  },
336
308
  s
337
309
  )
338
310
  ) });
339
- }), le = Ue({
311
+ }), $t = () => {
312
+ const e = p();
313
+ return j(e) ? e : void 0;
314
+ }, _t = () => {
315
+ const e = $t(), { data: n } = ie();
316
+ W(() => e ? e.gestures.hooks.register(
317
+ "beforeTapGesture",
318
+ ({ event$: r }) => r.pipe(
319
+ Fe(e == null ? void 0 : e.annotations.candidates$),
320
+ L(([i, s]) => {
321
+ if (!i.page) return !0;
322
+ const {
323
+ spineItem: d,
324
+ spineItemPageIndex: l,
325
+ spineItemPagePosition: u,
326
+ pageSize: a
327
+ } = i.page;
328
+ if (at(
329
+ u,
330
+ {
331
+ type: "corner",
332
+ corner: "top-right",
333
+ size: 10,
334
+ unit: "%"
335
+ },
336
+ a
337
+ )) {
338
+ const h = e.spine.pages.fromSpineItemPageIndex(
339
+ d,
340
+ l
341
+ );
342
+ if (!h) return !0;
343
+ const b = n == null ? void 0 : n.find(
344
+ (C) => {
345
+ var T;
346
+ return ((T = C == null ? void 0 : C.meta) == null ? void 0 : T.absolutePageIndex) === h.absolutePageIndex && C.meta.range === void 0;
347
+ }
348
+ );
349
+ if (b)
350
+ return e == null || e.annotations.delete(b.resource.id), !1;
351
+ if (s == null ? void 0 : s[h.absolutePageIndex])
352
+ return e == null || e.annotations.annotateAbsolutePage({
353
+ absolutePageIndex: h.absolutePageIndex
354
+ }), !1;
355
+ }
356
+ return !0;
357
+ })
358
+ )
359
+ ) : void 0, [e, n]);
360
+ }, ae = Ue({
340
361
  placement: "bottom-end",
341
362
  pauseOnPageIdle: !0
342
- }), Nt = () => /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ t(qe, { toaster: le, insetInline: { mdDown: "4" }, children: (e) => {
363
+ }), Nt = () => /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(qe, { toaster: ae, insetInline: { mdDown: "4" }, children: (e) => {
343
364
  var n;
344
- return /* @__PURE__ */ a(E.Root, { width: { md: "sm" }, children: [
345
- e.type === "loading" ? /* @__PURE__ */ t(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(E.Indicator, {}),
346
- /* @__PURE__ */ a(P, { gap: "1", flex: "1", maxWidth: "100%", children: [
347
- e.title && /* @__PURE__ */ t(E.Title, { children: e.title }),
348
- e.description && /* @__PURE__ */ t(E.Description, { children: e.description })
365
+ return /* @__PURE__ */ c(B.Root, { width: { md: "sm" }, children: [
366
+ e.type === "loading" ? /* @__PURE__ */ t(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(B.Indicator, {}),
367
+ /* @__PURE__ */ c(R, { gap: "1", flex: "1", maxWidth: "100%", children: [
368
+ e.title && /* @__PURE__ */ t(B.Title, { children: e.title }),
369
+ e.description && /* @__PURE__ */ t(B.Description, { children: e.description })
349
370
  ] }),
350
- e.action && /* @__PURE__ */ t(E.ActionTrigger, { children: e.action.label }),
351
- ((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(E.CloseTrigger, {})
371
+ e.action && /* @__PURE__ */ t(B.ActionTrigger, { children: e.action.label }),
372
+ ((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(B.CloseTrigger, {})
352
373
  ] });
353
- } }) }), Ht = {
374
+ } }) }), Ft = {
354
375
  x: 0,
355
376
  y: 0,
356
377
  width: 0,
@@ -360,64 +381,64 @@ const X = k.ActionTrigger, Z = () => Me(Re), m = () => {
360
381
  bottom: 0,
361
382
  right: 0
362
383
  };
363
- function Ft() {
364
- const [e, n] = I(null), [o, i] = I(Ht), r = ae(
384
+ function Ht() {
385
+ const [e, n] = k(null), [o, r] = k(Ft), i = ce(
365
386
  () => new ResizeObserver((s) => {
366
387
  if (s[0]) {
367
- const { x: c, y: d, width: u, height: l, top: g, left: h, bottom: C, right: y } = s[0].contentRect;
368
- i({ x: c, y: d, width: u, height: l, top: g, left: h, bottom: C, right: y });
388
+ const { x: d, y: l, width: u, height: a, top: m, left: h, bottom: b, right: y } = s[0].contentRect;
389
+ r({ x: d, y: l, width: u, height: a, top: m, left: h, bottom: b, right: y });
369
390
  }
370
391
  }),
371
392
  []
372
393
  );
373
- return Le(() => {
394
+ return Me(() => {
374
395
  if (e)
375
- return r.observe(e), () => {
376
- r.disconnect();
396
+ return i.observe(e), () => {
397
+ i.disconnect();
377
398
  };
378
- }, [e, r]), [n, o, e];
399
+ }, [e, i]), [n, o, e];
379
400
  }
380
401
  const jt = (e, n, o) => {
381
- const i = m(), r = Ae(i) ? i : void 0;
382
- B(() => {
383
- if (!r || !e) return ie;
402
+ const r = p(), i = Ae(r) ? r : void 0;
403
+ E(() => {
404
+ if (!i || !e) return re;
384
405
  const s = n.layout.layout$.pipe(
385
406
  ye(n.layout.layoutInfo),
386
- Ie(ht)
387
- ), c = ut(
407
+ Se(ct)
408
+ ), d = dt(
388
409
  e
389
- ).pipe(L((d) => d.some((u) => u.isIntersecting)));
410
+ ).pipe(L((l) => l.some((u) => u.isIntersecting)));
390
411
  return s.pipe(
391
- Fe(100, void 0, { trailing: !0 }),
392
- H(() => c.pipe(
393
- he((d) => {
394
- d || (e.innerHTML = "");
412
+ He(100, void 0, { trailing: !0 }),
413
+ F(() => d.pipe(
414
+ ue((l) => {
415
+ l || (e.innerHTML = "");
395
416
  }),
396
- J((d) => d),
397
- Se()
417
+ ee((l) => l),
418
+ Te()
398
419
  ).pipe(
399
- H(() => (e.innerHTML = "", r == null ? void 0 : r.gallery.snapshot(
420
+ F(() => (e.innerHTML = "", i == null ? void 0 : i.gallery.snapshot(
400
421
  n,
401
422
  e,
402
423
  o
403
424
  )))
404
425
  ))
405
426
  );
406
- }, [r, n, o, e]);
407
- }, Wt = p(
427
+ }, [i, n, o, e]);
428
+ }, Wt = g(
408
429
  ({
409
430
  item: e,
410
431
  onNavigated: n
411
432
  }) => {
412
- var d;
413
- const [o, i, r] = Ft(), s = m();
414
- jt(r, e, i);
415
- const c = b(
433
+ var l;
434
+ const [o, r, i] = Ht(), s = p();
435
+ jt(i, e, r);
436
+ const d = v(
416
437
  () => s == null ? void 0 : s.locateResource(e, { mode: "shallow" }),
417
438
  [s, e]
418
439
  );
419
- return /* @__PURE__ */ a(
420
- w,
440
+ return /* @__PURE__ */ c(
441
+ P,
421
442
  {
422
443
  width: "100%",
423
444
  aspectRatio: "2/3",
@@ -433,7 +454,7 @@ const jt = (e, n, o) => {
433
454
  },
434
455
  children: [
435
456
  /* @__PURE__ */ t(
436
- w,
457
+ P,
437
458
  {
438
459
  height: "100%",
439
460
  width: "100%",
@@ -442,7 +463,7 @@ const jt = (e, n, o) => {
442
463
  ref: o
443
464
  }
444
465
  ),
445
- /* @__PURE__ */ a(
466
+ /* @__PURE__ */ c(
446
467
  f,
447
468
  {
448
469
  position: "absolute",
@@ -455,7 +476,7 @@ const jt = (e, n, o) => {
455
476
  fontSize: "xs",
456
477
  children: [
457
478
  "Page ",
458
- (((d = c == null ? void 0 : c.meta) == null ? void 0 : d.absolutePageIndex) ?? 0) + 1
479
+ (((l = d == null ? void 0 : d.meta) == null ? void 0 : l.absolutePageIndex) ?? 0) + 1
459
480
  ]
460
481
  }
461
482
  )
@@ -463,25 +484,25 @@ const jt = (e, n, o) => {
463
484
  }
464
485
  );
465
486
  }
466
- ), Gt = p(
487
+ ), Gt = g(
467
488
  ({
468
489
  open: e,
469
490
  setOpen: n
470
491
  }) => {
471
- const o = m(), i = b(() => o == null ? void 0 : o.spineItemsManager.items$, [o]);
492
+ const o = p(), r = v(() => o == null ? void 0 : o.spineItemsManager.items$, [o]);
472
493
  return /* @__PURE__ */ t(
473
- Y,
494
+ U,
474
495
  {
475
496
  lazyMount: !0,
476
497
  placement: "center",
477
498
  open: e,
478
- onOpenChange: (r) => n(r.open),
499
+ onOpenChange: (i) => n(i.open),
479
500
  size: { mdDown: "full", md: "lg" },
480
501
  scrollBehavior: "inside",
481
- children: /* @__PURE__ */ a(G, { height: "100%", children: [
482
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(K, { children: "Gallery" }) }),
483
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
484
- w,
502
+ children: /* @__PURE__ */ c(V, { height: "100%", children: [
503
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Gallery" }) }),
504
+ /* @__PURE__ */ t(K, { children: /* @__PURE__ */ t(
505
+ P,
485
506
  {
486
507
  gridTemplateColumns: [
487
508
  "repeat(2, minmax(0, 1fr))",
@@ -491,30 +512,30 @@ const jt = (e, n, o) => {
491
512
  gap: [2, 4],
492
513
  pt: 2,
493
514
  "data-grid": !0,
494
- children: i == null ? void 0 : i.map((r) => /* @__PURE__ */ t(
515
+ children: r == null ? void 0 : r.map((i) => /* @__PURE__ */ t(
495
516
  Wt,
496
517
  {
497
- item: r,
518
+ item: i,
498
519
  onNavigated: () => {
499
520
  n(!1);
500
521
  }
501
522
  },
502
- r.item.id
523
+ i.item.id
503
524
  ))
504
525
  }
505
526
  ) }),
506
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(W, { variant: "outline", children: "Cancel" }) }) }),
507
- /* @__PURE__ */ t(V, {})
527
+ /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
528
+ /* @__PURE__ */ t(Y, {})
508
529
  ] })
509
530
  }
510
531
  );
511
532
  }
512
- ), Vt = "@prose-reader/react-reader", Yt = "1.227.0", Ut = p(
533
+ ), Vt = "@prose-reader/react-reader", Yt = "1.229.0", Ut = g(
513
534
  ({
514
535
  open: e,
515
536
  setOpen: n
516
537
  }) => /* @__PURE__ */ t(
517
- Y,
538
+ U,
518
539
  {
519
540
  lazyMount: !0,
520
541
  placement: "center",
@@ -522,63 +543,63 @@ const jt = (e, n, o) => {
522
543
  onOpenChange: (o) => n(o.open),
523
544
  size: { mdDown: "full", md: "lg" },
524
545
  scrollBehavior: "inside",
525
- children: /* @__PURE__ */ a(G, { children: [
526
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(K, { children: "Help" }) }),
527
- /* @__PURE__ */ a(Q, { overflowY: "auto", flex: 1, children: [
528
- /* @__PURE__ */ t(se, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
529
- /* @__PURE__ */ a(z, { mb: 1, children: [
546
+ children: /* @__PURE__ */ c(V, { children: [
547
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Help" }) }),
548
+ /* @__PURE__ */ c(K, { overflowY: "auto", flex: 1, children: [
549
+ /* @__PURE__ */ t(le, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
550
+ /* @__PURE__ */ c(D, { mb: 1, children: [
530
551
  /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(et, {}) }),
531
552
  " ",
532
553
  /* @__PURE__ */ t(f, { children: "Navigate to right page" })
533
554
  ] }),
534
- /* @__PURE__ */ a(z, { mb: 1, children: [
555
+ /* @__PURE__ */ c(D, { mb: 1, children: [
535
556
  /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(tt, {}) }),
536
557
  " ",
537
558
  /* @__PURE__ */ t(f, { children: "Navigate to left page" })
538
559
  ] }),
539
- /* @__PURE__ */ t(se, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
540
- /* @__PURE__ */ a(f, { children: [
560
+ /* @__PURE__ */ t(le, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
561
+ /* @__PURE__ */ c(f, { children: [
541
562
  Vt,
542
563
  " version: ",
543
564
  Yt
544
565
  ] })
545
566
  ] }),
546
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(W, { variant: "outline", children: "Cancel" }) }) }),
547
- /* @__PURE__ */ t(V, {})
567
+ /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
568
+ /* @__PURE__ */ t(Y, {})
548
569
  ] })
549
570
  }
550
571
  )
551
- ), _ = () => {
552
- const e = m();
553
- return b(
572
+ ), $ = () => {
573
+ const e = p();
574
+ return v(
554
575
  () => e ? je([e.pagination.state$, e.context.state$]).pipe(
555
576
  L(([n, o]) => {
556
- var r;
557
- const i = (r = o.manifest) == null ? void 0 : r.spineItems.every(
577
+ var i;
578
+ const r = (i = o.manifest) == null ? void 0 : i.spineItems.every(
558
579
  (s) => {
559
- var c;
560
- return (c = s.mediaType) == null ? void 0 : c.startsWith("image/");
580
+ var d;
581
+ return (d = s.mediaType) == null ? void 0 : d.startsWith("image/");
561
582
  }
562
583
  );
563
584
  return {
564
585
  ...n,
565
- hasChapters: !o.isFullyPrePaginated && !i
586
+ hasChapters: !o.isFullyPrePaginated && !r
566
587
  };
567
588
  })
568
- ) : ie,
589
+ ) : re,
569
590
  [e]
570
591
  );
571
592
  }, qt = () => {
572
- const e = _(), n = Math.floor(
593
+ const e = $(), n = Math.floor(
573
594
  ((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
574
595
  ), o = n > 0 ? n : 1;
575
- return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(w, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(f, { fontSize: "sm", children: [
596
+ return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(P, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ c(f, { fontSize: "sm", children: [
576
597
  o,
577
598
  " %"
578
599
  ] }) });
579
600
  }, Qt = () => {
580
- const [e, n] = I(/* @__PURE__ */ new Date());
581
- return oe(() => {
601
+ const [e, n] = k(/* @__PURE__ */ new Date());
602
+ return W(() => {
582
603
  const o = setInterval(() => {
583
604
  n(/* @__PURE__ */ new Date());
584
605
  }, 6e4);
@@ -591,12 +612,12 @@ const jt = (e, n, o) => {
591
612
  minute: "2-digit"
592
613
  }) });
593
614
  }, me = () => {
594
- const { quickMenuSignal: e } = Z();
595
- return [Ne(e), e.setValue, e];
596
- }, Xt = () => {
615
+ const { quickMenuSignal: e } = J();
616
+ return [_e(e), e.setValue, e];
617
+ }, Zt = () => {
597
618
  const [e] = me();
598
619
  return /* @__PURE__ */ t(
599
- w,
620
+ P,
600
621
  {
601
622
  position: "absolute",
602
623
  left: 0,
@@ -606,11 +627,11 @@ const jt = (e, n, o) => {
606
627
  children: /* @__PURE__ */ t(Kt, {})
607
628
  }
608
629
  );
609
- }, Zt = () => {
610
- const e = m();
611
- B(
630
+ }, Xt = () => {
631
+ const e = p();
632
+ E(
612
633
  () => e == null ? void 0 : e.links$.subscribe((n) => {
613
- if (n.type === "click" && gt(n.target, "a")) {
634
+ if (n.type === "click" && ht(n.target, "a")) {
614
635
  if (!n.target.href) return;
615
636
  const o = new URL(n.target.href);
616
637
  window.location.host !== o.host && confirm(
@@ -621,20 +642,20 @@ const jt = (e, n, o) => {
621
642
  [e]
622
643
  );
623
644
  }, Jt = () => {
624
- const e = m(), { notificationsSubject: n } = Z();
625
- B(
645
+ const e = p(), { notificationsSubject: n } = J();
646
+ E(
626
647
  () => e == null ? void 0 : e.zoom.isZooming$.pipe(
627
- H((o) => {
648
+ F((o) => {
628
649
  if (!o) return We;
629
- const i = new de();
650
+ const r = new he();
630
651
  return n.next({
631
652
  key: "zoom",
632
653
  title: "Zooming",
633
654
  duration: 999999,
634
- abort: i
635
- }), ie.pipe(
636
- we(() => {
637
- i.next(), i.complete();
655
+ abort: r
656
+ }), re.pipe(
657
+ ke(() => {
658
+ r.next(), r.complete();
638
659
  })
639
660
  );
640
661
  })
@@ -642,13 +663,13 @@ const jt = (e, n, o) => {
642
663
  [e]
643
664
  );
644
665
  }, en = () => {
645
- const e = m(), { notificationsSubject: n } = Z();
646
- B(
666
+ const e = p(), { notificationsSubject: n } = J();
667
+ E(
647
668
  () => e == null ? void 0 : e.settings.values$.pipe(
648
669
  L(({ fontScale: o }) => o),
649
- Ie(),
650
- Te(1),
651
- he((o) => {
670
+ Se(),
671
+ we(1),
672
+ ue((o) => {
652
673
  n.next({
653
674
  key: "fontScaleChange",
654
675
  title: "Font size changed",
@@ -659,51 +680,51 @@ const jt = (e, n, o) => {
659
680
  [e, n]
660
681
  );
661
682
  }, tn = () => {
662
- const { notificationsSubject: e } = Z();
663
- en(), Jt(), B(
683
+ const { notificationsSubject: e } = J();
684
+ en(), Jt(), E(
664
685
  () => e.pipe(
665
- J(ke),
686
+ ee(Ie),
666
687
  Ge((n) => {
667
- const o = n.duration ?? 3e3, i = le.create({
688
+ const o = n.duration ?? 3e3, r = ae.create({
668
689
  title: n.title,
669
690
  description: n.description,
670
691
  duration: o
671
- }), r = e.pipe(
672
- Te(1),
673
- J((s) => !!n.key && (s == null ? void 0 : s.key) === n.key)
692
+ }), i = e.pipe(
693
+ we(1),
694
+ ee((s) => !!n.key && (s == null ? void 0 : s.key) === n.key)
674
695
  );
675
696
  return Ve(
676
697
  Ye(o),
677
- n.abort ?? ie,
678
- r
698
+ n.abort ?? re,
699
+ i
679
700
  ).pipe(
680
- Se(),
681
- we(() => {
682
- le.dismiss(i);
701
+ Te(),
702
+ ke(() => {
703
+ ae.dismiss(r);
683
704
  })
684
705
  );
685
706
  })
686
707
  ),
687
708
  [e]
688
709
  );
689
- }, nn = D.forwardRef(
710
+ }, nn = z.forwardRef(
690
711
  function(n, o) {
691
712
  const {
692
- showArrow: i,
693
- children: r,
713
+ showArrow: r,
714
+ children: i,
694
715
  portalled: s = !0,
695
- content: c,
696
- portalRef: d,
716
+ content: d,
717
+ portalRef: l,
697
718
  ...u
698
719
  } = n;
699
- return /* @__PURE__ */ a(
720
+ return /* @__PURE__ */ c(
700
721
  M.Root,
701
722
  {
702
723
  ...u,
703
724
  positioning: { ...u.positioning, gutter: 4 },
704
725
  children: [
705
- /* @__PURE__ */ t(M.Trigger, { asChild: !0, children: r }),
706
- /* @__PURE__ */ t(ue, { disabled: !s, container: d, children: /* @__PURE__ */ t(M.Positioner, { children: /* @__PURE__ */ a(
726
+ /* @__PURE__ */ t(M.Trigger, { asChild: !0, children: i }),
727
+ /* @__PURE__ */ t(ge, { disabled: !s, container: l, children: /* @__PURE__ */ t(M.Positioner, { children: /* @__PURE__ */ c(
707
728
  M.Content,
708
729
  {
709
730
  width: "auto",
@@ -713,8 +734,8 @@ const jt = (e, n, o) => {
713
734
  rounded: "sm",
714
735
  ref: o,
715
736
  children: [
716
- i && /* @__PURE__ */ t(M.Arrow, { children: /* @__PURE__ */ t(M.ArrowTip, {}) }),
717
- c
737
+ r && /* @__PURE__ */ t(M.Arrow, { children: /* @__PURE__ */ t(M.ArrowTip, {}) }),
738
+ d
718
739
  ]
719
740
  }
720
741
  ) }) })
@@ -722,63 +743,63 @@ const jt = (e, n, o) => {
722
743
  }
723
744
  );
724
745
  }
725
- ), on = D.forwardRef(function(n, o) {
726
- const { children: i, ...r } = n;
727
- return /* @__PURE__ */ t(nn, { content: i, ...r, ref: o, children: /* @__PURE__ */ t(
728
- v,
746
+ ), on = z.forwardRef(function(n, o) {
747
+ const { children: r, ...i } = n;
748
+ return /* @__PURE__ */ t(nn, { content: r, ...i, ref: o, children: /* @__PURE__ */ t(
749
+ I,
729
750
  {
730
751
  variant: "ghost",
731
752
  "aria-label": "info",
732
753
  size: "2xs",
733
754
  colorPalette: "gray",
734
- children: /* @__PURE__ */ t(vt, {})
755
+ children: /* @__PURE__ */ t(xt, {})
735
756
  }
736
757
  ) });
737
- }), rn = D.forwardRef(function(n, o) {
738
- return /* @__PURE__ */ t(F.Track, { ...n, ref: o, children: /* @__PURE__ */ t(F.Range, {}) });
758
+ }), rn = z.forwardRef(function(n, o) {
759
+ return /* @__PURE__ */ t(H.Track, { ...n, ref: o, children: /* @__PURE__ */ t(H.Range, {}) });
739
760
  });
740
- D.forwardRef(function(n, o) {
741
- const { children: i, info: r, ...s } = n;
742
- return /* @__PURE__ */ a(F.Label, { ...s, ref: o, children: [
743
- i,
744
- r && /* @__PURE__ */ t(on, { children: r })
761
+ z.forwardRef(function(n, o) {
762
+ const { children: r, info: i, ...s } = n;
763
+ return /* @__PURE__ */ c(H.Label, { ...s, ref: o, children: [
764
+ r,
765
+ i && /* @__PURE__ */ t(on, { children: i })
745
766
  ] });
746
767
  });
747
- const sn = F.Root, ln = F.ValueText, fe = () => {
748
- const e = _(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, i = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, r = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, s = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
749
- r,
768
+ const sn = H.Root, ln = H.ValueText, fe = () => {
769
+ const e = $(), 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, s = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [d = 0, l = 0] = [
770
+ i,
750
771
  s
751
- ].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), l = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
772
+ ].sort((m, h) => m - 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), a = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
752
773
  return {
753
774
  hasOnlyOnePage: n,
754
- beginPageIndex: r,
775
+ beginPageIndex: i,
755
776
  endPageIndex: s,
756
777
  isBeginWithinChapter: o,
757
- isEndWithinChapter: i,
778
+ isEndWithinChapter: r,
758
779
  beginAndEndAreDifferent: u,
759
- totalApproximatePages: l,
760
- leftPageIndex: c,
761
- rightPageIndex: d
780
+ totalApproximatePages: a,
781
+ leftPageIndex: d,
782
+ rightPageIndex: l
762
783
  };
763
784
  }, an = () => {
764
- const e = _(), {
785
+ const e = $(), {
765
786
  hasOnlyOnePage: n,
766
787
  leftPageIndex: o,
767
- rightPageIndex: i,
768
- totalApproximatePages: r,
788
+ rightPageIndex: r,
789
+ totalApproximatePages: i,
769
790
  beginAndEndAreDifferent: s
770
- } = fe(), c = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (l) => l != null && l.subChapter ? `${l.title} / ${d(l.subChapter)}` : (l == null ? void 0 : l.title) || "", u = d(e == null ? void 0 : e.beginChapterInfo);
771
- return /* @__PURE__ */ a(P, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
772
- /* @__PURE__ */ t(sn, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(z, { justifyContent: "space-between", children: [
791
+ } = fe(), d = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), l = (a) => a != null && a.subChapter ? `${a.title} / ${l(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = l(e == null ? void 0 : e.beginChapterInfo);
792
+ return /* @__PURE__ */ c(R, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
793
+ /* @__PURE__ */ t(sn, { value: d, size: "xs", width: 150, children: /* @__PURE__ */ c(D, { justifyContent: "space-between", children: [
773
794
  /* @__PURE__ */ t(rn, { width: 110 }),
774
- /* @__PURE__ */ t(ln, { children: `${c}%` })
795
+ /* @__PURE__ */ t(ln, { children: `${d}%` })
775
796
  ] }) }),
776
797
  /* @__PURE__ */ t(f, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
777
- !n && /* @__PURE__ */ a(z, { children: [
778
- /* @__PURE__ */ t(f, { fontSize: "xs", children: s ? `${o + 1} - ${i + 1} of ${r}` : `${o + 1} of ${r}` }),
779
- !!(e != null && e.hasChapters) && /* @__PURE__ */ a(ne, { children: [
798
+ !n && /* @__PURE__ */ c(D, { children: [
799
+ /* @__PURE__ */ t(f, { fontSize: "xs", children: s ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
800
+ !!(e != null && e.hasChapters) && /* @__PURE__ */ c(oe, { children: [
780
801
  /* @__PURE__ */ t(f, { children: "-" }),
781
- /* @__PURE__ */ a(f, { fontSize: "xs", children: [
802
+ /* @__PURE__ */ c(f, { fontSize: "xs", children: [
782
803
  "(",
783
804
  ((e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0) + 1,
784
805
  ")"
@@ -786,13 +807,13 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
786
807
  ] })
787
808
  ] })
788
809
  ] });
789
- }, De = p(
810
+ }, De = g(
790
811
  ({
791
812
  children: e,
792
813
  position: n,
793
814
  ...o
794
815
  }) => /* @__PURE__ */ t(
795
- ee,
816
+ te,
796
817
  {
797
818
  display: "flex",
798
819
  flexDirection: "row",
@@ -816,8 +837,8 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
816
837
  children: e
817
838
  }
818
839
  )
819
- ), cn = Ke(Ct), dn = p((e) => /* @__PURE__ */ t(
820
- w,
840
+ ), cn = Ke(vt), dn = g((e) => /* @__PURE__ */ t(
841
+ P,
821
842
  {
822
843
  display: "contents",
823
844
  css: {
@@ -871,64 +892,64 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
871
892
  )
872
893
  }
873
894
  )), hn = () => {
874
- const e = _(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: i = 0 } = fe(), r = n ? Math.floor((o || 0) / 2) : o, [s, c] = Ce(
875
- () => ce({
876
- default: r || 0
895
+ const e = $(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = fe(), i = n ? Math.floor((o || 0) / 2) : o, [s, d] = Ce(
896
+ () => de({
897
+ default: i || 0
877
898
  })
878
- ), d = 0, u = Math.max(
899
+ ), l = 0, u = Math.max(
879
900
  0,
880
- n ? Math.floor((i - 1) / 2) : i - 1
901
+ n ? Math.floor((r - 1) / 2) : r - 1
881
902
  );
882
- return oe(() => {
883
- c.update(r || 0);
884
- }, [r, c]), {
903
+ return W(() => {
904
+ d.update(i || 0);
905
+ }, [i, d]), {
885
906
  value: s,
886
- valueSignal: c,
887
- min: d,
907
+ valueSignal: d,
908
+ min: l,
888
909
  max: u
889
910
  };
890
911
  }, un = (e) => {
891
- const n = m(), o = _(), { manifest: i } = b(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, r = (i == null ? void 0 : i.readingDirection) === "rtl", s = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: c = 0, isBeginWithinChapter: d } = fe(), u = 1, l = d, { value: g, valueSignal: h, min: C, max: y } = hn(), T = N(
912
+ const n = p(), o = $(), { manifest: r } = v(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, i = (r == null ? void 0 : r.readingDirection) === "rtl", s = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: d = 0, isBeginWithinChapter: l } = fe(), u = 1, a = l, { value: m, valueSignal: h, min: b, max: y } = hn(), C = N(
892
913
  (A) => {
893
914
  const [x = 0] = Array.isArray(A) ? A : [A];
894
915
  h.setValue(x);
895
- const $ = s ? Math.floor(x) * 2 : Math.floor(x);
896
- l ? n == null || n.navigation.goToPageOfSpineItem({
897
- pageIndex: $,
916
+ const _ = s ? Math.floor(x) * 2 : Math.floor(x);
917
+ a ? n == null || n.navigation.goToPageOfSpineItem({
918
+ pageIndex: _,
898
919
  spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
899
920
  animation: !1
900
921
  }) : n == null || n.navigation.goToAbsolutePageIndex({
901
- absolutePageIndex: $,
922
+ absolutePageIndex: _,
902
923
  animation: !1
903
924
  });
904
925
  },
905
- [n, s, h, l]
926
+ [n, s, h, a]
906
927
  );
907
- return B(
928
+ return E(
908
929
  () => n == null ? void 0 : n.navigation.throttleLock({
909
930
  duration: 100,
910
931
  trigger: h.subject
911
932
  }),
912
933
  [n, h]
913
- ), c === 1 || s && c === 2 ? /* @__PURE__ */ t(w, { style: e.style }) : /* @__PURE__ */ t(
934
+ ), d === 1 || s && d === 2 ? /* @__PURE__ */ t(P, { style: e.style }) : /* @__PURE__ */ t(
914
935
  dn,
915
936
  {
916
- value: [g],
937
+ value: [m],
917
938
  max: y,
918
- min: C,
919
- reverse: r,
939
+ min: b,
940
+ reverse: i,
920
941
  step: u,
921
- onChange: T,
942
+ onChange: C,
922
943
  ...e
923
944
  }
924
945
  );
925
- }, gn = p(
946
+ }, gn = g(
926
947
  ({
927
948
  open: e,
928
949
  onItemClick: n
929
950
  }) => {
930
- const o = m(), i = b(() => o == null ? void 0 : o.navigation.state$, [o]), r = b(() => o == null ? void 0 : o.settings.values$, [o]), s = (r == null ? void 0 : r.computedPageTurnDirection) === "vertical", [c, d] = I(!0);
931
- return /* @__PURE__ */ a(
951
+ const o = p(), r = v(() => o == null ? void 0 : o.navigation.state$, [o]), i = v(() => o == null ? void 0 : o.settings.values$, [o]), s = (i == null ? void 0 : i.computedPageTurnDirection) === "vertical", [d, l] = k(!0);
952
+ return /* @__PURE__ */ c(
932
953
  De,
933
954
  {
934
955
  present: e,
@@ -938,21 +959,21 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
938
959
  overflow: "auto",
939
960
  pb: 8,
940
961
  children: [
941
- /* @__PURE__ */ a(z, { flex: 1, alignItems: "center", justifyContent: "center", children: [
962
+ /* @__PURE__ */ c(D, { flex: 1, alignItems: "center", justifyContent: "center", children: [
942
963
  /* @__PURE__ */ t(
943
- v,
964
+ I,
944
965
  {
945
966
  "aria-label": "left",
946
967
  size: "lg",
947
968
  variant: "ghost",
948
969
  flexShrink: 0,
949
970
  onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
950
- disabled: !(i != null && i.canGoLeftSpineItem) && !(i != null && i.canGoTopSpineItem),
951
- children: s ? /* @__PURE__ */ t(mt, {}) : /* @__PURE__ */ t(ft, {})
971
+ disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
972
+ children: s ? /* @__PURE__ */ t(pt, {}) : /* @__PURE__ */ t(mt, {})
952
973
  }
953
974
  ),
954
- /* @__PURE__ */ a(
955
- P,
975
+ /* @__PURE__ */ c(
976
+ R,
956
977
  {
957
978
  flex: 1,
958
979
  maxW: 400,
@@ -976,31 +997,31 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
976
997
  }
977
998
  ),
978
999
  /* @__PURE__ */ t(
979
- v,
1000
+ I,
980
1001
  {
981
1002
  "aria-label": "right",
982
1003
  size: "lg",
983
1004
  flexShrink: 0,
984
1005
  variant: "ghost",
985
- disabled: !(i != null && i.canGoRightSpineItem) && !(i != null && i.canGoBottomSpineItem),
1006
+ disabled: !(r != null && r.canGoRightSpineItem) && !(r != null && r.canGoBottomSpineItem),
986
1007
  onClick: () => {
987
1008
  o == null || o.navigation.goToRightOrBottomSpineItem();
988
1009
  },
989
- children: s ? /* @__PURE__ */ t(bt, {}) : /* @__PURE__ */ t(xt, {})
1010
+ children: s ? /* @__PURE__ */ t(ft, {}) : /* @__PURE__ */ t(bt, {})
990
1011
  }
991
1012
  )
992
1013
  ] }),
993
- /* @__PURE__ */ t(z, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ a(
994
- re.Root,
1014
+ /* @__PURE__ */ t(D, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ c(
1015
+ se.Root,
995
1016
  {
996
- open: c,
1017
+ open: d,
997
1018
  flex: 1,
998
1019
  onOpenChange: ({ open: u }) => {
999
- d(u);
1020
+ l(u);
1000
1021
  },
1001
1022
  children: [
1002
1023
  /* @__PURE__ */ t(
1003
- re.Trigger,
1024
+ se.Trigger,
1004
1025
  {
1005
1026
  paddingY: "3",
1006
1027
  width: "100%",
@@ -1010,15 +1031,15 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1010
1031
  nt,
1011
1032
  {
1012
1033
  style: {
1013
- transform: c ? "rotate(0deg)" : "rotate(180deg)"
1034
+ transform: d ? "rotate(0deg)" : "rotate(180deg)"
1014
1035
  }
1015
1036
  }
1016
1037
  )
1017
1038
  }
1018
1039
  ),
1019
- /* @__PURE__ */ a(re.Content, { display: "flex", justifyContent: "center", children: [
1040
+ /* @__PURE__ */ c(se.Content, { display: "flex", justifyContent: "center", children: [
1020
1041
  /* @__PURE__ */ t(
1021
- v,
1042
+ I,
1022
1043
  {
1023
1044
  "aria-label": "Help",
1024
1045
  size: "lg",
@@ -1028,47 +1049,47 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1028
1049
  }
1029
1050
  ),
1030
1051
  /* @__PURE__ */ t(
1031
- v,
1052
+ I,
1032
1053
  {
1033
1054
  "aria-label": "Table of contents",
1034
1055
  size: "lg",
1035
1056
  variant: "ghost",
1036
1057
  onClick: () => n("toc"),
1037
- children: /* @__PURE__ */ t(it, {})
1058
+ children: /* @__PURE__ */ t(rt, {})
1038
1059
  }
1039
1060
  ),
1040
- Pe(o) && /* @__PURE__ */ t(
1041
- v,
1061
+ Re(o) && /* @__PURE__ */ t(
1062
+ I,
1042
1063
  {
1043
1064
  "aria-label": "Search",
1044
1065
  size: "lg",
1045
1066
  variant: "ghost",
1046
1067
  onClick: () => n("search"),
1047
- children: /* @__PURE__ */ t(rt, {})
1068
+ children: /* @__PURE__ */ t(it, {})
1048
1069
  }
1049
1070
  ),
1050
1071
  j(o) && /* @__PURE__ */ t(
1051
- v,
1072
+ I,
1052
1073
  {
1053
1074
  "aria-label": "Bookmarks",
1054
1075
  size: "lg",
1055
1076
  variant: "ghost",
1056
1077
  onClick: () => n("bookmarks"),
1057
- children: /* @__PURE__ */ t(dt, {})
1078
+ children: /* @__PURE__ */ t(ut, {})
1058
1079
  }
1059
1080
  ),
1060
1081
  j(o) && /* @__PURE__ */ t(
1061
- v,
1082
+ I,
1062
1083
  {
1063
1084
  "aria-label": "Annotations",
1064
1085
  size: "lg",
1065
1086
  variant: "ghost",
1066
1087
  onClick: () => n("annotations"),
1067
- children: /* @__PURE__ */ t(te, {})
1088
+ children: /* @__PURE__ */ t(ne, {})
1068
1089
  }
1069
1090
  ),
1070
1091
  /* @__PURE__ */ t(
1071
- v,
1092
+ I,
1072
1093
  {
1073
1094
  "aria-label": "Thumbnails",
1074
1095
  size: "lg",
@@ -1082,13 +1103,13 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1082
1103
  }
1083
1104
  ),
1084
1105
  Ae(o) && /* @__PURE__ */ t(
1085
- v,
1106
+ I,
1086
1107
  {
1087
1108
  "aria-label": "Gallery",
1088
1109
  size: "lg",
1089
1110
  variant: "ghost",
1090
1111
  onClick: () => n("gallery"),
1091
- children: /* @__PURE__ */ t(pt, {})
1112
+ children: /* @__PURE__ */ t(gt, {})
1092
1113
  }
1093
1114
  )
1094
1115
  ] })
@@ -1100,29 +1121,29 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1100
1121
  );
1101
1122
  }
1102
1123
  ), pn = () => {
1103
- const [e, n] = I(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1124
+ const [e, n] = k(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1104
1125
  n(!1);
1105
1126
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1106
1127
  n(!0);
1107
1128
  }), []);
1108
- return oe(() => {
1109
- function i() {
1129
+ return W(() => {
1130
+ function r() {
1110
1131
  n(!!document.fullscreenElement);
1111
1132
  }
1112
- return document.addEventListener("fullscreenchange", i), () => {
1113
- document.removeEventListener("fullscreenchange", i);
1133
+ return document.addEventListener("fullscreenchange", r), () => {
1134
+ document.removeEventListener("fullscreenchange", r);
1114
1135
  };
1115
1136
  }, []), {
1116
1137
  isFullscreen: e,
1117
1138
  onToggleFullscreenClick: o
1118
1139
  };
1119
- }, mn = p(
1140
+ }, mn = g(
1120
1141
  ({
1121
1142
  open: e,
1122
1143
  onItemClick: n
1123
1144
  }) => {
1124
- const o = m(), i = b(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: r, onToggleFullscreenClick: s } = pn();
1125
- return /* @__PURE__ */ a(
1145
+ const o = p(), r = v(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: s } = pn();
1146
+ return /* @__PURE__ */ c(
1126
1147
  De,
1127
1148
  {
1128
1149
  present: e,
@@ -1131,18 +1152,18 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1131
1152
  justifyContent: "space-between",
1132
1153
  children: [
1133
1154
  /* @__PURE__ */ t(
1134
- v,
1155
+ I,
1135
1156
  {
1136
1157
  "aria-label": "left",
1137
1158
  size: "lg",
1138
1159
  variant: "ghost",
1139
1160
  flexShrink: 0,
1140
1161
  onClick: () => n("back"),
1141
- children: /* @__PURE__ */ t(kt, {})
1162
+ children: /* @__PURE__ */ t(Ct, {})
1142
1163
  }
1143
1164
  ),
1144
1165
  /* @__PURE__ */ t(
1145
- P,
1166
+ R,
1146
1167
  {
1147
1168
  flex: 1,
1148
1169
  maxW: 600,
@@ -1150,30 +1171,30 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1150
1171
  alignItems: "center",
1151
1172
  overflow: "auto",
1152
1173
  px: 4,
1153
- children: /* @__PURE__ */ t(f, { truncate: !0, maxWidth: "100%", children: i == null ? void 0 : i.title })
1174
+ children: /* @__PURE__ */ t(f, { truncate: !0, maxWidth: "100%", children: r == null ? void 0 : r.title })
1154
1175
  }
1155
1176
  ),
1156
- /* @__PURE__ */ a(z, { children: [
1177
+ /* @__PURE__ */ c(D, { children: [
1157
1178
  /* @__PURE__ */ t(
1158
- v,
1179
+ I,
1159
1180
  {
1160
1181
  "aria-label": "right",
1161
1182
  size: "lg",
1162
1183
  flexShrink: 0,
1163
1184
  variant: "ghost",
1164
1185
  onClick: () => n("more"),
1165
- children: /* @__PURE__ */ t(yt, {})
1186
+ children: /* @__PURE__ */ t(It, {})
1166
1187
  }
1167
1188
  ),
1168
1189
  /* @__PURE__ */ t(
1169
- v,
1190
+ I,
1170
1191
  {
1171
1192
  "aria-label": "right",
1172
1193
  size: "lg",
1173
1194
  flexShrink: 0,
1174
1195
  variant: "ghost",
1175
1196
  onClick: s,
1176
- children: r ? /* @__PURE__ */ t(It, {}) : /* @__PURE__ */ t(St, {})
1197
+ children: i ? /* @__PURE__ */ t(yt, {}) : /* @__PURE__ */ t(St, {})
1177
1198
  }
1178
1199
  )
1179
1200
  ] })
@@ -1181,26 +1202,26 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1181
1202
  }
1182
1203
  );
1183
1204
  }
1184
- ), fn = p(
1205
+ ), fn = g(
1185
1206
  ({
1186
1207
  onItemClick: e
1187
1208
  }) => {
1188
1209
  const [n] = me();
1189
- return /* @__PURE__ */ a(ne, { children: [
1210
+ return /* @__PURE__ */ c(oe, { children: [
1190
1211
  /* @__PURE__ */ t(mn, { open: n, onItemClick: e }),
1191
1212
  /* @__PURE__ */ t(gn, { open: n, onItemClick: e })
1192
1213
  ] });
1193
1214
  }
1194
- ), bn = p(
1215
+ ), bn = g(
1195
1216
  ({
1196
1217
  contextText: e = "",
1197
1218
  startOffset: n = 0,
1198
1219
  text: o,
1199
- cfi: i = "#",
1200
- onClick: r,
1220
+ cfi: r = "#",
1221
+ onClick: i,
1201
1222
  absolutePageIndex: s
1202
1223
  }) => {
1203
- const d = e.substring(
1224
+ const l = e.substring(
1204
1225
  Math.max(n - 15, 0),
1205
1226
  Math.max(n, 0)
1206
1227
  ), u = e.substring(
@@ -1210,22 +1231,22 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1210
1231
  e.length - 1
1211
1232
  )
1212
1233
  );
1213
- return /* @__PURE__ */ a(
1214
- ge,
1234
+ return /* @__PURE__ */ c(
1235
+ pe,
1215
1236
  {
1216
- href: i,
1237
+ href: r,
1217
1238
  style: { margin: 5, overflow: "hidden" },
1218
- onClick: (l) => {
1219
- l.preventDefault(), r(i);
1239
+ onClick: (a) => {
1240
+ a.preventDefault(), i(r);
1220
1241
  },
1221
1242
  display: "flex",
1222
1243
  flexDirection: "column",
1223
1244
  alignItems: "flex-start",
1224
1245
  gap: 0,
1225
1246
  children: [
1226
- /* @__PURE__ */ a(f, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1247
+ /* @__PURE__ */ c(f, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1227
1248
  '"',
1228
- d,
1249
+ l,
1229
1250
  /* @__PURE__ */ t("b", { children: o }),
1230
1251
  u,
1231
1252
  '"'
@@ -1235,30 +1256,30 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1235
1256
  }
1236
1257
  );
1237
1258
  }
1238
- ), xn = p(
1259
+ ), xn = g(
1239
1260
  ({
1240
1261
  onNavigate: e
1241
1262
  }) => {
1242
- const [n, o] = I(""), i = m(), r = Pe(i) ? i : void 0, s = (h) => {
1263
+ const [n, o] = k(""), r = p(), i = Re(r) ? r : void 0, s = (h) => {
1243
1264
  o(h.target.value);
1244
- }, c = N(
1265
+ }, d = N(
1245
1266
  (h) => {
1246
- e(), i == null || i.navigation.goToCfi(h);
1267
+ e(), r == null || r.navigation.goToCfi(h);
1247
1268
  },
1248
- [i, e]
1249
- ), d = b(
1250
- () => r == null ? void 0 : r.search.search(n).pipe(
1269
+ [r, e]
1270
+ ), l = v(
1271
+ () => i == null ? void 0 : i.search.search(n).pipe(
1251
1272
  L((h) => ({ type: "end", data: h })),
1252
1273
  ye({ type: "start" })
1253
1274
  ),
1254
- [i, n]
1255
- ), u = (d == null ? void 0 : d.type) === "start", l = (d == null ? void 0 : d.type) === "end" ? d.data : [], g = b(
1256
- () => i == null ? void 0 : i.locateResource(l.slice(0, 100)),
1257
- [l]
1275
+ [r, n]
1276
+ ), u = (l == null ? void 0 : l.type) === "start", a = (l == null ? void 0 : l.type) === "end" ? l.data : [], m = v(
1277
+ () => r == null ? void 0 : r.locateResource(a.slice(0, 100)),
1278
+ [a]
1258
1279
  );
1259
- return /* @__PURE__ */ a(P, { flex: 1, height: "100%", children: [
1260
- /* @__PURE__ */ t(w, { px: 4, children: /* @__PURE__ */ t(
1261
- Xe,
1280
+ return /* @__PURE__ */ c(R, { flex: 1, height: "100%", children: [
1281
+ /* @__PURE__ */ t(P, { px: 4, children: /* @__PURE__ */ t(
1282
+ Ze,
1262
1283
  {
1263
1284
  placeholder: "Type something...",
1264
1285
  value: n,
@@ -1266,8 +1287,8 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1266
1287
  borderRadius: 0
1267
1288
  }
1268
1289
  ) }),
1269
- /* @__PURE__ */ a(
1270
- w,
1290
+ /* @__PURE__ */ c(
1291
+ P,
1271
1292
  {
1272
1293
  px: 4,
1273
1294
  pb: 4,
@@ -1276,26 +1297,26 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1276
1297
  style: { overflow: "hidden", overflowY: "auto" },
1277
1298
  children: [
1278
1299
  u && /* @__PURE__ */ t(f, { children: "Searching ..." }),
1279
- !u && l.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
1280
- !u && l.length >= 0 && /* @__PURE__ */ a(P, { children: [
1281
- /* @__PURE__ */ a(se, { as: "h2", size: "md", children: [
1282
- l.length,
1300
+ !u && a.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
1301
+ !u && a.length >= 0 && /* @__PURE__ */ c(R, { children: [
1302
+ /* @__PURE__ */ c(le, { as: "h2", size: "md", children: [
1303
+ a.length,
1283
1304
  " result(s)"
1284
1305
  ] }),
1285
- /* @__PURE__ */ t(P, { gap: 0, children: g == null ? void 0 : g.map((h, C) => {
1286
- var y, T, R, A, x, $, be;
1306
+ /* @__PURE__ */ t(R, { gap: 0, children: m == null ? void 0 : m.map((h, b) => {
1307
+ var y, C, T, A, x, _, be;
1287
1308
  return /* @__PURE__ */ t(
1288
1309
  bn,
1289
1310
  {
1290
- contextText: ((R = (T = (y = h.meta) == null ? void 0 : y.range) == null ? void 0 : T.startContainer.parentElement) == null ? void 0 : R.textContent) ?? "",
1311
+ contextText: ((T = (C = (y = h.meta) == null ? void 0 : y.range) == null ? void 0 : C.startContainer.parentElement) == null ? void 0 : T.textContent) ?? "",
1291
1312
  pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
1292
- startOffset: (($ = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : $.startOffset) ?? 0,
1313
+ startOffset: ((_ = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : _.startOffset) ?? 0,
1293
1314
  text: n,
1294
1315
  cfi: h.meta.cfi,
1295
- onClick: c,
1316
+ onClick: d,
1296
1317
  absolutePageIndex: (be = h.meta) == null ? void 0 : be.absolutePageIndex
1297
1318
  },
1298
- C
1319
+ b
1299
1320
  );
1300
1321
  }) })
1301
1322
  ] })
@@ -1304,60 +1325,60 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1304
1325
  )
1305
1326
  ] });
1306
1327
  }
1307
- ), vn = p(
1328
+ ), vn = g(
1308
1329
  ({
1309
1330
  open: e,
1310
1331
  setOpen: n,
1311
1332
  onNavigate: o
1312
1333
  }) => /* @__PURE__ */ t(
1313
- Y,
1334
+ U,
1314
1335
  {
1315
1336
  lazyMount: !0,
1316
1337
  placement: "center",
1317
1338
  open: e,
1318
- onOpenChange: (i) => n(i.open),
1339
+ onOpenChange: (r) => n(r.open),
1319
1340
  size: { mdDown: "full", md: "lg" },
1320
1341
  scrollBehavior: "inside",
1321
- children: /* @__PURE__ */ a(G, { height: "100%", children: [
1322
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(K, { children: "Search" }) }),
1323
- /* @__PURE__ */ t(Q, { flex: 1, children: /* @__PURE__ */ t(xn, { onNavigate: o }) }),
1324
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(W, { variant: "outline", children: "Cancel" }) }) }),
1325
- /* @__PURE__ */ t(V, {})
1342
+ children: /* @__PURE__ */ c(V, { height: "100%", children: [
1343
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Search" }) }),
1344
+ /* @__PURE__ */ t(K, { flex: 1, children: /* @__PURE__ */ t(xn, { onNavigate: o }) }),
1345
+ /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
1346
+ /* @__PURE__ */ t(Y, {})
1326
1347
  ] })
1327
1348
  }
1328
1349
  )
1329
- ), Cn = p(
1350
+ ), Cn = g(
1330
1351
  ({
1331
1352
  onNavigate: e
1332
1353
  }) => {
1333
- const n = m(), { manifest: o, assumedRenditionLayout: i } = b(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: r } = o ?? {}, s = _();
1334
- r != null && r.toc;
1335
- const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = s ?? {}, u = (i === "reflowable" ? d : c) || 0;
1336
- let l = s == null ? void 0 : s.beginChapterInfo;
1337
- for (; l != null && l.subChapter; )
1338
- l = l == null ? void 0 : l.subChapter;
1339
- const g = (h, C, y) => /* @__PURE__ */ a(Be.Fragment, { children: [
1354
+ const n = p(), { manifest: o, assumedRenditionLayout: r } = v(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: i } = o ?? {}, s = $();
1355
+ i != null && i.toc;
1356
+ const { beginSpineItemIndex: d, beginPageIndexInSpineItem: l } = s ?? {}, u = (r === "reflowable" ? l : d) || 0;
1357
+ let a = s == null ? void 0 : s.beginChapterInfo;
1358
+ for (; a != null && a.subChapter; )
1359
+ a = a == null ? void 0 : a.subChapter;
1360
+ const m = (h, b, y) => /* @__PURE__ */ c(ze.Fragment, { children: [
1340
1361
  /* @__PURE__ */ t(
1341
- S.Item,
1362
+ w.Item,
1342
1363
  {
1343
1364
  pl: 4 * (y + 1),
1344
1365
  style: {
1345
1366
  display: "flex",
1346
1367
  alignItems: "center"
1347
1368
  },
1348
- children: /* @__PURE__ */ a(
1349
- ge,
1369
+ children: /* @__PURE__ */ c(
1370
+ pe,
1350
1371
  {
1351
1372
  onClick: () => {
1352
1373
  e(), n == null || n.navigation.goToUrl(h.href);
1353
1374
  },
1354
1375
  href: "#",
1355
1376
  children: [
1356
- (l == null ? void 0 : l.path) === h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ve, {}) }),
1357
- (l == null ? void 0 : l.path) !== h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ve, {}) }),
1358
- /* @__PURE__ */ a(P, { gap: 0, children: [
1377
+ (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(w.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ve, {}) }),
1378
+ (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ve, {}) }),
1379
+ /* @__PURE__ */ c(R, { gap: 0, children: [
1359
1380
  /* @__PURE__ */ t(f, { fontSize: "md", children: h.title || h.path }),
1360
- (l == null ? void 0 : l.path) === h.path && /* @__PURE__ */ t(
1381
+ (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(
1361
1382
  f,
1362
1383
  {
1363
1384
  fontStyle: "italic",
@@ -1372,50 +1393,50 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1372
1393
  )
1373
1394
  }
1374
1395
  ),
1375
- h.contents.length > 0 && /* @__PURE__ */ t(S.Root, { as: "div", gap: 2, children: h.contents.map(
1376
- (T, R) => g(T, R, y + 1)
1396
+ h.contents.length > 0 && /* @__PURE__ */ t(w.Root, { as: "div", gap: 2, children: h.contents.map(
1397
+ (C, T) => m(C, T, y + 1)
1377
1398
  ) })
1378
- ] }, C);
1379
- return /* @__PURE__ */ t(S.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: r == null ? void 0 : r.toc.map((h, C) => g(h, C, 0)) });
1399
+ ] }, b);
1400
+ return /* @__PURE__ */ t(w.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i == null ? void 0 : i.toc.map((h, b) => m(h, b, 0)) });
1380
1401
  }
1381
- ), kn = p(
1402
+ ), In = g(
1382
1403
  ({
1383
1404
  open: e,
1384
1405
  setOpen: n,
1385
1406
  onNavigate: o
1386
1407
  }) => /* @__PURE__ */ t(
1387
- Y,
1408
+ U,
1388
1409
  {
1389
1410
  lazyMount: !0,
1390
1411
  placement: "center",
1391
1412
  open: e,
1392
- onOpenChange: (i) => n(i.open),
1413
+ onOpenChange: (r) => n(r.open),
1393
1414
  size: { mdDown: "full", md: "lg" },
1394
1415
  scrollBehavior: "inside",
1395
- children: /* @__PURE__ */ a(G, { children: [
1396
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(K, { children: "Table of Contents" }) }),
1397
- /* @__PURE__ */ t(Q, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(Cn, { onNavigate: o }) }),
1398
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(W, { variant: "outline", children: "Cancel" }) }) }),
1399
- /* @__PURE__ */ t(V, {})
1416
+ children: /* @__PURE__ */ c(V, { children: [
1417
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Table of Contents" }) }),
1418
+ /* @__PURE__ */ t(K, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(Cn, { onNavigate: o }) }),
1419
+ /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
1420
+ /* @__PURE__ */ t(Y, {})
1400
1421
  ] })
1401
1422
  }
1402
1423
  )
1403
- ), Nn = ({
1424
+ ), Fn = ({
1404
1425
  enableFloatingTime: e = !0,
1405
1426
  enableFloatingProgress: n = !0,
1406
1427
  onItemClick: o
1407
1428
  }) => {
1408
- const [i, r] = I(!1), [s, c] = I(!1), [d, u] = I(!1), [l, g] = I(void 0), [h, C] = I(!1), [y, T] = me(), R = N(() => {
1409
- r(!1), c(!1), u(!1), g(void 0), T(!1), C(!1);
1410
- }, [T]), A = N(
1429
+ const [r, i] = k(!1), [s, d] = k(!1), [l, u] = k(!1), [a, m] = k(void 0), [h, b] = k(!1), [y, C] = me(), T = N(() => {
1430
+ i(!1), d(!1), u(!1), m(void 0), C(!1), b(!1);
1431
+ }, [C]), A = N(
1411
1432
  (x) => {
1412
- x === "annotations" ? g("annotations") : x === "search" ? u(!0) : x === "help" ? c(!0) : x === "toc" ? r(!0) : x === "bookmarks" ? g("bookmarks") : x === "gallery" && C(!0), o == null || o(x);
1433
+ x === "annotations" ? m("annotations") : x === "search" ? u(!0) : x === "help" ? d(!0) : x === "toc" ? i(!0) : x === "bookmarks" ? m("bookmarks") : x === "gallery" && b(!0), o == null || o(x);
1413
1434
  },
1414
1435
  [o]
1415
1436
  );
1416
- return Zt(), tn(), /* @__PURE__ */ a(ne, { children: [
1437
+ return Xt(), tn(), _t(), /* @__PURE__ */ c(oe, { children: [
1417
1438
  n && /* @__PURE__ */ t(
1418
- ee,
1439
+ te,
1419
1440
  {
1420
1441
  present: !y,
1421
1442
  animationName: { _open: "fade-in", _closed: "fade-out" },
@@ -1423,50 +1444,50 @@ const sn = F.Root, ln = F.ValueText, fe = () => {
1423
1444
  children: /* @__PURE__ */ t(qt, {})
1424
1445
  }
1425
1446
  ),
1426
- /* @__PURE__ */ t(Gt, { open: h, setOpen: C }),
1447
+ /* @__PURE__ */ t(Gt, { open: h, setOpen: b }),
1427
1448
  /* @__PURE__ */ t(fn, { onItemClick: A }),
1428
- /* @__PURE__ */ t($t, {}),
1429
- /* @__PURE__ */ t(Ut, { open: s, setOpen: c }),
1449
+ /* @__PURE__ */ t(Lt, {}),
1450
+ /* @__PURE__ */ t(Ut, { open: s, setOpen: d }),
1430
1451
  /* @__PURE__ */ t(
1431
- kn,
1452
+ In,
1432
1453
  {
1433
- open: i,
1434
- setOpen: r,
1435
- onNavigate: R
1454
+ open: r,
1455
+ setOpen: i,
1456
+ onNavigate: T
1436
1457
  }
1437
1458
  ),
1438
1459
  /* @__PURE__ */ t(
1439
1460
  vn,
1440
1461
  {
1441
- open: d,
1462
+ open: l,
1442
1463
  setOpen: u,
1443
- onNavigate: R
1464
+ onNavigate: T
1444
1465
  }
1445
1466
  ),
1446
1467
  /* @__PURE__ */ t(
1447
- zt,
1468
+ Ot,
1448
1469
  {
1449
- openWith: l,
1450
- setOpen: (x) => g(x ? "annotations" : void 0),
1451
- onNavigate: R
1470
+ openWith: a,
1471
+ setOpen: (x) => m(x ? "annotations" : void 0),
1472
+ onNavigate: T
1452
1473
  }
1453
1474
  ),
1454
1475
  /* @__PURE__ */ t(
1455
- ee,
1476
+ te,
1456
1477
  {
1457
1478
  present: e || y,
1458
1479
  animationName: { _open: "fade-in", _closed: "fade-out" },
1459
1480
  animationDuration: "slow",
1460
1481
  overflow: "hidden",
1461
- children: /* @__PURE__ */ t(Xt, {})
1482
+ children: /* @__PURE__ */ t(Zt, {})
1462
1483
  }
1463
1484
  ),
1464
1485
  /* @__PURE__ */ t(Nt, {})
1465
1486
  ] });
1466
1487
  };
1467
1488
  export {
1468
- Mt as BOOKMARK_AREA_DATA_ATTRIBUTE,
1469
- Nn as ReactReader,
1470
- $n as ReactReaderProvider
1489
+ Bt as BOOKMARK_AREA_DATA_ATTRIBUTE,
1490
+ Fn as ReactReader,
1491
+ Nn as ReactReaderProvider
1471
1492
  };
1472
1493
  //# sourceMappingURL=index.js.map