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