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