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