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