@prose-reader/react-reader 1.261.0 → 1.264.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,25 +1,25 @@
1
- import { jsx as e, jsxs as s, Fragment as ce } from "react/jsx-runtime";
2
- import { IconButton as R, Portal as Ce, Dialog as T, List as A, Link as ve, Stack as z, Text as b, Tabs as P, Button as H, Presence as ae, Box as F, createToaster as Xe, Toaster as Ke, Toast as J, Spinner as Je, RadioGroup as oe, Slider as w, HStack as B, For as en, Fieldset as V, Heading as me, Kbd as Te, Popover as ee, Progress as le, chakra as nn, Collapsible as be, Field as te, Input as tn } from "@chakra-ui/react";
1
+ import { jsx as e, jsxs as s, Fragment as de } from "react/jsx-runtime";
2
+ import { IconButton as v, Portal as ve, Dialog as O, List as B, Link as xe, Stack as R, Text as S, Tabs as y, Button as W, Presence as ae, Box as _, createToaster as en, Toaster as nn, Toast as J, Spinner as tn, RadioGroup as re, Slider as M, HStack as F, For as on, Fieldset as V, Heading as me, Kbd as Te, Popover as ee, Progress as le, chakra as rn, Collapsible as be, Field as oe, Input as an } from "@chakra-ui/react";
3
3
  import * as E from "react";
4
- import on, { createContext as rn, useContext as Fe, memo as f, useState as y, useEffect as $, useCallback as O, useMemo as an, useLayoutEffect as ln, useRef as sn } from "react";
5
- import { LuX as cn, LuNotebookPen as he, LuBookmark as dn, LuCheck as un, LuArrowBigRight as hn, LuArrowBigLeft as pn, LuChevronDown as gn, LuCircleHelp as fn, LuTableOfContents as mn, LuSearch as bn, LuZoomOut as Sn, LuZoomIn as Cn, LuGalleryHorizontal as vn, LuCircleCheck as Me } from "react-icons/lu";
6
- import { signal as N, useObserve as S, isDefined as De, useConstant as re, useSignalValue as ue, useMemoCompare as xn, useLiveRef as kn, useSubscribe as de, useSignalState as In } from "reactjrx";
7
- import { Subject as Rn, map as D, filter as pe, switchMap as W, EMPTY as we, of as ge, withLatestFrom as zn, NEVER as xe, startWith as On, distinctUntilChanged as _e, throttleTime as Le, tap as Tn, first as $e, combineLatest as Mn, mergeMap as wn, Observable as yn, skip as Pn, merge as Ve, timer as Ne, finalize as En, BehaviorSubject as An, animationFrameScheduler as Bn } from "rxjs";
8
- import { createPortal as Fn } from "react-dom";
4
+ import ln, { createContext as sn, useContext as Fe, memo as f, useState as T, useEffect as L, useCallback as z, useMemo as cn, useLayoutEffect as dn, useRef as un } from "react";
5
+ import { LuX as hn, LuNotebookPen as he, LuBookmark as gn, LuCheck as pn, LuArrowBigRight as fn, LuArrowBigLeft as mn, LuChevronDown as bn, LuCircleHelp as Sn, LuTableOfContents as Cn, LuSearch as vn, LuZoomOut as xn, LuZoomIn as kn, LuGalleryHorizontal as In, LuCircleCheck as we } from "react-icons/lu";
6
+ import { signal as ne, useObserve as C, isDefined as _e, useSubscribe as H, useConstant as ue, useSignalValue as Se, useMemoCompare as Rn, useLiveRef as zn, useSignalState as On } from "reactjrx";
7
+ import { Subject as Mn, map as P, filter as se, switchMap as N, EMPTY as ye, of as ge, withLatestFrom as ke, NEVER as Ie, startWith as Tn, distinctUntilChanged as De, throttleTime as Le, tap as $e, first as Ve, combineLatest as wn, mergeMap as yn, Observable as Pn, skip as En, merge as Ne, timer as We, finalize as An, BehaviorSubject as Bn, animationFrameScheduler as Fn } from "rxjs";
8
+ import { createPortal as _n } from "react-dom";
9
9
  import { isPositionInArea as Dn } from "@prose-reader/enhancer-gestures";
10
- import { isShallowEqual as _n } from "@prose-reader/shared";
11
- import { isShallowEqual as Ln, observeIntersection as $n, isHtmlTagElement as Vn } from "@prose-reader/core";
12
- import { BiFontSize as Nn } from "react-icons/bi";
13
- import { BsBookmarks as Wn } from "react-icons/bs";
14
- import { MdOutlineFitScreen as Hn, MdFullscreenExit as Gn, MdFullscreen as qn } from "react-icons/md";
15
- import { RiGalleryView2 as jn } from "react-icons/ri";
16
- import { RxDoubleArrowUp as Un, RxDoubleArrowLeft as Qn, RxDoubleArrowDown as Yn, RxDoubleArrowRight as Zn } from "react-icons/rx";
17
- import { HiOutlineInformationCircle as Xn } from "react-icons/hi";
18
- import Kn from "rc-slider";
10
+ import { isShallowEqual as Ln } from "@prose-reader/shared";
11
+ import { isShallowEqual as $n, observeIntersection as Vn, isHtmlTagElement as Nn } from "@prose-reader/core";
12
+ import { BiFontSize as Wn } from "react-icons/bi";
13
+ import { BsBookmarks as Hn } from "react-icons/bs";
14
+ import { MdOutlineFitScreen as Gn, MdFullscreenExit as qn, MdFullscreen as jn } from "react-icons/md";
15
+ import { RiGalleryView2 as Un } from "react-icons/ri";
16
+ import { RxDoubleArrowUp as Qn, RxDoubleArrowLeft as Yn, RxDoubleArrowDown as Zn, RxDoubleArrowRight as Xn } from "react-icons/rx";
17
+ import { HiOutlineInformationCircle as Kn } from "react-icons/hi";
18
+ import Jn from "rc-slider";
19
19
  import "rc-slider/assets/index.css";
