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