@prose-reader/react-reader 1.249.0 → 1.251.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 +790 -724
- 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,122 +1,134 @@
|
|
|
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 te, 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 en, BehaviorSubject as nn } 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 tn, Toaster as on, Toast as $, Spinner as rn, Heading as ge, HStack as O, Kbd as Te, Popover as F, Progress as re, chakra as an, Collapsible as pe, Field as J, RadioGroup as ne, Slider as R, For as sn, Fieldset as fe, Input as ln } from "@chakra-ui/react";
|
|
7
|
+
import { LuX as cn, LuNotebookPen as de, LuBookmark as dn, LuArrowBigRight as un, LuArrowBigLeft as hn, LuChevronDown as gn, LuCircleHelp as pn, LuTableOfContents as fn, LuSearch as mn, LuZoomOut as bn, LuZoomIn as xn, LuGalleryHorizontal as vn, LuCircleCheck as we } from "react-icons/lu";
|
|
8
|
+
import { createPortal as Cn } from "react-dom";
|
|
9
|
+
import { isPositionInArea as kn } from "@prose-reader/enhancer-gestures";
|
|
10
|
+
import { isShallowEqual as Sn, observeIntersection as In, isHtmlTagElement as Rn } from "@prose-reader/core";
|
|
11
|
+
import { BsBookmarks as yn } from "react-icons/bs";
|
|
12
|
+
import { MdOutlineFitScreen as Tn, MdFullscreenExit as wn, MdFullscreen as Pn } from "react-icons/md";
|
|
13
|
+
import { RiGalleryView2 as Bn } from "react-icons/ri";
|
|
14
|
+
import { RxDoubleArrowUp as An, RxDoubleArrowLeft as zn, RxDoubleArrowDown as On, RxDoubleArrowRight as Mn } from "react-icons/rx";
|
|
15
|
+
import { HiOutlineInformationCircle as En } from "react-icons/hi";
|
|
16
|
+
import Dn from "rc-slider";
|
|
17
17
|
import "rc-slider/assets/index.css";
|
|
18
|
-
import { IoIosArrowBack as
|
|
19
|
-
const
|
|
18
|
+
import { IoIosArrowBack as Ln, IoMdMore as _n } from "react-icons/io";
|
|
19
|
+
const $n = "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
|
-
children:
|
|
27
|
-
reader:
|
|
27
|
+
children: n,
|
|
28
|
+
reader: t,
|
|
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:
|
|
44
|
-
reader:
|
|
48
|
+
quickMenuSignal: i,
|
|
49
|
+
reader: t,
|
|
45
50
|
notificationsSubject: a,
|
|
46
|
-
refitMenuSignal:
|
|
51
|
+
refitMenuSignal: c,
|
|
52
|
+
quickMenuBottomBarBoundingBox: l
|
|
47
53
|
}),
|
|
48
|
-
[
|
|
54
|
+
[
|
|
55
|
+
i,
|
|
56
|
+
t,
|
|
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: n });
|
|
56
68
|
}
|
|
57
|
-
),
|
|
58
|
-
return /* @__PURE__ */ e(
|
|
59
|
-
}),
|
|
69
|
+
), Fn = T.forwardRef(function(t, o) {
|
|
70
|
+
return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(cn, {}) });
|
|
71
|
+
}), G = T.forwardRef(function(t, 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
|
-
} =
|
|
67
|
-
return /* @__PURE__ */ s(ke, { disabled: !
|
|
68
|
-
l && /* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
78
|
+
} = t;
|
|
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(t, 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
|
+
...t,
|
|
79
91
|
asChild: !0,
|
|
80
|
-
children: /* @__PURE__ */ e(
|
|
92
|
+
children: /* @__PURE__ */ e(Fn, { size: "sm", ref: o, children: t.children })
|
|
81
93
|
}
|
|
82
94
|
);
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
const { reader:
|
|
90
|
-
return
|
|
91
|
-
}, Le = (
|
|
92
|
-
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 = () => {
|
|
101
|
+
const { reader: n } = E();
|
|
102
|
+
return n;
|
|
103
|
+
}, Le = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, ie = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, _e = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, $e = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, Wn = (n) => {
|
|
104
|
+
const t = m(), o = ie(t) ? t : void 0;
|
|
93
105
|
return { data: b(
|
|
94
106
|
() => o?.annotations.annotations$.pipe(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
_((i) => i.find((a) => a.id === n)),
|
|
108
|
+
le(Be),
|
|
109
|
+
W((i) => o.locateResource(i))
|
|
98
110
|
),
|
|
99
111
|
[o]
|
|
100
112
|
) };
|
|
101
113
|
}, Fe = ({
|
|
102
|
-
id:
|
|
103
|
-
onNavigate:
|
|
114
|
+
id: n,
|
|
115
|
+
onNavigate: t,
|
|
104
116
|
allowLeftIcon: o = !0
|
|
105
117
|
}) => {
|
|
106
|
-
const
|
|
107
|
-
return /* @__PURE__ */ e(
|
|
118
|
+
const r = m(), { data: i } = Wn(n), 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
|
-
|
|
124
|
+
t(), 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,162 +136,162 @@ 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
|
|
146
|
+
}, he = () => {
|
|
147
|
+
const n = m(), t = ie(n) ? n : void 0;
|
|
136
148
|
return { data: b(
|
|
137
|
-
() =>
|
|
138
|
-
|
|
139
|
-
(
|
|
149
|
+
() => t?.annotations.annotations$.pipe(
|
|
150
|
+
W(
|
|
151
|
+
(r) => t.locateResource(r)
|
|
140
152
|
)
|
|
141
153
|
),
|
|
142
|
-
[
|
|
154
|
+
[t]
|
|
143
155
|
) };
|
|
144
|
-
},
|
|
145
|
-
const { data:
|
|
156
|
+
}, Hn = () => {
|
|
157
|
+
const { data: n } = he();
|
|
146
158
|
return {
|
|
147
|
-
data:
|
|
159
|
+
data: n?.filter((t) => t.meta.isCfiRange)
|
|
148
160
|
};
|
|
149
|
-
},
|
|
150
|
-
const { data:
|
|
151
|
-
return /* @__PURE__ */ e(
|
|
161
|
+
}, Nn = ({ onNavigate: n }) => {
|
|
162
|
+
const { data: t } = Hn();
|
|
163
|
+
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
|
|
152
164
|
Fe,
|
|
153
165
|
{
|
|
154
166
|
id: o.resource.id,
|
|
155
|
-
onNavigate:
|
|
167
|
+
onNavigate: n
|
|
156
168
|
},
|
|
157
169
|
o.resource.id
|
|
158
170
|
)) });
|
|
159
|
-
},
|
|
160
|
-
const { data:
|
|
171
|
+
}, Vn = () => {
|
|
172
|
+
const { data: n } = he();
|
|
161
173
|
return {
|
|
162
|
-
data:
|
|
163
|
-
(
|
|
174
|
+
data: n?.filter(
|
|
175
|
+
(t) => !t.meta.isCfiRange && !t.resource.notes
|
|
164
176
|
)
|
|
165
177
|
};
|
|
166
|
-
},
|
|
167
|
-
const { data:
|
|
168
|
-
return /* @__PURE__ */ e(
|
|
178
|
+
}, Gn = ({ onNavigate: n }) => {
|
|
179
|
+
const { data: t } = Vn();
|
|
180
|
+
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
|
|
169
181
|
Fe,
|
|
170
182
|
{
|
|
171
183
|
id: o.resource.id,
|
|
172
|
-
onNavigate:
|
|
184
|
+
onNavigate: n,
|
|
173
185
|
allowLeftIcon: !1
|
|
174
186
|
},
|
|
175
187
|
o.resource.id
|
|
176
188
|
)) });
|
|
177
|
-
},
|
|
189
|
+
}, jn = f(
|
|
178
190
|
({
|
|
179
|
-
onNavigate:
|
|
180
|
-
defaultTab:
|
|
191
|
+
onNavigate: n,
|
|
192
|
+
defaultTab: t
|
|
181
193
|
}) => {
|
|
182
|
-
const [o,
|
|
194
|
+
const [o, r] = y(t ?? "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(dn, {}),
|
|
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(Gn, { onNavigate: n }) }),
|
|
213
|
+
/* @__PURE__ */ e(D.Content, { value: "annotations", children: /* @__PURE__ */ e(Nn, { onNavigate: n }) })
|
|
202
214
|
]
|
|
203
215
|
}
|
|
204
216
|
);
|
|
205
217
|
}
|
|
206
|
-
),
|
|
218
|
+
), qn = f(
|
|
207
219
|
({
|
|
208
|
-
openWith:
|
|
209
|
-
setOpen:
|
|
220
|
+
openWith: n,
|
|
221
|
+
setOpen: t,
|
|
210
222
|
onNavigate: o
|
|
211
223
|
}) => /* @__PURE__ */ e(
|
|
212
|
-
|
|
224
|
+
q,
|
|
213
225
|
{
|
|
214
226
|
lazyMount: !0,
|
|
215
227
|
placement: "center",
|
|
216
|
-
open: !!
|
|
217
|
-
onOpenChange: (
|
|
228
|
+
open: !!n,
|
|
229
|
+
onOpenChange: (r) => t(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
|
+
jn,
|
|
224
236
|
{
|
|
225
237
|
onNavigate: o,
|
|
226
|
-
defaultTab:
|
|
238
|
+
defaultTab: n
|
|
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
|
|
236
|
-
return o ? /* @__PURE__ */ e(
|
|
237
|
-
}),
|
|
238
|
-
absolutePageIndex:
|
|
239
|
-
itemIndex:
|
|
246
|
+
), Yn = f(({ children: n }) => {
|
|
247
|
+
const t = m(), o = b(() => t?.spine.element$, [t]);
|
|
248
|
+
return o ? /* @__PURE__ */ e(be, { children: Cn(n, o) }) : null;
|
|
249
|
+
}), Un = ({
|
|
250
|
+
absolutePageIndex: n,
|
|
251
|
+
itemIndex: t
|
|
240
252
|
}) => {
|
|
241
|
-
const o =
|
|
253
|
+
const o = m();
|
|
242
254
|
return {
|
|
243
|
-
spineItem: b(() => o ?
|
|
244
|
-
|
|
245
|
-
) :
|
|
255
|
+
spineItem: b(() => o ? t !== void 0 ? ce(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
|
|
256
|
+
_((i) => o.spine.spineItemsManager.get(i?.itemIndex))
|
|
257
|
+
) : ye : ye, [t, n, o])
|
|
246
258
|
};
|
|
247
|
-
},
|
|
248
|
-
absolutePageIndex:
|
|
249
|
-
itemIndex:
|
|
259
|
+
}, Zn = ({
|
|
260
|
+
absolutePageIndex: n,
|
|
261
|
+
itemIndex: t
|
|
250
262
|
}) => {
|
|
251
|
-
const { spineItem: o } =
|
|
252
|
-
() => o?.isReady$ ??
|
|
263
|
+
const { spineItem: o } = Un({ absolutePageIndex: n, itemIndex: t }), 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
|
+
}, Qn = f(
|
|
257
269
|
({
|
|
258
|
-
absolutePageIndex:
|
|
259
|
-
left:
|
|
270
|
+
absolutePageIndex: n,
|
|
271
|
+
left: t,
|
|
260
272
|
top: o,
|
|
261
|
-
width:
|
|
273
|
+
width: r
|
|
262
274
|
}) => {
|
|
263
|
-
const { isReady:
|
|
264
|
-
absolutePageIndex:
|
|
265
|
-
}), { data: a } =
|
|
266
|
-
(d) => d?.meta?.absolutePageIndex ===
|
|
275
|
+
const { isReady: i } = Zn({
|
|
276
|
+
absolutePageIndex: n
|
|
277
|
+
}), { data: a } = he(), l = a?.find(
|
|
278
|
+
(d) => d?.meta?.absolutePageIndex === n && 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": $n,
|
|
281
293
|
position: "absolute",
|
|
282
|
-
left:
|
|
294
|
+
left: t + 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
|
|
305
|
-
return /* @__PURE__ */ e(
|
|
306
|
-
({ absoluteLayout: { left: o, top:
|
|
307
|
-
|
|
315
|
+
), Kn = f(() => {
|
|
316
|
+
const n = m(), t = b(() => n?.layoutInfo$, [n]);
|
|
317
|
+
return /* @__PURE__ */ e(Yn, { children: t?.pages.map(
|
|
318
|
+
({ absoluteLayout: { left: o, top: r, width: i } }, a) => /* @__PURE__ */ e(
|
|
319
|
+
Qn,
|
|
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
|
|
319
|
-
return
|
|
320
|
-
},
|
|
321
|
-
const
|
|
322
|
-
|
|
329
|
+
}), Xn = () => {
|
|
330
|
+
const n = m();
|
|
331
|
+
return ie(n) ? n : void 0;
|
|
332
|
+
}, Jn = () => {
|
|
333
|
+
const n = Xn(), { data: t } = he();
|
|
334
|
+
H(() => n ? n.gestures.hooks.register(
|
|
323
335
|
"beforeTapGesture",
|
|
324
|
-
({ event$:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
if (!
|
|
336
|
+
({ event$: r }) => r.pipe(
|
|
337
|
+
Ze(n?.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 (kn(
|
|
335
347
|
d,
|
|
336
348
|
{
|
|
337
349
|
type: "corner",
|
|
@@ -341,37 +353,37 @@ const U = S.ActionTrigger, E = () => Ve(Be), f = () => {
|
|
|
341
353
|
},
|
|
342
354
|
u
|
|
343
355
|
)) {
|
|
344
|
-
const h =
|
|
356
|
+
const h = n.spine.pages.fromSpineItemPageIndex(
|
|
345
357
|
l,
|
|
346
358
|
c
|
|
347
359
|
);
|
|
348
360
|
if (!h) return !0;
|
|
349
|
-
const
|
|
350
|
-
(
|
|
361
|
+
const x = t?.find(
|
|
362
|
+
(I) => I?.meta?.absolutePageIndex === h.absolutePageIndex && I.meta.range === void 0
|
|
351
363
|
);
|
|
352
|
-
if (
|
|
353
|
-
return
|
|
364
|
+
if (x)
|
|
365
|
+
return n?.annotations.delete(x.resource.id), !1;
|
|
354
366
|
if (a?.[h.absolutePageIndex])
|
|
355
|
-
return
|
|
367
|
+
return n?.annotations.annotateAbsolutePage({
|
|
356
368
|
absolutePageIndex: h.absolutePageIndex
|
|
357
369
|
}), !1;
|
|
358
370
|
}
|
|
359
371
|
return !0;
|
|
360
372
|
})
|
|
361
373
|
)
|
|
362
|
-
) : void 0, [
|
|
363
|
-
}, me =
|
|
374
|
+
) : void 0, [n, t]);
|
|
375
|
+
}, me = tn({
|
|
364
376
|
placement: "bottom-end",
|
|
365
377
|
pauseOnPageIdle: !0
|
|
366
|
-
}),
|
|
367
|
-
|
|
378
|
+
}), et = () => /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(on, { toaster: me, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ s($.Root, { width: { md: "sm" }, children: [
|
|
379
|
+
n.type === "loading" ? /* @__PURE__ */ e(rn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e($.Indicator, {}),
|
|
368
380
|
/* @__PURE__ */ s(C, { gap: "1", flex: "1", maxWidth: "100%", children: [
|
|
369
|
-
|
|
370
|
-
|
|
381
|
+
n.title && /* @__PURE__ */ e($.Title, { children: n.title }),
|
|
382
|
+
n.description && /* @__PURE__ */ e($.Description, { children: n.description })
|
|
371
383
|
] }),
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
] }) }) }),
|
|
384
|
+
n.action && /* @__PURE__ */ e($.ActionTrigger, { children: n.action.label }),
|
|
385
|
+
n.meta?.closable && /* @__PURE__ */ e($.CloseTrigger, {})
|
|
386
|
+
] }) }) }), nt = {
|
|
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 [
|
|
396
|
+
function tt() {
|
|
397
|
+
const [n, t] = y(null), [o, r] = y(nt), 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
|
-
if (
|
|
396
|
-
return
|
|
397
|
-
|
|
407
|
+
if (n)
|
|
408
|
+
return i.observe(n), () => {
|
|
409
|
+
i.disconnect();
|
|
398
410
|
};
|
|
399
|
-
}, [
|
|
411
|
+
}, [n, i]), [t, o, n];
|
|
400
412
|
}
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
if (!
|
|
405
|
-
const a =
|
|
406
|
-
|
|
407
|
-
Ce(
|
|
408
|
-
), l =
|
|
409
|
-
|
|
410
|
-
).pipe(
|
|
413
|
+
const ot = (n, t, o) => {
|
|
414
|
+
const r = m(), i = _e(r) ? r : void 0;
|
|
415
|
+
N(() => {
|
|
416
|
+
if (!i || !n) return ve;
|
|
417
|
+
const a = t.layout.layout$.pipe(
|
|
418
|
+
Qe(t.layout.layoutInfo),
|
|
419
|
+
Ce(Sn)
|
|
420
|
+
), l = In(
|
|
421
|
+
n
|
|
422
|
+
).pipe(_((c) => c.some((d) => d.isIntersecting)));
|
|
411
423
|
return a.pipe(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
c || (
|
|
424
|
+
Ke(100, void 0, { trailing: !0 }),
|
|
425
|
+
W(() => l.pipe(
|
|
426
|
+
xe((c) => {
|
|
427
|
+
c || (n.innerHTML = "");
|
|
416
428
|
}),
|
|
417
|
-
|
|
418
|
-
|
|
429
|
+
le((c) => c),
|
|
430
|
+
ze()
|
|
419
431
|
).pipe(
|
|
420
|
-
|
|
421
|
-
n,
|
|
432
|
+
W(() => (n.innerHTML = "", i?.gallery.snapshot(
|
|
422
433
|
t,
|
|
434
|
+
n,
|
|
423
435
|
o
|
|
424
436
|
)))
|
|
425
437
|
))
|
|
426
438
|
);
|
|
427
|
-
}, [
|
|
428
|
-
},
|
|
429
|
-
({ item:
|
|
430
|
-
const [o,
|
|
431
|
-
|
|
439
|
+
}, [i, t, o, n]);
|
|
440
|
+
}, rt = f(
|
|
441
|
+
({ item: n, onNavigated: t }) => {
|
|
442
|
+
const [o, r, i] = tt(), a = m();
|
|
443
|
+
ot(i, n, r);
|
|
432
444
|
const l = b(
|
|
433
|
-
() => a?.locateResource(
|
|
434
|
-
[a,
|
|
445
|
+
() => a?.locateResource(n, { mode: "shallow" }),
|
|
446
|
+
[a, n]
|
|
435
447
|
);
|
|
436
448
|
return /* @__PURE__ */ s(
|
|
437
|
-
|
|
449
|
+
B,
|
|
438
450
|
{
|
|
439
451
|
width: "100%",
|
|
440
452
|
aspectRatio: "2/3",
|
|
@@ -446,11 +458,11 @@ const Xt = (t, n, o) => {
|
|
|
446
458
|
position: "relative",
|
|
447
459
|
overflow: "hidden",
|
|
448
460
|
onClick: () => {
|
|
449
|
-
|
|
461
|
+
t(), a?.navigation.goToSpineItem({ indexOrId: n });
|
|
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
|
-
),
|
|
484
|
-
({ open:
|
|
485
|
-
const o =
|
|
495
|
+
), it = f(
|
|
496
|
+
({ open: n, setOpen: t }) => {
|
|
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
|
-
open:
|
|
492
|
-
onOpenChange: (
|
|
503
|
+
open: n,
|
|
504
|
+
onOpenChange: (i) => t(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,38 +517,38 @@ 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
|
+
rt,
|
|
510
522
|
{
|
|
511
|
-
item:
|
|
523
|
+
item: i,
|
|
512
524
|
onNavigated: () => {
|
|
513
|
-
|
|
525
|
+
t(!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
|
-
),
|
|
527
|
-
({ open:
|
|
528
|
-
|
|
538
|
+
), at = "@prose-reader/react-reader", st = "1.250.0", lt = f(
|
|
539
|
+
({ open: n, setOpen: t }) => /* @__PURE__ */ e(
|
|
540
|
+
q,
|
|
529
541
|
{
|
|
530
542
|
lazyMount: !0,
|
|
531
543
|
placement: "center",
|
|
532
|
-
open:
|
|
533
|
-
onOpenChange: (o) =>
|
|
544
|
+
open: n,
|
|
545
|
+
onOpenChange: (o) => t(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,192 +557,170 @@ 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(un, {}) }),
|
|
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(hn, {}) }),
|
|
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
|
+
at,
|
|
568
580
|
" version: ",
|
|
569
|
-
|
|
581
|
+
st
|
|
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
|
|
592
|
+
), X = () => {
|
|
593
|
+
const n = m();
|
|
582
594
|
return b(
|
|
583
|
-
() =>
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
(
|
|
595
|
+
() => n ? Xe([n.pagination.state$, n.context]).pipe(
|
|
596
|
+
_(([t, o]) => {
|
|
597
|
+
const r = o.manifest?.spineItems.every(
|
|
598
|
+
(i) => i.mediaType?.startsWith("image/")
|
|
587
599
|
);
|
|
588
600
|
return {
|
|
589
|
-
...
|
|
590
|
-
hasChapters: !o.isFullyPrePaginated && !
|
|
601
|
+
...t,
|
|
602
|
+
hasChapters: !o.isFullyPrePaginated && !r
|
|
591
603
|
};
|
|
592
604
|
})
|
|
593
|
-
) :
|
|
594
|
-
[
|
|
605
|
+
) : ve,
|
|
606
|
+
[n]
|
|
595
607
|
);
|
|
596
|
-
},
|
|
597
|
-
const
|
|
598
|
-
(
|
|
599
|
-
), o =
|
|
600
|
-
return
|
|
608
|
+
}, ct = () => {
|
|
609
|
+
const n = X(), t = Math.floor(
|
|
610
|
+
(n?.percentageEstimateOfBook ?? 0) * 100
|
|
611
|
+
), o = t > 0 ? t : 1;
|
|
612
|
+
return n?.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 [
|
|
606
|
-
return
|
|
616
|
+
}, dt = () => {
|
|
617
|
+
const [n, t] = y(/* @__PURE__ */ new Date());
|
|
618
|
+
return H(() => {
|
|
607
619
|
const o = setInterval(() => {
|
|
608
|
-
|
|
620
|
+
t(/* @__PURE__ */ new Date());
|
|
609
621
|
}, 6e4);
|
|
610
622
|
return () => clearInterval(o);
|
|
611
|
-
}, []),
|
|
612
|
-
},
|
|
613
|
-
const
|
|
614
|
-
return /* @__PURE__ */ e(p, { fontSize: "xs", ...
|
|
623
|
+
}, []), n;
|
|
624
|
+
}, ut = (n) => {
|
|
625
|
+
const t = dt();
|
|
626
|
+
return /* @__PURE__ */ e(p, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
|
|
615
627
|
hour: "2-digit",
|
|
616
628
|
minute: "2-digit"
|
|
617
629
|
}) });
|
|
618
630
|
}, Ie = () => {
|
|
619
|
-
const { quickMenuSignal:
|
|
620
|
-
return [
|
|
621
|
-
},
|
|
622
|
-
const [
|
|
631
|
+
const { quickMenuSignal: n } = E();
|
|
632
|
+
return [ue(n), n.update, n];
|
|
633
|
+
}, ht = () => {
|
|
634
|
+
const [n] = 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
|
-
color:
|
|
631
|
-
children: /* @__PURE__ */ e(
|
|
642
|
+
color: n ? void 0 : "colorPalette.contrast",
|
|
643
|
+
children: /* @__PURE__ */ e(ut, {})
|
|
632
644
|
}
|
|
633
645
|
);
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
() =>
|
|
638
|
-
if (
|
|
639
|
-
if (!
|
|
640
|
-
const o = new URL(
|
|
646
|
+
}, gt = () => {
|
|
647
|
+
const n = m();
|
|
648
|
+
N(
|
|
649
|
+
() => n?.links$.subscribe((t) => {
|
|
650
|
+
if (t.type === "click" && Rn(t.target, "a")) {
|
|
651
|
+
if (!t.target.href) return;
|
|
652
|
+
const o = new URL(t.target.href);
|
|
641
653
|
window.location.host !== o.host && confirm(
|
|
642
654
|
"You are going to be redirected to external link"
|
|
643
|
-
) && window.open(
|
|
655
|
+
) && window.open(t.target.href, "__blank");
|
|
644
656
|
}
|
|
645
657
|
}),
|
|
646
|
-
[
|
|
647
|
-
);
|
|
648
|
-
}, dn = () => {
|
|
649
|
-
const t = f(), { notificationsSubject: n } = E();
|
|
650
|
-
D(
|
|
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]
|
|
658
|
+
[n]
|
|
669
659
|
);
|
|
670
|
-
},
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
() =>
|
|
674
|
-
|
|
660
|
+
}, pt = () => {
|
|
661
|
+
const n = m(), { notificationsSubject: t } = E();
|
|
662
|
+
N(
|
|
663
|
+
() => n?.settings.values$.pipe(
|
|
664
|
+
_(({ fontScale: o }) => o),
|
|
675
665
|
Ce(),
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
666
|
+
Oe(1),
|
|
667
|
+
xe((o) => {
|
|
668
|
+
t.next({
|
|
679
669
|
key: "fontScaleChange",
|
|
680
670
|
title: "Font size changed",
|
|
681
671
|
description: `${o * 100} %`
|
|
682
672
|
});
|
|
683
673
|
})
|
|
684
674
|
),
|
|
685
|
-
[
|
|
675
|
+
[n, t]
|
|
686
676
|
);
|
|
687
|
-
},
|
|
688
|
-
const { notificationsSubject:
|
|
689
|
-
|
|
690
|
-
() =>
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
const o =
|
|
694
|
-
title:
|
|
695
|
-
description:
|
|
677
|
+
}, ft = () => {
|
|
678
|
+
const { notificationsSubject: n } = E();
|
|
679
|
+
pt(), N(
|
|
680
|
+
() => n.pipe(
|
|
681
|
+
le(Be),
|
|
682
|
+
Je((t) => {
|
|
683
|
+
const o = t.duration ?? 3e3, r = me.create({
|
|
684
|
+
title: t.title,
|
|
685
|
+
description: t.description,
|
|
696
686
|
duration: o
|
|
697
|
-
}),
|
|
698
|
-
|
|
699
|
-
|
|
687
|
+
}), i = n.pipe(
|
|
688
|
+
Oe(1),
|
|
689
|
+
le((a) => !!t.key && a?.key === t.key)
|
|
700
690
|
);
|
|
701
|
-
return
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
691
|
+
return Me(
|
|
692
|
+
Ee(o),
|
|
693
|
+
t.abort ?? ve,
|
|
694
|
+
i
|
|
705
695
|
).pipe(
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
me.dismiss(
|
|
696
|
+
ze(),
|
|
697
|
+
en(() => {
|
|
698
|
+
me.dismiss(r);
|
|
709
699
|
})
|
|
710
700
|
);
|
|
711
701
|
})
|
|
712
702
|
),
|
|
713
|
-
[
|
|
703
|
+
[n]
|
|
714
704
|
);
|
|
715
|
-
},
|
|
716
|
-
function(
|
|
705
|
+
}, mt = T.forwardRef(
|
|
706
|
+
function(t, 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
|
+
} = t;
|
|
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,84 +738,84 @@ const Xt = (t, n, o) => {
|
|
|
748
738
|
}
|
|
749
739
|
);
|
|
750
740
|
}
|
|
751
|
-
),
|
|
752
|
-
const { children:
|
|
753
|
-
return /* @__PURE__ */ e(
|
|
754
|
-
|
|
741
|
+
), bt = T.forwardRef(function(t, o) {
|
|
742
|
+
const { children: r, ...i } = t;
|
|
743
|
+
return /* @__PURE__ */ e(mt, { 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(En, {})
|
|
761
751
|
}
|
|
762
752
|
) });
|
|
763
|
-
}),
|
|
764
|
-
return /* @__PURE__ */ e(
|
|
753
|
+
}), xt = T.forwardRef(function(t, o) {
|
|
754
|
+
return /* @__PURE__ */ e(re.Track, { ...t, ref: o, children: /* @__PURE__ */ e(re.Range, {}) });
|
|
765
755
|
});
|
|
766
|
-
|
|
767
|
-
const { children:
|
|
768
|
-
return /* @__PURE__ */ s(
|
|
769
|
-
|
|
770
|
-
|
|
756
|
+
T.forwardRef(function(t, o) {
|
|
757
|
+
const { children: r, info: i, ...a } = t;
|
|
758
|
+
return /* @__PURE__ */ s(re.Label, { ...a, ref: o, children: [
|
|
759
|
+
r,
|
|
760
|
+
i && /* @__PURE__ */ e(bt, { children: i })
|
|
771
761
|
] });
|
|
772
762
|
});
|
|
773
|
-
const
|
|
774
|
-
const
|
|
775
|
-
|
|
763
|
+
const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
764
|
+
const n = X(), 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, [l = 0, c = 0] = [
|
|
765
|
+
i,
|
|
776
766
|
a
|
|
777
|
-
].sort((g, h) => g - h), d =
|
|
767
|
+
].sort((g, h) => g - h), d = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, u = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
|
|
778
768
|
return {
|
|
779
|
-
hasOnlyOnePage:
|
|
780
|
-
beginPageIndex:
|
|
769
|
+
hasOnlyOnePage: t,
|
|
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
|
|
791
|
-
hasOnlyOnePage:
|
|
779
|
+
}, kt = () => {
|
|
780
|
+
const n = X(), {
|
|
781
|
+
hasOnlyOnePage: t,
|
|
792
782
|
leftPageIndex: o,
|
|
793
|
-
rightPageIndex:
|
|
794
|
-
totalApproximatePages:
|
|
783
|
+
rightPageIndex: r,
|
|
784
|
+
totalApproximatePages: i,
|
|
795
785
|
beginAndEndAreDifferent: a
|
|
796
|
-
} = Re(), l = Math.round((
|
|
786
|
+
} = Re(), l = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.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(vt, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(O, { justifyContent: "space-between", children: [
|
|
789
|
+
/* @__PURE__ */ e(xt, { width: 110 }),
|
|
790
|
+
/* @__PURE__ */ e(Ct, { children: `${l}%` })
|
|
801
791
|
] }) }),
|
|
802
792
|
/* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
|
|
803
|
-
!
|
|
804
|
-
/* @__PURE__ */ e(p, { fontSize: "xs", children: a ? `${o + 1} - ${
|
|
805
|
-
!!
|
|
793
|
+
!t && /* @__PURE__ */ s(O, { children: [
|
|
794
|
+
/* @__PURE__ */ e(p, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
|
|
795
|
+
!!n?.hasChapters && /* @__PURE__ */ s(be, { children: [
|
|
806
796
|
/* @__PURE__ */ e(p, { children: "-" }),
|
|
807
797
|
/* @__PURE__ */ s(p, { fontSize: "xs", children: [
|
|
808
798
|
"(",
|
|
809
|
-
(
|
|
799
|
+
(n?.beginAbsolutePageIndex ?? 0) + 1,
|
|
810
800
|
")"
|
|
811
801
|
] })
|
|
812
802
|
] })
|
|
813
803
|
] })
|
|
814
804
|
] });
|
|
815
|
-
}, We =
|
|
805
|
+
}, We = f(
|
|
816
806
|
({
|
|
817
|
-
children:
|
|
818
|
-
position:
|
|
807
|
+
children: n,
|
|
808
|
+
position: t,
|
|
819
809
|
...o
|
|
820
810
|
}) => /* @__PURE__ */ e(
|
|
821
|
-
|
|
811
|
+
oe,
|
|
822
812
|
{
|
|
823
813
|
display: "flex",
|
|
824
814
|
flexDirection: "row",
|
|
825
815
|
width: "100%",
|
|
826
816
|
position: "absolute",
|
|
827
|
-
...
|
|
828
|
-
animationName:
|
|
817
|
+
...t === "bottom" ? { bottom: 0 } : { top: 0 },
|
|
818
|
+
animationName: t === "bottom" ? {
|
|
829
819
|
_open: "slide-from-bottom, fade-in",
|
|
830
820
|
_closed: "slide-to-bottom, fade-out"
|
|
831
821
|
} : {
|
|
@@ -839,11 +829,11 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
839
829
|
shadow: "md",
|
|
840
830
|
p: 4,
|
|
841
831
|
...o,
|
|
842
|
-
children:
|
|
832
|
+
children: n
|
|
843
833
|
}
|
|
844
834
|
)
|
|
845
|
-
),
|
|
846
|
-
|
|
835
|
+
), St = an(Dn), It = f((n) => /* @__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
|
+
St,
|
|
856
846
|
{
|
|
857
847
|
keyboard: !1,
|
|
858
848
|
style: {
|
|
@@ -887,86 +877,96 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
887
877
|
height: "24px",
|
|
888
878
|
top: "50%",
|
|
889
879
|
borderColor: "var(--color-solid)",
|
|
890
|
-
transform: `translate(${
|
|
880
|
+
transform: `translate(${n.reverse ? "50%" : "-50%"}, -50%)`,
|
|
891
881
|
backgroundColor: "var(--bg)",
|
|
892
882
|
marginTop: "0px"
|
|
893
883
|
}
|
|
894
884
|
},
|
|
895
|
-
...
|
|
885
|
+
...n
|
|
896
886
|
}
|
|
897
887
|
)
|
|
898
888
|
}
|
|
899
|
-
)),
|
|
900
|
-
const
|
|
901
|
-
() =>
|
|
902
|
-
default:
|
|
889
|
+
)), Rt = () => {
|
|
890
|
+
const t = X()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Re(), i = t ? 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
|
-
|
|
896
|
+
t ? 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
|
|
918
|
-
(
|
|
919
|
-
const [
|
|
920
|
-
h.update(
|
|
921
|
-
const
|
|
922
|
-
u ?
|
|
923
|
-
pageIndex:
|
|
924
|
-
spineItemId:
|
|
906
|
+
}, yt = (n) => {
|
|
907
|
+
const t = m(), o = X(), { manifest: r } = b(() => t?.context, [t]) ?? {}, 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 } = Rt(), I = te(
|
|
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);
|
|
912
|
+
u ? t?.navigation.goToPageOfSpineItem({
|
|
913
|
+
pageIndex: ae,
|
|
914
|
+
spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
|
|
925
915
|
animation: !1
|
|
926
|
-
}) :
|
|
927
|
-
absolutePageIndex:
|
|
916
|
+
}) : t?.navigation.goToAbsolutePageIndex({
|
|
917
|
+
absolutePageIndex: ae,
|
|
928
918
|
animation: !1
|
|
929
919
|
});
|
|
930
920
|
},
|
|
931
|
-
[
|
|
921
|
+
[t, a, h, u]
|
|
932
922
|
);
|
|
933
|
-
return
|
|
934
|
-
() =>
|
|
923
|
+
return N(
|
|
924
|
+
() => t?.navigation.throttleLock({
|
|
935
925
|
duration: 100,
|
|
936
926
|
trigger: h.subject
|
|
937
927
|
}),
|
|
938
|
-
[
|
|
939
|
-
), l === 1 || a && l === 2 ? /* @__PURE__ */ e(
|
|
940
|
-
|
|
928
|
+
[t, h]
|
|
929
|
+
), l === 1 || a && l === 2 ? /* @__PURE__ */ e(B, { style: n.style }) : /* @__PURE__ */ e(
|
|
930
|
+
It,
|
|
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:
|
|
948
|
-
...
|
|
937
|
+
onChange: I,
|
|
938
|
+
...n
|
|
949
939
|
}
|
|
950
940
|
);
|
|
951
|
-
},
|
|
941
|
+
}, Tt = f(
|
|
952
942
|
({
|
|
953
|
-
open:
|
|
954
|
-
onItemClick:
|
|
943
|
+
open: n,
|
|
944
|
+
onItemClick: t
|
|
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
|
-
present:
|
|
959
|
+
present: n,
|
|
961
960
|
position: "bottom",
|
|
962
961
|
display: "flex",
|
|
963
962
|
flexDirection: "column",
|
|
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(An, {}) : /* @__PURE__ */ e(zn, {})
|
|
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(kt, {}),
|
|
1000
1000
|
/* @__PURE__ */ e(
|
|
1001
|
-
|
|
1001
|
+
yt,
|
|
1002
1002
|
{
|
|
1003
1003
|
style: {
|
|
1004
1004
|
width: "100%",
|
|
@@ -1011,102 +1011,118 @@ 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(On, {}) : /* @__PURE__ */ e(Mn, {})
|
|
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
|
+
gn,
|
|
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
|
-
onClick: () =>
|
|
1065
|
-
children: /* @__PURE__ */ e(
|
|
1064
|
+
onClick: () => t("help"),
|
|
1065
|
+
children: /* @__PURE__ */ e(pn, {})
|
|
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
|
-
onClick: () =>
|
|
1075
|
-
children: /* @__PURE__ */ e(
|
|
1074
|
+
onClick: () => t("toc"),
|
|
1075
|
+
children: /* @__PURE__ */ e(fn, {})
|
|
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
|
-
onClick: () =>
|
|
1085
|
-
children: /* @__PURE__ */ e(
|
|
1084
|
+
onClick: () => t("search"),
|
|
1085
|
+
children: /* @__PURE__ */ e(mn, {})
|
|
1086
|
+
}
|
|
1087
|
+
),
|
|
1088
|
+
/* @__PURE__ */ e(
|
|
1089
|
+
v,
|
|
1090
|
+
{
|
|
1091
|
+
"aria-label": "Zoom",
|
|
1092
|
+
size: "lg",
|
|
1093
|
+
variant: u ? "solid" : "ghost",
|
|
1094
|
+
disabled: !h,
|
|
1095
|
+
onClick: () => {
|
|
1096
|
+
u ? r?.zoom.exit() : r?.zoom.enter({
|
|
1097
|
+
animate: !1,
|
|
1098
|
+
scale: 2
|
|
1099
|
+
});
|
|
1100
|
+
},
|
|
1101
|
+
children: u ? /* @__PURE__ */ e(bn, {}) : /* @__PURE__ */ e(xn, {})
|
|
1086
1102
|
}
|
|
1087
1103
|
),
|
|
1088
|
-
|
|
1089
|
-
|
|
1104
|
+
ie(r) && /* @__PURE__ */ e(
|
|
1105
|
+
v,
|
|
1090
1106
|
{
|
|
1091
1107
|
"aria-label": "Bookmarks",
|
|
1092
1108
|
size: "lg",
|
|
1093
1109
|
variant: "ghost",
|
|
1094
|
-
onClick: () =>
|
|
1095
|
-
children: /* @__PURE__ */ e(
|
|
1110
|
+
onClick: () => t("bookmarks"),
|
|
1111
|
+
children: /* @__PURE__ */ e(yn, {})
|
|
1096
1112
|
}
|
|
1097
1113
|
),
|
|
1098
|
-
|
|
1099
|
-
|
|
1114
|
+
ie(r) && /* @__PURE__ */ e(
|
|
1115
|
+
v,
|
|
1100
1116
|
{
|
|
1101
1117
|
"aria-label": "Annotations",
|
|
1102
1118
|
size: "lg",
|
|
1103
1119
|
variant: "ghost",
|
|
1104
|
-
onClick: () =>
|
|
1105
|
-
children: /* @__PURE__ */ e(
|
|
1120
|
+
onClick: () => t("annotations"),
|
|
1121
|
+
children: /* @__PURE__ */ e(de, {})
|
|
1106
1122
|
}
|
|
1107
1123
|
),
|
|
1108
|
-
$e(
|
|
1109
|
-
|
|
1124
|
+
$e(r) && /* @__PURE__ */ e(
|
|
1125
|
+
v,
|
|
1110
1126
|
{
|
|
1111
1127
|
"aria-label": "Refit",
|
|
1112
1128
|
size: "lg",
|
|
@@ -1114,33 +1130,33 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
1114
1130
|
onClick: () => {
|
|
1115
1131
|
i.next(!0);
|
|
1116
1132
|
},
|
|
1117
|
-
disabled: !
|
|
1118
|
-
children: /* @__PURE__ */ e(
|
|
1133
|
+
disabled: !h,
|
|
1134
|
+
children: /* @__PURE__ */ e(Tn, {})
|
|
1119
1135
|
}
|
|
1120
1136
|
),
|
|
1121
1137
|
/* @__PURE__ */ e(
|
|
1122
|
-
|
|
1138
|
+
v,
|
|
1123
1139
|
{
|
|
1124
1140
|
"aria-label": "Thumbnails",
|
|
1125
1141
|
size: "lg",
|
|
1126
|
-
variant:
|
|
1142
|
+
variant: g ? "solid" : "ghost",
|
|
1127
1143
|
onClick: () => {
|
|
1128
|
-
|
|
1144
|
+
g ? r?.zoom.exit() : r?.zoom.enter({
|
|
1129
1145
|
animate: !0,
|
|
1130
1146
|
scale: 0.5
|
|
1131
1147
|
});
|
|
1132
1148
|
},
|
|
1133
|
-
children: /* @__PURE__ */ e(
|
|
1149
|
+
children: /* @__PURE__ */ e(vn, {})
|
|
1134
1150
|
}
|
|
1135
1151
|
),
|
|
1136
|
-
_e(
|
|
1137
|
-
|
|
1152
|
+
_e(r) && /* @__PURE__ */ e(
|
|
1153
|
+
v,
|
|
1138
1154
|
{
|
|
1139
1155
|
"aria-label": "Gallery",
|
|
1140
1156
|
size: "lg",
|
|
1141
1157
|
variant: "ghost",
|
|
1142
|
-
onClick: () =>
|
|
1143
|
-
children: /* @__PURE__ */ e(
|
|
1158
|
+
onClick: () => t("gallery"),
|
|
1159
|
+
children: /* @__PURE__ */ e(Bn, {})
|
|
1144
1160
|
}
|
|
1145
1161
|
)
|
|
1146
1162
|
] }) })
|
|
@@ -1151,46 +1167,46 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
1151
1167
|
}
|
|
1152
1168
|
);
|
|
1153
1169
|
}
|
|
1154
|
-
),
|
|
1155
|
-
const [
|
|
1156
|
-
|
|
1170
|
+
), wt = () => {
|
|
1171
|
+
const [n, t] = y(!1), o = te(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
1172
|
+
t(!1);
|
|
1157
1173
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
1158
|
-
|
|
1174
|
+
t(!0);
|
|
1159
1175
|
}), []);
|
|
1160
|
-
return
|
|
1161
|
-
function
|
|
1162
|
-
|
|
1176
|
+
return H(() => {
|
|
1177
|
+
function r() {
|
|
1178
|
+
t(!!document.fullscreenElement);
|
|
1163
1179
|
}
|
|
1164
|
-
return document.addEventListener("fullscreenchange",
|
|
1165
|
-
document.removeEventListener("fullscreenchange",
|
|
1180
|
+
return document.addEventListener("fullscreenchange", r), () => {
|
|
1181
|
+
document.removeEventListener("fullscreenchange", r);
|
|
1166
1182
|
};
|
|
1167
1183
|
}, []), {
|
|
1168
|
-
isFullscreen:
|
|
1184
|
+
isFullscreen: n,
|
|
1169
1185
|
onToggleFullscreenClick: o
|
|
1170
1186
|
};
|
|
1171
|
-
},
|
|
1187
|
+
}, Pt = f(
|
|
1172
1188
|
({
|
|
1173
|
-
open:
|
|
1174
|
-
onItemClick:
|
|
1189
|
+
open: n,
|
|
1190
|
+
onItemClick: t
|
|
1175
1191
|
}) => {
|
|
1176
|
-
const o =
|
|
1192
|
+
const o = m(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = wt();
|
|
1177
1193
|
return /* @__PURE__ */ s(
|
|
1178
1194
|
We,
|
|
1179
1195
|
{
|
|
1180
|
-
present:
|
|
1196
|
+
present: n,
|
|
1181
1197
|
position: "top",
|
|
1182
1198
|
height: "80px",
|
|
1183
1199
|
justifyContent: "space-between",
|
|
1184
1200
|
children: [
|
|
1185
1201
|
/* @__PURE__ */ e(
|
|
1186
|
-
|
|
1202
|
+
v,
|
|
1187
1203
|
{
|
|
1188
1204
|
"aria-label": "left",
|
|
1189
1205
|
size: "lg",
|
|
1190
1206
|
variant: "ghost",
|
|
1191
1207
|
flexShrink: 0,
|
|
1192
|
-
onClick: () =>
|
|
1193
|
-
children: /* @__PURE__ */ e(
|
|
1208
|
+
onClick: () => t("back"),
|
|
1209
|
+
children: /* @__PURE__ */ e(Ln, {})
|
|
1194
1210
|
}
|
|
1195
1211
|
),
|
|
1196
1212
|
/* @__PURE__ */ e(
|
|
@@ -1202,30 +1218,30 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
1202
1218
|
alignItems: "center",
|
|
1203
1219
|
overflow: "auto",
|
|
1204
1220
|
px: 4,
|
|
1205
|
-
children: /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", children:
|
|
1221
|
+
children: /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", children: r?.title })
|
|
1206
1222
|
}
|
|
1207
1223
|
),
|
|
1208
|
-
/* @__PURE__ */ s(
|
|
1224
|
+
/* @__PURE__ */ s(O, { children: [
|
|
1209
1225
|
/* @__PURE__ */ e(
|
|
1210
|
-
|
|
1226
|
+
v,
|
|
1211
1227
|
{
|
|
1212
1228
|
"aria-label": "right",
|
|
1213
1229
|
size: "lg",
|
|
1214
1230
|
flexShrink: 0,
|
|
1215
1231
|
variant: "ghost",
|
|
1216
|
-
onClick: () =>
|
|
1217
|
-
children: /* @__PURE__ */ e(
|
|
1232
|
+
onClick: () => t("more"),
|
|
1233
|
+
children: /* @__PURE__ */ e(_n, {})
|
|
1218
1234
|
}
|
|
1219
1235
|
),
|
|
1220
1236
|
/* @__PURE__ */ e(
|
|
1221
|
-
|
|
1237
|
+
v,
|
|
1222
1238
|
{
|
|
1223
1239
|
"aria-label": "right",
|
|
1224
1240
|
size: "lg",
|
|
1225
1241
|
flexShrink: 0,
|
|
1226
1242
|
variant: "ghost",
|
|
1227
1243
|
onClick: a,
|
|
1228
|
-
children:
|
|
1244
|
+
children: i ? /* @__PURE__ */ e(wn, {}) : /* @__PURE__ */ e(Pn, {})
|
|
1229
1245
|
}
|
|
1230
1246
|
)
|
|
1231
1247
|
] })
|
|
@@ -1233,115 +1249,115 @@ const mn = ee.Root, bn = ee.ValueText, Re = () => {
|
|
|
1233
1249
|
}
|
|
1234
1250
|
);
|
|
1235
1251
|
}
|
|
1236
|
-
),
|
|
1252
|
+
), Bt = f(
|
|
1237
1253
|
({
|
|
1238
|
-
onItemClick:
|
|
1254
|
+
onItemClick: n
|
|
1239
1255
|
}) => {
|
|
1240
|
-
const [
|
|
1241
|
-
return /* @__PURE__ */ s(
|
|
1242
|
-
/* @__PURE__ */ e(
|
|
1256
|
+
const [t] = Ie(), { refitMenuSignal: o } = E(), r = ue(o);
|
|
1257
|
+
return /* @__PURE__ */ s(be, { children: [
|
|
1258
|
+
/* @__PURE__ */ e(Pt, { open: t && !r, onItemClick: n }),
|
|
1243
1259
|
/* @__PURE__ */ e(
|
|
1244
|
-
|
|
1260
|
+
Tt,
|
|
1245
1261
|
{
|
|
1246
|
-
open:
|
|
1247
|
-
onItemClick:
|
|
1262
|
+
open: t && !r,
|
|
1263
|
+
onItemClick: n
|
|
1248
1264
|
}
|
|
1249
1265
|
)
|
|
1250
1266
|
] });
|
|
1251
1267
|
}
|
|
1252
|
-
),
|
|
1253
|
-
function(
|
|
1254
|
-
const { label:
|
|
1255
|
-
return /* @__PURE__ */ s(
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
/* @__PURE__ */ e(
|
|
1268
|
+
), At = T.forwardRef(
|
|
1269
|
+
function(t, o) {
|
|
1270
|
+
const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } = t;
|
|
1271
|
+
return /* @__PURE__ */ s(J.Root, { ref: o, ...d, children: [
|
|
1272
|
+
r && /* @__PURE__ */ s(J.Label, { children: [
|
|
1273
|
+
r,
|
|
1274
|
+
/* @__PURE__ */ e(J.RequiredIndicator, { fallback: c })
|
|
1259
1275
|
] }),
|
|
1260
|
-
|
|
1261
|
-
a && /* @__PURE__ */ e(
|
|
1262
|
-
l && /* @__PURE__ */ e(
|
|
1276
|
+
i,
|
|
1277
|
+
a && /* @__PURE__ */ e(J.HelperText, { children: a }),
|
|
1278
|
+
l && /* @__PURE__ */ e(J.ErrorText, { children: l })
|
|
1263
1279
|
] });
|
|
1264
1280
|
}
|
|
1265
|
-
),
|
|
1266
|
-
function(
|
|
1267
|
-
const { children:
|
|
1268
|
-
return /* @__PURE__ */ s(
|
|
1269
|
-
/* @__PURE__ */ e(
|
|
1270
|
-
/* @__PURE__ */ e(
|
|
1271
|
-
|
|
1281
|
+
), se = T.forwardRef(
|
|
1282
|
+
function(t, o) {
|
|
1283
|
+
const { children: r, inputProps: i, rootRef: a, ...l } = t;
|
|
1284
|
+
return /* @__PURE__ */ s(ne.Item, { ref: a, ...l, children: [
|
|
1285
|
+
/* @__PURE__ */ e(ne.ItemHiddenInput, { ref: o, ...i }),
|
|
1286
|
+
/* @__PURE__ */ e(ne.ItemIndicator, {}),
|
|
1287
|
+
r && /* @__PURE__ */ e(ne.ItemText, { children: r })
|
|
1272
1288
|
] });
|
|
1273
1289
|
}
|
|
1274
|
-
),
|
|
1275
|
-
function(
|
|
1276
|
-
const { marks:
|
|
1277
|
-
return /* @__PURE__ */ s(
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
/* @__PURE__ */ e(
|
|
1281
|
-
/* @__PURE__ */ e(
|
|
1290
|
+
), zt = ne.Root, He = T.forwardRef(
|
|
1291
|
+
function(t, o) {
|
|
1292
|
+
const { marks: r, label: i, showValue: a, ...l } = t, c = t.defaultValue ?? t.value, d = r?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), u = !!d?.some((g) => g.label);
|
|
1293
|
+
return /* @__PURE__ */ s(R.Root, { ref: o, thumbAlignment: "center", ...l, children: [
|
|
1294
|
+
i && !a && /* @__PURE__ */ e(R.Label, { children: i }),
|
|
1295
|
+
i && a && /* @__PURE__ */ s(O, { justify: "space-between", children: [
|
|
1296
|
+
/* @__PURE__ */ e(R.Label, { children: i }),
|
|
1297
|
+
/* @__PURE__ */ e(R.ValueText, {})
|
|
1282
1298
|
] }),
|
|
1283
|
-
/* @__PURE__ */ s(
|
|
1284
|
-
/* @__PURE__ */ e(
|
|
1285
|
-
/* @__PURE__ */ e(
|
|
1286
|
-
/* @__PURE__ */ e(
|
|
1299
|
+
/* @__PURE__ */ s(R.Control, { "data-has-mark-label": u || void 0, children: [
|
|
1300
|
+
/* @__PURE__ */ e(R.Track, { children: /* @__PURE__ */ e(R.Range, {}) }),
|
|
1301
|
+
/* @__PURE__ */ e(Ot, { value: c }),
|
|
1302
|
+
/* @__PURE__ */ e(Mt, { marks: d })
|
|
1287
1303
|
] })
|
|
1288
1304
|
] });
|
|
1289
1305
|
}
|
|
1290
1306
|
);
|
|
1291
|
-
function
|
|
1292
|
-
const { value:
|
|
1293
|
-
return /* @__PURE__ */ e(
|
|
1307
|
+
function Ot(n) {
|
|
1308
|
+
const { value: t } = n;
|
|
1309
|
+
return /* @__PURE__ */ e(sn, { each: t, children: (o, r) => /* @__PURE__ */ e(R.Thumb, { index: r, children: /* @__PURE__ */ e(R.HiddenInput, {}) }, r) });
|
|
1294
1310
|
}
|
|
1295
|
-
const
|
|
1296
|
-
function(
|
|
1297
|
-
const { marks:
|
|
1298
|
-
return
|
|
1299
|
-
const l = typeof
|
|
1300
|
-
return /* @__PURE__ */ s(
|
|
1301
|
-
/* @__PURE__ */ e(
|
|
1311
|
+
const Mt = T.forwardRef(
|
|
1312
|
+
function(t, o) {
|
|
1313
|
+
const { marks: r } = t;
|
|
1314
|
+
return r?.length ? /* @__PURE__ */ e(R.MarkerGroup, { ref: o, children: r.map((i, a) => {
|
|
1315
|
+
const l = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
|
|
1316
|
+
return /* @__PURE__ */ s(R.Marker, { value: l, children: [
|
|
1317
|
+
/* @__PURE__ */ e(R.MarkerIndicator, {}),
|
|
1302
1318
|
c
|
|
1303
1319
|
] }, a);
|
|
1304
1320
|
}) }) : null;
|
|
1305
1321
|
}
|
|
1306
|
-
),
|
|
1307
|
-
const { refitMenuSignal:
|
|
1308
|
-
() =>
|
|
1309
|
-
[
|
|
1322
|
+
), Et = f(() => {
|
|
1323
|
+
const { refitMenuSignal: t } = E(), o = ue(t), r = m(), i = $e(r) ? r : void 0, a = b(
|
|
1324
|
+
() => i?.refit.settings$,
|
|
1325
|
+
[i]
|
|
1310
1326
|
);
|
|
1311
1327
|
return /* @__PURE__ */ e(
|
|
1312
|
-
|
|
1328
|
+
q,
|
|
1313
1329
|
{
|
|
1314
1330
|
lazyMount: !0,
|
|
1315
1331
|
open: o,
|
|
1316
|
-
onOpenChange: (l) =>
|
|
1332
|
+
onOpenChange: (l) => t.next(l.open),
|
|
1317
1333
|
placement: "center",
|
|
1318
|
-
children: /* @__PURE__ */ s(
|
|
1319
|
-
/* @__PURE__ */ e(
|
|
1320
|
-
/* @__PURE__ */ e(
|
|
1321
|
-
/* @__PURE__ */ e(
|
|
1322
|
-
/* @__PURE__ */ s(
|
|
1323
|
-
/* @__PURE__ */ e(
|
|
1324
|
-
|
|
1334
|
+
children: /* @__PURE__ */ s(G, { children: [
|
|
1335
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Viewport fit" }) }),
|
|
1336
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ s(fe.Root, { children: [
|
|
1337
|
+
/* @__PURE__ */ e(fe.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
|
|
1338
|
+
/* @__PURE__ */ s(fe.Content, { children: [
|
|
1339
|
+
/* @__PURE__ */ e(At, { label: "Profile", children: /* @__PURE__ */ e(
|
|
1340
|
+
zt,
|
|
1325
1341
|
{
|
|
1326
1342
|
defaultValue: "fit",
|
|
1327
1343
|
onValueChange: (l) => {
|
|
1328
1344
|
const c = l.value;
|
|
1329
|
-
|
|
1345
|
+
i?.refit.update({
|
|
1330
1346
|
viewportFit: c,
|
|
1331
1347
|
customWidth: 60
|
|
1332
1348
|
});
|
|
1333
1349
|
},
|
|
1334
1350
|
value: a?.viewportFit ?? "fit",
|
|
1335
1351
|
children: /* @__PURE__ */ s(C, { gap: 2, children: [
|
|
1336
|
-
/* @__PURE__ */ e(
|
|
1337
|
-
/* @__PURE__ */ e(
|
|
1338
|
-
/* @__PURE__ */ e(
|
|
1339
|
-
/* @__PURE__ */ e(
|
|
1352
|
+
/* @__PURE__ */ e(se, { value: "desktop", children: "Desktop" }),
|
|
1353
|
+
/* @__PURE__ */ e(se, { value: "tablet", children: "Tablet" }),
|
|
1354
|
+
/* @__PURE__ */ e(se, { value: "fit", children: "Full width (default)" }),
|
|
1355
|
+
/* @__PURE__ */ e(se, { value: "custom", children: "Custom" })
|
|
1340
1356
|
] })
|
|
1341
1357
|
}
|
|
1342
1358
|
) }),
|
|
1343
1359
|
/* @__PURE__ */ e(
|
|
1344
|
-
|
|
1360
|
+
He,
|
|
1345
1361
|
{
|
|
1346
1362
|
label: "Maximum width (%)",
|
|
1347
1363
|
showValue: !0,
|
|
@@ -1352,7 +1368,7 @@ const En = y.forwardRef(
|
|
|
1352
1368
|
value: [a?.customWidth ?? 60],
|
|
1353
1369
|
onValueChange: (l) => {
|
|
1354
1370
|
const c = l.value[0] ?? 0;
|
|
1355
|
-
|
|
1371
|
+
i?.refit.update({
|
|
1356
1372
|
customWidth: c
|
|
1357
1373
|
});
|
|
1358
1374
|
}
|
|
@@ -1360,37 +1376,37 @@ const En = y.forwardRef(
|
|
|
1360
1376
|
)
|
|
1361
1377
|
] })
|
|
1362
1378
|
] }) }),
|
|
1363
|
-
/* @__PURE__ */ e(
|
|
1364
|
-
/* @__PURE__ */ e(
|
|
1379
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Close" }) }) }),
|
|
1380
|
+
/* @__PURE__ */ e(j, {})
|
|
1365
1381
|
] })
|
|
1366
1382
|
}
|
|
1367
1383
|
);
|
|
1368
|
-
}),
|
|
1384
|
+
}), Dt = f(
|
|
1369
1385
|
({
|
|
1370
|
-
contextText:
|
|
1371
|
-
startOffset:
|
|
1386
|
+
contextText: n = "",
|
|
1387
|
+
startOffset: t = 0,
|
|
1372
1388
|
text: o,
|
|
1373
|
-
cfi:
|
|
1374
|
-
onClick:
|
|
1389
|
+
cfi: r = "#",
|
|
1390
|
+
onClick: i,
|
|
1375
1391
|
absolutePageIndex: a
|
|
1376
1392
|
}) => {
|
|
1377
|
-
const c =
|
|
1378
|
-
Math.max(
|
|
1379
|
-
Math.max(
|
|
1380
|
-
), d =
|
|
1381
|
-
Math.min(
|
|
1393
|
+
const c = n.substring(
|
|
1394
|
+
Math.max(t - 15, 0),
|
|
1395
|
+
Math.max(t, 0)
|
|
1396
|
+
), d = n.substring(
|
|
1397
|
+
Math.min(t + o.length, n.length - 1),
|
|
1382
1398
|
Math.min(
|
|
1383
|
-
|
|
1384
|
-
|
|
1399
|
+
t + o.length + 15,
|
|
1400
|
+
n.length - 1
|
|
1385
1401
|
)
|
|
1386
1402
|
);
|
|
1387
1403
|
return /* @__PURE__ */ s(
|
|
1388
1404
|
Se,
|
|
1389
1405
|
{
|
|
1390
|
-
href:
|
|
1406
|
+
href: r,
|
|
1391
1407
|
style: { margin: 5, overflow: "hidden" },
|
|
1392
1408
|
onClick: (u) => {
|
|
1393
|
-
u.preventDefault(), r
|
|
1409
|
+
u.preventDefault(), i(r);
|
|
1394
1410
|
},
|
|
1395
1411
|
display: "flex",
|
|
1396
1412
|
flexDirection: "column",
|
|
@@ -1409,44 +1425,44 @@ const En = y.forwardRef(
|
|
|
1409
1425
|
}
|
|
1410
1426
|
);
|
|
1411
1427
|
}
|
|
1412
|
-
),
|
|
1413
|
-
const
|
|
1428
|
+
), Lt = 500, _t = () => {
|
|
1429
|
+
const n = ee(() => new nn("")), t = b(n), o = m(), r = Le(o) ? o : void 0, i = b(() => n.pipe(
|
|
1414
1430
|
Ce(),
|
|
1415
|
-
|
|
1416
|
-
(a) => a === "" || !
|
|
1417
|
-
|
|
1431
|
+
W(
|
|
1432
|
+
(a) => a === "" || !r ? ce(void 0) : Me(
|
|
1433
|
+
ce({
|
|
1418
1434
|
type: "start",
|
|
1419
1435
|
data: void 0
|
|
1420
1436
|
}),
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1437
|
+
Ee(Lt).pipe(
|
|
1438
|
+
W(() => r.search.search(a)),
|
|
1439
|
+
_((l) => ({ type: "end", data: l }))
|
|
1424
1440
|
)
|
|
1425
1441
|
)
|
|
1426
1442
|
)
|
|
1427
|
-
), [
|
|
1443
|
+
), [r, n]);
|
|
1428
1444
|
return {
|
|
1429
|
-
value:
|
|
1430
|
-
setValue:
|
|
1431
|
-
status:
|
|
1432
|
-
data:
|
|
1445
|
+
value: t,
|
|
1446
|
+
setValue: n.next.bind(n),
|
|
1447
|
+
status: i?.type ?? "idle",
|
|
1448
|
+
data: i?.data
|
|
1433
1449
|
};
|
|
1434
|
-
},
|
|
1435
|
-
({ onNavigate:
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1438
|
-
}, c =
|
|
1450
|
+
}, $t = f(
|
|
1451
|
+
({ onNavigate: n }) => {
|
|
1452
|
+
const t = m(), { value: o, setValue: r, status: i, data: a } = _t(), l = (u) => {
|
|
1453
|
+
r(u.target.value);
|
|
1454
|
+
}, c = te(
|
|
1439
1455
|
(u) => {
|
|
1440
|
-
|
|
1456
|
+
n(), t?.navigation.goToCfi(u);
|
|
1441
1457
|
},
|
|
1442
|
-
[
|
|
1458
|
+
[t, n]
|
|
1443
1459
|
), d = b(
|
|
1444
|
-
() =>
|
|
1460
|
+
() => t?.locateResource(a?.slice(0, 100) ?? []),
|
|
1445
1461
|
[a]
|
|
1446
1462
|
);
|
|
1447
1463
|
return /* @__PURE__ */ s(C, { flex: 1, height: "100%", gap: 2, children: [
|
|
1448
1464
|
/* @__PURE__ */ e(
|
|
1449
|
-
|
|
1465
|
+
ln,
|
|
1450
1466
|
{
|
|
1451
1467
|
placeholder: "Type something...",
|
|
1452
1468
|
value: o,
|
|
@@ -1468,15 +1484,15 @@ const En = y.forwardRef(
|
|
|
1468
1484
|
px: 4,
|
|
1469
1485
|
flex: 1,
|
|
1470
1486
|
children: [
|
|
1471
|
-
|
|
1487
|
+
i === "start" && /* @__PURE__ */ e(p, { children: "Searching ..." }),
|
|
1472
1488
|
a?.length === 0 && /* @__PURE__ */ e(p, { children: "No results" }),
|
|
1473
|
-
|
|
1489
|
+
i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(C, { children: [
|
|
1474
1490
|
/* @__PURE__ */ s(p, { fontSize: "md", children: [
|
|
1475
1491
|
a?.length,
|
|
1476
1492
|
" result(s)"
|
|
1477
1493
|
] }),
|
|
1478
1494
|
/* @__PURE__ */ e(C, { gap: 0, children: d?.map((u, g) => /* @__PURE__ */ e(
|
|
1479
|
-
|
|
1495
|
+
Dt,
|
|
1480
1496
|
{
|
|
1481
1497
|
contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
|
|
1482
1498
|
pageIndex: u.meta?.itemPageIndex,
|
|
@@ -1494,41 +1510,41 @@ const En = y.forwardRef(
|
|
|
1494
1510
|
)
|
|
1495
1511
|
] });
|
|
1496
1512
|
}
|
|
1497
|
-
),
|
|
1513
|
+
), Ft = f(
|
|
1498
1514
|
({
|
|
1499
|
-
open:
|
|
1500
|
-
setOpen:
|
|
1515
|
+
open: n,
|
|
1516
|
+
setOpen: t,
|
|
1501
1517
|
onNavigate: o
|
|
1502
1518
|
}) => /* @__PURE__ */ e(
|
|
1503
|
-
|
|
1519
|
+
q,
|
|
1504
1520
|
{
|
|
1505
1521
|
lazyMount: !0,
|
|
1506
1522
|
placement: "center",
|
|
1507
|
-
open:
|
|
1508
|
-
onOpenChange: (
|
|
1523
|
+
open: n,
|
|
1524
|
+
onOpenChange: (r) => t(r.open),
|
|
1509
1525
|
size: { mdDown: "full", md: "lg" },
|
|
1510
1526
|
scrollBehavior: "inside",
|
|
1511
|
-
children: /* @__PURE__ */ s(
|
|
1512
|
-
/* @__PURE__ */ e(
|
|
1513
|
-
/* @__PURE__ */ e(
|
|
1514
|
-
/* @__PURE__ */ e(
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1527
|
+
children: /* @__PURE__ */ s(G, { height: "100%", children: [
|
|
1528
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Search" }) }),
|
|
1529
|
+
/* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e($t, { onNavigate: o }) }),
|
|
1530
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
|
|
1531
|
+
/* @__PURE__ */ e(j, {})
|
|
1516
1532
|
] })
|
|
1517
1533
|
}
|
|
1518
1534
|
)
|
|
1519
|
-
),
|
|
1520
|
-
({ onNavigate:
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (
|
|
1535
|
+
), Wt = f(
|
|
1536
|
+
({ onNavigate: n }) => {
|
|
1537
|
+
const t = m(), { manifest: o, assumedRenditionLayout: r } = b(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = X();
|
|
1538
|
+
i?.toc;
|
|
1539
|
+
const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : l) || 0;
|
|
1524
1540
|
let u = a?.beginChapterInfo;
|
|
1525
1541
|
for (; u?.subChapter; )
|
|
1526
1542
|
u = u?.subChapter;
|
|
1527
|
-
const g = (h,
|
|
1543
|
+
const g = (h, x, S) => /* @__PURE__ */ s(Ne.Fragment, { children: [
|
|
1528
1544
|
/* @__PURE__ */ e(
|
|
1529
|
-
|
|
1545
|
+
P.Item,
|
|
1530
1546
|
{
|
|
1531
|
-
pl: 4 * (
|
|
1547
|
+
pl: 4 * (S + 1),
|
|
1532
1548
|
style: {
|
|
1533
1549
|
display: "flex",
|
|
1534
1550
|
alignItems: "center"
|
|
@@ -1537,12 +1553,12 @@ const En = y.forwardRef(
|
|
|
1537
1553
|
Se,
|
|
1538
1554
|
{
|
|
1539
1555
|
onClick: () => {
|
|
1540
|
-
|
|
1556
|
+
n(), t?.navigation.goToUrl(h.href);
|
|
1541
1557
|
},
|
|
1542
1558
|
href: "#",
|
|
1543
1559
|
children: [
|
|
1544
|
-
u?.path === h.path && /* @__PURE__ */ e(
|
|
1545
|
-
u?.path !== h.path && /* @__PURE__ */ e(
|
|
1560
|
+
u?.path === h.path && /* @__PURE__ */ e(P.Indicator, { asChild: !0, children: /* @__PURE__ */ e(we, {}) }),
|
|
1561
|
+
u?.path !== h.path && /* @__PURE__ */ e(P.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(we, {}) }),
|
|
1546
1562
|
/* @__PURE__ */ s(C, { gap: 0, children: [
|
|
1547
1563
|
/* @__PURE__ */ e(p, { fontSize: "md", children: h.title || h.path }),
|
|
1548
1564
|
u?.path === h.path && /* @__PURE__ */ e(
|
|
@@ -1560,102 +1576,152 @@ const En = y.forwardRef(
|
|
|
1560
1576
|
)
|
|
1561
1577
|
}
|
|
1562
1578
|
),
|
|
1563
|
-
h.contents.length > 0 && /* @__PURE__ */ e(
|
|
1564
|
-
(
|
|
1579
|
+
h.contents.length > 0 && /* @__PURE__ */ e(P.Root, { as: "div", gap: 2, children: h.contents.map(
|
|
1580
|
+
(I, w) => g(I, w, S + 1)
|
|
1565
1581
|
) })
|
|
1566
|
-
] },
|
|
1567
|
-
return /* @__PURE__ */ e(
|
|
1582
|
+
] }, x);
|
|
1583
|
+
return /* @__PURE__ */ e(P.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, x) => g(h, x, 0)) });
|
|
1568
1584
|
}
|
|
1569
|
-
),
|
|
1585
|
+
), Ht = f(
|
|
1570
1586
|
({
|
|
1571
|
-
open:
|
|
1572
|
-
setOpen:
|
|
1587
|
+
open: n,
|
|
1588
|
+
setOpen: t,
|
|
1573
1589
|
onNavigate: o
|
|
1574
1590
|
}) => /* @__PURE__ */ e(
|
|
1575
|
-
|
|
1591
|
+
q,
|
|
1576
1592
|
{
|
|
1577
1593
|
lazyMount: !0,
|
|
1578
1594
|
placement: "center",
|
|
1579
|
-
open:
|
|
1580
|
-
onOpenChange: (
|
|
1595
|
+
open: n,
|
|
1596
|
+
onOpenChange: (r) => t(r.open),
|
|
1581
1597
|
size: { mdDown: "full", md: "lg" },
|
|
1582
1598
|
scrollBehavior: "inside",
|
|
1583
|
-
children: /* @__PURE__ */ s(
|
|
1584
|
-
/* @__PURE__ */ e(
|
|
1585
|
-
/* @__PURE__ */ e(
|
|
1586
|
-
/* @__PURE__ */ e(
|
|
1587
|
-
/* @__PURE__ */ e(
|
|
1599
|
+
children: /* @__PURE__ */ s(G, { children: [
|
|
1600
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Table of Contents" }) }),
|
|
1601
|
+
/* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(Wt, { onNavigate: o }) }),
|
|
1602
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
|
|
1603
|
+
/* @__PURE__ */ e(j, {})
|
|
1588
1604
|
] })
|
|
1589
1605
|
}
|
|
1590
1606
|
)
|
|
1591
|
-
),
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1607
|
+
), Nt = f(() => {
|
|
1608
|
+
const { quickMenuBottomBarBoundingBox: n } = E(), t = ue(
|
|
1609
|
+
n
|
|
1610
|
+
), o = m(), r = b(() => o?.zoom.state$, [o]), i = r?.currentScale ?? 1, a = r?.isZooming && r.currentScale >= 1, l = t?.borderBoxSize?.[0]?.blockSize ?? 1;
|
|
1611
|
+
return /* @__PURE__ */ e(
|
|
1612
|
+
oe,
|
|
1613
|
+
{
|
|
1614
|
+
present: a,
|
|
1615
|
+
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1616
|
+
animationDuration: "moderate",
|
|
1617
|
+
position: "absolute",
|
|
1618
|
+
bottom: `calc(${l}px + var(--chakra-spacing-4))`,
|
|
1619
|
+
right: 4,
|
|
1620
|
+
backgroundColor: "bg.panel",
|
|
1621
|
+
shadow: "sm",
|
|
1622
|
+
borderRadius: "md",
|
|
1623
|
+
p: 4,
|
|
1624
|
+
children: /* @__PURE__ */ e(
|
|
1625
|
+
He,
|
|
1626
|
+
{
|
|
1627
|
+
value: [i],
|
|
1628
|
+
min: 1,
|
|
1629
|
+
max: 5,
|
|
1630
|
+
step: 0.5,
|
|
1631
|
+
minWidth: 200,
|
|
1632
|
+
onValueChange: (c) => {
|
|
1633
|
+
const d = c.value?.[0] ?? 1;
|
|
1634
|
+
d === 1 ? o?.zoom.exit() : o?.zoom.scaleAt(d);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
)
|
|
1638
|
+
}
|
|
1639
|
+
);
|
|
1640
|
+
}), so = ({
|
|
1641
|
+
enableFloatingTime: n = !0,
|
|
1642
|
+
enableFloatingProgress: t = !0,
|
|
1643
|
+
onItemClick: o,
|
|
1644
|
+
children: r,
|
|
1645
|
+
...i
|
|
1595
1646
|
}) => {
|
|
1596
|
-
const [
|
|
1597
|
-
|
|
1598
|
-
}, [
|
|
1599
|
-
(
|
|
1600
|
-
|
|
1647
|
+
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 = te(() => {
|
|
1648
|
+
l(!1), d(!1), g(!1), x(void 0), M(!1), I(!1);
|
|
1649
|
+
}, [M]), ae = te(
|
|
1650
|
+
(z) => {
|
|
1651
|
+
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
1652
|
},
|
|
1602
1653
|
[o]
|
|
1603
1654
|
);
|
|
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
|
-
|
|
1655
|
+
return gt(), ft(), Jn(), /* @__PURE__ */ s(
|
|
1656
|
+
B,
|
|
1657
|
+
{
|
|
1658
|
+
position: "absolute",
|
|
1659
|
+
top: 0,
|
|
1660
|
+
left: 0,
|
|
1661
|
+
height: "100%",
|
|
1662
|
+
width: "100%",
|
|
1663
|
+
overflow: "hidden",
|
|
1664
|
+
"data-prose-react-reader": !0,
|
|
1665
|
+
...i,
|
|
1666
|
+
children: [
|
|
1667
|
+
r,
|
|
1668
|
+
t && /* @__PURE__ */ e(
|
|
1669
|
+
oe,
|
|
1670
|
+
{
|
|
1671
|
+
present: !w,
|
|
1672
|
+
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1673
|
+
animationDuration: "moderate",
|
|
1674
|
+
children: /* @__PURE__ */ e(ct, {})
|
|
1675
|
+
}
|
|
1676
|
+
),
|
|
1677
|
+
/* @__PURE__ */ e(it, { open: S, setOpen: I }),
|
|
1678
|
+
/* @__PURE__ */ e(Et, {}),
|
|
1679
|
+
/* @__PURE__ */ e(Bt, { onItemClick: ae }),
|
|
1680
|
+
/* @__PURE__ */ e(Nt, {}),
|
|
1681
|
+
/* @__PURE__ */ e(Kn, {}),
|
|
1682
|
+
/* @__PURE__ */ e(lt, { open: c, setOpen: d }),
|
|
1683
|
+
/* @__PURE__ */ e(
|
|
1684
|
+
Ht,
|
|
1685
|
+
{
|
|
1686
|
+
open: a,
|
|
1687
|
+
setOpen: l,
|
|
1688
|
+
onNavigate: A
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
/* @__PURE__ */ e(
|
|
1692
|
+
Ft,
|
|
1693
|
+
{
|
|
1694
|
+
open: u,
|
|
1695
|
+
setOpen: g,
|
|
1696
|
+
onNavigate: A
|
|
1697
|
+
}
|
|
1698
|
+
),
|
|
1699
|
+
/* @__PURE__ */ e(
|
|
1700
|
+
qn,
|
|
1701
|
+
{
|
|
1702
|
+
openWith: h,
|
|
1703
|
+
setOpen: (z) => x(z ? "annotations" : void 0),
|
|
1704
|
+
onNavigate: A
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
/* @__PURE__ */ e(
|
|
1708
|
+
oe,
|
|
1709
|
+
{
|
|
1710
|
+
present: n || w,
|
|
1711
|
+
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1712
|
+
animationDuration: "slow",
|
|
1713
|
+
overflow: "hidden",
|
|
1714
|
+
children: /* @__PURE__ */ e(ht, {})
|
|
1715
|
+
}
|
|
1716
|
+
),
|
|
1717
|
+
/* @__PURE__ */ e(et, {})
|
|
1718
|
+
]
|
|
1719
|
+
}
|
|
1720
|
+
);
|
|
1655
1721
|
};
|
|
1656
1722
|
export {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1723
|
+
$n as BOOKMARK_AREA_DATA_ATTRIBUTE,
|
|
1724
|
+
so as ReactReader,
|
|
1725
|
+
ao as ReactReaderProvider
|
|
1660
1726
|
};
|
|
1661
1727
|
//# sourceMappingURL=index.js.map
|