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