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