@pdf-viewer/react 1.9.1-rc.2 → 1.9.1-rc.3
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/ToolbarLayout.module-20b830dd.js +3345 -0
- package/dist/ZoomTool.module-6c5eabbb.js +12 -0
- package/dist/assets/ToolbarLayout.css +1 -1
- package/dist/assets/ZoomTool.css +1 -0
- package/dist/components/RPController.js +56 -52
- package/dist/components/RPPages.js +8 -2
- package/dist/components/layout/LayoutContainer.js +7 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +8 -3
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +7 -2
- package/dist/components/layout/sidebar/Thumbnails.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +7 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +7 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +2 -2
- package/dist/components/layout/toolbar/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/RPToolbar.js +3 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +7 -2
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +12 -7
- package/dist/components/layout/toolbar/ToolbarDefault.js +11 -6
- package/dist/components/layout/toolbar/ZoomTool.js +116 -22
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +8 -3
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +10 -10
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +7 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +9 -9
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +19 -13
- package/dist/components/page/AnnotationLayer.js +7 -2
- package/dist/components/page/CanvasLayer.js +7 -2
- package/dist/components/page/CustomElement.js +20 -4
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +8 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +7 -2
- package/dist/components/page/TextLayer.js +7 -2
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/DimensionPagesContext.js +40 -9
- package/dist/contexts/ElementPageContext.js +74 -10
- package/dist/contexts/GlobalCurrentPage.js +16 -0
- package/dist/contexts/PaginationContext.js +5 -4
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ZoomContext.js +73 -15
- package/dist/main.js +64 -62
- package/dist/types/contexts/GlobalCurrentPage.d.ts +11 -0
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/utils/hooks/useFileDownload.js +7 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +7 -2
- package/dist/utils/hooks/usePinch.js +77 -4
- package/dist/utils/hooks/usePresentPage.js +7 -2
- package/dist/utils/hooks/usePrint.js +7 -2
- package/dist/utils/hooks/useScrollToPage.js +7 -2
- package/dist/utils/hooks/useSearch.js +7 -2
- package/dist/utils/hooks/useThumbnail.js +7 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +7 -2
- package/package.json +1 -1
- package/dist/ToolbarLayout.module-c973eb9c.js +0 -3675
|
@@ -0,0 +1,3345 @@
|
|
|
1
|
+
import { jsx as a, Fragment as pe, jsxs as H } from "react/jsx-runtime";
|
|
2
|
+
import * as Z from "react";
|
|
3
|
+
import { useRef as M, useEffect as D, useCallback as E, useState as $, useMemo as k, createContext as He, useContext as $e, useImperativeHandle as tn, createElement as Ve, PureComponent as Jn, Component as eo, memo as nn, forwardRef as to } from "react";
|
|
4
|
+
import { ChevronUpIcon as Ke } from "./components/icons/ChevronUpIcon.js";
|
|
5
|
+
import { UIButton as ge } from "./components/ui/Button.js";
|
|
6
|
+
import { UIInput as on } from "./components/ui/Input.js";
|
|
7
|
+
import { ViewMode as Re, ScrollMode as te, AnnotationSubType as Nt, SelectionMode as no } from "./utils/types.js";
|
|
8
|
+
import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
|
|
9
|
+
import { useDocumentContext as ne } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useDocumentPasswordContext as oo } from "./contexts/DocumentPasswordContext.js";
|
|
11
|
+
import { useDarkModeContext as ro } from "./contexts/DarkModeContext.js";
|
|
12
|
+
import "./contexts/RotationContext.js";
|
|
13
|
+
import { useLayerContext as io } from "./contexts/LayerContext.js";
|
|
14
|
+
import { useZoomContext as wt } from "./contexts/ZoomContext.js";
|
|
15
|
+
import { useViewModeContext as Fe } from "./contexts/ViewModeContext.js";
|
|
16
|
+
import { useVirtualScrollContext as Qe } from "./contexts/VirtualScrollContext.js";
|
|
17
|
+
import { useVirtualGridContext as rn } from "./contexts/VirtualGridContext.js";
|
|
18
|
+
import { useSelectionModeContext as ao } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as so } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as co } from "./contexts/FullScreenContext.js";
|
|
21
|
+
import "./contexts/FileInputContext.js";
|
|
22
|
+
import "./contexts/DropFileZoneContext.js";
|
|
23
|
+
import { findMatches as lo, resetDivs as uo, highlightMatches as po, isMatchEntireWord as ho } from "./utils/highlight.js";
|
|
24
|
+
import { useLayoutContainer as _e } from "./contexts/LayoutContainerContext.js";
|
|
25
|
+
import { useDimensionPagesContext as qe } from "./contexts/DimensionPagesContext.js";
|
|
26
|
+
import { useLocalizationContext as he } from "./contexts/LocalizationContext.js";
|
|
27
|
+
import { useHighlightContext as fo } from "./contexts/HighlightContext.js";
|
|
28
|
+
import "./contexts/LicenseContext.js";
|
|
29
|
+
import { useDownloadContext as mo } from "./contexts/DownloadContext.js";
|
|
30
|
+
import { useSmoothScrollContext as an } from "./contexts/SmoothScrollContext.js";
|
|
31
|
+
import "./contexts/ElementPageContext.js";
|
|
32
|
+
import { usePagesRotateContext as Ye } from "./contexts/PagesRotateContext.js";
|
|
33
|
+
import { Queue as go } from "./utils/Queue.js";
|
|
34
|
+
import { renderPage as vo } from "./utils/renderPage.js";
|
|
35
|
+
import { useGlobalCurrentPage as wo } from "./contexts/GlobalCurrentPage.js";
|
|
36
|
+
import { useLoaderContext as sn } from "./contexts/LoaderContext.js";
|
|
37
|
+
import { useToolComponentContext as Ne } from "./contexts/ToolComponentContext.js";
|
|
38
|
+
import { useIconToolContext as be } from "./contexts/IconToolContext.js";
|
|
39
|
+
import { useOtherToolContext as _o, OtherToolProvider as bo } from "./contexts/OtherToolContext.js";
|
|
40
|
+
import "./components/RPConfig.js";
|
|
41
|
+
import { ThumbnailIcon as To } from "./components/icons/Thumbnail.js";
|
|
42
|
+
import { c as ae } from "./clsx-0c6e471a.js";
|
|
43
|
+
import { LoaderIcon as _t } from "./components/icons/LoaderIcon.js";
|
|
44
|
+
import { Container as Co } from "./components/layout/Container.js";
|
|
45
|
+
import { useViewportContext as Oe, ViewportProvider as Po } from "./contexts/ViewportContext.js";
|
|
46
|
+
import { useToolbarComponentContext as Te, ToolbarComponentProvider as yo } from "./contexts/ToolbarComponentContext.js";
|
|
47
|
+
import { WrapperLayout as So } from "./components/layout/WrapperLayout.js";
|
|
48
|
+
import { useThemeContext as xo } from "./contexts/ThemeContext.js";
|
|
49
|
+
import { RPDropFileZone as Io } from "./components/RPDropFileZone.js";
|
|
50
|
+
import { c as ee, S as Ot } from "./SearchCloseButton-cbf182aa.js";
|
|
51
|
+
import { UICheckbox as Dt } from "./components/ui/Checkbox.js";
|
|
52
|
+
import { useIconContext as Ce, IconProvider as Ro } from "./contexts/IconContext.js";
|
|
53
|
+
import Q from "./components/ui/RPTooltip.js";
|
|
54
|
+
import { UIDropDown as cn } from "./components/ui/DropDown.js";
|
|
55
|
+
import "./ZoomTool.module-6c5eabbb.js";
|
|
56
|
+
import { MenuItem as Ze } from "./components/layout/toolbar/MenuItem.js";
|
|
57
|
+
import { MenuSeparator as ln } from "./components/layout/toolbar/MenuSeparator.js";
|
|
58
|
+
import { dateFormatter as At } from "./utils/dateFormatter.js";
|
|
59
|
+
import { PropertyItem as Lo } from "./components/layout/toolbar/PropertyItem.js";
|
|
60
|
+
import { RotateTool as Eo } from "./components/layout/toolbar/RotateTool.js";
|
|
61
|
+
import { withRef as Je } from "./utils/withRef.js";
|
|
62
|
+
import { useInfiniteScroll as No } from "./utils/hooks/useInfiniteScroll.js";
|
|
63
|
+
import { RPSplitter as Oo } from "./components/layout/sidebar/RPSplitter.js";
|
|
64
|
+
import * as Do from "pdfjs-dist";
|
|
65
|
+
import { PixelsPerInch as Ao, AnnotationMode as zo, RenderingCancelledException as Fo, AnnotationLayer as Mo } from "pdfjs-dist";
|
|
66
|
+
import { SimpleLinkService as ko } from "./utils/link_service.js";
|
|
67
|
+
import { annotationsEvents as Wo, annotationEventsHandler as Ho, handleClick as zt, handleAnnotationWidget as $o, handleAnnotationLink as qo, bindLayerEvents as Go, unbindLayerEvents as Ft } from "./utils/annotations.js";
|
|
68
|
+
import { normalizeSingleKeyword as Vo, sortHighlightPosition as Uo, unwrap as Bo } from "./components/page/searchHighlight.js";
|
|
69
|
+
import { CustomElement as jo } from "./components/page/CustomElement.js";
|
|
70
|
+
import { useMousePressed as Ko } from "./utils/hooks/useMousePressed.js";
|
|
71
|
+
import { useGrabScroll as Zo } from "./utils/hooks/useGrabScroll.js";
|
|
72
|
+
import { usePinch as Xo } from "./utils/hooks/usePinch.js";
|
|
73
|
+
import { useDebounce as bt } from "./utils/hooks/useDebounce.js";
|
|
74
|
+
import Qo from "./components/ui/PasswordModal.js";
|
|
75
|
+
import { getPositionFromPage as Yo, getPageFromPosition as Jo } from "./utils/calculatePage.js";
|
|
76
|
+
import { getScrollDistance as ze } from "./utils/getScrollDistance.js";
|
|
77
|
+
import { getWordPositionInPage as er } from "./utils/getWordPositionInPage.js";
|
|
78
|
+
import { getThumbnailViewport as tr } from "./utils/getThumbnailViewport.js";
|
|
79
|
+
import { smoothScrollTo as it } from "./utils/smoothScrollTo.js";
|
|
80
|
+
import { appConsole as nr } from "./utils/appConsole.js";
|
|
81
|
+
import { FileUploadTool as dn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
82
|
+
import { DarkModeTool as or } from "./components/layout/toolbar/DarkModeTool.js";
|
|
83
|
+
import { ThreeDotIcon as rr } from "./components/icons/ThreeDotIcon.js";
|
|
84
|
+
import { c as ir, u as Tt, P as Ge, b as We, d as Ct, i as ar, k as sr, a as cr } from "./index-5908484b.js";
|
|
85
|
+
import { D as lr, u as at } from "./index-18b0454c.js";
|
|
86
|
+
import { a as dr, h as ur, u as pr, F as hr, b as fr, G as un } from "./index-f4a9ae4d.js";
|
|
87
|
+
import { CloseIcon as mr } from "./components/icons/CloseIcon.js";
|
|
88
|
+
import { DocumentProperties as gr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
89
|
+
import { ViewModeTool as vr } from "./components/layout/toolbar/ViewModeTool.js";
|
|
90
|
+
import { ScrollModeTool as wr } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
91
|
+
import { FileDownloadDefaultIcon as _r } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
92
|
+
import { PrintDefaultTool as br } from "./components/icons/PrintDefaultIcon.js";
|
|
93
|
+
import { FullScreenTool as pn } from "./components/layout/toolbar/FullScreenTool.js";
|
|
94
|
+
import { GoToDownIcon as hn } from "./components/icons/GoToDownIcon.js";
|
|
95
|
+
import { SelectionModeTool as Tr } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
96
|
+
import { ZoomTool as Cr } from "./components/layout/toolbar/ZoomTool.js";
|
|
97
|
+
import { SearchIcon as fn } from "./components/icons/SearchIcon.js";
|
|
98
|
+
import { ClearIcon as Pr } from "./components/icons/ClearIcon.js";
|
|
99
|
+
import { InfoIcon as Mt } from "./components/icons/InfoIcon.js";
|
|
100
|
+
import './assets/ToolbarLayout.css';const mn = () => {
|
|
101
|
+
const { viewMode: t } = Fe(), { scrollMode: e } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Qe(), { setFocusedPage: i } = ce(), c = M(), { columnCount: l } = rn(), { widths: d, heights: h } = qe(), m = M(e), T = M(t), f = M(l), { targetScrollPage: v } = an();
|
|
102
|
+
D(() => {
|
|
103
|
+
n != null && n.scrollToItem && (c.current = n);
|
|
104
|
+
}, [n]), D(() => {
|
|
105
|
+
m.current = e, T.current = t;
|
|
106
|
+
}, [e, t]);
|
|
107
|
+
const C = E(
|
|
108
|
+
(b, y) => {
|
|
109
|
+
if (!o)
|
|
110
|
+
return;
|
|
111
|
+
const g = Math.ceil(b / 2) * 2 - 1;
|
|
112
|
+
if (b === g + 1) {
|
|
113
|
+
const u = {
|
|
114
|
+
left: d[g],
|
|
115
|
+
top: 0
|
|
116
|
+
};
|
|
117
|
+
return new Promise(
|
|
118
|
+
(s) => it(o, u, s)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
const p = {
|
|
122
|
+
left: 0,
|
|
123
|
+
top: 0
|
|
124
|
+
};
|
|
125
|
+
return o == null ? void 0 : o.scrollTo({
|
|
126
|
+
...p,
|
|
127
|
+
behavior: y
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
[o, d, it]
|
|
131
|
+
);
|
|
132
|
+
return D(() => {
|
|
133
|
+
m.current = e, T.current = t;
|
|
134
|
+
}, [e, t]), D(() => {
|
|
135
|
+
f.current = l;
|
|
136
|
+
}, [l]), { scrollToPage: E(
|
|
137
|
+
(b, y = "smooth") => {
|
|
138
|
+
i(b);
|
|
139
|
+
const g = b - 1;
|
|
140
|
+
let p = g, u = 0;
|
|
141
|
+
if (T.current === Re.DUAL_PAGE && m.current === te.PAGE_SCROLLING) {
|
|
142
|
+
C(b, y);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (m.current === te.PAGE_SCROLLING) {
|
|
146
|
+
i(b);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!c.current || !r)
|
|
150
|
+
return;
|
|
151
|
+
const s = r;
|
|
152
|
+
if (y === "smooth" && (v.current = b), m.current === te.HORIZONTAL_SCROLLING) {
|
|
153
|
+
u = g;
|
|
154
|
+
const S = {
|
|
155
|
+
left: ze(d, u),
|
|
156
|
+
top: 0
|
|
157
|
+
};
|
|
158
|
+
return s.scrollTo({
|
|
159
|
+
...S,
|
|
160
|
+
behavior: y
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (T.current === Re.DUAL_PAGE) {
|
|
164
|
+
u = g % 2, p = Math.floor(g / 2);
|
|
165
|
+
const S = {
|
|
166
|
+
left: ze(d, u),
|
|
167
|
+
top: ze(h, p)
|
|
168
|
+
};
|
|
169
|
+
return s.scrollTo({
|
|
170
|
+
...S,
|
|
171
|
+
behavior: y
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const w = {
|
|
175
|
+
left: 0,
|
|
176
|
+
top: ze(h, p)
|
|
177
|
+
};
|
|
178
|
+
return s.scrollTo({
|
|
179
|
+
...w,
|
|
180
|
+
behavior: y
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
[
|
|
184
|
+
r,
|
|
185
|
+
l,
|
|
186
|
+
C,
|
|
187
|
+
i,
|
|
188
|
+
it,
|
|
189
|
+
h,
|
|
190
|
+
d
|
|
191
|
+
]
|
|
192
|
+
) };
|
|
193
|
+
}, yr = (t = 1) => {
|
|
194
|
+
const [e, n] = $(t), [r, o] = $(0), { scrollToPage: i } = mn(), c = M(1), { viewMode: l } = Fe(), { scrollMode: d } = Ee(), { widths: h } = qe(), { pagesRef: m } = _e(), T = bt(e, 100), f = E(
|
|
195
|
+
(p) => {
|
|
196
|
+
if (!/^[0-9]*$/g.test(p.toString()) || !p)
|
|
197
|
+
return { success: !1, currentPage: c.current };
|
|
198
|
+
const s = +p;
|
|
199
|
+
return s < 0 || s > r ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +p });
|
|
200
|
+
},
|
|
201
|
+
[r]
|
|
202
|
+
), v = E(f, [f]), C = E(
|
|
203
|
+
(p) => {
|
|
204
|
+
const u = f(p);
|
|
205
|
+
return u.success && i(u.currentPage), u;
|
|
206
|
+
},
|
|
207
|
+
[f, i]
|
|
208
|
+
), P = E((p) => {
|
|
209
|
+
const u = p % 2 === 1;
|
|
210
|
+
if (!m || u)
|
|
211
|
+
return !1;
|
|
212
|
+
const s = u ? h[p] : h[p - 1], w = u ? h[p + 1] : h[p];
|
|
213
|
+
return l === Re.DUAL_PAGE && s + w < m.clientWidth;
|
|
214
|
+
}, [l, h, m, r]), b = E(() => {
|
|
215
|
+
let p = e - 1;
|
|
216
|
+
P(p) && (p = e - 2), C(p);
|
|
217
|
+
}, [C, e, l, d, P]), y = k(() => l === Re.DUAL_PAGE && d === te.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, l, d]), g = E(() => {
|
|
218
|
+
if (y)
|
|
219
|
+
return;
|
|
220
|
+
let p = e + 1;
|
|
221
|
+
P(p) && (p = e + 2), C(p);
|
|
222
|
+
}, [C, e, P, l, d, y]);
|
|
223
|
+
return {
|
|
224
|
+
focusedPage: T,
|
|
225
|
+
totalPages: r,
|
|
226
|
+
setFocusedPage: v,
|
|
227
|
+
setTotalPages: o,
|
|
228
|
+
nextPage: g,
|
|
229
|
+
prevPage: b,
|
|
230
|
+
goToPage: C
|
|
231
|
+
};
|
|
232
|
+
}, gn = He({
|
|
233
|
+
focusedPage: 0,
|
|
234
|
+
setFocusedPage: (t) => {
|
|
235
|
+
},
|
|
236
|
+
goToPage: (t) => ({ success: !!t, currentPage: +t }),
|
|
237
|
+
totalPages: 0,
|
|
238
|
+
setTotalPages: (t) => {
|
|
239
|
+
},
|
|
240
|
+
prevPage: () => {
|
|
241
|
+
},
|
|
242
|
+
nextPage: () => {
|
|
243
|
+
}
|
|
244
|
+
}), ce = () => {
|
|
245
|
+
const t = $e(gn);
|
|
246
|
+
return typeof (t == null ? void 0 : t.focusedPage) > "u" && nr.error("Please use this hooks inside children component of RPProvider"), t;
|
|
247
|
+
}, ks = ({ children: t }) => {
|
|
248
|
+
const { pdf: e } = ne(), { setCurrentPage: n } = wo(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: c, goToPage: l, nextPage: d, prevPage: h } = yr();
|
|
249
|
+
return D(() => {
|
|
250
|
+
e != null && e.numPages && (c(e.numPages), i(1));
|
|
251
|
+
}, [e, c, i]), D(() => {
|
|
252
|
+
n(r);
|
|
253
|
+
}, [r, n]), /* @__PURE__ */ a(
|
|
254
|
+
gn.Provider,
|
|
255
|
+
{
|
|
256
|
+
value: {
|
|
257
|
+
focusedPage: r,
|
|
258
|
+
totalPages: o,
|
|
259
|
+
setFocusedPage: i,
|
|
260
|
+
setTotalPages: c,
|
|
261
|
+
nextPage: d,
|
|
262
|
+
prevPage: h,
|
|
263
|
+
goToPage: l
|
|
264
|
+
},
|
|
265
|
+
children: t
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
};
|
|
269
|
+
const Sr = () => {
|
|
270
|
+
const { pdf: t, pages: e } = ne(), [n, r] = $({
|
|
271
|
+
loadedPages: 0,
|
|
272
|
+
totalPages: 0,
|
|
273
|
+
percentage: 0
|
|
274
|
+
}), [o, i] = $(!1), [c, l] = $(!1), [d, h] = $(null), m = M(!1);
|
|
275
|
+
D(() => {
|
|
276
|
+
m.current;
|
|
277
|
+
}, [m]);
|
|
278
|
+
const T = E(() => {
|
|
279
|
+
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
280
|
+
const p = document.querySelector(".rp-print-zone");
|
|
281
|
+
p && p.remove();
|
|
282
|
+
}, []), f = E(() => {
|
|
283
|
+
m.current = !1, i(!1), l(!1), h(null), r({
|
|
284
|
+
loadedPages: 0,
|
|
285
|
+
totalPages: 0,
|
|
286
|
+
percentage: 0
|
|
287
|
+
});
|
|
288
|
+
}, []), v = () => {
|
|
289
|
+
m.current = !0;
|
|
290
|
+
}, C = async ({
|
|
291
|
+
scratchCanvas: p,
|
|
292
|
+
pdfDocument: u,
|
|
293
|
+
pageNumber: s,
|
|
294
|
+
viewerPdfPage: w,
|
|
295
|
+
printResolution: _,
|
|
296
|
+
optionalContentConfigPromise: S,
|
|
297
|
+
printAnnotationStoragePromise: L
|
|
298
|
+
}) => {
|
|
299
|
+
if (m.current) {
|
|
300
|
+
f();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const x = _ / Ao.PDF;
|
|
304
|
+
p.width = Math.floor(w.width * x), p.height = Math.floor(w.height * x);
|
|
305
|
+
const I = p.getContext("2d");
|
|
306
|
+
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, p.width, p.height), I.restore();
|
|
307
|
+
const [O, A] = await Promise.all([
|
|
308
|
+
u.getPage(s),
|
|
309
|
+
L
|
|
310
|
+
]);
|
|
311
|
+
if (m.current) {
|
|
312
|
+
f();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const F = {
|
|
316
|
+
canvasContext: I,
|
|
317
|
+
transform: [x, 0, 0, x, 0, 0],
|
|
318
|
+
viewport: O.getViewport({ scale: 1, rotation: w.rotation }),
|
|
319
|
+
intent: "print",
|
|
320
|
+
annotationMode: zo.ENABLE_STORAGE,
|
|
321
|
+
optionalContentConfigPromise: S,
|
|
322
|
+
printAnnotationStorage: A
|
|
323
|
+
};
|
|
324
|
+
try {
|
|
325
|
+
return O.render(F).promise;
|
|
326
|
+
} catch (R) {
|
|
327
|
+
throw R instanceof Fo || console.error(R), R;
|
|
328
|
+
}
|
|
329
|
+
}, P = E(() => {
|
|
330
|
+
const p = window.print;
|
|
331
|
+
return new Promise((u) => {
|
|
332
|
+
const s = (S) => {
|
|
333
|
+
setTimeout(() => {
|
|
334
|
+
p.call(window), setTimeout(() => S(), 20);
|
|
335
|
+
}, 0);
|
|
336
|
+
};
|
|
337
|
+
if (document.querySelector(".rp-print-zone")) {
|
|
338
|
+
s(u);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const _ = new MutationObserver(() => {
|
|
342
|
+
document.querySelector(".rp-print-zone") && (s(u), _.disconnect());
|
|
343
|
+
});
|
|
344
|
+
_.observe(document.body, { childList: !0, subtree: !0 });
|
|
345
|
+
});
|
|
346
|
+
}, []), b = async (p) => {
|
|
347
|
+
const u = document.createElement("img"), s = document.createElement("div");
|
|
348
|
+
return s.classList.add("rp-print-page"), await new Promise((w, _) => {
|
|
349
|
+
p.toBlob((S) => {
|
|
350
|
+
S ? (u.src = URL.createObjectURL(S), u.onload = () => {
|
|
351
|
+
URL.revokeObjectURL(u.src), w();
|
|
352
|
+
}, u.onerror = _) : _(new Error("Failed to create blob"));
|
|
353
|
+
});
|
|
354
|
+
}).catch(() => {
|
|
355
|
+
}), s.appendChild(u), s;
|
|
356
|
+
}, y = (p, u) => {
|
|
357
|
+
const s = document.createElement("div");
|
|
358
|
+
s.classList.add("rp-print-zone");
|
|
359
|
+
const w = document.createElement("style"), _ = u.get(1);
|
|
360
|
+
if (_) {
|
|
361
|
+
const { width: S, height: L } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
362
|
+
w.innerHTML = `@page { size: ${S}px ${L}px }`;
|
|
363
|
+
}
|
|
364
|
+
return s.appendChild(w), s.append(...p), s;
|
|
365
|
+
}, g = E(async () => {
|
|
366
|
+
if (!t)
|
|
367
|
+
return;
|
|
368
|
+
f();
|
|
369
|
+
const p = document.createElement("canvas"), u = [];
|
|
370
|
+
try {
|
|
371
|
+
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
372
|
+
const w = t.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
373
|
+
t.annotationStorage.print ?? void 0
|
|
374
|
+
), S = e.size;
|
|
375
|
+
for (const [x, I] of e) {
|
|
376
|
+
if (m.current) {
|
|
377
|
+
f();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const O = I.page.getViewport({ scale: 1 });
|
|
381
|
+
if (await C({
|
|
382
|
+
scratchCanvas: p,
|
|
383
|
+
pdfDocument: t,
|
|
384
|
+
pageNumber: x,
|
|
385
|
+
viewerPdfPage: O,
|
|
386
|
+
printResolution: 150,
|
|
387
|
+
optionalContentConfigPromise: w,
|
|
388
|
+
printAnnotationStoragePromise: _
|
|
389
|
+
}), m.current) {
|
|
390
|
+
f();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const A = await b(p);
|
|
394
|
+
u.push(A);
|
|
395
|
+
const F = parseFloat((u.length / S * 100).toFixed(2));
|
|
396
|
+
r({
|
|
397
|
+
loadedPages: x,
|
|
398
|
+
totalPages: S,
|
|
399
|
+
percentage: F
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
if (m.current) {
|
|
403
|
+
f();
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const L = y(u, e);
|
|
407
|
+
document.body.appendChild(L), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await P();
|
|
408
|
+
} catch (s) {
|
|
409
|
+
l(!0), s instanceof Error && h(s);
|
|
410
|
+
} finally {
|
|
411
|
+
p.height = 0, p.width = 0;
|
|
412
|
+
}
|
|
413
|
+
}, [t, e, m]);
|
|
414
|
+
return D(() => {
|
|
415
|
+
const p = () => {
|
|
416
|
+
f(), T();
|
|
417
|
+
};
|
|
418
|
+
return window.addEventListener("afterprint", p, !0), () => {
|
|
419
|
+
window.removeEventListener("afterprint", p, !0);
|
|
420
|
+
};
|
|
421
|
+
}, [T, f]), {
|
|
422
|
+
print: g,
|
|
423
|
+
cancel: v,
|
|
424
|
+
progress: n,
|
|
425
|
+
isComplete: o,
|
|
426
|
+
isError: c,
|
|
427
|
+
error: d
|
|
428
|
+
};
|
|
429
|
+
}, vn = He({
|
|
430
|
+
print: () => {
|
|
431
|
+
},
|
|
432
|
+
cancel: () => {
|
|
433
|
+
},
|
|
434
|
+
setOnProgress: (t) => {
|
|
435
|
+
},
|
|
436
|
+
progress: {},
|
|
437
|
+
setOnComplete: (t) => t(),
|
|
438
|
+
setOnError: (t) => {
|
|
439
|
+
try {
|
|
440
|
+
const e = new Error("Print error occurred");
|
|
441
|
+
t(e);
|
|
442
|
+
} catch (e) {
|
|
443
|
+
console.error("Error in setOnError callback:", e);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}), Ws = ({ children: t }) => {
|
|
447
|
+
const [e, n] = $(null), [r, o] = $(null), { print: i, cancel: c, progress: l, isComplete: d, isError: h, error: m } = Sr(), T = E((b) => {
|
|
448
|
+
b && typeof b == "function" && o(() => b);
|
|
449
|
+
}, []), f = (b) => {
|
|
450
|
+
m && b(m);
|
|
451
|
+
}, v = E(
|
|
452
|
+
(b) => {
|
|
453
|
+
n(() => b);
|
|
454
|
+
},
|
|
455
|
+
[l, e]
|
|
456
|
+
);
|
|
457
|
+
D(() => {
|
|
458
|
+
d && r && C();
|
|
459
|
+
}, [d, r]), D(() => {
|
|
460
|
+
h && f((b) => {
|
|
461
|
+
console.error(b);
|
|
462
|
+
});
|
|
463
|
+
}, [h]), D(() => {
|
|
464
|
+
l && e && e(l);
|
|
465
|
+
}, [l, e]);
|
|
466
|
+
const C = () => {
|
|
467
|
+
r && (r(), o(null));
|
|
468
|
+
}, P = {
|
|
469
|
+
print: i,
|
|
470
|
+
cancel: c,
|
|
471
|
+
setOnProgress: v,
|
|
472
|
+
setOnComplete: T,
|
|
473
|
+
setOnError: f,
|
|
474
|
+
progress: l
|
|
475
|
+
};
|
|
476
|
+
return /* @__PURE__ */ a(vn.Provider, { value: P, children: t });
|
|
477
|
+
}, et = () => {
|
|
478
|
+
const t = $e(vn);
|
|
479
|
+
if (!t)
|
|
480
|
+
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
481
|
+
return t;
|
|
482
|
+
}, xr = () => {
|
|
483
|
+
const [t, e] = $({}), { pages: n } = ne(), r = k(() => Object.keys(t).length, [t]), o = E(
|
|
484
|
+
(c) => {
|
|
485
|
+
if (!n.size)
|
|
486
|
+
return;
|
|
487
|
+
const l = c > n.size ? n.size : c, h = Array.from(n.values()).slice(0, l).map((m) => {
|
|
488
|
+
const { thumbnailViewport: T, scale: f } = tr(m.page, m.defaultRotation);
|
|
489
|
+
return {
|
|
490
|
+
scale: f,
|
|
491
|
+
page: m.page,
|
|
492
|
+
loading: !0,
|
|
493
|
+
viewport: T,
|
|
494
|
+
defaultRotation: m.defaultRotation
|
|
495
|
+
};
|
|
496
|
+
}).reduce((m, T) => (m[T.page.pageNumber] = T, m), {});
|
|
497
|
+
e(h);
|
|
498
|
+
},
|
|
499
|
+
[n]
|
|
500
|
+
);
|
|
501
|
+
D(() => {
|
|
502
|
+
o(10);
|
|
503
|
+
}, [o]);
|
|
504
|
+
const i = E(
|
|
505
|
+
(c) => {
|
|
506
|
+
if (!n)
|
|
507
|
+
return;
|
|
508
|
+
const l = n.get(c);
|
|
509
|
+
l && e((d) => ({
|
|
510
|
+
...d,
|
|
511
|
+
[c]: {
|
|
512
|
+
loading: !0,
|
|
513
|
+
page: l.page,
|
|
514
|
+
viewport: l.thumbnailViewport,
|
|
515
|
+
scale: l.thumbnailScale,
|
|
516
|
+
defaultRotation: l.defaultRotation
|
|
517
|
+
}
|
|
518
|
+
}));
|
|
519
|
+
},
|
|
520
|
+
[n]
|
|
521
|
+
);
|
|
522
|
+
return { thumbnailPages: t, addPage: i, addToPage: o, thumbnailLength: r };
|
|
523
|
+
}, wn = He({
|
|
524
|
+
thumbnailPages: {},
|
|
525
|
+
addPage: (t) => {
|
|
526
|
+
},
|
|
527
|
+
addToPage: (t) => {
|
|
528
|
+
},
|
|
529
|
+
thumbnailLength: 0,
|
|
530
|
+
setActive: (t) => {
|
|
531
|
+
},
|
|
532
|
+
active: !1
|
|
533
|
+
}), _n = () => $e(wn), Hs = ({
|
|
534
|
+
children: t,
|
|
535
|
+
initialThumbnailsVisible: e
|
|
536
|
+
}) => {
|
|
537
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = xr(), [c, l] = $(e);
|
|
538
|
+
return /* @__PURE__ */ a(
|
|
539
|
+
wn.Provider,
|
|
540
|
+
{
|
|
541
|
+
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i, active: c, setActive: l },
|
|
542
|
+
children: t
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
}, Ir = (t = {}, e = "") => {
|
|
546
|
+
const [n, r] = $(e), [o, i] = $(!1), { pdf: c, pages: l } = ne(), { widths: d, heights: h } = qe(), m = M(!n), { currentZoom: T } = wt(), [f, v] = $([]), { setFocusedPage: C } = ce(), { columnCount: P } = Fe(), { pageRotate: b } = Ye(), [y, g] = $(0), { pageScrollElementRef: p, virtualScrollableElementRef: u } = Qe(), { scrollMode: s } = Ee(), { pagesRef: w } = _e(), [_, S] = $(null), L = M({}), x = k(() => y === 0 ? null : f[y - 1], [y, f]), I = k(() => f.length, [f]);
|
|
547
|
+
D(() => {
|
|
548
|
+
if (!x || !l)
|
|
549
|
+
return;
|
|
550
|
+
const R = u || p;
|
|
551
|
+
if (!R || !w)
|
|
552
|
+
return;
|
|
553
|
+
const N = l.get(x.page);
|
|
554
|
+
if (s === te.PAGE_SCROLLING && C(x.page), !N)
|
|
555
|
+
return;
|
|
556
|
+
let z = 0, W = 0;
|
|
557
|
+
if (s === te.VERTICAL_SCROLLING) {
|
|
558
|
+
const re = x.page - 1, Y = P, ie = re % Y, de = Math.floor(re / Y);
|
|
559
|
+
z = ze(h, de), W = ze(d, ie);
|
|
560
|
+
}
|
|
561
|
+
s === te.HORIZONTAL_SCROLLING && (W = d.slice(0, x.page - 1).reduce((re, Y) => re + Y, 0));
|
|
562
|
+
const G = {
|
|
563
|
+
height: h[x.page - 1],
|
|
564
|
+
width: d[x.page - 1]
|
|
565
|
+
}, B = {
|
|
566
|
+
top: G.height / 2,
|
|
567
|
+
left: G.width / 2
|
|
568
|
+
}, K = b[x.page], { leftInPage: V, topInPage: J } = er(
|
|
569
|
+
G,
|
|
570
|
+
B,
|
|
571
|
+
x.rect,
|
|
572
|
+
T,
|
|
573
|
+
K
|
|
574
|
+
), q = W + V, X = z + J, oe = {
|
|
575
|
+
left: Math.max(q, 0),
|
|
576
|
+
top: Math.max(X, 0)
|
|
577
|
+
};
|
|
578
|
+
R.scrollTo({
|
|
579
|
+
...oe,
|
|
580
|
+
behavior: "smooth"
|
|
581
|
+
});
|
|
582
|
+
}, [
|
|
583
|
+
l,
|
|
584
|
+
C,
|
|
585
|
+
d,
|
|
586
|
+
h,
|
|
587
|
+
x,
|
|
588
|
+
s,
|
|
589
|
+
u,
|
|
590
|
+
p,
|
|
591
|
+
w
|
|
592
|
+
]);
|
|
593
|
+
const O = E(() => {
|
|
594
|
+
g((R) => I ? R + 1 > I ? 1 : R + 1 : 0);
|
|
595
|
+
}, [I]), A = E(() => {
|
|
596
|
+
g((R) => I ? R - 1 <= 0 ? I : R - 1 : 0);
|
|
597
|
+
}, [I]), F = E(async (R) => {
|
|
598
|
+
if (!R)
|
|
599
|
+
return {};
|
|
600
|
+
const N = R.numPages, z = {};
|
|
601
|
+
for (let W = 1; W <= N; W++) {
|
|
602
|
+
if (m.current)
|
|
603
|
+
throw "close pop over";
|
|
604
|
+
const G = await R.getPage(W);
|
|
605
|
+
z[W.toString()] = await G.getTextContent();
|
|
606
|
+
}
|
|
607
|
+
return z;
|
|
608
|
+
}, []);
|
|
609
|
+
return D(() => {
|
|
610
|
+
if (!n) {
|
|
611
|
+
m.current = !0, v([]), g(0);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
m.current = !1, i(!0), v([]), g(0), F(c).then((R) => {
|
|
615
|
+
L.current = R;
|
|
616
|
+
const z = Object.keys(R).reduce((W, G) => {
|
|
617
|
+
const B = lo(
|
|
618
|
+
[n],
|
|
619
|
+
R[G],
|
|
620
|
+
Number(G) - 1,
|
|
621
|
+
t
|
|
622
|
+
).map((K, V) => ({ ...K, page: Number(G), pageMatchIdx: V }));
|
|
623
|
+
return [...W, ...B];
|
|
624
|
+
}, []);
|
|
625
|
+
v(z), g(z.length ? 1 : 0);
|
|
626
|
+
}).catch(() => {
|
|
627
|
+
v([]), g(0);
|
|
628
|
+
}).finally(() => i(!1));
|
|
629
|
+
}, [n, F, c, t]), {
|
|
630
|
+
search: n,
|
|
631
|
+
setSearch: r,
|
|
632
|
+
loading: o,
|
|
633
|
+
matches: f,
|
|
634
|
+
totalMatches: I,
|
|
635
|
+
currentMatchPosition: y,
|
|
636
|
+
currentMatch: x,
|
|
637
|
+
nextMatch: O,
|
|
638
|
+
prevMatch: A,
|
|
639
|
+
currentMatchElement: _,
|
|
640
|
+
setCurrentMatchElement: S
|
|
641
|
+
};
|
|
642
|
+
}, bn = He({
|
|
643
|
+
search: "",
|
|
644
|
+
setSearch: (t) => {
|
|
645
|
+
},
|
|
646
|
+
loading: !1,
|
|
647
|
+
matches: [],
|
|
648
|
+
totalMatches: 0,
|
|
649
|
+
currentMatchPosition: 0,
|
|
650
|
+
currentMatch: null,
|
|
651
|
+
nextMatch: () => {
|
|
652
|
+
},
|
|
653
|
+
prevMatch: () => {
|
|
654
|
+
},
|
|
655
|
+
searchOptions: {},
|
|
656
|
+
setSearchOptions: (t) => t,
|
|
657
|
+
currentMatchElement: null,
|
|
658
|
+
setCurrentMatchElement: (t) => {
|
|
659
|
+
}
|
|
660
|
+
}), $s = ({
|
|
661
|
+
children: t,
|
|
662
|
+
initialSearch: e
|
|
663
|
+
}) => {
|
|
664
|
+
const [n, r] = $({}), {
|
|
665
|
+
loading: o,
|
|
666
|
+
setSearch: i,
|
|
667
|
+
totalMatches: c,
|
|
668
|
+
currentMatchPosition: l,
|
|
669
|
+
currentMatch: d,
|
|
670
|
+
search: h,
|
|
671
|
+
matches: m,
|
|
672
|
+
nextMatch: T,
|
|
673
|
+
prevMatch: f,
|
|
674
|
+
currentMatchElement: v,
|
|
675
|
+
setCurrentMatchElement: C
|
|
676
|
+
} = Ir(n, e);
|
|
677
|
+
return /* @__PURE__ */ a(
|
|
678
|
+
bn.Provider,
|
|
679
|
+
{
|
|
680
|
+
value: {
|
|
681
|
+
searchOptions: n,
|
|
682
|
+
setSearchOptions: r,
|
|
683
|
+
loading: o,
|
|
684
|
+
setSearch: i,
|
|
685
|
+
totalMatches: c,
|
|
686
|
+
currentMatchPosition: l,
|
|
687
|
+
currentMatch: d,
|
|
688
|
+
nextMatch: T,
|
|
689
|
+
prevMatch: f,
|
|
690
|
+
search: h,
|
|
691
|
+
matches: m,
|
|
692
|
+
currentMatchElement: v,
|
|
693
|
+
setCurrentMatchElement: C
|
|
694
|
+
},
|
|
695
|
+
children: t
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
}, Pt = () => $e(bn), Tn = He(null), qs = ({ children: t }) => {
|
|
699
|
+
const e = M(!1), [n, r] = $([]), o = E((d) => {
|
|
700
|
+
r((h) => [...h, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
701
|
+
}, []), i = k(() => new go(o), [o]), { focusedPage: c } = ce(), l = E((d) => (e.current = !0, vo(
|
|
702
|
+
d.data.page,
|
|
703
|
+
d.data.canvasElem,
|
|
704
|
+
d.data.options
|
|
705
|
+
).promise.then(() => {
|
|
706
|
+
d.data.canvasElem.hidden = !1;
|
|
707
|
+
}).finally(() => {
|
|
708
|
+
d.data.onLoaded && d.data.onLoaded();
|
|
709
|
+
})), []);
|
|
710
|
+
return D(() => {
|
|
711
|
+
c && (i.changePagePriority(`^page-${c}`, 0), i.changePagePriority(`^thumbnail-${c}`, 1));
|
|
712
|
+
}, [c]), D(() => {
|
|
713
|
+
if (i.isEmpty() || e.current)
|
|
714
|
+
return;
|
|
715
|
+
const d = () => {
|
|
716
|
+
const h = i.dequeue();
|
|
717
|
+
h ? l(h).finally(() => {
|
|
718
|
+
d();
|
|
719
|
+
}) : (e.current = !1, r(i.peekAll()));
|
|
720
|
+
};
|
|
721
|
+
d();
|
|
722
|
+
}, [i, l, n]), /* @__PURE__ */ a(Tn.Provider, { value: i, children: t });
|
|
723
|
+
}, Cn = () => {
|
|
724
|
+
const t = $e(Tn);
|
|
725
|
+
if (!t)
|
|
726
|
+
throw new Error("RenderQueue not found");
|
|
727
|
+
return t;
|
|
728
|
+
}, ue = {
|
|
729
|
+
"rp-pages": "_rp-pages_dfr3e_1",
|
|
730
|
+
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_dfr3e_11",
|
|
731
|
+
"rp-pages-container": "_rp-pages-container_dfr3e_15",
|
|
732
|
+
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_dfr3e_52",
|
|
733
|
+
"rp-viewer": "_rp-viewer_dfr3e_57",
|
|
734
|
+
"rp-cursor-grab": "_rp-cursor-grab_dfr3e_62",
|
|
735
|
+
"rp-cursor-grabbing": "_rp-cursor-grabbing_dfr3e_70",
|
|
736
|
+
"rp-loader": "_rp-loader_dfr3e_78"
|
|
737
|
+
}, st = {
|
|
738
|
+
"rp-page-wrapper": "_rp-page-wrapper_14ohm_1",
|
|
739
|
+
"rp-page": "_rp-page_14ohm_1",
|
|
740
|
+
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
741
|
+
}, Rr = (t) => {
|
|
742
|
+
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = M(null), { pages: i } = ne(), { pageRotate: c } = Ye(), l = M(), { currentZoom: d } = wt(), h = Cn(), m = M(`page-${e}`);
|
|
743
|
+
return D(() => {
|
|
744
|
+
if (!i || d === 0)
|
|
745
|
+
return;
|
|
746
|
+
const T = i.get(e);
|
|
747
|
+
if (o.current && T) {
|
|
748
|
+
const f = o.current;
|
|
749
|
+
f.hidden = !0;
|
|
750
|
+
const v = l.current;
|
|
751
|
+
v && v.cancel(), r && r(), h.enqueue(
|
|
752
|
+
m.current,
|
|
753
|
+
{
|
|
754
|
+
page: T.page,
|
|
755
|
+
canvasElem: f,
|
|
756
|
+
options: {
|
|
757
|
+
scale: d,
|
|
758
|
+
rotate: c[e],
|
|
759
|
+
renderForms: !0
|
|
760
|
+
},
|
|
761
|
+
onLoaded: n
|
|
762
|
+
},
|
|
763
|
+
3
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
return () => {
|
|
767
|
+
h.removeQueue(m.current);
|
|
768
|
+
};
|
|
769
|
+
}, [i, e, c, d, r, n, h]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
|
|
770
|
+
}, Lr = "_selecting_usdup_9", fe = {
|
|
771
|
+
"rp-text-layer": "_rp-text-layer_usdup_1",
|
|
772
|
+
selecting: Lr,
|
|
773
|
+
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
774
|
+
}, Er = (t) => {
|
|
775
|
+
const { pageNumber: e } = t, { pages: n } = ne(), r = M(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = Pt(), [l, d] = $(
|
|
776
|
+
[]
|
|
777
|
+
), h = M(), m = M(), T = M([]), f = k(() => o.filter((p) => p.pageIndex === e - 1), [o, e]), v = E(
|
|
778
|
+
(p, u, s = !1) => {
|
|
779
|
+
if (s && uo(p, u), !f.length) {
|
|
780
|
+
T.current = [], d([]);
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
const w = po(f, p, u);
|
|
784
|
+
d(w);
|
|
785
|
+
},
|
|
786
|
+
[f]
|
|
787
|
+
), C = M(), P = M(!1), b = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
788
|
+
D(() => ((() => {
|
|
789
|
+
if (C.current)
|
|
790
|
+
return;
|
|
791
|
+
C.current = new AbortController();
|
|
792
|
+
const { signal: u } = C.current, s = () => {
|
|
793
|
+
b().forEach((_) => {
|
|
794
|
+
const S = _.querySelector(".endOfContent");
|
|
795
|
+
S && (_.appendChild(S), S.style.width = "", S.style.height = "", _.classList.remove(fe.selecting));
|
|
796
|
+
});
|
|
797
|
+
};
|
|
798
|
+
document.addEventListener(
|
|
799
|
+
"pointerdown",
|
|
800
|
+
() => {
|
|
801
|
+
P.current = !0;
|
|
802
|
+
},
|
|
803
|
+
{ signal: u }
|
|
804
|
+
), document.addEventListener(
|
|
805
|
+
"pointerup",
|
|
806
|
+
() => {
|
|
807
|
+
P.current = !1, s();
|
|
808
|
+
},
|
|
809
|
+
{ signal: u }
|
|
810
|
+
), window.addEventListener(
|
|
811
|
+
"blur",
|
|
812
|
+
() => {
|
|
813
|
+
P.current = !1, s();
|
|
814
|
+
},
|
|
815
|
+
{ signal: u }
|
|
816
|
+
), document.addEventListener(
|
|
817
|
+
"keyup",
|
|
818
|
+
() => {
|
|
819
|
+
P.current || s();
|
|
820
|
+
},
|
|
821
|
+
{ signal: u }
|
|
822
|
+
);
|
|
823
|
+
let w = null;
|
|
824
|
+
document.addEventListener(
|
|
825
|
+
"selectionchange",
|
|
826
|
+
() => {
|
|
827
|
+
var F, R;
|
|
828
|
+
const _ = document.getSelection();
|
|
829
|
+
if (!_)
|
|
830
|
+
return;
|
|
831
|
+
if (_.rangeCount === 0) {
|
|
832
|
+
s();
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
const S = /* @__PURE__ */ new Set();
|
|
836
|
+
for (let N = 0; N < _.rangeCount; N++) {
|
|
837
|
+
const z = _.getRangeAt(N);
|
|
838
|
+
b().forEach((W) => {
|
|
839
|
+
z.intersectsNode(W) && !S.has(W) && S.add(W);
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
b().forEach((N) => {
|
|
843
|
+
if (S.has(N))
|
|
844
|
+
N.classList.add(fe.selecting);
|
|
845
|
+
else {
|
|
846
|
+
const z = N.querySelector(".endOfContent");
|
|
847
|
+
z && (N.appendChild(z), z.style.width = "", z.style.height = "", N.classList.remove(fe.selecting));
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
const L = _.getRangeAt(0);
|
|
851
|
+
let I = w && (L.compareBoundaryPoints(Range.END_TO_END, w) === 0 || L.compareBoundaryPoints(Range.START_TO_END, w) === 0) ? L.startContainer : L.endContainer;
|
|
852
|
+
I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
|
|
853
|
+
const O = (F = I.parentElement) == null ? void 0 : F.closest(
|
|
854
|
+
fe["rp-text-layer"]
|
|
855
|
+
), A = O == null ? void 0 : O.querySelector(".endOfContent");
|
|
856
|
+
A && O && (A.style.width = O.style.width, A.style.height = O.style.height, (R = I.parentElement) == null || R.insertBefore(A, I.nextSibling)), w = L.cloneRange();
|
|
857
|
+
},
|
|
858
|
+
{ signal: u }
|
|
859
|
+
);
|
|
860
|
+
})(), () => {
|
|
861
|
+
var u;
|
|
862
|
+
(u = C.current) == null || u.abort(), C.current = void 0;
|
|
863
|
+
}), [b]);
|
|
864
|
+
const y = E(() => {
|
|
865
|
+
r.current && r.current.classList.add(fe.selecting);
|
|
866
|
+
}, []), g = E(() => {
|
|
867
|
+
r.current && r.current.classList.remove(fe.selecting);
|
|
868
|
+
}, []);
|
|
869
|
+
return D(() => {
|
|
870
|
+
if (T.current.forEach((s) => {
|
|
871
|
+
s.classList.remove("selected");
|
|
872
|
+
}), !l.length || !i || i.pageIndex !== e - 1)
|
|
873
|
+
return;
|
|
874
|
+
const p = f.findIndex(
|
|
875
|
+
(s) => JSON.stringify(s) === JSON.stringify(i)
|
|
876
|
+
);
|
|
877
|
+
if (p === -1)
|
|
878
|
+
return;
|
|
879
|
+
const u = l.filter((s) => s.index === p);
|
|
880
|
+
u.length && (T.current = u.map((s) => s.element), c(u[0].element), u.forEach((s) => {
|
|
881
|
+
s.element.classList.add("selected");
|
|
882
|
+
}));
|
|
883
|
+
}, [i, l, f]), D(() => {
|
|
884
|
+
const p = n.get(e);
|
|
885
|
+
if (!p || !r.current)
|
|
886
|
+
return;
|
|
887
|
+
const u = r.current;
|
|
888
|
+
return h.current && h.current.cancel(), p.page.getTextContent().then((s) => {
|
|
889
|
+
const w = p.page.getViewport({ scale: 1 });
|
|
890
|
+
return h.current = new Do.TextLayer({
|
|
891
|
+
viewport: w,
|
|
892
|
+
textContentSource: s,
|
|
893
|
+
container: u
|
|
894
|
+
}), m.current = s, u && (u.innerText = ""), h.current.render();
|
|
895
|
+
}).then(() => {
|
|
896
|
+
var S, L;
|
|
897
|
+
[].slice.call(u.children).forEach((x) => {
|
|
898
|
+
x.classList.add(fe["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
899
|
+
});
|
|
900
|
+
const w = (S = h.current) == null ? void 0 : S.textDivs;
|
|
901
|
+
w && m.current && v(m.current, w);
|
|
902
|
+
const _ = document.createElement("div");
|
|
903
|
+
_.className = "endOfContent", (L = r.current) == null || L.appendChild(_);
|
|
904
|
+
}).catch(() => {
|
|
905
|
+
}), () => {
|
|
906
|
+
var s;
|
|
907
|
+
(s = h.current) == null || s.cancel();
|
|
908
|
+
};
|
|
909
|
+
}, [n, e]), D(() => {
|
|
910
|
+
var s;
|
|
911
|
+
[].slice.call(r.current.children).forEach((w) => {
|
|
912
|
+
w.classList.add(fe["rp-text-layer-text"]);
|
|
913
|
+
});
|
|
914
|
+
const u = (s = h.current) == null ? void 0 : s.textDivs;
|
|
915
|
+
u && m.current && v(m.current, u, !0);
|
|
916
|
+
}, [v]), /* @__PURE__ */ a(
|
|
917
|
+
"div",
|
|
918
|
+
{
|
|
919
|
+
"data-rp": `page-${e}-textLayer`,
|
|
920
|
+
className: fe["rp-text-layer"],
|
|
921
|
+
ref: r,
|
|
922
|
+
onMouseDown: y,
|
|
923
|
+
onMouseUp: g
|
|
924
|
+
}
|
|
925
|
+
);
|
|
926
|
+
}, Nr = {
|
|
927
|
+
"rp-annotation-layer": "_rp-annotation-layer_1udza_1"
|
|
928
|
+
};
|
|
929
|
+
let Or = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
930
|
+
const Dr = (t) => {
|
|
931
|
+
const { pageNumber: e } = t, n = M(null), { pages: r, pdf: o } = ne(), i = M(), [c, l] = $(), { setFocusedPage: d, goToPage: h } = ce(), { scrollMode: m } = Ee(), { print: T } = et(), { download: f } = $n(), v = k(() => r.get(e), [r, e]), C = k(() => v == null ? void 0 : v.page.getViewport(), [v]);
|
|
932
|
+
D(() => {
|
|
933
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
934
|
+
}, [o]), D(() => {
|
|
935
|
+
v && v.page.getAnnotations().then((b) => {
|
|
936
|
+
i.current = void 0, l(b), n.current && (n.current.innerText = "");
|
|
937
|
+
});
|
|
938
|
+
}, [v]);
|
|
939
|
+
const P = E(
|
|
940
|
+
(b) => {
|
|
941
|
+
!c || !o || (Wo(b), Ho(b, o, c).then((y) => {
|
|
942
|
+
var g, p;
|
|
943
|
+
((g = y == null ? void 0 : y.data) == null ? void 0 : g.action) === "Print" ? T() : ((p = y == null ? void 0 : y.data) == null ? void 0 : p.action) === "SaveAs" && f();
|
|
944
|
+
}), m === te.PAGE_SCROLLING ? zt(b, c, o, (y) => d(y.pageIndex + 1)) : zt(b, c, o, (y) => h(y.pageIndex + 1)));
|
|
945
|
+
},
|
|
946
|
+
[o, c, h, d, m, T, f]
|
|
947
|
+
);
|
|
948
|
+
return D(() => {
|
|
949
|
+
if (!v || !c)
|
|
950
|
+
return;
|
|
951
|
+
const b = v.page.getViewport();
|
|
952
|
+
if (i.current) {
|
|
953
|
+
i.current.update({
|
|
954
|
+
viewport: b.clone({ dontFlip: !0 })
|
|
955
|
+
});
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
const y = /* @__PURE__ */ new Map([]);
|
|
959
|
+
for (const u of c) {
|
|
960
|
+
const { annotationType: s } = u;
|
|
961
|
+
switch (s) {
|
|
962
|
+
case Nt.Link:
|
|
963
|
+
qo(u);
|
|
964
|
+
break;
|
|
965
|
+
case Nt.Widget:
|
|
966
|
+
$o(u, b, y);
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
const g = new AbortController();
|
|
971
|
+
return (async () => {
|
|
972
|
+
var w;
|
|
973
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new Mo({
|
|
974
|
+
div: n.current,
|
|
975
|
+
accessibilityManager: void 0,
|
|
976
|
+
annotationCanvasMap: void 0,
|
|
977
|
+
annotationEditorUIManager: void 0,
|
|
978
|
+
structTreeLayer: null,
|
|
979
|
+
page: v.page,
|
|
980
|
+
viewport: b.clone({ dontFlip: !0 })
|
|
981
|
+
}), n.current && Ft(n.current, P);
|
|
982
|
+
const u = await (o == null ? void 0 : o.hasJSActions()), s = await (o == null ? void 0 : o.getFieldObjects());
|
|
983
|
+
if (g.signal.aborted)
|
|
984
|
+
throw "abort";
|
|
985
|
+
return (w = i.current) == null ? void 0 : w.render({
|
|
986
|
+
annotations: c,
|
|
987
|
+
annotationStorage: o == null ? void 0 : o.annotationStorage,
|
|
988
|
+
hasJSActions: u,
|
|
989
|
+
fieldObjects: s,
|
|
990
|
+
div: n.current,
|
|
991
|
+
viewport: b.clone({ dontFlip: !0 }),
|
|
992
|
+
page: v.page,
|
|
993
|
+
imageResourcesPath: Or,
|
|
994
|
+
renderForms: !0,
|
|
995
|
+
linkService: new ko(),
|
|
996
|
+
downloadManager: null,
|
|
997
|
+
enableScripting: !1
|
|
998
|
+
});
|
|
999
|
+
})().then(() => {
|
|
1000
|
+
n.current && Go(n.current, P);
|
|
1001
|
+
}).catch((u) => {
|
|
1002
|
+
if (u !== "abort")
|
|
1003
|
+
throw u;
|
|
1004
|
+
}), () => {
|
|
1005
|
+
g.abort("clear"), n.current && Ft(n.current, P);
|
|
1006
|
+
};
|
|
1007
|
+
}, [o, c, P]), /* @__PURE__ */ a(
|
|
1008
|
+
"div",
|
|
1009
|
+
{
|
|
1010
|
+
"data-rp": `page-${e}-annotationLayer`,
|
|
1011
|
+
style: { width: `${C == null ? void 0 : C.width}px`, height: `${C == null ? void 0 : C.height}px` },
|
|
1012
|
+
className: Nr["rp-annotation-layer"],
|
|
1013
|
+
ref: n
|
|
1014
|
+
}
|
|
1015
|
+
);
|
|
1016
|
+
}, Ar = {
|
|
1017
|
+
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1018
|
+
}, zr = ({ pageNumber: t, viewport: e }) => {
|
|
1019
|
+
const [n, r] = $(), { pages: o } = ne(), { highlightKeywords: i } = fo(), c = !0, l = M(null), [d, h] = $(null), [m, T] = $([]);
|
|
1020
|
+
D(() => {
|
|
1021
|
+
l.current && h(l.current.parentElement);
|
|
1022
|
+
}, [l]), D(() => {
|
|
1023
|
+
(async () => {
|
|
1024
|
+
const p = o.get(t);
|
|
1025
|
+
if (!p || !l.current)
|
|
1026
|
+
return;
|
|
1027
|
+
const u = await p.page.getTextContent();
|
|
1028
|
+
r(u);
|
|
1029
|
+
})();
|
|
1030
|
+
}, [o, t]);
|
|
1031
|
+
const f = k(() => i ? i.map((g) => {
|
|
1032
|
+
var p, u;
|
|
1033
|
+
return {
|
|
1034
|
+
...Vo(g.keyword, (p = g.options) == null ? void 0 : p.matchCase, (u = g.options) == null ? void 0 : u.wholeWords),
|
|
1035
|
+
color: g.highlightColor
|
|
1036
|
+
};
|
|
1037
|
+
}) : [], [i]);
|
|
1038
|
+
function v(g, p) {
|
|
1039
|
+
if (!g)
|
|
1040
|
+
return;
|
|
1041
|
+
const u = `[data-rp="page-${p}-textLayer"]`;
|
|
1042
|
+
return new Promise((s) => {
|
|
1043
|
+
const w = g.querySelector(u);
|
|
1044
|
+
if (w) {
|
|
1045
|
+
s(w);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
new MutationObserver((S, L) => {
|
|
1049
|
+
const x = g.querySelector(u);
|
|
1050
|
+
x && (s(x), L.disconnect());
|
|
1051
|
+
}).observe(g, { childList: !0, subtree: !0 });
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function C(g) {
|
|
1055
|
+
return new Promise((p) => {
|
|
1056
|
+
const u = g.querySelectorAll(
|
|
1057
|
+
'[data-rp="rp-text-layer-text"]'
|
|
1058
|
+
);
|
|
1059
|
+
if (u.length) {
|
|
1060
|
+
p(Array.from(u));
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
new MutationObserver((w, _) => {
|
|
1064
|
+
const S = g.querySelectorAll(
|
|
1065
|
+
".rp-text-layer-text"
|
|
1066
|
+
);
|
|
1067
|
+
S.length && (p(Array.from(S)), _.disconnect());
|
|
1068
|
+
}).observe(g, { childList: !0, subtree: !0 });
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
const P = (g, p, u, s) => {
|
|
1072
|
+
var B;
|
|
1073
|
+
const w = document.createRange(), _ = u.firstChild;
|
|
1074
|
+
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1075
|
+
return null;
|
|
1076
|
+
const S = ((B = _.textContent) == null ? void 0 : B.length) ?? 0, L = s[0].charIdxInSpan, x = s.length === 1 ? L : s[s.length - 1].charIdxInSpan;
|
|
1077
|
+
if (L > S || x + 1 > S)
|
|
1078
|
+
return null;
|
|
1079
|
+
w.setStart(_, L), w.setEnd(_, x + 1);
|
|
1080
|
+
const I = document.createElement("span");
|
|
1081
|
+
I.style.width = "auto", w.surroundContents(I);
|
|
1082
|
+
const O = I.getBoundingClientRect(), A = g.getBoundingClientRect(), F = A.height, R = A.width, N = 100 * (O.left - A.left) / R, z = 100 * (O.top - A.top) / F, W = 100 * O.height / F, G = 100 * O.width / R;
|
|
1083
|
+
return Bo(I), {
|
|
1084
|
+
keywordStr: p,
|
|
1085
|
+
left: N,
|
|
1086
|
+
top: z,
|
|
1087
|
+
height: W,
|
|
1088
|
+
width: G,
|
|
1089
|
+
pageHeight: F,
|
|
1090
|
+
pageWidth: R
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
async function b(g, p) {
|
|
1094
|
+
const u = await v(d, g);
|
|
1095
|
+
if (!u)
|
|
1096
|
+
return;
|
|
1097
|
+
const s = await C(u);
|
|
1098
|
+
if (s.length) {
|
|
1099
|
+
const w = s.map((S) => S.tagName === "BR" ? " " : S.textContent).reduce(
|
|
1100
|
+
(S, L, x) => S.concat(
|
|
1101
|
+
L.split("").map((I, O) => ({
|
|
1102
|
+
char: I,
|
|
1103
|
+
charIdxInSpan: O,
|
|
1104
|
+
spanIdx: x
|
|
1105
|
+
}))
|
|
1106
|
+
),
|
|
1107
|
+
[
|
|
1108
|
+
{
|
|
1109
|
+
char: "",
|
|
1110
|
+
charIdxInSpan: 0,
|
|
1111
|
+
spanIdx: 0
|
|
1112
|
+
}
|
|
1113
|
+
]
|
|
1114
|
+
).slice(1), _ = y(u, p, s, w);
|
|
1115
|
+
T(_);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
const y = (g, p, u, s) => {
|
|
1119
|
+
const w = p.length;
|
|
1120
|
+
if (!s.length || !w)
|
|
1121
|
+
return [];
|
|
1122
|
+
const _ = [], S = s.map((L) => L.char).join("");
|
|
1123
|
+
return f.forEach((L) => {
|
|
1124
|
+
const { keyword: x, regExp: I, wholeWords: O, color: A } = L, F = x;
|
|
1125
|
+
if (!F.trim())
|
|
1126
|
+
return;
|
|
1127
|
+
const R = I.flags.indexOf("g") === -1 ? new RegExp(I, `${I.flags}g`) : I;
|
|
1128
|
+
let N;
|
|
1129
|
+
const z = [];
|
|
1130
|
+
for (; (N = R.exec(S)) !== null; )
|
|
1131
|
+
O && !ho(S, N.index, N[0].length) || z.push({
|
|
1132
|
+
keyword: R,
|
|
1133
|
+
startIndex: N.index,
|
|
1134
|
+
endIndex: R.lastIndex
|
|
1135
|
+
});
|
|
1136
|
+
const W = z.map((G) => ({
|
|
1137
|
+
keyword: G.keyword,
|
|
1138
|
+
indexes: s.slice(G.startIndex, G.endIndex),
|
|
1139
|
+
color: A
|
|
1140
|
+
}));
|
|
1141
|
+
for (const G of W) {
|
|
1142
|
+
const B = G.indexes.reduce(
|
|
1143
|
+
(K, V) => (K[V.spanIdx] = (K[V.spanIdx] || []).concat([V]), K),
|
|
1144
|
+
{}
|
|
1145
|
+
);
|
|
1146
|
+
for (const K of Object.values(B))
|
|
1147
|
+
if (K.length !== 1 || K[0].char.trim() !== "") {
|
|
1148
|
+
const V = K, J = u[V[0].spanIdx], q = P(
|
|
1149
|
+
g,
|
|
1150
|
+
F,
|
|
1151
|
+
J,
|
|
1152
|
+
V
|
|
1153
|
+
);
|
|
1154
|
+
if (q) {
|
|
1155
|
+
const { left: X, top: oe } = q;
|
|
1156
|
+
if (_.find((Y) => Y.left === X && Y.top === oe))
|
|
1157
|
+
continue;
|
|
1158
|
+
_.push({ ...q, highlightColor: G.color });
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}), _.sort(Uo), _;
|
|
1163
|
+
};
|
|
1164
|
+
return D(() => {
|
|
1165
|
+
(async () => {
|
|
1166
|
+
if (!(!i || i.length === 0))
|
|
1167
|
+
try {
|
|
1168
|
+
await b(t, i);
|
|
1169
|
+
} catch (p) {
|
|
1170
|
+
console.error(p);
|
|
1171
|
+
}
|
|
1172
|
+
})();
|
|
1173
|
+
}, [c, i, t, n, e]), /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((g, p) => /* @__PURE__ */ a(
|
|
1174
|
+
"div",
|
|
1175
|
+
{
|
|
1176
|
+
className: Ar["rp-text-highlight"],
|
|
1177
|
+
style: {
|
|
1178
|
+
top: `${g.top}%`,
|
|
1179
|
+
left: `${g.left}%`,
|
|
1180
|
+
width: `${g.width}%`,
|
|
1181
|
+
height: `${g.height}%`,
|
|
1182
|
+
backgroundColor: g.highlightColor
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
p
|
|
1186
|
+
)) }) });
|
|
1187
|
+
}, yt = Je((t, e) => {
|
|
1188
|
+
const { pageNumber: n, style: r, ...o } = t, { pages: i } = ne(), { pageRotate: c } = Ye(), { textLayer: l } = io(), { currentZoom: d } = wt(), h = M(i.get(n)), [m, T] = $(!1), f = M(null), [v, C] = $({
|
|
1189
|
+
width: 0,
|
|
1190
|
+
height: 0
|
|
1191
|
+
});
|
|
1192
|
+
tn(e, () => f.current);
|
|
1193
|
+
const P = k(() => h.current ? c[n] : 0, [n, c]);
|
|
1194
|
+
D(() => {
|
|
1195
|
+
if (i && (h.current = i.get(n), h.current)) {
|
|
1196
|
+
const p = h.current.page.getViewport({
|
|
1197
|
+
scale: d,
|
|
1198
|
+
rotation: P
|
|
1199
|
+
});
|
|
1200
|
+
C(p);
|
|
1201
|
+
}
|
|
1202
|
+
}, [i, n, P, d]);
|
|
1203
|
+
const b = k(() => {
|
|
1204
|
+
switch (P) {
|
|
1205
|
+
case 90:
|
|
1206
|
+
return `${v.width / 2}px ${v.width / 2}px`;
|
|
1207
|
+
case -90:
|
|
1208
|
+
case 270:
|
|
1209
|
+
return `${v.height / 2}px ${v.height / 2}px`;
|
|
1210
|
+
default:
|
|
1211
|
+
return "center";
|
|
1212
|
+
}
|
|
1213
|
+
}, [P, v]), y = E(() => {
|
|
1214
|
+
T(!0);
|
|
1215
|
+
}, []), g = E(() => {
|
|
1216
|
+
T(!1);
|
|
1217
|
+
}, []);
|
|
1218
|
+
return /* @__PURE__ */ a(
|
|
1219
|
+
"div",
|
|
1220
|
+
{
|
|
1221
|
+
ref: f,
|
|
1222
|
+
id: `page-${n}`,
|
|
1223
|
+
"data-rp": `page-${n}`,
|
|
1224
|
+
...o,
|
|
1225
|
+
style: {
|
|
1226
|
+
...r,
|
|
1227
|
+
"--rp-rotate": `${P}deg`,
|
|
1228
|
+
"--rp-page-rotate-translate": `${b}`,
|
|
1229
|
+
"--scale-factor": d
|
|
1230
|
+
},
|
|
1231
|
+
className: st["rp-page-wrapper"],
|
|
1232
|
+
children: /* @__PURE__ */ H(
|
|
1233
|
+
"div",
|
|
1234
|
+
{
|
|
1235
|
+
style: {
|
|
1236
|
+
width: `${v.width}px`,
|
|
1237
|
+
height: `${v.height}px`
|
|
1238
|
+
},
|
|
1239
|
+
className: st["rp-page"],
|
|
1240
|
+
children: [
|
|
1241
|
+
/* @__PURE__ */ a(Rr, { onLoading: y, onLoaded: g, pageNumber: n }),
|
|
1242
|
+
m && /* @__PURE__ */ a("div", { className: st["rp-loader-wrapper"], children: /* @__PURE__ */ a(_t, {}) }),
|
|
1243
|
+
/* @__PURE__ */ a(jo, { pageNumber: n }),
|
|
1244
|
+
l && /* @__PURE__ */ a(Er, { pageNumber: n }),
|
|
1245
|
+
/* @__PURE__ */ a(zr, { pageNumber: n, viewport: v }),
|
|
1246
|
+
/* @__PURE__ */ a(Dr, { pageNumber: n })
|
|
1247
|
+
]
|
|
1248
|
+
}
|
|
1249
|
+
)
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1252
|
+
});
|
|
1253
|
+
function ft() {
|
|
1254
|
+
return ft = Object.assign ? Object.assign.bind() : function(t) {
|
|
1255
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1256
|
+
var n = arguments[e];
|
|
1257
|
+
for (var r in n)
|
|
1258
|
+
({}).hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1259
|
+
}
|
|
1260
|
+
return t;
|
|
1261
|
+
}, ft.apply(null, arguments);
|
|
1262
|
+
}
|
|
1263
|
+
function kt(t) {
|
|
1264
|
+
if (t === void 0)
|
|
1265
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1266
|
+
return t;
|
|
1267
|
+
}
|
|
1268
|
+
function mt(t, e) {
|
|
1269
|
+
return mt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
1270
|
+
return n.__proto__ = r, n;
|
|
1271
|
+
}, mt(t, e);
|
|
1272
|
+
}
|
|
1273
|
+
function Fr(t, e) {
|
|
1274
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, mt(t, e);
|
|
1275
|
+
}
|
|
1276
|
+
var Wt = Number.isNaN || function(e) {
|
|
1277
|
+
return typeof e == "number" && e !== e;
|
|
1278
|
+
};
|
|
1279
|
+
function Mr(t, e) {
|
|
1280
|
+
return !!(t === e || Wt(t) && Wt(e));
|
|
1281
|
+
}
|
|
1282
|
+
function kr(t, e) {
|
|
1283
|
+
if (t.length !== e.length)
|
|
1284
|
+
return !1;
|
|
1285
|
+
for (var n = 0; n < t.length; n++)
|
|
1286
|
+
if (!Mr(t[n], e[n]))
|
|
1287
|
+
return !1;
|
|
1288
|
+
return !0;
|
|
1289
|
+
}
|
|
1290
|
+
function ct(t, e) {
|
|
1291
|
+
e === void 0 && (e = kr);
|
|
1292
|
+
var n, r = [], o, i = !1;
|
|
1293
|
+
function c() {
|
|
1294
|
+
for (var l = [], d = 0; d < arguments.length; d++)
|
|
1295
|
+
l[d] = arguments[d];
|
|
1296
|
+
return i && n === this && e(l, r) || (o = t.apply(this, l), i = !0, n = this, r = l), o;
|
|
1297
|
+
}
|
|
1298
|
+
return c;
|
|
1299
|
+
}
|
|
1300
|
+
function Ht(t, e) {
|
|
1301
|
+
if (t == null)
|
|
1302
|
+
return {};
|
|
1303
|
+
var n = {};
|
|
1304
|
+
for (var r in t)
|
|
1305
|
+
if ({}.hasOwnProperty.call(t, r)) {
|
|
1306
|
+
if (e.indexOf(r) !== -1)
|
|
1307
|
+
continue;
|
|
1308
|
+
n[r] = t[r];
|
|
1309
|
+
}
|
|
1310
|
+
return n;
|
|
1311
|
+
}
|
|
1312
|
+
var Wr = typeof performance == "object" && typeof performance.now == "function", $t = Wr ? function() {
|
|
1313
|
+
return performance.now();
|
|
1314
|
+
} : function() {
|
|
1315
|
+
return Date.now();
|
|
1316
|
+
};
|
|
1317
|
+
function qt(t) {
|
|
1318
|
+
cancelAnimationFrame(t.id);
|
|
1319
|
+
}
|
|
1320
|
+
function Hr(t, e) {
|
|
1321
|
+
var n = $t();
|
|
1322
|
+
function r() {
|
|
1323
|
+
$t() - n >= e ? t.call(null) : o.id = requestAnimationFrame(r);
|
|
1324
|
+
}
|
|
1325
|
+
var o = {
|
|
1326
|
+
id: requestAnimationFrame(r)
|
|
1327
|
+
};
|
|
1328
|
+
return o;
|
|
1329
|
+
}
|
|
1330
|
+
var lt = -1;
|
|
1331
|
+
function $r(t) {
|
|
1332
|
+
if (t === void 0 && (t = !1), lt === -1 || t) {
|
|
1333
|
+
var e = document.createElement("div"), n = e.style;
|
|
1334
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(e), lt = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
1335
|
+
}
|
|
1336
|
+
return lt;
|
|
1337
|
+
}
|
|
1338
|
+
var De = null;
|
|
1339
|
+
function Gt(t) {
|
|
1340
|
+
if (t === void 0 && (t = !1), De === null || t) {
|
|
1341
|
+
var e = document.createElement("div"), n = e.style;
|
|
1342
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1343
|
+
var r = document.createElement("div"), o = r.style;
|
|
1344
|
+
return o.width = "100px", o.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? De = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? De = "negative" : De = "positive-ascending"), document.body.removeChild(e), De;
|
|
1345
|
+
}
|
|
1346
|
+
return De;
|
|
1347
|
+
}
|
|
1348
|
+
var qr = 150, Gr = function(e) {
|
|
1349
|
+
var n = e.columnIndex;
|
|
1350
|
+
e.data;
|
|
1351
|
+
var r = e.rowIndex;
|
|
1352
|
+
return r + ":" + n;
|
|
1353
|
+
}, Ue = null, Be = null, je = null;
|
|
1354
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ue = /* @__PURE__ */ new WeakSet(), Be = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1355
|
+
function Vr(t) {
|
|
1356
|
+
var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, c = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, h = t.getOffsetForRowAndAlignment, m = t.getRowHeight, T = t.getRowOffset, f = t.getRowStartIndexForOffset, v = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, P = t.shouldResetStyleCacheOnItemSizeChange, b = t.validateProps;
|
|
1357
|
+
return e = /* @__PURE__ */ function(y) {
|
|
1358
|
+
Fr(g, y);
|
|
1359
|
+
function g(u) {
|
|
1360
|
+
var s;
|
|
1361
|
+
return s = y.call(this, u) || this, s._instanceProps = C(s.props, kt(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1362
|
+
instance: kt(s),
|
|
1363
|
+
isScrolling: !1,
|
|
1364
|
+
horizontalScrollDirection: "forward",
|
|
1365
|
+
scrollLeft: typeof s.props.initialScrollLeft == "number" ? s.props.initialScrollLeft : 0,
|
|
1366
|
+
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1367
|
+
scrollUpdateWasRequested: !1,
|
|
1368
|
+
verticalScrollDirection: "forward"
|
|
1369
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ct(function(w, _, S, L, x, I, O, A) {
|
|
1370
|
+
return s.props.onItemsRendered({
|
|
1371
|
+
overscanColumnStartIndex: w,
|
|
1372
|
+
overscanColumnStopIndex: _,
|
|
1373
|
+
overscanRowStartIndex: S,
|
|
1374
|
+
overscanRowStopIndex: L,
|
|
1375
|
+
visibleColumnStartIndex: x,
|
|
1376
|
+
visibleColumnStopIndex: I,
|
|
1377
|
+
visibleRowStartIndex: O,
|
|
1378
|
+
visibleRowStopIndex: A
|
|
1379
|
+
});
|
|
1380
|
+
}), s._callOnScroll = void 0, s._callOnScroll = ct(function(w, _, S, L, x) {
|
|
1381
|
+
return s.props.onScroll({
|
|
1382
|
+
horizontalScrollDirection: S,
|
|
1383
|
+
scrollLeft: w,
|
|
1384
|
+
scrollTop: _,
|
|
1385
|
+
verticalScrollDirection: L,
|
|
1386
|
+
scrollUpdateWasRequested: x
|
|
1387
|
+
});
|
|
1388
|
+
}), s._getItemStyle = void 0, s._getItemStyle = function(w, _) {
|
|
1389
|
+
var S = s.props, L = S.columnWidth, x = S.direction, I = S.rowHeight, O = s._getItemStyleCache(P && L, P && x, P && I), A = w + ":" + _, F;
|
|
1390
|
+
if (O.hasOwnProperty(A))
|
|
1391
|
+
F = O[A];
|
|
1392
|
+
else {
|
|
1393
|
+
var R = n(s.props, _, s._instanceProps), N = x === "rtl";
|
|
1394
|
+
O[A] = F = {
|
|
1395
|
+
position: "absolute",
|
|
1396
|
+
left: N ? void 0 : R,
|
|
1397
|
+
right: N ? R : void 0,
|
|
1398
|
+
top: T(s.props, w, s._instanceProps),
|
|
1399
|
+
height: m(s.props, w, s._instanceProps),
|
|
1400
|
+
width: i(s.props, _, s._instanceProps)
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
return F;
|
|
1404
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = ct(function(w, _, S) {
|
|
1405
|
+
return {};
|
|
1406
|
+
}), s._onScroll = function(w) {
|
|
1407
|
+
var _ = w.currentTarget, S = _.clientHeight, L = _.clientWidth, x = _.scrollLeft, I = _.scrollTop, O = _.scrollHeight, A = _.scrollWidth;
|
|
1408
|
+
s.setState(function(F) {
|
|
1409
|
+
if (F.scrollLeft === x && F.scrollTop === I)
|
|
1410
|
+
return null;
|
|
1411
|
+
var R = s.props.direction, N = x;
|
|
1412
|
+
if (R === "rtl")
|
|
1413
|
+
switch (Gt()) {
|
|
1414
|
+
case "negative":
|
|
1415
|
+
N = -x;
|
|
1416
|
+
break;
|
|
1417
|
+
case "positive-descending":
|
|
1418
|
+
N = A - L - x;
|
|
1419
|
+
break;
|
|
1420
|
+
}
|
|
1421
|
+
N = Math.max(0, Math.min(N, A - L));
|
|
1422
|
+
var z = Math.max(0, Math.min(I, O - S));
|
|
1423
|
+
return {
|
|
1424
|
+
isScrolling: !0,
|
|
1425
|
+
horizontalScrollDirection: F.scrollLeft < x ? "forward" : "backward",
|
|
1426
|
+
scrollLeft: N,
|
|
1427
|
+
scrollTop: z,
|
|
1428
|
+
verticalScrollDirection: F.scrollTop < I ? "forward" : "backward",
|
|
1429
|
+
scrollUpdateWasRequested: !1
|
|
1430
|
+
};
|
|
1431
|
+
}, s._resetIsScrollingDebounced);
|
|
1432
|
+
}, s._outerRefSetter = function(w) {
|
|
1433
|
+
var _ = s.props.outerRef;
|
|
1434
|
+
s._outerRef = w, typeof _ == "function" ? _(w) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = w);
|
|
1435
|
+
}, s._resetIsScrollingDebounced = function() {
|
|
1436
|
+
s._resetIsScrollingTimeoutId !== null && qt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Hr(s._resetIsScrolling, qr);
|
|
1437
|
+
}, s._resetIsScrolling = function() {
|
|
1438
|
+
s._resetIsScrollingTimeoutId = null, s.setState({
|
|
1439
|
+
isScrolling: !1
|
|
1440
|
+
}, function() {
|
|
1441
|
+
s._getItemStyleCache(-1);
|
|
1442
|
+
});
|
|
1443
|
+
}, s;
|
|
1444
|
+
}
|
|
1445
|
+
g.getDerivedStateFromProps = function(s, w) {
|
|
1446
|
+
return Ur(s, w), b(s), null;
|
|
1447
|
+
};
|
|
1448
|
+
var p = g.prototype;
|
|
1449
|
+
return p.scrollTo = function(s) {
|
|
1450
|
+
var w = s.scrollLeft, _ = s.scrollTop;
|
|
1451
|
+
w !== void 0 && (w = Math.max(0, w)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(S) {
|
|
1452
|
+
return w === void 0 && (w = S.scrollLeft), _ === void 0 && (_ = S.scrollTop), S.scrollLeft === w && S.scrollTop === _ ? null : {
|
|
1453
|
+
horizontalScrollDirection: S.scrollLeft < w ? "forward" : "backward",
|
|
1454
|
+
scrollLeft: w,
|
|
1455
|
+
scrollTop: _,
|
|
1456
|
+
scrollUpdateWasRequested: !0,
|
|
1457
|
+
verticalScrollDirection: S.scrollTop < _ ? "forward" : "backward"
|
|
1458
|
+
};
|
|
1459
|
+
}, this._resetIsScrollingDebounced);
|
|
1460
|
+
}, p.scrollToItem = function(s) {
|
|
1461
|
+
var w = s.align, _ = w === void 0 ? "auto" : w, S = s.columnIndex, L = s.rowIndex, x = this.props, I = x.columnCount, O = x.height, A = x.rowCount, F = x.width, R = this.state, N = R.scrollLeft, z = R.scrollTop, W = $r();
|
|
1462
|
+
S !== void 0 && (S = Math.max(0, Math.min(S, I - 1))), L !== void 0 && (L = Math.max(0, Math.min(L, A - 1)));
|
|
1463
|
+
var G = c(this.props, this._instanceProps), B = l(this.props, this._instanceProps), K = B > F ? W : 0, V = G > O ? W : 0;
|
|
1464
|
+
this.scrollTo({
|
|
1465
|
+
scrollLeft: S !== void 0 ? d(this.props, S, _, N, this._instanceProps, V) : N,
|
|
1466
|
+
scrollTop: L !== void 0 ? h(this.props, L, _, z, this._instanceProps, K) : z
|
|
1467
|
+
});
|
|
1468
|
+
}, p.componentDidMount = function() {
|
|
1469
|
+
var s = this.props, w = s.initialScrollLeft, _ = s.initialScrollTop;
|
|
1470
|
+
if (this._outerRef != null) {
|
|
1471
|
+
var S = this._outerRef;
|
|
1472
|
+
typeof w == "number" && (S.scrollLeft = w), typeof _ == "number" && (S.scrollTop = _);
|
|
1473
|
+
}
|
|
1474
|
+
this._callPropsCallbacks();
|
|
1475
|
+
}, p.componentDidUpdate = function() {
|
|
1476
|
+
var s = this.props.direction, w = this.state, _ = w.scrollLeft, S = w.scrollTop, L = w.scrollUpdateWasRequested;
|
|
1477
|
+
if (L && this._outerRef != null) {
|
|
1478
|
+
var x = this._outerRef;
|
|
1479
|
+
if (s === "rtl")
|
|
1480
|
+
switch (Gt()) {
|
|
1481
|
+
case "negative":
|
|
1482
|
+
x.scrollLeft = -_;
|
|
1483
|
+
break;
|
|
1484
|
+
case "positive-ascending":
|
|
1485
|
+
x.scrollLeft = _;
|
|
1486
|
+
break;
|
|
1487
|
+
default:
|
|
1488
|
+
var I = x.clientWidth, O = x.scrollWidth;
|
|
1489
|
+
x.scrollLeft = O - I - _;
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
else
|
|
1493
|
+
x.scrollLeft = Math.max(0, _);
|
|
1494
|
+
x.scrollTop = Math.max(0, S);
|
|
1495
|
+
}
|
|
1496
|
+
this._callPropsCallbacks();
|
|
1497
|
+
}, p.componentWillUnmount = function() {
|
|
1498
|
+
this._resetIsScrollingTimeoutId !== null && qt(this._resetIsScrollingTimeoutId);
|
|
1499
|
+
}, p.render = function() {
|
|
1500
|
+
var s = this.props, w = s.children, _ = s.className, S = s.columnCount, L = s.direction, x = s.height, I = s.innerRef, O = s.innerElementType, A = s.innerTagName, F = s.itemData, R = s.itemKey, N = R === void 0 ? Gr : R, z = s.outerElementType, W = s.outerTagName, G = s.rowCount, B = s.style, K = s.useIsScrolling, V = s.width, J = this.state.isScrolling, q = this._getHorizontalRangeToRender(), X = q[0], oe = q[1], re = this._getVerticalRangeToRender(), Y = re[0], ie = re[1], de = [];
|
|
1501
|
+
if (S > 0 && G)
|
|
1502
|
+
for (var Pe = Y; Pe <= ie; Pe++)
|
|
1503
|
+
for (var ve = X; ve <= oe; ve++)
|
|
1504
|
+
de.push(Ve(w, {
|
|
1505
|
+
columnIndex: ve,
|
|
1506
|
+
data: F,
|
|
1507
|
+
isScrolling: K ? J : void 0,
|
|
1508
|
+
key: N({
|
|
1509
|
+
columnIndex: ve,
|
|
1510
|
+
data: F,
|
|
1511
|
+
rowIndex: Pe
|
|
1512
|
+
}),
|
|
1513
|
+
rowIndex: Pe,
|
|
1514
|
+
style: this._getItemStyle(Pe, ve)
|
|
1515
|
+
}));
|
|
1516
|
+
var tt = c(this.props, this._instanceProps), nt = l(this.props, this._instanceProps);
|
|
1517
|
+
return Ve(z || W || "div", {
|
|
1518
|
+
className: _,
|
|
1519
|
+
onScroll: this._onScroll,
|
|
1520
|
+
ref: this._outerRefSetter,
|
|
1521
|
+
style: ft({
|
|
1522
|
+
position: "relative",
|
|
1523
|
+
height: x,
|
|
1524
|
+
width: V,
|
|
1525
|
+
overflow: "auto",
|
|
1526
|
+
WebkitOverflowScrolling: "touch",
|
|
1527
|
+
willChange: "transform",
|
|
1528
|
+
direction: L
|
|
1529
|
+
}, B)
|
|
1530
|
+
}, Ve(O || A || "div", {
|
|
1531
|
+
children: de,
|
|
1532
|
+
ref: I,
|
|
1533
|
+
style: {
|
|
1534
|
+
height: tt,
|
|
1535
|
+
pointerEvents: J ? "none" : void 0,
|
|
1536
|
+
width: nt
|
|
1537
|
+
}
|
|
1538
|
+
}));
|
|
1539
|
+
}, p._callPropsCallbacks = function() {
|
|
1540
|
+
var s = this.props, w = s.columnCount, _ = s.onItemsRendered, S = s.onScroll, L = s.rowCount;
|
|
1541
|
+
if (typeof _ == "function" && w > 0 && L > 0) {
|
|
1542
|
+
var x = this._getHorizontalRangeToRender(), I = x[0], O = x[1], A = x[2], F = x[3], R = this._getVerticalRangeToRender(), N = R[0], z = R[1], W = R[2], G = R[3];
|
|
1543
|
+
this._callOnItemsRendered(I, O, N, z, A, F, W, G);
|
|
1544
|
+
}
|
|
1545
|
+
if (typeof S == "function") {
|
|
1546
|
+
var B = this.state, K = B.horizontalScrollDirection, V = B.scrollLeft, J = B.scrollTop, q = B.scrollUpdateWasRequested, X = B.verticalScrollDirection;
|
|
1547
|
+
this._callOnScroll(V, J, K, X, q);
|
|
1548
|
+
}
|
|
1549
|
+
}, p._getHorizontalRangeToRender = function() {
|
|
1550
|
+
var s = this.props, w = s.columnCount, _ = s.overscanColumnCount, S = s.overscanColumnsCount, L = s.overscanCount, x = s.rowCount, I = this.state, O = I.horizontalScrollDirection, A = I.isScrolling, F = I.scrollLeft, R = _ || S || L || 1;
|
|
1551
|
+
if (w === 0 || x === 0)
|
|
1552
|
+
return [0, 0, 0, 0];
|
|
1553
|
+
var N = r(this.props, F, this._instanceProps), z = o(this.props, N, F, this._instanceProps), W = !A || O === "backward" ? Math.max(1, R) : 1, G = !A || O === "forward" ? Math.max(1, R) : 1;
|
|
1554
|
+
return [Math.max(0, N - W), Math.max(0, Math.min(w - 1, z + G)), N, z];
|
|
1555
|
+
}, p._getVerticalRangeToRender = function() {
|
|
1556
|
+
var s = this.props, w = s.columnCount, _ = s.overscanCount, S = s.overscanRowCount, L = s.overscanRowsCount, x = s.rowCount, I = this.state, O = I.isScrolling, A = I.verticalScrollDirection, F = I.scrollTop, R = S || L || _ || 1;
|
|
1557
|
+
if (w === 0 || x === 0)
|
|
1558
|
+
return [0, 0, 0, 0];
|
|
1559
|
+
var N = f(this.props, F, this._instanceProps), z = v(this.props, N, F, this._instanceProps), W = !O || A === "backward" ? Math.max(1, R) : 1, G = !O || A === "forward" ? Math.max(1, R) : 1;
|
|
1560
|
+
return [Math.max(0, N - W), Math.max(0, Math.min(x - 1, z + G)), N, z];
|
|
1561
|
+
}, g;
|
|
1562
|
+
}(Jn), e.defaultProps = {
|
|
1563
|
+
direction: "ltr",
|
|
1564
|
+
itemData: void 0,
|
|
1565
|
+
useIsScrolling: !1
|
|
1566
|
+
}, e;
|
|
1567
|
+
}
|
|
1568
|
+
var Ur = function(e, n) {
|
|
1569
|
+
var r = e.children, o = e.direction, i = e.height, c = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, h = e.overscanCount, m = e.overscanRowsCount, T = e.width, f = n.instance;
|
|
1570
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1571
|
+
if (typeof h == "number" && Ue && !Ue.has(f) && (Ue.add(f), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Be && !Be.has(f) && (Be.add(f), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || l != null) && je && !je.has(f) && (je.add(f), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
1572
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
1573
|
+
switch (o) {
|
|
1574
|
+
case "ltr":
|
|
1575
|
+
case "rtl":
|
|
1576
|
+
break;
|
|
1577
|
+
default:
|
|
1578
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + o + '" was specified.'));
|
|
1579
|
+
}
|
|
1580
|
+
if (typeof T != "number")
|
|
1581
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (T === null ? "null" : typeof T) + '" was specified.'));
|
|
1582
|
+
if (typeof i != "number")
|
|
1583
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
1584
|
+
}
|
|
1585
|
+
}, Vt = 50, Pn = function(e, n) {
|
|
1586
|
+
var r = e.rowCount, o = n.rowMetadataMap, i = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, l = 0;
|
|
1587
|
+
if (c >= r && (c = r - 1), c >= 0) {
|
|
1588
|
+
var d = o[c];
|
|
1589
|
+
l = d.offset + d.size;
|
|
1590
|
+
}
|
|
1591
|
+
var h = r - c - 1, m = h * i;
|
|
1592
|
+
return l + m;
|
|
1593
|
+
}, yn = function(e, n) {
|
|
1594
|
+
var r = e.columnCount, o = n.columnMetadataMap, i = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, l = 0;
|
|
1595
|
+
if (c >= r && (c = r - 1), c >= 0) {
|
|
1596
|
+
var d = o[c];
|
|
1597
|
+
l = d.offset + d.size;
|
|
1598
|
+
}
|
|
1599
|
+
var h = r - c - 1, m = h * i;
|
|
1600
|
+
return l + m;
|
|
1601
|
+
}, me = function(e, n, r, o) {
|
|
1602
|
+
var i, c, l;
|
|
1603
|
+
if (e === "column" ? (i = o.columnMetadataMap, c = n.columnWidth, l = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, c = n.rowHeight, l = o.lastMeasuredRowIndex), r > l) {
|
|
1604
|
+
var d = 0;
|
|
1605
|
+
if (l >= 0) {
|
|
1606
|
+
var h = i[l];
|
|
1607
|
+
d = h.offset + h.size;
|
|
1608
|
+
}
|
|
1609
|
+
for (var m = l + 1; m <= r; m++) {
|
|
1610
|
+
var T = c(m);
|
|
1611
|
+
i[m] = {
|
|
1612
|
+
offset: d,
|
|
1613
|
+
size: T
|
|
1614
|
+
}, d += T;
|
|
1615
|
+
}
|
|
1616
|
+
e === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
1617
|
+
}
|
|
1618
|
+
return i[r];
|
|
1619
|
+
}, Ut = function(e, n, r, o) {
|
|
1620
|
+
var i, c;
|
|
1621
|
+
e === "column" ? (i = r.columnMetadataMap, c = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, c = r.lastMeasuredRowIndex);
|
|
1622
|
+
var l = c > 0 ? i[c].offset : 0;
|
|
1623
|
+
return l >= o ? Sn(e, n, r, c, 0, o) : Br(e, n, r, Math.max(0, c), o);
|
|
1624
|
+
}, Sn = function(e, n, r, o, i, c) {
|
|
1625
|
+
for (; i <= o; ) {
|
|
1626
|
+
var l = i + Math.floor((o - i) / 2), d = me(e, n, l, r).offset;
|
|
1627
|
+
if (d === c)
|
|
1628
|
+
return l;
|
|
1629
|
+
d < c ? i = l + 1 : d > c && (o = l - 1);
|
|
1630
|
+
}
|
|
1631
|
+
return i > 0 ? i - 1 : 0;
|
|
1632
|
+
}, Br = function(e, n, r, o, i) {
|
|
1633
|
+
for (var c = e === "column" ? n.columnCount : n.rowCount, l = 1; o < c && me(e, n, o, r).offset < i; )
|
|
1634
|
+
o += l, l *= 2;
|
|
1635
|
+
return Sn(e, n, r, Math.min(o, c - 1), Math.floor(o / 2), i);
|
|
1636
|
+
}, Bt = function(e, n, r, o, i, c, l) {
|
|
1637
|
+
var d = e === "column" ? n.width : n.height, h = me(e, n, r, c), m = e === "column" ? yn(n, c) : Pn(n, c), T = Math.max(0, Math.min(m - d, h.offset)), f = Math.max(0, h.offset - d + l + h.size);
|
|
1638
|
+
switch (o === "smart" && (i >= f - d && i <= T + d ? o = "auto" : o = "center"), o) {
|
|
1639
|
+
case "start":
|
|
1640
|
+
return T;
|
|
1641
|
+
case "end":
|
|
1642
|
+
return f;
|
|
1643
|
+
case "center":
|
|
1644
|
+
return Math.round(f + (T - f) / 2);
|
|
1645
|
+
case "auto":
|
|
1646
|
+
default:
|
|
1647
|
+
return i >= f && i <= T ? i : f > T || i < f ? f : T;
|
|
1648
|
+
}
|
|
1649
|
+
}, jr = /* @__PURE__ */ Vr({
|
|
1650
|
+
getColumnOffset: function(e, n, r) {
|
|
1651
|
+
return me("column", e, n, r).offset;
|
|
1652
|
+
},
|
|
1653
|
+
getColumnStartIndexForOffset: function(e, n, r) {
|
|
1654
|
+
return Ut("column", e, r, n);
|
|
1655
|
+
},
|
|
1656
|
+
getColumnStopIndexForStartIndex: function(e, n, r, o) {
|
|
1657
|
+
for (var i = e.columnCount, c = e.width, l = me("column", e, n, o), d = r + c, h = l.offset + l.size, m = n; m < i - 1 && h < d; )
|
|
1658
|
+
m++, h += me("column", e, m, o).size;
|
|
1659
|
+
return m;
|
|
1660
|
+
},
|
|
1661
|
+
getColumnWidth: function(e, n, r) {
|
|
1662
|
+
return r.columnMetadataMap[n].size;
|
|
1663
|
+
},
|
|
1664
|
+
getEstimatedTotalHeight: Pn,
|
|
1665
|
+
getEstimatedTotalWidth: yn,
|
|
1666
|
+
getOffsetForColumnAndAlignment: function(e, n, r, o, i, c) {
|
|
1667
|
+
return Bt("column", e, n, r, o, i, c);
|
|
1668
|
+
},
|
|
1669
|
+
getOffsetForRowAndAlignment: function(e, n, r, o, i, c) {
|
|
1670
|
+
return Bt("row", e, n, r, o, i, c);
|
|
1671
|
+
},
|
|
1672
|
+
getRowOffset: function(e, n, r) {
|
|
1673
|
+
return me("row", e, n, r).offset;
|
|
1674
|
+
},
|
|
1675
|
+
getRowHeight: function(e, n, r) {
|
|
1676
|
+
return r.rowMetadataMap[n].size;
|
|
1677
|
+
},
|
|
1678
|
+
getRowStartIndexForOffset: function(e, n, r) {
|
|
1679
|
+
return Ut("row", e, r, n);
|
|
1680
|
+
},
|
|
1681
|
+
getRowStopIndexForStartIndex: function(e, n, r, o) {
|
|
1682
|
+
for (var i = e.rowCount, c = e.height, l = me("row", e, n, o), d = r + c, h = l.offset + l.size, m = n; m < i - 1 && h < d; )
|
|
1683
|
+
m++, h += me("row", e, m, o).size;
|
|
1684
|
+
return m;
|
|
1685
|
+
},
|
|
1686
|
+
initInstanceProps: function(e, n) {
|
|
1687
|
+
var r = e, o = r.estimatedColumnWidth, i = r.estimatedRowHeight, c = {
|
|
1688
|
+
columnMetadataMap: {},
|
|
1689
|
+
estimatedColumnWidth: o || Vt,
|
|
1690
|
+
estimatedRowHeight: i || Vt,
|
|
1691
|
+
lastMeasuredColumnIndex: -1,
|
|
1692
|
+
lastMeasuredRowIndex: -1,
|
|
1693
|
+
rowMetadataMap: {}
|
|
1694
|
+
};
|
|
1695
|
+
return n.resetAfterColumnIndex = function(l, d) {
|
|
1696
|
+
d === void 0 && (d = !0), n.resetAfterIndices({
|
|
1697
|
+
columnIndex: l,
|
|
1698
|
+
shouldForceUpdate: d
|
|
1699
|
+
});
|
|
1700
|
+
}, n.resetAfterRowIndex = function(l, d) {
|
|
1701
|
+
d === void 0 && (d = !0), n.resetAfterIndices({
|
|
1702
|
+
rowIndex: l,
|
|
1703
|
+
shouldForceUpdate: d
|
|
1704
|
+
});
|
|
1705
|
+
}, n.resetAfterIndices = function(l) {
|
|
1706
|
+
var d = l.columnIndex, h = l.rowIndex, m = l.shouldForceUpdate, T = m === void 0 ? !0 : m;
|
|
1707
|
+
typeof d == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, d - 1)), typeof h == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, h - 1)), n._getItemStyleCache(-1), T && n.forceUpdate();
|
|
1708
|
+
}, c;
|
|
1709
|
+
},
|
|
1710
|
+
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1711
|
+
validateProps: function(e) {
|
|
1712
|
+
var n = e.columnWidth, r = e.rowHeight;
|
|
1713
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1714
|
+
if (typeof n != "function")
|
|
1715
|
+
throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (n === null ? "null" : typeof n) + '" was specified.'));
|
|
1716
|
+
if (typeof r != "function")
|
|
1717
|
+
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
});
|
|
1721
|
+
process.env.NODE_ENV;
|
|
1722
|
+
function jt(t, e) {
|
|
1723
|
+
for (var n in t)
|
|
1724
|
+
if (!(n in e))
|
|
1725
|
+
return !0;
|
|
1726
|
+
for (var r in e)
|
|
1727
|
+
if (t[r] !== e[r])
|
|
1728
|
+
return !0;
|
|
1729
|
+
return !1;
|
|
1730
|
+
}
|
|
1731
|
+
var Kr = ["style"], Zr = ["style"];
|
|
1732
|
+
function Xr(t, e) {
|
|
1733
|
+
var n = t.style, r = Ht(t, Kr), o = e.style, i = Ht(e, Zr);
|
|
1734
|
+
return !jt(n, o) && !jt(r, i);
|
|
1735
|
+
}
|
|
1736
|
+
const Qr = () => {
|
|
1737
|
+
const { viewMode: t } = Fe(), { scrollMode: e } = Ee(), { setColumnCount: n } = rn(), { virtualScrollableElementRef: r } = Qe(), o = qe(), i = k(() => o.heights.length, [o.heights]), c = k(() => e === te.HORIZONTAL_SCROLLING ? i : t === Re.DUAL_PAGE ? 2 : 1, [t, e, e, i, r]), l = k(() => o.widths.reduce((C, P, b) => {
|
|
1738
|
+
const y = b % c;
|
|
1739
|
+
return (!C[y] || P > C[y]) && (C[y] = P), C;
|
|
1740
|
+
}, []), [o.widths, c]), d = E(
|
|
1741
|
+
(v) => {
|
|
1742
|
+
const C = v % l.length;
|
|
1743
|
+
return l[C] || 0;
|
|
1744
|
+
},
|
|
1745
|
+
[l]
|
|
1746
|
+
), h = E(
|
|
1747
|
+
(v) => {
|
|
1748
|
+
const C = Array.from({ length: c }, (P, b) => {
|
|
1749
|
+
const y = v * c + b;
|
|
1750
|
+
return o.heights[y] || 0;
|
|
1751
|
+
});
|
|
1752
|
+
return Math.max(...C);
|
|
1753
|
+
},
|
|
1754
|
+
[o.heights, c]
|
|
1755
|
+
);
|
|
1756
|
+
D(() => {
|
|
1757
|
+
n(c);
|
|
1758
|
+
}, [c, n]);
|
|
1759
|
+
const m = k(() => e === te.HORIZONTAL_SCROLLING || e === te.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), T = k(() => o.heights.reduce((v, C) => v + C, 0) / o.heights.length || 0, [o]), f = k(() => o.widths.reduce((v, C) => v + C, 0) / o.heights.length || 0, [o]);
|
|
1760
|
+
return {
|
|
1761
|
+
rowCount: m,
|
|
1762
|
+
rowHeight: h,
|
|
1763
|
+
columnCount: c,
|
|
1764
|
+
columnWidth: d,
|
|
1765
|
+
pageDimension: o,
|
|
1766
|
+
estimatedRowHeight: T,
|
|
1767
|
+
estimatedColumnWidth: f
|
|
1768
|
+
};
|
|
1769
|
+
};
|
|
1770
|
+
let se;
|
|
1771
|
+
typeof window < "u" ? se = window : typeof self < "u" ? se = self : se = global;
|
|
1772
|
+
let gt = null, vt = null;
|
|
1773
|
+
const Kt = 20, dt = se.clearTimeout, Zt = se.setTimeout, ut = se.cancelAnimationFrame || se.mozCancelAnimationFrame || se.webkitCancelAnimationFrame, Xt = se.requestAnimationFrame || se.mozRequestAnimationFrame || se.webkitRequestAnimationFrame;
|
|
1774
|
+
ut == null || Xt == null ? (gt = dt, vt = function(e) {
|
|
1775
|
+
return Zt(e, Kt);
|
|
1776
|
+
}) : (gt = function([e, n]) {
|
|
1777
|
+
ut(e), dt(n);
|
|
1778
|
+
}, vt = function(e) {
|
|
1779
|
+
const n = Xt(function() {
|
|
1780
|
+
dt(r), e();
|
|
1781
|
+
}), r = Zt(function() {
|
|
1782
|
+
ut(n), e();
|
|
1783
|
+
}, Kt);
|
|
1784
|
+
return [n, r];
|
|
1785
|
+
});
|
|
1786
|
+
function Yr(t) {
|
|
1787
|
+
let e, n, r, o, i, c, l;
|
|
1788
|
+
const d = typeof document < "u" && document.attachEvent;
|
|
1789
|
+
if (!d) {
|
|
1790
|
+
c = function(y) {
|
|
1791
|
+
const g = y.__resizeTriggers__, p = g.firstElementChild, u = g.lastElementChild, s = p.firstElementChild;
|
|
1792
|
+
u.scrollLeft = u.scrollWidth, u.scrollTop = u.scrollHeight, s.style.width = p.offsetWidth + 1 + "px", s.style.height = p.offsetHeight + 1 + "px", p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight;
|
|
1793
|
+
}, i = function(y) {
|
|
1794
|
+
return y.offsetWidth !== y.__resizeLast__.width || y.offsetHeight !== y.__resizeLast__.height;
|
|
1795
|
+
}, l = function(y) {
|
|
1796
|
+
if (y.target.className && typeof y.target.className.indexOf == "function" && y.target.className.indexOf("contract-trigger") < 0 && y.target.className.indexOf("expand-trigger") < 0)
|
|
1797
|
+
return;
|
|
1798
|
+
const g = this;
|
|
1799
|
+
c(this), this.__resizeRAF__ && gt(this.__resizeRAF__), this.__resizeRAF__ = vt(function() {
|
|
1800
|
+
i(g) && (g.__resizeLast__.width = g.offsetWidth, g.__resizeLast__.height = g.offsetHeight, g.__resizeListeners__.forEach(function(s) {
|
|
1801
|
+
s.call(g, y);
|
|
1802
|
+
}));
|
|
1803
|
+
});
|
|
1804
|
+
};
|
|
1805
|
+
let f = !1, v = "";
|
|
1806
|
+
r = "animationstart";
|
|
1807
|
+
const C = "Webkit Moz O ms".split(" ");
|
|
1808
|
+
let P = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), b = "";
|
|
1809
|
+
{
|
|
1810
|
+
const y = document.createElement("fakeelement");
|
|
1811
|
+
if (y.style.animationName !== void 0 && (f = !0), f === !1) {
|
|
1812
|
+
for (let g = 0; g < C.length; g++)
|
|
1813
|
+
if (y.style[C[g] + "AnimationName"] !== void 0) {
|
|
1814
|
+
b = C[g], v = "-" + b.toLowerCase() + "-", r = P[g], f = !0;
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
n = "resizeanim", e = "@" + v + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = v + "animation: 1ms " + n + "; ";
|
|
1820
|
+
}
|
|
1821
|
+
const h = function(f) {
|
|
1822
|
+
if (!f.getElementById("detectElementResize")) {
|
|
1823
|
+
const v = (e || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = f.head || f.getElementsByTagName("head")[0], P = f.createElement("style");
|
|
1824
|
+
P.id = "detectElementResize", P.type = "text/css", t != null && P.setAttribute("nonce", t), P.styleSheet ? P.styleSheet.cssText = v : P.appendChild(f.createTextNode(v)), C.appendChild(P);
|
|
1825
|
+
}
|
|
1826
|
+
};
|
|
1827
|
+
return {
|
|
1828
|
+
addResizeListener: function(f, v) {
|
|
1829
|
+
if (d)
|
|
1830
|
+
f.attachEvent("onresize", v);
|
|
1831
|
+
else {
|
|
1832
|
+
if (!f.__resizeTriggers__) {
|
|
1833
|
+
const C = f.ownerDocument, P = se.getComputedStyle(f);
|
|
1834
|
+
P && P.position === "static" && (f.style.position = "relative"), h(C), f.__resizeLast__ = {}, f.__resizeListeners__ = [], (f.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
|
|
1835
|
+
const b = C.createElement("div");
|
|
1836
|
+
b.className = "expand-trigger", b.appendChild(C.createElement("div"));
|
|
1837
|
+
const y = C.createElement("div");
|
|
1838
|
+
y.className = "contract-trigger", f.__resizeTriggers__.appendChild(b), f.__resizeTriggers__.appendChild(y), f.appendChild(f.__resizeTriggers__), c(f), f.addEventListener("scroll", l, !0), r && (f.__resizeTriggers__.__animationListener__ = function(p) {
|
|
1839
|
+
p.animationName === n && c(f);
|
|
1840
|
+
}, f.__resizeTriggers__.addEventListener(r, f.__resizeTriggers__.__animationListener__));
|
|
1841
|
+
}
|
|
1842
|
+
f.__resizeListeners__.push(v);
|
|
1843
|
+
}
|
|
1844
|
+
},
|
|
1845
|
+
removeResizeListener: function(f, v) {
|
|
1846
|
+
if (d)
|
|
1847
|
+
f.detachEvent("onresize", v);
|
|
1848
|
+
else if (f.__resizeListeners__.splice(f.__resizeListeners__.indexOf(v), 1), !f.__resizeListeners__.length) {
|
|
1849
|
+
f.removeEventListener("scroll", l, !0), f.__resizeTriggers__.__animationListener__ && (f.__resizeTriggers__.removeEventListener(r, f.__resizeTriggers__.__animationListener__), f.__resizeTriggers__.__animationListener__ = null);
|
|
1850
|
+
try {
|
|
1851
|
+
f.__resizeTriggers__ = !f.removeChild(f.__resizeTriggers__);
|
|
1852
|
+
} catch {
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
};
|
|
1857
|
+
}
|
|
1858
|
+
class Jr extends eo {
|
|
1859
|
+
constructor(...e) {
|
|
1860
|
+
super(...e), this.state = {
|
|
1861
|
+
height: this.props.defaultHeight || 0,
|
|
1862
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
1863
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
1864
|
+
width: this.props.defaultWidth || 0
|
|
1865
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
1866
|
+
this._timeoutId = null;
|
|
1867
|
+
const {
|
|
1868
|
+
disableHeight: n,
|
|
1869
|
+
disableWidth: r,
|
|
1870
|
+
onResize: o
|
|
1871
|
+
} = this.props;
|
|
1872
|
+
if (this._parentNode) {
|
|
1873
|
+
const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), h = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), T = m.height - d - h, f = m.width - c - l, v = this._parentNode.offsetHeight - d - h, C = this._parentNode.offsetWidth - c - l;
|
|
1874
|
+
(!n && (this.state.height !== v || this.state.scaledHeight !== T) || !r && (this.state.width !== C || this.state.scaledWidth !== f)) && (this.setState({
|
|
1875
|
+
height: v,
|
|
1876
|
+
width: C,
|
|
1877
|
+
scaledHeight: T,
|
|
1878
|
+
scaledWidth: f
|
|
1879
|
+
}), typeof o == "function" && o({
|
|
1880
|
+
height: v,
|
|
1881
|
+
scaledHeight: T,
|
|
1882
|
+
scaledWidth: f,
|
|
1883
|
+
width: C
|
|
1884
|
+
}));
|
|
1885
|
+
}
|
|
1886
|
+
}, this._setRef = (n) => {
|
|
1887
|
+
this._autoSizer = n;
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
componentDidMount() {
|
|
1891
|
+
const {
|
|
1892
|
+
nonce: e
|
|
1893
|
+
} = this.props, n = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
1894
|
+
if (n != null && n.ownerDocument && n.ownerDocument.defaultView && n instanceof n.ownerDocument.defaultView.HTMLElement) {
|
|
1895
|
+
this._parentNode = n;
|
|
1896
|
+
const r = n.ownerDocument.defaultView.ResizeObserver;
|
|
1897
|
+
r != null ? (this._resizeObserver = new r(() => {
|
|
1898
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1899
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = Yr(e), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
componentWillUnmount() {
|
|
1903
|
+
this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
|
|
1904
|
+
}
|
|
1905
|
+
render() {
|
|
1906
|
+
const {
|
|
1907
|
+
children: e,
|
|
1908
|
+
defaultHeight: n,
|
|
1909
|
+
defaultWidth: r,
|
|
1910
|
+
disableHeight: o = !1,
|
|
1911
|
+
disableWidth: i = !1,
|
|
1912
|
+
doNotBailOutOnEmptyChildren: c = !1,
|
|
1913
|
+
nonce: l,
|
|
1914
|
+
onResize: d,
|
|
1915
|
+
style: h = {},
|
|
1916
|
+
tagName: m = "div",
|
|
1917
|
+
...T
|
|
1918
|
+
} = this.props, {
|
|
1919
|
+
height: f,
|
|
1920
|
+
scaledHeight: v,
|
|
1921
|
+
scaledWidth: C,
|
|
1922
|
+
width: P
|
|
1923
|
+
} = this.state, b = {
|
|
1924
|
+
overflow: "visible"
|
|
1925
|
+
}, y = {};
|
|
1926
|
+
let g = !1;
|
|
1927
|
+
return o || (f === 0 && (g = !0), b.height = 0, y.height = f, y.scaledHeight = v), i || (P === 0 && (g = !0), b.width = 0, y.width = P, y.scaledWidth = C), c && (g = !1), Ve(m, {
|
|
1928
|
+
ref: this._setRef,
|
|
1929
|
+
style: {
|
|
1930
|
+
...b,
|
|
1931
|
+
...h
|
|
1932
|
+
},
|
|
1933
|
+
...T
|
|
1934
|
+
}, !g && e(y));
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
const ei = nn(({ widths: t, heights: e }) => {
|
|
1938
|
+
const { focusedPage: n, totalPages: r } = ce(), o = k(() => {
|
|
1939
|
+
const l = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1940
|
+
if (l.push(d), d + 1 <= r) {
|
|
1941
|
+
const h = d + 1;
|
|
1942
|
+
l.push(h);
|
|
1943
|
+
}
|
|
1944
|
+
return l;
|
|
1945
|
+
}, [n, r]), i = k(() => {
|
|
1946
|
+
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), h = e(d), m = t(l), T = t(l + 1);
|
|
1947
|
+
return [
|
|
1948
|
+
{
|
|
1949
|
+
position: "absolute",
|
|
1950
|
+
left: 0,
|
|
1951
|
+
width: m,
|
|
1952
|
+
height: h
|
|
1953
|
+
},
|
|
1954
|
+
{
|
|
1955
|
+
position: "absolute",
|
|
1956
|
+
left: m,
|
|
1957
|
+
width: T,
|
|
1958
|
+
height: h
|
|
1959
|
+
}
|
|
1960
|
+
];
|
|
1961
|
+
}, [t, e, o]), c = k(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
1962
|
+
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: o.map((l, d) => /* @__PURE__ */ a(yt, { style: i[d], pageNumber: l }, l)) });
|
|
1963
|
+
}), ti = ({ widths: t, heights: e }) => {
|
|
1964
|
+
const { focusedPage: n } = ce(), r = k(() => ({
|
|
1965
|
+
position: "absolute",
|
|
1966
|
+
width: t(n - 1),
|
|
1967
|
+
height: e(n - 1)
|
|
1968
|
+
}), [t, e, n]), o = k(() => t(n - 1), [t]);
|
|
1969
|
+
return /* @__PURE__ */ a(
|
|
1970
|
+
"div",
|
|
1971
|
+
{
|
|
1972
|
+
style: {
|
|
1973
|
+
width: o,
|
|
1974
|
+
position: "relative"
|
|
1975
|
+
},
|
|
1976
|
+
children: /* @__PURE__ */ a(yt, { style: r, pageNumber: n }, n)
|
|
1977
|
+
}
|
|
1978
|
+
);
|
|
1979
|
+
}, ni = (t, e, n) => {
|
|
1980
|
+
const r = M(), { contentRef: o } = _e(), { heights: i, widths: c } = qe(), { setFocusedPage: l } = ce(), [d, h] = $([]), { targetScrollPage: m } = an(), T = bt(d, 0, 500), f = k(() => i.map((C, P) => {
|
|
1981
|
+
const b = c[P], y = Yo(P + 1, t), g = b * y.columnIndex, p = C * y.rowIndex, u = g + b, s = p + C;
|
|
1982
|
+
return {
|
|
1983
|
+
pageNumber: P + 1,
|
|
1984
|
+
...y,
|
|
1985
|
+
width: b,
|
|
1986
|
+
height: C,
|
|
1987
|
+
startX: g,
|
|
1988
|
+
startY: p,
|
|
1989
|
+
endX: u,
|
|
1990
|
+
endY: s
|
|
1991
|
+
};
|
|
1992
|
+
}), [i, c, t, e]);
|
|
1993
|
+
D(() => {
|
|
1994
|
+
var P;
|
|
1995
|
+
T.length > 0 && !m.current && l(T[0].pageNumber), ((P = T[0]) == null ? void 0 : P.ratio) && T.some((b) => b.pageNumber === m.current) && setTimeout(() => {
|
|
1996
|
+
m.current = void 0;
|
|
1997
|
+
}, 500);
|
|
1998
|
+
}, [T, l]);
|
|
1999
|
+
const v = E(
|
|
2000
|
+
(C) => {
|
|
2001
|
+
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
2002
|
+
const P = C.target, b = {
|
|
2003
|
+
startTop: P.scrollTop,
|
|
2004
|
+
startLeft: P.scrollLeft,
|
|
2005
|
+
endTop: P.scrollTop + P.clientHeight,
|
|
2006
|
+
endLeft: P.scrollLeft + P.clientWidth
|
|
2007
|
+
}, y = f.filter((g) => {
|
|
2008
|
+
const p = g.endX >= b.startLeft && g.endY >= b.startTop, u = g.startX <= b.endLeft && g.startY <= b.endTop;
|
|
2009
|
+
return p && u;
|
|
2010
|
+
}).map((g) => {
|
|
2011
|
+
const p = b.startLeft > g.startX ? b.startLeft : g.startX, u = b.startTop > g.startY ? b.startTop : g.startY, s = b.endLeft < g.endX ? b.endLeft : g.endX, w = b.endTop < g.endY ? b.endTop : g.endY, _ = s - p, S = w - u, x = +(_ * S / (g.width * g.height) * 100).toFixed(2);
|
|
2012
|
+
return {
|
|
2013
|
+
pageNumber: g.pageNumber,
|
|
2014
|
+
ratio: x
|
|
2015
|
+
};
|
|
2016
|
+
}).sort((g, p) => p.ratio - g.ratio);
|
|
2017
|
+
h(y);
|
|
2018
|
+
});
|
|
2019
|
+
},
|
|
2020
|
+
[o, f]
|
|
2021
|
+
);
|
|
2022
|
+
D(() => {
|
|
2023
|
+
if (n)
|
|
2024
|
+
return n == null || n.addEventListener("scroll", v), () => {
|
|
2025
|
+
n == null || n.removeEventListener("scroll", v);
|
|
2026
|
+
};
|
|
2027
|
+
}, [n, v]);
|
|
2028
|
+
}, we = {
|
|
2029
|
+
"rp-layout": "_rp-layout_1q08v_1",
|
|
2030
|
+
"rp-content": "_rp-content_1q08v_5",
|
|
2031
|
+
"rp-pages": "_rp-pages_1q08v_11",
|
|
2032
|
+
"rp-container": "_rp-container_1q08v_16",
|
|
2033
|
+
"rp-loader": "_rp-loader_1q08v_20",
|
|
2034
|
+
"rp-theme-variables": "_rp-theme-variables_1q08v_24",
|
|
2035
|
+
"rp-dark-mode": "_rp-dark-mode_1q08v_135"
|
|
2036
|
+
}, xn = Je((t, e) => {
|
|
2037
|
+
const { children: n, toolbarRef: r, style: o, className: i, ...c } = t, { customVariables: l, customDarkVariables: d } = xo(), { darkMode: h } = ro();
|
|
2038
|
+
return /* @__PURE__ */ a(
|
|
2039
|
+
"div",
|
|
2040
|
+
{
|
|
2041
|
+
ref: e,
|
|
2042
|
+
...c,
|
|
2043
|
+
className: ae(
|
|
2044
|
+
we["rp-theme-variables"],
|
|
2045
|
+
we["rp-container"],
|
|
2046
|
+
h ? we["rp-dark-mode"] : "",
|
|
2047
|
+
i
|
|
2048
|
+
),
|
|
2049
|
+
style: {
|
|
2050
|
+
"--rp-toolbar-height": `${(r == null ? void 0 : r.clientHeight) || 48}px`,
|
|
2051
|
+
...l,
|
|
2052
|
+
...h ? d : {},
|
|
2053
|
+
...o
|
|
2054
|
+
},
|
|
2055
|
+
children: n
|
|
2056
|
+
}
|
|
2057
|
+
);
|
|
2058
|
+
}), oi = nn(({ columnIndex: t, rowIndex: e, data: n, style: r }) => {
|
|
2059
|
+
const o = Jo(e, t, n.columnCount);
|
|
2060
|
+
return /* @__PURE__ */ a(yt, { style: r, pageNumber: o }, o);
|
|
2061
|
+
}, Xr), Gs = () => {
|
|
2062
|
+
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = so(), { pagesRef: r, setPagesRef: o } = _e(), { scrollToPage: i } = mn(), {
|
|
2063
|
+
virtualScrollRef: c,
|
|
2064
|
+
getVirtualScrollRef: l,
|
|
2065
|
+
getPageScrollElementRef: d,
|
|
2066
|
+
getVirtualScrollableElementRef: h,
|
|
2067
|
+
setTotalInnerDimensions: m,
|
|
2068
|
+
virtualScrollableElementRef: T,
|
|
2069
|
+
totalInnerDimensions: f,
|
|
2070
|
+
pageScrollElementRef: v
|
|
2071
|
+
} = Qe(), C = M(!0), { nextPage: P, prevPage: b, setFocusedPage: y, focusedPage: g } = ce(), { scrollMode: p } = Ee(), { viewMode: u } = Fe(), s = M(null), { loading: w } = ne(), { passwordRequired: _ } = oo(), { LoaderImageComponent: S } = sn(), L = M(
|
|
2072
|
+
f
|
|
2073
|
+
), x = M({
|
|
2074
|
+
viewMode: u,
|
|
2075
|
+
scrollMode: p
|
|
2076
|
+
}), I = M(!1), O = M(), { isFullScreen: A } = co(), {
|
|
2077
|
+
pageDimension: F,
|
|
2078
|
+
rowCount: R,
|
|
2079
|
+
rowHeight: N,
|
|
2080
|
+
columnCount: z,
|
|
2081
|
+
columnWidth: W,
|
|
2082
|
+
estimatedColumnWidth: G,
|
|
2083
|
+
estimatedRowHeight: B
|
|
2084
|
+
} = Qr(), K = bt(f, 100), V = M();
|
|
2085
|
+
ni(z, R, T);
|
|
2086
|
+
const J = M({
|
|
2087
|
+
scrollTop: 0,
|
|
2088
|
+
scrollLeft: 0
|
|
2089
|
+
});
|
|
2090
|
+
Xo(r);
|
|
2091
|
+
const { isPressed: q } = Ko(), { selectionMode: X } = ao(), { initializeGrabScroll: oe, resetGrabState: re } = Zo({
|
|
2092
|
+
isPressed: q
|
|
2093
|
+
}), Y = k(() => X === no.HAND, [X]), ie = k(() => ({
|
|
2094
|
+
columnCount: z
|
|
2095
|
+
}), [z]), de = E(
|
|
2096
|
+
(U) => {
|
|
2097
|
+
const j = document.activeElement !== r;
|
|
2098
|
+
!A && j || (["ArrowUp", "ArrowLeft"].includes(U.key) ? (U.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(U.key) && (U.preventDefault(), P()));
|
|
2099
|
+
},
|
|
2100
|
+
[P, b, A, p]
|
|
2101
|
+
);
|
|
2102
|
+
D(() => (window.addEventListener("keydown", de), () => {
|
|
2103
|
+
window.removeEventListener("keydown", de);
|
|
2104
|
+
}), [de]), D(() => {
|
|
2105
|
+
if (s.current && (s.current.style.position = "relative"), !!c)
|
|
2106
|
+
for (let U = 0; U < R; U++)
|
|
2107
|
+
for (let j = 0; j < z; j++)
|
|
2108
|
+
c.resetAfterIndices({
|
|
2109
|
+
columnIndex: j,
|
|
2110
|
+
rowIndex: U,
|
|
2111
|
+
shouldForceUpdate: !0
|
|
2112
|
+
});
|
|
2113
|
+
}, [R, z, F, c]);
|
|
2114
|
+
const Pe = E(
|
|
2115
|
+
(U, j) => {
|
|
2116
|
+
if (!T)
|
|
2117
|
+
return { scrollTop: 0, scrollLeft: 0 };
|
|
2118
|
+
const ye = J.current.scrollTop > j, Se = J.current.scrollLeft > U;
|
|
2119
|
+
return ye || Se ? J.current : {
|
|
2120
|
+
scrollTop: T.scrollTop,
|
|
2121
|
+
scrollLeft: T.scrollLeft
|
|
2122
|
+
};
|
|
2123
|
+
},
|
|
2124
|
+
[T]
|
|
2125
|
+
), ve = E(
|
|
2126
|
+
(U, j) => {
|
|
2127
|
+
if (x.current.viewMode !== u || x.current.scrollMode !== p) {
|
|
2128
|
+
V.current && clearTimeout(V.current), I.current = !0, i(g, "auto"), V.current = setTimeout(() => {
|
|
2129
|
+
requestAnimationFrame(() => {
|
|
2130
|
+
x.current = { viewMode: u, scrollMode: p };
|
|
2131
|
+
});
|
|
2132
|
+
}, 100);
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2135
|
+
const Se = U.scrollTop, ot = U.scrollLeft;
|
|
2136
|
+
if (!j.height || !j.width)
|
|
2137
|
+
return;
|
|
2138
|
+
I.current = !0;
|
|
2139
|
+
const { height: xe, width: rt } = j, { height: Lt, width: Et } = L.current;
|
|
2140
|
+
if (Lt === xe && Et === rt)
|
|
2141
|
+
return;
|
|
2142
|
+
const Zn = Se / Lt * xe, Xn = ot / Et * rt, Qn = Math.round(Math.min(Zn, xe)) || 0, Yn = Math.round(Math.min(Xn, rt)) || 0;
|
|
2143
|
+
O.current = setTimeout(() => {
|
|
2144
|
+
requestAnimationFrame(() => {
|
|
2145
|
+
c == null || c.scrollTo({
|
|
2146
|
+
scrollTop: Qn,
|
|
2147
|
+
scrollLeft: Yn
|
|
2148
|
+
});
|
|
2149
|
+
});
|
|
2150
|
+
}, 0), L.current = {
|
|
2151
|
+
height: j.height,
|
|
2152
|
+
width: j.width
|
|
2153
|
+
};
|
|
2154
|
+
},
|
|
2155
|
+
[c, u, p, i]
|
|
2156
|
+
);
|
|
2157
|
+
D(() => {
|
|
2158
|
+
clearTimeout(O.current);
|
|
2159
|
+
const U = Array.from({ length: R }).reduce(
|
|
2160
|
+
(Se, ot, xe) => Se + N(xe),
|
|
2161
|
+
0
|
|
2162
|
+
), j = Array.from({ length: z }).reduce(
|
|
2163
|
+
(Se, ot, xe) => Se + W(xe),
|
|
2164
|
+
0
|
|
2165
|
+
), ye = Pe(j, U);
|
|
2166
|
+
J.current = ye, ve(ye, { height: U, width: j }), m({
|
|
2167
|
+
height: U,
|
|
2168
|
+
width: j
|
|
2169
|
+
});
|
|
2170
|
+
}, [F, R, z, ve]);
|
|
2171
|
+
const tt = E(
|
|
2172
|
+
(U) => {
|
|
2173
|
+
J.current = {
|
|
2174
|
+
scrollTop: U.scrollTop,
|
|
2175
|
+
scrollLeft: U.scrollLeft
|
|
2176
|
+
};
|
|
2177
|
+
},
|
|
2178
|
+
[T]
|
|
2179
|
+
);
|
|
2180
|
+
D(() => () => {
|
|
2181
|
+
V.current && clearTimeout(V.current);
|
|
2182
|
+
}, []);
|
|
2183
|
+
const nt = k(() => ae(ue["rp-pages-container"], {
|
|
2184
|
+
[ue["rp-cursor-grab"]]: Y && !q,
|
|
2185
|
+
[ue["rp-cursor-grabbing"]]: Y && q
|
|
2186
|
+
}), [Y, q]), Kn = E(
|
|
2187
|
+
(U) => {
|
|
2188
|
+
if (Y && U) {
|
|
2189
|
+
const j = ae(ue["rp-pages"]), ye = document.querySelector(`.${j}`);
|
|
2190
|
+
oe(ye);
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
[Y, oe, ue]
|
|
2194
|
+
);
|
|
2195
|
+
return D(() => {
|
|
2196
|
+
w && re();
|
|
2197
|
+
}, [w]), D(() => {
|
|
2198
|
+
if (!(K.height === 0 || !C.current)) {
|
|
2199
|
+
if (e === te.PAGE_SCROLLING) {
|
|
2200
|
+
t !== g && v && y(t), C.current = !1;
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
i(t, "auto"), y(t), C.current = !1;
|
|
2204
|
+
}
|
|
2205
|
+
}, [
|
|
2206
|
+
i,
|
|
2207
|
+
e,
|
|
2208
|
+
v,
|
|
2209
|
+
y,
|
|
2210
|
+
K
|
|
2211
|
+
]), /* @__PURE__ */ H(pe, { children: [
|
|
2212
|
+
/* @__PURE__ */ a(xn, { id: n, ref: o, tabIndex: -1, className: nt, children: /* @__PURE__ */ a(Jr, { style: { minHeight: "50px" }, children: ({ width: U, height: j }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Kn, style: { width: U, height: j }, children: p === te.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
2213
|
+
"div",
|
|
2214
|
+
{
|
|
2215
|
+
ref: d,
|
|
2216
|
+
style: { width: U, height: j },
|
|
2217
|
+
className: ae(ue["rp-pages"], ue["rp-page-scrolling-wrapper"]),
|
|
2218
|
+
children: u === Re.DUAL_PAGE ? /* @__PURE__ */ a(ei, { widths: W, heights: N }) : /* @__PURE__ */ a(ti, { widths: W, heights: N })
|
|
2219
|
+
}
|
|
2220
|
+
) : B ? /* @__PURE__ */ a(
|
|
2221
|
+
jr,
|
|
2222
|
+
{
|
|
2223
|
+
ref: l,
|
|
2224
|
+
itemData: ie,
|
|
2225
|
+
outerRef: h,
|
|
2226
|
+
innerRef: s,
|
|
2227
|
+
onScroll: tt,
|
|
2228
|
+
columnCount: z,
|
|
2229
|
+
columnWidth: W,
|
|
2230
|
+
rowHeight: N,
|
|
2231
|
+
height: j,
|
|
2232
|
+
width: U,
|
|
2233
|
+
estimatedColumnWidth: G,
|
|
2234
|
+
estimatedRowHeight: B,
|
|
2235
|
+
rowCount: R,
|
|
2236
|
+
className: ae(
|
|
2237
|
+
ue["rp-pages"],
|
|
2238
|
+
p === te.HORIZONTAL_SCROLLING ? ue["rp-pages-horizontal-scroll"] : ""
|
|
2239
|
+
),
|
|
2240
|
+
style: {
|
|
2241
|
+
"--rp-page-height": `${B}px`,
|
|
2242
|
+
"--rp-page-width": `${G}px`,
|
|
2243
|
+
"--rp-row-count": `${R}`,
|
|
2244
|
+
"--rp-column-count": `${z}`
|
|
2245
|
+
},
|
|
2246
|
+
children: oi
|
|
2247
|
+
}
|
|
2248
|
+
) : w ? null : /* @__PURE__ */ a(
|
|
2249
|
+
"div",
|
|
2250
|
+
{
|
|
2251
|
+
className: ue["rp-loader"],
|
|
2252
|
+
style: {
|
|
2253
|
+
display: "flex",
|
|
2254
|
+
justifyContent: "center",
|
|
2255
|
+
alignItems: "center",
|
|
2256
|
+
height: "100%",
|
|
2257
|
+
width: "100%"
|
|
2258
|
+
},
|
|
2259
|
+
children: S && /* @__PURE__ */ a(S, {})
|
|
2260
|
+
}
|
|
2261
|
+
) }) }) }),
|
|
2262
|
+
_ && /* @__PURE__ */ a(Qo, {})
|
|
2263
|
+
] });
|
|
2264
|
+
}, Me = {
|
|
2265
|
+
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
2266
|
+
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
|
|
2267
|
+
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2268
|
+
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2269
|
+
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2270
|
+
}, pt = {
|
|
2271
|
+
"rp-paginate": "_rp-paginate_1gck0_1",
|
|
2272
|
+
"rp-page-input": "_rp-page-input_1gck0_6",
|
|
2273
|
+
"rp-total-page": "_rp-total-page_1gck0_18"
|
|
2274
|
+
}, ri = () => {
|
|
2275
|
+
const { prevIcon: t } = Ce(), { prevIcon: e } = be();
|
|
2276
|
+
return t || e || /* @__PURE__ */ a(Ke, {});
|
|
2277
|
+
}, ii = () => {
|
|
2278
|
+
const { nextIcon: t } = Ce(), { nextIcon: e } = be();
|
|
2279
|
+
return t || e || /* @__PURE__ */ a(Ke, { style: { transform: "rotate(180deg" } });
|
|
2280
|
+
}, ai = () => {
|
|
2281
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = ce(), [c, l] = $(t.toString()), { pageNavigationTool: d = !0 } = Te(), { pageNavigationTool: h = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: T } = Fe(), { scrollMode: f } = Ee(), { localeMessages: v } = he();
|
|
2282
|
+
D(() => {
|
|
2283
|
+
l(t.toString());
|
|
2284
|
+
}, [t]);
|
|
2285
|
+
const C = E((p) => {
|
|
2286
|
+
const u = p.target.value;
|
|
2287
|
+
l(u);
|
|
2288
|
+
}, []), P = E(async () => {
|
|
2289
|
+
const p = i(c);
|
|
2290
|
+
p.success || l(p.currentPage.toString());
|
|
2291
|
+
}, [i, c, e]), b = E(() => {
|
|
2292
|
+
l(t.toString());
|
|
2293
|
+
}, [t]), y = E(
|
|
2294
|
+
(p) => {
|
|
2295
|
+
p.key === "Enter" && P();
|
|
2296
|
+
},
|
|
2297
|
+
[P]
|
|
2298
|
+
), g = k(() => T === Re.DUAL_PAGE && f === te.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, T, f]);
|
|
2299
|
+
return !d || !h ? null : typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2300
|
+
d,
|
|
2301
|
+
{
|
|
2302
|
+
total: e,
|
|
2303
|
+
current: t,
|
|
2304
|
+
nextPage: r,
|
|
2305
|
+
prevPage: o,
|
|
2306
|
+
goToPage: i,
|
|
2307
|
+
changePage: n
|
|
2308
|
+
}
|
|
2309
|
+
) : typeof h != "boolean" ? /* @__PURE__ */ a(
|
|
2310
|
+
h,
|
|
2311
|
+
{
|
|
2312
|
+
total: e,
|
|
2313
|
+
current: t,
|
|
2314
|
+
nextPage: r,
|
|
2315
|
+
prevPage: o,
|
|
2316
|
+
goToPage: i,
|
|
2317
|
+
changePage: n
|
|
2318
|
+
}
|
|
2319
|
+
) : /* @__PURE__ */ H("div", { className: pt["rp-paginate"], children: [
|
|
2320
|
+
!m && /* @__PURE__ */ a(Q, { content: v == null ? void 0 : v.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2321
|
+
ge,
|
|
2322
|
+
{
|
|
2323
|
+
onClick: o,
|
|
2324
|
+
"aria-label": v == null ? void 0 : v.previousPageTooltip,
|
|
2325
|
+
"aria-disabled": t === 1,
|
|
2326
|
+
children: /* @__PURE__ */ a(ri, {})
|
|
2327
|
+
}
|
|
2328
|
+
) }),
|
|
2329
|
+
/* @__PURE__ */ a(Q, { content: v == null ? void 0 : v.currentPageTooltip, children: /* @__PURE__ */ a(
|
|
2330
|
+
on,
|
|
2331
|
+
{
|
|
2332
|
+
onKeyDown: y,
|
|
2333
|
+
onBlur: b,
|
|
2334
|
+
onChange: C,
|
|
2335
|
+
value: c,
|
|
2336
|
+
className: pt["rp-page-input"],
|
|
2337
|
+
id: "page-input",
|
|
2338
|
+
name: "page-input"
|
|
2339
|
+
}
|
|
2340
|
+
) }),
|
|
2341
|
+
/* @__PURE__ */ H("span", { className: pt["rp-total-page"], children: [
|
|
2342
|
+
"/",
|
|
2343
|
+
e
|
|
2344
|
+
] }),
|
|
2345
|
+
!m && /* @__PURE__ */ a(Q, { content: v == null ? void 0 : v.nextPageTooltip, children: /* @__PURE__ */ a(
|
|
2346
|
+
ge,
|
|
2347
|
+
{
|
|
2348
|
+
onClick: r,
|
|
2349
|
+
"aria-label": v == null ? void 0 : v.nextPageTooltip,
|
|
2350
|
+
"aria-disabled": g,
|
|
2351
|
+
children: /* @__PURE__ */ a(ii, {})
|
|
2352
|
+
}
|
|
2353
|
+
) })
|
|
2354
|
+
] });
|
|
2355
|
+
};
|
|
2356
|
+
var St = "Dialog", [In, Vs] = ir(St), [si, le] = In(St), Rn = (t) => {
|
|
2357
|
+
const {
|
|
2358
|
+
__scopeDialog: e,
|
|
2359
|
+
children: n,
|
|
2360
|
+
open: r,
|
|
2361
|
+
defaultOpen: o,
|
|
2362
|
+
onOpenChange: i,
|
|
2363
|
+
modal: c = !0
|
|
2364
|
+
} = t, l = Z.useRef(null), d = Z.useRef(null), [h = !1, m] = cr({
|
|
2365
|
+
prop: r,
|
|
2366
|
+
defaultProp: o,
|
|
2367
|
+
onChange: i
|
|
2368
|
+
});
|
|
2369
|
+
return /* @__PURE__ */ a(
|
|
2370
|
+
si,
|
|
2371
|
+
{
|
|
2372
|
+
scope: e,
|
|
2373
|
+
triggerRef: l,
|
|
2374
|
+
contentRef: d,
|
|
2375
|
+
contentId: at(),
|
|
2376
|
+
titleId: at(),
|
|
2377
|
+
descriptionId: at(),
|
|
2378
|
+
open: h,
|
|
2379
|
+
onOpenChange: m,
|
|
2380
|
+
onOpenToggle: Z.useCallback(() => m((T) => !T), [m]),
|
|
2381
|
+
modal: c,
|
|
2382
|
+
children: n
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
};
|
|
2386
|
+
Rn.displayName = St;
|
|
2387
|
+
var Ln = "DialogTrigger", ci = Z.forwardRef(
|
|
2388
|
+
(t, e) => {
|
|
2389
|
+
const { __scopeDialog: n, ...r } = t, o = le(Ln, n), i = Tt(e, o.triggerRef);
|
|
2390
|
+
return /* @__PURE__ */ a(
|
|
2391
|
+
Ge.button,
|
|
2392
|
+
{
|
|
2393
|
+
type: "button",
|
|
2394
|
+
"aria-haspopup": "dialog",
|
|
2395
|
+
"aria-expanded": o.open,
|
|
2396
|
+
"aria-controls": o.contentId,
|
|
2397
|
+
"data-state": Rt(o.open),
|
|
2398
|
+
...r,
|
|
2399
|
+
ref: i,
|
|
2400
|
+
onClick: We(t.onClick, o.onOpenToggle)
|
|
2401
|
+
}
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
);
|
|
2405
|
+
ci.displayName = Ln;
|
|
2406
|
+
var xt = "DialogPortal", [li, En] = In(xt, {
|
|
2407
|
+
forceMount: void 0
|
|
2408
|
+
}), Nn = (t) => {
|
|
2409
|
+
const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, i = le(xt, e);
|
|
2410
|
+
return /* @__PURE__ */ a(li, { scope: e, forceMount: n, children: Z.Children.map(r, (c) => /* @__PURE__ */ a(Ct, { present: n || i.open, children: /* @__PURE__ */ a(fr, { asChild: !0, container: o, children: c }) })) });
|
|
2411
|
+
};
|
|
2412
|
+
Nn.displayName = xt;
|
|
2413
|
+
var Xe = "DialogOverlay", On = Z.forwardRef(
|
|
2414
|
+
(t, e) => {
|
|
2415
|
+
const n = En(Xe, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = le(Xe, t.__scopeDialog);
|
|
2416
|
+
return i.modal ? /* @__PURE__ */ a(Ct, { present: r || i.open, children: /* @__PURE__ */ a(di, { ...o, ref: e }) }) : null;
|
|
2417
|
+
}
|
|
2418
|
+
);
|
|
2419
|
+
On.displayName = Xe;
|
|
2420
|
+
var di = Z.forwardRef(
|
|
2421
|
+
(t, e) => {
|
|
2422
|
+
const { __scopeDialog: n, ...r } = t, o = le(Xe, n);
|
|
2423
|
+
return (
|
|
2424
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2425
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
2426
|
+
/* @__PURE__ */ a(dr, { as: ar, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ a(
|
|
2427
|
+
Ge.div,
|
|
2428
|
+
{
|
|
2429
|
+
"data-state": Rt(o.open),
|
|
2430
|
+
...r,
|
|
2431
|
+
ref: e,
|
|
2432
|
+
style: { pointerEvents: "auto", ...r.style }
|
|
2433
|
+
}
|
|
2434
|
+
) })
|
|
2435
|
+
);
|
|
2436
|
+
}
|
|
2437
|
+
), Le = "DialogContent", Dn = Z.forwardRef(
|
|
2438
|
+
(t, e) => {
|
|
2439
|
+
const n = En(Le, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = le(Le, t.__scopeDialog);
|
|
2440
|
+
return /* @__PURE__ */ a(Ct, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(ui, { ...o, ref: e }) : /* @__PURE__ */ a(pi, { ...o, ref: e }) });
|
|
2441
|
+
}
|
|
2442
|
+
);
|
|
2443
|
+
Dn.displayName = Le;
|
|
2444
|
+
var ui = Z.forwardRef(
|
|
2445
|
+
(t, e) => {
|
|
2446
|
+
const n = le(Le, t.__scopeDialog), r = Z.useRef(null), o = Tt(e, n.contentRef, r);
|
|
2447
|
+
return Z.useEffect(() => {
|
|
2448
|
+
const i = r.current;
|
|
2449
|
+
if (i)
|
|
2450
|
+
return ur(i);
|
|
2451
|
+
}, []), /* @__PURE__ */ a(
|
|
2452
|
+
An,
|
|
2453
|
+
{
|
|
2454
|
+
...t,
|
|
2455
|
+
ref: o,
|
|
2456
|
+
trapFocus: n.open,
|
|
2457
|
+
disableOutsidePointerEvents: !0,
|
|
2458
|
+
onCloseAutoFocus: We(t.onCloseAutoFocus, (i) => {
|
|
2459
|
+
var c;
|
|
2460
|
+
i.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
2461
|
+
}),
|
|
2462
|
+
onPointerDownOutside: We(t.onPointerDownOutside, (i) => {
|
|
2463
|
+
const c = i.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
2464
|
+
(c.button === 2 || l) && i.preventDefault();
|
|
2465
|
+
}),
|
|
2466
|
+
onFocusOutside: We(
|
|
2467
|
+
t.onFocusOutside,
|
|
2468
|
+
(i) => i.preventDefault()
|
|
2469
|
+
)
|
|
2470
|
+
}
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
), pi = Z.forwardRef(
|
|
2474
|
+
(t, e) => {
|
|
2475
|
+
const n = le(Le, t.__scopeDialog), r = Z.useRef(!1), o = Z.useRef(!1);
|
|
2476
|
+
return /* @__PURE__ */ a(
|
|
2477
|
+
An,
|
|
2478
|
+
{
|
|
2479
|
+
...t,
|
|
2480
|
+
ref: e,
|
|
2481
|
+
trapFocus: !1,
|
|
2482
|
+
disableOutsidePointerEvents: !1,
|
|
2483
|
+
onCloseAutoFocus: (i) => {
|
|
2484
|
+
var c, l;
|
|
2485
|
+
(c = t.onCloseAutoFocus) == null || c.call(t, i), i.defaultPrevented || (r.current || (l = n.triggerRef.current) == null || l.focus(), i.preventDefault()), r.current = !1, o.current = !1;
|
|
2486
|
+
},
|
|
2487
|
+
onInteractOutside: (i) => {
|
|
2488
|
+
var d, h;
|
|
2489
|
+
(d = t.onInteractOutside) == null || d.call(t, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
2490
|
+
const c = i.target;
|
|
2491
|
+
((h = n.triggerRef.current) == null ? void 0 : h.contains(c)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
);
|
|
2495
|
+
}
|
|
2496
|
+
), An = Z.forwardRef(
|
|
2497
|
+
(t, e) => {
|
|
2498
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = le(Le, n), d = Z.useRef(null), h = Tt(e, d);
|
|
2499
|
+
return pr(), /* @__PURE__ */ H(pe, { children: [
|
|
2500
|
+
/* @__PURE__ */ a(
|
|
2501
|
+
hr,
|
|
2502
|
+
{
|
|
2503
|
+
asChild: !0,
|
|
2504
|
+
loop: !0,
|
|
2505
|
+
trapped: r,
|
|
2506
|
+
onMountAutoFocus: o,
|
|
2507
|
+
onUnmountAutoFocus: i,
|
|
2508
|
+
children: /* @__PURE__ */ a(
|
|
2509
|
+
lr,
|
|
2510
|
+
{
|
|
2511
|
+
role: "dialog",
|
|
2512
|
+
id: l.contentId,
|
|
2513
|
+
"aria-describedby": l.descriptionId,
|
|
2514
|
+
"aria-labelledby": l.titleId,
|
|
2515
|
+
"data-state": Rt(l.open),
|
|
2516
|
+
...c,
|
|
2517
|
+
ref: h,
|
|
2518
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
2519
|
+
}
|
|
2520
|
+
)
|
|
2521
|
+
}
|
|
2522
|
+
),
|
|
2523
|
+
/* @__PURE__ */ H(pe, { children: [
|
|
2524
|
+
/* @__PURE__ */ a(fi, { titleId: l.titleId }),
|
|
2525
|
+
/* @__PURE__ */ a(gi, { contentRef: d, descriptionId: l.descriptionId })
|
|
2526
|
+
] })
|
|
2527
|
+
] });
|
|
2528
|
+
}
|
|
2529
|
+
), It = "DialogTitle", zn = Z.forwardRef(
|
|
2530
|
+
(t, e) => {
|
|
2531
|
+
const { __scopeDialog: n, ...r } = t, o = le(It, n);
|
|
2532
|
+
return /* @__PURE__ */ a(Ge.h2, { id: o.titleId, ...r, ref: e });
|
|
2533
|
+
}
|
|
2534
|
+
);
|
|
2535
|
+
zn.displayName = It;
|
|
2536
|
+
var Fn = "DialogDescription", hi = Z.forwardRef(
|
|
2537
|
+
(t, e) => {
|
|
2538
|
+
const { __scopeDialog: n, ...r } = t, o = le(Fn, n);
|
|
2539
|
+
return /* @__PURE__ */ a(Ge.p, { id: o.descriptionId, ...r, ref: e });
|
|
2540
|
+
}
|
|
2541
|
+
);
|
|
2542
|
+
hi.displayName = Fn;
|
|
2543
|
+
var Mn = "DialogClose", kn = Z.forwardRef(
|
|
2544
|
+
(t, e) => {
|
|
2545
|
+
const { __scopeDialog: n, ...r } = t, o = le(Mn, n);
|
|
2546
|
+
return /* @__PURE__ */ a(
|
|
2547
|
+
Ge.button,
|
|
2548
|
+
{
|
|
2549
|
+
type: "button",
|
|
2550
|
+
...r,
|
|
2551
|
+
ref: e,
|
|
2552
|
+
onClick: We(t.onClick, () => o.onOpenChange(!1))
|
|
2553
|
+
}
|
|
2554
|
+
);
|
|
2555
|
+
}
|
|
2556
|
+
);
|
|
2557
|
+
kn.displayName = Mn;
|
|
2558
|
+
function Rt(t) {
|
|
2559
|
+
return t ? "open" : "closed";
|
|
2560
|
+
}
|
|
2561
|
+
var Wn = "DialogTitleWarning", [Us, Hn] = sr(Wn, {
|
|
2562
|
+
contentName: Le,
|
|
2563
|
+
titleName: It,
|
|
2564
|
+
docsSlug: "dialog"
|
|
2565
|
+
}), fi = ({ titleId: t }) => {
|
|
2566
|
+
const e = Hn(Wn), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2567
|
+
|
|
2568
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2569
|
+
|
|
2570
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;
|
|
2571
|
+
return Z.useEffect(() => {
|
|
2572
|
+
t && (document.getElementById(t) || console.error(n));
|
|
2573
|
+
}, [n, t]), null;
|
|
2574
|
+
}, mi = "DialogDescriptionWarning", gi = ({ contentRef: t, descriptionId: e }) => {
|
|
2575
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hn(mi).contentName}}.`;
|
|
2576
|
+
return Z.useEffect(() => {
|
|
2577
|
+
var i;
|
|
2578
|
+
const o = (i = t.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2579
|
+
e && o && (document.getElementById(e) || console.warn(r));
|
|
2580
|
+
}, [r, t, e]), null;
|
|
2581
|
+
}, vi = Rn, wi = Nn, _i = On, bi = Dn, Ti = zn, Ci = kn;
|
|
2582
|
+
const Ie = {
|
|
2583
|
+
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2584
|
+
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
2585
|
+
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
2586
|
+
"rp-document-properties": "_rp-document-properties_slqo7_35",
|
|
2587
|
+
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2588
|
+
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2589
|
+
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2590
|
+
}, Pi = () => {
|
|
2591
|
+
const { pdfProperties: t } = ne(), { container: e } = _e(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = _o(), { localeMessages: o } = he(), i = k(() => {
|
|
2592
|
+
if (!t)
|
|
2593
|
+
return [];
|
|
2594
|
+
const {
|
|
2595
|
+
fileSize: c,
|
|
2596
|
+
filename: l,
|
|
2597
|
+
title: d,
|
|
2598
|
+
author: h,
|
|
2599
|
+
subject: m,
|
|
2600
|
+
createdOn: T,
|
|
2601
|
+
creator: f,
|
|
2602
|
+
keywords: v,
|
|
2603
|
+
modifiedOn: C,
|
|
2604
|
+
pdfProducer: P,
|
|
2605
|
+
pdfVersion: b,
|
|
2606
|
+
pageCount: y
|
|
2607
|
+
} = t;
|
|
2608
|
+
return [
|
|
2609
|
+
{ label: o == null ? void 0 : o.propertiesFilenameLabel, value: l },
|
|
2610
|
+
{ label: o == null ? void 0 : o.propertiesFileSizeLabel, value: c },
|
|
2611
|
+
{ separate: !0 },
|
|
2612
|
+
{ label: o == null ? void 0 : o.propertiesTitleLabel, value: d },
|
|
2613
|
+
{ label: o == null ? void 0 : o.propertiesAuthorLabel, value: h },
|
|
2614
|
+
{ label: o == null ? void 0 : o.propertiesSubjectLabel, value: m },
|
|
2615
|
+
{ label: o == null ? void 0 : o.propertiesKeywordLabel, value: v },
|
|
2616
|
+
{ label: o == null ? void 0 : o.propertiesCreatorLabel, value: f },
|
|
2617
|
+
{
|
|
2618
|
+
label: o == null ? void 0 : o.propertiesCreateOnLabel,
|
|
2619
|
+
value: T ? At(T) : ""
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
label: o == null ? void 0 : o.propertiesModifiedOnLabel,
|
|
2623
|
+
value: C ? At(C) : ""
|
|
2624
|
+
},
|
|
2625
|
+
{ separate: !0 },
|
|
2626
|
+
{ label: o == null ? void 0 : o.propertiesPDFProducerLabel, value: P },
|
|
2627
|
+
{ label: o == null ? void 0 : o.propertiesPDFVersionLabel, value: b },
|
|
2628
|
+
{ label: o == null ? void 0 : o.propertiesPageCountLabel, value: y }
|
|
2629
|
+
];
|
|
2630
|
+
}, [t, o]);
|
|
2631
|
+
return /* @__PURE__ */ a(vi, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(wi, { container: e, children: /* @__PURE__ */ H("div", { className: Ie["rp-dialog-wrapper"], children: [
|
|
2632
|
+
/* @__PURE__ */ a(_i, { className: Ie["rp-dialog-overlay"] }),
|
|
2633
|
+
/* @__PURE__ */ H(bi, { className: Ie["rp-document-dialog"], children: [
|
|
2634
|
+
/* @__PURE__ */ a(Ti, { className: Ie["rp-dialog-title"], children: o == null ? void 0 : o.documentPropertiesLabel }),
|
|
2635
|
+
/* @__PURE__ */ a("div", { className: Ie["rp-document-properties"], children: i.map((c, l) => /* @__PURE__ */ a("div", { children: c.separate ? /* @__PURE__ */ a("div", { className: Ie["rp-properties-divider"] }) : /* @__PURE__ */ a(Lo, { label: c.label, value: c.value }) }, l)) }),
|
|
2636
|
+
/* @__PURE__ */ a(Ci, { asChild: !0, className: Ie["rp-dialog-close"], children: /* @__PURE__ */ a(mr, {}) })
|
|
2637
|
+
] })
|
|
2638
|
+
] }) }) });
|
|
2639
|
+
}, yi = {
|
|
2640
|
+
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2641
|
+
}, Qt = ".pdf", Si = (t) => URL.createObjectURL(t), xi = async (t) => {
|
|
2642
|
+
const n = await (await fetch(t)).blob();
|
|
2643
|
+
return Si(n);
|
|
2644
|
+
}, $n = () => {
|
|
2645
|
+
const { filename: t, pdfSrc: e } = ne(), { downloadFilename: n } = mo(), r = (i) => {
|
|
2646
|
+
const c = n || i;
|
|
2647
|
+
return c.endsWith(Qt) ? c : `${c}${Qt}`;
|
|
2648
|
+
};
|
|
2649
|
+
return { download: E(async () => {
|
|
2650
|
+
if (!t || !e)
|
|
2651
|
+
throw new Error("There is no PDF source to download");
|
|
2652
|
+
const i = document.createElement("a");
|
|
2653
|
+
i.href = await xi(e), i.download = r(t), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
2654
|
+
}, [t, e]) };
|
|
2655
|
+
}, qn = () => {
|
|
2656
|
+
const { downloadIcon: t } = Ce(), { downloadIcon: e } = be();
|
|
2657
|
+
return t || e || /* @__PURE__ */ a(_r, {});
|
|
2658
|
+
}, Gn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ii = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Gn, { localeMessages: e, children: /* @__PURE__ */ a(ge, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(qn, {}) }) }), Ri = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Ze, { onClick: t, children: /* @__PURE__ */ H(Gn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2659
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(qn, {}) }),
|
|
2660
|
+
e == null ? void 0 : e.downloadFileLabel
|
|
2661
|
+
] }) }), Vn = () => {
|
|
2662
|
+
const { download: t } = $n(), { downloadTool: e = !0 } = Te(), { downloadTool: n = !0 } = Ne(), { isSmallScreen: r } = Oe(), { localeMessages: o } = he(), i = o == null ? void 0 : o.downloadFileTooltip;
|
|
2663
|
+
return !e || !n ? null : r ? /* @__PURE__ */ a(Ri, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(n, { download: t }) }) : /* @__PURE__ */ a(Ii, { download: t, localeMessages: o });
|
|
2664
|
+
}, Un = () => {
|
|
2665
|
+
const { printIcon: t } = Ce(), { printIcon: e } = be();
|
|
2666
|
+
return t || e || /* @__PURE__ */ a(br, {});
|
|
2667
|
+
}, Bn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Li = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Bn, { localeMessages: e, children: /* @__PURE__ */ a(ge, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), Ei = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Ze, { onClick: t, children: /* @__PURE__ */ H(Bn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2668
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
|
|
2669
|
+
e == null ? void 0 : e.printLabel
|
|
2670
|
+
] }) }), jn = () => {
|
|
2671
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = et(), { printTool: c = !0 } = Te(), { printTool: l = !0 } = Ne(), { isSmallScreen: d } = Oe(), { localeMessages: h } = he(), m = h == null ? void 0 : h.printTooltip;
|
|
2672
|
+
return !c || !l ? null : d ? /* @__PURE__ */ a(Ei, { print: t, localeMessages: h }) : typeof c == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
2673
|
+
c,
|
|
2674
|
+
{
|
|
2675
|
+
print: t,
|
|
2676
|
+
cancel: e,
|
|
2677
|
+
setOnProgress: n,
|
|
2678
|
+
setOnError: o,
|
|
2679
|
+
setOnComplete: r,
|
|
2680
|
+
progress: i
|
|
2681
|
+
}
|
|
2682
|
+
) }) : typeof l == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
2683
|
+
l,
|
|
2684
|
+
{
|
|
2685
|
+
print: t,
|
|
2686
|
+
cancel: e,
|
|
2687
|
+
setOnProgress: n,
|
|
2688
|
+
setOnError: o,
|
|
2689
|
+
setOnComplete: r,
|
|
2690
|
+
progress: i
|
|
2691
|
+
}
|
|
2692
|
+
) }) : /* @__PURE__ */ a(Li, { print: t, localeMessages: h });
|
|
2693
|
+
}, Ni = {
|
|
2694
|
+
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2695
|
+
}, Oi = () => {
|
|
2696
|
+
const { goToFirstPageIcon: t } = Ce(), { goToFirstPageIcon: e } = be();
|
|
2697
|
+
return t || e || /* @__PURE__ */ a(hn, { className: Ni["rp-go-to-Top"] });
|
|
2698
|
+
}, Di = () => {
|
|
2699
|
+
const { goToLastPageIcon: t } = Ce(), { goToLastPageIcon: e } = be();
|
|
2700
|
+
return t || e || /* @__PURE__ */ a(hn, {});
|
|
2701
|
+
}, Yt = { width: "100%" }, Ai = () => {
|
|
2702
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = ce(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = Ne(), { localeMessages: i } = he(), c = k(() => n === 1, [n]), l = k(() => n === e, [n, e]), d = E(() => {
|
|
2703
|
+
t(1);
|
|
2704
|
+
}, [t]), h = E(() => {
|
|
2705
|
+
t(e);
|
|
2706
|
+
}, [t, e]);
|
|
2707
|
+
return !r || !o ? null : /* @__PURE__ */ H(un, { children: [
|
|
2708
|
+
/* @__PURE__ */ a(Ze, { onClick: d, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.firstPageTooltip, style: Yt, children: /* @__PURE__ */ H("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2709
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Oi, {}) }),
|
|
2710
|
+
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.firstPageLabel })
|
|
2711
|
+
] }) }) }),
|
|
2712
|
+
/* @__PURE__ */ a(Ze, { onClick: h, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.lastPageTooltip, style: Yt, children: /* @__PURE__ */ H("div", { className: "rp-menu-item", "aria-disabled": l, children: [
|
|
2713
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Di, {}) }),
|
|
2714
|
+
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.lastPageLabel })
|
|
2715
|
+
] }) }) }),
|
|
2716
|
+
/* @__PURE__ */ a(ln, {})
|
|
2717
|
+
] });
|
|
2718
|
+
}, zi = () => {
|
|
2719
|
+
const [t, e] = $(!1), { container: n, pagesRef: r } = _e(), { isSmallScreen: o } = Oe(), {
|
|
2720
|
+
openFileTool: i,
|
|
2721
|
+
downloadTool: c,
|
|
2722
|
+
documentProperties: l,
|
|
2723
|
+
scrollModeTool: d,
|
|
2724
|
+
rotateTool: h,
|
|
2725
|
+
selectionModeTool: m,
|
|
2726
|
+
jumpNavigationTool: T,
|
|
2727
|
+
printTool: f,
|
|
2728
|
+
fullscreenTool: v,
|
|
2729
|
+
viewModeTool: C
|
|
2730
|
+
} = Te(), {
|
|
2731
|
+
openFileTool: P,
|
|
2732
|
+
downloadTool: b,
|
|
2733
|
+
documentProperties: y,
|
|
2734
|
+
scrollModeTool: g,
|
|
2735
|
+
rotateTool: p,
|
|
2736
|
+
selectionModeTool: u,
|
|
2737
|
+
jumpNavigationTool: s,
|
|
2738
|
+
printTool: w,
|
|
2739
|
+
fullscreenTool: _,
|
|
2740
|
+
viewModeTool: S
|
|
2741
|
+
} = Ne(), { localeMessages: L } = he(), [x, I] = $(0), O = M(
|
|
2742
|
+
new ResizeObserver((R) => {
|
|
2743
|
+
I(R[0].contentRect.height);
|
|
2744
|
+
})
|
|
2745
|
+
), A = k(() => T || h || m || d || l || C || o && (i || c || f || v), [
|
|
2746
|
+
i,
|
|
2747
|
+
c,
|
|
2748
|
+
f,
|
|
2749
|
+
v,
|
|
2750
|
+
l,
|
|
2751
|
+
d,
|
|
2752
|
+
h,
|
|
2753
|
+
m,
|
|
2754
|
+
T,
|
|
2755
|
+
o
|
|
2756
|
+
]), F = k(() => s || p || u || g || y || S || o && (P || b || w || _), [
|
|
2757
|
+
P,
|
|
2758
|
+
b,
|
|
2759
|
+
w,
|
|
2760
|
+
_,
|
|
2761
|
+
y,
|
|
2762
|
+
g,
|
|
2763
|
+
p,
|
|
2764
|
+
u,
|
|
2765
|
+
s,
|
|
2766
|
+
o
|
|
2767
|
+
]);
|
|
2768
|
+
return D(() => (r && O.current.observe(r), () => {
|
|
2769
|
+
O.current.disconnect();
|
|
2770
|
+
}), [r]), !A || !F ? null : /* @__PURE__ */ H(pe, { children: [
|
|
2771
|
+
/* @__PURE__ */ a(
|
|
2772
|
+
cn,
|
|
2773
|
+
{
|
|
2774
|
+
container: n,
|
|
2775
|
+
onOpenChange: e,
|
|
2776
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: L == null ? void 0 : L.moreOptionTooltip, children: /* @__PURE__ */ a(ge, { active: t, "aria-label": L == null ? void 0 : L.moreOptionTooltip, children: /* @__PURE__ */ a(rr, {}) }) }) }),
|
|
2777
|
+
side: "bottom",
|
|
2778
|
+
avoidCollisions: !1,
|
|
2779
|
+
children: /* @__PURE__ */ H(
|
|
2780
|
+
"div",
|
|
2781
|
+
{
|
|
2782
|
+
style: { maxHeight: `${x}px`, overflow: "auto" },
|
|
2783
|
+
className: yi["rp-other-tool-content"],
|
|
2784
|
+
"data-rp": "moreOptionsDropdown",
|
|
2785
|
+
children: [
|
|
2786
|
+
o && /* @__PURE__ */ H(un, { children: [
|
|
2787
|
+
/* @__PURE__ */ a(dn, {}),
|
|
2788
|
+
/* @__PURE__ */ a(Vn, {}),
|
|
2789
|
+
/* @__PURE__ */ a(jn, {}),
|
|
2790
|
+
/* @__PURE__ */ a(pn, {}),
|
|
2791
|
+
/* @__PURE__ */ a(ln, {})
|
|
2792
|
+
] }),
|
|
2793
|
+
/* @__PURE__ */ a(Ai, {}),
|
|
2794
|
+
/* @__PURE__ */ a(Eo, {}),
|
|
2795
|
+
/* @__PURE__ */ a(Tr, {}),
|
|
2796
|
+
/* @__PURE__ */ a(vr, {}),
|
|
2797
|
+
/* @__PURE__ */ a(wr, {}),
|
|
2798
|
+
/* @__PURE__ */ a(gr, {})
|
|
2799
|
+
]
|
|
2800
|
+
}
|
|
2801
|
+
)
|
|
2802
|
+
}
|
|
2803
|
+
),
|
|
2804
|
+
/* @__PURE__ */ a(Pi, {})
|
|
2805
|
+
] });
|
|
2806
|
+
}, Fi = () => {
|
|
2807
|
+
const { isSmallScreen: t } = Oe();
|
|
2808
|
+
return /* @__PURE__ */ H(pe, { children: [
|
|
2809
|
+
/* @__PURE__ */ a(or, {}),
|
|
2810
|
+
!t && /* @__PURE__ */ H(pe, { children: [
|
|
2811
|
+
/* @__PURE__ */ a(dn, {}),
|
|
2812
|
+
/* @__PURE__ */ a(Vn, {}),
|
|
2813
|
+
/* @__PURE__ */ a(jn, {}),
|
|
2814
|
+
/* @__PURE__ */ a(pn, {})
|
|
2815
|
+
] }),
|
|
2816
|
+
/* @__PURE__ */ a(zi, {})
|
|
2817
|
+
] });
|
|
2818
|
+
}, Jt = () => {
|
|
2819
|
+
const { totalMatches: t, nextMatch: e, prevMatch: n } = Pt(), { localeMessages: r } = he();
|
|
2820
|
+
return /* @__PURE__ */ H(pe, { children: [
|
|
2821
|
+
/* @__PURE__ */ a(
|
|
2822
|
+
Q,
|
|
2823
|
+
{
|
|
2824
|
+
content: r == null ? void 0 : r.searchPrevTooltip,
|
|
2825
|
+
className: ee["rp-search-tool-result-navigator"],
|
|
2826
|
+
children: /* @__PURE__ */ a(ge, { tabIndex: 0, onClick: n, "aria-label": r == null ? void 0 : r.searchPrevTooltip, children: /* @__PURE__ */ a(
|
|
2827
|
+
Ke,
|
|
2828
|
+
{
|
|
2829
|
+
className: ee["rp-search-tool-input-icon"],
|
|
2830
|
+
"aria-disabled": !t
|
|
2831
|
+
}
|
|
2832
|
+
) })
|
|
2833
|
+
}
|
|
2834
|
+
),
|
|
2835
|
+
/* @__PURE__ */ a(
|
|
2836
|
+
Q,
|
|
2837
|
+
{
|
|
2838
|
+
content: r == null ? void 0 : r.searchNextTooltip,
|
|
2839
|
+
className: ee["rp-search-tool-result-navigator"],
|
|
2840
|
+
children: /* @__PURE__ */ a(ge, { tabIndex: 0, onClick: e, "aria-label": r == null ? void 0 : r.searchNextTooltip, children: /* @__PURE__ */ a(
|
|
2841
|
+
Ke,
|
|
2842
|
+
{
|
|
2843
|
+
style: { transform: "rotate(180deg" },
|
|
2844
|
+
className: ee["rp-search-tool-input-icon"],
|
|
2845
|
+
"aria-disabled": !t
|
|
2846
|
+
}
|
|
2847
|
+
) })
|
|
2848
|
+
}
|
|
2849
|
+
)
|
|
2850
|
+
] });
|
|
2851
|
+
}, Mi = () => {
|
|
2852
|
+
const { searchIcon: t } = Ce(), { searchIcon: e } = be();
|
|
2853
|
+
return t || e || /* @__PURE__ */ a(fn, {});
|
|
2854
|
+
}, ki = ({ icon: t }) => {
|
|
2855
|
+
const { container: e } = _e(), [n, r] = $(!1), { pdf: o } = ne(), [i, c] = $(null), {
|
|
2856
|
+
searchOptions: l,
|
|
2857
|
+
setSearchOptions: d,
|
|
2858
|
+
loading: h,
|
|
2859
|
+
setSearch: m,
|
|
2860
|
+
totalMatches: T,
|
|
2861
|
+
currentMatchPosition: f,
|
|
2862
|
+
nextMatch: v,
|
|
2863
|
+
prevMatch: C,
|
|
2864
|
+
search: P
|
|
2865
|
+
} = Pt(), { searchTool: b = !0 } = Te(), { searchTool: y = !0 } = Ne(), [g, p] = $(P), { localeMessages: u } = he(), { isSmallScreen: s } = Oe(), [w, _] = $(null), [S, L] = $(!1), x = E(() => {
|
|
2866
|
+
r(!0);
|
|
2867
|
+
}, []), I = E(() => {
|
|
2868
|
+
m(""), p(""), r(!1);
|
|
2869
|
+
}, [m]), O = (q) => {
|
|
2870
|
+
const X = q.key === "Enter", oe = q.key === " ";
|
|
2871
|
+
(X || oe) && I();
|
|
2872
|
+
}, A = E(
|
|
2873
|
+
(q) => {
|
|
2874
|
+
q.key === "Escape" && n && I();
|
|
2875
|
+
},
|
|
2876
|
+
[n]
|
|
2877
|
+
), F = E(
|
|
2878
|
+
(q) => {
|
|
2879
|
+
q.shiftKey && q.key === "Enter" ? C() : q.key === "Enter" && P !== g ? m(g) : q.key === "Enter" && v();
|
|
2880
|
+
},
|
|
2881
|
+
[g, C, v, m, P]
|
|
2882
|
+
);
|
|
2883
|
+
D(() => {
|
|
2884
|
+
p(P);
|
|
2885
|
+
}, [P]), D(() => {
|
|
2886
|
+
P && o && L(!0);
|
|
2887
|
+
}, [P, o]), D(() => {
|
|
2888
|
+
P && P.trim() !== "" && (p(P), m(P));
|
|
2889
|
+
}, []), D(() => (window.addEventListener("keydown", A), () => {
|
|
2890
|
+
window.removeEventListener("keydown", A);
|
|
2891
|
+
}), [A]), D(() => {
|
|
2892
|
+
i && setTimeout(() => {
|
|
2893
|
+
i.focus();
|
|
2894
|
+
}, 0);
|
|
2895
|
+
}, [i]);
|
|
2896
|
+
const R = E((q) => {
|
|
2897
|
+
p(q.target.value);
|
|
2898
|
+
}, []), N = E(() => {
|
|
2899
|
+
p(""), m("");
|
|
2900
|
+
}, [m]), z = k(() => `${f} / ${T}`, [f, T]), { wholeWords: W, matchCase: G } = k(() => l, [l]), B = E(
|
|
2901
|
+
(q) => {
|
|
2902
|
+
d((X) => ({ ...X, matchCase: q }));
|
|
2903
|
+
},
|
|
2904
|
+
[d]
|
|
2905
|
+
), K = E(
|
|
2906
|
+
(q) => {
|
|
2907
|
+
d((X) => ({ ...X, wholeWords: q }));
|
|
2908
|
+
},
|
|
2909
|
+
[d]
|
|
2910
|
+
);
|
|
2911
|
+
D(() => {
|
|
2912
|
+
o && S && I();
|
|
2913
|
+
}, [o, I]);
|
|
2914
|
+
const V = k(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]), J = E(
|
|
2915
|
+
(q) => {
|
|
2916
|
+
if (q.key === "Tab") {
|
|
2917
|
+
const X = document.activeElement;
|
|
2918
|
+
let oe = 0;
|
|
2919
|
+
V.forEach((ie, de) => {
|
|
2920
|
+
ie === X && (oe = de);
|
|
2921
|
+
});
|
|
2922
|
+
let re = oe + 1;
|
|
2923
|
+
q.shiftKey && (re = oe - 1);
|
|
2924
|
+
const Y = V[re];
|
|
2925
|
+
if (Y)
|
|
2926
|
+
Y.focus();
|
|
2927
|
+
else if (re > V.length - 1) {
|
|
2928
|
+
const ie = V[0];
|
|
2929
|
+
ie && ie.focus();
|
|
2930
|
+
} else {
|
|
2931
|
+
const ie = V[V.length - 1];
|
|
2932
|
+
ie && ie.focus();
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
},
|
|
2936
|
+
[V]
|
|
2937
|
+
);
|
|
2938
|
+
return !b || !y ? null : /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a(
|
|
2939
|
+
cn,
|
|
2940
|
+
{
|
|
2941
|
+
open: n,
|
|
2942
|
+
container: e,
|
|
2943
|
+
side: "bottom",
|
|
2944
|
+
align: "start",
|
|
2945
|
+
tabIndex: 0,
|
|
2946
|
+
avoidCollisions: !1,
|
|
2947
|
+
triggerComponent: /* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchButtonTooltip, children: /* @__PURE__ */ a(
|
|
2948
|
+
ge,
|
|
2949
|
+
{
|
|
2950
|
+
active: n,
|
|
2951
|
+
onClick: x,
|
|
2952
|
+
"aria-label": u == null ? void 0 : u.searchButtonTooltip,
|
|
2953
|
+
children: t || /* @__PURE__ */ a(Mi, {})
|
|
2954
|
+
}
|
|
2955
|
+
) }),
|
|
2956
|
+
children: /* @__PURE__ */ H(
|
|
2957
|
+
"div",
|
|
2958
|
+
{
|
|
2959
|
+
ref: _,
|
|
2960
|
+
className: ee["rp-search-tool-content"],
|
|
2961
|
+
tabIndex: 0,
|
|
2962
|
+
onKeyDown: J,
|
|
2963
|
+
children: [
|
|
2964
|
+
/* @__PURE__ */ H("div", { className: ee["rp-search-tool-input-wrapper"], children: [
|
|
2965
|
+
/* @__PURE__ */ H("div", { className: ee["rp-search-tool-input"], children: [
|
|
2966
|
+
/* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
2967
|
+
on,
|
|
2968
|
+
{
|
|
2969
|
+
value: g,
|
|
2970
|
+
onKeyDown: F,
|
|
2971
|
+
onChange: R,
|
|
2972
|
+
icon: /* @__PURE__ */ a(fn, {}),
|
|
2973
|
+
placeholder: u == null ? void 0 : u.searchInputPlaceholder,
|
|
2974
|
+
className: ee["rp-search-input"],
|
|
2975
|
+
ref: c,
|
|
2976
|
+
id: "search-input",
|
|
2977
|
+
name: "search-input",
|
|
2978
|
+
tabIndex: 0,
|
|
2979
|
+
children: !!g && /* @__PURE__ */ a("span", { className: ee["rp-search-tool-input-clear"], onClick: N, children: /* @__PURE__ */ a(Pr, {}) })
|
|
2980
|
+
}
|
|
2981
|
+
) }),
|
|
2982
|
+
h ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(_t, { className: ee["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: z }),
|
|
2983
|
+
s && /* @__PURE__ */ a("div", { className: ee["rp-search-tool-controls"], children: /* @__PURE__ */ a(Ot, { onKeyPress: O, handleClose: I }) })
|
|
2984
|
+
] }),
|
|
2985
|
+
/* @__PURE__ */ H("div", { className: ee["rp-search-tool-input-checkboxes"], children: [
|
|
2986
|
+
s && /* @__PURE__ */ a(Jt, {}),
|
|
2987
|
+
/* @__PURE__ */ a(
|
|
2988
|
+
Dt,
|
|
2989
|
+
{
|
|
2990
|
+
tabIndex: 0,
|
|
2991
|
+
name: "matchCase",
|
|
2992
|
+
value: G,
|
|
2993
|
+
onChange: B,
|
|
2994
|
+
children: u == null ? void 0 : u.searchMatchCaseLabel
|
|
2995
|
+
}
|
|
2996
|
+
),
|
|
2997
|
+
!s && /* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: ee["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Mt, {}) }) }),
|
|
2998
|
+
/* @__PURE__ */ a(
|
|
2999
|
+
Dt,
|
|
3000
|
+
{
|
|
3001
|
+
tabIndex: 0,
|
|
3002
|
+
name: "wholeWord",
|
|
3003
|
+
value: W,
|
|
3004
|
+
onChange: K,
|
|
3005
|
+
children: u == null ? void 0 : u.searchWholeWordsLabel
|
|
3006
|
+
}
|
|
3007
|
+
),
|
|
3008
|
+
!s && /* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { tabIndex: 0, className: ee["rp-search-icon-info"], children: /* @__PURE__ */ a(Mt, {}) }) })
|
|
3009
|
+
] })
|
|
3010
|
+
] }),
|
|
3011
|
+
!s && /* @__PURE__ */ H("div", { className: ee["rp-search-tool-controls"], children: [
|
|
3012
|
+
/* @__PURE__ */ a(Jt, {}),
|
|
3013
|
+
/* @__PURE__ */ a(Ot, { onKeyPress: O, handleClose: I })
|
|
3014
|
+
] })
|
|
3015
|
+
]
|
|
3016
|
+
}
|
|
3017
|
+
)
|
|
3018
|
+
}
|
|
3019
|
+
) });
|
|
3020
|
+
}, Wi = "_loading_wazy2_1", Ae = {
|
|
3021
|
+
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3022
|
+
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3023
|
+
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
3024
|
+
"rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
|
|
3025
|
+
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
3026
|
+
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3027
|
+
loading: Wi
|
|
3028
|
+
}, Hi = ({ percentage: t }) => {
|
|
3029
|
+
const { cancel: e } = et(), { localeMessages: n } = he();
|
|
3030
|
+
return t < 1 ? null : /* @__PURE__ */ a("div", { className: ae(Ae["rp-loading-overlay"]), children: /* @__PURE__ */ H("div", { className: ae(Ae["rp-loading-modal"]), children: [
|
|
3031
|
+
/* @__PURE__ */ H("div", { className: ae(Ae["rp-loading-title"]), children: [
|
|
3032
|
+
n == null ? void 0 : n.printLoadingMessage,
|
|
3033
|
+
"..."
|
|
3034
|
+
] }),
|
|
3035
|
+
/* @__PURE__ */ a("div", { className: ae(Ae["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
3036
|
+
"div",
|
|
3037
|
+
{
|
|
3038
|
+
className: ae(Ae["rp-loading-progress"]),
|
|
3039
|
+
style: { width: `${t}%` }
|
|
3040
|
+
}
|
|
3041
|
+
) }),
|
|
3042
|
+
/* @__PURE__ */ a("button", { className: ae(Ae["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3043
|
+
] }) });
|
|
3044
|
+
}, $i = Je((t, e) => {
|
|
3045
|
+
const { showPrintProgress: n = !0 } = Te(), { showPrintProgress: r = !0 } = Ne(), { progress: o } = et(), { isSmallScreen: i } = Oe(), { percentage: c } = o || {}, l = () => i ? { gridTemplateColumns: "25% 60% 15%" } : void 0, d = () => {
|
|
3046
|
+
if (!(!n || !r || !c))
|
|
3047
|
+
return /* @__PURE__ */ a(Hi, { percentage: c });
|
|
3048
|
+
};
|
|
3049
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
3050
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: Me["rp-toolbar-content"], children: /* @__PURE__ */ H("div", { className: Me["rp-toolbar-wrapper"], style: l(), children: [
|
|
3051
|
+
/* @__PURE__ */ H("div", { "data-rp": "topBarLeft", className: Me["rp-toolbar-start"], children: [
|
|
3052
|
+
/* @__PURE__ */ a(ki, {}),
|
|
3053
|
+
/* @__PURE__ */ a(ai, {})
|
|
3054
|
+
] }),
|
|
3055
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: Me["rp-toolbar-middle"], children: /* @__PURE__ */ a(Cr, {}) }),
|
|
3056
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: Me["rp-toolbar-end"], children: /* @__PURE__ */ a(Fi, {}) })
|
|
3057
|
+
] }) }),
|
|
3058
|
+
/* @__PURE__ */ a(d, {})
|
|
3059
|
+
] });
|
|
3060
|
+
}), ht = {
|
|
3061
|
+
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
|
|
3062
|
+
"rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
|
|
3063
|
+
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
|
|
3064
|
+
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_1sdl6_21"
|
|
3065
|
+
}, ke = {
|
|
3066
|
+
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
3067
|
+
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
3068
|
+
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3069
|
+
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3070
|
+
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3071
|
+
}, qi = (t) => {
|
|
3072
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = ce(), { pageRotate: i } = Ye(), c = M(null), l = Cn(), { pages: d } = ne(), [h, m] = $(null), T = M(!1), f = M(), v = k(() => n ? ke["rp-thumbnail-active"] : "", [n]), C = k(() => ({
|
|
3073
|
+
width: Math.round(r.width),
|
|
3074
|
+
height: Math.round(r.height)
|
|
3075
|
+
}), [r]), P = E(() => {
|
|
3076
|
+
e && o(e);
|
|
3077
|
+
}, [o, e]);
|
|
3078
|
+
return D(() => {
|
|
3079
|
+
const b = d.get(e);
|
|
3080
|
+
f.current === b || (m(null), f.current = b);
|
|
3081
|
+
}, [d, e]), D(() => {
|
|
3082
|
+
const b = d.get(e);
|
|
3083
|
+
if (!c.current || !e || !b || h)
|
|
3084
|
+
return;
|
|
3085
|
+
const y = new IntersectionObserver((g) => {
|
|
3086
|
+
g.forEach((p) => {
|
|
3087
|
+
if (T.current) {
|
|
3088
|
+
T.current = !1, l.removeQueue(`thumbnail-${e}`);
|
|
3089
|
+
return;
|
|
3090
|
+
}
|
|
3091
|
+
if (p.isIntersecting) {
|
|
3092
|
+
const u = document.createElement("canvas");
|
|
3093
|
+
T.current = !0, l.enqueue(
|
|
3094
|
+
`thumbnail-${e}`,
|
|
3095
|
+
{
|
|
3096
|
+
page: b.page,
|
|
3097
|
+
canvasElem: u,
|
|
3098
|
+
options: {
|
|
3099
|
+
scale: 1
|
|
3100
|
+
},
|
|
3101
|
+
onLoaded: () => {
|
|
3102
|
+
u.toBlob((s) => {
|
|
3103
|
+
if (!s)
|
|
3104
|
+
return;
|
|
3105
|
+
const w = URL.createObjectURL(s);
|
|
3106
|
+
m(w);
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
3110
|
+
2
|
|
3111
|
+
);
|
|
3112
|
+
}
|
|
3113
|
+
});
|
|
3114
|
+
});
|
|
3115
|
+
return c.current && y.observe(c.current), () => {
|
|
3116
|
+
y.disconnect(), l.removeQueue(`thumbnail-${e}`);
|
|
3117
|
+
};
|
|
3118
|
+
}, [l, e, d, h]), /* @__PURE__ */ H(
|
|
3119
|
+
"div",
|
|
3120
|
+
{
|
|
3121
|
+
onClick: P,
|
|
3122
|
+
id: `page-${e}`,
|
|
3123
|
+
className: ke["rp-thumbnail-wrapper"],
|
|
3124
|
+
ref: c,
|
|
3125
|
+
children: [
|
|
3126
|
+
/* @__PURE__ */ a(
|
|
3127
|
+
"div",
|
|
3128
|
+
{
|
|
3129
|
+
style: {
|
|
3130
|
+
transform: `rotate(${i[e || 0]}deg)`
|
|
3131
|
+
},
|
|
3132
|
+
className: ae(v, ke["rp-thumbnail"]),
|
|
3133
|
+
children: h ? /* @__PURE__ */ a(
|
|
3134
|
+
"img",
|
|
3135
|
+
{
|
|
3136
|
+
src: h,
|
|
3137
|
+
width: C.width,
|
|
3138
|
+
height: C.height,
|
|
3139
|
+
alt: "thumbnail"
|
|
3140
|
+
}
|
|
3141
|
+
) : /* @__PURE__ */ a(
|
|
3142
|
+
"div",
|
|
3143
|
+
{
|
|
3144
|
+
className: ke["rp-thumbnail-loader"],
|
|
3145
|
+
style: {
|
|
3146
|
+
width: `${C.width}px`,
|
|
3147
|
+
height: `${C.height}px`
|
|
3148
|
+
},
|
|
3149
|
+
children: /* @__PURE__ */ a(_t, {})
|
|
3150
|
+
}
|
|
3151
|
+
)
|
|
3152
|
+
}
|
|
3153
|
+
),
|
|
3154
|
+
/* @__PURE__ */ a("div", { className: ke["rp-thumbnail-text"], children: e })
|
|
3155
|
+
]
|
|
3156
|
+
}
|
|
3157
|
+
);
|
|
3158
|
+
}, en = {
|
|
3159
|
+
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
3160
|
+
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
3161
|
+
}, Gi = 16, Vi = (t, e) => {
|
|
3162
|
+
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3163
|
+
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Gi);
|
|
3164
|
+
}, Ui = Je((t, e) => {
|
|
3165
|
+
const { show: n } = t, { focusedPage: r, totalPages: o } = ce(), { thumbnailPages: i, addPage: c, thumbnailLength: l, addToPage: d } = _n(), h = M(null), m = M(1);
|
|
3166
|
+
tn(e, () => h.current);
|
|
3167
|
+
const T = k(() => Object.values(i), [i]), f = E(() => {
|
|
3168
|
+
const v = l + 1;
|
|
3169
|
+
v <= o && c(v);
|
|
3170
|
+
}, [c, o, l]);
|
|
3171
|
+
return D(() => {
|
|
3172
|
+
r > l && o > l ? d(r) : n && m.current !== r && (Vi(h.current, r), m.current = r);
|
|
3173
|
+
}, [r, l, d, n, T]), No(h.current, f), /* @__PURE__ */ a("div", { ref: h, className: en["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: en["rp-thumbnails"], children: n ? T.map((v, C) => {
|
|
3174
|
+
var P, b;
|
|
3175
|
+
return /* @__PURE__ */ a(
|
|
3176
|
+
qi,
|
|
3177
|
+
{
|
|
3178
|
+
isFocused: r === ((P = v.page) == null ? void 0 : P.pageNumber),
|
|
3179
|
+
pageNumber: (b = v.page) == null ? void 0 : b.pageNumber,
|
|
3180
|
+
loading: v.loading,
|
|
3181
|
+
viewport: v.viewport,
|
|
3182
|
+
defaultRotation: v.defaultRotation
|
|
3183
|
+
},
|
|
3184
|
+
C
|
|
3185
|
+
);
|
|
3186
|
+
}) : null }) });
|
|
3187
|
+
}), Bi = () => {
|
|
3188
|
+
const { thumbnailIcon: t } = Ce(), { thumbnailIcon: e } = be();
|
|
3189
|
+
return t || e || /* @__PURE__ */ a(To, {});
|
|
3190
|
+
}, ji = () => {
|
|
3191
|
+
const { active: t, setActive: e } = _n(), [n, r] = $(200), o = M(null), { thumbnailTool: i, sidebarEnable: c } = Te(), { localeMessages: l } = he(), d = E(() => {
|
|
3192
|
+
e((m) => !m);
|
|
3193
|
+
}, []), h = k(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: d, active: t }) : i ? /* @__PURE__ */ a(Q, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3194
|
+
ge,
|
|
3195
|
+
{
|
|
3196
|
+
onClick: d,
|
|
3197
|
+
active: t,
|
|
3198
|
+
"aria-label": l == null ? void 0 : l.thumbnailTooltip,
|
|
3199
|
+
children: /* @__PURE__ */ a(Bi, {})
|
|
3200
|
+
}
|
|
3201
|
+
) }) : null, [i, t, d, l]);
|
|
3202
|
+
return /* @__PURE__ */ a(pe, { children: c && /* @__PURE__ */ H(
|
|
3203
|
+
"div",
|
|
3204
|
+
{
|
|
3205
|
+
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3206
|
+
className: ht["rp-sidebar-content-wrapper"],
|
|
3207
|
+
"data-rp": "sidebar",
|
|
3208
|
+
children: [
|
|
3209
|
+
/* @__PURE__ */ a("div", { className: ht["rp-sidebar-content"], children: h }),
|
|
3210
|
+
/* @__PURE__ */ H(
|
|
3211
|
+
"div",
|
|
3212
|
+
{
|
|
3213
|
+
"data-rp": "thumbnailSidebar",
|
|
3214
|
+
hidden: !t,
|
|
3215
|
+
className: ht["rp-thumbnails-wrapper"],
|
|
3216
|
+
children: [
|
|
3217
|
+
/* @__PURE__ */ a(Ui, { show: t, ref: o }),
|
|
3218
|
+
/* @__PURE__ */ a(Oo, { onWidthChange: r, thumbnailRef: o })
|
|
3219
|
+
]
|
|
3220
|
+
}
|
|
3221
|
+
)
|
|
3222
|
+
]
|
|
3223
|
+
}
|
|
3224
|
+
) });
|
|
3225
|
+
}, Bs = to((t, e) => {
|
|
3226
|
+
const {
|
|
3227
|
+
children: n,
|
|
3228
|
+
slots: r,
|
|
3229
|
+
icons: o,
|
|
3230
|
+
style: i,
|
|
3231
|
+
className: c,
|
|
3232
|
+
mobileWidth: l,
|
|
3233
|
+
onLoaded: d,
|
|
3234
|
+
cleanupOnLoaded: h,
|
|
3235
|
+
onLayoutWidthChange: m
|
|
3236
|
+
} = t, [T, f] = $(null), { setContainer: v, setContentRef: C } = _e(), { loading: P } = ne(), { LoaderImageComponent: b } = sn();
|
|
3237
|
+
return D(() => (d && d(), () => {
|
|
3238
|
+
h && h();
|
|
3239
|
+
}), [d, h]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3240
|
+
/* @__PURE__ */ a(xn, { toolbarRef: T, ref: e, children: /* @__PURE__ */ a(Po, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(yo, { slots: r, children: /* @__PURE__ */ a(Ro, { icons: o, children: /* @__PURE__ */ a(bo, { children: /* @__PURE__ */ H(Co, { getContainerRef: v, style: i, className: c, children: [
|
|
3241
|
+
/* @__PURE__ */ H(So, { children: [
|
|
3242
|
+
/* @__PURE__ */ H("div", { className: we["rp-layout"], children: [
|
|
3243
|
+
/* @__PURE__ */ a(
|
|
3244
|
+
$i,
|
|
3245
|
+
{
|
|
3246
|
+
ref: f
|
|
3247
|
+
}
|
|
3248
|
+
),
|
|
3249
|
+
/* @__PURE__ */ H("div", { className: we["rp-content"], children: [
|
|
3250
|
+
/* @__PURE__ */ a("div", { className: we["rp-sidebar"], children: /* @__PURE__ */ a(ji, {}) }),
|
|
3251
|
+
/* @__PURE__ */ a("div", { ref: C, className: we["rp-pages"], children: n })
|
|
3252
|
+
] })
|
|
3253
|
+
] }),
|
|
3254
|
+
/* @__PURE__ */ a(Io, {})
|
|
3255
|
+
] }),
|
|
3256
|
+
P ? /* @__PURE__ */ a(
|
|
3257
|
+
"div",
|
|
3258
|
+
{
|
|
3259
|
+
className: we["rp-loader"],
|
|
3260
|
+
style: {
|
|
3261
|
+
position: "absolute",
|
|
3262
|
+
top: 0,
|
|
3263
|
+
left: 0,
|
|
3264
|
+
right: 0,
|
|
3265
|
+
bottom: 0,
|
|
3266
|
+
width: "100%",
|
|
3267
|
+
height: "100%"
|
|
3268
|
+
},
|
|
3269
|
+
children: /* @__PURE__ */ a(
|
|
3270
|
+
"div",
|
|
3271
|
+
{
|
|
3272
|
+
style: {
|
|
3273
|
+
display: "flex",
|
|
3274
|
+
justifyContent: "center",
|
|
3275
|
+
alignItems: "center",
|
|
3276
|
+
height: "100%",
|
|
3277
|
+
width: "100%"
|
|
3278
|
+
},
|
|
3279
|
+
children: b && /* @__PURE__ */ a(b, {})
|
|
3280
|
+
}
|
|
3281
|
+
)
|
|
3282
|
+
}
|
|
3283
|
+
) : null
|
|
3284
|
+
] }) }) }) }) }) });
|
|
3285
|
+
}), js = {
|
|
3286
|
+
"rp-toolbar-layout": "_rp-toolbar-layout_vwobs_1",
|
|
3287
|
+
"rp-content": "_rp-content_vwobs_7",
|
|
3288
|
+
"rp-topbar-content": "_rp-topbar-content_vwobs_13",
|
|
3289
|
+
"rp-sidebar-content": "_rp-sidebar-content_vwobs_22",
|
|
3290
|
+
"rp-pages": "_rp-pages_vwobs_32",
|
|
3291
|
+
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_vwobs_37"
|
|
3292
|
+
};
|
|
3293
|
+
export {
|
|
3294
|
+
Tn as A,
|
|
3295
|
+
Cn as B,
|
|
3296
|
+
Rr as C,
|
|
3297
|
+
Er as D,
|
|
3298
|
+
Dr as E,
|
|
3299
|
+
zr as F,
|
|
3300
|
+
yt as G,
|
|
3301
|
+
Qr as H,
|
|
3302
|
+
ei as I,
|
|
3303
|
+
ti as J,
|
|
3304
|
+
ni as K,
|
|
3305
|
+
xn as L,
|
|
3306
|
+
Pi as M,
|
|
3307
|
+
Vn as N,
|
|
3308
|
+
jn as O,
|
|
3309
|
+
ks as P,
|
|
3310
|
+
Ai as Q,
|
|
3311
|
+
Gs as R,
|
|
3312
|
+
ki as S,
|
|
3313
|
+
Hs as T,
|
|
3314
|
+
zi as U,
|
|
3315
|
+
Jt as V,
|
|
3316
|
+
$i as W,
|
|
3317
|
+
qi as X,
|
|
3318
|
+
ji as Y,
|
|
3319
|
+
Bs as a,
|
|
3320
|
+
$n as b,
|
|
3321
|
+
et as c,
|
|
3322
|
+
Pt as d,
|
|
3323
|
+
we as e,
|
|
3324
|
+
$s as f,
|
|
3325
|
+
qs as g,
|
|
3326
|
+
Ws as h,
|
|
3327
|
+
_n as i,
|
|
3328
|
+
pt as j,
|
|
3329
|
+
Me as k,
|
|
3330
|
+
ai as l,
|
|
3331
|
+
Fi as m,
|
|
3332
|
+
js as n,
|
|
3333
|
+
Ui as o,
|
|
3334
|
+
Hi as p,
|
|
3335
|
+
mn as q,
|
|
3336
|
+
yr as r,
|
|
3337
|
+
gn as s,
|
|
3338
|
+
Sr as t,
|
|
3339
|
+
ce as u,
|
|
3340
|
+
vn as v,
|
|
3341
|
+
xr as w,
|
|
3342
|
+
wn as x,
|
|
3343
|
+
Ir as y,
|
|
3344
|
+
bn as z
|
|
3345
|
+
};
|