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