20
- import { IoIosArrowBack as Jn, IoMdMore as et } from "react-icons/io";
21
- const nt = "data-bookmark-area", tt = E.forwardRef(function(t, o) {
22
- return /* @__PURE__ */ e(R, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(cn, {}) });
20
+ import { IoIosArrowBack as et, IoMdMore as nt } from "react-icons/io";
21
+ const tt = "data-bookmark-area", He = 5, ot = E.forwardRef(function(t, o) {
22
+ return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(hn, {}) });
23
23
  }), G = E.forwardRef(function(t, o) {
24
24
  const {
25
25
  children: r,
@@ -28,36 +28,35 @@ const nt = "data-bookmark-area", tt = E.forwardRef(function(t, o) {
28
28
  backdrop: l = !0,
29
29
  ...c
30
30
  } = t;
31
- return /* @__PURE__ */ s(Ce, { disabled: !i, container: a, children: [
32
- l && /* @__PURE__ */ e(T.Backdrop, {}),
33
- /* @__PURE__ */ e(T.Positioner, { children: /* @__PURE__ */ e(T.Content, { ref: o, ...c, asChild: !1, children: r }) })
31
+ return /* @__PURE__ */ s(ve, { disabled: !i, container: a, children: [
32
+ l && /* @__PURE__ */ e(O.Backdrop, {}),
33
+ /* @__PURE__ */ e(O.Positioner, { children: /* @__PURE__ */ e(O.Content, { ref: o, ...c, asChild: !1, children: r }) })
34
34
  ] });
35
35
  }), q = E.forwardRef(function(t, o) {
36
36
  return /* @__PURE__ */ e(
37
- T.CloseTrigger,
37
+ O.CloseTrigger,
38
38
  {
39
39
  position: "absolute",
40
40
  top: "2",
41
41
  insetEnd: "2",
42
42
  ...t,
43
43
  asChild: !0,
44
- children: /* @__PURE__ */ e(tt, { size: "sm", ref: o, children: t.children })
44
+ children: /* @__PURE__ */ e(ot, { size: "sm", ref: o, children: t.children })
45
45
  }
46
46
  );
47
- }), j = T.Root, U = T.Footer, Q = T.Header, Y = T.Body;
48
- T.Backdrop;
49
- const Z = T.Title;
50
- T.Description;
51
- T.Trigger;
52
- const X = T.ActionTrigger, We = () => ({
47
+ }), j = O.Root, U = O.Footer, Q = O.Header, Y = O.Body;
48
+ O.Backdrop;
49
+ const Z = O.Title;
50
+ O.Description;
51
+ O.Trigger;
52
+ const X = O.ActionTrigger, Ge = () => ({
53
+ _quickMenuOpen: !1,
54
+ _onQuickMenuOpenChange: (n) => n,
53
55
  reader: void 0,
54
- quickMenuOpen: !1,
55
- onQuickMenuOpenChange: () => {
56
- },
57
- quickMenuBottomBarBoundingBoxSignal: N({
56
+ quickMenuBottomBarBoundingBoxSignal: ne({
58
57
  default: void 0
59
58
  }),
60
- notificationsSubject: new Rn(),
59
+ notificationsSubject: new Mn(),
61
60
  refitMenuOpen: !1,
62
61
  onRefitMenuOpenChange: () => {
63
62
  },
@@ -67,46 +66,46 @@ const X = T.ActionTrigger, We = () => ({
67
66
  fontSizeMin: 0.2,
68
67
  fontSizeMax: 5,
69
68
  uncontrolledFontSize: 1
70
- }), ke = rn(
71
- N({ default: We() })
72
- ), _ = (n) => {
73
- const t = Fe(ke);
74
- return S(t, n);
75
- }, He = () => Fe(ke), C = () => {
76
- const { reader: n } = _(["reader"]);
69
+ }), Re = sn(
70
+ ne({ default: Ge() })
71
+ ), A = (n) => {
72
+ const t = Fe(Re);
73
+ return C(t, n);
74
+ }, qe = () => Fe(Re), b = () => {
75
+ const { reader: n } = A(["reader"]);
77
76
  return n;
78
- }, Ge = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, se = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, qe = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, je = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, ot = (n) => {
79
- const t = C(), o = se(t) ? t : void 0;
80
- return { data: S(
77
+ }, je = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, ce = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Ue = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, Qe = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, rt = (n) => {
78
+ const t = b(), o = ce(t) ? t : void 0;
79
+ return { data: C(
81
80
  () => o?.annotations.annotations$.pipe(
82
- D((i) => i.find((a) => a.id === n)),
83
- pe(De),
84
- W((i) => o.locateResource(i))
81
+ P((i) => i.find((a) => a.id === n)),
82
+ se(_e),
83
+ N((i) => o.locateResource(i))
85
84
  ),
86
85
  [o]
87
86
  ) };
88
- }, Ue = ({
87
+ }, Ye = ({
89
88
  id: n,
90
89
  onNavigate: t,
91
90
  allowLeftIcon: o = !0
92
91
  }) => {
93
- const r = C(), { data: i } = ot(n), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
94
- return /* @__PURE__ */ e(A.Item, { children: /* @__PURE__ */ s(
95
- ve,
92
+ const r = b(), { data: i } = rt(n), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
93
+ return /* @__PURE__ */ e(B.Item, { children: /* @__PURE__ */ s(
94
+ xe,
96
95
  {
97
96
  href: "#",
98
97
  onClick: () => {
99
98
  t(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
100
99
  },
101
100
  children: [
102
- i?.resource?.notes ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(he, {}) }) : o ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(he, {}) }) : null,
103
- /* @__PURE__ */ s(z, { gap: 0, children: [
104
- a ? /* @__PURE__ */ e(b, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(b, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
101
+ i?.resource?.notes ? /* @__PURE__ */ e(B.Indicator, { asChild: !0, children: /* @__PURE__ */ e(he, {}) }) : o ? /* @__PURE__ */ e(B.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(he, {}) }) : null,
102
+ /* @__PURE__ */ s(R, { gap: 0, children: [
103
+ a ? /* @__PURE__ */ e(S, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(S, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
105
104
  "Page ",
106
105
  (i?.meta.absolutePageIndex ?? 0) + 1
107
106
  ] }),
108
107
  /* @__PURE__ */ e(
109
- b,
108
+ S,
110
109
  {
111
110
  fontStyle: "italic",
112
111
  fontWeight: "bold",
@@ -118,42 +117,42 @@ const X = T.ActionTrigger, We = () => ({
118
117
  ]
119
118
  }
120
119
  ) });
121
- }, fe = () => {
122
- const n = C(), t = se(n) ? n : void 0;
123
- return { data: S(
120
+ }, pe = () => {
121
+ const n = b(), t = ce(n) ? n : void 0;
122
+ return { data: C(
124
123
  () => t?.annotations.annotations$.pipe(
125
- W(
124
+ N(
126
125
  (r) => t.locateResource(r)
127
126
  )
128
127
  ),
129
128
  [t]
130
129
  ) };
131
- }, rt = () => {
132
- const { data: n } = fe();
130
+ }, it = () => {
131
+ const { data: n } = pe();
133
132
  return {
134
133
  data: n?.filter((t) => t.meta.isCfiRange)
135
134
  };
136
- }, it = ({ onNavigate: n }) => {
137
- const { data: t } = rt();
138
- return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
139
- Ue,
135
+ }, at = ({ onNavigate: n }) => {
136
+ const { data: t } = it();
137
+ return /* @__PURE__ */ e(B.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
138
+ Ye,
140
139
  {
141
140
  id: o.resource.id,
142
141
  onNavigate: n
143
142
  },
144
143
  o.resource.id
145
144
  )) });
146
- }, at = () => {
147
- const { data: n } = fe();
145
+ }, lt = () => {
146
+ const { data: n } = pe();
148
147
  return {
149
148
  data: n?.filter(
150
149
  (t) => !t.meta.isCfiRange && !t.resource.notes
151
150
  )
152
151
  };
153
- }, lt = ({ onNavigate: n }) => {
154
- const { data: t } = at();
155
- return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
156
- Ue,
152
+ }, st = ({ onNavigate: n }) => {
153
+ const { data: t } = lt();
154
+ return /* @__PURE__ */ e(B.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
155
+ Ye,
157
156
  {
158
157
  id: o.resource.id,
159
158
  onNavigate: n,
@@ -161,36 +160,36 @@ const X = T.ActionTrigger, We = () => ({
161
160
  },
162
161
  o.resource.id
163
162
  )) });
164
- }, st = f(
163
+ }, ct = f(
165
164
  ({
166
165
  onNavigate: n,
167
166
  defaultTab: t
168
167
  }) => {
169
- const [o, r] = y(t ?? "bookmarks");
168
+ const [o, r] = T(t ?? "bookmarks");
170
169
  return /* @__PURE__ */ s(
171
- P.Root,
170
+ y.Root,
172
171
  {
173
172
  value: o,
174
173
  onValueChange: (i) => r(i.value),
175
174
  children: [
176
- /* @__PURE__ */ s(P.List, { children: [
177
- /* @__PURE__ */ s(P.Trigger, { value: "bookmarks", children: [
178
- /* @__PURE__ */ e(dn, {}),
175
+ /* @__PURE__ */ s(y.List, { children: [
176
+ /* @__PURE__ */ s(y.Trigger, { value: "bookmarks", children: [
177
+ /* @__PURE__ */ e(gn, {}),
179
178
  "Bookmarks"
180
179
  ] }),
181
- /* @__PURE__ */ s(P.Trigger, { value: "annotations", children: [
180
+ /* @__PURE__ */ s(y.Trigger, { value: "annotations", children: [
182
181
  /* @__PURE__ */ e(he, {}),
183
182
  "Annotations"
184
183
  ] }),
185
- /* @__PURE__ */ e(P.Indicator, {})
184
+ /* @__PURE__ */ e(y.Indicator, {})
186
185
  ] }),
187
- /* @__PURE__ */ e(P.Content, { value: "bookmarks", children: /* @__PURE__ */ e(lt, { onNavigate: n }) }),
188
- /* @__PURE__ */ e(P.Content, { value: "annotations", children: /* @__PURE__ */ e(it, { onNavigate: n }) })
186
+ /* @__PURE__ */ e(y.Content, { value: "bookmarks", children: /* @__PURE__ */ e(st, { onNavigate: n }) }),
187
+ /* @__PURE__ */ e(y.Content, { value: "annotations", children: /* @__PURE__ */ e(at, { onNavigate: n }) })
189
188
  ]
190
189
  }
191
190
  );
192
191
  }
193
- ), ct = f(
192
+ ), dt = f(
194
193
  ({
195
194
  openWith: n,
196
195
  setOpen: t,
@@ -207,35 +206,35 @@ const X = T.ActionTrigger, We = () => ({
207
206
  children: /* @__PURE__ */ s(G, { height: "100%", children: [
208
207
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Annotations" }) }),
209
208
  /* @__PURE__ */ e(Y, { flex: 1, children: /* @__PURE__ */ e(
210
- st,
209
+ ct,
211
210
  {
212
211
  onNavigate: o,
213
212
  defaultTab: n
214
213
  }
215
214
  ) }),
216
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Cancel" }) }) }),
215
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
217
216
  /* @__PURE__ */ e(q, {})
218
217
  ] })
219
218
  }
220
219
  )
221
- ), dt = f(({ children: n }) => {
222
- const t = C(), o = S(() => t?.spine.element$, [t]);
223
- return o ? /* @__PURE__ */ e(ce, { children: Fn(n, o) }) : null;
224
- }), ut = ({
220
+ ), ut = f(({ children: n }) => {
221
+ const t = b(), o = C(() => t?.spine.element$, [t]);
222
+ return o ? /* @__PURE__ */ e(de, { children: _n(n, o) }) : null;
223
+ }), ht = ({
225
224
  absolutePageIndex: n,
226
225
  itemIndex: t
227
226
  }) => {
228
- const o = C();
227
+ const o = b();
229
228
  return {
230
- spineItem: S(() => o ? t !== void 0 ? ge(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
231
- D((i) => o.spine.spineItemsManager.get(i?.itemIndex))
232
- ) : we : we, [t, n, o])
229
+ spineItem: C(() => o ? t !== void 0 ? ge(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
230
+ P((i) => o.spine.spineItemsManager.get(i?.itemIndex))
231
+ ) : ye : ye, [t, n, o])
233
232
  };
234
- }, ht = ({
233
+ }, gt = ({
235
234
  absolutePageIndex: n,
236
235
  itemIndex: t
237
236
  }) => {
238
- const { spineItem: o } = ut({ absolutePageIndex: n, itemIndex: t }), r = S(
237
+ const { spineItem: o } = ht({ absolutePageIndex: n, itemIndex: t }), r = C(
239
238
  () => o?.isReady$ ?? ge(!1),
240
239
  [o]
241
240
  );
@@ -247,9 +246,9 @@ const X = T.ActionTrigger, We = () => ({
247
246
  top: o,
248
247
  width: r
249
248
  }) => {
250
- const { isReady: i } = ht({
249
+ const { isReady: i } = gt({
251
250
  absolutePageIndex: n
252
- }), { data: a } = fe(), l = a?.find(
251
+ }), { data: a } = pe(), l = a?.find(
253
252
  (d) => d?.meta?.absolutePageIndex === n && d.meta.range === void 0
254
253
  );
255
254
  if (!i) return null;
@@ -262,9 +261,9 @@ const X = T.ActionTrigger, We = () => ({
262
261
  animationName: { _open: "fade-in", _closed: "fade-out" },
263
262
  animationDuration: "moderate",
264
263
  children: /* @__PURE__ */ e(
265
- F,
264
+ _,
266
265
  {
267
- "data-bookmark-area": nt,
266
+ "data-bookmark-area": tt,
268
267
  position: "absolute",
269
268
  left: t + r,
270
269
  transform: "translateX(-100%)",
@@ -287,9 +286,9 @@ const X = T.ActionTrigger, We = () => ({
287
286
  }
288
287
  );
289
288
  }
290
- ), gt = f(() => {
291
- const n = C(), t = S(() => n?.layoutInfo$, [n]);
292
- return /* @__PURE__ */ e(dt, { children: t?.pages.map(
289
+ ), ft = f(() => {
290
+ const n = b(), t = C(() => n?.layoutInfo$, [n]);
291
+ return /* @__PURE__ */ e(ut, { children: t?.pages.map(
293
292
  ({ absoluteLayout: { left: o, top: r, width: i } }, a) => /* @__PURE__ */ e(
294
293
  pt,
295
294
  {
@@ -301,16 +300,16 @@ const X = T.ActionTrigger, We = () => ({
301
300
  a
302
301
  )
303
302
  ) });
304
- }), ft = () => {
305
- const n = C();
306
- return se(n) ? n : void 0;
303
+ }), Ze = () => {
304
+ const n = b();
305
+ return ce(n) ? n : void 0;
307
306
  }, mt = () => {
308
- const n = ft(), { data: t } = fe();
309
- $(() => n ? n.gestures.hooks.register(
307
+ const n = Ze(), { data: t } = pe();
308
+ L(() => n ? n.gestures.hooks.register(
310
309
  "beforeTapGesture",
311
310
  ({ event$: r }) => r.pipe(
312
- zn(n?.annotations.candidates$),
313
- D(([i, a]) => {
311
+ ke(n?.annotations.candidates$),
312
+ P(([i, a]) => {
314
313
  if (!i.page) return !0;
315
314
  const {
316
315
  spineItem: l,
@@ -347,116 +346,131 @@ const X = T.ActionTrigger, We = () => ({
347
346
  })
348
347
  )
349
348
  ) : void 0, [n, t]);
350
- }, Se = Xe({
349
+ }, bt = () => {
350
+ const n = Ze();
351
+ H(
352
+ () => (
353
+ /**
354
+ * Hook used to prevent some gestures from being handled.
355
+ */
356
+ n?.gestures.hooks.register(
357
+ "beforeTapGesture",
358
+ ({ event$: t }) => t.pipe(
359
+ ke(n.selection.lastSelectionOnPointerdown$),
360
+ P(([{ event: o }, r]) => {
361
+ const i = o.event.target;
362
+ return !(i && n.annotations.isTargetWithinHighlight(i) || r);
363
+ })
364
+ )
365
+ )
366
+ ),
367
+ [n]
368
+ );
369
+ }, Ce = en({
351
370
  placement: "bottom-end",
352
371
  pauseOnPageIdle: !0
353
- }), bt = () => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Ke, { toaster: Se, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ s(J.Root, { width: { md: "sm" }, children: [
354
- n.type === "loading" ? /* @__PURE__ */ e(Je, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(J.Indicator, {}),
355
- /* @__PURE__ */ s(z, { gap: "1", flex: "1", maxWidth: "100%", children: [
372
+ }), St = () => /* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(nn, { toaster: Ce, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ s(J.Root, { width: { md: "sm" }, children: [
373
+ n.type === "loading" ? /* @__PURE__ */ e(tn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(J.Indicator, {}),
374
+ /* @__PURE__ */ s(R, { gap: "1", flex: "1", maxWidth: "100%", children: [
356
375
  n.title && /* @__PURE__ */ e(J.Title, { children: n.title }),
357
376
  n.description && /* @__PURE__ */ e(J.Description, { children: n.description })
358
377
  ] }),
359
378
  n.action && /* @__PURE__ */ e(J.ActionTrigger, { children: n.action.label }),
360
379
  n.meta?.closable && /* @__PURE__ */ e(J.CloseTrigger, {})
361
- ] }) }) }), St = ({
380
+ ] }) }) }), Ct = ({
362
381
  children: n,
363
- onQuickMenuOpenChange: t,
364
- quickMenuOpen: o,
365
- ...r
382
+ ...t
366
383
  }) => {
367
- const i = re(() => N({ default: We() })), a = re(
368
- () => N({ default: i.value.fontSizeMenuOpen })
369
- ), l = ue(
370
- a
371
- ), c = O(
372
- (I) => {
373
- a.update(I);
384
+ const o = ue(() => ne({ default: Ge() })), r = ue(
385
+ () => ne({ default: o.value.fontSizeMenuOpen })
386
+ ), i = Se(
387
+ r
388
+ ), a = z(
389
+ (h) => {
390
+ r.update(h);
374
391
  },
375
- [a]
376
- ), d = re(
377
- () => N({ default: i.value.quickMenuOpen })
378
- ), u = O(
379
- (I) => {
380
- d.update(I);
392
+ [r]
393
+ ), l = z(
394
+ (h) => {
395
+ o.update((m) => ({
396
+ ...m,
397
+ _quickMenuOpen: typeof h == "function" ? h(m._quickMenuOpen) : h
398
+ }));
381
399
  },
382
- [d]
383
- ), g = ue(
384
- d
385
- ), h = o ?? g, m = t ?? u, v = re(
386
- () => N({ default: i.value.refitMenuOpen })
387
- ), x = O(
388
- (I) => {
389
- v.update(I);
400
+ [o]
401
+ ), c = ue(
402
+ () => ne({ default: o.value.refitMenuOpen })
403
+ ), d = z(
404
+ (h) => {
405
+ c.update(h);
390
406
  },
391
- [v]
392
- ), M = ue(
393
- v
394
- ), k = xn(r, _n);
395
- return $(() => {
396
- i.update((I) => ({
397
- ...I,
398
- ...k,
399
- onQuickMenuOpenChange: m,
400
- quickMenuOpen: h,
401
- onFontSizeMenuOpenChange: c,
402
- fontSizeMenuOpen: l,
403
- onRefitMenuOpenChange: x,
404
- refitMenuOpen: M
407
+ [c]
408
+ ), u = Se(
409
+ c
410
+ ), p = Rn(t, Ln);
411
+ return L(() => {
412
+ o.update((h) => ({
413
+ ...h,
414
+ ...p,
415
+ onFontSizeMenuOpenChange: a,
416
+ fontSizeMenuOpen: i,
417
+ onRefitMenuOpenChange: d,
418
+ refitMenuOpen: u,
419
+ _onQuickMenuOpenChange: l
405
420
  }));
406
421
  }, [
407
- k,
408
- h,
409
- m,
410
- i,
422
+ p,
411
423
  l,
412
- c,
413
- M,
414
- x
415
- ]), /* @__PURE__ */ e(ke.Provider, { value: i, children: n });
416
- }, Ct = f(
417
- ({ children: n, ...t }) => /* @__PURE__ */ e(St, { ...t, children: n })
424
+ o,
425
+ i,
426
+ a,
427
+ u,
428
+ d
429
+ ]), /* @__PURE__ */ e(Re.Provider, { value: o, children: n });
430
+ }, vt = f(
431
+ ({ children: n, ...t }) => /* @__PURE__ */ e(Ct, { ...t, children: n })
418
432
  ), ie = E.forwardRef(
419
433
  function(t, o) {
420
434
  const { children: r, inputProps: i, rootRef: a, ...l } = t;
421
- return /* @__PURE__ */ s(oe.Item, { ref: a, ...l, children: [
422
- /* @__PURE__ */ e(oe.ItemHiddenInput, { ref: o, ...i }),
423
- /* @__PURE__ */ e(oe.ItemIndicator, {}),
424
- r && /* @__PURE__ */ e(oe.ItemText, { children: r })
435
+ return /* @__PURE__ */ s(re.Item, { ref: a, ...l, children: [
436
+ /* @__PURE__ */ e(re.ItemHiddenInput, { ref: o, ...i }),
437
+ /* @__PURE__ */ e(re.ItemIndicator, {}),
438
+ r && /* @__PURE__ */ e(re.ItemText, { children: r })
425
439
  ] });
426
440
  }
427
- ), Qe = oe.Root, Ie = E.forwardRef(
441
+ ), Xe = re.Root, ze = E.forwardRef(
428
442
  function(t, o) {
429
- const { marks: r, label: i, showValue: a, ...l } = t, c = t.defaultValue ?? t.value, d = r?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), u = !!d?.some((g) => g.label);
430
- return /* @__PURE__ */ s(w.Root, { ref: o, thumbAlignment: "center", ...l, children: [
431
- i && !a && /* @__PURE__ */ e(w.Label, { children: i }),
432
- i && a && /* @__PURE__ */ s(B, { justify: "space-between", children: [
433
- /* @__PURE__ */ e(w.Label, { children: i }),
434
- /* @__PURE__ */ e(w.ValueText, {})
443
+ const { marks: r, label: i, showValue: a, ...l } = t, c = t.defaultValue ?? t.value, d = r?.map((p) => typeof p == "number" ? { value: p, label: void 0 } : p), u = !!d?.some((p) => p.label);
444
+ return /* @__PURE__ */ s(M.Root, { ref: o, thumbAlignment: "center", ...l, children: [
445
+ i && !a && /* @__PURE__ */ e(M.Label, { children: i }),
446
+ i && a && /* @__PURE__ */ s(F, { justify: "space-between", children: [
447
+ /* @__PURE__ */ e(M.Label, { children: i }),
448
+ /* @__PURE__ */ e(M.ValueText, {})
435
449
  ] }),
436
- /* @__PURE__ */ s(w.Control, { "data-has-mark-label": u || void 0, children: [
437
- /* @__PURE__ */ e(w.Track, { children: /* @__PURE__ */ e(w.Range, {}) }),
438
- /* @__PURE__ */ e(vt, { value: c }),
439
- /* @__PURE__ */ e(xt, { marks: d })
450
+ /* @__PURE__ */ s(M.Control, { "data-has-mark-label": u || void 0, children: [
451
+ /* @__PURE__ */ e(M.Track, { children: /* @__PURE__ */ e(M.Range, {}) }),
452
+ /* @__PURE__ */ e(xt, { value: c }),
453
+ /* @__PURE__ */ e(kt, { marks: d })
440
454
  ] })
441
455
  ] });
442
456
  }
443
457
  );
444
- function vt(n) {
458
+ function xt(n) {
445
459
  const { value: t } = n;
446
- return /* @__PURE__ */ e(en, { each: t, children: (o, r) => /* @__PURE__ */ e(w.Thumb, { index: r, children: /* @__PURE__ */ e(w.HiddenInput, {}) }, r) });
460
+ return /* @__PURE__ */ e(on, { each: t, children: (o, r) => /* @__PURE__ */ e(M.Thumb, { index: r, children: /* @__PURE__ */ e(M.HiddenInput, {}) }, r) });
447
461
  }
448
- const xt = E.forwardRef(
462
+ const kt = E.forwardRef(
449
463
  function(t, o) {
450
464
  const { marks: r } = t;
451
- return r?.length ? /* @__PURE__ */ e(w.MarkerGroup, { ref: o, children: r.map((i, a) => {
465
+ return r?.length ? /* @__PURE__ */ e(M.MarkerGroup, { ref: o, children: r.map((i, a) => {
452
466
  const l = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
453
- return /* @__PURE__ */ s(w.Marker, { value: l, children: [
454
- /* @__PURE__ */ e(w.MarkerIndicator, {}),
467
+ return /* @__PURE__ */ s(M.Marker, { value: l, children: [
468
+ /* @__PURE__ */ e(M.MarkerIndicator, {}),
455
469
  c
456
470
  ] }, a);
457
471
  }) }) : null;
458
472
  }
459
- ), Re = [
473
+ ), Oe = [
460
474
  {
461
475
  value: "global",
462
476
  references: ["global"]
@@ -469,15 +483,15 @@ const xt = E.forwardRef(
469
483
  value: "screen",
470
484
  references: ["mobile", "tablet", "desktop"]
471
485
  }
472
- ], kt = Re.map((n) => n.value), ye = Re.flatMap(
486
+ ], It = Oe.map((n) => n.value), Pe = Oe.flatMap(
473
487
  (n) => n.references
474
- ), It = (n) => {
488
+ ), Rt = (n) => {
475
489
  if (n)
476
- return Re.find(
490
+ return Oe.find(
477
491
  (t) => t.references.includes(n)
478
492
  )?.value;
479
- }, Rt = f(() => {
480
- const n = He(), {
493
+ }, zt = f(() => {
494
+ const n = qe(), {
481
495
  fontSizeMenuOpen: t,
482
496
  onFontSizeMenuOpenChange: o,
483
497
  uncontrolledFontSize: r,
@@ -487,8 +501,8 @@ const xt = E.forwardRef(
487
501
  fontSizeScope: c,
488
502
  fontSizeValues: d,
489
503
  onFontSizeChange: u,
490
- onFontSizeScopeChange: g
491
- } = _([
504
+ onFontSizeScopeChange: p
505
+ } = A([
492
506
  "fontSizeMenuOpen",
493
507
  "onFontSizeMenuOpenChange",
494
508
  "fontSize",
@@ -499,37 +513,37 @@ const xt = E.forwardRef(
499
513
  "onFontSizeScopeChange",
500
514
  "uncontrolledFontSize",
501
515
  "fontSizeValues"
502
- ]), h = kn(u), [m, v] = y(
516
+ ]), h = zn(u), [m, I] = T(
503
517
  c ?? "global"
504
- ), x = O(
505
- (p, K) => {
506
- h.current ? h.current(p, K) : n.update((Ze) => ({
507
- ...Ze,
518
+ ), x = z(
519
+ (g, K) => {
520
+ h.current ? h.current(g, K) : n.update((Je) => ({
521
+ ...Je,
508
522
  uncontrolledFontSize: K
509
523
  }));
510
524
  },
511
525
  [h, n]
512
- ), M = O(
513
- (p) => d?.[p] ?? i,
526
+ ), D = z(
527
+ (g) => d?.[g] ?? i,
514
528
  [i, d]
515
- ), k = O(
516
- (p) => {
517
- const K = p.value;
518
- g?.(K);
529
+ ), k = z(
530
+ (g) => {
531
+ const K = g.value;
532
+ p?.(K);
519
533
  },
520
- [g]
521
- ), I = O((p) => {
522
- v(p.value);
523
- }, []), L = O(
524
- (p) => {
525
- const K = p.value[0] ?? 0;
534
+ [p]
535
+ ), w = z((g) => {
536
+ I(g.value);
537
+ }, []), $ = z(
538
+ (g) => {
539
+ const K = g.value[0] ?? 0;
526
540
  x(m, K / 100);
527
541
  },
528
542
  [x, m]
529
543
  );
530
- return $(
544
+ return L(
531
545
  function() {
532
- v(c ?? "global");
546
+ I(c ?? "global");
533
547
  },
534
548
  [c]
535
549
  ), /* @__PURE__ */ e(
@@ -537,53 +551,53 @@ const xt = E.forwardRef(
537
551
  {
538
552
  lazyMount: !0,
539
553
  open: t,
540
- onOpenChange: (p) => {
541
- o(p.open);
554
+ onOpenChange: (g) => {
555
+ o(g.open);
542
556
  },
543
557
  placement: "center",
544
558
  children: /* @__PURE__ */ s(G, { maxH: "40vh", overflow: "auto", children: [
545
559
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Font size" }) }),
546
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ s(z, { gap: 4, flex: 1, children: [
560
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ s(R, { gap: 4, flex: 1, children: [
547
561
  /* @__PURE__ */ s(V.Root, { children: [
548
562
  /* @__PURE__ */ e(V.Legend, { children: "Scope" }),
549
563
  /* @__PURE__ */ e(V.HelperText, { children: "The scope to which apply the font size for this book." }),
550
564
  /* @__PURE__ */ e(V.Content, { children: /* @__PURE__ */ e(
551
- Qe,
565
+ Xe,
552
566
  {
553
567
  onValueChange: k,
554
- value: It(c) ?? "global",
555
- disabled: !g,
556
- children: /* @__PURE__ */ e(B, { gap: 2, children: kt.map((p) => /* @__PURE__ */ e(ie, { value: p, children: p }, p)) })
568
+ value: Rt(c) ?? "global",
569
+ disabled: !p,
570
+ children: /* @__PURE__ */ e(F, { gap: 2, children: It.map((g) => /* @__PURE__ */ e(ie, { value: g, children: g }, g)) })
557
571
  }
558
572
  ) })
559
573
  ] }),
560
574
  /* @__PURE__ */ s(
561
- P.Root,
575
+ y.Root,
562
576
  {
563
577
  value: m,
564
- onValueChange: I,
578
+ onValueChange: w,
565
579
  fitted: !1,
566
580
  size: "sm",
567
581
  children: [
568
- /* @__PURE__ */ e(P.List, { children: ye.map((p) => /* @__PURE__ */ s(
569
- P.Trigger,
582
+ /* @__PURE__ */ e(y.List, { children: Pe.map((g) => /* @__PURE__ */ s(
583
+ y.Trigger,
570
584
  {
571
- value: p,
585
+ value: g,
572
586
  textTransform: "capitalize",
573
- disabled: p !== "global" && !c,
587
+ disabled: g !== "global" && !c,
574
588
  children: [
575
- c === p && /* @__PURE__ */ e(un, {}),
576
- p
589
+ c === g && /* @__PURE__ */ e(pn, {}),
590
+ g
577
591
  ]
578
592
  },
579
- p
593
+ g
580
594
  )) }),
581
- ye.map((p) => /* @__PURE__ */ e(P.Content, { value: p, children: /* @__PURE__ */ e(
582
- Ie,
595
+ Pe.map((g) => /* @__PURE__ */ e(y.Content, { value: g, children: /* @__PURE__ */ e(
596
+ ze,
583
597
  {
584
598
  label: "%",
585
- value: [(M(p) ?? 1) * 100],
586
- onValueChange: L,
599
+ value: [(D(g) ?? 1) * 100],
600
+ onValueChange: $,
587
601
  showValue: !0,
588
602
  marks: [
589
603
  { value: 100, label: "Publisher" },
@@ -601,23 +615,23 @@ const xt = E.forwardRef(
601
615
  width: "100%",
602
616
  step: 0.1 * 100
603
617
  }
604
- ) }, p))
618
+ ) }, g))
605
619
  ]
606
620
  }
607
621
  )
608
622
  ] }) }),
609
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Close" }) }) }),
623
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Close" }) }) }),
610
624
  /* @__PURE__ */ e(q, {})
611
625
  ] })
612
626
  }
613
627
  );
614
- }), zt = () => {
615
- const n = C(), t = He(), { fontSize: o, uncontrolledFontSize: r } = _([
628
+ }), Ot = () => {
629
+ const n = b(), t = qe(), { fontSize: o, uncontrolledFontSize: r } = A([
616
630
  "fontSize",
617
631
  "uncontrolledFontSize",
618
632
  "onFontSizeChange"
619
633
  ]), i = o ?? r;
620
- return $(
634
+ return L(
621
635
  function() {
622
636
  if (n && i) {
623
637
  const l = setTimeout(() => {
@@ -629,9 +643,9 @@ const xt = E.forwardRef(
629
643
  }
630
644
  },
631
645
  [n, i]
632
- ), de(
646
+ ), H(
633
647
  function() {
634
- return n?.settings.values$.pipe(D((l) => l.fontScale)).subscribe((l) => {
648
+ return n?.settings.values$.pipe(P((l) => l.fontScale)).subscribe((l) => {
635
649
  const c = t.value.fontSize ?? t.value.uncontrolledFontSize;
636
650
  l !== c && (t.value.onFontSizeChange?.("internal", l), t.update((d) => ({
637
651
  ...d,
@@ -641,7 +655,7 @@ const xt = E.forwardRef(
641
655
  },
642
656
  [n, t]
643
657
  ), null;
644
- }, Ot = {
658
+ }, Mt = {
645
659
  x: 0,
646
660
  y: 0,
647
661
  width: 0,
@@ -652,42 +666,42 @@ const xt = E.forwardRef(
652
666
  right: 0
653
667
  };
654
668
  function Tt() {
655
- const [n, t] = y(null), [o, r] = y(Ot), i = an(
669
+ const [n, t] = T(null), [o, r] = T(Mt), i = cn(
656
670
  () => new ResizeObserver((a) => {
657
671
  if (a[0]) {
658
- const { x: l, y: c, width: d, height: u, top: g, left: h, bottom: m, right: v } = a[0].contentRect;
659
- r({ x: l, y: c, width: d, height: u, top: g, left: h, bottom: m, right: v });
672
+ const { x: l, y: c, width: d, height: u, top: p, left: h, bottom: m, right: I } = a[0].contentRect;
673
+ r({ x: l, y: c, width: d, height: u, top: p, left: h, bottom: m, right: I });
660
674
  }
661
675
  }),
662
676
  []
663
677
  );
664
- return ln(() => {
678
+ return dn(() => {
665
679
  if (n)
666
680
  return i.observe(n), () => {
667
681
  i.disconnect();
668
682
  };
669
683
  }, [n, i]), [t, o, n];
670
684
  }
671
- const Mt = (n, t, o) => {
672
- const r = C(), i = qe(r) ? r : void 0;
673
- de(() => {
674
- if (!i || !n) return xe;
685
+ const wt = (n, t, o) => {
686
+ const r = b(), i = Ue(r) ? r : void 0;
687
+ H(() => {
688
+ if (!i || !n) return Ie;
675
689
  const a = t.layout.layout$.pipe(
676
- On(t.layout.layoutInfo),
677
- _e(Ln)
678
- ), l = $n(
690
+ Tn(t.layout.layoutInfo),
691
+ De($n)
692
+ ), l = Vn(
679
693
  n
680
- ).pipe(D((c) => c.some((d) => d.isIntersecting)));
694
+ ).pipe(P((c) => c.some((d) => d.isIntersecting)));
681
695
  return a.pipe(
682
696
  Le(100, void 0, { trailing: !0 }),
683
- W(() => l.pipe(
684
- Tn((c) => {
697
+ N(() => l.pipe(
698
+ $e((c) => {
685
699
  c || (n.innerHTML = "");
686
700
  }),
687
- pe((c) => c),
688
- $e()
701
+ se((c) => c),
702
+ Ve()
689
703
  ).pipe(
690
- W(() => (n.innerHTML = "", i?.gallery.snapshot(
704
+ N(() => (n.innerHTML = "", i?.gallery.snapshot(
691
705
  t,
692
706
  n,
693
707
  o
@@ -695,16 +709,16 @@ const Mt = (n, t, o) => {
695
709
  ))
696
710
  );
697
711
  }, [i, t, o, n]);
698
- }, wt = f(
712
+ }, yt = f(
699
713
  ({ item: n, onNavigated: t }) => {
700
- const [o, r, i] = Tt(), a = C();
701
- Mt(i, n, r);
702
- const l = S(
714
+ const [o, r, i] = Tt(), a = b();
715
+ wt(i, n, r);
716
+ const l = C(
703
717
  () => a?.locateResource(n, { mode: "shallow" }),
704
718
  [a, n]
705
719
  );
706
720
  return /* @__PURE__ */ s(
707
- F,
721
+ _,
708
722
  {
709
723
  width: "100%",
710
724
  aspectRatio: "2/3",
@@ -720,7 +734,7 @@ const Mt = (n, t, o) => {
720
734
  },
721
735
  children: [
722
736
  /* @__PURE__ */ e(
723
- F,
737
+ _,
724
738
  {
725
739
  height: "100%",
726
740
  width: "100%",
@@ -730,7 +744,7 @@ const Mt = (n, t, o) => {
730
744
  }
731
745
  ),
732
746
  /* @__PURE__ */ s(
733
- b,
747
+ S,
734
748
  {
735
749
  position: "absolute",
736
750
  bottom: 0,
@@ -750,9 +764,9 @@ const Mt = (n, t, o) => {
750
764
  }
751
765
  );
752
766
  }
753
- ), yt = f(
767
+ ), Pt = f(
754
768
  ({ open: n, setOpen: t }) => {
755
- const o = C(), r = S(() => o?.spineItemsManager.items$, [o]);
769
+ const o = b(), r = C(() => o?.spineItemsManager.items$, [o]);
756
770
  return /* @__PURE__ */ e(
757
771
  j,
758
772
  {
@@ -765,7 +779,7 @@ const Mt = (n, t, o) => {
765
779
  children: /* @__PURE__ */ s(G, { height: "100%", children: [
766
780
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Gallery" }) }),
767
781
  /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(
768
- F,
782
+ _,
769
783
  {
770
784
  gridTemplateColumns: [
771
785
  "repeat(2, minmax(0, 1fr))",
@@ -776,7 +790,7 @@ const Mt = (n, t, o) => {
776
790
  pt: 2,
777
791
  "data-grid": !0,
778
792
  children: r?.map((i) => /* @__PURE__ */ e(
779
- wt,
793
+ yt,
780
794
  {
781
795
  item: i,
782
796
  onNavigated: () => {
@@ -787,13 +801,13 @@ const Mt = (n, t, o) => {
787
801
  ))
788
802
  }
789
803
  ) }),
790
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Cancel" }) }) }),
804
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
791
805
  /* @__PURE__ */ e(q, {})
792
806
  ] })
793
807
  }
794
808
  );
795
809
  }
796
- ), Pt = "@prose-reader/react-reader", Et = "1.260.0", At = f(
810
+ ), Et = "@prose-reader/react-reader", At = "1.263.0", Bt = f(
797
811
  ({ open: n, setOpen: t }) => /* @__PURE__ */ e(
798
812
  j,
799
813
  {
@@ -814,44 +828,44 @@ const Mt = (n, t, o) => {
814
828
  flexDirection: "column",
815
829
  gap: 4,
816
830
  children: [
817
- /* @__PURE__ */ s(z, { children: [
831
+ /* @__PURE__ */ s(R, { children: [
818
832
  /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
819
- /* @__PURE__ */ s(B, { mb: 1, children: [
820
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(hn, {}) }),
833
+ /* @__PURE__ */ s(F, { mb: 1, children: [
834
+ /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(fn, {}) }),
821
835
  " ",
822
- /* @__PURE__ */ e(b, { children: "Navigate to right page" })
836
+ /* @__PURE__ */ e(S, { children: "Navigate to right page" })
823
837
  ] }),
824
- /* @__PURE__ */ s(B, { mb: 1, children: [
825
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(pn, {}) }),
838
+ /* @__PURE__ */ s(F, { mb: 1, children: [
839
+ /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(mn, {}) }),
826
840
  " ",
827
- /* @__PURE__ */ e(b, { children: "Navigate to left page" })
841
+ /* @__PURE__ */ e(S, { children: "Navigate to left page" })
828
842
  ] })
829
843
  ] }),
830
- /* @__PURE__ */ s(z, { children: [
844
+ /* @__PURE__ */ s(R, { children: [
831
845
  /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
832
- /* @__PURE__ */ e(B, { mb: 1, children: /* @__PURE__ */ e(b, { children: "Tap on the top right corner of a page bookmark it" }) })
846
+ /* @__PURE__ */ e(F, { mb: 1, children: /* @__PURE__ */ e(S, { children: "Tap on the top right corner of a page bookmark it" }) })
833
847
  ] }),
834
- /* @__PURE__ */ s(z, { children: [
848
+ /* @__PURE__ */ s(R, { children: [
835
849
  /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "About" }),
836
- /* @__PURE__ */ s(b, { children: [
837
- Pt,
850
+ /* @__PURE__ */ s(S, { children: [
851
+ Et,
838
852
  " version: ",
839
- Et
853
+ At
840
854
  ] })
841
855
  ] })
842
856
  ]
843
857
  }
844
858
  ),
845
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Cancel" }) }) }),
859
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
846
860
  /* @__PURE__ */ e(q, {})
847
861
  ] })
848
862
  }
849
863
  )
850
- ), ne = () => {
851
- const n = C();
852
- return S(
853
- () => n ? Mn([n.pagination.state$, n.context]).pipe(
854
- D(([t, o]) => {
864
+ ), te = () => {
865
+ const n = b();
866
+ return C(
867
+ () => n ? wn([n.pagination.state$, n.context]).pipe(
868
+ P(([t, o]) => {
855
869
  const r = o.manifest?.spineItems.every(
856
870
  (i) => i.mediaType?.startsWith("image/")
857
871
  );
@@ -860,41 +874,51 @@ const Mt = (n, t, o) => {
860
874
  hasChapters: !o.isFullyPrePaginated && !r
861
875
  };
862
876
  })
863
- ) : xe,
877
+ ) : Ie,
864
878
  [n]
865
879
  );
866
- }, Bt = () => {
867
- const n = ne(), t = Math.floor(
880
+ }, Ft = () => {
881
+ const n = te(), t = Math.floor(
868
882
  (n?.percentageEstimateOfBook ?? 0) * 100
869
883
  ), o = t > 0 ? t : 1;
870
- return n?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(F, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(b, { fontSize: "sm", children: [
884
+ return n?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(_, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(S, { fontSize: "sm", children: [
871
885
  o,
872
886
  " %"
873
887
  ] }) });
874
- }, Ft = () => {
875
- const [n, t] = y(/* @__PURE__ */ new Date());
876
- return $(() => {
888
+ }, _t = () => {
889
+ const [n, t] = T(/* @__PURE__ */ new Date());
890
+ return L(() => {
877
891
  const o = setInterval(() => {
878
892
  t(/* @__PURE__ */ new Date());
879
893
  }, 6e4);
880
894
  return () => clearInterval(o);
881
895
  }, []), n;
882
896
  }, Dt = (n) => {
883
- const t = Ft();
884
- return /* @__PURE__ */ e(b, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
897
+ const t = _t();
898
+ return /* @__PURE__ */ e(S, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
885
899
  hour: "2-digit",
886
900
  minute: "2-digit"
887
901
  }) });
888
- }, ze = () => {
889
- const { quickMenuOpen: n, onQuickMenuOpenChange: t } = _([
902
+ }, fe = () => {
903
+ const {
904
+ quickMenuOpen: n,
905
+ onQuickMenuOpenChange: t,
906
+ _quickMenuOpen: o,
907
+ _onQuickMenuOpenChange: r
908
+ } = A([
890
909
  "quickMenuOpen",
891
- "onQuickMenuOpenChange"
910
+ "onQuickMenuOpenChange",
911
+ "_quickMenuOpen",
912
+ "_onQuickMenuOpenChange"
892
913
  ]);
893
- return [n, t];
894
- }, _t = f(() => {
895
- const [n] = ze();
914
+ return [
915
+ n ?? o,
916
+ t ?? r
917
+ ];
918
+ }, Lt = f(() => {
919
+ const [n] = fe();
896
920
  return /* @__PURE__ */ e(
897
- F,
921
+ _,
898
922
  {
899
923
  position: "absolute",
900
924
  left: 0,
@@ -904,11 +928,11 @@ const Mt = (n, t, o) => {
904
928
  children: /* @__PURE__ */ e(Dt, {})
905
929
  }
906
930
  );
907
- }), Lt = () => {
908
- const n = C();
909
- de(
931
+ }), $t = () => {
932
+ const n = b();
933
+ H(
910
934
  () => n?.links$.subscribe((t) => {
911
- if (t.type === "click" && Vn(t.target, "a")) {
935
+ if (t.type === "click" && Nn(t.target, "a")) {
912
936
  if (!t.target.href) return;
913
937
  const o = new URL(t.target.href);
914
938
  window.location.host !== o.host && confirm(
@@ -918,18 +942,18 @@ const Mt = (n, t, o) => {
918
942
  }),
919
943
  [n]
920
944
  );
921
- }, $t = () => {
922
- const { notificationsSubject: n } = _([
945
+ }, Vt = () => {
946
+ const { notificationsSubject: n } = A([
923
947
  "notificationsSubject"
924
948
  ]);
925
- de(
949
+ H(
926
950
  () => n.pipe(
927
- pe(De),
928
- wn((t) => {
929
- const o = t.duration ?? 3e3, r = new yn((a) => {
951
+ se(_e),
952
+ yn((t) => {
953
+ const o = t.duration ?? 3e3, r = new Pn((a) => {
930
954
  try {
931
955
  queueMicrotask(() => {
932
- const l = Se.create({
956
+ const l = Ce.create({
933
957
  title: t.title,
934
958
  description: t.description,
935
959
  duration: o
@@ -940,20 +964,20 @@ const Mt = (n, t, o) => {
940
964
  a.error(l);
941
965
  }
942
966
  }), i = n.pipe(
943
- Pn(1),
944
- pe((a) => !!t.key && a?.key === t.key)
967
+ En(1),
968
+ se((a) => !!t.key && a?.key === t.key)
945
969
  );
946
970
  return r.pipe(
947
- W(
948
- (a) => Ve(
949
- Ne(o),
950
- t.abort ?? xe,
971
+ N(
972
+ (a) => Ne(
973
+ We(o),
974
+ t.abort ?? Ie,
951
975
  i
952
976
  ).pipe(
953
- $e(),
954
- En(() => {
977
+ Ve(),
978
+ An(() => {
955
979
  queueMicrotask(() => {
956
- Se.dismiss(a);
980
+ Ce.dismiss(a);
957
981
  });
958
982
  })
959
983
  )
@@ -963,7 +987,7 @@ const Mt = (n, t, o) => {
963
987
  ),
964
988
  [n]
965
989
  );
966
- }, Vt = E.forwardRef(
990
+ }, Nt = E.forwardRef(
967
991
  function(t, o) {
968
992
  const {
969
993
  showArrow: r,
@@ -980,7 +1004,7 @@ const Mt = (n, t, o) => {
980
1004
  positioning: { ...d.positioning, gutter: 4 },
981
1005
  children: [
982
1006
  /* @__PURE__ */ e(ee.Trigger, { asChild: !0, children: i }),
983
- /* @__PURE__ */ e(Ce, { disabled: !a, container: c, children: /* @__PURE__ */ e(ee.Positioner, { children: /* @__PURE__ */ s(
1007
+ /* @__PURE__ */ e(ve, { disabled: !a, container: c, children: /* @__PURE__ */ e(ee.Positioner, { children: /* @__PURE__ */ s(
984
1008
  ee.Content,
985
1009
  {
986
1010
  width: "auto",
@@ -999,33 +1023,33 @@ const Mt = (n, t, o) => {
999
1023
  }
1000
1024
  );
1001
1025
  }
1002
- ), Nt = E.forwardRef(function(t, o) {
1026
+ ), Wt = E.forwardRef(function(t, o) {
1003
1027
  const { children: r, ...i } = t;
1004
- return /* @__PURE__ */ e(Vt, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
1005
- R,
1028
+ return /* @__PURE__ */ e(Nt, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
1029
+ v,
1006
1030
  {
1007
1031
  variant: "ghost",
1008
1032
  "aria-label": "info",
1009
1033
  size: "2xs",
1010
1034
  colorPalette: "gray",
1011
- children: /* @__PURE__ */ e(Xn, {})
1035
+ children: /* @__PURE__ */ e(Kn, {})
1012
1036
  }
1013
1037
  ) });
1014
- }), Wt = E.forwardRef(function(t, o) {
1038
+ }), Ht = E.forwardRef(function(t, o) {
1015
1039
  return /* @__PURE__ */ e(le.Track, { ...t, ref: o, children: /* @__PURE__ */ e(le.Range, {}) });
1016
1040
  });
1017
1041
  E.forwardRef(function(t, o) {
1018
1042
  const { children: r, info: i, ...a } = t;
1019
1043
  return /* @__PURE__ */ s(le.Label, { ...a, ref: o, children: [
1020
1044
  r,
1021
- i && /* @__PURE__ */ e(Nt, { children: i })
1045
+ i && /* @__PURE__ */ e(Wt, { children: i })
1022
1046
  ] });
1023
1047
  });
1024
- const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1025
- const n = ne(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
1048
+ const Gt = le.Root, qt = le.ValueText, Me = () => {
1049
+ const n = te(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
1026
1050
  i,
1027
1051
  a
1028
- ].sort((g, h) => g - h), d = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, u = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
1052
+ ].sort((p, h) => p - h), d = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, u = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
1029
1053
  return {
1030
1054
  hasOnlyOnePage: t,
1031
1055
  beginPageIndex: i,
@@ -1037,25 +1061,25 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1037
1061
  leftPageIndex: l,
1038
1062
  rightPageIndex: c
1039
1063
  };
1040
- }, qt = () => {
1041
- const n = ne(), {
1064
+ }, jt = () => {
1065
+ const n = te(), {
1042
1066
  hasOnlyOnePage: t,
1043
1067
  leftPageIndex: o,
1044
1068
  rightPageIndex: r,
1045
1069
  totalApproximatePages: i,
1046
1070
  beginAndEndAreDifferent: a
1047
- } = Oe(), l = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.beginChapterInfo);
1048
- return /* @__PURE__ */ s(z, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
1049
- /* @__PURE__ */ e(Ht, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(B, { justifyContent: "space-between", children: [
1050
- /* @__PURE__ */ e(Wt, { width: 110 }),
1051
- /* @__PURE__ */ e(Gt, { children: `${l}%` })
1071
+ } = Me(), l = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.beginChapterInfo);
1072
+ return /* @__PURE__ */ s(R, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
1073
+ /* @__PURE__ */ e(Gt, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(F, { justifyContent: "space-between", children: [
1074
+ /* @__PURE__ */ e(Ht, { width: 110 }),
1075
+ /* @__PURE__ */ e(qt, { children: `${l}%` })
1052
1076
  ] }) }),
1053
- /* @__PURE__ */ e(b, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
1054
- !t && /* @__PURE__ */ s(B, { children: [
1055
- /* @__PURE__ */ e(b, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
1056
- !!n?.hasChapters && /* @__PURE__ */ s(ce, { children: [
1057
- /* @__PURE__ */ e(b, { children: "-" }),
1058
- /* @__PURE__ */ s(b, { fontSize: "xs", children: [
1077
+ /* @__PURE__ */ e(S, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
1078
+ !t && /* @__PURE__ */ s(F, { children: [
1079
+ /* @__PURE__ */ e(S, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
1080
+ !!n?.hasChapters && /* @__PURE__ */ s(de, { children: [
1081
+ /* @__PURE__ */ e(S, { children: "-" }),
1082
+ /* @__PURE__ */ s(S, { fontSize: "xs", children: [
1059
1083
  "(",
1060
1084
  (n?.beginAbsolutePageIndex ?? 0) + 1,
1061
1085
  ")"
@@ -1063,7 +1087,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1063
1087
  ] })
1064
1088
  ] })
1065
1089
  ] });
1066
- }, Ye = f(
1090
+ }, Ke = f(
1067
1091
  ({
1068
1092
  children: n,
1069
1093
  position: t,
@@ -1093,8 +1117,8 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1093
1117
  children: n
1094
1118
  }
1095
1119
  )
1096
- ), jt = nn(Kn), Ut = f((n) => /* @__PURE__ */ e(
1097
- F,
1120
+ ), Ut = rn(Jn), Qt = f((n) => /* @__PURE__ */ e(
1121
+ _,
1098
1122
  {
1099
1123
  display: "contents",
1100
1124
  css: {
@@ -1103,7 +1127,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1103
1127
  "--color-solid": "colors.colorPalette.solid"
1104
1128
  },
1105
1129
  children: /* @__PURE__ */ e(
1106
- jt,
1130
+ Ut,
1107
1131
  {
1108
1132
  keyboard: !1,
1109
1133
  style: {
@@ -1147,16 +1171,16 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1147
1171
  }
1148
1172
  )
1149
1173
  }
1150
- )), Qt = () => {
1151
- const t = ne()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Oe(), i = t ? Math.floor((o || 0) / 2) : o, [a, l] = In(
1152
- () => N({
1174
+ )), Yt = () => {
1175
+ const t = te()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Me(), i = t ? Math.floor((o || 0) / 2) : o, [a, l] = On(
1176
+ () => ne({
1153
1177
  default: i || 0
1154
1178
  })
1155
1179
  ), c = 0, d = Math.max(
1156
1180
  0,
1157
1181
  t ? Math.floor((r - 1) / 2) : r - 1
1158
1182
  );
1159
- return $(() => {
1183
+ return L(() => {
1160
1184
  l.update(i || 0);
1161
1185
  }, [i, l]), {
1162
1186
  value: a,
@@ -1164,34 +1188,34 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1164
1188
  min: c,
1165
1189
  max: d
1166
1190
  };
1167
- }, Yt = (n) => {
1168
- const t = C(), o = ne(), { manifest: r } = S(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = Oe(), d = 1, u = c, { value: g, valueSignal: h, min: m, max: v } = Qt(), x = O(
1191
+ }, Zt = (n) => {
1192
+ const t = b(), o = te(), { manifest: r } = C(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = Me(), d = 1, u = c, { value: p, valueSignal: h, min: m, max: I } = Yt(), x = z(
1169
1193
  (k) => {
1170
- const [I = 0] = Array.isArray(k) ? k : [k];
1171
- h.update(I);
1172
- const L = a ? Math.floor(I) * 2 : Math.floor(I);
1194
+ const [w = 0] = Array.isArray(k) ? k : [k];
1195
+ h.update(w);
1196
+ const $ = a ? Math.floor(w) * 2 : Math.floor(w);
1173
1197
  u ? t?.navigation.goToPageOfSpineItem({
1174
- pageIndex: L,
1198
+ pageIndex: $,
1175
1199
  spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
1176
1200
  animation: !1
1177
1201
  }) : t?.navigation.goToAbsolutePageIndex({
1178
- absolutePageIndex: L,
1202
+ absolutePageIndex: $,
1179
1203
  animation: !1
1180
1204
  });
1181
1205
  },
1182
1206
  [t, a, h, u]
1183
1207
  );
1184
- return de(
1208
+ return H(
1185
1209
  () => t?.navigation.throttleLock({
1186
1210
  duration: 100,
1187
1211
  trigger: h.subject
1188
1212
  }),
1189
1213
  [t, h]
1190
- ), l === 1 || a && l === 2 ? /* @__PURE__ */ e(F, { style: n.style }) : /* @__PURE__ */ e(
1191
- Ut,
1214
+ ), l === 1 || a && l === 2 ? /* @__PURE__ */ e(_, { style: n.style }) : /* @__PURE__ */ e(
1215
+ Qt,
1192
1216
  {
1193
- value: [g],
1194
- max: v,
1217
+ value: [p],
1218
+ max: I,
1195
1219
  min: m,
1196
1220
  reverse: i,
1197
1221
  step: d,
@@ -1199,38 +1223,38 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1199
1223
  ...n
1200
1224
  }
1201
1225
  );
1202
- }, Zt = f(
1226
+ }, Xt = f(
1203
1227
  ({
1204
1228
  open: n,
1205
1229
  onItemClick: t
1206
1230
  }) => {
1207
- const o = sn(null), r = C(), {
1231
+ const o = un(null), r = b(), {
1208
1232
  quickMenuBottomBarBoundingBoxSignal: i,
1209
1233
  onFontSizeMenuOpenChange: a,
1210
1234
  onRefitMenuOpenChange: l
1211
- } = _([
1235
+ } = A([
1212
1236
  "quickMenuBottomBarBoundingBoxSignal",
1213
1237
  "onFontSizeMenuOpenChange",
1214
1238
  "onRefitMenuOpenChange"
1215
- ]), c = S(() => r?.navigation.state$, [r]), d = S(() => r?.settings.values$, [r]), u = S(
1239
+ ]), c = C(() => r?.navigation.state$, [r]), d = C(() => r?.settings.values$, [r]), u = C(
1216
1240
  () => r?.zoom.state$.pipe(
1217
- D(
1241
+ P(
1218
1242
  (k) => k.currentScale > 1 ? "in" : k.currentScale < 1 ? "out" : void 0
1219
1243
  )
1220
1244
  ),
1221
1245
  [r]
1222
- ), g = u === "in", h = u === "out", m = d?.computedPageTurnMode === "scrollable", v = d?.computedPageTurnDirection === "vertical", [x, M] = y(!0);
1223
- return $(() => {
1246
+ ), p = u === "in", h = u === "out", m = d?.computedPageTurnMode === "scrollable", I = d?.computedPageTurnDirection === "vertical", [x, D] = T(!0);
1247
+ return L(() => {
1224
1248
  if (!o.current) return;
1225
- const k = new ResizeObserver((I) => {
1226
- for (const L of I)
1227
- i.update(L);
1249
+ const k = new ResizeObserver((w) => {
1250
+ for (const $ of w)
1251
+ i.update($);
1228
1252
  });
1229
1253
  return k.observe(o.current), () => {
1230
1254
  k.disconnect();
1231
1255
  };
1232
1256
  }, [i]), /* @__PURE__ */ s(
1233
- Ye,
1257
+ Ke,
1234
1258
  {
1235
1259
  present: n,
1236
1260
  position: "bottom",
@@ -1242,7 +1266,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1242
1266
  ref: o,
1243
1267
  children: [
1244
1268
  /* @__PURE__ */ s(
1245
- B,
1269
+ F,
1246
1270
  {
1247
1271
  flex: 1,
1248
1272
  alignItems: "center",
@@ -1251,7 +1275,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1251
1275
  px: 4,
1252
1276
  children: [
1253
1277
  /* @__PURE__ */ e(
1254
- R,
1278
+ v,
1255
1279
  {
1256
1280
  "aria-label": "left",
1257
1281
  size: "lg",
@@ -1259,11 +1283,11 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1259
1283
  flexShrink: 0,
1260
1284
  onClick: () => r?.navigation.goToLeftOrTopSpineItem(),
1261
1285
  disabled: !c?.canGoLeftSpineItem && !c?.canGoTopSpineItem,
1262
- children: v ? /* @__PURE__ */ e(Un, {}) : /* @__PURE__ */ e(Qn, {})
1286
+ children: I ? /* @__PURE__ */ e(Qn, {}) : /* @__PURE__ */ e(Yn, {})
1263
1287
  }
1264
1288
  ),
1265
1289
  /* @__PURE__ */ s(
1266
- z,
1290
+ R,
1267
1291
  {
1268
1292
  flex: 1,
1269
1293
  maxW: 400,
@@ -1272,9 +1296,9 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1272
1296
  overflow: "auto",
1273
1297
  px: 4,
1274
1298
  children: [
1275
- /* @__PURE__ */ e(qt, {}),
1299
+ /* @__PURE__ */ e(jt, {}),
1276
1300
  /* @__PURE__ */ e(
1277
- Yt,
1301
+ Zt,
1278
1302
  {
1279
1303
  style: {
1280
1304
  width: "100%",
@@ -1287,7 +1311,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1287
1311
  }
1288
1312
  ),
1289
1313
  /* @__PURE__ */ e(
1290
- R,
1314
+ v,
1291
1315
  {
1292
1316
  "aria-label": "right",
1293
1317
  size: "lg",
@@ -1297,19 +1321,19 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1297
1321
  onClick: () => {
1298
1322
  r?.navigation.goToRightOrBottomSpineItem();
1299
1323
  },
1300
- children: v ? /* @__PURE__ */ e(Yn, {}) : /* @__PURE__ */ e(Zn, {})
1324
+ children: I ? /* @__PURE__ */ e(Zn, {}) : /* @__PURE__ */ e(Xn, {})
1301
1325
  }
1302
1326
  )
1303
1327
  ]
1304
1328
  }
1305
1329
  ),
1306
- /* @__PURE__ */ e(B, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1330
+ /* @__PURE__ */ e(F, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1307
1331
  be.Root,
1308
1332
  {
1309
1333
  open: x,
1310
1334
  flex: 1,
1311
1335
  onOpenChange: ({ open: k }) => {
1312
- M(k);
1336
+ D(k);
1313
1337
  },
1314
1338
  width: "100%",
1315
1339
  children: [
@@ -1321,7 +1345,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1321
1345
  display: "flex",
1322
1346
  justifyContent: "center",
1323
1347
  children: /* @__PURE__ */ e(
1324
- gn,
1348
+ bn,
1325
1349
  {
1326
1350
  style: {
1327
1351
  transform: x ? "rotate(0deg)" : "rotate(180deg)"
@@ -1330,54 +1354,54 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1330
1354
  )
1331
1355
  }
1332
1356
  ),
1333
- /* @__PURE__ */ e(be.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(F, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1357
+ /* @__PURE__ */ e(be.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(_, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1334
1358
  /* @__PURE__ */ e(
1335
- R,
1359
+ v,
1336
1360
  {
1337
1361
  "aria-label": "Help",
1338
1362
  size: "lg",
1339
1363
  variant: "ghost",
1340
1364
  onClick: () => t("help"),
1341
- children: /* @__PURE__ */ e(fn, {})
1365
+ children: /* @__PURE__ */ e(Sn, {})
1342
1366
  }
1343
1367
  ),
1344
1368
  /* @__PURE__ */ e(
1345
- R,
1369
+ v,
1346
1370
  {
1347
1371
  "aria-label": "Table of contents",
1348
1372
  size: "lg",
1349
1373
  variant: "ghost",
1350
1374
  onClick: () => t("toc"),
1351
- children: /* @__PURE__ */ e(mn, {})
1375
+ children: /* @__PURE__ */ e(Cn, {})
1352
1376
  }
1353
1377
  ),
1354
- Ge(r) && /* @__PURE__ */ e(
1355
- R,
1378
+ je(r) && /* @__PURE__ */ e(
1379
+ v,
1356
1380
  {
1357
1381
  "aria-label": "Search",
1358
1382
  size: "lg",
1359
1383
  variant: "ghost",
1360
1384
  onClick: () => t("search"),
1361
- children: /* @__PURE__ */ e(bn, {})
1385
+ children: /* @__PURE__ */ e(vn, {})
1362
1386
  }
1363
1387
  ),
1364
1388
  /* @__PURE__ */ e(
1365
- R,
1389
+ v,
1366
1390
  {
1367
1391
  "aria-label": "Zoom",
1368
1392
  size: "lg",
1369
- variant: g ? "solid" : "ghost",
1393
+ variant: p ? "solid" : "ghost",
1370
1394
  onClick: () => {
1371
- g ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1395
+ p ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1372
1396
  animate: !0,
1373
1397
  scale: 2
1374
1398
  });
1375
1399
  },
1376
- children: g ? /* @__PURE__ */ e(Sn, {}) : /* @__PURE__ */ e(Cn, {})
1400
+ children: p ? /* @__PURE__ */ e(xn, {}) : /* @__PURE__ */ e(kn, {})
1377
1401
  }
1378
1402
  ),
1379
1403
  /* @__PURE__ */ e(
1380
- R,
1404
+ v,
1381
1405
  {
1382
1406
  "aria-label": "font size",
1383
1407
  size: "lg",
@@ -1385,21 +1409,21 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1385
1409
  a(!0);
1386
1410
  },
1387
1411
  variant: "ghost",
1388
- children: /* @__PURE__ */ e(Nn, {})
1412
+ children: /* @__PURE__ */ e(Wn, {})
1389
1413
  }
1390
1414
  ),
1391
- se(r) && /* @__PURE__ */ e(
1392
- R,
1415
+ ce(r) && /* @__PURE__ */ e(
1416
+ v,
1393
1417
  {
1394
1418
  "aria-label": "Bookmarks",
1395
1419
  size: "lg",
1396
1420
  variant: "ghost",
1397
1421
  onClick: () => t("bookmarks"),
1398
- children: /* @__PURE__ */ e(Wn, {})
1422
+ children: /* @__PURE__ */ e(Hn, {})
1399
1423
  }
1400
1424
  ),
1401
- se(r) && /* @__PURE__ */ e(
1402
- R,
1425
+ ce(r) && /* @__PURE__ */ e(
1426
+ v,
1403
1427
  {
1404
1428
  "aria-label": "Annotations",
1405
1429
  size: "lg",
@@ -1408,8 +1432,8 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1408
1432
  children: /* @__PURE__ */ e(he, {})
1409
1433
  }
1410
1434
  ),
1411
- je(r) && /* @__PURE__ */ e(
1412
- R,
1435
+ Qe(r) && /* @__PURE__ */ e(
1436
+ v,
1413
1437
  {
1414
1438
  "aria-label": "Refit",
1415
1439
  size: "lg",
@@ -1418,11 +1442,11 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1418
1442
  l(!0);
1419
1443
  },
1420
1444
  disabled: !m,
1421
- children: /* @__PURE__ */ e(Hn, {})
1445
+ children: /* @__PURE__ */ e(Gn, {})
1422
1446
  }
1423
1447
  ),
1424
1448
  /* @__PURE__ */ e(
1425
- R,
1449
+ v,
1426
1450
  {
1427
1451
  "aria-label": "Thumbnails",
1428
1452
  size: "lg",
@@ -1433,17 +1457,17 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1433
1457
  scale: 0.5
1434
1458
  });
1435
1459
  },
1436
- children: /* @__PURE__ */ e(vn, {})
1460
+ children: /* @__PURE__ */ e(In, {})
1437
1461
  }
1438
1462
  ),
1439
- qe(r) && /* @__PURE__ */ e(
1440
- R,
1463
+ Ue(r) && /* @__PURE__ */ e(
1464
+ v,
1441
1465
  {
1442
1466
  "aria-label": "Gallery",
1443
1467
  size: "lg",
1444
1468
  variant: "ghost",
1445
1469
  onClick: () => t("gallery"),
1446
- children: /* @__PURE__ */ e(jn, {})
1470
+ children: /* @__PURE__ */ e(Un, {})
1447
1471
  }
1448
1472
  )
1449
1473
  ] }) })
@@ -1454,13 +1478,13 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1454
1478
  }
1455
1479
  );
1456
1480
  }
1457
- ), Xt = () => {
1458
- const [n, t] = y(!1), o = O(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1481
+ ), Kt = () => {
1482
+ const [n, t] = T(!1), o = z(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1459
1483
  t(!1);
1460
1484
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1461
1485
  t(!0);
1462
1486
  }), []);
1463
- return $(() => {
1487
+ return L(() => {
1464
1488
  function r() {
1465
1489
  t(!!document.fullscreenElement);
1466
1490
  }
@@ -1471,14 +1495,14 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1471
1495
  isFullscreen: n,
1472
1496
  onToggleFullscreenClick: o
1473
1497
  };
1474
- }, Kt = f(
1498
+ }, Jt = f(
1475
1499
  ({
1476
1500
  open: n,
1477
1501
  onItemClick: t
1478
1502
  }) => {
1479
- const o = C(), r = S(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = Xt();
1503
+ const o = b(), r = C(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = Kt();
1480
1504
  return /* @__PURE__ */ s(
1481
- Ye,
1505
+ Ke,
1482
1506
  {
1483
1507
  present: n,
1484
1508
  position: "top",
@@ -1486,18 +1510,18 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1486
1510
  justifyContent: "space-between",
1487
1511
  children: [
1488
1512
  /* @__PURE__ */ e(
1489
- R,
1513
+ v,
1490
1514
  {
1491
1515
  "aria-label": "left",
1492
1516
  size: "lg",
1493
1517
  variant: "ghost",
1494
1518
  flexShrink: 0,
1495
1519
  onClick: () => t("back"),
1496
- children: /* @__PURE__ */ e(Jn, {})
1520
+ children: /* @__PURE__ */ e(et, {})
1497
1521
  }
1498
1522
  ),
1499
1523
  /* @__PURE__ */ e(
1500
- z,
1524
+ R,
1501
1525
  {
1502
1526
  flex: 1,
1503
1527
  maxW: 600,
@@ -1505,30 +1529,30 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1505
1529
  alignItems: "center",
1506
1530
  overflow: "auto",
1507
1531
  px: 4,
1508
- children: /* @__PURE__ */ e(b, { truncate: !0, maxWidth: "100%", children: r?.title })
1532
+ children: /* @__PURE__ */ e(S, { truncate: !0, maxWidth: "100%", children: r?.title })
1509
1533
  }
1510
1534
  ),
1511
- /* @__PURE__ */ s(B, { children: [
1535
+ /* @__PURE__ */ s(F, { children: [
1512
1536
  /* @__PURE__ */ e(
1513
- R,
1537
+ v,
1514
1538
  {
1515
1539
  "aria-label": "right",
1516
1540
  size: "lg",
1517
1541
  flexShrink: 0,
1518
1542
  variant: "ghost",
1519
1543
  onClick: () => t("more"),
1520
- children: /* @__PURE__ */ e(et, {})
1544
+ children: /* @__PURE__ */ e(nt, {})
1521
1545
  }
1522
1546
  ),
1523
1547
  /* @__PURE__ */ e(
1524
- R,
1548
+ v,
1525
1549
  {
1526
1550
  "aria-label": "right",
1527
1551
  size: "lg",
1528
1552
  flexShrink: 0,
1529
1553
  variant: "ghost",
1530
1554
  onClick: a,
1531
- children: i ? /* @__PURE__ */ e(Gn, {}) : /* @__PURE__ */ e(qn, {})
1555
+ children: i ? /* @__PURE__ */ e(qn, {}) : /* @__PURE__ */ e(jn, {})
1532
1556
  }
1533
1557
  )
1534
1558
  ] })
@@ -1536,24 +1560,24 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1536
1560
  }
1537
1561
  );
1538
1562
  }
1539
- ), Jt = f(
1563
+ ), eo = f(
1540
1564
  ({
1541
1565
  onItemClick: n
1542
1566
  }) => {
1543
- const [t] = ze(), { refitMenuOpen: o, fontSizeMenuOpen: r } = _([
1567
+ const [t] = fe(), { refitMenuOpen: o, fontSizeMenuOpen: r } = A([
1544
1568
  "refitMenuOpen",
1545
1569
  "fontSizeMenuOpen"
1546
1570
  ]);
1547
- return /* @__PURE__ */ s(ce, { children: [
1571
+ return /* @__PURE__ */ s(de, { children: [
1548
1572
  /* @__PURE__ */ e(
1549
- Kt,
1573
+ Jt,
1550
1574
  {
1551
1575
  open: t && !o && !r,
1552
1576
  onItemClick: n
1553
1577
  }
1554
1578
  ),
1555
1579
  /* @__PURE__ */ e(
1556
- Zt,
1580
+ Xt,
1557
1581
  {
1558
1582
  open: t && !o && !r,
1559
1583
  onItemClick: n
@@ -1561,24 +1585,36 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1561
1585
  )
1562
1586
  ] });
1563
1587
  }
1564
- ), eo = E.forwardRef(
1588
+ ), no = () => {
1589
+ const [n, t] = fe(), o = b();
1590
+ H(() => o?.gestures.gestures$.pipe(
1591
+ se((r) => r.type === "tap" && !r.handled),
1592
+ ke(
1593
+ o.selection.selection$,
1594
+ o.selection.lastSelectionOnPointerdown$
1595
+ ),
1596
+ $e(([, r, i]) => {
1597
+ t(r || i ? !1 : (a) => !a);
1598
+ })
1599
+ ), [o]);
1600
+ }, to = E.forwardRef(
1565
1601
  function(t, o) {
1566
1602
  const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } = t;
1567
- return /* @__PURE__ */ s(te.Root, { ref: o, ...d, children: [
1568
- r && /* @__PURE__ */ s(te.Label, { children: [
1603
+ return /* @__PURE__ */ s(oe.Root, { ref: o, ...d, children: [
1604
+ r && /* @__PURE__ */ s(oe.Label, { children: [
1569
1605
  r,
1570
- /* @__PURE__ */ e(te.RequiredIndicator, { fallback: c })
1606
+ /* @__PURE__ */ e(oe.RequiredIndicator, { fallback: c })
1571
1607
  ] }),
1572
1608
  i,
1573
- a && /* @__PURE__ */ e(te.HelperText, { children: a }),
1574
- l && /* @__PURE__ */ e(te.ErrorText, { children: l })
1609
+ a && /* @__PURE__ */ e(oe.HelperText, { children: a }),
1610
+ l && /* @__PURE__ */ e(oe.ErrorText, { children: l })
1575
1611
  ] });
1576
1612
  }
1577
- ), no = f(() => {
1578
- const { refitMenuOpen: t, onRefitMenuOpenChange: o } = _([
1613
+ ), oo = f(() => {
1614
+ const { refitMenuOpen: t, onRefitMenuOpenChange: o } = A([
1579
1615
  "refitMenuOpen",
1580
1616
  "onRefitMenuOpenChange"
1581
- ]), r = C(), i = je(r) ? r : void 0, a = S(
1617
+ ]), r = b(), i = Qe(r) ? r : void 0, a = C(
1582
1618
  () => i?.refit.settings$,
1583
1619
  [i]
1584
1620
  );
@@ -1594,8 +1630,8 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1594
1630
  /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ s(V.Root, { children: [
1595
1631
  /* @__PURE__ */ e(V.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
1596
1632
  /* @__PURE__ */ s(V.Content, { children: [
1597
- /* @__PURE__ */ e(eo, { label: "Profile", children: /* @__PURE__ */ e(
1598
- Qe,
1633
+ /* @__PURE__ */ e(to, { label: "Profile", children: /* @__PURE__ */ e(
1634
+ Xe,
1599
1635
  {
1600
1636
  defaultValue: "fit",
1601
1637
  onValueChange: (l) => {
@@ -1606,7 +1642,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1606
1642
  });
1607
1643
  },
1608
1644
  value: a?.viewportFit ?? "fit",
1609
- children: /* @__PURE__ */ s(z, { gap: 2, children: [
1645
+ children: /* @__PURE__ */ s(R, { gap: 2, children: [
1610
1646
  /* @__PURE__ */ e(ie, { value: "desktop", children: "Desktop" }),
1611
1647
  /* @__PURE__ */ e(ie, { value: "tablet", children: "Tablet" }),
1612
1648
  /* @__PURE__ */ e(ie, { value: "fit", children: "Full width (default)" }),
@@ -1615,7 +1651,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1615
1651
  }
1616
1652
  ) }),
1617
1653
  /* @__PURE__ */ e(
1618
- Ie,
1654
+ ze,
1619
1655
  {
1620
1656
  label: "Maximum width (%)",
1621
1657
  showValue: !0,
@@ -1634,12 +1670,12 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1634
1670
  )
1635
1671
  ] })
1636
1672
  ] }) }),
1637
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Close" }) }) }),
1673
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Close" }) }) }),
1638
1674
  /* @__PURE__ */ e(q, {})
1639
1675
  ] })
1640
1676
  }
1641
1677
  );
1642
- }), to = f(
1678
+ }), ro = f(
1643
1679
  ({
1644
1680
  contextText: n = "",
1645
1681
  startOffset: t = 0,
@@ -1659,7 +1695,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1659
1695
  )
1660
1696
  );
1661
1697
  return /* @__PURE__ */ s(
1662
- ve,
1698
+ xe,
1663
1699
  {
1664
1700
  href: r,
1665
1701
  style: { margin: 5, overflow: "hidden" },
@@ -1671,30 +1707,30 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1671
1707
  alignItems: "flex-start",
1672
1708
  gap: 0,
1673
1709
  children: [
1674
- /* @__PURE__ */ s(b, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1710
+ /* @__PURE__ */ s(S, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1675
1711
  '"',
1676
1712
  c,
1677
1713
  /* @__PURE__ */ e("b", { children: o }),
1678
1714
  d,
1679
1715
  '"'
1680
1716
  ] }),
1681
- /* @__PURE__ */ e(b, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1717
+ /* @__PURE__ */ e(S, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1682
1718
  ]
1683
1719
  }
1684
1720
  );
1685
1721
  }
1686
- ), oo = 500, ro = () => {
1687
- const n = re(() => new An("")), t = S(n), o = C(), r = Ge(o) ? o : void 0, i = S(() => n.pipe(
1688
- _e(),
1689
- W(
1690
- (a) => a === "" || !r ? ge(void 0) : Ve(
1722
+ ), io = 500, ao = () => {
1723
+ const n = ue(() => new Bn("")), t = C(n), o = b(), r = je(o) ? o : void 0, i = C(() => n.pipe(
1724
+ De(),
1725
+ N(
1726
+ (a) => a === "" || !r ? ge(void 0) : Ne(
1691
1727
  ge({
1692
1728
  type: "start",
1693
1729
  data: void 0
1694
1730
  }),
1695
- Ne(oo).pipe(
1696
- W(() => r.search.search(a)),
1697
- D((l) => ({ type: "end", data: l }))
1731
+ We(io).pipe(
1732
+ N(() => r.search.search(a)),
1733
+ P((l) => ({ type: "end", data: l }))
1698
1734
  )
1699
1735
  )
1700
1736
  )
@@ -1705,22 +1741,22 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1705
1741
  status: i?.type ?? "idle",
1706
1742
  data: i?.data
1707
1743
  };
1708
- }, io = f(
1744
+ }, lo = f(
1709
1745
  ({ onNavigate: n }) => {
1710
- const t = C(), { value: o, setValue: r, status: i, data: a } = ro(), l = (u) => {
1746
+ const t = b(), { value: o, setValue: r, status: i, data: a } = ao(), l = (u) => {
1711
1747
  r(u.target.value);
1712
- }, c = O(
1748
+ }, c = z(
1713
1749
  (u) => {
1714
1750
  n(), t?.navigation.goToCfi(u);
1715
1751
  },
1716
1752
  [t, n]
1717
- ), d = S(
1753
+ ), d = C(
1718
1754
  () => t?.locateResource(a?.slice(0, 100) ?? []),
1719
1755
  [a]
1720
1756
  );
1721
- return /* @__PURE__ */ s(z, { flex: 1, height: "100%", gap: 2, children: [
1757
+ return /* @__PURE__ */ s(R, { flex: 1, height: "100%", gap: 2, children: [
1722
1758
  /* @__PURE__ */ e(
1723
- tn,
1759
+ an,
1724
1760
  {
1725
1761
  placeholder: "Type something...",
1726
1762
  value: o,
@@ -1735,22 +1771,22 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1735
1771
  }
1736
1772
  ),
1737
1773
  /* @__PURE__ */ s(
1738
- z,
1774
+ R,
1739
1775
  {
1740
1776
  style: { overflow: "hidden", overflowY: "auto" },
1741
1777
  overflow: "auto",
1742
1778
  px: 4,
1743
1779
  flex: 1,
1744
1780
  children: [
1745
- i === "start" && /* @__PURE__ */ e(b, { children: "Searching ..." }),
1746
- a?.length === 0 && /* @__PURE__ */ e(b, { children: "No results" }),
1747
- i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(z, { children: [
1748
- /* @__PURE__ */ s(b, { fontSize: "md", children: [
1781
+ i === "start" && /* @__PURE__ */ e(S, { children: "Searching ..." }),
1782
+ a?.length === 0 && /* @__PURE__ */ e(S, { children: "No results" }),
1783
+ i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(R, { children: [
1784
+ /* @__PURE__ */ s(S, { fontSize: "md", children: [
1749
1785
  a?.length,
1750
1786
  " result(s)"
1751
1787
  ] }),
1752
- /* @__PURE__ */ e(z, { gap: 0, children: d?.map((u, g) => /* @__PURE__ */ e(
1753
- to,
1788
+ /* @__PURE__ */ e(R, { gap: 0, children: d?.map((u, p) => /* @__PURE__ */ e(
1789
+ ro,
1754
1790
  {
1755
1791
  contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
1756
1792
  pageIndex: u.meta?.itemPageIndex,
@@ -1760,7 +1796,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1760
1796
  onClick: c,
1761
1797
  absolutePageIndex: u.meta?.absolutePageIndex
1762
1798
  },
1763
- g
1799
+ p
1764
1800
  )) })
1765
1801
  ] })
1766
1802
  ]
@@ -1768,7 +1804,7 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1768
1804
  )
1769
1805
  ] });
1770
1806
  }
1771
- ), ao = f(
1807
+ ), so = f(
1772
1808
  ({
1773
1809
  open: n,
1774
1810
  setOpen: t,
@@ -1784,43 +1820,43 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1784
1820
  scrollBehavior: "inside",
1785
1821
  children: /* @__PURE__ */ s(G, { height: "100%", children: [
1786
1822
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Search" }) }),
1787
- /* @__PURE__ */ e(Y, { flex: 1, p: 0, children: /* @__PURE__ */ e(io, { onNavigate: o }) }),
1788
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Cancel" }) }) }),
1823
+ /* @__PURE__ */ e(Y, { flex: 1, p: 0, children: /* @__PURE__ */ e(lo, { onNavigate: o }) }),
1824
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
1789
1825
  /* @__PURE__ */ e(q, {})
1790
1826
  ] })
1791
1827
  }
1792
1828
  )
1793
- ), lo = f(
1829
+ ), co = f(
1794
1830
  ({ onNavigate: n }) => {
1795
- const t = C(), { manifest: o, assumedRenditionLayout: r } = S(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = ne();
1831
+ const t = b(), { manifest: o, assumedRenditionLayout: r } = C(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = te();
1796
1832
  i?.toc;
1797
1833
  const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : l) || 0;
1798
1834
  let u = a?.beginChapterInfo;
1799
1835
  for (; u?.subChapter; )
1800
1836
  u = u?.subChapter;
1801
- const g = (h, m, v) => /* @__PURE__ */ s(on.Fragment, { children: [
1837
+ const p = (h, m, I) => /* @__PURE__ */ s(ln.Fragment, { children: [
1802
1838
  /* @__PURE__ */ e(
1803
- A.Item,
1839
+ B.Item,
1804
1840
  {
1805
- pl: 4 * (v + 1),
1841
+ pl: 4 * (I + 1),
1806
1842
  style: {
1807
1843
  display: "flex",
1808
1844
  alignItems: "center"
1809
1845
  },
1810
1846
  children: /* @__PURE__ */ s(
1811
- ve,
1847
+ xe,
1812
1848
  {
1813
1849
  onClick: () => {
1814
1850
  n(), t?.navigation.goToUrl(h.href);
1815
1851
  },
1816
1852
  href: "#",
1817
1853
  children: [
1818
- u?.path === h.path && /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(Me, {}) }),
1819
- u?.path !== h.path && /* @__PURE__ */ e(A.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(Me, {}) }),
1820
- /* @__PURE__ */ s(z, { gap: 0, children: [
1821
- /* @__PURE__ */ e(b, { fontSize: "md", children: h.title || h.path }),
1854
+ u?.path === h.path && /* @__PURE__ */ e(B.Indicator, { asChild: !0, children: /* @__PURE__ */ e(we, {}) }),
1855
+ u?.path !== h.path && /* @__PURE__ */ e(B.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(we, {}) }),
1856
+ /* @__PURE__ */ s(R, { gap: 0, children: [
1857
+ /* @__PURE__ */ e(S, { fontSize: "md", children: h.title || h.path }),
1822
1858
  u?.path === h.path && /* @__PURE__ */ e(
1823
- b,
1859
+ S,
1824
1860
  {
1825
1861
  fontStyle: "italic",
1826
1862
  fontWeight: "bold",
@@ -1834,13 +1870,13 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1834
1870
  )
1835
1871
  }
1836
1872
  ),
1837
- h.contents.length > 0 && /* @__PURE__ */ e(A.Root, { as: "div", gap: 2, children: h.contents.map(
1838
- (x, M) => g(x, M, v + 1)
1873
+ h.contents.length > 0 && /* @__PURE__ */ e(B.Root, { as: "div", gap: 2, children: h.contents.map(
1874
+ (x, D) => p(x, D, I + 1)
1839
1875
  ) })
1840
1876
  ] }, m);
1841
- return /* @__PURE__ */ e(A.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, m) => g(h, m, 0)) });
1877
+ return /* @__PURE__ */ e(B.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, m) => p(h, m, 0)) });
1842
1878
  }
1843
- ), so = f(
1879
+ ), uo = f(
1844
1880
  ({
1845
1881
  open: n,
1846
1882
  setOpen: t,
@@ -1856,93 +1892,106 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1856
1892
  scrollBehavior: "inside",
1857
1893
  children: /* @__PURE__ */ s(G, { children: [
1858
1894
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Table of Contents" }) }),
1859
- /* @__PURE__ */ e(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(lo, { onNavigate: o }) }),
1860
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(H, { variant: "outline", children: "Cancel" }) }) }),
1895
+ /* @__PURE__ */ e(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(co, { onNavigate: o }) }),
1896
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
1861
1897
  /* @__PURE__ */ e(q, {})
1862
1898
  ] })
1863
1899
  }
1864
1900
  )
1865
- ), Pe = 0.5, Ee = 1, Ae = 5, co = (n, t, o, r) => {
1901
+ ), ho = () => {
1902
+ const n = b(), { zoomMaxScale: t } = A(["zoomMaxScale"]);
1903
+ L(
1904
+ function() {
1905
+ n?.gestures.settings.update({
1906
+ zoomMaxScale: t ?? He
1907
+ });
1908
+ },
1909
+ [n, t]
1910
+ );
1911
+ }, Ee = 0.5, Ae = 1, go = (n, t, o, r) => {
1866
1912
  if (n > t && n < t + r)
1867
1913
  return t + r;
1868
1914
  const i = Math.min(Math.max(n, t), o), a = Math.round((i - t) / r) * r + t;
1869
1915
  return Math.round(a * 100) / 100;
1870
- }, uo = f(() => {
1871
- const { quickMenuBottomBarBoundingBoxSignal: n } = _([
1872
- "quickMenuBottomBarBoundingBoxSignal"
1873
- ]), t = ue(
1916
+ }, po = f(() => {
1917
+ const { quickMenuBottomBarBoundingBoxSignal: n, zoomMaxScale: t = He } = A([
1918
+ "quickMenuBottomBarBoundingBoxSignal",
1919
+ "zoomMaxScale"
1920
+ ]), o = Se(
1874
1921
  n
1875
- ), o = C(), r = S(
1876
- () => o?.zoom.state$.pipe(
1877
- D((c) => c.currentScale),
1878
- Le(100, Bn, {
1922
+ ), r = b(), i = C(
1923
+ () => r?.zoom.state$.pipe(
1924
+ P((d) => d.currentScale),
1925
+ Le(100, Fn, {
1879
1926
  leading: !0,
1880
1927
  trailing: !0
1881
1928
  })
1882
1929
  ),
1883
- [o]
1884
- ) ?? 1, i = S(
1885
- () => o?.zoom.state$.pipe(D((c) => c.isZooming)),
1886
- [o]
1887
- ) ?? !1, a = co(
1888
- r,
1889
- Ee,
1930
+ [r]
1931
+ ) ?? 1, a = C(
1932
+ () => r?.zoom.state$.pipe(P((d) => d.isZooming)),
1933
+ [r]
1934
+ ) ?? !1, l = go(
1935
+ i,
1890
1936
  Ae,
1891
- Pe
1892
- ), l = t?.borderBoxSize?.[0]?.blockSize ?? 1;
1937
+ t,
1938
+ Ee
1939
+ ), c = o?.borderBoxSize?.[0]?.blockSize ?? 1;
1893
1940
  return /* @__PURE__ */ e(
1894
1941
  ae,
1895
1942
  {
1896
- present: i && r > 1,
1943
+ present: a && i > 1,
1897
1944
  animationName: { _open: "fade-in", _closed: "fade-out" },
1898
1945
  animationDuration: "moderate",
1899
1946
  position: "absolute",
1900
- bottom: `calc(${l}px + var(--chakra-spacing-4))`,
1947
+ bottom: `calc(${c}px + var(--chakra-spacing-4))`,
1901
1948
  right: 4,
1902
1949
  backgroundColor: "bg.panel",
1903
1950
  shadow: "sm",
1904
1951
  borderRadius: "md",
1905
1952
  p: 4,
1906
1953
  children: /* @__PURE__ */ e(
1907
- Ie,
1954
+ ze,
1908
1955
  {
1909
- value: [a],
1910
- min: Ee,
1911
- max: Ae,
1912
- step: Pe,
1956
+ value: [l],
1957
+ min: Ae,
1958
+ max: t,
1959
+ step: Ee,
1913
1960
  minWidth: 200,
1914
- onValueChange: (c) => {
1915
- const d = c.value?.[0] ?? 1;
1916
- d === 1 ? o?.zoom.exit() : o?.zoom.scaleAt(d);
1961
+ onValueChange: (d) => {
1962
+ const u = d.value?.[0] ?? 1;
1963
+ u === 1 ? r?.zoom.exit() : r?.zoom.scaleAt(u, {
1964
+ constrain: "within-viewport"
1965
+ });
1917
1966
  }
1918
1967
  }
1919
1968
  )
1920
1969
  }
1921
1970
  );
1922
- }), Be = { _open: "fade-in", _closed: "fade-out" }, ho = f(() => (mt(), null)), po = f(() => (Lt(), $t(), /* @__PURE__ */ s(ce, { children: [
1923
- /* @__PURE__ */ e(zt, {}),
1924
- /* @__PURE__ */ e(ho, {})
1925
- ] }))), go = f(
1971
+ }), Be = { _open: "fade-in", _closed: "fade-out" }, fo = f(() => (mt(), null)), mo = f(() => (ho(), $t(), Vt(), no(), bt(), /* @__PURE__ */ s(de, { children: [
1972
+ /* @__PURE__ */ e(Ot, {}),
1973
+ /* @__PURE__ */ e(fo, {})
1974
+ ] }))), bo = f(
1926
1975
  ({
1927
1976
  children: n,
1928
1977
  ...t
1929
1978
  }) => {
1930
- const { enableFloatingTime: o, enableFloatingProgress: r, onItemClick: i } = _([
1979
+ const { enableFloatingTime: o, enableFloatingProgress: r, onItemClick: i } = A([
1931
1980
  "enableFloatingTime",
1932
1981
  "enableFloatingProgress",
1933
1982
  "onItemClick"
1934
- ]), [a, l] = y(!1), [c, d] = y(!1), [u, g] = y(!1), [h, m] = y(void 0), [v, x] = y(!1), [M, k] = ze(), I = O(() => {
1935
- l(!1), d(!1), g(!1), m(void 0), k(!1), x(!1);
1936
- }, [k]), L = O(
1937
- (p) => {
1938
- p === "annotations" ? m("annotations") : p === "search" ? g(!0) : p === "help" ? d(!0) : p === "toc" ? l(!0) : p === "bookmarks" ? m("bookmarks") : p === "gallery" && x(!0), i?.(p);
1983
+ ]), [a, l] = T(!1), [c, d] = T(!1), [u, p] = T(!1), [h, m] = T(void 0), [I, x] = T(!1), [D, k] = fe(), w = z(() => {
1984
+ l(!1), d(!1), p(!1), m(void 0), k(!1), x(!1);
1985
+ }, [k]), $ = z(
1986
+ (g) => {
1987
+ g === "annotations" ? m("annotations") : g === "search" ? p(!0) : g === "help" ? d(!0) : g === "toc" ? l(!0) : g === "bookmarks" ? m("bookmarks") : g === "gallery" && x(!0), i?.(g);
1939
1988
  },
1940
1989
  [i]
1941
1990
  );
1942
- return /* @__PURE__ */ s(ce, { children: [
1943
- /* @__PURE__ */ e(po, {}),
1991
+ return /* @__PURE__ */ s(de, { children: [
1992
+ /* @__PURE__ */ e(mo, {}),
1944
1993
  /* @__PURE__ */ s(
1945
- F,
1994
+ _,
1946
1995
  {
1947
1996
  position: "absolute",
1948
1997
  top: 0,
@@ -1957,72 +2006,72 @@ const Ht = le.Root, Gt = le.ValueText, Oe = () => {
1957
2006
  r && /* @__PURE__ */ e(
1958
2007
  ae,
1959
2008
  {
1960
- present: !M,
2009
+ present: !D,
1961
2010
  animationName: Be,
1962
2011
  animationDuration: "moderate",
1963
- children: /* @__PURE__ */ e(Bt, {})
2012
+ children: /* @__PURE__ */ e(Ft, {})
1964
2013
  }
1965
2014
  ),
1966
- /* @__PURE__ */ e(yt, { open: v, setOpen: x }),
1967
- /* @__PURE__ */ e(no, {}),
1968
- /* @__PURE__ */ e(Jt, { onItemClick: L }),
1969
- /* @__PURE__ */ e(uo, {}),
1970
- /* @__PURE__ */ e(Rt, {}),
1971
- /* @__PURE__ */ e(gt, {}),
1972
- /* @__PURE__ */ e(At, { open: c, setOpen: d }),
2015
+ /* @__PURE__ */ e(Pt, { open: I, setOpen: x }),
2016
+ /* @__PURE__ */ e(oo, {}),
2017
+ /* @__PURE__ */ e(eo, { onItemClick: $ }),
2018
+ /* @__PURE__ */ e(po, {}),
2019
+ /* @__PURE__ */ e(zt, {}),
2020
+ /* @__PURE__ */ e(ft, {}),
2021
+ /* @__PURE__ */ e(Bt, { open: c, setOpen: d }),
1973
2022
  /* @__PURE__ */ e(
1974
- so,
2023
+ uo,
1975
2024
  {
1976
2025
  open: a,
1977
2026
  setOpen: l,
1978
- onNavigate: I
2027
+ onNavigate: w
1979
2028
  }
1980
2029
  ),
1981
2030
  /* @__PURE__ */ e(
1982
- ao,
2031
+ so,
1983
2032
  {
1984
2033
  open: u,
1985
- setOpen: g,
1986
- onNavigate: I
2034
+ setOpen: p,
2035
+ onNavigate: w
1987
2036
  }
1988
2037
  ),
1989
2038
  /* @__PURE__ */ e(
1990
- ct,
2039
+ dt,
1991
2040
  {
1992
2041
  openWith: h,
1993
- setOpen: (p) => m(p ? "annotations" : void 0),
1994
- onNavigate: I
2042
+ setOpen: (g) => m(g ? "annotations" : void 0),
2043
+ onNavigate: w
1995
2044
  }
1996
2045
  ),
1997
2046
  /* @__PURE__ */ e(
1998
2047
  ae,
1999
2048
  {
2000
- present: o || M,
2049
+ present: o || D,
2001
2050
  animationName: Be,
2002
2051
  animationDuration: "slow",
2003
2052
  overflow: "hidden",
2004
- children: /* @__PURE__ */ e(_t, {})
2053
+ children: /* @__PURE__ */ e(Lt, {})
2005
2054
  }
2006
2055
  ),
2007
- /* @__PURE__ */ e(bt, {})
2056
+ /* @__PURE__ */ e(St, {})
2008
2057
  ]
2009
2058
  }
2010
2059
  )
2011
2060
  ] });
2012
2061
  }
2013
- ), Bo = f(
2062
+ ), Do = f(
2014
2063
  ({
2015
2064
  children: n,
2016
2065
  slots: t,
2017
2066
  ...o
2018
2067
  }) => {
2019
2068
  const { container: { props: r = {} } = {} } = t ?? {};
2020
- return /* @__PURE__ */ e(Ct, { ...o, children: /* @__PURE__ */ e(go, { ...r, children: n }) });
2069
+ return /* @__PURE__ */ e(vt, { ...o, children: /* @__PURE__ */ e(bo, { ...r, children: n }) });
2021
2070
  }
2022
2071
  );
2023
2072
  export {
2024
- nt as BOOKMARK_AREA_DATA_ATTRIBUTE,
2025
- go as InnerReactReader,
2026
- Bo as ReactReader
2073
+ tt as BOOKMARK_AREA_DATA_ATTRIBUTE,
2074
+ He as MAX_ZOOM_SCALE,
2075
+ Do as ReactReader
2027
2076
  };
2028
2077
  //# sourceMappingURL=index.js.map