@pdf-viewer/react 1.1.0-beta.4 → 1.1.0-beta.5
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/{RPDefaultLayout-e37d2a6d.js → RPDefaultLayout-c14e28c7.js} +971 -963
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +3 -2
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/RPDefaultLayout.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/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.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 +3 -2
- package/dist/components/page/SinglePage.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/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/components/page/RPPage.d.ts +1 -1
- 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/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,144 +1,144 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef as
|
|
1
|
+
import { jsx as a, jsxs as O, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import * as U from "react";
|
|
3
|
+
import { useRef as H, useEffect as A, useCallback as R, useState as $, createContext as Ge, useContext as Ve, useMemo as z, forwardRef as Ue, useImperativeHandle as Zt, createElement as De, PureComponent as qn, Component as Zn, memo as jn } from "react";
|
|
4
4
|
import { ChevronUpIcon as Re } from "./components/icons/ChevronUpIcon.js";
|
|
5
|
-
import { UIButton as
|
|
6
|
-
import { UIInput as
|
|
5
|
+
import { UIButton as Y } from "./components/ui/Button.js";
|
|
6
|
+
import { UIInput as jt } from "./components/ui/Input.js";
|
|
7
7
|
import { useScrollModeContext as Pe } from "./contexts/ScrollModeContext.js";
|
|
8
|
-
import { useDocumentContext as
|
|
8
|
+
import { useDocumentContext as Q } from "./contexts/RPDocumentContext.js";
|
|
9
9
|
import "./contexts/DarkModeContext.js";
|
|
10
|
-
import { ViewMode as We, ScrollMode as
|
|
10
|
+
import { ViewMode as We, ScrollMode as X, AnnotationSubType as at, SelectionMode as Bn, ZoomLevel as Ke } from "./utils/types.js";
|
|
11
11
|
import { useRotationContext as qe } from "./contexts/RotationContext.js";
|
|
12
|
-
import { useLayerContext as
|
|
12
|
+
import { useLayerContext as Kn } from "./contexts/LayerContext.js";
|
|
13
13
|
import { useZoomContext as Ze } from "./contexts/ZoomContext.js";
|
|
14
14
|
import { useViewModeContext as je } from "./contexts/ViewModeContext.js";
|
|
15
15
|
import { useVirtualScrollContext as Be } from "./contexts/VirtualScrollContext.js";
|
|
16
|
-
import { useVirtualGridContext as
|
|
17
|
-
import { useScrollStateContext as
|
|
18
|
-
import { useSelectionModeContext as
|
|
19
|
-
import { useInitialStateContext as
|
|
20
|
-
import { useFullScreenContext as
|
|
16
|
+
import { useVirtualGridContext as Bt } from "./contexts/VirtualGridContext.js";
|
|
17
|
+
import { useScrollStateContext as Kt } from "./contexts/ScrollStateContext.js";
|
|
18
|
+
import { useSelectionModeContext as Xn } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as Jn } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as Yn } from "./contexts/FullScreenContext.js";
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
23
|
import { renderPage as it } from "./utils/renderPage.js";
|
|
24
|
-
import { highlightMatches as
|
|
25
|
-
import * as
|
|
26
|
-
import { PixelsPerInch as
|
|
24
|
+
import { highlightMatches as Xt, findMatches as Qn, resetDivs as eo } from "./utils/highlight.js";
|
|
25
|
+
import * as Jt from "pdfjs-dist";
|
|
26
|
+
import { PixelsPerInch as to, AnnotationMode as no, RenderingCancelledException as oo, AnnotationLayer as ro } from "pdfjs-dist";
|
|
27
27
|
import { useLayoutContainer as Le } from "./contexts/LayoutContainerContext.js";
|
|
28
|
-
import { useDimensionPagesContext as
|
|
28
|
+
import { useDimensionPagesContext as Yt } from "./contexts/DimensionPagesContext.js";
|
|
29
29
|
import "./components/RPConfig.js";
|
|
30
|
-
import { ThumbnailIcon as
|
|
31
|
-
import { c as
|
|
30
|
+
import { ThumbnailIcon as so } from "./components/icons/Thumbnail.js";
|
|
31
|
+
import { c as ee } from "./clsx-0c6e471a.js";
|
|
32
32
|
import { LoaderIcon as Ne } from "./components/icons/LoaderIcon.js";
|
|
33
|
-
import { useInfiniteScroll as
|
|
34
|
-
import { RPSplitter as
|
|
35
|
-
import { useToolbarComponentContext as
|
|
36
|
-
import { useIconContext as
|
|
37
|
-
import
|
|
38
|
-
import { c as we, C as
|
|
39
|
-
import { WrapperLayout as
|
|
40
|
-
import { RPDropFileZone as
|
|
41
|
-
import { useViewportContext as
|
|
33
|
+
import { useInfiniteScroll as ao } from "./utils/hooks/useInfiniteScroll.js";
|
|
34
|
+
import { RPSplitter as io } from "./components/layout/sidebar/RPSplitter.js";
|
|
35
|
+
import { useToolbarComponentContext as de, ToolbarComponentProvider as co } from "./contexts/ToolbarComponentContext.js";
|
|
36
|
+
import { useIconContext as ie, IconProvider as lo } from "./contexts/IconContext.js";
|
|
37
|
+
import te from "./components/ui/RPTooltip.js";
|
|
38
|
+
import { c as we, C as uo } from "./Container-fdb0a71f.js";
|
|
39
|
+
import { WrapperLayout as po } from "./components/layout/WrapperLayout.js";
|
|
40
|
+
import { RPDropFileZone as ho } from "./components/RPDropFileZone.js";
|
|
41
|
+
import { useViewportContext as _e, ViewportProvider as mo } from "./contexts/ViewportContext.js";
|
|
42
42
|
import "./contexts/ThemeContext.js";
|
|
43
|
-
import { SimpleLinkService as
|
|
43
|
+
import { SimpleLinkService as fo } from "./utils/link_service.js";
|
|
44
44
|
import { dateFormatter as ct } from "./utils/dateFormatter.js";
|
|
45
|
-
import { sanitizeExternalUrl as
|
|
46
|
-
import { useWatermark as
|
|
47
|
-
import { useMousePressed as
|
|
48
|
-
import { useGrabScroll as
|
|
49
|
-
import { usePinch as
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import { appConsole as
|
|
54
|
-
import { FileUploadTool as
|
|
55
|
-
import { DarkModeTool as
|
|
56
|
-
import { ThreeDotIcon as
|
|
45
|
+
import { sanitizeExternalUrl as go } from "./utils/sanitizeExternalUrl.js";
|
|
46
|
+
import { useWatermark as Qt } from "./utils/hooks/useWatermark.js";
|
|
47
|
+
import { useMousePressed as vo } from "./utils/hooks/useMousePressed.js";
|
|
48
|
+
import { useGrabScroll as _o } from "./utils/hooks/useGrabScroll.js";
|
|
49
|
+
import { usePinch as wo } from "./utils/hooks/usePinch.js";
|
|
50
|
+
import { useDebounce as en } from "./utils/hooks/useDebounce.js";
|
|
51
|
+
import { getThumbnailViewport as It } from "./utils/getThumbnailViewport.js";
|
|
52
|
+
import { useDimensionPages as bo } from "./utils/hooks/useDimensionPages.js";
|
|
53
|
+
import { appConsole as Co } from "./utils/appConsole.js";
|
|
54
|
+
import { FileUploadTool as tn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
55
|
+
import { DarkModeTool as To } from "./components/layout/toolbar/DarkModeTool.js";
|
|
56
|
+
import { ThreeDotIcon as Po } from "./components/icons/ThreeDotIcon.js";
|
|
57
57
|
import { UIDropDown as mt } from "./components/ui/DropDown.js";
|
|
58
|
-
import { c as
|
|
59
|
-
import { D as
|
|
60
|
-
import { a as
|
|
61
|
-
import { CloseIcon as
|
|
62
|
-
import { PropertyItem as
|
|
63
|
-
import { useOtherToolContext as
|
|
64
|
-
import { DocumentProperties as
|
|
65
|
-
import { RotateTool as
|
|
66
|
-
import { ScrollModeTool as
|
|
58
|
+
import { c as So, a as ft, P as Me, b as xe, d as gt, i as Io, k as yo, u as xo } from "./index-3dff3fa8.js";
|
|
59
|
+
import { D as Ro, u as Xe } from "./index-4f17fe4d.js";
|
|
60
|
+
import { a as Lo, h as No, u as Mo, F as Eo, b as Oo, G as He } from "./index-1db49c1a.js";
|
|
61
|
+
import { CloseIcon as nn } from "./components/icons/CloseIcon.js";
|
|
62
|
+
import { PropertyItem as Do } from "./components/layout/toolbar/PropertyItem.js";
|
|
63
|
+
import { useOtherToolContext as Ao, OtherToolProvider as zo } from "./contexts/OtherToolContext.js";
|
|
64
|
+
import { DocumentProperties as Fo } from "./components/layout/toolbar/DocumentProperties.js";
|
|
65
|
+
import { RotateTool as ko } from "./components/layout/toolbar/RotateTool.js";
|
|
66
|
+
import { ScrollModeTool as Wo } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
67
67
|
import { MenuSeparator as vt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
68
|
-
import { FileDownloadDefaultIcon as
|
|
69
|
-
import { MenuItem as
|
|
70
|
-
import { PrintDefaultTool as
|
|
71
|
-
import { FullScreenTool as
|
|
72
|
-
import { GoToDownIcon as
|
|
73
|
-
import { SelectionModeTool as
|
|
74
|
-
import { ZoomInIcon as
|
|
75
|
-
import { ZoomOutIcon as
|
|
76
|
-
import { PAGE_PADDING as
|
|
77
|
-
import { getZoomLevel as
|
|
78
|
-
import { SearchIcon as
|
|
79
|
-
import { UICheckbox as
|
|
80
|
-
import { ClearIcon as
|
|
81
|
-
import './assets/RPDefaultLayout.css';const
|
|
82
|
-
const { viewMode: e } = je(), { scrollMode: t } = Pe(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = Be(), { setFocusedPage: s } =
|
|
68
|
+
import { FileDownloadDefaultIcon as Ho } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
69
|
+
import { MenuItem as fe } from "./components/layout/toolbar/MenuItem.js";
|
|
70
|
+
import { PrintDefaultTool as $o } from "./components/icons/PrintDefaultIcon.js";
|
|
71
|
+
import { FullScreenTool as on } from "./components/layout/toolbar/FullScreenTool.js";
|
|
72
|
+
import { GoToDownIcon as rn } from "./components/icons/GoToDownIcon.js";
|
|
73
|
+
import { SelectionModeTool as Go } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
74
|
+
import { ZoomInIcon as Vo } from "./components/icons/ZoomInIcon.js";
|
|
75
|
+
import { ZoomOutIcon as Uo } from "./components/icons/ZoomOutIcon.js";
|
|
76
|
+
import { PAGE_PADDING as yt } from "./utils/constants.js";
|
|
77
|
+
import { getZoomLevel as qo } from "./utils/getZoomLevel.js";
|
|
78
|
+
import { SearchIcon as Zo } from "./components/icons/SearchIcon.js";
|
|
79
|
+
import { UICheckbox as xt } from "./components/ui/Checkbox.js";
|
|
80
|
+
import { ClearIcon as jo } from "./components/icons/ClearIcon.js";
|
|
81
|
+
import './assets/RPDefaultLayout.css';const Bo = (e) => e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e, sn = () => {
|
|
82
|
+
const { viewMode: e } = je(), { scrollMode: t } = Pe(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = Be(), { setFocusedPage: s } = oe(), c = H(), { columnCount: i } = Bt(), { widths: l, heights: p } = bo(), h = H(t), m = H(e), d = H(i);
|
|
83
83
|
A(() => {
|
|
84
84
|
n != null && n.scrollToItem && (c.current = n);
|
|
85
85
|
}, [n]), A(() => {
|
|
86
86
|
h.current = t, m.current = e;
|
|
87
87
|
}, [t, e]);
|
|
88
|
-
const g = R((f,
|
|
88
|
+
const g = R((f, w, P) => {
|
|
89
89
|
const T = {
|
|
90
90
|
left: f.scrollLeft,
|
|
91
91
|
top: f.scrollTop
|
|
92
|
-
},
|
|
93
|
-
left:
|
|
92
|
+
}, I = {
|
|
93
|
+
left: w - T.left,
|
|
94
94
|
top: P - T.top
|
|
95
|
-
},
|
|
96
|
-
const N =
|
|
95
|
+
}, u = performance.now(), C = 300, b = (x) => {
|
|
96
|
+
const N = x - u, y = Math.min(N / C, 1), S = Bo(y), M = T.left + I.left * S, L = T.top + I.top * S;
|
|
97
97
|
f.scrollTo({
|
|
98
98
|
left: M,
|
|
99
99
|
top: L
|
|
100
|
-
}),
|
|
100
|
+
}), y < 1 && requestAnimationFrame(b);
|
|
101
101
|
};
|
|
102
|
-
requestAnimationFrame(
|
|
102
|
+
requestAnimationFrame(b);
|
|
103
103
|
}, []), v = R(
|
|
104
104
|
(f) => {
|
|
105
105
|
if (!r)
|
|
106
106
|
return;
|
|
107
|
-
const
|
|
108
|
-
f ===
|
|
107
|
+
const w = Math.ceil(f / 2) * 2 - 1;
|
|
108
|
+
f === w + 1 ? g(r, l[w], 0) : g(r, 0, 0);
|
|
109
109
|
},
|
|
110
110
|
[r, l, g]
|
|
111
111
|
);
|
|
112
112
|
return A(() => {
|
|
113
113
|
h.current = t, m.current = e;
|
|
114
114
|
}, [t, e]), A(() => {
|
|
115
|
-
|
|
115
|
+
d.current = i;
|
|
116
116
|
}, [i]), { scrollToPage: R(
|
|
117
117
|
(f) => {
|
|
118
|
-
const
|
|
119
|
-
let P =
|
|
120
|
-
if (m.current === We.DUAL_PAGE && h.current ===
|
|
118
|
+
const w = f - 1;
|
|
119
|
+
let P = w, T = 0;
|
|
120
|
+
if (m.current === We.DUAL_PAGE && h.current === X.PAGE_SCROLLING) {
|
|
121
121
|
v(f);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (h.current ===
|
|
124
|
+
if (h.current === X.PAGE_SCROLLING) {
|
|
125
125
|
s(f);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (!c.current || !o)
|
|
129
129
|
return;
|
|
130
|
-
const
|
|
131
|
-
if (h.current ===
|
|
132
|
-
T =
|
|
133
|
-
const
|
|
134
|
-
g(
|
|
130
|
+
const I = o;
|
|
131
|
+
if (h.current === X.HORIZONTAL_SCROLLING) {
|
|
132
|
+
T = w;
|
|
133
|
+
const u = w * (l[w] ?? 0);
|
|
134
|
+
g(I, u, 0);
|
|
135
135
|
} else if (m.current === We.DUAL_PAGE) {
|
|
136
|
-
T =
|
|
137
|
-
const C = P * (p[P] ?? 0),
|
|
138
|
-
g(
|
|
136
|
+
T = w % 2, P = Math.floor(w / 2);
|
|
137
|
+
const C = P * (p[P] ?? 0), b = T * (l[T] ?? 0);
|
|
138
|
+
g(I, b, C);
|
|
139
139
|
} else {
|
|
140
|
-
const
|
|
141
|
-
g(
|
|
140
|
+
const u = P * (p[P] ?? 0);
|
|
141
|
+
g(I, 0, u);
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
[
|
|
@@ -151,8 +151,8 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
|
|
|
151
151
|
l
|
|
152
152
|
]
|
|
153
153
|
) };
|
|
154
|
-
},
|
|
155
|
-
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: s } =
|
|
154
|
+
}, Ko = (e = 1) => {
|
|
155
|
+
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: s } = sn(), c = H(1), { isScrolling: i } = Kt(), { viewMode: l } = je(), { scrollMode: p } = Pe(), h = en(t, 100), m = R(
|
|
156
156
|
(f) => {
|
|
157
157
|
if (!/^[0-9]*$/g.test(f.toString()) || !f)
|
|
158
158
|
return { success: !1, currentPage: c.current };
|
|
@@ -160,29 +160,29 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
|
|
|
160
160
|
return P < 0 || P > o ? { success: !1, currentPage: c.current } : (n(P), c.current = P, { success: !0, currentPage: +f });
|
|
161
161
|
},
|
|
162
162
|
[o]
|
|
163
|
-
),
|
|
163
|
+
), d = R(m, [m]), g = R(
|
|
164
164
|
(f) => {
|
|
165
|
-
const
|
|
166
|
-
return
|
|
165
|
+
const w = m(f);
|
|
166
|
+
return w.success && (i.current = !0, s(w.currentPage)), w;
|
|
167
167
|
},
|
|
168
168
|
[m, s]
|
|
169
169
|
), v = R(() => {
|
|
170
170
|
let f = t - 1;
|
|
171
171
|
g(f);
|
|
172
|
-
}, [g, t, l, p]),
|
|
172
|
+
}, [g, t, l, p]), _ = R(() => {
|
|
173
173
|
let f = t + 1;
|
|
174
174
|
g(f);
|
|
175
175
|
}, [g, t, l, p]);
|
|
176
176
|
return {
|
|
177
177
|
focusedPage: h,
|
|
178
178
|
totalPages: o,
|
|
179
|
-
setFocusedPage:
|
|
179
|
+
setFocusedPage: d,
|
|
180
180
|
setTotalPages: r,
|
|
181
|
-
nextPage:
|
|
181
|
+
nextPage: _,
|
|
182
182
|
prevPage: v,
|
|
183
183
|
goToPage: g
|
|
184
184
|
};
|
|
185
|
-
},
|
|
185
|
+
}, an = Ge({
|
|
186
186
|
focusedPage: 0,
|
|
187
187
|
setFocusedPage: (e) => {
|
|
188
188
|
},
|
|
@@ -194,15 +194,15 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
|
|
|
194
194
|
},
|
|
195
195
|
nextPage: () => {
|
|
196
196
|
}
|
|
197
|
-
}),
|
|
198
|
-
const e = Ve(
|
|
199
|
-
return typeof (e == null ? void 0 : e.focusedPage) > "u" &&
|
|
200
|
-
},
|
|
201
|
-
const { pdf: t } =
|
|
197
|
+
}), oe = () => {
|
|
198
|
+
const e = Ve(an);
|
|
199
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Co.error("Please use this hooks inside children component of RPProvider"), e;
|
|
200
|
+
}, Xa = ({ children: e }) => {
|
|
201
|
+
const { pdf: t } = Q(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: s, goToPage: c, nextPage: i, prevPage: l } = Ko();
|
|
202
202
|
return A(() => {
|
|
203
203
|
t != null && t.numPages && s(t.numPages);
|
|
204
204
|
}, [t, s]), /* @__PURE__ */ a(
|
|
205
|
-
|
|
205
|
+
an.Provider,
|
|
206
206
|
{
|
|
207
207
|
value: {
|
|
208
208
|
focusedPage: n,
|
|
@@ -217,12 +217,12 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
};
|
|
220
|
-
const
|
|
221
|
-
const { pdf: e, pages: t } =
|
|
220
|
+
const Xo = () => {
|
|
221
|
+
const { pdf: e, pages: t } = Q(), [n, o] = $({
|
|
222
222
|
loadedPages: 0,
|
|
223
223
|
totalPages: 0,
|
|
224
224
|
percentage: 0
|
|
225
|
-
}), [r, s] = $(!1), [c, i] = $(!1), [l, p] = $(null), h =
|
|
225
|
+
}), [r, s] = $(!1), [c, i] = $(!1), [l, p] = $(null), h = H(!1);
|
|
226
226
|
A(() => {
|
|
227
227
|
h.current;
|
|
228
228
|
}, [h]);
|
|
@@ -230,7 +230,7 @@ const Ko = () => {
|
|
|
230
230
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
231
231
|
const T = document.querySelector(".rp-print-zone");
|
|
232
232
|
T && T.remove();
|
|
233
|
-
}, []),
|
|
233
|
+
}, []), d = R(() => {
|
|
234
234
|
h.current = !1, s(!1), i(!1), p(null), o({
|
|
235
235
|
loadedPages: 0,
|
|
236
236
|
totalPages: 0,
|
|
@@ -240,136 +240,136 @@ const Ko = () => {
|
|
|
240
240
|
h.current = !0;
|
|
241
241
|
}, v = async ({
|
|
242
242
|
scratchCanvas: T,
|
|
243
|
-
pdfDocument:
|
|
244
|
-
pageNumber:
|
|
243
|
+
pdfDocument: I,
|
|
244
|
+
pageNumber: u,
|
|
245
245
|
viewerPdfPage: C,
|
|
246
|
-
printResolution:
|
|
247
|
-
optionalContentConfigPromise:
|
|
246
|
+
printResolution: b,
|
|
247
|
+
optionalContentConfigPromise: x,
|
|
248
248
|
printAnnotationStoragePromise: N
|
|
249
249
|
}) => {
|
|
250
250
|
if (h.current) {
|
|
251
|
-
|
|
251
|
+
d();
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
|
-
const
|
|
255
|
-
T.width = Math.floor(C.width *
|
|
254
|
+
const y = b / to.PDF;
|
|
255
|
+
T.width = Math.floor(C.width * y), T.height = Math.floor(C.height * y);
|
|
256
256
|
const S = T.getContext("2d");
|
|
257
257
|
S.save(), S.fillStyle = "rgb(255, 255, 255)", S.fillRect(0, 0, T.width, T.height), S.restore();
|
|
258
258
|
const [M, L] = await Promise.all([
|
|
259
|
-
|
|
259
|
+
I.getPage(u),
|
|
260
260
|
N
|
|
261
261
|
]);
|
|
262
262
|
if (h.current) {
|
|
263
|
-
|
|
263
|
+
d();
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
266
|
const E = {
|
|
267
267
|
canvasContext: S,
|
|
268
|
-
transform: [
|
|
268
|
+
transform: [y, 0, 0, y, 0, 0],
|
|
269
269
|
viewport: M.getViewport({ scale: 1, rotation: C.rotation }),
|
|
270
270
|
intent: "print",
|
|
271
|
-
annotationMode:
|
|
272
|
-
optionalContentConfigPromise:
|
|
271
|
+
annotationMode: no.ENABLE_STORAGE,
|
|
272
|
+
optionalContentConfigPromise: x,
|
|
273
273
|
printAnnotationStorage: L
|
|
274
274
|
};
|
|
275
275
|
try {
|
|
276
276
|
return M.render(E).promise;
|
|
277
|
-
} catch (
|
|
278
|
-
throw
|
|
277
|
+
} catch (D) {
|
|
278
|
+
throw D instanceof oo || console.error(D), D;
|
|
279
279
|
}
|
|
280
|
-
},
|
|
280
|
+
}, _ = R(() => {
|
|
281
281
|
const T = window.print;
|
|
282
|
-
return new Promise((
|
|
283
|
-
const
|
|
282
|
+
return new Promise((I) => {
|
|
283
|
+
const u = (x) => {
|
|
284
284
|
setTimeout(() => {
|
|
285
|
-
T.call(window), setTimeout(() =>
|
|
285
|
+
T.call(window), setTimeout(() => x(), 20);
|
|
286
286
|
}, 0);
|
|
287
287
|
};
|
|
288
288
|
if (document.querySelector(".rp-print-zone")) {
|
|
289
|
-
|
|
289
|
+
u(I);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
document.querySelector(".rp-print-zone") && (
|
|
292
|
+
const b = new MutationObserver(() => {
|
|
293
|
+
document.querySelector(".rp-print-zone") && (u(I), b.disconnect());
|
|
294
294
|
});
|
|
295
|
-
|
|
295
|
+
b.observe(document.body, { childList: !0, subtree: !0 });
|
|
296
296
|
});
|
|
297
297
|
}, []), f = async (T) => {
|
|
298
|
-
const
|
|
299
|
-
return
|
|
300
|
-
T.toBlob((
|
|
301
|
-
|
|
302
|
-
URL.revokeObjectURL(
|
|
303
|
-
},
|
|
298
|
+
const I = document.createElement("img"), u = document.createElement("div");
|
|
299
|
+
return u.classList.add("rp-print-page"), await new Promise((C, b) => {
|
|
300
|
+
T.toBlob((x) => {
|
|
301
|
+
x ? (I.src = URL.createObjectURL(x), I.onload = () => {
|
|
302
|
+
URL.revokeObjectURL(I.src), C();
|
|
303
|
+
}, I.onerror = b) : b(new Error("Failed to create blob"));
|
|
304
304
|
});
|
|
305
305
|
}).catch(() => {
|
|
306
|
-
}),
|
|
307
|
-
},
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
const C = document.createElement("style"),
|
|
311
|
-
if (
|
|
312
|
-
const { width:
|
|
313
|
-
C.innerHTML = `@page { size: ${
|
|
306
|
+
}), u.appendChild(I), u;
|
|
307
|
+
}, w = (T, I) => {
|
|
308
|
+
const u = document.createElement("div");
|
|
309
|
+
u.classList.add("rp-print-zone");
|
|
310
|
+
const C = document.createElement("style"), b = I.get(1);
|
|
311
|
+
if (b) {
|
|
312
|
+
const { width: x, height: N } = b == null ? void 0 : b.page.getViewport({ scale: 1 });
|
|
313
|
+
C.innerHTML = `@page { size: ${x}px ${N}px }`;
|
|
314
314
|
}
|
|
315
|
-
return
|
|
315
|
+
return u.appendChild(C), u.append(...T), u;
|
|
316
316
|
}, P = R(async () => {
|
|
317
317
|
if (!e)
|
|
318
318
|
return;
|
|
319
|
-
|
|
320
|
-
const T = document.createElement("canvas"),
|
|
319
|
+
d();
|
|
320
|
+
const T = document.createElement("canvas"), I = [];
|
|
321
321
|
try {
|
|
322
322
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
323
|
-
const C = e.getOptionalContentConfig({ intent: "print" }),
|
|
323
|
+
const C = e.getOptionalContentConfig({ intent: "print" }), b = Promise.resolve(
|
|
324
324
|
e.annotationStorage.print ?? void 0
|
|
325
|
-
),
|
|
326
|
-
for (const [
|
|
325
|
+
), x = t.size;
|
|
326
|
+
for (const [y, S] of t) {
|
|
327
327
|
if (h.current) {
|
|
328
|
-
|
|
328
|
+
d();
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
331
|
const M = S.page.getViewport({ scale: 1 });
|
|
332
332
|
if (await v({
|
|
333
333
|
scratchCanvas: T,
|
|
334
334
|
pdfDocument: e,
|
|
335
|
-
pageNumber:
|
|
335
|
+
pageNumber: y,
|
|
336
336
|
viewerPdfPage: M,
|
|
337
337
|
printResolution: 150,
|
|
338
338
|
optionalContentConfigPromise: C,
|
|
339
|
-
printAnnotationStoragePromise:
|
|
339
|
+
printAnnotationStoragePromise: b
|
|
340
340
|
}), h.current) {
|
|
341
|
-
|
|
341
|
+
d();
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
344
|
const L = await f(T);
|
|
345
|
-
|
|
346
|
-
const E = parseFloat((
|
|
345
|
+
I.push(L);
|
|
346
|
+
const E = parseFloat((I.length / x * 100).toFixed(2));
|
|
347
347
|
o({
|
|
348
|
-
loadedPages:
|
|
349
|
-
totalPages:
|
|
348
|
+
loadedPages: y,
|
|
349
|
+
totalPages: x,
|
|
350
350
|
percentage: E
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
if (h.current) {
|
|
354
|
-
|
|
354
|
+
d();
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
|
-
const N =
|
|
358
|
-
document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), s(!0), await
|
|
359
|
-
} catch (
|
|
360
|
-
i(!0),
|
|
357
|
+
const N = w(I, t);
|
|
358
|
+
document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), s(!0), await _();
|
|
359
|
+
} catch (u) {
|
|
360
|
+
i(!0), u instanceof Error && p(u);
|
|
361
361
|
} finally {
|
|
362
362
|
T.height = 0, T.width = 0;
|
|
363
363
|
}
|
|
364
364
|
}, [e, t, h]);
|
|
365
365
|
return A(() => {
|
|
366
366
|
const T = () => {
|
|
367
|
-
|
|
367
|
+
d(), m();
|
|
368
368
|
};
|
|
369
369
|
return window.addEventListener("afterprint", T, !0), () => {
|
|
370
370
|
window.removeEventListener("afterprint", T, !0);
|
|
371
371
|
};
|
|
372
|
-
}, [m,
|
|
372
|
+
}, [m, d]), {
|
|
373
373
|
print: P,
|
|
374
374
|
cancel: g,
|
|
375
375
|
progress: n,
|
|
@@ -377,7 +377,7 @@ const Ko = () => {
|
|
|
377
377
|
isError: c,
|
|
378
378
|
error: l
|
|
379
379
|
};
|
|
380
|
-
},
|
|
380
|
+
}, cn = Ge({
|
|
381
381
|
print: () => {
|
|
382
382
|
},
|
|
383
383
|
cancel: () => {
|
|
@@ -394,10 +394,10 @@ const Ko = () => {
|
|
|
394
394
|
console.error("Error in setOnError callback:", t);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
}),
|
|
398
|
-
const [t, n] = $(null), [o, r] = $(null), { print: s, cancel: c, progress: i, isComplete: l, isError: p, error: h } =
|
|
397
|
+
}), Ja = ({ children: e }) => {
|
|
398
|
+
const [t, n] = $(null), [o, r] = $(null), { print: s, cancel: c, progress: i, isComplete: l, isError: p, error: h } = Xo(), m = R((f) => {
|
|
399
399
|
f && typeof f == "function" && r(() => f);
|
|
400
|
-
}, []),
|
|
400
|
+
}, []), d = (f) => {
|
|
401
401
|
h && f(h);
|
|
402
402
|
}, g = R(
|
|
403
403
|
(f) => {
|
|
@@ -408,7 +408,7 @@ const Ko = () => {
|
|
|
408
408
|
A(() => {
|
|
409
409
|
l && o && v();
|
|
410
410
|
}, [l, o]), A(() => {
|
|
411
|
-
p &&
|
|
411
|
+
p && d((f) => {
|
|
412
412
|
console.error(f);
|
|
413
413
|
});
|
|
414
414
|
}, [p]), A(() => {
|
|
@@ -416,44 +416,44 @@ const Ko = () => {
|
|
|
416
416
|
}, [i, t]);
|
|
417
417
|
const v = () => {
|
|
418
418
|
o && (o(), r(null));
|
|
419
|
-
},
|
|
419
|
+
}, _ = {
|
|
420
420
|
print: s,
|
|
421
421
|
cancel: c,
|
|
422
422
|
setOnProgress: g,
|
|
423
423
|
setOnComplete: m,
|
|
424
|
-
setOnError:
|
|
424
|
+
setOnError: d,
|
|
425
425
|
progress: i
|
|
426
426
|
};
|
|
427
|
-
return /* @__PURE__ */ a(
|
|
427
|
+
return /* @__PURE__ */ a(cn.Provider, { value: _, children: e });
|
|
428
428
|
}, _t = () => {
|
|
429
|
-
const e = Ve(
|
|
429
|
+
const e = Ve(cn);
|
|
430
430
|
if (!e)
|
|
431
431
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
432
432
|
return e;
|
|
433
|
-
},
|
|
434
|
-
const [e, t] = $({}), { pages: n } =
|
|
433
|
+
}, Jo = () => {
|
|
434
|
+
const [e, t] = $({}), { pages: n } = Q(), { rotate: o } = qe(), r = z(() => Object.keys(e).length, [e]), s = R(
|
|
435
435
|
(i) => {
|
|
436
436
|
if (!n.size)
|
|
437
437
|
return;
|
|
438
438
|
const l = Array.from(n.values()).slice(0, i).map((m) => {
|
|
439
|
-
const { thumbnailViewport:
|
|
439
|
+
const { thumbnailViewport: d, scale: g } = It(m.page, o);
|
|
440
440
|
return {
|
|
441
441
|
scale: g,
|
|
442
442
|
page: m.page,
|
|
443
443
|
loading: !0,
|
|
444
|
-
viewport:
|
|
444
|
+
viewport: d
|
|
445
445
|
};
|
|
446
|
-
}), p = l.reduce((m,
|
|
446
|
+
}), p = l.reduce((m, d) => (m[d.page.pageNumber] = d, m), {});
|
|
447
447
|
t(p);
|
|
448
448
|
const h = [];
|
|
449
449
|
for (const m of l) {
|
|
450
|
-
const
|
|
450
|
+
const d = document.createElement("canvas"), g = it(
|
|
451
451
|
m.page,
|
|
452
|
-
|
|
452
|
+
d,
|
|
453
453
|
m.scale,
|
|
454
454
|
o
|
|
455
455
|
).promise.then(() => {
|
|
456
|
-
const v =
|
|
456
|
+
const v = d.toDataURL();
|
|
457
457
|
return {
|
|
458
458
|
...m,
|
|
459
459
|
thumbnailSrc: v,
|
|
@@ -463,11 +463,11 @@ const Ko = () => {
|
|
|
463
463
|
h.push(g);
|
|
464
464
|
}
|
|
465
465
|
Promise.all(h).then((m) => {
|
|
466
|
-
const
|
|
466
|
+
const d = m.reduce(
|
|
467
467
|
(g, v) => (g[v.page.pageNumber] = v, g),
|
|
468
468
|
{}
|
|
469
469
|
);
|
|
470
|
-
t((g) => ({ ...g, ...
|
|
470
|
+
t((g) => ({ ...g, ...d }));
|
|
471
471
|
});
|
|
472
472
|
},
|
|
473
473
|
[n, o]
|
|
@@ -493,9 +493,9 @@ const Ko = () => {
|
|
|
493
493
|
}));
|
|
494
494
|
const p = document.createElement("canvas");
|
|
495
495
|
it(l.page, p, l.thumbnailScale, o).promise.then(() => {
|
|
496
|
-
const h = p.toDataURL(), { thumbnailViewport: m, scale:
|
|
496
|
+
const h = p.toDataURL(), { thumbnailViewport: m, scale: d } = It(l.page, o);
|
|
497
497
|
return {
|
|
498
|
-
scale:
|
|
498
|
+
scale: d,
|
|
499
499
|
thumbnailSrc: h,
|
|
500
500
|
page: l.page,
|
|
501
501
|
loading: !1,
|
|
@@ -508,7 +508,7 @@ const Ko = () => {
|
|
|
508
508
|
[n, o]
|
|
509
509
|
);
|
|
510
510
|
return { thumbnailPages: e, addPage: c, addToPage: s, thumbnailLength: r };
|
|
511
|
-
},
|
|
511
|
+
}, ln = Ge({
|
|
512
512
|
thumbnailPages: {},
|
|
513
513
|
addPage: (e) => {
|
|
514
514
|
},
|
|
@@ -518,45 +518,45 @@ const Ko = () => {
|
|
|
518
518
|
setActive: (e) => {
|
|
519
519
|
},
|
|
520
520
|
active: !1
|
|
521
|
-
}),
|
|
521
|
+
}), un = () => Ve(ln), Ya = ({
|
|
522
522
|
children: e,
|
|
523
523
|
initialThumbnailsVisible: t
|
|
524
524
|
}) => {
|
|
525
|
-
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: s } =
|
|
525
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: s } = Jo(), [c, i] = $(t);
|
|
526
526
|
return /* @__PURE__ */ a(
|
|
527
|
-
|
|
527
|
+
ln.Provider,
|
|
528
528
|
{
|
|
529
529
|
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: s, active: c, setActive: i },
|
|
530
530
|
children: e
|
|
531
531
|
}
|
|
532
532
|
);
|
|
533
|
-
},
|
|
534
|
-
const [n, o] = $(t), [r, s] = $(!1), { pdf: c, pages: i } =
|
|
533
|
+
}, Yo = (e = {}, t = "") => {
|
|
534
|
+
const [n, o] = $(t), [r, s] = $(!1), { pdf: c, pages: i } = Q(), l = Yt(), p = H(!n), { currentZoom: h } = Ze(), [m, d] = $([]), { setFocusedPage: g } = oe(), [v, _] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: w } = Be(), { scrollMode: P } = Pe(), [T, I] = $(null), u = H({}), C = z(() => v === 0 ? null : m[v - 1], [v, m]), b = z(() => m.length, [m]);
|
|
535
535
|
A(() => {
|
|
536
536
|
if (!C || !i)
|
|
537
537
|
return;
|
|
538
|
-
const S =
|
|
538
|
+
const S = w || f;
|
|
539
539
|
if (!S)
|
|
540
540
|
return;
|
|
541
541
|
const M = i.get(C.page), L = S.clientHeight / 2, E = S.clientWidth / 2;
|
|
542
|
-
let
|
|
543
|
-
P ===
|
|
542
|
+
let D = 0, k = 0;
|
|
543
|
+
P === X.PAGE_SCROLLING && g(C.page), P === X.VERTICAL_SCROLLING && (D = l.heights.slice(0, C.page - 1).reduce((V, B) => V + B, 0)), P === X.HORIZONTAL_SCROLLING && (k = l.widths.slice(0, C.page - 1).reduce((V, B) => V + B, 0));
|
|
544
544
|
let G;
|
|
545
545
|
if (!M)
|
|
546
546
|
return;
|
|
547
|
-
const
|
|
548
|
-
G = new
|
|
549
|
-
viewport:
|
|
550
|
-
textContentSource:
|
|
547
|
+
const q = u.current[C.page], Z = M.page.getViewport({ scale: 1 });
|
|
548
|
+
G = new Jt.TextLayer({
|
|
549
|
+
viewport: Z,
|
|
550
|
+
textContentSource: q,
|
|
551
551
|
container: document.createElement("div")
|
|
552
552
|
}), G.render().then(() => {
|
|
553
|
-
const V = G.textDivs[C.start.idx], [
|
|
554
|
-
V.style.position = "absolute", V.style.color = "transparent",
|
|
555
|
-
const
|
|
556
|
-
left:
|
|
557
|
-
top:
|
|
553
|
+
const V = G.textDivs[C.start.idx], [B] = Xt([C], q, G.textDivs), se = l.widths[C.page - 1], ce = l.heights[C.page - 1], j = document.createElement("div"), J = document.createElement("div");
|
|
554
|
+
V.style.position = "absolute", V.style.color = "transparent", J.style.position = "absolute", J.style.top = "0", J.style.setProperty("--scale-factor", `${h}`), j.style.position = "relative", j.style.width = `${se}px`, j.style.height = `${ce}px`, j.style.zIndex = "-1", j.appendChild(V), J.appendChild(j), document.body.prepend(J);
|
|
555
|
+
const pe = B.element.getBoundingClientRect(), he = D + +pe.top - L + pe.height / 2, Se = {
|
|
556
|
+
left: k + +pe.left - E + pe.width / 2,
|
|
557
|
+
top: he
|
|
558
558
|
};
|
|
559
|
-
document.body.removeChild(
|
|
559
|
+
document.body.removeChild(J), S.scrollTo({
|
|
560
560
|
...Se
|
|
561
561
|
});
|
|
562
562
|
});
|
|
@@ -566,59 +566,59 @@ const Ko = () => {
|
|
|
566
566
|
l,
|
|
567
567
|
C,
|
|
568
568
|
P,
|
|
569
|
-
|
|
569
|
+
w,
|
|
570
570
|
f
|
|
571
571
|
]);
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
-
}, [
|
|
575
|
-
|
|
576
|
-
}, [
|
|
572
|
+
const x = R(() => {
|
|
573
|
+
_((S) => b ? S + 1 > b ? 1 : S + 1 : 0);
|
|
574
|
+
}, [b]), N = R(() => {
|
|
575
|
+
_((S) => b ? S - 1 <= 0 ? b : S - 1 : 0);
|
|
576
|
+
}, [b]), y = R(async (S) => {
|
|
577
577
|
if (!S)
|
|
578
578
|
return {};
|
|
579
579
|
const M = S.numPages, L = {};
|
|
580
580
|
for (let E = 1; E <= M; E++) {
|
|
581
581
|
if (p.current)
|
|
582
582
|
throw "close pop over";
|
|
583
|
-
const
|
|
584
|
-
L[E.toString()] = await
|
|
583
|
+
const D = await S.getPage(E);
|
|
584
|
+
L[E.toString()] = await D.getTextContent();
|
|
585
585
|
}
|
|
586
586
|
return L;
|
|
587
587
|
}, []);
|
|
588
588
|
return A(() => {
|
|
589
589
|
if (!n) {
|
|
590
|
-
p.current = !0,
|
|
590
|
+
p.current = !0, d([]), _(0);
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
p.current = !1, s(!0),
|
|
594
|
-
|
|
595
|
-
const L = Object.keys(S).reduce((E,
|
|
596
|
-
const
|
|
593
|
+
p.current = !1, s(!0), d([]), _(0), y(c).then((S) => {
|
|
594
|
+
u.current = S;
|
|
595
|
+
const L = Object.keys(S).reduce((E, D) => {
|
|
596
|
+
const k = Qn(
|
|
597
597
|
[n],
|
|
598
|
-
S[
|
|
599
|
-
Number(
|
|
598
|
+
S[D],
|
|
599
|
+
Number(D) - 1,
|
|
600
600
|
e
|
|
601
|
-
).map((G,
|
|
602
|
-
return [...E, ...
|
|
601
|
+
).map((G, q) => ({ ...G, page: Number(D), pageMatchIdx: q }));
|
|
602
|
+
return [...E, ...k];
|
|
603
603
|
}, []);
|
|
604
|
-
|
|
604
|
+
d(L), _(L.length ? 1 : 0);
|
|
605
605
|
}).catch(() => {
|
|
606
|
-
|
|
606
|
+
d([]), _(0);
|
|
607
607
|
}).finally(() => s(!1));
|
|
608
|
-
}, [n,
|
|
608
|
+
}, [n, y, c, e]), {
|
|
609
609
|
search: n,
|
|
610
610
|
setSearch: o,
|
|
611
611
|
loading: r,
|
|
612
612
|
matches: m,
|
|
613
|
-
totalMatches:
|
|
613
|
+
totalMatches: b,
|
|
614
614
|
currentMatchPosition: v,
|
|
615
615
|
currentMatch: C,
|
|
616
|
-
nextMatch:
|
|
616
|
+
nextMatch: x,
|
|
617
617
|
prevMatch: N,
|
|
618
618
|
currentMatchElement: T,
|
|
619
|
-
setCurrentMatchElement:
|
|
619
|
+
setCurrentMatchElement: I
|
|
620
620
|
};
|
|
621
|
-
},
|
|
621
|
+
}, dn = Ge({
|
|
622
622
|
search: "",
|
|
623
623
|
setSearch: (e) => {
|
|
624
624
|
},
|
|
@@ -636,7 +636,7 @@ const Ko = () => {
|
|
|
636
636
|
currentMatchElement: null,
|
|
637
637
|
setCurrentMatchElement: (e) => {
|
|
638
638
|
}
|
|
639
|
-
}),
|
|
639
|
+
}), Qa = ({
|
|
640
640
|
children: e,
|
|
641
641
|
initialSearch: t
|
|
642
642
|
}) => {
|
|
@@ -649,12 +649,12 @@ const Ko = () => {
|
|
|
649
649
|
search: p,
|
|
650
650
|
matches: h,
|
|
651
651
|
nextMatch: m,
|
|
652
|
-
prevMatch:
|
|
652
|
+
prevMatch: d,
|
|
653
653
|
currentMatchElement: g,
|
|
654
654
|
setCurrentMatchElement: v
|
|
655
|
-
} =
|
|
655
|
+
} = Yo(n, t);
|
|
656
656
|
return /* @__PURE__ */ a(
|
|
657
|
-
|
|
657
|
+
dn.Provider,
|
|
658
658
|
{
|
|
659
659
|
value: {
|
|
660
660
|
searchOptions: n,
|
|
@@ -665,7 +665,7 @@ const Ko = () => {
|
|
|
665
665
|
currentMatchPosition: i,
|
|
666
666
|
currentMatch: l,
|
|
667
667
|
nextMatch: m,
|
|
668
|
-
prevMatch:
|
|
668
|
+
prevMatch: d,
|
|
669
669
|
search: p,
|
|
670
670
|
matches: h,
|
|
671
671
|
currentMatchElement: g,
|
|
@@ -674,7 +674,7 @@ const Ko = () => {
|
|
|
674
674
|
children: e
|
|
675
675
|
}
|
|
676
676
|
);
|
|
677
|
-
},
|
|
677
|
+
}, pn = () => Ve(dn), le = {
|
|
678
678
|
"rp-pages": "_rp-pages_34orh_1",
|
|
679
679
|
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_34orh_7",
|
|
680
680
|
"rp-pages-container": "_rp-pages-container_34orh_11",
|
|
@@ -686,8 +686,8 @@ const Ko = () => {
|
|
|
686
686
|
"rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
|
|
687
687
|
"rp-page": "_rp-page_h7a2q_1",
|
|
688
688
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
689
|
-
},
|
|
690
|
-
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r =
|
|
689
|
+
}, Qo = (e) => {
|
|
690
|
+
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = H(null), { pages: s } = Q(), { rotate: c } = qe(), i = H(), { currentZoom: l } = Ze();
|
|
691
691
|
return A(() => {
|
|
692
692
|
if (!s || l === 0)
|
|
693
693
|
return;
|
|
@@ -698,7 +698,7 @@ const Ko = () => {
|
|
|
698
698
|
const m = i.current;
|
|
699
699
|
m && m.cancel(), o && o(), i.current = it(p.page, h, l, c), i.current.promise.then(() => {
|
|
700
700
|
h.hidden = !1;
|
|
701
|
-
}).catch((
|
|
701
|
+
}).catch((d) => {
|
|
702
702
|
}).finally(() => {
|
|
703
703
|
n && n();
|
|
704
704
|
});
|
|
@@ -707,60 +707,60 @@ const Ko = () => {
|
|
|
707
707
|
}, Ye = {
|
|
708
708
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
709
709
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
710
|
-
},
|
|
711
|
-
const { pageNumber: t } = e, { pages: n } =
|
|
710
|
+
}, er = (e) => {
|
|
711
|
+
const { pageNumber: t } = e, { pages: n } = Q(), o = H(null), { matches: r, currentMatch: s, setCurrentMatchElement: c } = pn(), [i, l] = $(
|
|
712
712
|
[]
|
|
713
|
-
), p =
|
|
714
|
-
(v,
|
|
715
|
-
if (f &&
|
|
713
|
+
), p = H(), h = H(), m = H(), d = z(() => r.filter((v) => v.pageIndex === t - 1), [r, t]), g = R(
|
|
714
|
+
(v, _, f = !1) => {
|
|
715
|
+
if (f && eo(v, _), !d.length) {
|
|
716
716
|
m.current = void 0, l([]);
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const
|
|
720
|
-
l(
|
|
719
|
+
const w = Xt(d, v, _);
|
|
720
|
+
l(w);
|
|
721
721
|
},
|
|
722
|
-
[
|
|
722
|
+
[d]
|
|
723
723
|
);
|
|
724
724
|
return A(() => {
|
|
725
725
|
var f;
|
|
726
726
|
if ((f = m.current) == null || f.classList.remove("selected"), !i.length || !s || s.pageIndex !== t - 1)
|
|
727
727
|
return;
|
|
728
|
-
const v =
|
|
729
|
-
(
|
|
728
|
+
const v = d.findIndex(
|
|
729
|
+
(w) => JSON.stringify(w) === JSON.stringify(s)
|
|
730
730
|
);
|
|
731
731
|
if (v === -1)
|
|
732
732
|
return;
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
}, [s, i,
|
|
733
|
+
const _ = i.find((w) => w.index === v);
|
|
734
|
+
_ && (m.current = _.element, c(_.element), _.element.classList.add("selected"));
|
|
735
|
+
}, [s, i, d]), A(() => {
|
|
736
736
|
const v = n.get(t);
|
|
737
737
|
if (!(!v || !o.current))
|
|
738
|
-
return p.current && p.current.cancel(), v.page.getTextContent().then((
|
|
738
|
+
return p.current && p.current.cancel(), v.page.getTextContent().then((_) => {
|
|
739
739
|
const f = v.page.getViewport({ scale: 1 });
|
|
740
|
-
return p.current = new
|
|
740
|
+
return p.current = new Jt.TextLayer({
|
|
741
741
|
viewport: f,
|
|
742
|
-
textContentSource:
|
|
742
|
+
textContentSource: _,
|
|
743
743
|
container: o.current
|
|
744
|
-
}), h.current =
|
|
744
|
+
}), h.current = _, o.current && (o.current.innerText = ""), p.current.render();
|
|
745
745
|
}).then(() => {
|
|
746
|
-
var
|
|
746
|
+
var w;
|
|
747
747
|
[].slice.call(o.current.children).forEach((P) => {
|
|
748
748
|
P.classList.add(Ye["rp-text-layer-text"]);
|
|
749
749
|
});
|
|
750
|
-
const f = (
|
|
750
|
+
const f = (w = p.current) == null ? void 0 : w.textDivs;
|
|
751
751
|
f && h.current && g(h.current, f);
|
|
752
752
|
}).catch(() => {
|
|
753
753
|
}), () => {
|
|
754
|
-
var
|
|
755
|
-
(
|
|
754
|
+
var _;
|
|
755
|
+
(_ = p.current) == null || _.cancel();
|
|
756
756
|
};
|
|
757
757
|
}, [n, t]), A(() => {
|
|
758
758
|
var f;
|
|
759
|
-
[].slice.call(o.current.children).forEach((
|
|
760
|
-
|
|
759
|
+
[].slice.call(o.current.children).forEach((w) => {
|
|
760
|
+
w.classList.add(Ye["rp-text-layer-text"]);
|
|
761
761
|
});
|
|
762
|
-
const
|
|
763
|
-
|
|
762
|
+
const _ = (f = p.current) == null ? void 0 : f.textDivs;
|
|
763
|
+
_ && h.current && g(h.current, _, !0);
|
|
764
764
|
}, [g]), /* @__PURE__ */ a(
|
|
765
765
|
"div",
|
|
766
766
|
{
|
|
@@ -769,18 +769,18 @@ const Ko = () => {
|
|
|
769
769
|
ref: o
|
|
770
770
|
}
|
|
771
771
|
);
|
|
772
|
-
},
|
|
772
|
+
}, tr = {
|
|
773
773
|
"rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
|
|
774
|
-
},
|
|
775
|
-
let
|
|
776
|
-
const lt = /* @__PURE__ */ new Map(),
|
|
777
|
-
function
|
|
778
|
-
const n =
|
|
774
|
+
}, hn = ["click", "dblclick", "mouseover", "input", "change"];
|
|
775
|
+
let nr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
776
|
+
const lt = /* @__PURE__ */ new Map(), mn = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
777
|
+
function or(e, t) {
|
|
778
|
+
const n = mn(e, t);
|
|
779
779
|
return lt.has(n) ? lt.get(n) ?? null : null;
|
|
780
780
|
}
|
|
781
|
-
const
|
|
782
|
-
lt.set(
|
|
783
|
-
},
|
|
781
|
+
const rr = (e, t, n) => {
|
|
782
|
+
lt.set(mn(e, t), n);
|
|
783
|
+
}, Rt = (e, t) => {
|
|
784
784
|
switch (t[1].name) {
|
|
785
785
|
case "XYZ":
|
|
786
786
|
return {
|
|
@@ -814,29 +814,29 @@ const or = (e, t, n) => {
|
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
|
-
async function
|
|
817
|
+
async function fn(e, t) {
|
|
818
818
|
let n;
|
|
819
819
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
820
|
-
const o = n[0], r =
|
|
820
|
+
const o = n[0], r = or(e, o);
|
|
821
821
|
if (r === null) {
|
|
822
822
|
const s = await e.getPageIndex(o);
|
|
823
|
-
return
|
|
823
|
+
return rr(e, o, s), await fn(e, n);
|
|
824
824
|
} else
|
|
825
|
-
return
|
|
825
|
+
return Rt(r, n);
|
|
826
826
|
} else
|
|
827
|
-
return
|
|
827
|
+
return Rt(n[0], n);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function sr(e) {
|
|
830
830
|
const { id: t, url: n, unsafeUrl: o } = e;
|
|
831
831
|
new MutationObserver((s, c) => {
|
|
832
832
|
const i = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
833
833
|
if (i) {
|
|
834
|
-
const l = i.querySelector("a"), p =
|
|
834
|
+
const l = i.querySelector("a"), p = go((n || o) ?? "", "");
|
|
835
835
|
l && (l.setAttribute("target", "_blank"), l.setAttribute("href", p), l.setAttribute("rel", "noopener noreferrer")), c.disconnect();
|
|
836
836
|
}
|
|
837
837
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
838
838
|
}
|
|
839
|
-
const
|
|
839
|
+
const ar = (e) => {
|
|
840
840
|
const n = e.target.parentNode;
|
|
841
841
|
if (!n)
|
|
842
842
|
return;
|
|
@@ -863,164 +863,164 @@ const sr = (e) => {
|
|
|
863
863
|
attributes: !0
|
|
864
864
|
// Watch for changes to attributes
|
|
865
865
|
}), () => o.disconnect();
|
|
866
|
-
},
|
|
866
|
+
}, Lt = (e, t, n, o) => {
|
|
867
867
|
if (e.type !== "click")
|
|
868
868
|
return;
|
|
869
869
|
const r = e.target, s = r.getAttribute("data-element-id"), c = r.getAttribute("href");
|
|
870
870
|
if (c && c !== "#")
|
|
871
871
|
return;
|
|
872
872
|
const i = t.find((l) => l.id === s);
|
|
873
|
-
!i || i.annotationType !== at.Link || i.dest &&
|
|
873
|
+
!i || i.annotationType !== at.Link || i.dest && fn(n, i.dest).then((l) => {
|
|
874
874
|
o(l);
|
|
875
875
|
});
|
|
876
876
|
};
|
|
877
|
-
function
|
|
878
|
-
for (const n of
|
|
877
|
+
function ir(e, t) {
|
|
878
|
+
for (const n of hn)
|
|
879
879
|
e.addEventListener(n, t);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
for (const n of
|
|
881
|
+
function Nt(e, t) {
|
|
882
|
+
for (const n of hn)
|
|
883
883
|
e.removeEventListener(n, t);
|
|
884
884
|
}
|
|
885
|
-
const
|
|
886
|
-
const { pageNumber: t } = e, n =
|
|
885
|
+
const cr = (e) => {
|
|
886
|
+
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = Q(), s = H(), [c, i] = $(), { setFocusedPage: l, goToPage: p } = oe(), { scrollMode: h } = Pe(), m = z(() => o.get(t), [o, t]), d = z(() => m == null ? void 0 : m.page.getViewport(), [m]);
|
|
887
887
|
A(() => {
|
|
888
888
|
s.current && (s.current.div.replaceChildren(), s.current = void 0);
|
|
889
889
|
}, [r]);
|
|
890
890
|
const g = z(() => r == null ? void 0 : r.annotationStorage, [r]);
|
|
891
891
|
A(() => {
|
|
892
|
-
m && m.page.getAnnotations().then((
|
|
893
|
-
s.current = void 0, i(
|
|
892
|
+
m && m.page.getAnnotations().then((_) => {
|
|
893
|
+
s.current = void 0, i(_), n.current && (n.current.innerText = "");
|
|
894
894
|
});
|
|
895
895
|
}, [m]);
|
|
896
896
|
const v = R(
|
|
897
|
-
(
|
|
898
|
-
|
|
897
|
+
(_) => {
|
|
898
|
+
ar(_), !(!c || !r) && (h === X.PAGE_SCROLLING ? Lt(_, c, r, (f) => l(f.pageIndex + 1)) : Lt(_, c, r, (f) => p(f.pageIndex + 1)));
|
|
899
899
|
},
|
|
900
900
|
[r, c, p, l, h]
|
|
901
901
|
);
|
|
902
902
|
return A(() => {
|
|
903
903
|
if (!m || !c)
|
|
904
904
|
return;
|
|
905
|
-
const
|
|
905
|
+
const _ = m.page.getViewport();
|
|
906
906
|
if (s.current) {
|
|
907
907
|
s.current.update({
|
|
908
|
-
viewport:
|
|
908
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
909
909
|
});
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
for (const
|
|
913
|
-
const { annotationType: P } =
|
|
912
|
+
for (const w of c) {
|
|
913
|
+
const { annotationType: P } = w;
|
|
914
914
|
switch (P) {
|
|
915
915
|
case at.Link:
|
|
916
|
-
|
|
916
|
+
sr(w);
|
|
917
917
|
break;
|
|
918
918
|
case at.Widget:
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
return (async () => {
|
|
923
|
-
s.current = new
|
|
923
|
+
s.current = new ro({
|
|
924
924
|
div: n.current,
|
|
925
925
|
accessibilityManager: void 0,
|
|
926
926
|
annotationCanvasMap: void 0,
|
|
927
927
|
annotationEditorUIManager: void 0,
|
|
928
928
|
structTreeLayer: void 0,
|
|
929
929
|
page: m.page,
|
|
930
|
-
viewport:
|
|
931
|
-
}), n.current &&
|
|
932
|
-
const
|
|
930
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
931
|
+
}), n.current && Nt(n.current, v);
|
|
932
|
+
const w = await (r == null ? void 0 : r.hasJSActions()), P = await (r == null ? void 0 : r.getFieldObjects());
|
|
933
933
|
return s.current.render({
|
|
934
934
|
annotations: c,
|
|
935
935
|
annotationStorage: g,
|
|
936
|
-
hasJSActions:
|
|
936
|
+
hasJSActions: w,
|
|
937
937
|
fieldObjects: P,
|
|
938
938
|
div: n.current,
|
|
939
|
-
viewport:
|
|
939
|
+
viewport: _.clone({ dontFlip: !0 }),
|
|
940
940
|
page: m.page,
|
|
941
|
-
imageResourcesPath:
|
|
941
|
+
imageResourcesPath: nr,
|
|
942
942
|
renderForms: !1,
|
|
943
|
-
linkService: new
|
|
943
|
+
linkService: new fo(),
|
|
944
944
|
downloadManager: null,
|
|
945
945
|
enableScripting: !1
|
|
946
946
|
});
|
|
947
947
|
})().then(() => {
|
|
948
|
-
n.current &&
|
|
948
|
+
n.current && ir(n.current, v);
|
|
949
949
|
}), () => {
|
|
950
|
-
n.current &&
|
|
950
|
+
n.current && Nt(n.current, v);
|
|
951
951
|
};
|
|
952
952
|
}, [r, c, v]), /* @__PURE__ */ a(
|
|
953
953
|
"div",
|
|
954
954
|
{
|
|
955
955
|
"data-rp": `page-${t}-annotationLayer`,
|
|
956
|
-
style: { width: `${
|
|
957
|
-
className:
|
|
956
|
+
style: { width: `${d == null ? void 0 : d.width}px`, height: `${d == null ? void 0 : d.height}px` },
|
|
957
|
+
className: tr["rp-annotation-layer"],
|
|
958
958
|
ref: n
|
|
959
959
|
}
|
|
960
960
|
);
|
|
961
|
-
},
|
|
962
|
-
const { pageNumber: n, style: o, onIntersectRatioChange: r, ...s } = e, { pages: c } =
|
|
961
|
+
}, lr = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], wt = Ue((e, t) => {
|
|
962
|
+
const { pageNumber: n, style: o, onIntersectRatioChange: r, ...s } = e, { pages: c } = Q(), { rotate: i } = qe(), { textLayer: l } = Kn(), { currentZoom: p } = Ze(), { container: h } = Qt(), m = H(c.get(n)), [d, g] = $(!1), v = H(null), [_, f] = $({
|
|
963
963
|
width: 0,
|
|
964
964
|
height: 0
|
|
965
965
|
});
|
|
966
|
-
|
|
967
|
-
if (c && (
|
|
968
|
-
const
|
|
969
|
-
|
|
966
|
+
Zt(t, () => v.current), A(() => {
|
|
967
|
+
if (c && (m.current = c.get(n), m.current)) {
|
|
968
|
+
const I = m.current.page.getViewport({ scale: p, rotation: i });
|
|
969
|
+
f(I);
|
|
970
970
|
}
|
|
971
971
|
}, [c, n, i, p]);
|
|
972
|
-
const
|
|
972
|
+
const w = z(() => {
|
|
973
973
|
switch (i) {
|
|
974
974
|
case 90:
|
|
975
|
-
return `${
|
|
975
|
+
return `${_.width / 2}px ${_.width / 2}px`;
|
|
976
976
|
case -90:
|
|
977
977
|
case 270:
|
|
978
|
-
return `${
|
|
978
|
+
return `${_.height / 2}px ${_.height / 2}px`;
|
|
979
979
|
default:
|
|
980
980
|
return "center";
|
|
981
981
|
}
|
|
982
|
-
}, [i,
|
|
983
|
-
|
|
984
|
-
}, []),
|
|
985
|
-
|
|
982
|
+
}, [i, _]), P = R(() => {
|
|
983
|
+
g(!0);
|
|
984
|
+
}, []), T = R(() => {
|
|
985
|
+
g(!1);
|
|
986
986
|
}, []);
|
|
987
987
|
return A(() => {
|
|
988
|
-
const
|
|
989
|
-
(
|
|
990
|
-
r
|
|
988
|
+
const I = new IntersectionObserver(
|
|
989
|
+
(u) => {
|
|
990
|
+
r(n, u[0].intersectionRatio);
|
|
991
991
|
},
|
|
992
|
-
{ threshold:
|
|
992
|
+
{ threshold: lr, root: h, rootMargin: "0px" }
|
|
993
993
|
);
|
|
994
|
-
return
|
|
995
|
-
|
|
994
|
+
return v.current && I.observe(v.current), () => {
|
|
995
|
+
I.disconnect(), r(n, -1);
|
|
996
996
|
};
|
|
997
|
-
}, [r, n, i]), /* @__PURE__ */ a(
|
|
997
|
+
}, [r, n, i, _]), /* @__PURE__ */ a(
|
|
998
998
|
"div",
|
|
999
999
|
{
|
|
1000
|
-
ref:
|
|
1000
|
+
ref: v,
|
|
1001
1001
|
id: `page-${n}`,
|
|
1002
1002
|
"data-rp": `page-${n}`,
|
|
1003
1003
|
...s,
|
|
1004
1004
|
style: {
|
|
1005
1005
|
...o,
|
|
1006
1006
|
"--rp-rotate": `${i}deg`,
|
|
1007
|
-
"--rp-page-rotate-translate": `${
|
|
1007
|
+
"--rp-page-rotate-translate": `${w}`,
|
|
1008
1008
|
"--scale-factor": p
|
|
1009
1009
|
},
|
|
1010
1010
|
className: Je["rp-page-wrapper"],
|
|
1011
|
-
children: /* @__PURE__ */
|
|
1011
|
+
children: /* @__PURE__ */ O(
|
|
1012
1012
|
"div",
|
|
1013
1013
|
{
|
|
1014
1014
|
style: {
|
|
1015
|
-
width: `${
|
|
1016
|
-
height: `${
|
|
1015
|
+
width: `${_.width}px`,
|
|
1016
|
+
height: `${_.height}px`
|
|
1017
1017
|
},
|
|
1018
1018
|
className: Je["rp-page"],
|
|
1019
1019
|
children: [
|
|
1020
|
-
/* @__PURE__ */ a(
|
|
1021
|
-
|
|
1022
|
-
l && /* @__PURE__ */ a(
|
|
1023
|
-
/* @__PURE__ */ a(
|
|
1020
|
+
/* @__PURE__ */ a(Qo, { onLoading: P, onLoaded: T, pageNumber: n }),
|
|
1021
|
+
d && /* @__PURE__ */ a("div", { className: Je["rp-loader-wrapper"], children: /* @__PURE__ */ a(Ne, {}) }),
|
|
1022
|
+
l && /* @__PURE__ */ a(er, { pageNumber: n }),
|
|
1023
|
+
/* @__PURE__ */ a(cr, { pageNumber: n })
|
|
1024
1024
|
]
|
|
1025
1025
|
}
|
|
1026
1026
|
)
|
|
@@ -1037,7 +1037,7 @@ function ut() {
|
|
|
1037
1037
|
return e;
|
|
1038
1038
|
}, ut.apply(null, arguments);
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function Mt(e) {
|
|
1041
1041
|
if (e === void 0)
|
|
1042
1042
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1043
1043
|
return e;
|
|
@@ -1047,25 +1047,25 @@ function dt(e, t) {
|
|
|
1047
1047
|
return n.__proto__ = o, n;
|
|
1048
1048
|
}, dt(e, t);
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function ur(e, t) {
|
|
1051
1051
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, dt(e, t);
|
|
1052
1052
|
}
|
|
1053
|
-
var
|
|
1053
|
+
var Et = Number.isNaN || function(t) {
|
|
1054
1054
|
return typeof t == "number" && t !== t;
|
|
1055
1055
|
};
|
|
1056
|
-
function ur(e, t) {
|
|
1057
|
-
return !!(e === t || Mt(e) && Mt(t));
|
|
1058
|
-
}
|
|
1059
1056
|
function dr(e, t) {
|
|
1057
|
+
return !!(e === t || Et(e) && Et(t));
|
|
1058
|
+
}
|
|
1059
|
+
function pr(e, t) {
|
|
1060
1060
|
if (e.length !== t.length)
|
|
1061
1061
|
return !1;
|
|
1062
1062
|
for (var n = 0; n < e.length; n++)
|
|
1063
|
-
if (!
|
|
1063
|
+
if (!dr(e[n], t[n]))
|
|
1064
1064
|
return !1;
|
|
1065
1065
|
return !0;
|
|
1066
1066
|
}
|
|
1067
1067
|
function Qe(e, t) {
|
|
1068
|
-
t === void 0 && (t =
|
|
1068
|
+
t === void 0 && (t = pr);
|
|
1069
1069
|
var n, o = [], r, s = !1;
|
|
1070
1070
|
function c() {
|
|
1071
1071
|
for (var i = [], l = 0; l < arguments.length; l++)
|
|
@@ -1074,7 +1074,7 @@ function Qe(e, t) {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
return c;
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function Ot(e, t) {
|
|
1078
1078
|
if (e == null)
|
|
1079
1079
|
return {};
|
|
1080
1080
|
var n = {};
|
|
@@ -1086,18 +1086,18 @@ function Et(e, t) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
return n;
|
|
1088
1088
|
}
|
|
1089
|
-
var
|
|
1089
|
+
var hr = typeof performance == "object" && typeof performance.now == "function", Dt = hr ? function() {
|
|
1090
1090
|
return performance.now();
|
|
1091
1091
|
} : function() {
|
|
1092
1092
|
return Date.now();
|
|
1093
1093
|
};
|
|
1094
|
-
function
|
|
1094
|
+
function At(e) {
|
|
1095
1095
|
cancelAnimationFrame(e.id);
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
var n =
|
|
1097
|
+
function mr(e, t) {
|
|
1098
|
+
var n = Dt();
|
|
1099
1099
|
function o() {
|
|
1100
|
-
|
|
1100
|
+
Dt() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
|
|
1101
1101
|
}
|
|
1102
1102
|
var r = {
|
|
1103
1103
|
id: requestAnimationFrame(o)
|
|
@@ -1105,7 +1105,7 @@ function hr(e, t) {
|
|
|
1105
1105
|
return r;
|
|
1106
1106
|
}
|
|
1107
1107
|
var et = -1;
|
|
1108
|
-
function
|
|
1108
|
+
function fr(e) {
|
|
1109
1109
|
if (e === void 0 && (e = !1), et === -1 || e) {
|
|
1110
1110
|
var t = document.createElement("div"), n = t.style;
|
|
1111
1111
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), et = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
@@ -1113,7 +1113,7 @@ function mr(e) {
|
|
|
1113
1113
|
return et;
|
|
1114
1114
|
}
|
|
1115
1115
|
var be = null;
|
|
1116
|
-
function
|
|
1116
|
+
function zt(e) {
|
|
1117
1117
|
if (e === void 0 && (e = !1), be === null || e) {
|
|
1118
1118
|
var t = document.createElement("div"), n = t.style;
|
|
1119
1119
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
@@ -1122,230 +1122,230 @@ function At(e) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
return be;
|
|
1124
1124
|
}
|
|
1125
|
-
var
|
|
1125
|
+
var gr = 150, vr = function(t) {
|
|
1126
1126
|
var n = t.columnIndex;
|
|
1127
1127
|
t.data;
|
|
1128
1128
|
var o = t.rowIndex;
|
|
1129
1129
|
return o + ":" + n;
|
|
1130
1130
|
}, Ae = null, ze = null, Fe = null;
|
|
1131
1131
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ae = /* @__PURE__ */ new WeakSet(), ze = /* @__PURE__ */ new WeakSet(), Fe = /* @__PURE__ */ new WeakSet());
|
|
1132
|
-
function
|
|
1133
|
-
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, s = e.getColumnWidth, c = e.getEstimatedTotalHeight, i = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, m = e.getRowOffset,
|
|
1134
|
-
return t = /* @__PURE__ */ function(
|
|
1135
|
-
|
|
1136
|
-
function P(
|
|
1137
|
-
var
|
|
1138
|
-
return
|
|
1139
|
-
instance:
|
|
1132
|
+
function _r(e) {
|
|
1133
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, s = e.getColumnWidth, c = e.getEstimatedTotalHeight, i = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, m = e.getRowOffset, d = e.getRowStartIndexForOffset, g = e.getRowStopIndexForStartIndex, v = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, f = e.validateProps;
|
|
1134
|
+
return t = /* @__PURE__ */ function(w) {
|
|
1135
|
+
ur(P, w);
|
|
1136
|
+
function P(I) {
|
|
1137
|
+
var u;
|
|
1138
|
+
return u = w.call(this, I) || this, u._instanceProps = v(u.props, Mt(u)), u._resetIsScrollingTimeoutId = null, u._outerRef = void 0, u.state = {
|
|
1139
|
+
instance: Mt(u),
|
|
1140
1140
|
isScrolling: !1,
|
|
1141
1141
|
horizontalScrollDirection: "forward",
|
|
1142
|
-
scrollLeft: typeof
|
|
1143
|
-
scrollTop: typeof
|
|
1142
|
+
scrollLeft: typeof u.props.initialScrollLeft == "number" ? u.props.initialScrollLeft : 0,
|
|
1143
|
+
scrollTop: typeof u.props.initialScrollTop == "number" ? u.props.initialScrollTop : 0,
|
|
1144
1144
|
scrollUpdateWasRequested: !1,
|
|
1145
1145
|
verticalScrollDirection: "forward"
|
|
1146
|
-
},
|
|
1147
|
-
return
|
|
1146
|
+
}, u._callOnItemsRendered = void 0, u._callOnItemsRendered = Qe(function(C, b, x, N, y, S, M, L) {
|
|
1147
|
+
return u.props.onItemsRendered({
|
|
1148
1148
|
overscanColumnStartIndex: C,
|
|
1149
|
-
overscanColumnStopIndex:
|
|
1150
|
-
overscanRowStartIndex:
|
|
1149
|
+
overscanColumnStopIndex: b,
|
|
1150
|
+
overscanRowStartIndex: x,
|
|
1151
1151
|
overscanRowStopIndex: N,
|
|
1152
|
-
visibleColumnStartIndex:
|
|
1152
|
+
visibleColumnStartIndex: y,
|
|
1153
1153
|
visibleColumnStopIndex: S,
|
|
1154
1154
|
visibleRowStartIndex: M,
|
|
1155
1155
|
visibleRowStopIndex: L
|
|
1156
1156
|
});
|
|
1157
|
-
}),
|
|
1158
|
-
return
|
|
1159
|
-
horizontalScrollDirection:
|
|
1157
|
+
}), u._callOnScroll = void 0, u._callOnScroll = Qe(function(C, b, x, N, y) {
|
|
1158
|
+
return u.props.onScroll({
|
|
1159
|
+
horizontalScrollDirection: x,
|
|
1160
1160
|
scrollLeft: C,
|
|
1161
|
-
scrollTop:
|
|
1161
|
+
scrollTop: b,
|
|
1162
1162
|
verticalScrollDirection: N,
|
|
1163
|
-
scrollUpdateWasRequested:
|
|
1163
|
+
scrollUpdateWasRequested: y
|
|
1164
1164
|
});
|
|
1165
|
-
}),
|
|
1166
|
-
var
|
|
1165
|
+
}), u._getItemStyle = void 0, u._getItemStyle = function(C, b) {
|
|
1166
|
+
var x = u.props, N = x.columnWidth, y = x.direction, S = x.rowHeight, M = u._getItemStyleCache(_ && N, _ && y, _ && S), L = C + ":" + b, E;
|
|
1167
1167
|
if (M.hasOwnProperty(L))
|
|
1168
1168
|
E = M[L];
|
|
1169
1169
|
else {
|
|
1170
|
-
var
|
|
1170
|
+
var D = n(u.props, b, u._instanceProps), k = y === "rtl";
|
|
1171
1171
|
M[L] = E = {
|
|
1172
1172
|
position: "absolute",
|
|
1173
|
-
left:
|
|
1174
|
-
right:
|
|
1175
|
-
top: m(
|
|
1176
|
-
height: h(
|
|
1177
|
-
width: s(
|
|
1173
|
+
left: k ? void 0 : D,
|
|
1174
|
+
right: k ? D : void 0,
|
|
1175
|
+
top: m(u.props, C, u._instanceProps),
|
|
1176
|
+
height: h(u.props, C, u._instanceProps),
|
|
1177
|
+
width: s(u.props, b, u._instanceProps)
|
|
1178
1178
|
};
|
|
1179
1179
|
}
|
|
1180
1180
|
return E;
|
|
1181
|
-
},
|
|
1181
|
+
}, u._getItemStyleCache = void 0, u._getItemStyleCache = Qe(function(C, b, x) {
|
|
1182
1182
|
return {};
|
|
1183
|
-
}),
|
|
1184
|
-
var
|
|
1185
|
-
|
|
1186
|
-
if (E.scrollLeft ===
|
|
1183
|
+
}), u._onScroll = function(C) {
|
|
1184
|
+
var b = C.currentTarget, x = b.clientHeight, N = b.clientWidth, y = b.scrollLeft, S = b.scrollTop, M = b.scrollHeight, L = b.scrollWidth;
|
|
1185
|
+
u.setState(function(E) {
|
|
1186
|
+
if (E.scrollLeft === y && E.scrollTop === S)
|
|
1187
1187
|
return null;
|
|
1188
|
-
var
|
|
1189
|
-
if (
|
|
1190
|
-
switch (
|
|
1188
|
+
var D = u.props.direction, k = y;
|
|
1189
|
+
if (D === "rtl")
|
|
1190
|
+
switch (zt()) {
|
|
1191
1191
|
case "negative":
|
|
1192
|
-
|
|
1192
|
+
k = -y;
|
|
1193
1193
|
break;
|
|
1194
1194
|
case "positive-descending":
|
|
1195
|
-
|
|
1195
|
+
k = L - N - y;
|
|
1196
1196
|
break;
|
|
1197
1197
|
}
|
|
1198
|
-
|
|
1199
|
-
var G = Math.max(0, Math.min(S, M -
|
|
1198
|
+
k = Math.max(0, Math.min(k, L - N));
|
|
1199
|
+
var G = Math.max(0, Math.min(S, M - x));
|
|
1200
1200
|
return {
|
|
1201
1201
|
isScrolling: !0,
|
|
1202
|
-
horizontalScrollDirection: E.scrollLeft <
|
|
1203
|
-
scrollLeft:
|
|
1202
|
+
horizontalScrollDirection: E.scrollLeft < y ? "forward" : "backward",
|
|
1203
|
+
scrollLeft: k,
|
|
1204
1204
|
scrollTop: G,
|
|
1205
1205
|
verticalScrollDirection: E.scrollTop < S ? "forward" : "backward",
|
|
1206
1206
|
scrollUpdateWasRequested: !1
|
|
1207
1207
|
};
|
|
1208
|
-
},
|
|
1209
|
-
},
|
|
1210
|
-
var
|
|
1211
|
-
|
|
1212
|
-
},
|
|
1213
|
-
|
|
1214
|
-
},
|
|
1215
|
-
|
|
1208
|
+
}, u._resetIsScrollingDebounced);
|
|
1209
|
+
}, u._outerRefSetter = function(C) {
|
|
1210
|
+
var b = u.props.outerRef;
|
|
1211
|
+
u._outerRef = C, typeof b == "function" ? b(C) : b != null && typeof b == "object" && b.hasOwnProperty("current") && (b.current = C);
|
|
1212
|
+
}, u._resetIsScrollingDebounced = function() {
|
|
1213
|
+
u._resetIsScrollingTimeoutId !== null && At(u._resetIsScrollingTimeoutId), u._resetIsScrollingTimeoutId = mr(u._resetIsScrolling, gr);
|
|
1214
|
+
}, u._resetIsScrolling = function() {
|
|
1215
|
+
u._resetIsScrollingTimeoutId = null, u.setState({
|
|
1216
1216
|
isScrolling: !1
|
|
1217
1217
|
}, function() {
|
|
1218
|
-
|
|
1218
|
+
u._getItemStyleCache(-1);
|
|
1219
1219
|
});
|
|
1220
|
-
},
|
|
1220
|
+
}, u;
|
|
1221
1221
|
}
|
|
1222
|
-
P.getDerivedStateFromProps = function(
|
|
1223
|
-
return
|
|
1222
|
+
P.getDerivedStateFromProps = function(u, C) {
|
|
1223
|
+
return wr(u, C), f(u), null;
|
|
1224
1224
|
};
|
|
1225
1225
|
var T = P.prototype;
|
|
1226
|
-
return T.scrollTo = function(
|
|
1227
|
-
var C =
|
|
1228
|
-
C !== void 0 && (C = Math.max(0, C)),
|
|
1229
|
-
return C === void 0 && (C =
|
|
1230
|
-
horizontalScrollDirection:
|
|
1226
|
+
return T.scrollTo = function(u) {
|
|
1227
|
+
var C = u.scrollLeft, b = u.scrollTop;
|
|
1228
|
+
C !== void 0 && (C = Math.max(0, C)), b !== void 0 && (b = Math.max(0, b)), this.setState(function(x) {
|
|
1229
|
+
return C === void 0 && (C = x.scrollLeft), b === void 0 && (b = x.scrollTop), x.scrollLeft === C && x.scrollTop === b ? null : {
|
|
1230
|
+
horizontalScrollDirection: x.scrollLeft < C ? "forward" : "backward",
|
|
1231
1231
|
scrollLeft: C,
|
|
1232
|
-
scrollTop:
|
|
1232
|
+
scrollTop: b,
|
|
1233
1233
|
scrollUpdateWasRequested: !0,
|
|
1234
|
-
verticalScrollDirection:
|
|
1234
|
+
verticalScrollDirection: x.scrollTop < b ? "forward" : "backward"
|
|
1235
1235
|
};
|
|
1236
1236
|
}, this._resetIsScrollingDebounced);
|
|
1237
|
-
}, T.scrollToItem = function(
|
|
1238
|
-
var C =
|
|
1239
|
-
|
|
1240
|
-
var
|
|
1237
|
+
}, T.scrollToItem = function(u) {
|
|
1238
|
+
var C = u.align, b = C === void 0 ? "auto" : C, x = u.columnIndex, N = u.rowIndex, y = this.props, S = y.columnCount, M = y.height, L = y.rowCount, E = y.width, D = this.state, k = D.scrollLeft, G = D.scrollTop, q = fr();
|
|
1239
|
+
x !== void 0 && (x = Math.max(0, Math.min(x, S - 1))), N !== void 0 && (N = Math.max(0, Math.min(N, L - 1)));
|
|
1240
|
+
var Z = c(this.props, this._instanceProps), V = i(this.props, this._instanceProps), B = V > E ? q : 0, se = Z > M ? q : 0;
|
|
1241
1241
|
this.scrollTo({
|
|
1242
|
-
scrollLeft:
|
|
1243
|
-
scrollTop: N !== void 0 ? p(this.props, N,
|
|
1242
|
+
scrollLeft: x !== void 0 ? l(this.props, x, b, k, this._instanceProps, se) : k,
|
|
1243
|
+
scrollTop: N !== void 0 ? p(this.props, N, b, G, this._instanceProps, B) : G
|
|
1244
1244
|
});
|
|
1245
1245
|
}, T.componentDidMount = function() {
|
|
1246
|
-
var
|
|
1246
|
+
var u = this.props, C = u.initialScrollLeft, b = u.initialScrollTop;
|
|
1247
1247
|
if (this._outerRef != null) {
|
|
1248
|
-
var
|
|
1249
|
-
typeof C == "number" && (
|
|
1248
|
+
var x = this._outerRef;
|
|
1249
|
+
typeof C == "number" && (x.scrollLeft = C), typeof b == "number" && (x.scrollTop = b);
|
|
1250
1250
|
}
|
|
1251
1251
|
this._callPropsCallbacks();
|
|
1252
1252
|
}, T.componentDidUpdate = function() {
|
|
1253
|
-
var
|
|
1253
|
+
var u = this.props.direction, C = this.state, b = C.scrollLeft, x = C.scrollTop, N = C.scrollUpdateWasRequested;
|
|
1254
1254
|
if (N && this._outerRef != null) {
|
|
1255
|
-
var
|
|
1256
|
-
if (
|
|
1257
|
-
switch (
|
|
1255
|
+
var y = this._outerRef;
|
|
1256
|
+
if (u === "rtl")
|
|
1257
|
+
switch (zt()) {
|
|
1258
1258
|
case "negative":
|
|
1259
|
-
|
|
1259
|
+
y.scrollLeft = -b;
|
|
1260
1260
|
break;
|
|
1261
1261
|
case "positive-ascending":
|
|
1262
|
-
|
|
1262
|
+
y.scrollLeft = b;
|
|
1263
1263
|
break;
|
|
1264
1264
|
default:
|
|
1265
|
-
var S =
|
|
1266
|
-
|
|
1265
|
+
var S = y.clientWidth, M = y.scrollWidth;
|
|
1266
|
+
y.scrollLeft = M - S - b;
|
|
1267
1267
|
break;
|
|
1268
1268
|
}
|
|
1269
1269
|
else
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
y.scrollLeft = Math.max(0, b);
|
|
1271
|
+
y.scrollTop = Math.max(0, x);
|
|
1272
1272
|
}
|
|
1273
1273
|
this._callPropsCallbacks();
|
|
1274
1274
|
}, T.componentWillUnmount = function() {
|
|
1275
|
-
this._resetIsScrollingTimeoutId !== null &&
|
|
1275
|
+
this._resetIsScrollingTimeoutId !== null && At(this._resetIsScrollingTimeoutId);
|
|
1276
1276
|
}, T.render = function() {
|
|
1277
|
-
var
|
|
1278
|
-
if (
|
|
1279
|
-
for (var
|
|
1280
|
-
for (var
|
|
1281
|
-
|
|
1282
|
-
columnIndex:
|
|
1277
|
+
var u = this.props, C = u.children, b = u.className, x = u.columnCount, N = u.direction, y = u.height, S = u.innerRef, M = u.innerElementType, L = u.innerTagName, E = u.itemData, D = u.itemKey, k = D === void 0 ? vr : D, G = u.outerElementType, q = u.outerTagName, Z = u.rowCount, V = u.style, B = u.useIsScrolling, se = u.width, ce = this.state.isScrolling, j = this._getHorizontalRangeToRender(), J = j[0], pe = j[1], he = this._getVerticalRangeToRender(), Ee = he[0], Se = he[1], Oe = [];
|
|
1278
|
+
if (x > 0 && Z)
|
|
1279
|
+
for (var F = Ee; F <= Se; F++)
|
|
1280
|
+
for (var W = J; W <= pe; W++)
|
|
1281
|
+
Oe.push(De(C, {
|
|
1282
|
+
columnIndex: W,
|
|
1283
1283
|
data: E,
|
|
1284
|
-
isScrolling:
|
|
1285
|
-
key:
|
|
1286
|
-
columnIndex:
|
|
1284
|
+
isScrolling: B ? ce : void 0,
|
|
1285
|
+
key: k({
|
|
1286
|
+
columnIndex: W,
|
|
1287
1287
|
data: E,
|
|
1288
|
-
rowIndex:
|
|
1288
|
+
rowIndex: F
|
|
1289
1289
|
}),
|
|
1290
|
-
rowIndex:
|
|
1291
|
-
style: this._getItemStyle(
|
|
1290
|
+
rowIndex: F,
|
|
1291
|
+
style: this._getItemStyle(F, W)
|
|
1292
1292
|
}));
|
|
1293
|
-
var
|
|
1294
|
-
return De(G ||
|
|
1295
|
-
className:
|
|
1293
|
+
var K = c(this.props, this._instanceProps), me = i(this.props, this._instanceProps);
|
|
1294
|
+
return De(G || q || "div", {
|
|
1295
|
+
className: b,
|
|
1296
1296
|
onScroll: this._onScroll,
|
|
1297
1297
|
ref: this._outerRefSetter,
|
|
1298
1298
|
style: ut({
|
|
1299
1299
|
position: "relative",
|
|
1300
|
-
height:
|
|
1301
|
-
width:
|
|
1300
|
+
height: y,
|
|
1301
|
+
width: se,
|
|
1302
1302
|
overflow: "auto",
|
|
1303
1303
|
WebkitOverflowScrolling: "touch",
|
|
1304
1304
|
willChange: "transform",
|
|
1305
1305
|
direction: N
|
|
1306
1306
|
}, V)
|
|
1307
1307
|
}, De(M || L || "div", {
|
|
1308
|
-
children:
|
|
1308
|
+
children: Oe,
|
|
1309
1309
|
ref: S,
|
|
1310
1310
|
style: {
|
|
1311
|
-
height:
|
|
1312
|
-
pointerEvents:
|
|
1313
|
-
width:
|
|
1311
|
+
height: K,
|
|
1312
|
+
pointerEvents: ce ? "none" : void 0,
|
|
1313
|
+
width: me
|
|
1314
1314
|
}
|
|
1315
1315
|
}));
|
|
1316
1316
|
}, T._callPropsCallbacks = function() {
|
|
1317
|
-
var
|
|
1318
|
-
if (typeof
|
|
1319
|
-
var
|
|
1320
|
-
this._callOnItemsRendered(S, M,
|
|
1317
|
+
var u = this.props, C = u.columnCount, b = u.onItemsRendered, x = u.onScroll, N = u.rowCount;
|
|
1318
|
+
if (typeof b == "function" && C > 0 && N > 0) {
|
|
1319
|
+
var y = this._getHorizontalRangeToRender(), S = y[0], M = y[1], L = y[2], E = y[3], D = this._getVerticalRangeToRender(), k = D[0], G = D[1], q = D[2], Z = D[3];
|
|
1320
|
+
this._callOnItemsRendered(S, M, k, G, L, E, q, Z);
|
|
1321
1321
|
}
|
|
1322
|
-
if (typeof
|
|
1323
|
-
var V = this.state,
|
|
1324
|
-
this._callOnScroll(
|
|
1322
|
+
if (typeof x == "function") {
|
|
1323
|
+
var V = this.state, B = V.horizontalScrollDirection, se = V.scrollLeft, ce = V.scrollTop, j = V.scrollUpdateWasRequested, J = V.verticalScrollDirection;
|
|
1324
|
+
this._callOnScroll(se, ce, B, J, j);
|
|
1325
1325
|
}
|
|
1326
1326
|
}, T._getHorizontalRangeToRender = function() {
|
|
1327
|
-
var
|
|
1328
|
-
if (C === 0 ||
|
|
1327
|
+
var u = this.props, C = u.columnCount, b = u.overscanColumnCount, x = u.overscanColumnsCount, N = u.overscanCount, y = u.rowCount, S = this.state, M = S.horizontalScrollDirection, L = S.isScrolling, E = S.scrollLeft, D = b || x || N || 1;
|
|
1328
|
+
if (C === 0 || y === 0)
|
|
1329
1329
|
return [0, 0, 0, 0];
|
|
1330
|
-
var
|
|
1331
|
-
return [Math.max(0,
|
|
1330
|
+
var k = o(this.props, E, this._instanceProps), G = r(this.props, k, E, this._instanceProps), q = !L || M === "backward" ? Math.max(1, D) : 1, Z = !L || M === "forward" ? Math.max(1, D) : 1;
|
|
1331
|
+
return [Math.max(0, k - q), Math.max(0, Math.min(C - 1, G + Z)), k, G];
|
|
1332
1332
|
}, T._getVerticalRangeToRender = function() {
|
|
1333
|
-
var
|
|
1334
|
-
if (C === 0 ||
|
|
1333
|
+
var u = this.props, C = u.columnCount, b = u.overscanCount, x = u.overscanRowCount, N = u.overscanRowsCount, y = u.rowCount, S = this.state, M = S.isScrolling, L = S.verticalScrollDirection, E = S.scrollTop, D = x || N || b || 1;
|
|
1334
|
+
if (C === 0 || y === 0)
|
|
1335
1335
|
return [0, 0, 0, 0];
|
|
1336
|
-
var
|
|
1337
|
-
return [Math.max(0,
|
|
1336
|
+
var k = d(this.props, E, this._instanceProps), G = g(this.props, k, E, this._instanceProps), q = !M || L === "backward" ? Math.max(1, D) : 1, Z = !M || L === "forward" ? Math.max(1, D) : 1;
|
|
1337
|
+
return [Math.max(0, k - q), Math.max(0, Math.min(y - 1, G + Z)), k, G];
|
|
1338
1338
|
}, P;
|
|
1339
|
-
}(
|
|
1339
|
+
}(qn), t.defaultProps = {
|
|
1340
1340
|
direction: "ltr",
|
|
1341
1341
|
itemData: void 0,
|
|
1342
1342
|
useIsScrolling: !1
|
|
1343
1343
|
}, t;
|
|
1344
1344
|
}
|
|
1345
|
-
var
|
|
1346
|
-
var o = t.children, r = t.direction, s = t.height, c = t.innerTagName, i = t.outerTagName, l = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, m = t.width,
|
|
1345
|
+
var wr = function(t, n) {
|
|
1346
|
+
var o = t.children, r = t.direction, s = t.height, c = t.innerTagName, i = t.outerTagName, l = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, m = t.width, d = n.instance;
|
|
1347
1347
|
if (process.env.NODE_ENV !== "production") {
|
|
1348
|
-
if (typeof p == "number" && Ae && !Ae.has(
|
|
1348
|
+
if (typeof p == "number" && Ae && !Ae.has(d) && (Ae.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof h == "number") && ze && !ze.has(d) && (ze.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || i != null) && Fe && !Fe.has(d) && (Fe.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1349
1349
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1350
1350
|
switch (r) {
|
|
1351
1351
|
case "ltr":
|
|
@@ -1359,7 +1359,7 @@ var _r = function(t, n) {
|
|
|
1359
1359
|
if (typeof s != "number")
|
|
1360
1360
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (s === null ? "null" : typeof s) + '" was specified.'));
|
|
1361
1361
|
}
|
|
1362
|
-
},
|
|
1362
|
+
}, Ft = 50, gn = function(t, n) {
|
|
1363
1363
|
var o = t.rowCount, r = n.rowMetadataMap, s = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, i = 0;
|
|
1364
1364
|
if (c >= o && (c = o - 1), c >= 0) {
|
|
1365
1365
|
var l = r[c];
|
|
@@ -1367,7 +1367,7 @@ var _r = function(t, n) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
var p = o - c - 1, h = p * s;
|
|
1369
1369
|
return i + h;
|
|
1370
|
-
},
|
|
1370
|
+
}, vn = function(t, n) {
|
|
1371
1371
|
var o = t.columnCount, r = n.columnMetadataMap, s = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, i = 0;
|
|
1372
1372
|
if (c >= o && (c = o - 1), c >= 0) {
|
|
1373
1373
|
var l = r[c];
|
|
@@ -1375,7 +1375,7 @@ var _r = function(t, n) {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
var p = o - c - 1, h = p * s;
|
|
1377
1377
|
return i + h;
|
|
1378
|
-
},
|
|
1378
|
+
}, ue = function(t, n, o, r) {
|
|
1379
1379
|
var s, c, i;
|
|
1380
1380
|
if (t === "column" ? (s = r.columnMetadataMap, c = n.columnWidth, i = r.lastMeasuredColumnIndex) : (s = r.rowMetadataMap, c = n.rowHeight, i = r.lastMeasuredRowIndex), o > i) {
|
|
1381
1381
|
var l = 0;
|
|
@@ -1393,78 +1393,78 @@ var _r = function(t, n) {
|
|
|
1393
1393
|
t === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1394
1394
|
}
|
|
1395
1395
|
return s[o];
|
|
1396
|
-
},
|
|
1396
|
+
}, kt = function(t, n, o, r) {
|
|
1397
1397
|
var s, c;
|
|
1398
1398
|
t === "column" ? (s = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (s = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
|
|
1399
1399
|
var i = c > 0 ? s[c].offset : 0;
|
|
1400
|
-
return i >= r ?
|
|
1401
|
-
},
|
|
1400
|
+
return i >= r ? _n(t, n, o, c, 0, r) : br(t, n, o, Math.max(0, c), r);
|
|
1401
|
+
}, _n = function(t, n, o, r, s, c) {
|
|
1402
1402
|
for (; s <= r; ) {
|
|
1403
|
-
var i = s + Math.floor((r - s) / 2), l =
|
|
1403
|
+
var i = s + Math.floor((r - s) / 2), l = ue(t, n, i, o).offset;
|
|
1404
1404
|
if (l === c)
|
|
1405
1405
|
return i;
|
|
1406
1406
|
l < c ? s = i + 1 : l > c && (r = i - 1);
|
|
1407
1407
|
}
|
|
1408
1408
|
return s > 0 ? s - 1 : 0;
|
|
1409
|
-
},
|
|
1410
|
-
for (var c = t === "column" ? n.columnCount : n.rowCount, i = 1; r < c &&
|
|
1409
|
+
}, br = function(t, n, o, r, s) {
|
|
1410
|
+
for (var c = t === "column" ? n.columnCount : n.rowCount, i = 1; r < c && ue(t, n, r, o).offset < s; )
|
|
1411
1411
|
r += i, i *= 2;
|
|
1412
|
-
return
|
|
1413
|
-
},
|
|
1414
|
-
var l = t === "column" ? n.width : n.height, p =
|
|
1415
|
-
switch (r === "smart" && (s >=
|
|
1412
|
+
return _n(t, n, o, Math.min(r, c - 1), Math.floor(r / 2), s);
|
|
1413
|
+
}, Wt = function(t, n, o, r, s, c, i) {
|
|
1414
|
+
var l = t === "column" ? n.width : n.height, p = ue(t, n, o, c), h = t === "column" ? vn(n, c) : gn(n, c), m = Math.max(0, Math.min(h - l, p.offset)), d = Math.max(0, p.offset - l + i + p.size);
|
|
1415
|
+
switch (r === "smart" && (s >= d - l && s <= m + l ? r = "auto" : r = "center"), r) {
|
|
1416
1416
|
case "start":
|
|
1417
1417
|
return m;
|
|
1418
1418
|
case "end":
|
|
1419
|
-
return
|
|
1419
|
+
return d;
|
|
1420
1420
|
case "center":
|
|
1421
|
-
return Math.round(
|
|
1421
|
+
return Math.round(d + (m - d) / 2);
|
|
1422
1422
|
case "auto":
|
|
1423
1423
|
default:
|
|
1424
|
-
return s >=
|
|
1424
|
+
return s >= d && s <= m ? s : d > m || s < d ? d : m;
|
|
1425
1425
|
}
|
|
1426
|
-
},
|
|
1426
|
+
}, Cr = /* @__PURE__ */ _r({
|
|
1427
1427
|
getColumnOffset: function(t, n, o) {
|
|
1428
|
-
return
|
|
1428
|
+
return ue("column", t, n, o).offset;
|
|
1429
1429
|
},
|
|
1430
1430
|
getColumnStartIndexForOffset: function(t, n, o) {
|
|
1431
|
-
return
|
|
1431
|
+
return kt("column", t, o, n);
|
|
1432
1432
|
},
|
|
1433
1433
|
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1434
|
-
for (var s = t.columnCount, c = t.width, i =
|
|
1435
|
-
h++, p +=
|
|
1434
|
+
for (var s = t.columnCount, c = t.width, i = ue("column", t, n, r), l = o + c, p = i.offset + i.size, h = n; h < s - 1 && p < l; )
|
|
1435
|
+
h++, p += ue("column", t, h, r).size;
|
|
1436
1436
|
return h;
|
|
1437
1437
|
},
|
|
1438
1438
|
getColumnWidth: function(t, n, o) {
|
|
1439
1439
|
return o.columnMetadataMap[n].size;
|
|
1440
1440
|
},
|
|
1441
|
-
getEstimatedTotalHeight:
|
|
1442
|
-
getEstimatedTotalWidth:
|
|
1441
|
+
getEstimatedTotalHeight: gn,
|
|
1442
|
+
getEstimatedTotalWidth: vn,
|
|
1443
1443
|
getOffsetForColumnAndAlignment: function(t, n, o, r, s, c) {
|
|
1444
|
-
return
|
|
1444
|
+
return Wt("column", t, n, o, r, s, c);
|
|
1445
1445
|
},
|
|
1446
1446
|
getOffsetForRowAndAlignment: function(t, n, o, r, s, c) {
|
|
1447
|
-
return
|
|
1447
|
+
return Wt("row", t, n, o, r, s, c);
|
|
1448
1448
|
},
|
|
1449
1449
|
getRowOffset: function(t, n, o) {
|
|
1450
|
-
return
|
|
1450
|
+
return ue("row", t, n, o).offset;
|
|
1451
1451
|
},
|
|
1452
1452
|
getRowHeight: function(t, n, o) {
|
|
1453
1453
|
return o.rowMetadataMap[n].size;
|
|
1454
1454
|
},
|
|
1455
1455
|
getRowStartIndexForOffset: function(t, n, o) {
|
|
1456
|
-
return
|
|
1456
|
+
return kt("row", t, o, n);
|
|
1457
1457
|
},
|
|
1458
1458
|
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1459
|
-
for (var s = t.rowCount, c = t.height, i =
|
|
1460
|
-
h++, p +=
|
|
1459
|
+
for (var s = t.rowCount, c = t.height, i = ue("row", t, n, r), l = o + c, p = i.offset + i.size, h = n; h < s - 1 && p < l; )
|
|
1460
|
+
h++, p += ue("row", t, h, r).size;
|
|
1461
1461
|
return h;
|
|
1462
1462
|
},
|
|
1463
1463
|
initInstanceProps: function(t, n) {
|
|
1464
1464
|
var o = t, r = o.estimatedColumnWidth, s = o.estimatedRowHeight, c = {
|
|
1465
1465
|
columnMetadataMap: {},
|
|
1466
|
-
estimatedColumnWidth: r ||
|
|
1467
|
-
estimatedRowHeight: s ||
|
|
1466
|
+
estimatedColumnWidth: r || Ft,
|
|
1467
|
+
estimatedRowHeight: s || Ft,
|
|
1468
1468
|
lastMeasuredColumnIndex: -1,
|
|
1469
1469
|
lastMeasuredRowIndex: -1,
|
|
1470
1470
|
rowMetadataMap: {}
|
|
@@ -1496,7 +1496,7 @@ var _r = function(t, n) {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
});
|
|
1498
1498
|
process.env.NODE_ENV;
|
|
1499
|
-
function
|
|
1499
|
+
function Ht(e, t) {
|
|
1500
1500
|
for (var n in e)
|
|
1501
1501
|
if (!(n in t))
|
|
1502
1502
|
return !0;
|
|
@@ -1505,23 +1505,23 @@ function Wt(e, t) {
|
|
|
1505
1505
|
return !0;
|
|
1506
1506
|
return !1;
|
|
1507
1507
|
}
|
|
1508
|
-
var
|
|
1509
|
-
function
|
|
1510
|
-
var n = e.style, o =
|
|
1511
|
-
return !
|
|
1508
|
+
var Tr = ["style"], Pr = ["style"];
|
|
1509
|
+
function Sr(e, t) {
|
|
1510
|
+
var n = e.style, o = Ot(e, Tr), r = t.style, s = Ot(t, Pr);
|
|
1511
|
+
return !Ht(n, r) && !Ht(o, s);
|
|
1512
1512
|
}
|
|
1513
|
-
const
|
|
1514
|
-
const { viewMode: e } = je(), { scrollMode: t } = Pe(), { setColumnCount: n } =
|
|
1513
|
+
const Ir = () => {
|
|
1514
|
+
const { viewMode: e } = je(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: o } = Be(), r = Yt(), s = R(
|
|
1515
1515
|
(g) => r.widths[g] || 0,
|
|
1516
1516
|
[r.widths]
|
|
1517
1517
|
), c = R(
|
|
1518
1518
|
(g) => r.heights[g] || 0,
|
|
1519
1519
|
[r.heights]
|
|
1520
|
-
), i = z(() => r.heights.length, [r.heights]), l = z(() => Math.max(...r.widths), [r.widths]), p = z(() => t ===
|
|
1520
|
+
), i = z(() => r.heights.length, [r.heights]), l = z(() => Math.max(...r.widths), [r.widths]), p = z(() => t === X.HORIZONTAL_SCROLLING ? i : e === We.DUAL_PAGE ? 2 : 1, [e, t, t, i, o, l]);
|
|
1521
1521
|
A(() => {
|
|
1522
1522
|
n(p);
|
|
1523
1523
|
}, [p, n]);
|
|
1524
|
-
const h = z(() => t ===
|
|
1524
|
+
const h = z(() => t === X.HORIZONTAL_SCROLLING || t === X.PAGE_SCROLLING ? 1 : Math.round(i / p), [p, i, t]), m = z(() => r.heights.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]), d = z(() => r.widths.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]);
|
|
1525
1525
|
return {
|
|
1526
1526
|
rowCount: h,
|
|
1527
1527
|
rowHeight: c,
|
|
@@ -1529,98 +1529,98 @@ const Sr = () => {
|
|
|
1529
1529
|
columnWidth: s,
|
|
1530
1530
|
pageDimension: r,
|
|
1531
1531
|
estimatedRowHeight: m,
|
|
1532
|
-
estimatedColumnWidth:
|
|
1532
|
+
estimatedColumnWidth: d
|
|
1533
1533
|
};
|
|
1534
1534
|
};
|
|
1535
|
-
let
|
|
1536
|
-
typeof window < "u" ?
|
|
1535
|
+
let ne;
|
|
1536
|
+
typeof window < "u" ? ne = window : typeof self < "u" ? ne = self : ne = global;
|
|
1537
1537
|
let pt = null, ht = null;
|
|
1538
|
-
const
|
|
1539
|
-
nt == null ||
|
|
1540
|
-
return
|
|
1538
|
+
const $t = 20, tt = ne.clearTimeout, Gt = ne.setTimeout, nt = ne.cancelAnimationFrame || ne.mozCancelAnimationFrame || ne.webkitCancelAnimationFrame, Vt = ne.requestAnimationFrame || ne.mozRequestAnimationFrame || ne.webkitRequestAnimationFrame;
|
|
1539
|
+
nt == null || Vt == null ? (pt = tt, ht = function(t) {
|
|
1540
|
+
return Gt(t, $t);
|
|
1541
1541
|
}) : (pt = function([t, n]) {
|
|
1542
1542
|
nt(t), tt(n);
|
|
1543
1543
|
}, ht = function(t) {
|
|
1544
|
-
const n =
|
|
1544
|
+
const n = Vt(function() {
|
|
1545
1545
|
tt(o), t();
|
|
1546
|
-
}), o =
|
|
1546
|
+
}), o = Gt(function() {
|
|
1547
1547
|
nt(n), t();
|
|
1548
|
-
},
|
|
1548
|
+
}, $t);
|
|
1549
1549
|
return [n, o];
|
|
1550
1550
|
});
|
|
1551
|
-
function
|
|
1551
|
+
function yr(e) {
|
|
1552
1552
|
let t, n, o, r, s, c, i;
|
|
1553
1553
|
const l = typeof document < "u" && document.attachEvent;
|
|
1554
1554
|
if (!l) {
|
|
1555
|
-
c = function(
|
|
1556
|
-
const P =
|
|
1557
|
-
|
|
1558
|
-
}, s = function(
|
|
1559
|
-
return
|
|
1560
|
-
}, i = function(
|
|
1561
|
-
if (
|
|
1555
|
+
c = function(w) {
|
|
1556
|
+
const P = w.__resizeTriggers__, T = P.firstElementChild, I = P.lastElementChild, u = T.firstElementChild;
|
|
1557
|
+
I.scrollLeft = I.scrollWidth, I.scrollTop = I.scrollHeight, u.style.width = T.offsetWidth + 1 + "px", u.style.height = T.offsetHeight + 1 + "px", T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight;
|
|
1558
|
+
}, s = function(w) {
|
|
1559
|
+
return w.offsetWidth !== w.__resizeLast__.width || w.offsetHeight !== w.__resizeLast__.height;
|
|
1560
|
+
}, i = function(w) {
|
|
1561
|
+
if (w.target.className && typeof w.target.className.indexOf == "function" && w.target.className.indexOf("contract-trigger") < 0 && w.target.className.indexOf("expand-trigger") < 0)
|
|
1562
1562
|
return;
|
|
1563
1563
|
const P = this;
|
|
1564
1564
|
c(this), this.__resizeRAF__ && pt(this.__resizeRAF__), this.__resizeRAF__ = ht(function() {
|
|
1565
|
-
s(P) && (P.__resizeLast__.width = P.offsetWidth, P.__resizeLast__.height = P.offsetHeight, P.__resizeListeners__.forEach(function(
|
|
1566
|
-
|
|
1565
|
+
s(P) && (P.__resizeLast__.width = P.offsetWidth, P.__resizeLast__.height = P.offsetHeight, P.__resizeListeners__.forEach(function(u) {
|
|
1566
|
+
u.call(P, w);
|
|
1567
1567
|
}));
|
|
1568
1568
|
});
|
|
1569
1569
|
};
|
|
1570
|
-
let
|
|
1570
|
+
let d = !1, g = "";
|
|
1571
1571
|
o = "animationstart";
|
|
1572
1572
|
const v = "Webkit Moz O ms".split(" ");
|
|
1573
|
-
let
|
|
1573
|
+
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), f = "";
|
|
1574
1574
|
{
|
|
1575
|
-
const
|
|
1576
|
-
if (
|
|
1575
|
+
const w = document.createElement("fakeelement");
|
|
1576
|
+
if (w.style.animationName !== void 0 && (d = !0), d === !1) {
|
|
1577
1577
|
for (let P = 0; P < v.length; P++)
|
|
1578
|
-
if (
|
|
1579
|
-
f = v[P], g = "-" + f.toLowerCase() + "-", o =
|
|
1578
|
+
if (w.style[v[P] + "AnimationName"] !== void 0) {
|
|
1579
|
+
f = v[P], g = "-" + f.toLowerCase() + "-", o = _[P], d = !0;
|
|
1580
1580
|
break;
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
n = "resizeanim", t = "@" + g + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = g + "animation: 1ms " + n + "; ";
|
|
1585
1585
|
}
|
|
1586
|
-
const p = function(
|
|
1587
|
-
if (!
|
|
1588
|
-
const g = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', v =
|
|
1589
|
-
|
|
1586
|
+
const p = function(d) {
|
|
1587
|
+
if (!d.getElementById("detectElementResize")) {
|
|
1588
|
+
const g = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', v = d.head || d.getElementsByTagName("head")[0], _ = d.createElement("style");
|
|
1589
|
+
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = g : _.appendChild(d.createTextNode(g)), v.appendChild(_);
|
|
1590
1590
|
}
|
|
1591
1591
|
};
|
|
1592
1592
|
return {
|
|
1593
|
-
addResizeListener: function(
|
|
1593
|
+
addResizeListener: function(d, g) {
|
|
1594
1594
|
if (l)
|
|
1595
|
-
|
|
1595
|
+
d.attachEvent("onresize", g);
|
|
1596
1596
|
else {
|
|
1597
|
-
if (!
|
|
1598
|
-
const v =
|
|
1599
|
-
|
|
1597
|
+
if (!d.__resizeTriggers__) {
|
|
1598
|
+
const v = d.ownerDocument, _ = ne.getComputedStyle(d);
|
|
1599
|
+
_ && _.position === "static" && (d.style.position = "relative"), p(v), d.__resizeLast__ = {}, d.__resizeListeners__ = [], (d.__resizeTriggers__ = v.createElement("div")).className = "resize-triggers";
|
|
1600
1600
|
const f = v.createElement("div");
|
|
1601
1601
|
f.className = "expand-trigger", f.appendChild(v.createElement("div"));
|
|
1602
|
-
const
|
|
1603
|
-
|
|
1604
|
-
T.animationName === n && c(
|
|
1605
|
-
},
|
|
1602
|
+
const w = v.createElement("div");
|
|
1603
|
+
w.className = "contract-trigger", d.__resizeTriggers__.appendChild(f), d.__resizeTriggers__.appendChild(w), d.appendChild(d.__resizeTriggers__), c(d), d.addEventListener("scroll", i, !0), o && (d.__resizeTriggers__.__animationListener__ = function(T) {
|
|
1604
|
+
T.animationName === n && c(d);
|
|
1605
|
+
}, d.__resizeTriggers__.addEventListener(o, d.__resizeTriggers__.__animationListener__));
|
|
1606
1606
|
}
|
|
1607
|
-
|
|
1607
|
+
d.__resizeListeners__.push(g);
|
|
1608
1608
|
}
|
|
1609
1609
|
},
|
|
1610
|
-
removeResizeListener: function(
|
|
1610
|
+
removeResizeListener: function(d, g) {
|
|
1611
1611
|
if (l)
|
|
1612
|
-
|
|
1613
|
-
else if (
|
|
1614
|
-
|
|
1612
|
+
d.detachEvent("onresize", g);
|
|
1613
|
+
else if (d.__resizeListeners__.splice(d.__resizeListeners__.indexOf(g), 1), !d.__resizeListeners__.length) {
|
|
1614
|
+
d.removeEventListener("scroll", i, !0), d.__resizeTriggers__.__animationListener__ && (d.__resizeTriggers__.removeEventListener(o, d.__resizeTriggers__.__animationListener__), d.__resizeTriggers__.__animationListener__ = null);
|
|
1615
1615
|
try {
|
|
1616
|
-
|
|
1616
|
+
d.__resizeTriggers__ = !d.removeChild(d.__resizeTriggers__);
|
|
1617
1617
|
} catch {
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
1621
|
};
|
|
1622
1622
|
}
|
|
1623
|
-
class
|
|
1623
|
+
class xr extends Zn {
|
|
1624
1624
|
constructor(...t) {
|
|
1625
1625
|
super(...t), this.state = {
|
|
1626
1626
|
height: this.props.defaultHeight || 0,
|
|
@@ -1635,16 +1635,16 @@ class yr extends Vn {
|
|
|
1635
1635
|
onResize: r
|
|
1636
1636
|
} = this.props;
|
|
1637
1637
|
if (this._parentNode) {
|
|
1638
|
-
const s = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(s.paddingLeft || "0"), i = parseFloat(s.paddingRight || "0"), l = parseFloat(s.paddingTop || "0"), p = parseFloat(s.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), m = h.height - l - p,
|
|
1639
|
-
(!n && (this.state.height !== g || this.state.scaledHeight !== m) || !o && (this.state.width !== v || this.state.scaledWidth !==
|
|
1638
|
+
const s = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(s.paddingLeft || "0"), i = parseFloat(s.paddingRight || "0"), l = parseFloat(s.paddingTop || "0"), p = parseFloat(s.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), m = h.height - l - p, d = h.width - c - i, g = this._parentNode.offsetHeight - l - p, v = this._parentNode.offsetWidth - c - i;
|
|
1639
|
+
(!n && (this.state.height !== g || this.state.scaledHeight !== m) || !o && (this.state.width !== v || this.state.scaledWidth !== d)) && (this.setState({
|
|
1640
1640
|
height: g,
|
|
1641
1641
|
width: v,
|
|
1642
1642
|
scaledHeight: m,
|
|
1643
|
-
scaledWidth:
|
|
1643
|
+
scaledWidth: d
|
|
1644
1644
|
}), typeof r == "function" && r({
|
|
1645
1645
|
height: g,
|
|
1646
1646
|
scaledHeight: m,
|
|
1647
|
-
scaledWidth:
|
|
1647
|
+
scaledWidth: d,
|
|
1648
1648
|
width: v
|
|
1649
1649
|
}));
|
|
1650
1650
|
}
|
|
@@ -1661,7 +1661,7 @@ class yr extends Vn {
|
|
|
1661
1661
|
const o = n.ownerDocument.defaultView.ResizeObserver;
|
|
1662
1662
|
o != null ? (this._resizeObserver = new o(() => {
|
|
1663
1663
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1664
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1664
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = yr(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
componentWillUnmount() {
|
|
@@ -1681,26 +1681,26 @@ class yr extends Vn {
|
|
|
1681
1681
|
tagName: h = "div",
|
|
1682
1682
|
...m
|
|
1683
1683
|
} = this.props, {
|
|
1684
|
-
height:
|
|
1684
|
+
height: d,
|
|
1685
1685
|
scaledHeight: g,
|
|
1686
1686
|
scaledWidth: v,
|
|
1687
|
-
width:
|
|
1687
|
+
width: _
|
|
1688
1688
|
} = this.state, f = {
|
|
1689
1689
|
overflow: "visible"
|
|
1690
|
-
},
|
|
1690
|
+
}, w = {};
|
|
1691
1691
|
let P = !1;
|
|
1692
|
-
return r || (
|
|
1692
|
+
return r || (d === 0 && (P = !0), f.height = 0, w.height = d, w.scaledHeight = g), s || (_ === 0 && (P = !0), f.width = 0, w.width = _, w.scaledWidth = v), c && (P = !1), De(h, {
|
|
1693
1693
|
ref: this._setRef,
|
|
1694
1694
|
style: {
|
|
1695
1695
|
...f,
|
|
1696
1696
|
...p
|
|
1697
1697
|
},
|
|
1698
1698
|
...m
|
|
1699
|
-
}, !P && t(
|
|
1699
|
+
}, !P && t(w));
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
const
|
|
1703
|
-
const { focusedPage: n, totalPages: o } =
|
|
1702
|
+
const Rr = ({ widths: e, heights: t }) => {
|
|
1703
|
+
const { focusedPage: n, totalPages: o } = oe(), r = z(() => {
|
|
1704
1704
|
const i = [], l = Math.ceil(n / 2) * 2 - 1;
|
|
1705
1705
|
if (i.push(l), l + 1 < o) {
|
|
1706
1706
|
const p = l + 1;
|
|
@@ -1722,9 +1722,10 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1722
1722
|
height: t(n)
|
|
1723
1723
|
}
|
|
1724
1724
|
], [e, t, r]), c = z(() => s.reduce((i, l) => i + Number(l.width || 0), 0), [s]);
|
|
1725
|
-
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((i, l) => /* @__PURE__ */ a(wt, {
|
|
1726
|
-
},
|
|
1727
|
-
|
|
1725
|
+
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((i, l) => /* @__PURE__ */ a(wt, { onIntersectRatioChange: () => {
|
|
1726
|
+
}, style: s[l], pageNumber: i }, i)) });
|
|
1727
|
+
}, Lr = ({ widths: e, heights: t }) => {
|
|
1728
|
+
const { focusedPage: n } = oe(), o = z(() => ({
|
|
1728
1729
|
position: "absolute",
|
|
1729
1730
|
width: e(n - 1),
|
|
1730
1731
|
height: t(n - 1)
|
|
@@ -1736,10 +1737,19 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1736
1737
|
width: r,
|
|
1737
1738
|
position: "relative"
|
|
1738
1739
|
},
|
|
1739
|
-
children: /* @__PURE__ */ a(
|
|
1740
|
+
children: /* @__PURE__ */ a(
|
|
1741
|
+
wt,
|
|
1742
|
+
{
|
|
1743
|
+
style: o,
|
|
1744
|
+
onIntersectRatioChange: () => {
|
|
1745
|
+
},
|
|
1746
|
+
pageNumber: n
|
|
1747
|
+
},
|
|
1748
|
+
n
|
|
1749
|
+
)
|
|
1740
1750
|
}
|
|
1741
1751
|
);
|
|
1742
|
-
},
|
|
1752
|
+
}, Nr = jn(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
|
|
1743
1753
|
const r = e + 1 + t * n.columnCount;
|
|
1744
1754
|
return /* @__PURE__ */ a(
|
|
1745
1755
|
wt,
|
|
@@ -1750,8 +1760,8 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1750
1760
|
},
|
|
1751
1761
|
r
|
|
1752
1762
|
);
|
|
1753
|
-
},
|
|
1754
|
-
const { initialPage: e = 1, initialScrollMode: t } =
|
|
1763
|
+
}, Sr), ei = () => {
|
|
1764
|
+
const { initialPage: e = 1, initialScrollMode: t } = Jn(), { getContainer: n, container: o } = Qt(), { scrollToPage: r } = sn(), {
|
|
1755
1765
|
virtualScrollRef: s,
|
|
1756
1766
|
getVirtualScrollRef: c,
|
|
1757
1767
|
getPageScrollElementRef: i,
|
|
@@ -1759,125 +1769,123 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1759
1769
|
setTotalInnerDimensions: p,
|
|
1760
1770
|
totalInnerDimensions: h,
|
|
1761
1771
|
pageScrollElementRef: m
|
|
1762
|
-
} = Be(), { nextPage:
|
|
1772
|
+
} = Be(), { nextPage: d, prevPage: g, setFocusedPage: v, focusedPage: _ } = oe(), { scrollMode: f } = Pe(), { viewMode: w } = je(), P = H(null), T = H(
|
|
1763
1773
|
h
|
|
1764
|
-
),
|
|
1765
|
-
viewMode:
|
|
1774
|
+
), I = H({
|
|
1775
|
+
viewMode: w,
|
|
1766
1776
|
scrollMode: f
|
|
1767
|
-
}),
|
|
1768
|
-
pageDimension:
|
|
1777
|
+
}), u = H(!1), C = H(), { isFullScreen: b } = Yn(), {
|
|
1778
|
+
pageDimension: x,
|
|
1769
1779
|
rowCount: N,
|
|
1770
|
-
rowHeight:
|
|
1780
|
+
rowHeight: y,
|
|
1771
1781
|
columnCount: S,
|
|
1772
1782
|
columnWidth: M,
|
|
1773
1783
|
estimatedColumnWidth: L,
|
|
1774
1784
|
estimatedRowHeight: E
|
|
1775
|
-
} =
|
|
1785
|
+
} = Ir(), [D, k] = $({}), G = en(D, 100), { isScrolling: q } = Kt(), Z = H(), V = H({
|
|
1776
1786
|
scrollTop: 0,
|
|
1777
1787
|
scrollLeft: 0
|
|
1778
1788
|
});
|
|
1779
|
-
|
|
1780
|
-
const { isPressed:
|
|
1781
|
-
isPressed:
|
|
1782
|
-
}),
|
|
1783
|
-
|
|
1784
|
-
}, []),
|
|
1789
|
+
wo(o);
|
|
1790
|
+
const { isPressed: B } = vo(), { selectionMode: se } = Xn(), { initializeGrabScroll: ce } = _o({
|
|
1791
|
+
isPressed: B
|
|
1792
|
+
}), j = z(() => se === Bn.HAND, [se]), J = R((F, W) => {
|
|
1793
|
+
k((K) => W > -1 ? { ...K, [F]: Math.round(W * 100) } : (delete K[F], K));
|
|
1794
|
+
}, []), pe = z(() => ({
|
|
1785
1795
|
columnCount: S,
|
|
1786
|
-
handleIntersectRatioChange:
|
|
1787
|
-
}), [S,
|
|
1788
|
-
(
|
|
1789
|
-
const
|
|
1790
|
-
!
|
|
1796
|
+
handleIntersectRatioChange: J
|
|
1797
|
+
}), [S, J]), he = R(
|
|
1798
|
+
(F) => {
|
|
1799
|
+
const W = document.activeElement !== o;
|
|
1800
|
+
!b && W || (["ArrowUp", "ArrowLeft"].includes(F.key) ? (F.preventDefault(), g()) : ["ArrowDown", "ArrowRight"].includes(F.key) && (F.preventDefault(), d()));
|
|
1791
1801
|
},
|
|
1792
|
-
[
|
|
1793
|
-
),
|
|
1794
|
-
|
|
1795
|
-
scrollTop:
|
|
1796
|
-
scrollLeft:
|
|
1802
|
+
[d, g, b, f]
|
|
1803
|
+
), Ee = R((F) => {
|
|
1804
|
+
V.current = {
|
|
1805
|
+
scrollTop: F.scrollTop,
|
|
1806
|
+
scrollLeft: F.scrollLeft
|
|
1797
1807
|
};
|
|
1798
1808
|
}, []);
|
|
1799
|
-
A(() => (window.addEventListener("keydown",
|
|
1800
|
-
window.removeEventListener("keydown",
|
|
1801
|
-
}), [
|
|
1809
|
+
A(() => (window.addEventListener("keydown", he), () => {
|
|
1810
|
+
window.removeEventListener("keydown", he);
|
|
1811
|
+
}), [he]), A(() => {
|
|
1802
1812
|
if (P.current && (P.current.style.position = "relative"), !!s) {
|
|
1803
1813
|
T.current = {
|
|
1804
1814
|
height: h.height,
|
|
1805
1815
|
width: h.width
|
|
1806
1816
|
}, p({
|
|
1807
1817
|
height: Array.from({ length: N }).reduce(
|
|
1808
|
-
(
|
|
1818
|
+
(F, W, K) => F + y(K),
|
|
1809
1819
|
0
|
|
1810
1820
|
),
|
|
1811
1821
|
width: Array.from({ length: S }).reduce(
|
|
1812
|
-
(
|
|
1822
|
+
(F, W, K) => F + M(K),
|
|
1813
1823
|
0
|
|
1814
1824
|
)
|
|
1815
1825
|
});
|
|
1816
|
-
for (let
|
|
1817
|
-
for (let
|
|
1826
|
+
for (let F = 0; F < N; F++)
|
|
1827
|
+
for (let W = 0; W < S; W++)
|
|
1818
1828
|
s.resetAfterIndices({
|
|
1819
|
-
columnIndex:
|
|
1820
|
-
rowIndex:
|
|
1829
|
+
columnIndex: W,
|
|
1830
|
+
rowIndex: F,
|
|
1821
1831
|
shouldForceUpdate: !0
|
|
1822
1832
|
});
|
|
1823
1833
|
}
|
|
1824
|
-
}, [N, S,
|
|
1825
|
-
if (
|
|
1834
|
+
}, [N, S, x, s, r]), A(() => {
|
|
1835
|
+
if (q.current)
|
|
1826
1836
|
return;
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1837
|
+
if (I.current.viewMode !== w || I.current.scrollMode !== f) {
|
|
1838
|
+
Z.current && clearTimeout(Z.current), k({}), u.current = !0, r(_), f === X.HORIZONTAL_SCROLLING && (s == null || s.scrollTo({
|
|
1829
1839
|
scrollTop: 0
|
|
1830
|
-
})),
|
|
1840
|
+
})), Z.current = setTimeout(() => {
|
|
1831
1841
|
requestAnimationFrame(() => {
|
|
1832
|
-
|
|
1842
|
+
I.current = { viewMode: w, scrollMode: f };
|
|
1833
1843
|
});
|
|
1834
1844
|
}, 100);
|
|
1835
1845
|
return;
|
|
1836
1846
|
}
|
|
1837
|
-
const
|
|
1847
|
+
const W = V.current.scrollTop, K = V.current.scrollLeft;
|
|
1838
1848
|
if (h.height && h.width) {
|
|
1839
|
-
|
|
1840
|
-
const { height:
|
|
1849
|
+
u.current = !0;
|
|
1850
|
+
const { height: me, width: St } = h, { height: Wn, width: Hn } = T.current, $n = W / Wn * me, Gn = K / Hn * St, Vn = Math.min($n, me) || 0, Un = Math.min(Gn, St) || 0;
|
|
1841
1851
|
s == null || s.scrollTo({
|
|
1842
|
-
scrollTop:
|
|
1843
|
-
scrollLeft:
|
|
1852
|
+
scrollTop: Vn,
|
|
1853
|
+
scrollLeft: Un
|
|
1844
1854
|
}), C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
1845
|
-
|
|
1855
|
+
u.current = !1;
|
|
1846
1856
|
}, 100);
|
|
1847
1857
|
}
|
|
1848
|
-
}, [h,
|
|
1849
|
-
|
|
1850
|
-
if (G.current || d.current) {
|
|
1851
|
-
G.current = !1;
|
|
1858
|
+
}, [h, w, f]), A(() => {
|
|
1859
|
+
if ((q.current || u.current) && (q.current = !1), q.current)
|
|
1852
1860
|
return;
|
|
1853
|
-
|
|
1854
|
-
let
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}),
|
|
1858
|
-
}, [
|
|
1859
|
-
|
|
1861
|
+
const F = Object.entries(G);
|
|
1862
|
+
let W = 0, K = -1;
|
|
1863
|
+
F.forEach((me) => {
|
|
1864
|
+
K < me[1] && (W = Number(me[0]), K = me[1]);
|
|
1865
|
+
}), W && v(W);
|
|
1866
|
+
}, [G, v]), A(() => () => {
|
|
1867
|
+
Z.current && clearTimeout(Z.current), C.current && clearTimeout(C.current);
|
|
1860
1868
|
}, []);
|
|
1861
|
-
const
|
|
1862
|
-
[
|
|
1863
|
-
[
|
|
1864
|
-
}), [
|
|
1865
|
-
(
|
|
1866
|
-
if (
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1869
|
+
const Se = z(() => ee(le["rp-pages-container"], {
|
|
1870
|
+
[le["rp-cursor-grab"]]: j && !B,
|
|
1871
|
+
[le["rp-cursor-grabbing"]]: j && B
|
|
1872
|
+
}), [j, B]), Oe = R(
|
|
1873
|
+
(F) => {
|
|
1874
|
+
if (j && F) {
|
|
1875
|
+
const W = ee(le["rp-pages"]), K = document.querySelector(`.${W}`);
|
|
1876
|
+
ce(K);
|
|
1869
1877
|
}
|
|
1870
1878
|
},
|
|
1871
|
-
[
|
|
1879
|
+
[j, ce, le]
|
|
1872
1880
|
);
|
|
1873
1881
|
return A(() => {
|
|
1874
|
-
if (t ===
|
|
1875
|
-
e !==
|
|
1882
|
+
if (t === X.PAGE_SCROLLING) {
|
|
1883
|
+
e !== _ && m && v(e);
|
|
1876
1884
|
return;
|
|
1877
1885
|
}
|
|
1878
1886
|
if (s != null && s.scrollToItem) {
|
|
1879
1887
|
switch (t) {
|
|
1880
|
-
case
|
|
1888
|
+
case X.HORIZONTAL_SCROLLING:
|
|
1881
1889
|
s.scrollToItem({
|
|
1882
1890
|
columnIndex: e - 1,
|
|
1883
1891
|
rowIndex: 0,
|
|
@@ -1894,35 +1902,35 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1894
1902
|
}
|
|
1895
1903
|
v(e);
|
|
1896
1904
|
}
|
|
1897
|
-
}, [s, t, m, v]), /* @__PURE__ */ a("div", { ref: n, tabIndex: -1, className:
|
|
1905
|
+
}, [s, t, m, v]), /* @__PURE__ */ a("div", { ref: n, tabIndex: -1, className: Se, children: /* @__PURE__ */ a(xr, { children: ({ width: F, height: W }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Oe, style: { width: F, height: W }, children: f === X.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1898
1906
|
"div",
|
|
1899
1907
|
{
|
|
1900
1908
|
ref: i,
|
|
1901
|
-
style: { width:
|
|
1902
|
-
className:
|
|
1903
|
-
children:
|
|
1909
|
+
style: { width: F, height: W },
|
|
1910
|
+
className: ee(le["rp-pages"], le["rp-page-scrolling-wrapper"]),
|
|
1911
|
+
children: w === We.DUAL_PAGE ? /* @__PURE__ */ a(Rr, { widths: M, heights: y }) : /* @__PURE__ */ a(Lr, { widths: M, heights: y })
|
|
1904
1912
|
}
|
|
1905
1913
|
) : L ? /* @__PURE__ */ a(
|
|
1906
|
-
|
|
1914
|
+
Cr,
|
|
1907
1915
|
{
|
|
1908
1916
|
ref: c,
|
|
1909
|
-
itemData:
|
|
1917
|
+
itemData: pe,
|
|
1910
1918
|
outerRef: l,
|
|
1911
1919
|
innerRef: P,
|
|
1912
|
-
onScroll:
|
|
1920
|
+
onScroll: Ee,
|
|
1913
1921
|
columnCount: S,
|
|
1914
1922
|
columnWidth: M,
|
|
1915
|
-
rowHeight:
|
|
1916
|
-
height:
|
|
1917
|
-
width:
|
|
1923
|
+
rowHeight: y,
|
|
1924
|
+
height: W,
|
|
1925
|
+
width: F,
|
|
1918
1926
|
estimatedColumnWidth: L,
|
|
1919
1927
|
estimatedRowHeight: E,
|
|
1920
1928
|
rowCount: N,
|
|
1921
|
-
className:
|
|
1922
|
-
|
|
1923
|
-
f ===
|
|
1929
|
+
className: ee(
|
|
1930
|
+
le["rp-pages"],
|
|
1931
|
+
f === X.HORIZONTAL_SCROLLING ? le["rp-pages-horizontal-scroll"] : ""
|
|
1924
1932
|
),
|
|
1925
|
-
children:
|
|
1933
|
+
children: Nr
|
|
1926
1934
|
}
|
|
1927
1935
|
) : /* @__PURE__ */ a(
|
|
1928
1936
|
"div",
|
|
@@ -1947,24 +1955,24 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1947
1955
|
"rp-paginate": "_rp-paginate_1vu6o_1",
|
|
1948
1956
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1949
1957
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1950
|
-
}, Nr = () => {
|
|
1951
|
-
const { prevIcon: e } = le();
|
|
1952
|
-
return e || /* @__PURE__ */ a(Re, {});
|
|
1953
1958
|
}, Mr = () => {
|
|
1954
|
-
const {
|
|
1955
|
-
return e || /* @__PURE__ */ a(Re, {
|
|
1959
|
+
const { prevIcon: e } = ie();
|
|
1960
|
+
return e || /* @__PURE__ */ a(Re, {});
|
|
1956
1961
|
}, Er = () => {
|
|
1957
|
-
const {
|
|
1962
|
+
const { nextIcon: e } = ie();
|
|
1963
|
+
return e || /* @__PURE__ */ a(Re, { style: { transform: "rotate(180deg" } });
|
|
1964
|
+
}, Or = () => {
|
|
1965
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: s } = oe(), [c, i] = $(e.toString()), { pageNavigationTool: l = !0 } = de(), { isSmallScreen: p } = _e();
|
|
1958
1966
|
A(() => {
|
|
1959
1967
|
i(e.toString());
|
|
1960
1968
|
}, [e]);
|
|
1961
1969
|
const h = R((v) => {
|
|
1962
|
-
const
|
|
1963
|
-
i(
|
|
1970
|
+
const _ = v.target.value;
|
|
1971
|
+
i(_);
|
|
1964
1972
|
}, []), m = R(() => {
|
|
1965
1973
|
const v = s(c);
|
|
1966
1974
|
v.success || i(v.currentPage.toString());
|
|
1967
|
-
}, [s, c, t]),
|
|
1975
|
+
}, [s, c, t]), d = R(() => {
|
|
1968
1976
|
i(e.toString());
|
|
1969
1977
|
}, [e]), g = R(
|
|
1970
1978
|
(v) => {
|
|
@@ -1982,26 +1990,26 @@ const xr = ({ widths: e, heights: t }) => {
|
|
|
1982
1990
|
goToPage: s,
|
|
1983
1991
|
changePage: n
|
|
1984
1992
|
}
|
|
1985
|
-
) : l ? /* @__PURE__ */
|
|
1986
|
-
!p && /* @__PURE__ */ a(
|
|
1993
|
+
) : l ? /* @__PURE__ */ O("div", { className: ot["rp-paginate"], children: [
|
|
1994
|
+
!p && /* @__PURE__ */ a(te, { content: "Previous page", children: /* @__PURE__ */ a(Y, { onClick: r, disabled: e === 1, children: /* @__PURE__ */ a(Mr, {}) }) }),
|
|
1987
1995
|
/* @__PURE__ */ a(
|
|
1988
|
-
|
|
1996
|
+
jt,
|
|
1989
1997
|
{
|
|
1990
1998
|
onKeyDown: g,
|
|
1991
|
-
onBlur:
|
|
1999
|
+
onBlur: d,
|
|
1992
2000
|
onChange: h,
|
|
1993
2001
|
value: c,
|
|
1994
2002
|
className: ot["rp-page-input"]
|
|
1995
2003
|
}
|
|
1996
2004
|
),
|
|
1997
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ O("span", { className: ot["rp-total-page"], children: [
|
|
1998
2006
|
"/",
|
|
1999
2007
|
t
|
|
2000
2008
|
] }),
|
|
2001
|
-
!p && /* @__PURE__ */ a(
|
|
2009
|
+
!p && /* @__PURE__ */ a(te, { content: "Next page", children: /* @__PURE__ */ a(Y, { onClick: o, disabled: e === t, children: /* @__PURE__ */ a(Er, {}) }) })
|
|
2002
2010
|
] }) : null;
|
|
2003
2011
|
};
|
|
2004
|
-
var bt = "Dialog", [
|
|
2012
|
+
var bt = "Dialog", [wn, ti] = So(bt), [Dr, re] = wn(bt), bn = (e) => {
|
|
2005
2013
|
const {
|
|
2006
2014
|
__scopeDialog: t,
|
|
2007
2015
|
children: n,
|
|
@@ -2009,13 +2017,13 @@ var bt = "Dialog", [gn, ei] = Po(bt), [Or, se] = gn(bt), vn = (e) => {
|
|
|
2009
2017
|
defaultOpen: r,
|
|
2010
2018
|
onOpenChange: s,
|
|
2011
2019
|
modal: c = !0
|
|
2012
|
-
} = e, i =
|
|
2020
|
+
} = e, i = U.useRef(null), l = U.useRef(null), [p = !1, h] = xo({
|
|
2013
2021
|
prop: o,
|
|
2014
2022
|
defaultProp: r,
|
|
2015
2023
|
onChange: s
|
|
2016
2024
|
});
|
|
2017
2025
|
return /* @__PURE__ */ a(
|
|
2018
|
-
|
|
2026
|
+
Dr,
|
|
2019
2027
|
{
|
|
2020
2028
|
scope: t,
|
|
2021
2029
|
triggerRef: i,
|
|
@@ -2025,16 +2033,16 @@ var bt = "Dialog", [gn, ei] = Po(bt), [Or, se] = gn(bt), vn = (e) => {
|
|
|
2025
2033
|
descriptionId: Xe(),
|
|
2026
2034
|
open: p,
|
|
2027
2035
|
onOpenChange: h,
|
|
2028
|
-
onOpenToggle:
|
|
2036
|
+
onOpenToggle: U.useCallback(() => h((m) => !m), [h]),
|
|
2029
2037
|
modal: c,
|
|
2030
2038
|
children: n
|
|
2031
2039
|
}
|
|
2032
2040
|
);
|
|
2033
2041
|
};
|
|
2034
|
-
|
|
2035
|
-
var
|
|
2042
|
+
bn.displayName = bt;
|
|
2043
|
+
var Cn = "DialogTrigger", Ar = U.forwardRef(
|
|
2036
2044
|
(e, t) => {
|
|
2037
|
-
const { __scopeDialog: n, ...o } = e, r =
|
|
2045
|
+
const { __scopeDialog: n, ...o } = e, r = re(Cn, n), s = ft(t, r.triggerRef);
|
|
2038
2046
|
return /* @__PURE__ */ a(
|
|
2039
2047
|
Me.button,
|
|
2040
2048
|
{
|
|
@@ -2050,28 +2058,28 @@ var _n = "DialogTrigger", Dr = q.forwardRef(
|
|
|
2050
2058
|
);
|
|
2051
2059
|
}
|
|
2052
2060
|
);
|
|
2053
|
-
|
|
2054
|
-
var Ct = "DialogPortal", [
|
|
2061
|
+
Ar.displayName = Cn;
|
|
2062
|
+
var Ct = "DialogPortal", [zr, Tn] = wn(Ct, {
|
|
2055
2063
|
forceMount: void 0
|
|
2056
|
-
}),
|
|
2057
|
-
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, s =
|
|
2058
|
-
return /* @__PURE__ */ a(
|
|
2064
|
+
}), Pn = (e) => {
|
|
2065
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, s = re(Ct, t);
|
|
2066
|
+
return /* @__PURE__ */ a(zr, { scope: t, forceMount: n, children: U.Children.map(o, (c) => /* @__PURE__ */ a(gt, { present: n || s.open, children: /* @__PURE__ */ a(Oo, { asChild: !0, container: r, children: c }) })) });
|
|
2059
2067
|
};
|
|
2060
|
-
|
|
2061
|
-
var $e = "DialogOverlay",
|
|
2068
|
+
Pn.displayName = Ct;
|
|
2069
|
+
var $e = "DialogOverlay", Sn = U.forwardRef(
|
|
2062
2070
|
(e, t) => {
|
|
2063
|
-
const n =
|
|
2064
|
-
return s.modal ? /* @__PURE__ */ a(gt, { present: o || s.open, children: /* @__PURE__ */ a(
|
|
2071
|
+
const n = Tn($e, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, s = re($e, e.__scopeDialog);
|
|
2072
|
+
return s.modal ? /* @__PURE__ */ a(gt, { present: o || s.open, children: /* @__PURE__ */ a(Fr, { ...r, ref: t }) }) : null;
|
|
2065
2073
|
}
|
|
2066
2074
|
);
|
|
2067
|
-
|
|
2068
|
-
var
|
|
2075
|
+
Sn.displayName = $e;
|
|
2076
|
+
var Fr = U.forwardRef(
|
|
2069
2077
|
(e, t) => {
|
|
2070
|
-
const { __scopeDialog: n, ...o } = e, r =
|
|
2078
|
+
const { __scopeDialog: n, ...o } = e, r = re($e, n);
|
|
2071
2079
|
return (
|
|
2072
2080
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2073
2081
|
// ie. when `Overlay` and `Content` are siblings
|
|
2074
|
-
/* @__PURE__ */ a(
|
|
2082
|
+
/* @__PURE__ */ a(Lo, { as: Io, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
2075
2083
|
Me.div,
|
|
2076
2084
|
{
|
|
2077
2085
|
"data-state": Pt(r.open),
|
|
@@ -2082,22 +2090,22 @@ var zr = q.forwardRef(
|
|
|
2082
2090
|
) })
|
|
2083
2091
|
);
|
|
2084
2092
|
}
|
|
2085
|
-
),
|
|
2093
|
+
), ve = "DialogContent", In = U.forwardRef(
|
|
2086
2094
|
(e, t) => {
|
|
2087
|
-
const n =
|
|
2088
|
-
return /* @__PURE__ */ a(gt, { present: o || s.open, children: s.modal ? /* @__PURE__ */ a(
|
|
2095
|
+
const n = Tn(ve, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, s = re(ve, e.__scopeDialog);
|
|
2096
|
+
return /* @__PURE__ */ a(gt, { present: o || s.open, children: s.modal ? /* @__PURE__ */ a(kr, { ...r, ref: t }) : /* @__PURE__ */ a(Wr, { ...r, ref: t }) });
|
|
2089
2097
|
}
|
|
2090
2098
|
);
|
|
2091
|
-
|
|
2092
|
-
var
|
|
2099
|
+
In.displayName = ve;
|
|
2100
|
+
var kr = U.forwardRef(
|
|
2093
2101
|
(e, t) => {
|
|
2094
|
-
const n =
|
|
2095
|
-
return
|
|
2102
|
+
const n = re(ve, e.__scopeDialog), o = U.useRef(null), r = ft(t, n.contentRef, o);
|
|
2103
|
+
return U.useEffect(() => {
|
|
2096
2104
|
const s = o.current;
|
|
2097
2105
|
if (s)
|
|
2098
|
-
return
|
|
2106
|
+
return No(s);
|
|
2099
2107
|
}, []), /* @__PURE__ */ a(
|
|
2100
|
-
|
|
2108
|
+
yn,
|
|
2101
2109
|
{
|
|
2102
2110
|
...e,
|
|
2103
2111
|
ref: r,
|
|
@@ -2118,11 +2126,11 @@ var Fr = q.forwardRef(
|
|
|
2118
2126
|
}
|
|
2119
2127
|
);
|
|
2120
2128
|
}
|
|
2121
|
-
),
|
|
2129
|
+
), Wr = U.forwardRef(
|
|
2122
2130
|
(e, t) => {
|
|
2123
|
-
const n =
|
|
2131
|
+
const n = re(ve, e.__scopeDialog), o = U.useRef(!1), r = U.useRef(!1);
|
|
2124
2132
|
return /* @__PURE__ */ a(
|
|
2125
|
-
|
|
2133
|
+
yn,
|
|
2126
2134
|
{
|
|
2127
2135
|
...e,
|
|
2128
2136
|
ref: t,
|
|
@@ -2141,12 +2149,12 @@ var Fr = q.forwardRef(
|
|
|
2141
2149
|
}
|
|
2142
2150
|
);
|
|
2143
2151
|
}
|
|
2144
|
-
),
|
|
2152
|
+
), yn = U.forwardRef(
|
|
2145
2153
|
(e, t) => {
|
|
2146
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: s, ...c } = e, i =
|
|
2147
|
-
return
|
|
2154
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: s, ...c } = e, i = re(ve, n), l = U.useRef(null), p = ft(t, l);
|
|
2155
|
+
return Mo(), /* @__PURE__ */ O(ke, { children: [
|
|
2148
2156
|
/* @__PURE__ */ a(
|
|
2149
|
-
|
|
2157
|
+
Eo,
|
|
2150
2158
|
{
|
|
2151
2159
|
asChild: !0,
|
|
2152
2160
|
loop: !0,
|
|
@@ -2154,7 +2162,7 @@ var Fr = q.forwardRef(
|
|
|
2154
2162
|
onMountAutoFocus: r,
|
|
2155
2163
|
onUnmountAutoFocus: s,
|
|
2156
2164
|
children: /* @__PURE__ */ a(
|
|
2157
|
-
|
|
2165
|
+
Ro,
|
|
2158
2166
|
{
|
|
2159
2167
|
role: "dialog",
|
|
2160
2168
|
id: i.contentId,
|
|
@@ -2168,29 +2176,29 @@ var Fr = q.forwardRef(
|
|
|
2168
2176
|
)
|
|
2169
2177
|
}
|
|
2170
2178
|
),
|
|
2171
|
-
/* @__PURE__ */
|
|
2172
|
-
/* @__PURE__ */ a(
|
|
2173
|
-
/* @__PURE__ */ a(
|
|
2179
|
+
/* @__PURE__ */ O(ke, { children: [
|
|
2180
|
+
/* @__PURE__ */ a($r, { titleId: i.titleId }),
|
|
2181
|
+
/* @__PURE__ */ a(Vr, { contentRef: l, descriptionId: i.descriptionId })
|
|
2174
2182
|
] })
|
|
2175
2183
|
] });
|
|
2176
2184
|
}
|
|
2177
|
-
), Tt = "DialogTitle",
|
|
2185
|
+
), Tt = "DialogTitle", xn = U.forwardRef(
|
|
2178
2186
|
(e, t) => {
|
|
2179
|
-
const { __scopeDialog: n, ...o } = e, r =
|
|
2187
|
+
const { __scopeDialog: n, ...o } = e, r = re(Tt, n);
|
|
2180
2188
|
return /* @__PURE__ */ a(Me.h2, { id: r.titleId, ...o, ref: t });
|
|
2181
2189
|
}
|
|
2182
2190
|
);
|
|
2183
|
-
|
|
2184
|
-
var
|
|
2191
|
+
xn.displayName = Tt;
|
|
2192
|
+
var Rn = "DialogDescription", Hr = U.forwardRef(
|
|
2185
2193
|
(e, t) => {
|
|
2186
|
-
const { __scopeDialog: n, ...o } = e, r =
|
|
2194
|
+
const { __scopeDialog: n, ...o } = e, r = re(Rn, n);
|
|
2187
2195
|
return /* @__PURE__ */ a(Me.p, { id: r.descriptionId, ...o, ref: t });
|
|
2188
2196
|
}
|
|
2189
2197
|
);
|
|
2190
|
-
|
|
2191
|
-
var
|
|
2198
|
+
Hr.displayName = Rn;
|
|
2199
|
+
var Ln = "DialogClose", Nn = U.forwardRef(
|
|
2192
2200
|
(e, t) => {
|
|
2193
|
-
const { __scopeDialog: n, ...o } = e, r =
|
|
2201
|
+
const { __scopeDialog: n, ...o } = e, r = re(Ln, n);
|
|
2194
2202
|
return /* @__PURE__ */ a(
|
|
2195
2203
|
Me.button,
|
|
2196
2204
|
{
|
|
@@ -2202,32 +2210,32 @@ var yn = "DialogClose", xn = q.forwardRef(
|
|
|
2202
2210
|
);
|
|
2203
2211
|
}
|
|
2204
2212
|
);
|
|
2205
|
-
|
|
2213
|
+
Nn.displayName = Ln;
|
|
2206
2214
|
function Pt(e) {
|
|
2207
2215
|
return e ? "open" : "closed";
|
|
2208
2216
|
}
|
|
2209
|
-
var
|
|
2210
|
-
contentName:
|
|
2217
|
+
var Mn = "DialogTitleWarning", [ni, En] = yo(Mn, {
|
|
2218
|
+
contentName: ve,
|
|
2211
2219
|
titleName: Tt,
|
|
2212
2220
|
docsSlug: "dialog"
|
|
2213
|
-
}),
|
|
2214
|
-
const t =
|
|
2221
|
+
}), $r = ({ titleId: e }) => {
|
|
2222
|
+
const t = En(Mn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2215
2223
|
|
|
2216
2224
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2217
2225
|
|
|
2218
2226
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
2219
|
-
return
|
|
2227
|
+
return U.useEffect(() => {
|
|
2220
2228
|
e && (document.getElementById(e) || console.error(n));
|
|
2221
2229
|
}, [n, e]), null;
|
|
2222
|
-
},
|
|
2223
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
2224
|
-
return
|
|
2230
|
+
}, Gr = "DialogDescriptionWarning", Vr = ({ contentRef: e, descriptionId: t }) => {
|
|
2231
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${En(Gr).contentName}}.`;
|
|
2232
|
+
return U.useEffect(() => {
|
|
2225
2233
|
var s;
|
|
2226
2234
|
const r = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
|
|
2227
2235
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2228
2236
|
}, [o, e, t]), null;
|
|
2229
|
-
},
|
|
2230
|
-
const
|
|
2237
|
+
}, Ur = bn, qr = Pn, Zr = Sn, jr = In, Br = xn, Kr = Nn;
|
|
2238
|
+
const ge = {
|
|
2231
2239
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2232
2240
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
2233
2241
|
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
@@ -2235,8 +2243,8 @@ const fe = {
|
|
|
2235
2243
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2236
2244
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2237
2245
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2238
|
-
},
|
|
2239
|
-
const { pdfProperties: e } =
|
|
2246
|
+
}, Xr = () => {
|
|
2247
|
+
const { pdfProperties: e } = Q(), { container: t } = Le(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = Ao(), r = z(() => {
|
|
2240
2248
|
if (!e)
|
|
2241
2249
|
return [];
|
|
2242
2250
|
const {
|
|
@@ -2247,10 +2255,10 @@ const fe = {
|
|
|
2247
2255
|
subject: p,
|
|
2248
2256
|
createdOn: h,
|
|
2249
2257
|
creator: m,
|
|
2250
|
-
keywords:
|
|
2258
|
+
keywords: d,
|
|
2251
2259
|
modifiedOn: g,
|
|
2252
2260
|
pdfProducer: v,
|
|
2253
|
-
pdfVersion:
|
|
2261
|
+
pdfVersion: _,
|
|
2254
2262
|
pageCount: f
|
|
2255
2263
|
} = e;
|
|
2256
2264
|
return [
|
|
@@ -2260,7 +2268,7 @@ const fe = {
|
|
|
2260
2268
|
{ label: "Title", value: i },
|
|
2261
2269
|
{ label: "Author", value: l },
|
|
2262
2270
|
{ label: "Subject", value: p },
|
|
2263
|
-
{ label: "Keywords", value:
|
|
2271
|
+
{ label: "Keywords", value: d },
|
|
2264
2272
|
{ label: "Creator", value: m },
|
|
2265
2273
|
{
|
|
2266
2274
|
label: "Created on",
|
|
@@ -2272,49 +2280,49 @@ const fe = {
|
|
|
2272
2280
|
},
|
|
2273
2281
|
{ separate: !0 },
|
|
2274
2282
|
{ label: "PDF producer", value: v },
|
|
2275
|
-
{ label: "PDF version", value:
|
|
2283
|
+
{ label: "PDF version", value: _ },
|
|
2276
2284
|
{ label: "Page count", value: f }
|
|
2277
2285
|
];
|
|
2278
2286
|
}, [e]);
|
|
2279
|
-
return /* @__PURE__ */ a(
|
|
2280
|
-
/* @__PURE__ */ a(
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
/* @__PURE__ */ a(
|
|
2283
|
-
/* @__PURE__ */ a("div", { className:
|
|
2284
|
-
/* @__PURE__ */ a(
|
|
2287
|
+
return /* @__PURE__ */ a(Ur, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(qr, { container: t, children: /* @__PURE__ */ O("div", { className: ge["rp-dialog-wrapper"], children: [
|
|
2288
|
+
/* @__PURE__ */ a(Zr, { className: ge["rp-dialog-overlay"] }),
|
|
2289
|
+
/* @__PURE__ */ O(jr, { className: ge["rp-document-dialog"], children: [
|
|
2290
|
+
/* @__PURE__ */ a(Br, { className: ge["rp-dialog-title"], children: "Document Properties" }),
|
|
2291
|
+
/* @__PURE__ */ a("div", { className: ge["rp-document-properties"], children: r.map((s, c) => /* @__PURE__ */ a("div", { children: s.separate ? /* @__PURE__ */ a("div", { className: ge["rp-properties-divider"] }) : /* @__PURE__ */ a(Do, { label: s.label, value: s.value }) }, c)) }),
|
|
2292
|
+
/* @__PURE__ */ a(Kr, { asChild: !0, className: ge["rp-dialog-close"], children: /* @__PURE__ */ a(nn, {}) })
|
|
2285
2293
|
] })
|
|
2286
2294
|
] }) }) });
|
|
2287
|
-
},
|
|
2295
|
+
}, Jr = {
|
|
2288
2296
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2289
|
-
},
|
|
2297
|
+
}, Yr = (e) => URL.createObjectURL(e), Qr = async (e) => {
|
|
2290
2298
|
const n = await (await fetch(e)).blob();
|
|
2291
|
-
return
|
|
2292
|
-
},
|
|
2293
|
-
const { filename: e, pdfSrc: t } =
|
|
2299
|
+
return Yr(n);
|
|
2300
|
+
}, es = () => {
|
|
2301
|
+
const { filename: e, pdfSrc: t } = Q();
|
|
2294
2302
|
return { download: R(async () => {
|
|
2295
2303
|
if (!e || !t)
|
|
2296
2304
|
throw new Error("There is no PDF source to download");
|
|
2297
2305
|
const o = document.createElement("a");
|
|
2298
|
-
o.href = await
|
|
2306
|
+
o.href = await Qr(t), o.download = e, document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
2299
2307
|
}, []) };
|
|
2300
|
-
}, Nn = () => {
|
|
2301
|
-
const { downloadIcon: e } = le();
|
|
2302
|
-
return e || /* @__PURE__ */ a(Wo, {});
|
|
2303
|
-
}, Mn = ({ children: e, className: t }) => /* @__PURE__ */ a(ne, { className: t, content: "Download file", children: e }), es = ({ download: e }) => /* @__PURE__ */ a(Mn, { children: /* @__PURE__ */ a(J, { onClick: e, children: /* @__PURE__ */ a(Nn, {}) }) }), ts = ({ download: e }) => /* @__PURE__ */ a(me, { onClick: e, children: /* @__PURE__ */ D(Mn, { className: "rp-menu-item", children: [
|
|
2304
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Nn, {}) }),
|
|
2305
|
-
"Download file"
|
|
2306
|
-
] }) }), En = () => {
|
|
2307
|
-
const { download: e } = Qr(), { downloadTool: t = !0 } = pe(), { isSmallScreen: n } = ve();
|
|
2308
|
-
return t ? n ? /* @__PURE__ */ a(ts, { download: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { download: e }) : t ? /* @__PURE__ */ a(es, { download: e }) : null : null;
|
|
2309
2308
|
}, On = () => {
|
|
2310
|
-
const {
|
|
2309
|
+
const { downloadIcon: e } = ie();
|
|
2311
2310
|
return e || /* @__PURE__ */ a(Ho, {});
|
|
2312
|
-
}, Dn = ({ children: e, className: t }) => /* @__PURE__ */ a(
|
|
2311
|
+
}, Dn = ({ children: e, className: t }) => /* @__PURE__ */ a(te, { className: t, content: "Download file", children: e }), ts = ({ download: e }) => /* @__PURE__ */ a(Dn, { children: /* @__PURE__ */ a(Y, { onClick: e, children: /* @__PURE__ */ a(On, {}) }) }), ns = ({ download: e }) => /* @__PURE__ */ a(fe, { onClick: e, children: /* @__PURE__ */ O(Dn, { className: "rp-menu-item", children: [
|
|
2313
2312
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(On, {}) }),
|
|
2314
|
-
"
|
|
2313
|
+
"Download file"
|
|
2315
2314
|
] }) }), An = () => {
|
|
2316
|
-
const {
|
|
2317
|
-
return
|
|
2315
|
+
const { download: e } = es(), { downloadTool: t = !0 } = de(), { isSmallScreen: n } = _e();
|
|
2316
|
+
return t ? n ? /* @__PURE__ */ a(ns, { download: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { download: e }) : t ? /* @__PURE__ */ a(ts, { download: e }) : null : null;
|
|
2317
|
+
}, zn = () => {
|
|
2318
|
+
const { printIcon: e } = ie();
|
|
2319
|
+
return e || /* @__PURE__ */ a($o, {});
|
|
2320
|
+
}, Fn = ({ children: e, className: t }) => /* @__PURE__ */ a(te, { className: t, content: "Print", children: e }), os = ({ print: e }) => /* @__PURE__ */ a(Fn, { children: /* @__PURE__ */ a(Y, { onClick: e, children: /* @__PURE__ */ a(zn, {}) }) }), rs = ({ print: e }) => /* @__PURE__ */ a(fe, { onClick: e, children: /* @__PURE__ */ O(Fn, { className: "rp-menu-item", children: [
|
|
2321
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(zn, {}) }),
|
|
2322
|
+
"Print"
|
|
2323
|
+
] }) }), kn = () => {
|
|
2324
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: s } = _t(), { printTool: c = !0 } = de(), { isSmallScreen: i } = _e();
|
|
2325
|
+
return c ? i ? /* @__PURE__ */ a(rs, { print: e }) : typeof c == "function" ? /* @__PURE__ */ a(
|
|
2318
2326
|
c,
|
|
2319
2327
|
{
|
|
2320
2328
|
print: e,
|
|
@@ -2324,34 +2332,34 @@ const fe = {
|
|
|
2324
2332
|
setOnComplete: o,
|
|
2325
2333
|
progress: s
|
|
2326
2334
|
}
|
|
2327
|
-
) : c ? /* @__PURE__ */ a(
|
|
2328
|
-
},
|
|
2335
|
+
) : c ? /* @__PURE__ */ a(os, { print: e }) : null : null;
|
|
2336
|
+
}, ss = {
|
|
2329
2337
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2330
|
-
}, ss = () => {
|
|
2331
|
-
const { goToFirstPageIcon: e } = le();
|
|
2332
|
-
return e || /* @__PURE__ */ a(tn, { className: rs["rp-go-to-Top"] });
|
|
2333
2338
|
}, as = () => {
|
|
2334
|
-
const {
|
|
2335
|
-
return e || /* @__PURE__ */ a(
|
|
2339
|
+
const { goToFirstPageIcon: e } = ie();
|
|
2340
|
+
return e || /* @__PURE__ */ a(rn, { className: ss["rp-go-to-Top"] });
|
|
2336
2341
|
}, is = () => {
|
|
2337
|
-
const {
|
|
2342
|
+
const { goToLastPageIcon: e } = ie();
|
|
2343
|
+
return e || /* @__PURE__ */ a(rn, {});
|
|
2344
|
+
}, cs = () => {
|
|
2345
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = oe(), { jumpNavigationTool: o = !0 } = de(), r = z(() => n === 1, [n]), s = z(() => n === t, [n, t]), c = R(() => {
|
|
2338
2346
|
e(1);
|
|
2339
2347
|
}, [e]), i = R(() => {
|
|
2340
2348
|
e(t);
|
|
2341
2349
|
}, [e, t]);
|
|
2342
|
-
return o ? /* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */ a(
|
|
2344
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2350
|
+
return o ? /* @__PURE__ */ O(He, { children: [
|
|
2351
|
+
/* @__PURE__ */ a(fe, { disabled: r, onClick: c, children: /* @__PURE__ */ O(te, { className: "rp-menu-item", content: "Go to first page", children: [
|
|
2352
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(as, {}) }),
|
|
2345
2353
|
"First page"
|
|
2346
2354
|
] }) }),
|
|
2347
|
-
/* @__PURE__ */ a(
|
|
2348
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2355
|
+
/* @__PURE__ */ a(fe, { disabled: s, onClick: i, children: /* @__PURE__ */ O(te, { className: "rp-menu-item", content: "Go to last page", children: [
|
|
2356
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(is, {}) }),
|
|
2349
2357
|
"Last page"
|
|
2350
2358
|
] }) }),
|
|
2351
2359
|
/* @__PURE__ */ a(vt, {})
|
|
2352
2360
|
] }) : null;
|
|
2353
|
-
},
|
|
2354
|
-
const { container: e } = Le(), { isSmallScreen: t } =
|
|
2361
|
+
}, ls = () => {
|
|
2362
|
+
const { container: e } = Le(), { isSmallScreen: t } = _e(), {
|
|
2355
2363
|
openFileTool: n,
|
|
2356
2364
|
downloadTool: o,
|
|
2357
2365
|
documentProperties: r,
|
|
@@ -2361,11 +2369,11 @@ const fe = {
|
|
|
2361
2369
|
jumpNavigationTool: l,
|
|
2362
2370
|
printTool: p,
|
|
2363
2371
|
fullscreenTool: h
|
|
2364
|
-
} =
|
|
2372
|
+
} = de();
|
|
2365
2373
|
return z(() => {
|
|
2366
|
-
const
|
|
2374
|
+
const d = l || c || i || s || r;
|
|
2367
2375
|
let g = !1;
|
|
2368
|
-
return t && (g = !(!n && !o && !p && !h)),
|
|
2376
|
+
return t && (g = !(!n && !o && !p && !h)), d || g;
|
|
2369
2377
|
}, [
|
|
2370
2378
|
n,
|
|
2371
2379
|
o,
|
|
@@ -2375,41 +2383,41 @@ const fe = {
|
|
|
2375
2383
|
i,
|
|
2376
2384
|
l,
|
|
2377
2385
|
t
|
|
2378
|
-
]) ? /* @__PURE__ */
|
|
2386
|
+
]) ? /* @__PURE__ */ O(zo, { children: [
|
|
2379
2387
|
/* @__PURE__ */ a(
|
|
2380
2388
|
mt,
|
|
2381
2389
|
{
|
|
2382
2390
|
container: e,
|
|
2383
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(
|
|
2384
|
-
children: /* @__PURE__ */
|
|
2385
|
-
t && /* @__PURE__ */
|
|
2386
|
-
/* @__PURE__ */ a(
|
|
2387
|
-
/* @__PURE__ */ a(En, {}),
|
|
2391
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(te, { content: "More options", children: /* @__PURE__ */ a(Y, { children: /* @__PURE__ */ a(Po, {}) }) }) }),
|
|
2392
|
+
children: /* @__PURE__ */ O("div", { className: Jr["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2393
|
+
t && /* @__PURE__ */ O(He, { children: [
|
|
2394
|
+
/* @__PURE__ */ a(tn, {}),
|
|
2388
2395
|
/* @__PURE__ */ a(An, {}),
|
|
2389
|
-
/* @__PURE__ */ a(
|
|
2396
|
+
/* @__PURE__ */ a(kn, {}),
|
|
2397
|
+
/* @__PURE__ */ a(on, {}),
|
|
2390
2398
|
/* @__PURE__ */ a(vt, {})
|
|
2391
2399
|
] }),
|
|
2392
|
-
/* @__PURE__ */ a(
|
|
2393
|
-
/* @__PURE__ */ a(Fo, {}),
|
|
2394
|
-
/* @__PURE__ */ a($o, {}),
|
|
2400
|
+
/* @__PURE__ */ a(cs, {}),
|
|
2395
2401
|
/* @__PURE__ */ a(ko, {}),
|
|
2396
|
-
/* @__PURE__ */ a(
|
|
2402
|
+
/* @__PURE__ */ a(Go, {}),
|
|
2403
|
+
/* @__PURE__ */ a(Wo, {}),
|
|
2404
|
+
/* @__PURE__ */ a(Fo, {})
|
|
2397
2405
|
] })
|
|
2398
2406
|
}
|
|
2399
2407
|
),
|
|
2400
|
-
/* @__PURE__ */ a(
|
|
2408
|
+
/* @__PURE__ */ a(Xr, {})
|
|
2401
2409
|
] }) : null;
|
|
2402
|
-
},
|
|
2403
|
-
const { isSmallScreen: e } =
|
|
2404
|
-
return /* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */ a(
|
|
2406
|
-
!e && /* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */ a(
|
|
2408
|
-
/* @__PURE__ */ a(En, {}),
|
|
2410
|
+
}, us = () => {
|
|
2411
|
+
const { isSmallScreen: e } = _e();
|
|
2412
|
+
return /* @__PURE__ */ O(ke, { children: [
|
|
2413
|
+
/* @__PURE__ */ a(To, {}),
|
|
2414
|
+
!e && /* @__PURE__ */ O(ke, { children: [
|
|
2415
|
+
/* @__PURE__ */ a(tn, {}),
|
|
2409
2416
|
/* @__PURE__ */ a(An, {}),
|
|
2410
|
-
/* @__PURE__ */ a(
|
|
2417
|
+
/* @__PURE__ */ a(kn, {}),
|
|
2418
|
+
/* @__PURE__ */ a(on, {})
|
|
2411
2419
|
] }),
|
|
2412
|
-
/* @__PURE__ */ a(
|
|
2420
|
+
/* @__PURE__ */ a(ls, {})
|
|
2413
2421
|
] });
|
|
2414
2422
|
}, Ce = {
|
|
2415
2423
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
@@ -2417,68 +2425,68 @@ const fe = {
|
|
|
2417
2425
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
|
|
2418
2426
|
"rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
|
|
2419
2427
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
|
|
2420
|
-
},
|
|
2421
|
-
const { zoomInIcon: e } =
|
|
2422
|
-
return e || /* @__PURE__ */ a(Go, {});
|
|
2423
|
-
}, hs = () => {
|
|
2424
|
-
const { zoomOutIcon: e } = le();
|
|
2428
|
+
}, ds = 25, rt = 1e3, ps = [50, 75, 100, 125, 150, 200, 300, 400], hs = () => {
|
|
2429
|
+
const { zoomInIcon: e } = ie();
|
|
2425
2430
|
return e || /* @__PURE__ */ a(Vo, {});
|
|
2426
2431
|
}, ms = () => {
|
|
2427
|
-
const {
|
|
2432
|
+
const { zoomOutIcon: e } = ie();
|
|
2433
|
+
return e || /* @__PURE__ */ a(Uo, {});
|
|
2434
|
+
}, fs = () => {
|
|
2435
|
+
const { zoomLevel: e, setZoomLevel: t } = Ze(), { container: n, contentRef: o } = Le(), { zoomTool: r = !0 } = de(), { focusedPage: s } = oe(), { rotate: c } = qe(), { pages: i } = Q(), { isSmallScreen: l } = _e(), p = R(() => {
|
|
2428
2436
|
t((f) => {
|
|
2429
|
-
const
|
|
2430
|
-
return Math.min(
|
|
2437
|
+
const w = Math.floor(f / 25) * 25;
|
|
2438
|
+
return Math.min(w + 25, rt);
|
|
2431
2439
|
});
|
|
2432
2440
|
}, [t]), h = R(() => {
|
|
2433
2441
|
t((f) => {
|
|
2434
|
-
const
|
|
2435
|
-
return Math.min(
|
|
2442
|
+
const w = Math.ceil(f / 25) * 25;
|
|
2443
|
+
return Math.min(w - 25, rt);
|
|
2436
2444
|
});
|
|
2437
|
-
}, [t]), m = z(() => e ===
|
|
2445
|
+
}, [t]), m = z(() => e === ds, [e]), d = z(() => e === rt, [e]), g = z(() => {
|
|
2438
2446
|
var f;
|
|
2439
2447
|
return (f = i.get(s)) == null ? void 0 : f.page.getViewport({ scale: 1, rotation: c });
|
|
2440
2448
|
}, [i, s, c]), v = R(
|
|
2441
2449
|
(f) => {
|
|
2442
|
-
const
|
|
2443
|
-
t(
|
|
2450
|
+
const w = ((g == null ? void 0 : g.width) || 0) + 2 * yt, P = ((g == null ? void 0 : g.height) || 0) + 2 * yt, T = (o == null ? void 0 : o.clientWidth) || 0, I = (o == null ? void 0 : o.clientHeight) || 0, u = qo(f, T, I, w, P);
|
|
2451
|
+
t(u);
|
|
2444
2452
|
},
|
|
2445
2453
|
[t, g]
|
|
2446
|
-
),
|
|
2454
|
+
), _ = R(
|
|
2447
2455
|
(f) => {
|
|
2448
2456
|
typeof f == "number" ? t(f) : v(f);
|
|
2449
2457
|
},
|
|
2450
2458
|
[t, v]
|
|
2451
2459
|
);
|
|
2452
|
-
return typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */
|
|
2453
|
-
/* @__PURE__ */ a(
|
|
2460
|
+
return typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ O("div", { className: Ce["rp-zoom-wrapper"], children: [
|
|
2461
|
+
/* @__PURE__ */ a(te, { content: "Zoom out", children: /* @__PURE__ */ a(Y, { disabled: m, onClick: h, children: /* @__PURE__ */ a(ms, {}) }) }),
|
|
2454
2462
|
!l && /* @__PURE__ */ a(
|
|
2455
2463
|
mt,
|
|
2456
2464
|
{
|
|
2457
2465
|
container: n,
|
|
2458
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(
|
|
2466
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(te, { content: "Select zoom level", children: /* @__PURE__ */ O(Y, { className: Ce["rp-current-zoom-wrapper"], children: [
|
|
2459
2467
|
/* @__PURE__ */ a("span", { className: Ce["rp-current-zoom-text"], children: e }),
|
|
2460
2468
|
/* @__PURE__ */ a("span", { className: Ce["rp-current-zoom-text"], children: "%" }),
|
|
2461
2469
|
/* @__PURE__ */ a(Re, { className: Ce["rp-current-zoom-icon"] })
|
|
2462
2470
|
] }) }) }),
|
|
2463
2471
|
style: { minWidth: "200px" },
|
|
2464
2472
|
align: "center",
|
|
2465
|
-
children: /* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */ a(
|
|
2468
|
-
/* @__PURE__ */ a(
|
|
2469
|
-
/* @__PURE__ */ a(
|
|
2473
|
+
children: /* @__PURE__ */ O("div", { className: Ce["rp-zoom-dropdown-content"], children: [
|
|
2474
|
+
/* @__PURE__ */ O(He, { children: [
|
|
2475
|
+
/* @__PURE__ */ a(fe, { onClick: () => _(Ke.ACTUAL), children: "Actual size" }),
|
|
2476
|
+
/* @__PURE__ */ a(fe, { onClick: () => _(Ke.PAGE_FIT), children: "Page fit" }),
|
|
2477
|
+
/* @__PURE__ */ a(fe, { onClick: () => _(Ke.PAGE_WIDTH), children: "Page width" })
|
|
2470
2478
|
] }),
|
|
2471
2479
|
/* @__PURE__ */ a(vt, {}),
|
|
2472
|
-
/* @__PURE__ */ a(He, { children:
|
|
2480
|
+
/* @__PURE__ */ a(He, { children: ps.map((f) => /* @__PURE__ */ O(fe, { onClick: () => _(f), children: [
|
|
2473
2481
|
f,
|
|
2474
2482
|
" %"
|
|
2475
2483
|
] }, f)) })
|
|
2476
2484
|
] })
|
|
2477
2485
|
}
|
|
2478
2486
|
),
|
|
2479
|
-
/* @__PURE__ */ a(
|
|
2487
|
+
/* @__PURE__ */ a(te, { content: "Zoom in", children: /* @__PURE__ */ a(Y, { disabled: d, onClick: p, children: /* @__PURE__ */ a(hs, {}) }) })
|
|
2480
2488
|
] }) : null;
|
|
2481
|
-
},
|
|
2489
|
+
}, ae = {
|
|
2482
2490
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
2483
2491
|
"rp-search-tool-input": "_rp-search-tool-input_1vxow_6",
|
|
2484
2492
|
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_1vxow_12",
|
|
@@ -2487,45 +2495,45 @@ const fe = {
|
|
|
2487
2495
|
"rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_1vxow_30",
|
|
2488
2496
|
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_1vxow_35",
|
|
2489
2497
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2490
|
-
},
|
|
2491
|
-
const { searchIcon: e } =
|
|
2492
|
-
return e || /* @__PURE__ */ a(
|
|
2493
|
-
},
|
|
2494
|
-
const { container: e } = Le(), [t, n] = $(!1), { pdf: o } =
|
|
2498
|
+
}, Ut = () => {
|
|
2499
|
+
const { searchIcon: e } = ie();
|
|
2500
|
+
return e || /* @__PURE__ */ a(Zo, {});
|
|
2501
|
+
}, gs = () => {
|
|
2502
|
+
const { container: e } = Le(), [t, n] = $(!1), { pdf: o } = Q(), [r, s] = $(null), {
|
|
2495
2503
|
searchOptions: c,
|
|
2496
2504
|
setSearchOptions: i,
|
|
2497
2505
|
loading: l,
|
|
2498
2506
|
setSearch: p,
|
|
2499
2507
|
totalMatches: h,
|
|
2500
2508
|
currentMatchPosition: m,
|
|
2501
|
-
nextMatch:
|
|
2509
|
+
nextMatch: d,
|
|
2502
2510
|
prevMatch: g,
|
|
2503
2511
|
search: v
|
|
2504
|
-
} =
|
|
2512
|
+
} = pn(), { searchTool: _ = !0 } = de(), [f, w] = $(v), P = R(() => {
|
|
2505
2513
|
n(!0);
|
|
2506
2514
|
}, []), T = R(() => {
|
|
2507
|
-
p(""),
|
|
2508
|
-
}, [p]),
|
|
2515
|
+
p(""), w(""), n(!1);
|
|
2516
|
+
}, [p]), I = R(
|
|
2509
2517
|
(L) => {
|
|
2510
2518
|
L.key === "Escape" && t && T();
|
|
2511
2519
|
},
|
|
2512
2520
|
[t]
|
|
2513
|
-
),
|
|
2521
|
+
), u = R(
|
|
2514
2522
|
(L) => {
|
|
2515
|
-
L.shiftKey && L.key === "Enter" ? g() : L.key === "Enter" && v !== f ? p(f) : L.key === "Enter" &&
|
|
2523
|
+
L.shiftKey && L.key === "Enter" ? g() : L.key === "Enter" && v !== f ? p(f) : L.key === "Enter" && d();
|
|
2516
2524
|
},
|
|
2517
|
-
[f, g,
|
|
2525
|
+
[f, g, d, p, v]
|
|
2518
2526
|
);
|
|
2519
|
-
A(() => (window.addEventListener("keydown",
|
|
2520
|
-
window.removeEventListener("keydown",
|
|
2521
|
-
}), [
|
|
2527
|
+
A(() => (window.addEventListener("keydown", I), () => {
|
|
2528
|
+
window.removeEventListener("keydown", I);
|
|
2529
|
+
}), [I]), A(() => {
|
|
2522
2530
|
r && r.focus();
|
|
2523
2531
|
}, [r]);
|
|
2524
2532
|
const C = R((L) => {
|
|
2525
|
-
|
|
2526
|
-
}, []),
|
|
2527
|
-
|
|
2528
|
-
}, [p]),
|
|
2533
|
+
w(L.target.value);
|
|
2534
|
+
}, []), b = R(() => {
|
|
2535
|
+
w(""), p("");
|
|
2536
|
+
}, [p]), x = z(() => `${m} / ${h}`, [m, h]), { wholeWords: N, matchCase: y } = z(() => c, [c]), S = R(
|
|
2529
2537
|
(L) => {
|
|
2530
2538
|
i((E) => ({ ...E, matchCase: L }));
|
|
2531
2539
|
},
|
|
@@ -2538,83 +2546,83 @@ const fe = {
|
|
|
2538
2546
|
);
|
|
2539
2547
|
return A(() => {
|
|
2540
2548
|
T();
|
|
2541
|
-
}, [o, T]),
|
|
2549
|
+
}, [o, T]), _ ? /* @__PURE__ */ a(
|
|
2542
2550
|
mt,
|
|
2543
2551
|
{
|
|
2544
2552
|
open: t,
|
|
2545
2553
|
container: e,
|
|
2546
2554
|
align: "start",
|
|
2547
|
-
triggerComponent: /* @__PURE__ */ a(
|
|
2548
|
-
children: /* @__PURE__ */
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2555
|
+
triggerComponent: /* @__PURE__ */ a(te, { content: "Search in document", children: /* @__PURE__ */ a(Y, { onClick: P, children: /* @__PURE__ */ a(Ut, {}) }) }),
|
|
2556
|
+
children: /* @__PURE__ */ O("div", { className: ae["rp-search-tool-content"], children: [
|
|
2557
|
+
/* @__PURE__ */ O("div", { className: ae["rp-search-tool-input-wrapper"], children: [
|
|
2558
|
+
/* @__PURE__ */ O("div", { className: ae["rp-search-tool-input"], children: [
|
|
2551
2559
|
/* @__PURE__ */ a(
|
|
2552
|
-
|
|
2560
|
+
jt,
|
|
2553
2561
|
{
|
|
2554
2562
|
value: f,
|
|
2555
|
-
onKeyDown:
|
|
2563
|
+
onKeyDown: u,
|
|
2556
2564
|
onChange: C,
|
|
2557
|
-
icon: /* @__PURE__ */ a(
|
|
2565
|
+
icon: /* @__PURE__ */ a(Ut, {}),
|
|
2558
2566
|
placeholder: "Enter to Search",
|
|
2559
|
-
className:
|
|
2567
|
+
className: ae["rp-search-input"],
|
|
2560
2568
|
ref: s,
|
|
2561
|
-
children: !!f && /* @__PURE__ */ a("span", { className:
|
|
2569
|
+
children: !!f && /* @__PURE__ */ a("span", { className: ae["rp-search-tool-input-clear"], onClick: b, children: /* @__PURE__ */ a(jo, {}) })
|
|
2562
2570
|
}
|
|
2563
2571
|
),
|
|
2564
|
-
l ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(Ne, {}) }) : /* @__PURE__ */ a("span", { children:
|
|
2572
|
+
l ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(Ne, {}) }) : /* @__PURE__ */ a("span", { children: x })
|
|
2565
2573
|
] }),
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */ a(
|
|
2568
|
-
/* @__PURE__ */ a(
|
|
2574
|
+
/* @__PURE__ */ O("div", { className: ae["rp-search-tool-input-checkboxes"], children: [
|
|
2575
|
+
/* @__PURE__ */ a(xt, { name: "matchCase", value: y, onChange: S, children: "Match Case" }),
|
|
2576
|
+
/* @__PURE__ */ a(xt, { name: "wholeWord", value: N, onChange: M, children: "Whole Word" })
|
|
2569
2577
|
] })
|
|
2570
2578
|
] }),
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */ a(
|
|
2573
|
-
/* @__PURE__ */ a(
|
|
2579
|
+
/* @__PURE__ */ O("div", { className: ae["rp-search-tool-controls"], children: [
|
|
2580
|
+
/* @__PURE__ */ a(Y, { onClick: g, children: /* @__PURE__ */ a(Re, { className: ae["rp-search-tool-input-icon"] }) }),
|
|
2581
|
+
/* @__PURE__ */ a(Y, { onClick: d, children: /* @__PURE__ */ a(
|
|
2574
2582
|
Re,
|
|
2575
2583
|
{
|
|
2576
2584
|
style: { transform: "rotate(180deg" },
|
|
2577
|
-
className:
|
|
2585
|
+
className: ae["rp-search-tool-input-icon"]
|
|
2578
2586
|
}
|
|
2579
2587
|
) }),
|
|
2580
|
-
/* @__PURE__ */ a(
|
|
2588
|
+
/* @__PURE__ */ a(Y, { children: /* @__PURE__ */ a(nn, { onClick: T, className: ae["rp-search-tool-input-icon"] }) })
|
|
2581
2589
|
] })
|
|
2582
2590
|
] })
|
|
2583
2591
|
}
|
|
2584
2592
|
) : null;
|
|
2585
|
-
},
|
|
2593
|
+
}, vs = "_loading_1snj5_1", Te = {
|
|
2586
2594
|
"rp-loading-overlay": "_rp-loading-overlay_1snj5_1",
|
|
2587
2595
|
"rp-loading-modal": "_rp-loading-modal_1snj5_14",
|
|
2588
2596
|
"rp-loading-title": "_rp-loading-title_1snj5_27",
|
|
2589
2597
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_1snj5_35",
|
|
2590
2598
|
"rp-loading-progress": "_rp-loading-progress_1snj5_35",
|
|
2591
2599
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_1snj5_52",
|
|
2592
|
-
loading:
|
|
2593
|
-
},
|
|
2600
|
+
loading: vs
|
|
2601
|
+
}, _s = ({ percentage: e }) => {
|
|
2594
2602
|
const { cancel: t } = _t();
|
|
2595
|
-
return e < 1 ? null : /* @__PURE__ */ a("div", { className:
|
|
2596
|
-
/* @__PURE__ */ a("div", { className:
|
|
2597
|
-
/* @__PURE__ */ a("div", { className:
|
|
2603
|
+
return e < 1 ? null : /* @__PURE__ */ a("div", { className: ee(Te["rp-loading-overlay"]), children: /* @__PURE__ */ O("div", { className: ee(Te["rp-loading-modal"]), children: [
|
|
2604
|
+
/* @__PURE__ */ a("div", { className: ee(Te["rp-loading-title"]), children: "Preparing document..." }),
|
|
2605
|
+
/* @__PURE__ */ a("div", { className: ee(Te["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
2598
2606
|
"div",
|
|
2599
2607
|
{
|
|
2600
|
-
className:
|
|
2608
|
+
className: ee(Te["rp-loading-progress"]),
|
|
2601
2609
|
style: { width: `${e}%` }
|
|
2602
2610
|
}
|
|
2603
2611
|
) }),
|
|
2604
|
-
/* @__PURE__ */ a("button", { className:
|
|
2612
|
+
/* @__PURE__ */ a("button", { className: ee(Te["rp-loading-cancel-button"]), onClick: t, children: "Cancel" })
|
|
2605
2613
|
] }) });
|
|
2606
|
-
},
|
|
2607
|
-
const { showPrintProgress: n } =
|
|
2608
|
-
return /* @__PURE__ */
|
|
2609
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: t, className: Ie["rp-toolbar-content"], children: /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2611
|
-
/* @__PURE__ */ a(
|
|
2612
|
-
/* @__PURE__ */ a(
|
|
2614
|
+
}, ws = Ue((e, t) => {
|
|
2615
|
+
const { showPrintProgress: n } = de(), { progress: o } = _t(), { isSmallScreen: r } = _e(), { percentage: s } = o || {}, c = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2616
|
+
return /* @__PURE__ */ O("div", { children: [
|
|
2617
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: t, className: Ie["rp-toolbar-content"], children: /* @__PURE__ */ O("div", { className: Ie["rp-toolbar-wrapper"], style: c(), children: [
|
|
2618
|
+
/* @__PURE__ */ O("div", { "data-rp": "topBarLeft", className: Ie["rp-toolbar-start"], children: [
|
|
2619
|
+
/* @__PURE__ */ a(gs, {}),
|
|
2620
|
+
/* @__PURE__ */ a(Or, {})
|
|
2613
2621
|
] }),
|
|
2614
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: Ie["rp-toolbar-middle"], children: /* @__PURE__ */ a(
|
|
2615
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: Ie["rp-toolbar-end"], children: /* @__PURE__ */ a(
|
|
2622
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: Ie["rp-toolbar-middle"], children: /* @__PURE__ */ a(fs, {}) }),
|
|
2623
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: Ie["rp-toolbar-end"], children: /* @__PURE__ */ a(us, {}) })
|
|
2616
2624
|
] }) }),
|
|
2617
|
-
n && s ? /* @__PURE__ */ a(
|
|
2625
|
+
n && s ? /* @__PURE__ */ a(_s, { percentage: s }) : null
|
|
2618
2626
|
] });
|
|
2619
2627
|
}), st = {
|
|
2620
2628
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_4wlw3_1",
|
|
@@ -2627,21 +2635,21 @@ const fe = {
|
|
|
2627
2635
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2628
2636
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2629
2637
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2630
|
-
},
|
|
2631
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: s } =
|
|
2638
|
+
}, bs = (e) => {
|
|
2639
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: s } = oe(), c = z(() => o ? ye["rp-thumbnail-active"] : "", [o]), i = z(() => ({
|
|
2632
2640
|
width: Math.round(r.width),
|
|
2633
2641
|
height: Math.round(r.height)
|
|
2634
2642
|
}), [r]), l = R(() => {
|
|
2635
2643
|
n && s(n);
|
|
2636
2644
|
}, [s, n]);
|
|
2637
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ O(
|
|
2638
2646
|
"div",
|
|
2639
2647
|
{
|
|
2640
2648
|
onClick: l,
|
|
2641
2649
|
id: `page-${n}`,
|
|
2642
2650
|
className: ye["rp-thumbnail-wrapper"],
|
|
2643
2651
|
children: [
|
|
2644
|
-
/* @__PURE__ */ a("div", { className:
|
|
2652
|
+
/* @__PURE__ */ a("div", { className: ee(c, ye["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2645
2653
|
"img",
|
|
2646
2654
|
{
|
|
2647
2655
|
src: t,
|
|
@@ -2664,27 +2672,27 @@ const fe = {
|
|
|
2664
2672
|
]
|
|
2665
2673
|
}
|
|
2666
2674
|
);
|
|
2667
|
-
},
|
|
2675
|
+
}, qt = {
|
|
2668
2676
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2669
2677
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2670
|
-
},
|
|
2678
|
+
}, Cs = 16, Ts = (e, t) => {
|
|
2671
2679
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2672
|
-
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
2673
|
-
},
|
|
2674
|
-
const { show: n } = e, { focusedPage: o, totalPages: r } =
|
|
2675
|
-
|
|
2676
|
-
const m = z(() => Object.values(s), [s]),
|
|
2680
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Cs);
|
|
2681
|
+
}, Ps = Ue((e, t) => {
|
|
2682
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages: s, addPage: c, thumbnailLength: i, addToPage: l } = un(), p = H(null), h = H(1);
|
|
2683
|
+
Zt(t, () => p.current);
|
|
2684
|
+
const m = z(() => Object.values(s), [s]), d = R(() => {
|
|
2677
2685
|
const g = i + 1;
|
|
2678
2686
|
g <= r && c(g);
|
|
2679
2687
|
}, [c, r, i]);
|
|
2680
2688
|
return A(() => {
|
|
2681
|
-
o > i ? l(o) : n && h.current !== o && (
|
|
2682
|
-
}, [o, i, l, n, m]),
|
|
2683
|
-
var
|
|
2689
|
+
o > i ? l(o) : n && h.current !== o && (Ts(p.current, o), h.current = o);
|
|
2690
|
+
}, [o, i, l, n, m]), ao(p.current, d), /* @__PURE__ */ a("div", { ref: p, className: qt["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: qt["rp-thumbnails"], children: n ? m.map((g, v) => {
|
|
2691
|
+
var _, f;
|
|
2684
2692
|
return /* @__PURE__ */ a(
|
|
2685
|
-
|
|
2693
|
+
bs,
|
|
2686
2694
|
{
|
|
2687
|
-
isFocused: o === ((
|
|
2695
|
+
isFocused: o === ((_ = g.page) == null ? void 0 : _.pageNumber),
|
|
2688
2696
|
pageNumber: (f = g.page) == null ? void 0 : f.pageNumber,
|
|
2689
2697
|
thumbnailSrc: g.thumbnailSrc,
|
|
2690
2698
|
loading: g.loading,
|
|
@@ -2693,14 +2701,14 @@ const fe = {
|
|
|
2693
2701
|
v
|
|
2694
2702
|
);
|
|
2695
2703
|
}) : null }) });
|
|
2696
|
-
}),
|
|
2697
|
-
const { thumbnailIcon: e } =
|
|
2698
|
-
return e || /* @__PURE__ */ a(
|
|
2699
|
-
},
|
|
2700
|
-
const { active: e, setActive: t } =
|
|
2704
|
+
}), Ss = () => {
|
|
2705
|
+
const { thumbnailIcon: e } = ie();
|
|
2706
|
+
return e || /* @__PURE__ */ a(so, {});
|
|
2707
|
+
}, Is = () => {
|
|
2708
|
+
const { active: e, setActive: t } = un(), [n, o] = $(200), r = H(null), { thumbnailTool: s } = de(), c = R(() => {
|
|
2701
2709
|
t((l) => !l);
|
|
2702
|
-
}, []), i = z(() => typeof s != "boolean" && s ? /* @__PURE__ */ a(s, { onClick: c, active: e }) : s ? /* @__PURE__ */ a(
|
|
2703
|
-
return /* @__PURE__ */
|
|
2710
|
+
}, []), i = z(() => typeof s != "boolean" && s ? /* @__PURE__ */ a(s, { onClick: c, active: e }) : s ? /* @__PURE__ */ a(te, { content: "Thumbnail", children: /* @__PURE__ */ a(Y, { onClick: c, active: e, children: /* @__PURE__ */ a(Ss, {}) }) }) : null, [s, e, c]);
|
|
2711
|
+
return /* @__PURE__ */ O(
|
|
2704
2712
|
"div",
|
|
2705
2713
|
{
|
|
2706
2714
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
@@ -2708,34 +2716,34 @@ const fe = {
|
|
|
2708
2716
|
"data-rp": "sidebar",
|
|
2709
2717
|
children: [
|
|
2710
2718
|
/* @__PURE__ */ a("div", { className: st["rp-sidebar-content"], children: i }),
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
-
/* @__PURE__ */ a(
|
|
2713
|
-
/* @__PURE__ */ a(
|
|
2719
|
+
/* @__PURE__ */ O("div", { "data-rp": "thumbnailSidebar", hidden: !e, className: st["rp-thumbnails-wrapper"], children: [
|
|
2720
|
+
/* @__PURE__ */ a(Ps, { show: e, ref: r }),
|
|
2721
|
+
/* @__PURE__ */ a(io, { onWidthChange: o, thumbnailRef: r })
|
|
2714
2722
|
] })
|
|
2715
2723
|
]
|
|
2716
2724
|
}
|
|
2717
2725
|
);
|
|
2718
|
-
},
|
|
2719
|
-
const { children: n, slots: o, icons: r, style: s, className: c, mobileWidth: i, onLoaded: l, cleanupOnLoaded: p } = e, [h, m] = $(null), { setContainer:
|
|
2726
|
+
}, oi = Ue((e, t) => {
|
|
2727
|
+
const { children: n, slots: o, icons: r, style: s, className: c, mobileWidth: i, onLoaded: l, cleanupOnLoaded: p } = e, [h, m] = $(null), { setContainer: d, setContentRef: g } = Le(), { loading: v } = Q();
|
|
2720
2728
|
return A(() => (l && l(), () => {
|
|
2721
2729
|
p && p();
|
|
2722
|
-
}), [l, p]), /* @__PURE__ */ a("div", { ref: t, className:
|
|
2723
|
-
|
|
2730
|
+
}), [l, p]), /* @__PURE__ */ a("div", { ref: t, className: ee(we["rp-theme-variables"], we["rp-container"]), children: /* @__PURE__ */ a(mo, { mobileWidth: i, children: /* @__PURE__ */ a(co, { slots: o, children: /* @__PURE__ */ a(lo, { icons: r, children: /* @__PURE__ */ O(
|
|
2731
|
+
uo,
|
|
2724
2732
|
{
|
|
2725
|
-
getContainerRef:
|
|
2733
|
+
getContainerRef: d,
|
|
2726
2734
|
toolbarRef: h,
|
|
2727
2735
|
style: s,
|
|
2728
2736
|
className: c,
|
|
2729
2737
|
children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2732
|
-
/* @__PURE__ */ a(
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */ a("div", { className: we["rp-sidebar"], children: /* @__PURE__ */ a(
|
|
2738
|
+
/* @__PURE__ */ O(po, { children: [
|
|
2739
|
+
/* @__PURE__ */ O("div", { className: we["rp-layout"], children: [
|
|
2740
|
+
/* @__PURE__ */ a(ws, { ref: m }),
|
|
2741
|
+
/* @__PURE__ */ O("div", { className: we["rp-content"], children: [
|
|
2742
|
+
/* @__PURE__ */ a("div", { className: we["rp-sidebar"], children: /* @__PURE__ */ a(Is, {}) }),
|
|
2735
2743
|
/* @__PURE__ */ a("div", { ref: g, className: we["rp-pages"], children: n })
|
|
2736
2744
|
] })
|
|
2737
2745
|
] }),
|
|
2738
|
-
/* @__PURE__ */ a(
|
|
2746
|
+
/* @__PURE__ */ a(ho, {})
|
|
2739
2747
|
] }),
|
|
2740
2748
|
v ? /* @__PURE__ */ a(
|
|
2741
2749
|
"div",
|
|
@@ -2770,45 +2778,45 @@ const fe = {
|
|
|
2770
2778
|
) }) }) }) });
|
|
2771
2779
|
});
|
|
2772
2780
|
export {
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2781
|
+
cr as A,
|
|
2782
|
+
bs as B,
|
|
2783
|
+
Qo as C,
|
|
2784
|
+
Rr as D,
|
|
2785
|
+
Ps as E,
|
|
2786
|
+
An as F,
|
|
2787
|
+
Is as G,
|
|
2788
|
+
_s as L,
|
|
2789
|
+
cs as M,
|
|
2790
|
+
ls as O,
|
|
2791
|
+
Xa as P,
|
|
2792
|
+
ei as R,
|
|
2793
|
+
Qa as S,
|
|
2794
|
+
Ya as T,
|
|
2795
|
+
fs as Z,
|
|
2796
|
+
Ja as a,
|
|
2797
|
+
oi as b,
|
|
2798
|
+
es as c,
|
|
2791
2799
|
_t as d,
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2800
|
+
pn as e,
|
|
2801
|
+
sn as f,
|
|
2802
|
+
Ko as g,
|
|
2803
|
+
an as h,
|
|
2804
|
+
Xo as i,
|
|
2805
|
+
cn as j,
|
|
2806
|
+
Jo as k,
|
|
2807
|
+
ln as l,
|
|
2808
|
+
un as m,
|
|
2809
|
+
Yo as n,
|
|
2810
|
+
dn as o,
|
|
2811
|
+
er as p,
|
|
2804
2812
|
wt as q,
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2813
|
+
Ir as r,
|
|
2814
|
+
Lr as s,
|
|
2815
|
+
Or as t,
|
|
2816
|
+
oe as u,
|
|
2817
|
+
Xr as v,
|
|
2818
|
+
kn as w,
|
|
2819
|
+
us as x,
|
|
2820
|
+
gs as y,
|
|
2821
|
+
ws as z
|
|
2814
2822
|
};
|