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