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