@pdf-viewer/react 1.8.5-rc.5 → 1.8.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-2fc9f5ab.js → RPDefaultLayout-9c9a2159.js} +750 -756
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/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/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- 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/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Checkbox.js +125 -237
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +424 -211
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/floating-ui.react-dom-88a86594.js +1447 -0
- package/dist/index-48ca3f30.js +307 -0
- package/dist/index-4ba3ab9a.js +1877 -0
- package/dist/main.js +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/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
- package/dist/index-0da31711.js +0 -1672
- package/dist/index-a7d7ef35.js +0 -1681
- package/dist/index-ebf0eeb9.js +0 -332
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as a, Fragment as me, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import * as j from "react";
|
|
3
|
-
import { useRef as H, useEffect as
|
|
3
|
+
import { useRef as H, useEffect as D, useCallback as E, useState as G, useMemo as W, createContext as $e, useContext as Ge, useImperativeHandle as cn, createElement as Ze, PureComponent as tr, Component as nr, memo as ln } from "react";
|
|
4
4
|
import { ChevronUpIcon as He } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as ie } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as dn } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as Le, ScrollMode as ne, AnnotationSubType as At, SelectionMode as rr, ZoomLevel as
|
|
7
|
+
import { ViewMode as Le, ScrollMode as ne, AnnotationSubType as At, SelectionMode as rr, ZoomLevel as at } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as Ne } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as J } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as or } from "./contexts/DocumentPasswordContext.js";
|
|
@@ -36,7 +36,7 @@ import { useLoaderContext as hn } from "./contexts/LoaderContext.js";
|
|
|
36
36
|
import "./components/RPConfig.js";
|
|
37
37
|
import { ThumbnailIcon as wr } from "./components/icons/Thumbnail.js";
|
|
38
38
|
import { c as re } from "./clsx-0c6e471a.js";
|
|
39
|
-
import { LoaderIcon as
|
|
39
|
+
import { LoaderIcon as Ct } from "./components/icons/LoaderIcon.js";
|
|
40
40
|
import { useThemeContext as _r } from "./contexts/ThemeContext.js";
|
|
41
41
|
import { RPDropFileZone as br } from "./components/RPDropFileZone.js";
|
|
42
42
|
import { useToolbarComponentContext as ve, ToolbarComponentProvider as Cr } from "./contexts/ToolbarComponentContext.js";
|
|
@@ -50,28 +50,28 @@ import { WrapperLayout as xr } from "./components/layout/WrapperLayout.js";
|
|
|
50
50
|
import { useViewportContext as Pe, ViewportProvider as Ir } from "./contexts/ViewportContext.js";
|
|
51
51
|
import * as Rr from "pdfjs-dist";
|
|
52
52
|
import { PixelsPerInch as Lr, AnnotationMode as Er, RenderingCancelledException as Nr, AnnotationLayer as Or } from "pdfjs-dist";
|
|
53
|
-
import { SimpleLinkService as
|
|
54
|
-
import { annotationsEvents as
|
|
53
|
+
import { SimpleLinkService as zr } from "./utils/link_service.js";
|
|
54
|
+
import { annotationsEvents as Dr, annotationEventsHandler as Ar, handleClick as Ft, handleAnnotationWidget as Fr, handleAnnotationLink as kr, bindLayerEvents as Wr, unbindLayerEvents as kt } from "./utils/annotations.js";
|
|
55
55
|
import { normalizeSingleKeyword as Mr, sortHighlightPosition as Hr, unwrap as $r } from "./components/page/searchHighlight.js";
|
|
56
56
|
import { CustomElement as Gr } from "./components/page/CustomElement.js";
|
|
57
57
|
import { useMousePressed as qr } from "./utils/hooks/useMousePressed.js";
|
|
58
58
|
import { useGrabScroll as Ur } from "./utils/hooks/useGrabScroll.js";
|
|
59
59
|
import { usePinch as Vr } from "./utils/hooks/usePinch.js";
|
|
60
|
-
import { useDebounce as
|
|
60
|
+
import { useDebounce as Pt } from "./utils/hooks/useDebounce.js";
|
|
61
61
|
import Br from "./components/ui/PasswordModal.js";
|
|
62
62
|
import { getPositionFromPage as Zr, getPageFromPosition as jr } from "./utils/calculatePage.js";
|
|
63
63
|
import { getScrollDistance as Ae } from "./utils/getScrollDistance.js";
|
|
64
64
|
import { getWordPositionInPage as Kr } from "./utils/getWordPositionInPage.js";
|
|
65
65
|
import { getThumbnailViewport as Xr } from "./utils/getThumbnailViewport.js";
|
|
66
|
-
import { smoothScrollTo as
|
|
66
|
+
import { smoothScrollTo as st } from "./utils/smoothScrollTo.js";
|
|
67
67
|
import { appConsole as Qr } from "./utils/appConsole.js";
|
|
68
68
|
import { FileUploadTool as fn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
69
69
|
import { DarkModeTool as Yr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
70
70
|
import { ThreeDotIcon as Jr } from "./components/icons/ThreeDotIcon.js";
|
|
71
|
-
import { UIDropDown as
|
|
72
|
-
import { c as eo,
|
|
73
|
-
import { D as oo,
|
|
74
|
-
import { a as io, h as ao, u as so, F as co, b as lo, G as Qe } from "./index-
|
|
71
|
+
import { UIDropDown as Tt } from "./components/ui/DropDown.js";
|
|
72
|
+
import { c as eo, u as yt, P as Be, b as Me, d as St, i as to, k as no, a as ro } from "./index-48ca3f30.js";
|
|
73
|
+
import { D as oo, d as ct } from "./floating-ui.react-dom-88a86594.js";
|
|
74
|
+
import { a as io, h as ao, u as so, F as co, b as lo, G as Qe } from "./index-4ba3ab9a.js";
|
|
75
75
|
import { CloseIcon as uo } from "./components/icons/CloseIcon.js";
|
|
76
76
|
import { dateFormatter as Wt } from "./utils/dateFormatter.js";
|
|
77
77
|
import { PropertyItem as po } from "./components/layout/toolbar/PropertyItem.js";
|
|
@@ -80,7 +80,7 @@ import { DocumentProperties as mo } from "./components/layout/toolbar/DocumentPr
|
|
|
80
80
|
import { RotateTool as go } from "./components/layout/toolbar/RotateTool.js";
|
|
81
81
|
import { ViewModeTool as vo } from "./components/layout/toolbar/ViewModeTool.js";
|
|
82
82
|
import { ScrollModeTool as wo } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
83
|
-
import { MenuSeparator as
|
|
83
|
+
import { MenuSeparator as xt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
84
84
|
import { FileDownloadDefaultIcon as _o } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
85
85
|
import { MenuItem as Ce } from "./components/layout/toolbar/MenuItem.js";
|
|
86
86
|
import { PrintDefaultTool as bo } from "./components/icons/PrintDefaultIcon.js";
|
|
@@ -97,24 +97,24 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
97
97
|
import { ClearIcon as xo } from "./components/icons/ClearIcon.js";
|
|
98
98
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
99
99
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
100
|
-
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = oe(), s = H(), { columnCount: l } = un(), { widths: d, heights: u } = qe(), m = H(e), P = H(t),
|
|
101
|
-
|
|
100
|
+
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = oe(), s = H(), { columnCount: l } = un(), { widths: d, heights: u } = qe(), m = H(e), P = H(t), f = H(l), { targetScrollPage: C } = pn();
|
|
101
|
+
D(() => {
|
|
102
102
|
n != null && n.scrollToItem && (s.current = n);
|
|
103
|
-
}, [n]),
|
|
103
|
+
}, [n]), D(() => {
|
|
104
104
|
m.current = e, P.current = t;
|
|
105
105
|
}, [e, t]);
|
|
106
|
-
const
|
|
107
|
-
(w,
|
|
106
|
+
const b = E(
|
|
107
|
+
(w, T) => {
|
|
108
108
|
if (!r)
|
|
109
109
|
return;
|
|
110
|
-
const
|
|
111
|
-
if (w ===
|
|
110
|
+
const h = Math.ceil(w / 2) * 2 - 1;
|
|
111
|
+
if (w === h + 1) {
|
|
112
112
|
const g = {
|
|
113
|
-
left: d[
|
|
113
|
+
left: d[h],
|
|
114
114
|
top: 0
|
|
115
115
|
};
|
|
116
116
|
return new Promise(
|
|
117
|
-
(c) =>
|
|
117
|
+
(c) => st(r, g, c)
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
const p = {
|
|
@@ -123,22 +123,22 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
123
123
|
};
|
|
124
124
|
return r == null ? void 0 : r.scrollTo({
|
|
125
125
|
...p,
|
|
126
|
-
behavior:
|
|
126
|
+
behavior: T
|
|
127
127
|
});
|
|
128
128
|
},
|
|
129
|
-
[r, d,
|
|
129
|
+
[r, d, st]
|
|
130
130
|
);
|
|
131
|
-
return
|
|
131
|
+
return D(() => {
|
|
132
132
|
m.current = e, P.current = t;
|
|
133
|
-
}, [e, t]),
|
|
134
|
-
|
|
133
|
+
}, [e, t]), D(() => {
|
|
134
|
+
f.current = l;
|
|
135
135
|
}, [l]), { scrollToPage: E(
|
|
136
|
-
(w,
|
|
136
|
+
(w, T = "smooth") => {
|
|
137
137
|
console.log("scrollToPage", w), i(w);
|
|
138
|
-
const
|
|
139
|
-
let p =
|
|
138
|
+
const h = w - 1;
|
|
139
|
+
let p = h, g = 0;
|
|
140
140
|
if (P.current === Le.DUAL_PAGE && m.current === ne.PAGE_SCROLLING) {
|
|
141
|
-
|
|
141
|
+
b(w, T);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
if (m.current === ne.PAGE_SCROLLING) {
|
|
@@ -148,26 +148,26 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
148
148
|
if (!s.current || !o)
|
|
149
149
|
return;
|
|
150
150
|
const c = o;
|
|
151
|
-
if (
|
|
152
|
-
g =
|
|
153
|
-
const
|
|
151
|
+
if (T === "smooth" && (C.current = w), m.current === ne.HORIZONTAL_SCROLLING) {
|
|
152
|
+
g = h;
|
|
153
|
+
const y = {
|
|
154
154
|
left: Ae(d, g),
|
|
155
155
|
top: 0
|
|
156
156
|
};
|
|
157
157
|
return c.scrollTo({
|
|
158
|
-
...
|
|
159
|
-
behavior:
|
|
158
|
+
...y,
|
|
159
|
+
behavior: T
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
if (P.current === Le.DUAL_PAGE) {
|
|
163
|
-
g =
|
|
164
|
-
const
|
|
163
|
+
g = h % 2, p = Math.floor(h / 2);
|
|
164
|
+
const y = {
|
|
165
165
|
left: Ae(d, g),
|
|
166
166
|
top: Ae(u, p)
|
|
167
167
|
};
|
|
168
168
|
return c.scrollTo({
|
|
169
|
-
...
|
|
170
|
-
behavior:
|
|
169
|
+
...y,
|
|
170
|
+
behavior: T
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
const _ = {
|
|
@@ -176,21 +176,21 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
176
176
|
};
|
|
177
177
|
return c.scrollTo({
|
|
178
178
|
..._,
|
|
179
|
-
behavior:
|
|
179
|
+
behavior: T
|
|
180
180
|
});
|
|
181
181
|
},
|
|
182
182
|
[
|
|
183
183
|
o,
|
|
184
184
|
l,
|
|
185
|
-
|
|
185
|
+
b,
|
|
186
186
|
i,
|
|
187
|
-
|
|
187
|
+
st,
|
|
188
188
|
u,
|
|
189
189
|
d
|
|
190
190
|
]
|
|
191
191
|
) };
|
|
192
192
|
}, Io = (t = 1) => {
|
|
193
|
-
const [e, n] = G(t), [o, r] = G(0), { scrollToPage: i } = vn(), s = H(1), { viewMode: l } = Oe(), { scrollMode: d } = Ne(), { widths: u } = qe(), { pagesRef: m } = ge(), P =
|
|
193
|
+
const [e, n] = G(t), [o, r] = G(0), { scrollToPage: i } = vn(), s = H(1), { viewMode: l } = Oe(), { scrollMode: d } = Ne(), { widths: u } = qe(), { pagesRef: m } = ge(), P = Pt(e, 100), f = E(
|
|
194
194
|
(p) => {
|
|
195
195
|
if (!/^[0-9]*$/g.test(p.toString()) || !p)
|
|
196
196
|
return { success: !1, currentPage: s.current };
|
|
@@ -198,13 +198,13 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
198
198
|
return c < 0 || c > o ? { success: !1, currentPage: s.current } : (n(c), s.current = c, { success: !0, currentPage: +p });
|
|
199
199
|
},
|
|
200
200
|
[o]
|
|
201
|
-
),
|
|
201
|
+
), C = E(f, [f]), b = E(
|
|
202
202
|
(p) => {
|
|
203
|
-
const g =
|
|
203
|
+
const g = f(p);
|
|
204
204
|
return g.success && i(g.currentPage), g;
|
|
205
205
|
},
|
|
206
|
-
[
|
|
207
|
-
),
|
|
206
|
+
[f, i]
|
|
207
|
+
), S = E((p) => {
|
|
208
208
|
const g = p % 2 === 1;
|
|
209
209
|
if (!m || g)
|
|
210
210
|
return !1;
|
|
@@ -212,21 +212,21 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
212
212
|
return l === Le.DUAL_PAGE && c + _ < m.clientWidth;
|
|
213
213
|
}, [l, u, m, o]), w = E(() => {
|
|
214
214
|
let p = e - 1;
|
|
215
|
-
|
|
216
|
-
}, [
|
|
217
|
-
if (
|
|
215
|
+
S(p) && (p = e - 2), b(p);
|
|
216
|
+
}, [b, e, l, d, S]), T = W(() => l === Le.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === o - 1 : e === o, [e, o, l, d]), h = E(() => {
|
|
217
|
+
if (T)
|
|
218
218
|
return;
|
|
219
219
|
let p = e + 1;
|
|
220
|
-
|
|
221
|
-
}, [
|
|
220
|
+
S(p) && (p = e + 2), b(p);
|
|
221
|
+
}, [b, e, S, l, d, T]);
|
|
222
222
|
return {
|
|
223
223
|
focusedPage: P,
|
|
224
224
|
totalPages: o,
|
|
225
|
-
setFocusedPage:
|
|
225
|
+
setFocusedPage: C,
|
|
226
226
|
setTotalPages: r,
|
|
227
|
-
nextPage:
|
|
227
|
+
nextPage: h,
|
|
228
228
|
prevPage: w,
|
|
229
|
-
goToPage:
|
|
229
|
+
goToPage: b
|
|
230
230
|
};
|
|
231
231
|
}, wn = $e({
|
|
232
232
|
focusedPage: 0,
|
|
@@ -243,9 +243,9 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
243
243
|
}), oe = () => {
|
|
244
244
|
const t = Ge(wn);
|
|
245
245
|
return typeof (t == null ? void 0 : t.focusedPage) > "u" && Qr.error("Please use this hooks inside children component of RPProvider"), t;
|
|
246
|
-
},
|
|
246
|
+
}, Vs = ({ children: t }) => {
|
|
247
247
|
const { pdf: e } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: i, goToPage: s, nextPage: l, prevPage: d } = Io();
|
|
248
|
-
return
|
|
248
|
+
return D(() => {
|
|
249
249
|
e != null && e.numPages && (i(e.numPages), r(1));
|
|
250
250
|
}, [e, i, r]), /* @__PURE__ */ a(
|
|
251
251
|
wn.Provider,
|
|
@@ -269,32 +269,32 @@ const Ro = () => {
|
|
|
269
269
|
totalPages: 0,
|
|
270
270
|
percentage: 0
|
|
271
271
|
}), [r, i] = G(!1), [s, l] = G(!1), [d, u] = G(null), m = H(!1);
|
|
272
|
-
|
|
272
|
+
D(() => {
|
|
273
273
|
m.current;
|
|
274
274
|
}, [m]);
|
|
275
275
|
const P = E(() => {
|
|
276
276
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
277
277
|
const p = document.querySelector(".rp-print-zone");
|
|
278
278
|
p && p.remove();
|
|
279
|
-
}, []),
|
|
279
|
+
}, []), f = E(() => {
|
|
280
280
|
m.current = !1, i(!1), l(!1), u(null), o({
|
|
281
281
|
loadedPages: 0,
|
|
282
282
|
totalPages: 0,
|
|
283
283
|
percentage: 0
|
|
284
284
|
});
|
|
285
|
-
}, []),
|
|
285
|
+
}, []), C = () => {
|
|
286
286
|
m.current = !0;
|
|
287
|
-
},
|
|
287
|
+
}, b = async ({
|
|
288
288
|
scratchCanvas: p,
|
|
289
289
|
pdfDocument: g,
|
|
290
290
|
pageNumber: c,
|
|
291
291
|
viewerPdfPage: _,
|
|
292
292
|
printResolution: v,
|
|
293
|
-
optionalContentConfigPromise:
|
|
293
|
+
optionalContentConfigPromise: y,
|
|
294
294
|
printAnnotationStoragePromise: R
|
|
295
295
|
}) => {
|
|
296
296
|
if (m.current) {
|
|
297
|
-
|
|
297
|
+
f();
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
const x = v / Lr.PDF;
|
|
@@ -306,7 +306,7 @@ const Ro = () => {
|
|
|
306
306
|
R
|
|
307
307
|
]);
|
|
308
308
|
if (m.current) {
|
|
309
|
-
|
|
309
|
+
f();
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
const F = {
|
|
@@ -315,7 +315,7 @@ const Ro = () => {
|
|
|
315
315
|
viewport: O.getViewport({ scale: 1, rotation: _.rotation }),
|
|
316
316
|
intent: "print",
|
|
317
317
|
annotationMode: Er.ENABLE_STORAGE,
|
|
318
|
-
optionalContentConfigPromise:
|
|
318
|
+
optionalContentConfigPromise: y,
|
|
319
319
|
printAnnotationStorage: A
|
|
320
320
|
};
|
|
321
321
|
try {
|
|
@@ -323,12 +323,12 @@ const Ro = () => {
|
|
|
323
323
|
} catch (L) {
|
|
324
324
|
throw L instanceof Nr || console.error(L), L;
|
|
325
325
|
}
|
|
326
|
-
},
|
|
326
|
+
}, S = E(() => {
|
|
327
327
|
const p = window.print;
|
|
328
328
|
return new Promise((g) => {
|
|
329
|
-
const c = (
|
|
329
|
+
const c = (y) => {
|
|
330
330
|
setTimeout(() => {
|
|
331
|
-
p.call(window), setTimeout(() =>
|
|
331
|
+
p.call(window), setTimeout(() => y(), 20);
|
|
332
332
|
}, 0);
|
|
333
333
|
};
|
|
334
334
|
if (document.querySelector(".rp-print-zone")) {
|
|
@@ -343,39 +343,39 @@ const Ro = () => {
|
|
|
343
343
|
}, []), w = async (p) => {
|
|
344
344
|
const g = document.createElement("img"), c = document.createElement("div");
|
|
345
345
|
return c.classList.add("rp-print-page"), await new Promise((_, v) => {
|
|
346
|
-
p.toBlob((
|
|
347
|
-
|
|
346
|
+
p.toBlob((y) => {
|
|
347
|
+
y ? (g.src = URL.createObjectURL(y), g.onload = () => {
|
|
348
348
|
URL.revokeObjectURL(g.src), _();
|
|
349
349
|
}, g.onerror = v) : v(new Error("Failed to create blob"));
|
|
350
350
|
});
|
|
351
351
|
}).catch(() => {
|
|
352
352
|
}), c.appendChild(g), c;
|
|
353
|
-
},
|
|
353
|
+
}, T = (p, g) => {
|
|
354
354
|
const c = document.createElement("div");
|
|
355
355
|
c.classList.add("rp-print-zone");
|
|
356
356
|
const _ = document.createElement("style"), v = g.get(1);
|
|
357
357
|
if (v) {
|
|
358
|
-
const { width:
|
|
359
|
-
_.innerHTML = `@page { size: ${
|
|
358
|
+
const { width: y, height: R } = v == null ? void 0 : v.page.getViewport({ scale: 1 });
|
|
359
|
+
_.innerHTML = `@page { size: ${y}px ${R}px }`;
|
|
360
360
|
}
|
|
361
361
|
return c.appendChild(_), c.append(...p), c;
|
|
362
|
-
},
|
|
362
|
+
}, h = E(async () => {
|
|
363
363
|
if (!t)
|
|
364
364
|
return;
|
|
365
|
-
|
|
365
|
+
f();
|
|
366
366
|
const p = document.createElement("canvas"), g = [];
|
|
367
367
|
try {
|
|
368
368
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
369
369
|
const _ = t.getOptionalContentConfig({ intent: "print" }), v = Promise.resolve(
|
|
370
370
|
t.annotationStorage.print ?? void 0
|
|
371
|
-
),
|
|
371
|
+
), y = e.size;
|
|
372
372
|
for (const [x, I] of e) {
|
|
373
373
|
if (m.current) {
|
|
374
|
-
|
|
374
|
+
f();
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
377
|
const O = I.page.getViewport({ scale: 1 });
|
|
378
|
-
if (await
|
|
378
|
+
if (await b({
|
|
379
379
|
scratchCanvas: p,
|
|
380
380
|
pdfDocument: t,
|
|
381
381
|
pageNumber: x,
|
|
@@ -384,40 +384,40 @@ const Ro = () => {
|
|
|
384
384
|
optionalContentConfigPromise: _,
|
|
385
385
|
printAnnotationStoragePromise: v
|
|
386
386
|
}), m.current) {
|
|
387
|
-
|
|
387
|
+
f();
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
390
|
const A = await w(p);
|
|
391
391
|
g.push(A);
|
|
392
|
-
const F = parseFloat((g.length /
|
|
392
|
+
const F = parseFloat((g.length / y * 100).toFixed(2));
|
|
393
393
|
o({
|
|
394
394
|
loadedPages: x,
|
|
395
|
-
totalPages:
|
|
395
|
+
totalPages: y,
|
|
396
396
|
percentage: F
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
if (m.current) {
|
|
400
|
-
|
|
400
|
+
f();
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
|
-
const R =
|
|
404
|
-
document.body.appendChild(R), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await
|
|
403
|
+
const R = T(g, e);
|
|
404
|
+
document.body.appendChild(R), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await S();
|
|
405
405
|
} catch (c) {
|
|
406
406
|
l(!0), c instanceof Error && u(c);
|
|
407
407
|
} finally {
|
|
408
408
|
p.height = 0, p.width = 0;
|
|
409
409
|
}
|
|
410
410
|
}, [t, e, m]);
|
|
411
|
-
return
|
|
411
|
+
return D(() => {
|
|
412
412
|
const p = () => {
|
|
413
|
-
|
|
413
|
+
f(), P();
|
|
414
414
|
};
|
|
415
415
|
return window.addEventListener("afterprint", p, !0), () => {
|
|
416
416
|
window.removeEventListener("afterprint", p, !0);
|
|
417
417
|
};
|
|
418
|
-
}, [P,
|
|
419
|
-
print:
|
|
420
|
-
cancel:
|
|
418
|
+
}, [P, f]), {
|
|
419
|
+
print: h,
|
|
420
|
+
cancel: C,
|
|
421
421
|
progress: n,
|
|
422
422
|
isComplete: r,
|
|
423
423
|
isError: s,
|
|
@@ -440,37 +440,37 @@ const Ro = () => {
|
|
|
440
440
|
console.error("Error in setOnError callback:", e);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
}),
|
|
443
|
+
}), Bs = ({ children: t }) => {
|
|
444
444
|
const [e, n] = G(null), [o, r] = G(null), { print: i, cancel: s, progress: l, isComplete: d, isError: u, error: m } = Ro(), P = E((w) => {
|
|
445
445
|
w && typeof w == "function" && r(() => w);
|
|
446
|
-
}, []),
|
|
446
|
+
}, []), f = (w) => {
|
|
447
447
|
m && w(m);
|
|
448
|
-
},
|
|
448
|
+
}, C = E(
|
|
449
449
|
(w) => {
|
|
450
450
|
n(() => w);
|
|
451
451
|
},
|
|
452
452
|
[l, e]
|
|
453
453
|
);
|
|
454
|
-
|
|
455
|
-
d && o &&
|
|
456
|
-
}, [d, o]),
|
|
457
|
-
u &&
|
|
454
|
+
D(() => {
|
|
455
|
+
d && o && b();
|
|
456
|
+
}, [d, o]), D(() => {
|
|
457
|
+
u && f((w) => {
|
|
458
458
|
console.error(w);
|
|
459
459
|
});
|
|
460
|
-
}, [u]),
|
|
460
|
+
}, [u]), D(() => {
|
|
461
461
|
l && e && e(l);
|
|
462
462
|
}, [l, e]);
|
|
463
|
-
const
|
|
463
|
+
const b = () => {
|
|
464
464
|
o && (o(), r(null));
|
|
465
|
-
},
|
|
465
|
+
}, S = {
|
|
466
466
|
print: i,
|
|
467
467
|
cancel: s,
|
|
468
|
-
setOnProgress:
|
|
468
|
+
setOnProgress: C,
|
|
469
469
|
setOnComplete: P,
|
|
470
|
-
setOnError:
|
|
470
|
+
setOnError: f,
|
|
471
471
|
progress: l
|
|
472
472
|
};
|
|
473
|
-
return /* @__PURE__ */ a(_n.Provider, { value:
|
|
473
|
+
return /* @__PURE__ */ a(_n.Provider, { value: S, children: t });
|
|
474
474
|
}, tt = () => {
|
|
475
475
|
const t = Ge(_n);
|
|
476
476
|
if (!t)
|
|
@@ -482,9 +482,9 @@ const Ro = () => {
|
|
|
482
482
|
if (!n.size)
|
|
483
483
|
return;
|
|
484
484
|
const l = s > n.size ? n.size : s, u = Array.from(n.values()).slice(0, l).map((m) => {
|
|
485
|
-
const { thumbnailViewport: P, scale:
|
|
485
|
+
const { thumbnailViewport: P, scale: f } = Xr(m.page, m.defaultRotation);
|
|
486
486
|
return {
|
|
487
|
-
scale:
|
|
487
|
+
scale: f,
|
|
488
488
|
page: m.page,
|
|
489
489
|
loading: !0,
|
|
490
490
|
viewport: P,
|
|
@@ -495,7 +495,7 @@ const Ro = () => {
|
|
|
495
495
|
},
|
|
496
496
|
[n]
|
|
497
497
|
);
|
|
498
|
-
|
|
498
|
+
D(() => {
|
|
499
499
|
r(10);
|
|
500
500
|
}, [r]);
|
|
501
501
|
const i = E(
|
|
@@ -527,7 +527,7 @@ const Ro = () => {
|
|
|
527
527
|
setActive: (t) => {
|
|
528
528
|
},
|
|
529
529
|
active: !1
|
|
530
|
-
}), Cn = () => Ge(bn),
|
|
530
|
+
}), Cn = () => Ge(bn), Zs = ({
|
|
531
531
|
children: t,
|
|
532
532
|
initialThumbnailsVisible: e
|
|
533
533
|
}) => {
|
|
@@ -540,20 +540,20 @@ const Ro = () => {
|
|
|
540
540
|
}
|
|
541
541
|
);
|
|
542
542
|
}, Eo = (t = {}, e = "") => {
|
|
543
|
-
const [n, o] = G(e), [r, i] = G(!1), { pdf: s, pages: l } = J(), { widths: d, heights: u } = qe(), m = H(!n), { currentZoom: P } = Je(), [
|
|
544
|
-
|
|
543
|
+
const [n, o] = G(e), [r, i] = G(!1), { pdf: s, pages: l } = J(), { widths: d, heights: u } = qe(), m = H(!n), { currentZoom: P } = Je(), [f, C] = G([]), { setFocusedPage: b } = oe(), { columnCount: S } = Oe(), { pageRotate: w } = Ue(), [T, h] = G(0), { pageScrollElementRef: p, virtualScrollableElementRef: g } = et(), { scrollMode: c } = Ne(), { pagesRef: _ } = ge(), [v, y] = G(null), R = H({}), x = W(() => T === 0 ? null : f[T - 1], [T, f]), I = W(() => f.length, [f]);
|
|
544
|
+
D(() => {
|
|
545
545
|
if (!x || !l)
|
|
546
546
|
return;
|
|
547
547
|
const L = g || p;
|
|
548
548
|
if (!L || !_)
|
|
549
549
|
return;
|
|
550
550
|
const N = l.get(x.page);
|
|
551
|
-
if (c === ne.PAGE_SCROLLING &&
|
|
551
|
+
if (c === ne.PAGE_SCROLLING && b(x.page), !N)
|
|
552
552
|
return;
|
|
553
|
-
let
|
|
553
|
+
let z = 0, k = 0;
|
|
554
554
|
if (c === ne.VERTICAL_SCROLLING) {
|
|
555
|
-
const de = x.page - 1, ee =
|
|
556
|
-
|
|
555
|
+
const de = x.page - 1, ee = S, Fe = de % ee, we = Math.floor(de / ee);
|
|
556
|
+
z = Ae(u, we), k = Ae(d, Fe);
|
|
557
557
|
}
|
|
558
558
|
c === ne.HORIZONTAL_SCROLLING && (k = d.slice(0, x.page - 1).reduce((de, ee) => de + ee, 0));
|
|
559
559
|
const q = {
|
|
@@ -568,7 +568,7 @@ const Ro = () => {
|
|
|
568
568
|
x.rect,
|
|
569
569
|
P,
|
|
570
570
|
U
|
|
571
|
-
), X = k + V, Q =
|
|
571
|
+
), X = k + V, Q = z + K, le = {
|
|
572
572
|
left: Math.max(X, 0),
|
|
573
573
|
top: Math.max(Q, 0)
|
|
574
574
|
};
|
|
@@ -578,7 +578,7 @@ const Ro = () => {
|
|
|
578
578
|
});
|
|
579
579
|
}, [
|
|
580
580
|
l,
|
|
581
|
-
|
|
581
|
+
b,
|
|
582
582
|
d,
|
|
583
583
|
u,
|
|
584
584
|
x,
|
|
@@ -588,29 +588,29 @@ const Ro = () => {
|
|
|
588
588
|
_
|
|
589
589
|
]);
|
|
590
590
|
const O = E(() => {
|
|
591
|
-
|
|
591
|
+
h((L) => I ? L + 1 > I ? 1 : L + 1 : 0);
|
|
592
592
|
}, [I]), A = E(() => {
|
|
593
|
-
|
|
593
|
+
h((L) => I ? L - 1 <= 0 ? I : L - 1 : 0);
|
|
594
594
|
}, [I]), F = E(async (L) => {
|
|
595
595
|
if (!L)
|
|
596
596
|
return {};
|
|
597
|
-
const N = L.numPages,
|
|
597
|
+
const N = L.numPages, z = {};
|
|
598
598
|
for (let k = 1; k <= N; k++) {
|
|
599
599
|
if (m.current)
|
|
600
600
|
throw "close pop over";
|
|
601
601
|
const q = await L.getPage(k);
|
|
602
|
-
|
|
602
|
+
z[k.toString()] = await q.getTextContent();
|
|
603
603
|
}
|
|
604
|
-
return
|
|
604
|
+
return z;
|
|
605
605
|
}, []);
|
|
606
|
-
return
|
|
606
|
+
return D(() => {
|
|
607
607
|
if (!n) {
|
|
608
|
-
m.current = !0,
|
|
608
|
+
m.current = !0, C([]), h(0);
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
m.current = !1, i(!0),
|
|
611
|
+
m.current = !1, i(!0), C([]), h(0), F(s).then((L) => {
|
|
612
612
|
R.current = L;
|
|
613
|
-
const
|
|
613
|
+
const z = Object.keys(L).reduce((k, q) => {
|
|
614
614
|
const $ = dr(
|
|
615
615
|
[n],
|
|
616
616
|
L[q],
|
|
@@ -619,22 +619,22 @@ const Ro = () => {
|
|
|
619
619
|
).map((U, V) => ({ ...U, page: Number(q), pageMatchIdx: V }));
|
|
620
620
|
return [...k, ...$];
|
|
621
621
|
}, []);
|
|
622
|
-
|
|
622
|
+
C(z), h(z.length ? 1 : 0);
|
|
623
623
|
}).catch(() => {
|
|
624
|
-
|
|
624
|
+
C([]), h(0);
|
|
625
625
|
}).finally(() => i(!1));
|
|
626
626
|
}, [n, F, s, t]), {
|
|
627
627
|
search: n,
|
|
628
628
|
setSearch: o,
|
|
629
629
|
loading: r,
|
|
630
|
-
matches:
|
|
630
|
+
matches: f,
|
|
631
631
|
totalMatches: I,
|
|
632
|
-
currentMatchPosition:
|
|
632
|
+
currentMatchPosition: T,
|
|
633
633
|
currentMatch: x,
|
|
634
634
|
nextMatch: O,
|
|
635
635
|
prevMatch: A,
|
|
636
636
|
currentMatchElement: v,
|
|
637
|
-
setCurrentMatchElement:
|
|
637
|
+
setCurrentMatchElement: y
|
|
638
638
|
};
|
|
639
639
|
}, Pn = $e({
|
|
640
640
|
search: "",
|
|
@@ -654,7 +654,7 @@ const Ro = () => {
|
|
|
654
654
|
currentMatchElement: null,
|
|
655
655
|
setCurrentMatchElement: (t) => {
|
|
656
656
|
}
|
|
657
|
-
}),
|
|
657
|
+
}), js = ({
|
|
658
658
|
children: t,
|
|
659
659
|
initialSearch: e
|
|
660
660
|
}) => {
|
|
@@ -667,9 +667,9 @@ const Ro = () => {
|
|
|
667
667
|
search: u,
|
|
668
668
|
matches: m,
|
|
669
669
|
nextMatch: P,
|
|
670
|
-
prevMatch:
|
|
671
|
-
currentMatchElement:
|
|
672
|
-
setCurrentMatchElement:
|
|
670
|
+
prevMatch: f,
|
|
671
|
+
currentMatchElement: C,
|
|
672
|
+
setCurrentMatchElement: b
|
|
673
673
|
} = Eo(n, e);
|
|
674
674
|
return /* @__PURE__ */ a(
|
|
675
675
|
Pn.Provider,
|
|
@@ -683,16 +683,16 @@ const Ro = () => {
|
|
|
683
683
|
currentMatchPosition: l,
|
|
684
684
|
currentMatch: d,
|
|
685
685
|
nextMatch: P,
|
|
686
|
-
prevMatch:
|
|
686
|
+
prevMatch: f,
|
|
687
687
|
search: u,
|
|
688
688
|
matches: m,
|
|
689
|
-
currentMatchElement:
|
|
690
|
-
setCurrentMatchElement:
|
|
689
|
+
currentMatchElement: C,
|
|
690
|
+
setCurrentMatchElement: b
|
|
691
691
|
},
|
|
692
692
|
children: t
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
|
-
},
|
|
695
|
+
}, It = () => Ge(Pn), Tn = $e(null), Ks = ({ children: t }) => {
|
|
696
696
|
const e = H(!1), [n, o] = G([]), r = E((d) => {
|
|
697
697
|
o((u) => [...u, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
698
698
|
}, []), i = W(() => new gr(r), [r]), { focusedPage: s } = oe(), l = E((d) => (e.current = !0, vr(
|
|
@@ -704,9 +704,9 @@ const Ro = () => {
|
|
|
704
704
|
}).finally(() => {
|
|
705
705
|
d.data.onLoaded && d.data.onLoaded();
|
|
706
706
|
})), []);
|
|
707
|
-
return
|
|
707
|
+
return D(() => {
|
|
708
708
|
s && (i.changePagePriority(`^page-${s}`, 0), i.changePagePriority(`^thumbnail-${s}`, 1));
|
|
709
|
-
}, [s]),
|
|
709
|
+
}, [s]), D(() => {
|
|
710
710
|
if (i.isEmpty() || e.current)
|
|
711
711
|
return;
|
|
712
712
|
const d = () => {
|
|
@@ -731,25 +731,25 @@ const Ro = () => {
|
|
|
731
731
|
"rp-cursor-grab": "_rp-cursor-grab_17t6t_58",
|
|
732
732
|
"rp-cursor-grabbing": "_rp-cursor-grabbing_17t6t_66",
|
|
733
733
|
"rp-loader": "_rp-loader_17t6t_74"
|
|
734
|
-
},
|
|
734
|
+
}, lt = {
|
|
735
735
|
"rp-page-wrapper": "_rp-page-wrapper_14ohm_1",
|
|
736
736
|
"rp-page": "_rp-page_14ohm_1",
|
|
737
737
|
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
738
738
|
}, No = (t) => {
|
|
739
739
|
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r = H(null), { pages: i } = J(), { pageRotate: s } = Ue(), l = H(), { currentZoom: d } = Je(), u = yn(), m = H(`page-${e}`);
|
|
740
|
-
return
|
|
740
|
+
return D(() => {
|
|
741
741
|
if (!i || d === 0)
|
|
742
742
|
return;
|
|
743
743
|
const P = i.get(e);
|
|
744
744
|
if (r.current && P) {
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
|
|
745
|
+
const f = r.current;
|
|
746
|
+
f.hidden = !0;
|
|
747
|
+
const C = l.current;
|
|
748
|
+
C && C.cancel(), o && o(), u.enqueue(
|
|
749
749
|
m.current,
|
|
750
750
|
{
|
|
751
751
|
page: P.page,
|
|
752
|
-
canvasElem:
|
|
752
|
+
canvasElem: f,
|
|
753
753
|
options: {
|
|
754
754
|
scale: d,
|
|
755
755
|
rotate: s[e],
|
|
@@ -768,52 +768,52 @@ const Ro = () => {
|
|
|
768
768
|
"rp-text-layer": "_rp-text-layer_usdup_1",
|
|
769
769
|
selecting: Oo,
|
|
770
770
|
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
771
|
-
},
|
|
772
|
-
const { pageNumber: e } = t, { pages: n } = J(), o = H(null), { matches: r, currentMatch: i, setCurrentMatchElement: s } =
|
|
771
|
+
}, zo = (t) => {
|
|
772
|
+
const { pageNumber: e } = t, { pages: n } = J(), o = H(null), { matches: r, currentMatch: i, setCurrentMatchElement: s } = It(), [l, d] = G(
|
|
773
773
|
[]
|
|
774
|
-
), u = H(), m = H(), P = H([]),
|
|
774
|
+
), u = H(), m = H(), P = H([]), f = W(() => r.filter((p) => p.pageIndex === e - 1), [r, e]), C = E(
|
|
775
775
|
(p, g, c = !1) => {
|
|
776
|
-
if (c && ur(p, g), !
|
|
776
|
+
if (c && ur(p, g), !f.length) {
|
|
777
777
|
P.current = [], d([]);
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
const _ = pr(
|
|
780
|
+
const _ = pr(f, p, g);
|
|
781
781
|
d(_);
|
|
782
782
|
},
|
|
783
|
-
[
|
|
784
|
-
),
|
|
785
|
-
|
|
786
|
-
if (
|
|
783
|
+
[f]
|
|
784
|
+
), b = H(), S = H(!1), w = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
785
|
+
D(() => ((() => {
|
|
786
|
+
if (b.current)
|
|
787
787
|
return;
|
|
788
|
-
|
|
789
|
-
const { signal: g } =
|
|
788
|
+
b.current = new AbortController();
|
|
789
|
+
const { signal: g } = b.current, c = () => {
|
|
790
790
|
w().forEach((v) => {
|
|
791
|
-
const
|
|
792
|
-
|
|
791
|
+
const y = v.querySelector(".endOfContent");
|
|
792
|
+
y && (v.appendChild(y), y.style.width = "", y.style.height = "", v.classList.remove(he.selecting));
|
|
793
793
|
});
|
|
794
794
|
};
|
|
795
795
|
document.addEventListener(
|
|
796
796
|
"pointerdown",
|
|
797
797
|
() => {
|
|
798
|
-
|
|
798
|
+
S.current = !0;
|
|
799
799
|
},
|
|
800
800
|
{ signal: g }
|
|
801
801
|
), document.addEventListener(
|
|
802
802
|
"pointerup",
|
|
803
803
|
() => {
|
|
804
|
-
|
|
804
|
+
S.current = !1, c();
|
|
805
805
|
},
|
|
806
806
|
{ signal: g }
|
|
807
807
|
), window.addEventListener(
|
|
808
808
|
"blur",
|
|
809
809
|
() => {
|
|
810
|
-
|
|
810
|
+
S.current = !1, c();
|
|
811
811
|
},
|
|
812
812
|
{ signal: g }
|
|
813
813
|
), document.addEventListener(
|
|
814
814
|
"keyup",
|
|
815
815
|
() => {
|
|
816
|
-
|
|
816
|
+
S.current || c();
|
|
817
817
|
},
|
|
818
818
|
{ signal: g }
|
|
819
819
|
);
|
|
@@ -829,19 +829,19 @@ const Ro = () => {
|
|
|
829
829
|
c();
|
|
830
830
|
return;
|
|
831
831
|
}
|
|
832
|
-
const
|
|
832
|
+
const y = /* @__PURE__ */ new Set();
|
|
833
833
|
for (let N = 0; N < v.rangeCount; N++) {
|
|
834
|
-
const
|
|
834
|
+
const z = v.getRangeAt(N);
|
|
835
835
|
w().forEach((k) => {
|
|
836
|
-
|
|
836
|
+
z.intersectsNode(k) && !y.has(k) && y.add(k);
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
839
|
w().forEach((N) => {
|
|
840
|
-
if (
|
|
840
|
+
if (y.has(N))
|
|
841
841
|
N.classList.add(he.selecting);
|
|
842
842
|
else {
|
|
843
|
-
const
|
|
844
|
-
|
|
843
|
+
const z = N.querySelector(".endOfContent");
|
|
844
|
+
z && (N.appendChild(z), z.style.width = "", z.style.height = "", N.classList.remove(he.selecting));
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
const R = v.getRangeAt(0);
|
|
@@ -856,19 +856,19 @@ const Ro = () => {
|
|
|
856
856
|
);
|
|
857
857
|
})(), () => {
|
|
858
858
|
var g;
|
|
859
|
-
(g =
|
|
859
|
+
(g = b.current) == null || g.abort(), b.current = void 0;
|
|
860
860
|
}), [w]);
|
|
861
|
-
const
|
|
861
|
+
const T = E(() => {
|
|
862
862
|
o.current && o.current.classList.add(he.selecting);
|
|
863
|
-
}, []),
|
|
863
|
+
}, []), h = E(() => {
|
|
864
864
|
o.current && o.current.classList.remove(he.selecting);
|
|
865
865
|
}, []);
|
|
866
|
-
return
|
|
866
|
+
return D(() => {
|
|
867
867
|
if (P.current.forEach((c) => {
|
|
868
868
|
c.classList.remove("selected");
|
|
869
869
|
}), !l.length || !i || i.pageIndex !== e - 1)
|
|
870
870
|
return;
|
|
871
|
-
const p =
|
|
871
|
+
const p = f.findIndex(
|
|
872
872
|
(c) => JSON.stringify(c) === JSON.stringify(i)
|
|
873
873
|
);
|
|
874
874
|
if (p === -1)
|
|
@@ -877,7 +877,7 @@ const Ro = () => {
|
|
|
877
877
|
g.length && (P.current = g.map((c) => c.element), s(g[0].element), g.forEach((c) => {
|
|
878
878
|
c.element.classList.add("selected");
|
|
879
879
|
}));
|
|
880
|
-
}, [i, l,
|
|
880
|
+
}, [i, l, f]), D(() => {
|
|
881
881
|
const p = n.get(e);
|
|
882
882
|
if (!p || !o.current)
|
|
883
883
|
return;
|
|
@@ -890,12 +890,12 @@ const Ro = () => {
|
|
|
890
890
|
container: g
|
|
891
891
|
}), m.current = c, g && (g.innerText = ""), u.current.render();
|
|
892
892
|
}).then(() => {
|
|
893
|
-
var
|
|
893
|
+
var y, R;
|
|
894
894
|
[].slice.call(g.children).forEach((x) => {
|
|
895
895
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
896
896
|
});
|
|
897
|
-
const _ = (
|
|
898
|
-
_ && m.current &&
|
|
897
|
+
const _ = (y = u.current) == null ? void 0 : y.textDivs;
|
|
898
|
+
_ && m.current && C(m.current, _);
|
|
899
899
|
const v = document.createElement("div");
|
|
900
900
|
v.className = "endOfContent", (R = o.current) == null || R.appendChild(v);
|
|
901
901
|
}).catch(() => {
|
|
@@ -903,56 +903,56 @@ const Ro = () => {
|
|
|
903
903
|
var c;
|
|
904
904
|
(c = u.current) == null || c.cancel();
|
|
905
905
|
};
|
|
906
|
-
}, [n, e]),
|
|
906
|
+
}, [n, e]), D(() => {
|
|
907
907
|
var c;
|
|
908
908
|
[].slice.call(o.current.children).forEach((_) => {
|
|
909
909
|
_.classList.add(he["rp-text-layer-text"]);
|
|
910
910
|
});
|
|
911
911
|
const g = (c = u.current) == null ? void 0 : c.textDivs;
|
|
912
|
-
g && m.current &&
|
|
913
|
-
}, [
|
|
912
|
+
g && m.current && C(m.current, g, !0);
|
|
913
|
+
}, [C]), /* @__PURE__ */ a(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
"data-rp": `page-${e}-textLayer`,
|
|
917
917
|
className: he["rp-text-layer"],
|
|
918
918
|
ref: o,
|
|
919
|
-
onMouseDown:
|
|
920
|
-
onMouseUp:
|
|
919
|
+
onMouseDown: T,
|
|
920
|
+
onMouseUp: h
|
|
921
921
|
}
|
|
922
922
|
);
|
|
923
|
-
},
|
|
923
|
+
}, Do = {
|
|
924
924
|
"rp-annotation-layer": "_rp-annotation-layer_1udza_1"
|
|
925
925
|
};
|
|
926
926
|
let Ao = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
927
927
|
const Fo = (t) => {
|
|
928
|
-
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = J(), i = H(), [s, l] = G(), { setFocusedPage: d, goToPage: u } = oe(), { scrollMode: m } = Ne(), { print: P } = tt(), { download:
|
|
929
|
-
|
|
928
|
+
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = J(), i = H(), [s, l] = G(), { setFocusedPage: d, goToPage: u } = oe(), { scrollMode: m } = Ne(), { print: P } = tt(), { download: f } = qn(), C = W(() => o.get(e), [o, e]), b = W(() => C == null ? void 0 : C.page.getViewport(), [C]);
|
|
929
|
+
D(() => {
|
|
930
930
|
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
931
|
-
}, [r]),
|
|
932
|
-
|
|
931
|
+
}, [r]), D(() => {
|
|
932
|
+
C && C.page.getAnnotations().then((w) => {
|
|
933
933
|
i.current = void 0, l(w), n.current && (n.current.innerText = "");
|
|
934
934
|
});
|
|
935
|
-
}, [
|
|
936
|
-
const
|
|
935
|
+
}, [C]);
|
|
936
|
+
const S = E(
|
|
937
937
|
(w) => {
|
|
938
|
-
!s || !r || (
|
|
939
|
-
var
|
|
940
|
-
((
|
|
941
|
-
}), m === ne.PAGE_SCROLLING ? Ft(w, s, r, (
|
|
938
|
+
!s || !r || (Dr(w), Ar(w, r, s).then((T) => {
|
|
939
|
+
var h, p;
|
|
940
|
+
((h = T == null ? void 0 : T.data) == null ? void 0 : h.action) === "Print" ? P() : ((p = T == null ? void 0 : T.data) == null ? void 0 : p.action) === "SaveAs" && f();
|
|
941
|
+
}), m === ne.PAGE_SCROLLING ? Ft(w, s, r, (T) => d(T.pageIndex + 1)) : Ft(w, s, r, (T) => u(T.pageIndex + 1)));
|
|
942
942
|
},
|
|
943
|
-
[r, s, u, d, m, P,
|
|
943
|
+
[r, s, u, d, m, P, f]
|
|
944
944
|
);
|
|
945
|
-
return
|
|
946
|
-
if (!
|
|
945
|
+
return D(() => {
|
|
946
|
+
if (!C || !s)
|
|
947
947
|
return;
|
|
948
|
-
const w =
|
|
948
|
+
const w = C.page.getViewport();
|
|
949
949
|
if (i.current) {
|
|
950
950
|
i.current.update({
|
|
951
951
|
viewport: w.clone({ dontFlip: !0 })
|
|
952
952
|
});
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const T = /* @__PURE__ */ new Map([]);
|
|
956
956
|
for (const g of s) {
|
|
957
957
|
const { annotationType: c } = g;
|
|
958
958
|
switch (c) {
|
|
@@ -960,11 +960,11 @@ const Fo = (t) => {
|
|
|
960
960
|
kr(g);
|
|
961
961
|
break;
|
|
962
962
|
case At.Widget:
|
|
963
|
-
Fr(g, w,
|
|
963
|
+
Fr(g, w, T);
|
|
964
964
|
break;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
const
|
|
967
|
+
const h = new AbortController();
|
|
968
968
|
return (async () => {
|
|
969
969
|
var _;
|
|
970
970
|
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new Or({
|
|
@@ -973,11 +973,11 @@ const Fo = (t) => {
|
|
|
973
973
|
annotationCanvasMap: void 0,
|
|
974
974
|
annotationEditorUIManager: void 0,
|
|
975
975
|
structTreeLayer: null,
|
|
976
|
-
page:
|
|
976
|
+
page: C.page,
|
|
977
977
|
viewport: w.clone({ dontFlip: !0 })
|
|
978
|
-
}), n.current && kt(n.current,
|
|
978
|
+
}), n.current && kt(n.current, S);
|
|
979
979
|
const g = await (r == null ? void 0 : r.hasJSActions()), c = await (r == null ? void 0 : r.getFieldObjects());
|
|
980
|
-
if (
|
|
980
|
+
if (h.signal.aborted)
|
|
981
981
|
throw "abort";
|
|
982
982
|
return (_ = i.current) == null ? void 0 : _.render({
|
|
983
983
|
annotations: s,
|
|
@@ -986,27 +986,27 @@ const Fo = (t) => {
|
|
|
986
986
|
fieldObjects: c,
|
|
987
987
|
div: n.current,
|
|
988
988
|
viewport: w.clone({ dontFlip: !0 }),
|
|
989
|
-
page:
|
|
989
|
+
page: C.page,
|
|
990
990
|
imageResourcesPath: Ao,
|
|
991
991
|
renderForms: !0,
|
|
992
|
-
linkService: new
|
|
992
|
+
linkService: new zr(),
|
|
993
993
|
downloadManager: null,
|
|
994
994
|
enableScripting: !1
|
|
995
995
|
});
|
|
996
996
|
})().then(() => {
|
|
997
|
-
n.current && Wr(n.current,
|
|
997
|
+
n.current && Wr(n.current, S);
|
|
998
998
|
}).catch((g) => {
|
|
999
999
|
if (g !== "abort")
|
|
1000
1000
|
throw g;
|
|
1001
1001
|
}), () => {
|
|
1002
|
-
|
|
1002
|
+
h.abort("clear"), n.current && kt(n.current, S);
|
|
1003
1003
|
};
|
|
1004
|
-
}, [r, s,
|
|
1004
|
+
}, [r, s, S]), /* @__PURE__ */ a(
|
|
1005
1005
|
"div",
|
|
1006
1006
|
{
|
|
1007
1007
|
"data-rp": `page-${e}-annotationLayer`,
|
|
1008
|
-
style: { width: `${
|
|
1009
|
-
className:
|
|
1008
|
+
style: { width: `${b == null ? void 0 : b.width}px`, height: `${b == null ? void 0 : b.height}px` },
|
|
1009
|
+
className: Do["rp-annotation-layer"],
|
|
1010
1010
|
ref: n
|
|
1011
1011
|
}
|
|
1012
1012
|
);
|
|
@@ -1014,9 +1014,9 @@ const Fo = (t) => {
|
|
|
1014
1014
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1015
1015
|
}, Wo = ({ pageNumber: t, viewport: e }) => {
|
|
1016
1016
|
const [n, o] = G(), { pages: r } = J(), { highlightKeywords: i } = fr(), s = !0, l = H(null), [d, u] = G(null), [m, P] = G([]);
|
|
1017
|
-
|
|
1017
|
+
D(() => {
|
|
1018
1018
|
l.current && u(l.current.parentElement);
|
|
1019
|
-
}, [l]),
|
|
1019
|
+
}, [l]), D(() => {
|
|
1020
1020
|
(async () => {
|
|
1021
1021
|
const p = r.get(t);
|
|
1022
1022
|
if (!p || !l.current)
|
|
@@ -1025,32 +1025,32 @@ const Fo = (t) => {
|
|
|
1025
1025
|
o(g);
|
|
1026
1026
|
})();
|
|
1027
1027
|
}, [r, t]);
|
|
1028
|
-
const
|
|
1028
|
+
const f = W(() => i ? i.map((h) => {
|
|
1029
1029
|
var p, g;
|
|
1030
1030
|
return {
|
|
1031
|
-
...Mr(
|
|
1032
|
-
color:
|
|
1031
|
+
...Mr(h.keyword, (p = h.options) == null ? void 0 : p.matchCase, (g = h.options) == null ? void 0 : g.wholeWords),
|
|
1032
|
+
color: h.highlightColor
|
|
1033
1033
|
};
|
|
1034
1034
|
}) : [], [i]);
|
|
1035
|
-
function
|
|
1036
|
-
if (!
|
|
1035
|
+
function C(h, p) {
|
|
1036
|
+
if (!h)
|
|
1037
1037
|
return;
|
|
1038
1038
|
const g = `[data-rp="page-${p}-textLayer"]`;
|
|
1039
1039
|
return new Promise((c) => {
|
|
1040
|
-
const _ =
|
|
1040
|
+
const _ = h.querySelector(g);
|
|
1041
1041
|
if (_) {
|
|
1042
1042
|
c(_);
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
1045
|
-
new MutationObserver((
|
|
1046
|
-
const x =
|
|
1045
|
+
new MutationObserver((y, R) => {
|
|
1046
|
+
const x = h.querySelector(g);
|
|
1047
1047
|
x && (c(x), R.disconnect());
|
|
1048
|
-
}).observe(
|
|
1048
|
+
}).observe(h, { childList: !0, subtree: !0 });
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function b(h) {
|
|
1052
1052
|
return new Promise((p) => {
|
|
1053
|
-
const g =
|
|
1053
|
+
const g = h.querySelectorAll(
|
|
1054
1054
|
'[data-rp="rp-text-layer-text"]'
|
|
1055
1055
|
);
|
|
1056
1056
|
if (g.length) {
|
|
@@ -1058,43 +1058,43 @@ const Fo = (t) => {
|
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
new MutationObserver((_, v) => {
|
|
1061
|
-
const
|
|
1061
|
+
const y = h.querySelectorAll(
|
|
1062
1062
|
".rp-text-layer-text"
|
|
1063
1063
|
);
|
|
1064
|
-
|
|
1065
|
-
}).observe(
|
|
1064
|
+
y.length && (p(Array.from(y)), v.disconnect());
|
|
1065
|
+
}).observe(h, { childList: !0, subtree: !0 });
|
|
1066
1066
|
});
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const S = (h, p, g, c) => {
|
|
1069
1069
|
var $;
|
|
1070
1070
|
const _ = document.createRange(), v = g.firstChild;
|
|
1071
1071
|
if (!v || v.nodeType !== Node.TEXT_NODE)
|
|
1072
1072
|
return null;
|
|
1073
|
-
const
|
|
1074
|
-
if (R >
|
|
1073
|
+
const y = (($ = v.textContent) == null ? void 0 : $.length) ?? 0, R = c[0].charIdxInSpan, x = c.length === 1 ? R : c[c.length - 1].charIdxInSpan;
|
|
1074
|
+
if (R > y || x + 1 > y)
|
|
1075
1075
|
return null;
|
|
1076
1076
|
_.setStart(v, R), _.setEnd(v, x + 1);
|
|
1077
1077
|
const I = document.createElement("span");
|
|
1078
1078
|
I.style.width = "auto", _.surroundContents(I);
|
|
1079
|
-
const O = I.getBoundingClientRect(), A =
|
|
1079
|
+
const O = I.getBoundingClientRect(), A = h.getBoundingClientRect(), F = A.height, L = A.width, N = 100 * (O.left - A.left) / L, z = 100 * (O.top - A.top) / F, k = 100 * O.height / F, q = 100 * O.width / L;
|
|
1080
1080
|
return $r(I), {
|
|
1081
1081
|
keywordStr: p,
|
|
1082
1082
|
left: N,
|
|
1083
|
-
top:
|
|
1083
|
+
top: z,
|
|
1084
1084
|
height: k,
|
|
1085
1085
|
width: q,
|
|
1086
1086
|
pageHeight: F,
|
|
1087
1087
|
pageWidth: L
|
|
1088
1088
|
};
|
|
1089
1089
|
};
|
|
1090
|
-
async function w(
|
|
1091
|
-
const g = await
|
|
1090
|
+
async function w(h, p) {
|
|
1091
|
+
const g = await C(d, h);
|
|
1092
1092
|
if (!g)
|
|
1093
1093
|
return;
|
|
1094
|
-
const c = await
|
|
1094
|
+
const c = await b(g);
|
|
1095
1095
|
if (c.length) {
|
|
1096
|
-
const _ = c.map((
|
|
1097
|
-
(
|
|
1096
|
+
const _ = c.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1097
|
+
(y, R, x) => y.concat(
|
|
1098
1098
|
R.split("").map((I, O) => ({
|
|
1099
1099
|
char: I,
|
|
1100
1100
|
charIdxInSpan: O,
|
|
@@ -1108,29 +1108,29 @@ const Fo = (t) => {
|
|
|
1108
1108
|
spanIdx: 0
|
|
1109
1109
|
}
|
|
1110
1110
|
]
|
|
1111
|
-
).slice(1), v =
|
|
1111
|
+
).slice(1), v = T(g, p, c, _);
|
|
1112
1112
|
P(v);
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
|
-
const
|
|
1115
|
+
const T = (h, p, g, c) => {
|
|
1116
1116
|
const _ = p.length;
|
|
1117
1117
|
if (!c.length || !_)
|
|
1118
1118
|
return [];
|
|
1119
|
-
const v = [],
|
|
1120
|
-
return
|
|
1119
|
+
const v = [], y = c.map((R) => R.char).join("");
|
|
1120
|
+
return f.forEach((R) => {
|
|
1121
1121
|
const { keyword: x, regExp: I, wholeWords: O, color: A } = R, F = x;
|
|
1122
1122
|
if (!F.trim())
|
|
1123
1123
|
return;
|
|
1124
1124
|
const L = I.flags.indexOf("g") === -1 ? new RegExp(I, `${I.flags}g`) : I;
|
|
1125
1125
|
let N;
|
|
1126
|
-
const
|
|
1127
|
-
for (; (N = L.exec(
|
|
1128
|
-
O && !hr(
|
|
1126
|
+
const z = [];
|
|
1127
|
+
for (; (N = L.exec(y)) !== null; )
|
|
1128
|
+
O && !hr(y, N.index, N[0].length) || z.push({
|
|
1129
1129
|
keyword: L,
|
|
1130
1130
|
startIndex: N.index,
|
|
1131
1131
|
endIndex: L.lastIndex
|
|
1132
1132
|
});
|
|
1133
|
-
const k =
|
|
1133
|
+
const k = z.map((q) => ({
|
|
1134
1134
|
keyword: q.keyword,
|
|
1135
1135
|
indexes: c.slice(q.startIndex, q.endIndex),
|
|
1136
1136
|
color: A
|
|
@@ -1142,8 +1142,8 @@ const Fo = (t) => {
|
|
|
1142
1142
|
);
|
|
1143
1143
|
for (const U of Object.values($))
|
|
1144
1144
|
if (U.length !== 1 || U[0].char.trim() !== "") {
|
|
1145
|
-
const V = U, K = g[V[0].spanIdx], X =
|
|
1146
|
-
|
|
1145
|
+
const V = U, K = g[V[0].spanIdx], X = S(
|
|
1146
|
+
h,
|
|
1147
1147
|
F,
|
|
1148
1148
|
K,
|
|
1149
1149
|
V
|
|
@@ -1158,7 +1158,7 @@ const Fo = (t) => {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
}), v.sort(Hr), v;
|
|
1160
1160
|
};
|
|
1161
|
-
return
|
|
1161
|
+
return D(() => {
|
|
1162
1162
|
(async () => {
|
|
1163
1163
|
if (!(!i || i.length === 0))
|
|
1164
1164
|
try {
|
|
@@ -1167,79 +1167,79 @@ const Fo = (t) => {
|
|
|
1167
1167
|
console.error(p);
|
|
1168
1168
|
}
|
|
1169
1169
|
})();
|
|
1170
|
-
}, [s, i, t, n, e]), /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((
|
|
1170
|
+
}, [s, i, t, n, e]), /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((h, p) => /* @__PURE__ */ a(
|
|
1171
1171
|
"div",
|
|
1172
1172
|
{
|
|
1173
1173
|
className: ko["rp-text-highlight"],
|
|
1174
1174
|
style: {
|
|
1175
|
-
top: `${
|
|
1176
|
-
left: `${
|
|
1177
|
-
width: `${
|
|
1178
|
-
height: `${
|
|
1179
|
-
backgroundColor:
|
|
1175
|
+
top: `${h.top}%`,
|
|
1176
|
+
left: `${h.left}%`,
|
|
1177
|
+
width: `${h.width}%`,
|
|
1178
|
+
height: `${h.height}%`,
|
|
1179
|
+
backgroundColor: h.highlightColor
|
|
1180
1180
|
}
|
|
1181
1181
|
},
|
|
1182
1182
|
p
|
|
1183
1183
|
)) }) });
|
|
1184
|
-
},
|
|
1185
|
-
const { pageNumber: n, style: o, ...r } = t, { pages: i } = J(), { pageRotate: s } = Ue(), { textLayer: l } = ar(), { currentZoom: d } = Je(), u = H(i.get(n)), [m, P] = G(!1),
|
|
1184
|
+
}, Rt = Ve((t, e) => {
|
|
1185
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: i } = J(), { pageRotate: s } = Ue(), { textLayer: l } = ar(), { currentZoom: d } = Je(), u = H(i.get(n)), [m, P] = G(!1), f = H(null), [C, b] = G({
|
|
1186
1186
|
width: 0,
|
|
1187
1187
|
height: 0
|
|
1188
1188
|
});
|
|
1189
|
-
cn(e, () =>
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1189
|
+
cn(e, () => f.current);
|
|
1190
|
+
const S = W(() => u.current ? s[n] : 0, [n, s]);
|
|
1191
|
+
D(() => {
|
|
1192
1192
|
if (i && (u.current = i.get(n), u.current)) {
|
|
1193
1193
|
const p = u.current.page.getViewport({
|
|
1194
1194
|
scale: d,
|
|
1195
|
-
rotation:
|
|
1195
|
+
rotation: S
|
|
1196
1196
|
});
|
|
1197
|
-
|
|
1197
|
+
b(p);
|
|
1198
1198
|
}
|
|
1199
|
-
}, [i, n,
|
|
1199
|
+
}, [i, n, S, d]);
|
|
1200
1200
|
const w = W(() => {
|
|
1201
|
-
switch (
|
|
1201
|
+
switch (S) {
|
|
1202
1202
|
case 90:
|
|
1203
|
-
return `${
|
|
1203
|
+
return `${C.width / 2}px ${C.width / 2}px`;
|
|
1204
1204
|
case -90:
|
|
1205
1205
|
case 270:
|
|
1206
|
-
return `${
|
|
1206
|
+
return `${C.height / 2}px ${C.height / 2}px`;
|
|
1207
1207
|
default:
|
|
1208
1208
|
return "center";
|
|
1209
1209
|
}
|
|
1210
|
-
}, [
|
|
1210
|
+
}, [S, C]), T = E(() => {
|
|
1211
1211
|
P(!0);
|
|
1212
|
-
}, []),
|
|
1212
|
+
}, []), h = E(() => {
|
|
1213
1213
|
P(!1);
|
|
1214
1214
|
}, []);
|
|
1215
1215
|
return /* @__PURE__ */ a(
|
|
1216
1216
|
"div",
|
|
1217
1217
|
{
|
|
1218
|
-
ref:
|
|
1218
|
+
ref: f,
|
|
1219
1219
|
id: `page-${n}`,
|
|
1220
1220
|
"data-rp": `page-${n}`,
|
|
1221
1221
|
...r,
|
|
1222
1222
|
style: {
|
|
1223
1223
|
...o,
|
|
1224
|
-
"--rp-rotate": `${
|
|
1224
|
+
"--rp-rotate": `${S}deg`,
|
|
1225
1225
|
"--rp-page-rotate-translate": `${w}`,
|
|
1226
1226
|
"--scale-factor": d
|
|
1227
1227
|
},
|
|
1228
|
-
className:
|
|
1228
|
+
className: lt["rp-page-wrapper"],
|
|
1229
1229
|
children: /* @__PURE__ */ M(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
style: {
|
|
1233
|
-
width: `${
|
|
1234
|
-
height: `${
|
|
1233
|
+
width: `${C.width}px`,
|
|
1234
|
+
height: `${C.height}px`
|
|
1235
1235
|
},
|
|
1236
|
-
className:
|
|
1236
|
+
className: lt["rp-page"],
|
|
1237
1237
|
children: [
|
|
1238
|
-
/* @__PURE__ */ a(No, { onLoading:
|
|
1239
|
-
m && /* @__PURE__ */ a("div", { className:
|
|
1238
|
+
/* @__PURE__ */ a(No, { onLoading: T, onLoaded: h, pageNumber: n }),
|
|
1239
|
+
m && /* @__PURE__ */ a("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ a(Ct, {}) }),
|
|
1240
1240
|
/* @__PURE__ */ a(Gr, { pageNumber: n }),
|
|
1241
|
-
l && /* @__PURE__ */ a(
|
|
1242
|
-
/* @__PURE__ */ a(Wo, { pageNumber: n, viewport:
|
|
1241
|
+
l && /* @__PURE__ */ a(zo, { pageNumber: n }),
|
|
1242
|
+
/* @__PURE__ */ a(Wo, { pageNumber: n, viewport: C }),
|
|
1243
1243
|
/* @__PURE__ */ a(Fo, { pageNumber: n })
|
|
1244
1244
|
]
|
|
1245
1245
|
}
|
|
@@ -1247,28 +1247,28 @@ const Fo = (t) => {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
);
|
|
1249
1249
|
});
|
|
1250
|
-
function
|
|
1251
|
-
return
|
|
1250
|
+
function vt() {
|
|
1251
|
+
return vt = Object.assign ? Object.assign.bind() : function(t) {
|
|
1252
1252
|
for (var e = 1; e < arguments.length; e++) {
|
|
1253
1253
|
var n = arguments[e];
|
|
1254
1254
|
for (var o in n)
|
|
1255
1255
|
({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
|
|
1256
1256
|
}
|
|
1257
1257
|
return t;
|
|
1258
|
-
},
|
|
1258
|
+
}, vt.apply(null, arguments);
|
|
1259
1259
|
}
|
|
1260
1260
|
function qt(t) {
|
|
1261
1261
|
if (t === void 0)
|
|
1262
1262
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1263
1263
|
return t;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return
|
|
1265
|
+
function wt(t, e) {
|
|
1266
|
+
return wt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
1267
1267
|
return n.__proto__ = o, n;
|
|
1268
|
-
},
|
|
1268
|
+
}, wt(t, e);
|
|
1269
1269
|
}
|
|
1270
1270
|
function Mo(t, e) {
|
|
1271
|
-
t.prototype = Object.create(e.prototype), t.prototype.constructor = t,
|
|
1271
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, wt(t, e);
|
|
1272
1272
|
}
|
|
1273
1273
|
var Ut = Number.isNaN || function(e) {
|
|
1274
1274
|
return typeof e == "number" && e !== e;
|
|
@@ -1284,7 +1284,7 @@ function $o(t, e) {
|
|
|
1284
1284
|
return !1;
|
|
1285
1285
|
return !0;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function dt(t, e) {
|
|
1288
1288
|
e === void 0 && (e = $o);
|
|
1289
1289
|
var n, o = [], r, i = !1;
|
|
1290
1290
|
function s() {
|
|
@@ -1324,23 +1324,23 @@ function qo(t, e) {
|
|
|
1324
1324
|
};
|
|
1325
1325
|
return r;
|
|
1326
1326
|
}
|
|
1327
|
-
var
|
|
1327
|
+
var ut = -1;
|
|
1328
1328
|
function Uo(t) {
|
|
1329
|
-
if (t === void 0 && (t = !1),
|
|
1329
|
+
if (t === void 0 && (t = !1), ut === -1 || t) {
|
|
1330
1330
|
var e = document.createElement("div"), n = e.style;
|
|
1331
|
-
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(e),
|
|
1331
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(e), ut = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
1332
1332
|
}
|
|
1333
|
-
return
|
|
1333
|
+
return ut;
|
|
1334
1334
|
}
|
|
1335
|
-
var
|
|
1335
|
+
var ze = null;
|
|
1336
1336
|
function jt(t) {
|
|
1337
|
-
if (t === void 0 && (t = !1),
|
|
1337
|
+
if (t === void 0 && (t = !1), ze === null || t) {
|
|
1338
1338
|
var e = document.createElement("div"), n = e.style;
|
|
1339
1339
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1340
1340
|
var o = document.createElement("div"), r = o.style;
|
|
1341
|
-
return r.width = "100px", r.height = "100px", e.appendChild(o), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1341
|
+
return r.width = "100px", r.height = "100px", e.appendChild(o), document.body.appendChild(e), e.scrollLeft > 0 ? ze = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? ze = "negative" : ze = "positive-ascending"), document.body.removeChild(e), ze;
|
|
1342
1342
|
}
|
|
1343
|
-
return
|
|
1343
|
+
return ze;
|
|
1344
1344
|
}
|
|
1345
1345
|
var Vo = 150, Bo = function(e) {
|
|
1346
1346
|
var n = e.columnIndex;
|
|
@@ -1350,12 +1350,12 @@ var Vo = 150, Bo = function(e) {
|
|
|
1350
1350
|
}, je = null, Ke = null, Xe = null;
|
|
1351
1351
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet(), Xe = /* @__PURE__ */ new WeakSet());
|
|
1352
1352
|
function Zo(t) {
|
|
1353
|
-
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, s = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, u = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset,
|
|
1354
|
-
return e = /* @__PURE__ */ function(
|
|
1355
|
-
Mo(
|
|
1356
|
-
function
|
|
1353
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, s = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, u = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, f = t.getRowStartIndexForOffset, C = t.getRowStopIndexForStartIndex, b = t.initInstanceProps, S = t.shouldResetStyleCacheOnItemSizeChange, w = t.validateProps;
|
|
1354
|
+
return e = /* @__PURE__ */ function(T) {
|
|
1355
|
+
Mo(h, T);
|
|
1356
|
+
function h(g) {
|
|
1357
1357
|
var c;
|
|
1358
|
-
return c =
|
|
1358
|
+
return c = T.call(this, g) || this, c._instanceProps = b(c.props, qt(c)), c._resetIsScrollingTimeoutId = null, c._outerRef = void 0, c.state = {
|
|
1359
1359
|
instance: qt(c),
|
|
1360
1360
|
isScrolling: !1,
|
|
1361
1361
|
horizontalScrollDirection: "forward",
|
|
@@ -1363,27 +1363,27 @@ function Zo(t) {
|
|
|
1363
1363
|
scrollTop: typeof c.props.initialScrollTop == "number" ? c.props.initialScrollTop : 0,
|
|
1364
1364
|
scrollUpdateWasRequested: !1,
|
|
1365
1365
|
verticalScrollDirection: "forward"
|
|
1366
|
-
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered =
|
|
1366
|
+
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = dt(function(_, v, y, R, x, I, O, A) {
|
|
1367
1367
|
return c.props.onItemsRendered({
|
|
1368
1368
|
overscanColumnStartIndex: _,
|
|
1369
1369
|
overscanColumnStopIndex: v,
|
|
1370
|
-
overscanRowStartIndex:
|
|
1370
|
+
overscanRowStartIndex: y,
|
|
1371
1371
|
overscanRowStopIndex: R,
|
|
1372
1372
|
visibleColumnStartIndex: x,
|
|
1373
1373
|
visibleColumnStopIndex: I,
|
|
1374
1374
|
visibleRowStartIndex: O,
|
|
1375
1375
|
visibleRowStopIndex: A
|
|
1376
1376
|
});
|
|
1377
|
-
}), c._callOnScroll = void 0, c._callOnScroll =
|
|
1377
|
+
}), c._callOnScroll = void 0, c._callOnScroll = dt(function(_, v, y, R, x) {
|
|
1378
1378
|
return c.props.onScroll({
|
|
1379
|
-
horizontalScrollDirection:
|
|
1379
|
+
horizontalScrollDirection: y,
|
|
1380
1380
|
scrollLeft: _,
|
|
1381
1381
|
scrollTop: v,
|
|
1382
1382
|
verticalScrollDirection: R,
|
|
1383
1383
|
scrollUpdateWasRequested: x
|
|
1384
1384
|
});
|
|
1385
1385
|
}), c._getItemStyle = void 0, c._getItemStyle = function(_, v) {
|
|
1386
|
-
var
|
|
1386
|
+
var y = c.props, R = y.columnWidth, x = y.direction, I = y.rowHeight, O = c._getItemStyleCache(S && R, S && x, S && I), A = _ + ":" + v, F;
|
|
1387
1387
|
if (O.hasOwnProperty(A))
|
|
1388
1388
|
F = O[A];
|
|
1389
1389
|
else {
|
|
@@ -1398,10 +1398,10 @@ function Zo(t) {
|
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
return F;
|
|
1401
|
-
}, c._getItemStyleCache = void 0, c._getItemStyleCache =
|
|
1401
|
+
}, c._getItemStyleCache = void 0, c._getItemStyleCache = dt(function(_, v, y) {
|
|
1402
1402
|
return {};
|
|
1403
1403
|
}), c._onScroll = function(_) {
|
|
1404
|
-
var v = _.currentTarget,
|
|
1404
|
+
var v = _.currentTarget, y = v.clientHeight, R = v.clientWidth, x = v.scrollLeft, I = v.scrollTop, O = v.scrollHeight, A = v.scrollWidth;
|
|
1405
1405
|
c.setState(function(F) {
|
|
1406
1406
|
if (F.scrollLeft === x && F.scrollTop === I)
|
|
1407
1407
|
return null;
|
|
@@ -1416,12 +1416,12 @@ function Zo(t) {
|
|
|
1416
1416
|
break;
|
|
1417
1417
|
}
|
|
1418
1418
|
N = Math.max(0, Math.min(N, A - R));
|
|
1419
|
-
var
|
|
1419
|
+
var z = Math.max(0, Math.min(I, O - y));
|
|
1420
1420
|
return {
|
|
1421
1421
|
isScrolling: !0,
|
|
1422
1422
|
horizontalScrollDirection: F.scrollLeft < x ? "forward" : "backward",
|
|
1423
1423
|
scrollLeft: N,
|
|
1424
|
-
scrollTop:
|
|
1424
|
+
scrollTop: z,
|
|
1425
1425
|
verticalScrollDirection: F.scrollTop < I ? "forward" : "backward",
|
|
1426
1426
|
scrollUpdateWasRequested: !1
|
|
1427
1427
|
};
|
|
@@ -1439,38 +1439,38 @@ function Zo(t) {
|
|
|
1439
1439
|
});
|
|
1440
1440
|
}, c;
|
|
1441
1441
|
}
|
|
1442
|
-
|
|
1442
|
+
h.getDerivedStateFromProps = function(c, _) {
|
|
1443
1443
|
return jo(c, _), w(c), null;
|
|
1444
1444
|
};
|
|
1445
|
-
var p =
|
|
1445
|
+
var p = h.prototype;
|
|
1446
1446
|
return p.scrollTo = function(c) {
|
|
1447
1447
|
var _ = c.scrollLeft, v = c.scrollTop;
|
|
1448
|
-
_ !== void 0 && (_ = Math.max(0, _)), v !== void 0 && (v = Math.max(0, v)), this.setState(function(
|
|
1449
|
-
return _ === void 0 && (_ =
|
|
1450
|
-
horizontalScrollDirection:
|
|
1448
|
+
_ !== void 0 && (_ = Math.max(0, _)), v !== void 0 && (v = Math.max(0, v)), this.setState(function(y) {
|
|
1449
|
+
return _ === void 0 && (_ = y.scrollLeft), v === void 0 && (v = y.scrollTop), y.scrollLeft === _ && y.scrollTop === v ? null : {
|
|
1450
|
+
horizontalScrollDirection: y.scrollLeft < _ ? "forward" : "backward",
|
|
1451
1451
|
scrollLeft: _,
|
|
1452
1452
|
scrollTop: v,
|
|
1453
1453
|
scrollUpdateWasRequested: !0,
|
|
1454
|
-
verticalScrollDirection:
|
|
1454
|
+
verticalScrollDirection: y.scrollTop < v ? "forward" : "backward"
|
|
1455
1455
|
};
|
|
1456
1456
|
}, this._resetIsScrollingDebounced);
|
|
1457
1457
|
}, p.scrollToItem = function(c) {
|
|
1458
|
-
var _ = c.align, v = _ === void 0 ? "auto" : _,
|
|
1459
|
-
|
|
1458
|
+
var _ = c.align, v = _ === void 0 ? "auto" : _, y = c.columnIndex, R = c.rowIndex, x = this.props, I = x.columnCount, O = x.height, A = x.rowCount, F = x.width, L = this.state, N = L.scrollLeft, z = L.scrollTop, k = Uo();
|
|
1459
|
+
y !== void 0 && (y = Math.max(0, Math.min(y, I - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, A - 1)));
|
|
1460
1460
|
var q = s(this.props, this._instanceProps), $ = l(this.props, this._instanceProps), U = $ > F ? k : 0, V = q > O ? k : 0;
|
|
1461
1461
|
this.scrollTo({
|
|
1462
|
-
scrollLeft:
|
|
1463
|
-
scrollTop: R !== void 0 ? u(this.props, R, v,
|
|
1462
|
+
scrollLeft: y !== void 0 ? d(this.props, y, v, N, this._instanceProps, V) : N,
|
|
1463
|
+
scrollTop: R !== void 0 ? u(this.props, R, v, z, this._instanceProps, U) : z
|
|
1464
1464
|
});
|
|
1465
1465
|
}, p.componentDidMount = function() {
|
|
1466
1466
|
var c = this.props, _ = c.initialScrollLeft, v = c.initialScrollTop;
|
|
1467
1467
|
if (this._outerRef != null) {
|
|
1468
|
-
var
|
|
1469
|
-
typeof _ == "number" && (
|
|
1468
|
+
var y = this._outerRef;
|
|
1469
|
+
typeof _ == "number" && (y.scrollLeft = _), typeof v == "number" && (y.scrollTop = v);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._callPropsCallbacks();
|
|
1472
1472
|
}, p.componentDidUpdate = function() {
|
|
1473
|
-
var c = this.props.direction, _ = this.state, v = _.scrollLeft,
|
|
1473
|
+
var c = this.props.direction, _ = this.state, v = _.scrollLeft, y = _.scrollTop, R = _.scrollUpdateWasRequested;
|
|
1474
1474
|
if (R && this._outerRef != null) {
|
|
1475
1475
|
var x = this._outerRef;
|
|
1476
1476
|
if (c === "rtl")
|
|
@@ -1488,14 +1488,14 @@ function Zo(t) {
|
|
|
1488
1488
|
}
|
|
1489
1489
|
else
|
|
1490
1490
|
x.scrollLeft = Math.max(0, v);
|
|
1491
|
-
x.scrollTop = Math.max(0,
|
|
1491
|
+
x.scrollTop = Math.max(0, y);
|
|
1492
1492
|
}
|
|
1493
1493
|
this._callPropsCallbacks();
|
|
1494
1494
|
}, p.componentWillUnmount = function() {
|
|
1495
1495
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1496
1496
|
}, p.render = function() {
|
|
1497
|
-
var c = this.props, _ = c.children, v = c.className,
|
|
1498
|
-
if (
|
|
1497
|
+
var c = this.props, _ = c.children, v = c.className, y = c.columnCount, R = c.direction, x = c.height, I = c.innerRef, O = c.innerElementType, A = c.innerTagName, F = c.itemData, L = c.itemKey, N = L === void 0 ? Bo : L, z = c.outerElementType, k = c.outerTagName, q = c.rowCount, $ = c.style, U = c.useIsScrolling, V = c.width, K = this.state.isScrolling, X = this._getHorizontalRangeToRender(), Q = X[0], le = X[1], de = this._getVerticalRangeToRender(), ee = de[0], Fe = de[1], we = [];
|
|
1498
|
+
if (y > 0 && q)
|
|
1499
1499
|
for (var Te = ee; Te <= Fe; Te++)
|
|
1500
1500
|
for (var _e = Q; _e <= le; _e++)
|
|
1501
1501
|
we.push(Ze(_, {
|
|
@@ -1510,12 +1510,12 @@ function Zo(t) {
|
|
|
1510
1510
|
rowIndex: Te,
|
|
1511
1511
|
style: this._getItemStyle(Te, _e)
|
|
1512
1512
|
}));
|
|
1513
|
-
var
|
|
1514
|
-
return Ze(
|
|
1513
|
+
var nt = s(this.props, this._instanceProps), rt = l(this.props, this._instanceProps);
|
|
1514
|
+
return Ze(z || k || "div", {
|
|
1515
1515
|
className: v,
|
|
1516
1516
|
onScroll: this._onScroll,
|
|
1517
1517
|
ref: this._outerRefSetter,
|
|
1518
|
-
style:
|
|
1518
|
+
style: vt({
|
|
1519
1519
|
position: "relative",
|
|
1520
1520
|
height: x,
|
|
1521
1521
|
width: V,
|
|
@@ -1528,34 +1528,34 @@ function Zo(t) {
|
|
|
1528
1528
|
children: we,
|
|
1529
1529
|
ref: I,
|
|
1530
1530
|
style: {
|
|
1531
|
-
height:
|
|
1531
|
+
height: nt,
|
|
1532
1532
|
pointerEvents: K ? "none" : void 0,
|
|
1533
|
-
width:
|
|
1533
|
+
width: rt
|
|
1534
1534
|
}
|
|
1535
1535
|
}));
|
|
1536
1536
|
}, p._callPropsCallbacks = function() {
|
|
1537
|
-
var c = this.props, _ = c.columnCount, v = c.onItemsRendered,
|
|
1537
|
+
var c = this.props, _ = c.columnCount, v = c.onItemsRendered, y = c.onScroll, R = c.rowCount;
|
|
1538
1538
|
if (typeof v == "function" && _ > 0 && R > 0) {
|
|
1539
|
-
var x = this._getHorizontalRangeToRender(), I = x[0], O = x[1], A = x[2], F = x[3], L = this._getVerticalRangeToRender(), N = L[0],
|
|
1540
|
-
this._callOnItemsRendered(I, O, N,
|
|
1539
|
+
var x = this._getHorizontalRangeToRender(), I = x[0], O = x[1], A = x[2], F = x[3], L = this._getVerticalRangeToRender(), N = L[0], z = L[1], k = L[2], q = L[3];
|
|
1540
|
+
this._callOnItemsRendered(I, O, N, z, A, F, k, q);
|
|
1541
1541
|
}
|
|
1542
|
-
if (typeof
|
|
1542
|
+
if (typeof y == "function") {
|
|
1543
1543
|
var $ = this.state, U = $.horizontalScrollDirection, V = $.scrollLeft, K = $.scrollTop, X = $.scrollUpdateWasRequested, Q = $.verticalScrollDirection;
|
|
1544
1544
|
this._callOnScroll(V, K, U, Q, X);
|
|
1545
1545
|
}
|
|
1546
1546
|
}, p._getHorizontalRangeToRender = function() {
|
|
1547
|
-
var c = this.props, _ = c.columnCount, v = c.overscanColumnCount,
|
|
1547
|
+
var c = this.props, _ = c.columnCount, v = c.overscanColumnCount, y = c.overscanColumnsCount, R = c.overscanCount, x = c.rowCount, I = this.state, O = I.horizontalScrollDirection, A = I.isScrolling, F = I.scrollLeft, L = v || y || R || 1;
|
|
1548
1548
|
if (_ === 0 || x === 0)
|
|
1549
1549
|
return [0, 0, 0, 0];
|
|
1550
|
-
var N = o(this.props, F, this._instanceProps),
|
|
1551
|
-
return [Math.max(0, N - k), Math.max(0, Math.min(_ - 1,
|
|
1550
|
+
var N = o(this.props, F, this._instanceProps), z = r(this.props, N, F, this._instanceProps), k = !A || O === "backward" ? Math.max(1, L) : 1, q = !A || O === "forward" ? Math.max(1, L) : 1;
|
|
1551
|
+
return [Math.max(0, N - k), Math.max(0, Math.min(_ - 1, z + q)), N, z];
|
|
1552
1552
|
}, p._getVerticalRangeToRender = function() {
|
|
1553
|
-
var c = this.props, _ = c.columnCount, v = c.overscanCount,
|
|
1553
|
+
var c = this.props, _ = c.columnCount, v = c.overscanCount, y = c.overscanRowCount, R = c.overscanRowsCount, x = c.rowCount, I = this.state, O = I.isScrolling, A = I.verticalScrollDirection, F = I.scrollTop, L = y || R || v || 1;
|
|
1554
1554
|
if (_ === 0 || x === 0)
|
|
1555
1555
|
return [0, 0, 0, 0];
|
|
1556
|
-
var N =
|
|
1557
|
-
return [Math.max(0, N - k), Math.max(0, Math.min(x - 1,
|
|
1558
|
-
},
|
|
1556
|
+
var N = f(this.props, F, this._instanceProps), z = C(this.props, N, F, this._instanceProps), k = !O || A === "backward" ? Math.max(1, L) : 1, q = !O || A === "forward" ? Math.max(1, L) : 1;
|
|
1557
|
+
return [Math.max(0, N - k), Math.max(0, Math.min(x - 1, z + q)), N, z];
|
|
1558
|
+
}, h;
|
|
1559
1559
|
}(tr), e.defaultProps = {
|
|
1560
1560
|
direction: "ltr",
|
|
1561
1561
|
itemData: void 0,
|
|
@@ -1563,9 +1563,9 @@ function Zo(t) {
|
|
|
1563
1563
|
}, e;
|
|
1564
1564
|
}
|
|
1565
1565
|
var jo = function(e, n) {
|
|
1566
|
-
var o = e.children, r = e.direction, i = e.height, s = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, u = e.overscanCount, m = e.overscanRowsCount, P = e.width,
|
|
1566
|
+
var o = e.children, r = e.direction, i = e.height, s = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, u = e.overscanCount, m = e.overscanRowsCount, P = e.width, f = n.instance;
|
|
1567
1567
|
if (process.env.NODE_ENV !== "production") {
|
|
1568
|
-
if (typeof u == "number" && je && !je.has(
|
|
1568
|
+
if (typeof u == "number" && je && !je.has(f) && (je.add(f), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Ke && !Ke.has(f) && (Ke.add(f), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (s != null || l != null) && Xe && !Xe.has(f) && (Xe.add(f), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1569
1569
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1570
1570
|
switch (r) {
|
|
1571
1571
|
case "ltr":
|
|
@@ -1631,17 +1631,17 @@ var jo = function(e, n) {
|
|
|
1631
1631
|
r += l, l *= 2;
|
|
1632
1632
|
return In(e, n, o, Math.min(r, s - 1), Math.floor(r / 2), i);
|
|
1633
1633
|
}, Qt = function(e, n, o, r, i, s, l) {
|
|
1634
|
-
var d = e === "column" ? n.width : n.height, u = fe(e, n, o, s), m = e === "column" ? xn(n, s) : Sn(n, s), P = Math.max(0, Math.min(m - d, u.offset)),
|
|
1635
|
-
switch (r === "smart" && (i >=
|
|
1634
|
+
var d = e === "column" ? n.width : n.height, u = fe(e, n, o, s), m = e === "column" ? xn(n, s) : Sn(n, s), P = Math.max(0, Math.min(m - d, u.offset)), f = Math.max(0, u.offset - d + l + u.size);
|
|
1635
|
+
switch (r === "smart" && (i >= f - d && i <= P + d ? r = "auto" : r = "center"), r) {
|
|
1636
1636
|
case "start":
|
|
1637
1637
|
return P;
|
|
1638
1638
|
case "end":
|
|
1639
|
-
return
|
|
1639
|
+
return f;
|
|
1640
1640
|
case "center":
|
|
1641
|
-
return Math.round(
|
|
1641
|
+
return Math.round(f + (P - f) / 2);
|
|
1642
1642
|
case "auto":
|
|
1643
1643
|
default:
|
|
1644
|
-
return i >=
|
|
1644
|
+
return i >= f && i <= P ? i : f > P || i < f ? f : P;
|
|
1645
1645
|
}
|
|
1646
1646
|
}, Xo = /* @__PURE__ */ Zo({
|
|
1647
1647
|
getColumnOffset: function(e, n, o) {
|
|
@@ -1731,29 +1731,29 @@ function Jo(t, e) {
|
|
|
1731
1731
|
return !Yt(n, r) && !Yt(o, i);
|
|
1732
1732
|
}
|
|
1733
1733
|
const ei = () => {
|
|
1734
|
-
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(), i = W(() => r.heights.length, [r.heights]), s = W(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Le.DUAL_PAGE ? 2 : 1, [t, e, e, i, o]), l = W(() => r.widths.reduce((
|
|
1735
|
-
const
|
|
1736
|
-
return (!
|
|
1734
|
+
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(), i = W(() => r.heights.length, [r.heights]), s = W(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Le.DUAL_PAGE ? 2 : 1, [t, e, e, i, o]), l = W(() => r.widths.reduce((b, S, w) => {
|
|
1735
|
+
const T = w % s;
|
|
1736
|
+
return (!b[T] || S > b[T]) && (b[T] = S), b;
|
|
1737
1737
|
}, []), [r.widths, s]), d = E(
|
|
1738
|
-
(
|
|
1739
|
-
const
|
|
1740
|
-
return l[
|
|
1738
|
+
(C) => {
|
|
1739
|
+
const b = C % l.length;
|
|
1740
|
+
return l[b] || 0;
|
|
1741
1741
|
},
|
|
1742
1742
|
[l]
|
|
1743
1743
|
), u = E(
|
|
1744
|
-
(
|
|
1745
|
-
const
|
|
1746
|
-
const
|
|
1747
|
-
return r.heights[
|
|
1744
|
+
(C) => {
|
|
1745
|
+
const b = Array.from({ length: s }, (S, w) => {
|
|
1746
|
+
const T = C * s + w;
|
|
1747
|
+
return r.heights[T] || 0;
|
|
1748
1748
|
});
|
|
1749
|
-
return Math.max(...
|
|
1749
|
+
return Math.max(...b);
|
|
1750
1750
|
},
|
|
1751
1751
|
[r.heights, s]
|
|
1752
1752
|
);
|
|
1753
|
-
|
|
1753
|
+
D(() => {
|
|
1754
1754
|
n(s);
|
|
1755
1755
|
}, [s, n]);
|
|
1756
|
-
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / s), [s, i, e]), P = W(() => r.heights.reduce((
|
|
1756
|
+
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / s), [s, i, e]), P = W(() => r.heights.reduce((C, b) => C + b, 0) / r.heights.length || 0, [r]), f = W(() => r.widths.reduce((C, b) => C + b, 0) / r.heights.length || 0, [r]);
|
|
1757
1757
|
return {
|
|
1758
1758
|
rowCount: m,
|
|
1759
1759
|
rowHeight: u,
|
|
@@ -1761,22 +1761,22 @@ const ei = () => {
|
|
|
1761
1761
|
columnWidth: d,
|
|
1762
1762
|
pageDimension: r,
|
|
1763
1763
|
estimatedRowHeight: P,
|
|
1764
|
-
estimatedColumnWidth:
|
|
1764
|
+
estimatedColumnWidth: f
|
|
1765
1765
|
};
|
|
1766
1766
|
};
|
|
1767
1767
|
let ae;
|
|
1768
1768
|
typeof window < "u" ? ae = window : typeof self < "u" ? ae = self : ae = global;
|
|
1769
|
-
let
|
|
1770
|
-
const Jt = 20,
|
|
1771
|
-
|
|
1769
|
+
let _t = null, bt = null;
|
|
1770
|
+
const Jt = 20, pt = ae.clearTimeout, en = ae.setTimeout, ht = ae.cancelAnimationFrame || ae.mozCancelAnimationFrame || ae.webkitCancelAnimationFrame, tn = ae.requestAnimationFrame || ae.mozRequestAnimationFrame || ae.webkitRequestAnimationFrame;
|
|
1771
|
+
ht == null || tn == null ? (_t = pt, bt = function(e) {
|
|
1772
1772
|
return en(e, Jt);
|
|
1773
|
-
}) : (
|
|
1774
|
-
|
|
1775
|
-
},
|
|
1773
|
+
}) : (_t = function([e, n]) {
|
|
1774
|
+
ht(e), pt(n);
|
|
1775
|
+
}, bt = function(e) {
|
|
1776
1776
|
const n = tn(function() {
|
|
1777
|
-
|
|
1777
|
+
pt(o), e();
|
|
1778
1778
|
}), o = en(function() {
|
|
1779
|
-
|
|
1779
|
+
ht(n), e();
|
|
1780
1780
|
}, Jt);
|
|
1781
1781
|
return [n, o];
|
|
1782
1782
|
});
|
|
@@ -1784,68 +1784,68 @@ function ti(t) {
|
|
|
1784
1784
|
let e, n, o, r, i, s, l;
|
|
1785
1785
|
const d = typeof document < "u" && document.attachEvent;
|
|
1786
1786
|
if (!d) {
|
|
1787
|
-
s = function(
|
|
1788
|
-
const
|
|
1787
|
+
s = function(T) {
|
|
1788
|
+
const h = T.__resizeTriggers__, p = h.firstElementChild, g = h.lastElementChild, c = p.firstElementChild;
|
|
1789
1789
|
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, c.style.width = p.offsetWidth + 1 + "px", c.style.height = p.offsetHeight + 1 + "px", p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight;
|
|
1790
|
-
}, i = function(
|
|
1791
|
-
return
|
|
1792
|
-
}, l = function(
|
|
1793
|
-
if (
|
|
1790
|
+
}, i = function(T) {
|
|
1791
|
+
return T.offsetWidth !== T.__resizeLast__.width || T.offsetHeight !== T.__resizeLast__.height;
|
|
1792
|
+
}, l = function(T) {
|
|
1793
|
+
if (T.target.className && typeof T.target.className.indexOf == "function" && T.target.className.indexOf("contract-trigger") < 0 && T.target.className.indexOf("expand-trigger") < 0)
|
|
1794
1794
|
return;
|
|
1795
|
-
const
|
|
1796
|
-
s(this), this.__resizeRAF__ &&
|
|
1797
|
-
i(
|
|
1798
|
-
c.call(
|
|
1795
|
+
const h = this;
|
|
1796
|
+
s(this), this.__resizeRAF__ && _t(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
|
|
1797
|
+
i(h) && (h.__resizeLast__.width = h.offsetWidth, h.__resizeLast__.height = h.offsetHeight, h.__resizeListeners__.forEach(function(c) {
|
|
1798
|
+
c.call(h, T);
|
|
1799
1799
|
}));
|
|
1800
1800
|
});
|
|
1801
1801
|
};
|
|
1802
|
-
let
|
|
1802
|
+
let f = !1, C = "";
|
|
1803
1803
|
o = "animationstart";
|
|
1804
|
-
const
|
|
1805
|
-
let
|
|
1804
|
+
const b = "Webkit Moz O ms".split(" ");
|
|
1805
|
+
let S = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), w = "";
|
|
1806
1806
|
{
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
for (let
|
|
1810
|
-
if (
|
|
1811
|
-
w =
|
|
1807
|
+
const T = document.createElement("fakeelement");
|
|
1808
|
+
if (T.style.animationName !== void 0 && (f = !0), f === !1) {
|
|
1809
|
+
for (let h = 0; h < b.length; h++)
|
|
1810
|
+
if (T.style[b[h] + "AnimationName"] !== void 0) {
|
|
1811
|
+
w = b[h], C = "-" + w.toLowerCase() + "-", o = S[h], f = !0;
|
|
1812
1812
|
break;
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
n = "resizeanim", e = "@" +
|
|
1816
|
+
n = "resizeanim", e = "@" + C + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = C + "animation: 1ms " + n + "; ";
|
|
1817
1817
|
}
|
|
1818
|
-
const u = function(
|
|
1819
|
-
if (!
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1818
|
+
const u = function(f) {
|
|
1819
|
+
if (!f.getElementById("detectElementResize")) {
|
|
1820
|
+
const C = (e || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', b = f.head || f.getElementsByTagName("head")[0], S = f.createElement("style");
|
|
1821
|
+
S.id = "detectElementResize", S.type = "text/css", t != null && S.setAttribute("nonce", t), S.styleSheet ? S.styleSheet.cssText = C : S.appendChild(f.createTextNode(C)), b.appendChild(S);
|
|
1822
1822
|
}
|
|
1823
1823
|
};
|
|
1824
1824
|
return {
|
|
1825
|
-
addResizeListener: function(
|
|
1825
|
+
addResizeListener: function(f, C) {
|
|
1826
1826
|
if (d)
|
|
1827
|
-
|
|
1827
|
+
f.attachEvent("onresize", C);
|
|
1828
1828
|
else {
|
|
1829
|
-
if (!
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
const w =
|
|
1833
|
-
w.className = "expand-trigger", w.appendChild(
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
p.animationName === n && s(
|
|
1837
|
-
},
|
|
1829
|
+
if (!f.__resizeTriggers__) {
|
|
1830
|
+
const b = f.ownerDocument, S = ae.getComputedStyle(f);
|
|
1831
|
+
S && S.position === "static" && (f.style.position = "relative"), u(b), f.__resizeLast__ = {}, f.__resizeListeners__ = [], (f.__resizeTriggers__ = b.createElement("div")).className = "resize-triggers";
|
|
1832
|
+
const w = b.createElement("div");
|
|
1833
|
+
w.className = "expand-trigger", w.appendChild(b.createElement("div"));
|
|
1834
|
+
const T = b.createElement("div");
|
|
1835
|
+
T.className = "contract-trigger", f.__resizeTriggers__.appendChild(w), f.__resizeTriggers__.appendChild(T), f.appendChild(f.__resizeTriggers__), s(f), f.addEventListener("scroll", l, !0), o && (f.__resizeTriggers__.__animationListener__ = function(p) {
|
|
1836
|
+
p.animationName === n && s(f);
|
|
1837
|
+
}, f.__resizeTriggers__.addEventListener(o, f.__resizeTriggers__.__animationListener__));
|
|
1838
1838
|
}
|
|
1839
|
-
|
|
1839
|
+
f.__resizeListeners__.push(C);
|
|
1840
1840
|
}
|
|
1841
1841
|
},
|
|
1842
|
-
removeResizeListener: function(
|
|
1842
|
+
removeResizeListener: function(f, C) {
|
|
1843
1843
|
if (d)
|
|
1844
|
-
|
|
1845
|
-
else if (
|
|
1846
|
-
|
|
1844
|
+
f.detachEvent("onresize", C);
|
|
1845
|
+
else if (f.__resizeListeners__.splice(f.__resizeListeners__.indexOf(C), 1), !f.__resizeListeners__.length) {
|
|
1846
|
+
f.removeEventListener("scroll", l, !0), f.__resizeTriggers__.__animationListener__ && (f.__resizeTriggers__.removeEventListener(o, f.__resizeTriggers__.__animationListener__), f.__resizeTriggers__.__animationListener__ = null);
|
|
1847
1847
|
try {
|
|
1848
|
-
|
|
1848
|
+
f.__resizeTriggers__ = !f.removeChild(f.__resizeTriggers__);
|
|
1849
1849
|
} catch {
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
@@ -1856,8 +1856,10 @@ class ni extends nr {
|
|
|
1856
1856
|
constructor(...e) {
|
|
1857
1857
|
super(...e), this.state = {
|
|
1858
1858
|
height: this.props.defaultHeight || 0,
|
|
1859
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
1860
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
1859
1861
|
width: this.props.defaultWidth || 0
|
|
1860
|
-
}, this._autoSizer = null, this._detectElementResize = null, this.
|
|
1862
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
1861
1863
|
this._timeoutId = null;
|
|
1862
1864
|
const {
|
|
1863
1865
|
disableHeight: n,
|
|
@@ -1865,27 +1867,18 @@ class ni extends nr {
|
|
|
1865
1867
|
onResize: r
|
|
1866
1868
|
} = this.props;
|
|
1867
1869
|
if (this._parentNode) {
|
|
1868
|
-
const i = window.getComputedStyle(this._parentNode) || {}, s = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), u = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - u,
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
// TODO Remove these params in the next major release
|
|
1881
|
-
get scaledHeight() {
|
|
1882
|
-
return b(), P;
|
|
1883
|
-
},
|
|
1884
|
-
get scaledWidth() {
|
|
1885
|
-
return b(), h;
|
|
1886
|
-
}
|
|
1887
|
-
});
|
|
1888
|
-
}
|
|
1870
|
+
const i = window.getComputedStyle(this._parentNode) || {}, s = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), u = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - u, f = m.width - s - l, C = this._parentNode.offsetHeight - d - u, b = this._parentNode.offsetWidth - s - l;
|
|
1871
|
+
(!n && (this.state.height !== C || this.state.scaledHeight !== P) || !o && (this.state.width !== b || this.state.scaledWidth !== f)) && (this.setState({
|
|
1872
|
+
height: C,
|
|
1873
|
+
width: b,
|
|
1874
|
+
scaledHeight: P,
|
|
1875
|
+
scaledWidth: f
|
|
1876
|
+
}), typeof r == "function" && r({
|
|
1877
|
+
height: C,
|
|
1878
|
+
scaledHeight: P,
|
|
1879
|
+
scaledWidth: f,
|
|
1880
|
+
width: b
|
|
1881
|
+
}));
|
|
1889
1882
|
}
|
|
1890
1883
|
}, this._setRef = (n) => {
|
|
1891
1884
|
this._autoSizer = n;
|
|
@@ -1920,20 +1913,22 @@ class ni extends nr {
|
|
|
1920
1913
|
tagName: m = "div",
|
|
1921
1914
|
...P
|
|
1922
1915
|
} = this.props, {
|
|
1923
|
-
height:
|
|
1924
|
-
|
|
1925
|
-
|
|
1916
|
+
height: f,
|
|
1917
|
+
scaledHeight: C,
|
|
1918
|
+
scaledWidth: b,
|
|
1919
|
+
width: S
|
|
1920
|
+
} = this.state, w = {
|
|
1926
1921
|
overflow: "visible"
|
|
1927
|
-
},
|
|
1928
|
-
let
|
|
1929
|
-
return r || (
|
|
1922
|
+
}, T = {};
|
|
1923
|
+
let h = !1;
|
|
1924
|
+
return r || (f === 0 && (h = !0), w.height = 0, T.height = f, T.scaledHeight = C), i || (S === 0 && (h = !0), w.width = 0, T.width = S, T.scaledWidth = b), s && (h = !1), Ze(m, {
|
|
1930
1925
|
ref: this._setRef,
|
|
1931
1926
|
style: {
|
|
1932
|
-
...
|
|
1927
|
+
...w,
|
|
1933
1928
|
...u
|
|
1934
1929
|
},
|
|
1935
1930
|
...P
|
|
1936
|
-
}, !
|
|
1931
|
+
}, !h && e(T));
|
|
1937
1932
|
}
|
|
1938
1933
|
}
|
|
1939
1934
|
const ri = ln(({ widths: t, heights: e }) => {
|
|
@@ -1961,7 +1956,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
1961
1956
|
}
|
|
1962
1957
|
];
|
|
1963
1958
|
}, [t, e, r]), s = W(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
1964
|
-
return /* @__PURE__ */ a("div", { style: { width: s, position: "relative" }, children: r.map((l, d) => /* @__PURE__ */ a(
|
|
1959
|
+
return /* @__PURE__ */ a("div", { style: { width: s, position: "relative" }, children: r.map((l, d) => /* @__PURE__ */ a(Rt, { style: i[d], pageNumber: l }, l)) });
|
|
1965
1960
|
}), oi = ({ widths: t, heights: e }) => {
|
|
1966
1961
|
const { focusedPage: n } = oe(), o = W(() => ({
|
|
1967
1962
|
position: "absolute",
|
|
@@ -1975,58 +1970,58 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
1975
1970
|
width: r,
|
|
1976
1971
|
position: "relative"
|
|
1977
1972
|
},
|
|
1978
|
-
children: /* @__PURE__ */ a(
|
|
1973
|
+
children: /* @__PURE__ */ a(Rt, { style: o, pageNumber: n }, n)
|
|
1979
1974
|
}
|
|
1980
1975
|
);
|
|
1981
1976
|
}, ii = (t, e, n) => {
|
|
1982
|
-
const o = H(), { contentRef: r } = ge(), { heights: i, widths: s } = qe(), { setFocusedPage: l } = oe(), [d, u] = G([]), { targetScrollPage: m } = pn(), P =
|
|
1983
|
-
const w = s[
|
|
1977
|
+
const o = H(), { contentRef: r } = ge(), { heights: i, widths: s } = qe(), { setFocusedPage: l } = oe(), [d, u] = G([]), { targetScrollPage: m } = pn(), P = Pt(d, 0, 500), f = W(() => i.map((b, S) => {
|
|
1978
|
+
const w = s[S], T = Zr(S + 1, t), h = w * T.columnIndex, p = b * T.rowIndex, g = h + w, c = p + b;
|
|
1984
1979
|
return {
|
|
1985
|
-
pageNumber:
|
|
1986
|
-
...
|
|
1980
|
+
pageNumber: S + 1,
|
|
1981
|
+
...T,
|
|
1987
1982
|
width: w,
|
|
1988
|
-
height:
|
|
1989
|
-
startX:
|
|
1983
|
+
height: b,
|
|
1984
|
+
startX: h,
|
|
1990
1985
|
startY: p,
|
|
1991
1986
|
endX: g,
|
|
1992
1987
|
endY: c
|
|
1993
1988
|
};
|
|
1994
1989
|
}), [i, s, t, e]);
|
|
1995
|
-
|
|
1996
|
-
var
|
|
1997
|
-
P.length > 0 && !m.current && l(P[0].pageNumber), ((
|
|
1990
|
+
D(() => {
|
|
1991
|
+
var S;
|
|
1992
|
+
P.length > 0 && !m.current && l(P[0].pageNumber), ((S = P[0]) == null ? void 0 : S.ratio) && P.some((w) => w.pageNumber === m.current) && setTimeout(() => {
|
|
1998
1993
|
m.current = void 0;
|
|
1999
1994
|
}, 500);
|
|
2000
1995
|
}, [P, l]);
|
|
2001
|
-
const
|
|
2002
|
-
(
|
|
1996
|
+
const C = E(
|
|
1997
|
+
(b) => {
|
|
2003
1998
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2004
|
-
const
|
|
2005
|
-
startTop:
|
|
2006
|
-
startLeft:
|
|
2007
|
-
endTop:
|
|
2008
|
-
endLeft:
|
|
2009
|
-
},
|
|
2010
|
-
const p =
|
|
1999
|
+
const S = b.target, w = {
|
|
2000
|
+
startTop: S.scrollTop,
|
|
2001
|
+
startLeft: S.scrollLeft,
|
|
2002
|
+
endTop: S.scrollTop + S.clientHeight,
|
|
2003
|
+
endLeft: S.scrollLeft + S.clientWidth
|
|
2004
|
+
}, T = f.filter((h) => {
|
|
2005
|
+
const p = h.endX >= w.startLeft && h.endY >= w.startTop, g = h.startX <= w.endLeft && h.startY <= w.endTop;
|
|
2011
2006
|
return p && g;
|
|
2012
|
-
}).map((
|
|
2013
|
-
const p = w.startLeft >
|
|
2007
|
+
}).map((h) => {
|
|
2008
|
+
const p = w.startLeft > h.startX ? w.startLeft : h.startX, g = w.startTop > h.startY ? w.startTop : h.startY, c = w.endLeft < h.endX ? w.endLeft : h.endX, _ = w.endTop < h.endY ? w.endTop : h.endY, v = c - p, y = _ - g, x = +(v * y / (h.width * h.height) * 100).toFixed(2);
|
|
2014
2009
|
return {
|
|
2015
|
-
pageNumber:
|
|
2010
|
+
pageNumber: h.pageNumber,
|
|
2016
2011
|
ratio: x
|
|
2017
2012
|
};
|
|
2018
|
-
}).sort((
|
|
2019
|
-
u(
|
|
2013
|
+
}).sort((h, p) => p.ratio - h.ratio);
|
|
2014
|
+
u(T);
|
|
2020
2015
|
});
|
|
2021
2016
|
},
|
|
2022
|
-
[r,
|
|
2017
|
+
[r, f]
|
|
2023
2018
|
);
|
|
2024
|
-
|
|
2019
|
+
D(() => {
|
|
2025
2020
|
if (n)
|
|
2026
|
-
return n == null || n.addEventListener("scroll",
|
|
2027
|
-
n == null || n.removeEventListener("scroll",
|
|
2021
|
+
return n == null || n.addEventListener("scroll", C), () => {
|
|
2022
|
+
n == null || n.removeEventListener("scroll", C);
|
|
2028
2023
|
};
|
|
2029
|
-
}, [n,
|
|
2024
|
+
}, [n, C]);
|
|
2030
2025
|
}, be = {
|
|
2031
2026
|
"rp-layout": "_rp-layout_1g4ff_1",
|
|
2032
2027
|
"rp-content": "_rp-content_1g4ff_5",
|
|
@@ -2059,8 +2054,8 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2059
2054
|
);
|
|
2060
2055
|
}), ai = ln(({ columnIndex: t, rowIndex: e, data: n, style: o }) => {
|
|
2061
2056
|
const r = jr(e, t, n.columnCount);
|
|
2062
|
-
return /* @__PURE__ */ a(
|
|
2063
|
-
}, Jo),
|
|
2057
|
+
return /* @__PURE__ */ a(Rt, { style: o, pageNumber: r }, r);
|
|
2058
|
+
}, Jo), Xs = () => {
|
|
2064
2059
|
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = cr(), { pagesRef: o, setPagesRef: r } = ge(), { scrollToPage: i } = vn(), {
|
|
2065
2060
|
virtualScrollRef: s,
|
|
2066
2061
|
getVirtualScrollRef: l,
|
|
@@ -2068,10 +2063,10 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2068
2063
|
getVirtualScrollableElementRef: u,
|
|
2069
2064
|
setTotalInnerDimensions: m,
|
|
2070
2065
|
virtualScrollableElementRef: P,
|
|
2071
|
-
totalInnerDimensions:
|
|
2072
|
-
pageScrollElementRef:
|
|
2073
|
-
} = et(),
|
|
2074
|
-
|
|
2066
|
+
totalInnerDimensions: f,
|
|
2067
|
+
pageScrollElementRef: C
|
|
2068
|
+
} = et(), b = H(!0), { nextPage: S, prevPage: w, setFocusedPage: T, focusedPage: h } = oe(), { scrollMode: p } = Ne(), { viewMode: g } = Oe(), c = H(null), { loading: _ } = J(), { passwordRequired: v } = or(), { LoaderImageComponent: y } = hn(), R = H(
|
|
2069
|
+
f
|
|
2075
2070
|
), x = H({
|
|
2076
2071
|
viewMode: g,
|
|
2077
2072
|
scrollMode: p
|
|
@@ -2079,12 +2074,12 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2079
2074
|
pageDimension: F,
|
|
2080
2075
|
rowCount: L,
|
|
2081
2076
|
rowHeight: N,
|
|
2082
|
-
columnCount:
|
|
2077
|
+
columnCount: z,
|
|
2083
2078
|
columnWidth: k,
|
|
2084
2079
|
estimatedColumnWidth: q,
|
|
2085
2080
|
estimatedRowHeight: $
|
|
2086
|
-
} = ei(), U =
|
|
2087
|
-
ii(
|
|
2081
|
+
} = ei(), U = Pt(f, 100), V = H();
|
|
2082
|
+
ii(z, L, P);
|
|
2088
2083
|
const K = H({
|
|
2089
2084
|
scrollTop: 0,
|
|
2090
2085
|
scrollLeft: 0
|
|
@@ -2093,26 +2088,26 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2093
2088
|
const { isPressed: X } = qr(), { selectionMode: Q } = sr(), { initializeGrabScroll: le, resetGrabState: de } = Ur({
|
|
2094
2089
|
isPressed: X
|
|
2095
2090
|
}), ee = W(() => Q === rr.HAND, [Q]), Fe = W(() => ({
|
|
2096
|
-
columnCount:
|
|
2097
|
-
}), [
|
|
2091
|
+
columnCount: z
|
|
2092
|
+
}), [z]), we = E(
|
|
2098
2093
|
(B) => {
|
|
2099
2094
|
const Z = document.activeElement !== o;
|
|
2100
|
-
!A && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), w()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(),
|
|
2095
|
+
!A && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), w()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(), S()));
|
|
2101
2096
|
},
|
|
2102
|
-
[
|
|
2097
|
+
[S, w, A, p]
|
|
2103
2098
|
);
|
|
2104
|
-
|
|
2099
|
+
D(() => (window.addEventListener("keydown", we), () => {
|
|
2105
2100
|
window.removeEventListener("keydown", we);
|
|
2106
|
-
}), [we]),
|
|
2101
|
+
}), [we]), D(() => {
|
|
2107
2102
|
if (c.current && (c.current.style.position = "relative"), !!s)
|
|
2108
2103
|
for (let B = 0; B < L; B++)
|
|
2109
|
-
for (let Z = 0; Z <
|
|
2104
|
+
for (let Z = 0; Z < z; Z++)
|
|
2110
2105
|
s.resetAfterIndices({
|
|
2111
2106
|
columnIndex: Z,
|
|
2112
2107
|
rowIndex: B,
|
|
2113
2108
|
shouldForceUpdate: !0
|
|
2114
2109
|
});
|
|
2115
|
-
}, [L,
|
|
2110
|
+
}, [L, z, F, s]);
|
|
2116
2111
|
const Te = E(
|
|
2117
2112
|
(B, Z) => {
|
|
2118
2113
|
if (!P)
|
|
@@ -2127,21 +2122,21 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2127
2122
|
), _e = E(
|
|
2128
2123
|
(B, Z) => {
|
|
2129
2124
|
if (x.current.viewMode !== g || x.current.scrollMode !== p) {
|
|
2130
|
-
V.current && clearTimeout(V.current), I.current = !0, i(
|
|
2125
|
+
V.current && clearTimeout(V.current), I.current = !0, i(h, "auto"), V.current = setTimeout(() => {
|
|
2131
2126
|
requestAnimationFrame(() => {
|
|
2132
2127
|
x.current = { viewMode: g, scrollMode: p };
|
|
2133
2128
|
});
|
|
2134
2129
|
}, 100);
|
|
2135
2130
|
return;
|
|
2136
2131
|
}
|
|
2137
|
-
const Se = B.scrollTop,
|
|
2132
|
+
const Se = B.scrollTop, ot = B.scrollLeft;
|
|
2138
2133
|
if (!Z.height || !Z.width)
|
|
2139
2134
|
return;
|
|
2140
2135
|
I.current = !0;
|
|
2141
|
-
const { height: xe, width:
|
|
2142
|
-
if (
|
|
2136
|
+
const { height: xe, width: it } = Z, { height: zt, width: Dt } = R.current;
|
|
2137
|
+
if (zt === xe && Dt === it)
|
|
2143
2138
|
return;
|
|
2144
|
-
const Qn = Se /
|
|
2139
|
+
const Qn = Se / zt * xe, Yn = ot / Dt * it, Jn = Math.round(Math.min(Qn, xe)) || 0, er = Math.round(Math.min(Yn, it)) || 0;
|
|
2145
2140
|
O.current = setTimeout(() => {
|
|
2146
2141
|
requestAnimationFrame(() => {
|
|
2147
2142
|
s == null || s.scrollTo({
|
|
@@ -2156,21 +2151,21 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2156
2151
|
},
|
|
2157
2152
|
[s, g, p, i]
|
|
2158
2153
|
);
|
|
2159
|
-
|
|
2154
|
+
D(() => {
|
|
2160
2155
|
clearTimeout(O.current);
|
|
2161
2156
|
const B = Array.from({ length: L }).reduce(
|
|
2162
|
-
(Se,
|
|
2157
|
+
(Se, ot, xe) => Se + N(xe),
|
|
2163
2158
|
0
|
|
2164
|
-
), Z = Array.from({ length:
|
|
2165
|
-
(Se,
|
|
2159
|
+
), Z = Array.from({ length: z }).reduce(
|
|
2160
|
+
(Se, ot, xe) => Se + k(xe),
|
|
2166
2161
|
0
|
|
2167
2162
|
), ye = Te(Z, B);
|
|
2168
2163
|
K.current = ye, _e(ye, { height: B, width: Z }), m({
|
|
2169
2164
|
height: B,
|
|
2170
2165
|
width: Z
|
|
2171
2166
|
});
|
|
2172
|
-
}, [F, L,
|
|
2173
|
-
const
|
|
2167
|
+
}, [F, L, z, _e]);
|
|
2168
|
+
const nt = E(
|
|
2174
2169
|
(B) => {
|
|
2175
2170
|
K.current = {
|
|
2176
2171
|
scrollTop: B.scrollTop,
|
|
@@ -2179,10 +2174,10 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2179
2174
|
},
|
|
2180
2175
|
[P]
|
|
2181
2176
|
);
|
|
2182
|
-
|
|
2177
|
+
D(() => () => {
|
|
2183
2178
|
V.current && clearTimeout(V.current);
|
|
2184
2179
|
}, []);
|
|
2185
|
-
const
|
|
2180
|
+
const rt = W(() => re(ue["rp-pages-container"], {
|
|
2186
2181
|
[ue["rp-cursor-grab"]]: ee && !X,
|
|
2187
2182
|
[ue["rp-cursor-grabbing"]]: ee && X
|
|
2188
2183
|
}), [ee, X]), Xn = E(
|
|
@@ -2194,24 +2189,24 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2194
2189
|
},
|
|
2195
2190
|
[ee, le, ue]
|
|
2196
2191
|
);
|
|
2197
|
-
return
|
|
2192
|
+
return D(() => {
|
|
2198
2193
|
_ && de();
|
|
2199
|
-
}, [_]),
|
|
2200
|
-
if (!(U.height === 0 || !
|
|
2194
|
+
}, [_]), D(() => {
|
|
2195
|
+
if (!(U.height === 0 || !b.current)) {
|
|
2201
2196
|
if (e === ne.PAGE_SCROLLING) {
|
|
2202
|
-
t !==
|
|
2197
|
+
t !== h && C && T(t), b.current = !1;
|
|
2203
2198
|
return;
|
|
2204
2199
|
}
|
|
2205
|
-
i(t, "auto"),
|
|
2200
|
+
i(t, "auto"), T(t), b.current = !1;
|
|
2206
2201
|
}
|
|
2207
2202
|
}, [
|
|
2208
2203
|
i,
|
|
2209
2204
|
e,
|
|
2210
|
-
|
|
2211
|
-
|
|
2205
|
+
C,
|
|
2206
|
+
T,
|
|
2212
2207
|
U
|
|
2213
2208
|
]), /* @__PURE__ */ M(me, { children: [
|
|
2214
|
-
/* @__PURE__ */ a(Rn, { id: n, ref: r, tabIndex: -1, className:
|
|
2209
|
+
/* @__PURE__ */ a(Rn, { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ a(ni, { style: { minHeight: "50px" }, children: ({ width: B, height: Z }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Xn, style: { width: B, height: Z }, children: p === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
2215
2210
|
"div",
|
|
2216
2211
|
{
|
|
2217
2212
|
ref: d,
|
|
@@ -2226,8 +2221,8 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2226
2221
|
itemData: Fe,
|
|
2227
2222
|
outerRef: u,
|
|
2228
2223
|
innerRef: c,
|
|
2229
|
-
onScroll:
|
|
2230
|
-
columnCount:
|
|
2224
|
+
onScroll: nt,
|
|
2225
|
+
columnCount: z,
|
|
2231
2226
|
columnWidth: k,
|
|
2232
2227
|
rowHeight: N,
|
|
2233
2228
|
height: Z,
|
|
@@ -2252,7 +2247,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2252
2247
|
height: "100%",
|
|
2253
2248
|
width: "100%"
|
|
2254
2249
|
},
|
|
2255
|
-
children:
|
|
2250
|
+
children: y && /* @__PURE__ */ a(y, {})
|
|
2256
2251
|
}
|
|
2257
2252
|
) }) }) }),
|
|
2258
2253
|
v && /* @__PURE__ */ a(Br, {})
|
|
@@ -2263,10 +2258,10 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2263
2258
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2264
2259
|
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2265
2260
|
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2266
|
-
},
|
|
2267
|
-
"rp-paginate": "_rp-
|
|
2268
|
-
"rp-page-input": "_rp-page-
|
|
2269
|
-
"rp-total-page": "_rp-total-
|
|
2261
|
+
}, ft = {
|
|
2262
|
+
"rp-paginate": "_rp-paginate_1gck0_1",
|
|
2263
|
+
"rp-page-input": "_rp-page-input_1gck0_6",
|
|
2264
|
+
"rp-total-page": "_rp-total-page_1gck0_18"
|
|
2270
2265
|
}, si = () => {
|
|
2271
2266
|
const { prevIcon: t } = pe();
|
|
2272
2267
|
return t || /* @__PURE__ */ a(He, {});
|
|
@@ -2274,24 +2269,24 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2274
2269
|
const { nextIcon: t } = pe();
|
|
2275
2270
|
return t || /* @__PURE__ */ a(He, { style: { transform: "rotate(180deg" } });
|
|
2276
2271
|
}, li = () => {
|
|
2277
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = oe(), [s, l] = G(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: u } = Pe(), { localeMessages: m } = se(), { viewMode: P } = Oe(), { scrollMode:
|
|
2278
|
-
|
|
2272
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = oe(), [s, l] = G(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: u } = Pe(), { localeMessages: m } = se(), { viewMode: P } = Oe(), { scrollMode: f } = Ne();
|
|
2273
|
+
D(() => {
|
|
2279
2274
|
l(t.toString());
|
|
2280
2275
|
}, [t]);
|
|
2281
|
-
const
|
|
2282
|
-
const p =
|
|
2276
|
+
const C = E((h) => {
|
|
2277
|
+
const p = h.target.value;
|
|
2283
2278
|
l(p);
|
|
2284
|
-
}, []),
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2287
|
-
}, [i, s, e]),
|
|
2279
|
+
}, []), b = E(async () => {
|
|
2280
|
+
const h = i(s);
|
|
2281
|
+
h.success || l(h.currentPage.toString());
|
|
2282
|
+
}, [i, s, e]), S = E(() => {
|
|
2288
2283
|
l(t.toString());
|
|
2289
2284
|
}, [t]), w = E(
|
|
2290
|
-
(
|
|
2291
|
-
|
|
2285
|
+
(h) => {
|
|
2286
|
+
h.key === "Enter" && b();
|
|
2292
2287
|
},
|
|
2293
|
-
[
|
|
2294
|
-
),
|
|
2288
|
+
[b]
|
|
2289
|
+
), T = W(() => P === Le.DUAL_PAGE && f === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, f]);
|
|
2295
2290
|
return typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2296
2291
|
d,
|
|
2297
2292
|
{
|
|
@@ -2302,7 +2297,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2302
2297
|
goToPage: i,
|
|
2303
2298
|
changePage: n
|
|
2304
2299
|
}
|
|
2305
|
-
) : d ? /* @__PURE__ */ M("div", { className:
|
|
2300
|
+
) : d ? /* @__PURE__ */ M("div", { className: ft["rp-paginate"], children: [
|
|
2306
2301
|
!u && /* @__PURE__ */ a(Y, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2307
2302
|
ie,
|
|
2308
2303
|
{
|
|
@@ -2316,15 +2311,15 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2316
2311
|
dn,
|
|
2317
2312
|
{
|
|
2318
2313
|
onKeyDown: w,
|
|
2319
|
-
onBlur:
|
|
2320
|
-
onChange:
|
|
2314
|
+
onBlur: S,
|
|
2315
|
+
onChange: C,
|
|
2321
2316
|
value: s,
|
|
2322
|
-
className:
|
|
2317
|
+
className: ft["rp-page-input"],
|
|
2323
2318
|
id: "page-input",
|
|
2324
2319
|
name: "page-input"
|
|
2325
2320
|
}
|
|
2326
2321
|
) }),
|
|
2327
|
-
/* @__PURE__ */ M("span", { className:
|
|
2322
|
+
/* @__PURE__ */ M("span", { className: ft["rp-total-page"], children: [
|
|
2328
2323
|
"/",
|
|
2329
2324
|
e
|
|
2330
2325
|
] }),
|
|
@@ -2333,13 +2328,13 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2333
2328
|
{
|
|
2334
2329
|
onClick: o,
|
|
2335
2330
|
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2336
|
-
"aria-disabled":
|
|
2331
|
+
"aria-disabled": T,
|
|
2337
2332
|
children: /* @__PURE__ */ a(ci, {})
|
|
2338
2333
|
}
|
|
2339
2334
|
) })
|
|
2340
2335
|
] }) : null;
|
|
2341
2336
|
};
|
|
2342
|
-
var
|
|
2337
|
+
var Lt = "Dialog", [Ln, Qs] = eo(Lt), [di, ce] = Ln(Lt), En = (t) => {
|
|
2343
2338
|
const {
|
|
2344
2339
|
__scopeDialog: e,
|
|
2345
2340
|
children: n,
|
|
@@ -2347,11 +2342,10 @@ var nt = "Dialog", [Ln, Ys] = eo(nt), [di, ce] = Ln(nt), En = (t) => {
|
|
|
2347
2342
|
defaultOpen: r,
|
|
2348
2343
|
onOpenChange: i,
|
|
2349
2344
|
modal: s = !0
|
|
2350
|
-
} = t, l = j.useRef(null), d = j.useRef(null), [u, m] =
|
|
2345
|
+
} = t, l = j.useRef(null), d = j.useRef(null), [u = !1, m] = ro({
|
|
2351
2346
|
prop: o,
|
|
2352
|
-
defaultProp: r
|
|
2353
|
-
onChange: i
|
|
2354
|
-
caller: nt
|
|
2347
|
+
defaultProp: r,
|
|
2348
|
+
onChange: i
|
|
2355
2349
|
});
|
|
2356
2350
|
return /* @__PURE__ */ a(
|
|
2357
2351
|
di,
|
|
@@ -2359,9 +2353,9 @@ var nt = "Dialog", [Ln, Ys] = eo(nt), [di, ce] = Ln(nt), En = (t) => {
|
|
|
2359
2353
|
scope: e,
|
|
2360
2354
|
triggerRef: l,
|
|
2361
2355
|
contentRef: d,
|
|
2362
|
-
contentId:
|
|
2363
|
-
titleId:
|
|
2364
|
-
descriptionId:
|
|
2356
|
+
contentId: ct(),
|
|
2357
|
+
titleId: ct(),
|
|
2358
|
+
descriptionId: ct(),
|
|
2365
2359
|
open: u,
|
|
2366
2360
|
onOpenChange: m,
|
|
2367
2361
|
onOpenToggle: j.useCallback(() => m((P) => !P), [m]),
|
|
@@ -2370,10 +2364,10 @@ var nt = "Dialog", [Ln, Ys] = eo(nt), [di, ce] = Ln(nt), En = (t) => {
|
|
|
2370
2364
|
}
|
|
2371
2365
|
);
|
|
2372
2366
|
};
|
|
2373
|
-
En.displayName =
|
|
2367
|
+
En.displayName = Lt;
|
|
2374
2368
|
var Nn = "DialogTrigger", ui = j.forwardRef(
|
|
2375
2369
|
(t, e) => {
|
|
2376
|
-
const { __scopeDialog: n, ...o } = t, r = ce(Nn, n), i =
|
|
2370
|
+
const { __scopeDialog: n, ...o } = t, r = ce(Nn, n), i = yt(e, r.triggerRef);
|
|
2377
2371
|
return /* @__PURE__ */ a(
|
|
2378
2372
|
Be.button,
|
|
2379
2373
|
{
|
|
@@ -2392,25 +2386,25 @@ var Nn = "DialogTrigger", ui = j.forwardRef(
|
|
|
2392
2386
|
ui.displayName = Nn;
|
|
2393
2387
|
var Et = "DialogPortal", [pi, On] = Ln(Et, {
|
|
2394
2388
|
forceMount: void 0
|
|
2395
|
-
}),
|
|
2389
|
+
}), zn = (t) => {
|
|
2396
2390
|
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t, i = ce(Et, e);
|
|
2397
|
-
return /* @__PURE__ */ a(pi, { scope: e, forceMount: n, children: j.Children.map(o, (s) => /* @__PURE__ */ a(
|
|
2391
|
+
return /* @__PURE__ */ a(pi, { scope: e, forceMount: n, children: j.Children.map(o, (s) => /* @__PURE__ */ a(St, { present: n || i.open, children: /* @__PURE__ */ a(lo, { asChild: !0, container: r, children: s }) })) });
|
|
2398
2392
|
};
|
|
2399
|
-
|
|
2400
|
-
var Ye = "DialogOverlay",
|
|
2393
|
+
zn.displayName = Et;
|
|
2394
|
+
var Ye = "DialogOverlay", Dn = j.forwardRef(
|
|
2401
2395
|
(t, e) => {
|
|
2402
2396
|
const n = On(Ye, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = ce(Ye, t.__scopeDialog);
|
|
2403
|
-
return i.modal ? /* @__PURE__ */ a(
|
|
2397
|
+
return i.modal ? /* @__PURE__ */ a(St, { present: o || i.open, children: /* @__PURE__ */ a(hi, { ...r, ref: e }) }) : null;
|
|
2404
2398
|
}
|
|
2405
2399
|
);
|
|
2406
|
-
|
|
2407
|
-
var hi =
|
|
2400
|
+
Dn.displayName = Ye;
|
|
2401
|
+
var hi = j.forwardRef(
|
|
2408
2402
|
(t, e) => {
|
|
2409
2403
|
const { __scopeDialog: n, ...o } = t, r = ce(Ye, n);
|
|
2410
2404
|
return (
|
|
2411
2405
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2412
2406
|
// ie. when `Overlay` and `Content` are siblings
|
|
2413
|
-
/* @__PURE__ */ a(io, { as:
|
|
2407
|
+
/* @__PURE__ */ a(io, { as: to, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
2414
2408
|
Be.div,
|
|
2415
2409
|
{
|
|
2416
2410
|
"data-state": Ot(r.open),
|
|
@@ -2424,13 +2418,13 @@ var hi = ro("DialogOverlay.RemoveScroll"), fi = j.forwardRef(
|
|
|
2424
2418
|
), Ee = "DialogContent", An = j.forwardRef(
|
|
2425
2419
|
(t, e) => {
|
|
2426
2420
|
const n = On(Ee, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = ce(Ee, t.__scopeDialog);
|
|
2427
|
-
return /* @__PURE__ */ a(
|
|
2421
|
+
return /* @__PURE__ */ a(St, { present: o || i.open, children: i.modal ? /* @__PURE__ */ a(fi, { ...r, ref: e }) : /* @__PURE__ */ a(mi, { ...r, ref: e }) });
|
|
2428
2422
|
}
|
|
2429
2423
|
);
|
|
2430
2424
|
An.displayName = Ee;
|
|
2431
|
-
var
|
|
2425
|
+
var fi = j.forwardRef(
|
|
2432
2426
|
(t, e) => {
|
|
2433
|
-
const n = ce(Ee, t.__scopeDialog), o = j.useRef(null), r =
|
|
2427
|
+
const n = ce(Ee, t.__scopeDialog), o = j.useRef(null), r = yt(e, n.contentRef, o);
|
|
2434
2428
|
return j.useEffect(() => {
|
|
2435
2429
|
const i = o.current;
|
|
2436
2430
|
if (i)
|
|
@@ -2457,7 +2451,7 @@ var mi = j.forwardRef(
|
|
|
2457
2451
|
}
|
|
2458
2452
|
);
|
|
2459
2453
|
}
|
|
2460
|
-
),
|
|
2454
|
+
), mi = j.forwardRef(
|
|
2461
2455
|
(t, e) => {
|
|
2462
2456
|
const n = ce(Ee, t.__scopeDialog), o = j.useRef(!1), r = j.useRef(!1);
|
|
2463
2457
|
return /* @__PURE__ */ a(
|
|
@@ -2482,7 +2476,7 @@ var mi = j.forwardRef(
|
|
|
2482
2476
|
}
|
|
2483
2477
|
), Fn = j.forwardRef(
|
|
2484
2478
|
(t, e) => {
|
|
2485
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...s } = t, l = ce(Ee, n), d = j.useRef(null), u =
|
|
2479
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...s } = t, l = ce(Ee, n), d = j.useRef(null), u = yt(e, d);
|
|
2486
2480
|
return so(), /* @__PURE__ */ M(me, { children: [
|
|
2487
2481
|
/* @__PURE__ */ a(
|
|
2488
2482
|
co,
|
|
@@ -2508,8 +2502,8 @@ var mi = j.forwardRef(
|
|
|
2508
2502
|
}
|
|
2509
2503
|
),
|
|
2510
2504
|
/* @__PURE__ */ M(me, { children: [
|
|
2511
|
-
/* @__PURE__ */ a(
|
|
2512
|
-
/* @__PURE__ */ a(
|
|
2505
|
+
/* @__PURE__ */ a(vi, { titleId: l.titleId }),
|
|
2506
|
+
/* @__PURE__ */ a(_i, { contentRef: d, descriptionId: l.descriptionId })
|
|
2513
2507
|
] })
|
|
2514
2508
|
] });
|
|
2515
2509
|
}
|
|
@@ -2520,13 +2514,13 @@ var mi = j.forwardRef(
|
|
|
2520
2514
|
}
|
|
2521
2515
|
);
|
|
2522
2516
|
kn.displayName = Nt;
|
|
2523
|
-
var Wn = "DialogDescription",
|
|
2517
|
+
var Wn = "DialogDescription", gi = j.forwardRef(
|
|
2524
2518
|
(t, e) => {
|
|
2525
2519
|
const { __scopeDialog: n, ...o } = t, r = ce(Wn, n);
|
|
2526
2520
|
return /* @__PURE__ */ a(Be.p, { id: r.descriptionId, ...o, ref: e });
|
|
2527
2521
|
}
|
|
2528
2522
|
);
|
|
2529
|
-
|
|
2523
|
+
gi.displayName = Wn;
|
|
2530
2524
|
var Mn = "DialogClose", Hn = j.forwardRef(
|
|
2531
2525
|
(t, e) => {
|
|
2532
2526
|
const { __scopeDialog: n, ...o } = t, r = ce(Mn, n);
|
|
@@ -2545,11 +2539,11 @@ Hn.displayName = Mn;
|
|
|
2545
2539
|
function Ot(t) {
|
|
2546
2540
|
return t ? "open" : "closed";
|
|
2547
2541
|
}
|
|
2548
|
-
var $n = "DialogTitleWarning", [
|
|
2542
|
+
var $n = "DialogTitleWarning", [Ys, Gn] = no($n, {
|
|
2549
2543
|
contentName: Ee,
|
|
2550
2544
|
titleName: Nt,
|
|
2551
2545
|
docsSlug: "dialog"
|
|
2552
|
-
}),
|
|
2546
|
+
}), vi = ({ titleId: t }) => {
|
|
2553
2547
|
const e = Gn($n), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2554
2548
|
|
|
2555
2549
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -2558,14 +2552,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2558
2552
|
return j.useEffect(() => {
|
|
2559
2553
|
t && (document.getElementById(t) || console.error(n));
|
|
2560
2554
|
}, [n, t]), null;
|
|
2561
|
-
},
|
|
2562
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gn(
|
|
2555
|
+
}, wi = "DialogDescriptionWarning", _i = ({ contentRef: t, descriptionId: e }) => {
|
|
2556
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gn(wi).contentName}}.`;
|
|
2563
2557
|
return j.useEffect(() => {
|
|
2564
2558
|
var i;
|
|
2565
2559
|
const r = (i = t.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2566
2560
|
e && r && (document.getElementById(e) || console.warn(o));
|
|
2567
2561
|
}, [o, t, e]), null;
|
|
2568
|
-
},
|
|
2562
|
+
}, bi = En, Ci = zn, Pi = Dn, Ti = An, yi = kn, Si = Hn;
|
|
2569
2563
|
const Ie = {
|
|
2570
2564
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2571
2565
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2574,7 +2568,7 @@ const Ie = {
|
|
|
2574
2568
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2575
2569
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2576
2570
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2577
|
-
},
|
|
2571
|
+
}, xi = () => {
|
|
2578
2572
|
const { pdfProperties: t } = J(), { container: e } = ge(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = ho(), { localeMessages: r } = se(), i = W(() => {
|
|
2579
2573
|
if (!t)
|
|
2580
2574
|
return [];
|
|
@@ -2585,12 +2579,12 @@ const Ie = {
|
|
|
2585
2579
|
author: u,
|
|
2586
2580
|
subject: m,
|
|
2587
2581
|
createdOn: P,
|
|
2588
|
-
creator:
|
|
2589
|
-
keywords:
|
|
2590
|
-
modifiedOn:
|
|
2591
|
-
pdfProducer:
|
|
2582
|
+
creator: f,
|
|
2583
|
+
keywords: C,
|
|
2584
|
+
modifiedOn: b,
|
|
2585
|
+
pdfProducer: S,
|
|
2592
2586
|
pdfVersion: w,
|
|
2593
|
-
pageCount:
|
|
2587
|
+
pageCount: T
|
|
2594
2588
|
} = t;
|
|
2595
2589
|
return [
|
|
2596
2590
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: l },
|
|
@@ -2599,35 +2593,35 @@ const Ie = {
|
|
|
2599
2593
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2600
2594
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: u },
|
|
2601
2595
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2602
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2603
|
-
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value:
|
|
2596
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: C },
|
|
2597
|
+
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: f },
|
|
2604
2598
|
{
|
|
2605
2599
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2606
2600
|
value: P ? Wt(P) : ""
|
|
2607
2601
|
},
|
|
2608
2602
|
{
|
|
2609
2603
|
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2610
|
-
value:
|
|
2604
|
+
value: b ? Wt(b) : ""
|
|
2611
2605
|
},
|
|
2612
2606
|
{ separate: !0 },
|
|
2613
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2607
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: S },
|
|
2614
2608
|
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: w },
|
|
2615
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2609
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: T }
|
|
2616
2610
|
];
|
|
2617
2611
|
}, [t, r]);
|
|
2618
|
-
return /* @__PURE__ */ a(
|
|
2619
|
-
/* @__PURE__ */ a(
|
|
2620
|
-
/* @__PURE__ */ M(
|
|
2621
|
-
/* @__PURE__ */ a(
|
|
2612
|
+
return /* @__PURE__ */ a(bi, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(Ci, { container: e, children: /* @__PURE__ */ M("div", { className: Ie["rp-dialog-wrapper"], children: [
|
|
2613
|
+
/* @__PURE__ */ a(Pi, { className: Ie["rp-dialog-overlay"] }),
|
|
2614
|
+
/* @__PURE__ */ M(Ti, { className: Ie["rp-document-dialog"], children: [
|
|
2615
|
+
/* @__PURE__ */ a(yi, { className: Ie["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2622
2616
|
/* @__PURE__ */ a("div", { className: Ie["rp-document-properties"], children: i.map((s, l) => /* @__PURE__ */ a("div", { children: s.separate ? /* @__PURE__ */ a("div", { className: Ie["rp-properties-divider"] }) : /* @__PURE__ */ a(po, { label: s.label, value: s.value }) }, l)) }),
|
|
2623
|
-
/* @__PURE__ */ a(
|
|
2617
|
+
/* @__PURE__ */ a(Si, { asChild: !0, className: Ie["rp-dialog-close"], children: /* @__PURE__ */ a(uo, {}) })
|
|
2624
2618
|
] })
|
|
2625
2619
|
] }) }) });
|
|
2626
|
-
},
|
|
2620
|
+
}, Ii = {
|
|
2627
2621
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2628
|
-
}, nn = ".pdf",
|
|
2622
|
+
}, nn = ".pdf", Ri = (t) => URL.createObjectURL(t), Li = async (t) => {
|
|
2629
2623
|
const n = await (await fetch(t)).blob();
|
|
2630
|
-
return
|
|
2624
|
+
return Ri(n);
|
|
2631
2625
|
}, qn = () => {
|
|
2632
2626
|
const { filename: t, pdfSrc: e } = J(), { downloadFilename: n } = mr(), o = (i) => {
|
|
2633
2627
|
const s = n || i;
|
|
@@ -2637,21 +2631,21 @@ const Ie = {
|
|
|
2637
2631
|
if (!t || !e)
|
|
2638
2632
|
throw new Error("There is no PDF source to download");
|
|
2639
2633
|
const i = document.createElement("a");
|
|
2640
|
-
i.href = await
|
|
2634
|
+
i.href = await Li(e), i.download = o(t), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
2641
2635
|
}, [t, e]) };
|
|
2642
2636
|
}, Un = () => {
|
|
2643
2637
|
const { downloadIcon: t } = pe();
|
|
2644
2638
|
return t || /* @__PURE__ */ a(_o, {});
|
|
2645
|
-
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }),
|
|
2639
|
+
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ei = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(ie, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), Ni = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Ce, { onClick: t, children: /* @__PURE__ */ M(Vn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2646
2640
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
|
|
2647
2641
|
e == null ? void 0 : e.downloadFileLabel
|
|
2648
2642
|
] }) }), Bn = () => {
|
|
2649
2643
|
const { download: t } = qn(), { downloadTool: e = !0 } = ve(), { isSmallScreen: n } = Pe(), { localeMessages: o } = se();
|
|
2650
|
-
return e ? n ? /* @__PURE__ */ a(
|
|
2644
|
+
return e ? n ? /* @__PURE__ */ a(Ni, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ a(e, { download: t }) : e ? /* @__PURE__ */ a(Ei, { download: t, localeMessages: o }) : null : null;
|
|
2651
2645
|
}, Zn = () => {
|
|
2652
2646
|
const { printIcon: t } = pe();
|
|
2653
2647
|
return t || /* @__PURE__ */ a(bo, {});
|
|
2654
|
-
}, jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }),
|
|
2648
|
+
}, jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Y, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Oi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(jn, { localeMessages: e, children: /* @__PURE__ */ a(ie, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(Zn, {}) }) }), zi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Ce, { onClick: t, children: /* @__PURE__ */ M(jn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2655
2649
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Zn, {}) }),
|
|
2656
2650
|
e == null ? void 0 : e.printLabel
|
|
2657
2651
|
] }) }), Kn = () => {
|
|
@@ -2666,16 +2660,16 @@ const Ie = {
|
|
|
2666
2660
|
setOnComplete: o,
|
|
2667
2661
|
progress: i
|
|
2668
2662
|
}
|
|
2669
|
-
) : s ? /* @__PURE__ */ a(
|
|
2670
|
-
},
|
|
2663
|
+
) : s ? /* @__PURE__ */ a(Oi, { print: t, localeMessages: d }) : null : null;
|
|
2664
|
+
}, Di = {
|
|
2671
2665
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2672
|
-
},
|
|
2666
|
+
}, Ai = () => {
|
|
2673
2667
|
const { goToFirstPageIcon: t } = pe();
|
|
2674
|
-
return t || /* @__PURE__ */ a(gn, { className:
|
|
2675
|
-
},
|
|
2668
|
+
return t || /* @__PURE__ */ a(gn, { className: Di["rp-go-to-Top"] });
|
|
2669
|
+
}, Fi = () => {
|
|
2676
2670
|
const { goToLastPageIcon: t } = pe();
|
|
2677
2671
|
return t || /* @__PURE__ */ a(gn, {});
|
|
2678
|
-
}, rn = { width: "100%" },
|
|
2672
|
+
}, rn = { width: "100%" }, ki = () => {
|
|
2679
2673
|
const { goToPage: t, totalPages: e, focusedPage: n } = oe(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), i = W(() => n === 1, [n]), s = W(() => n === e, [n, e]), l = E(() => {
|
|
2680
2674
|
t(1);
|
|
2681
2675
|
}, [t]), d = E(() => {
|
|
@@ -2683,16 +2677,16 @@ const Ie = {
|
|
|
2683
2677
|
}, [t, e]);
|
|
2684
2678
|
return o ? /* @__PURE__ */ M(Qe, { children: [
|
|
2685
2679
|
/* @__PURE__ */ a(Ce, { onClick: l, children: /* @__PURE__ */ a(Y, { content: r == null ? void 0 : r.firstPageTooltip, style: rn, children: /* @__PURE__ */ M("div", { className: "rp-menu-item", "aria-disabled": i, children: [
|
|
2686
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2680
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Ai, {}) }),
|
|
2687
2681
|
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2688
2682
|
] }) }) }),
|
|
2689
2683
|
/* @__PURE__ */ a(Ce, { onClick: d, children: /* @__PURE__ */ a(Y, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ M("div", { className: "rp-menu-item", "aria-disabled": s, children: [
|
|
2690
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2684
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Fi, {}) }),
|
|
2691
2685
|
/* @__PURE__ */ a("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2692
2686
|
] }) }) }),
|
|
2693
|
-
/* @__PURE__ */ a(
|
|
2687
|
+
/* @__PURE__ */ a(xt, {})
|
|
2694
2688
|
] }) : null;
|
|
2695
|
-
},
|
|
2689
|
+
}, Wi = () => {
|
|
2696
2690
|
const [t, e] = G(!1), { container: n, pagesRef: o } = ge(), { isSmallScreen: r } = Pe(), {
|
|
2697
2691
|
openFileTool: i,
|
|
2698
2692
|
downloadTool: s,
|
|
@@ -2701,16 +2695,16 @@ const Ie = {
|
|
|
2701
2695
|
rotateTool: u,
|
|
2702
2696
|
selectionModeTool: m,
|
|
2703
2697
|
jumpNavigationTool: P,
|
|
2704
|
-
printTool:
|
|
2705
|
-
fullscreenTool:
|
|
2706
|
-
} = ve(), { localeMessages:
|
|
2698
|
+
printTool: f,
|
|
2699
|
+
fullscreenTool: C
|
|
2700
|
+
} = ve(), { localeMessages: b } = se(), [S, w] = G(0), T = H(
|
|
2707
2701
|
new ResizeObserver((p) => {
|
|
2708
2702
|
w(p[0].contentRect.height);
|
|
2709
2703
|
})
|
|
2710
|
-
),
|
|
2704
|
+
), h = W(() => {
|
|
2711
2705
|
const p = P || u || m || d || l;
|
|
2712
2706
|
let g = !1;
|
|
2713
|
-
return r && (g = !(!i && !s && !
|
|
2707
|
+
return r && (g = !(!i && !s && !f && !C)), p || g;
|
|
2714
2708
|
}, [
|
|
2715
2709
|
i,
|
|
2716
2710
|
s,
|
|
@@ -2721,22 +2715,22 @@ const Ie = {
|
|
|
2721
2715
|
P,
|
|
2722
2716
|
r
|
|
2723
2717
|
]);
|
|
2724
|
-
return
|
|
2725
|
-
|
|
2726
|
-
}), [o]),
|
|
2718
|
+
return D(() => (o && T.current.observe(o), () => {
|
|
2719
|
+
T.current.disconnect();
|
|
2720
|
+
}), [o]), h ? /* @__PURE__ */ M(fo, { children: [
|
|
2727
2721
|
/* @__PURE__ */ a(
|
|
2728
|
-
|
|
2722
|
+
Tt,
|
|
2729
2723
|
{
|
|
2730
2724
|
container: n,
|
|
2731
2725
|
onOpenChange: e,
|
|
2732
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content:
|
|
2726
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content: b == null ? void 0 : b.moreOptionTooltip, children: /* @__PURE__ */ a(ie, { active: t, "aria-label": b == null ? void 0 : b.moreOptionTooltip, children: /* @__PURE__ */ a(Jr, {}) }) }) }),
|
|
2733
2727
|
side: "bottom",
|
|
2734
2728
|
avoidCollisions: !1,
|
|
2735
2729
|
children: /* @__PURE__ */ M(
|
|
2736
2730
|
"div",
|
|
2737
2731
|
{
|
|
2738
|
-
style: { maxHeight: `${
|
|
2739
|
-
className:
|
|
2732
|
+
style: { maxHeight: `${S}px`, overflow: "auto" },
|
|
2733
|
+
className: Ii["rp-other-tool-content"],
|
|
2740
2734
|
"data-rp": "moreOptionsDropdown",
|
|
2741
2735
|
children: [
|
|
2742
2736
|
r && /* @__PURE__ */ M(Qe, { children: [
|
|
@@ -2744,9 +2738,9 @@ const Ie = {
|
|
|
2744
2738
|
/* @__PURE__ */ a(Bn, {}),
|
|
2745
2739
|
/* @__PURE__ */ a(Kn, {}),
|
|
2746
2740
|
/* @__PURE__ */ a(mn, {}),
|
|
2747
|
-
/* @__PURE__ */ a(
|
|
2741
|
+
/* @__PURE__ */ a(xt, {})
|
|
2748
2742
|
] }),
|
|
2749
|
-
/* @__PURE__ */ a(
|
|
2743
|
+
/* @__PURE__ */ a(ki, {}),
|
|
2750
2744
|
/* @__PURE__ */ a(go, {}),
|
|
2751
2745
|
/* @__PURE__ */ a(Co, {}),
|
|
2752
2746
|
/* @__PURE__ */ a(vo, {}),
|
|
@@ -2757,9 +2751,9 @@ const Ie = {
|
|
|
2757
2751
|
)
|
|
2758
2752
|
}
|
|
2759
2753
|
),
|
|
2760
|
-
/* @__PURE__ */ a(
|
|
2754
|
+
/* @__PURE__ */ a(xi, {})
|
|
2761
2755
|
] }) : null;
|
|
2762
|
-
},
|
|
2756
|
+
}, Mi = () => {
|
|
2763
2757
|
const { isSmallScreen: t } = Pe();
|
|
2764
2758
|
return /* @__PURE__ */ M(me, { children: [
|
|
2765
2759
|
/* @__PURE__ */ a(Yr, {}),
|
|
@@ -2769,46 +2763,46 @@ const Ie = {
|
|
|
2769
2763
|
/* @__PURE__ */ a(Kn, {}),
|
|
2770
2764
|
/* @__PURE__ */ a(mn, {})
|
|
2771
2765
|
] }),
|
|
2772
|
-
/* @__PURE__ */ a(
|
|
2766
|
+
/* @__PURE__ */ a(Wi, {})
|
|
2773
2767
|
] });
|
|
2774
|
-
},
|
|
2768
|
+
}, Hi = "_active_1fv1b_11", Re = {
|
|
2775
2769
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_1fv1b_1",
|
|
2776
2770
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_1fv1b_6",
|
|
2777
|
-
active:
|
|
2771
|
+
active: Hi,
|
|
2778
2772
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_1fv1b_15",
|
|
2779
2773
|
"rp-current-zoom-text": "_rp-current-zoom-text_1fv1b_20",
|
|
2780
2774
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1fv1b_24"
|
|
2781
|
-
},
|
|
2775
|
+
}, $i = 25, mt = 1e3, Gi = [50, 75, 100, 125, 150, 200, 300, 400], qi = () => {
|
|
2782
2776
|
const { zoomInIcon: t } = pe();
|
|
2783
2777
|
return t || /* @__PURE__ */ a(Po, {});
|
|
2784
|
-
},
|
|
2778
|
+
}, Ui = () => {
|
|
2785
2779
|
const { zoomOutIcon: t } = pe();
|
|
2786
2780
|
return t || /* @__PURE__ */ a(To, {});
|
|
2787
|
-
},
|
|
2788
|
-
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: i } = oe(), { pageRotate: s } = Ue(), { pages: l } = J(), { isSmallScreen: d } = Pe(), { localeMessages: u } = se(), { viewMode: m } = Oe(), [P,
|
|
2781
|
+
}, Vi = () => {
|
|
2782
|
+
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: i } = oe(), { pageRotate: s } = Ue(), { pages: l } = J(), { isSmallScreen: d } = Pe(), { localeMessages: u } = se(), { viewMode: m } = Oe(), [P, f] = G(0), [C, b] = G(!1), S = H(
|
|
2789
2783
|
new ResizeObserver((v) => {
|
|
2790
|
-
|
|
2784
|
+
f(v[0].contentRect.height);
|
|
2791
2785
|
})
|
|
2792
2786
|
), w = E(() => {
|
|
2793
2787
|
e((v) => {
|
|
2794
|
-
const
|
|
2795
|
-
return Math.min(
|
|
2788
|
+
const y = Math.floor(v / 25) * 25;
|
|
2789
|
+
return Math.min(y + 25, mt);
|
|
2796
2790
|
});
|
|
2797
|
-
}, [e]),
|
|
2791
|
+
}, [e]), T = E(() => {
|
|
2798
2792
|
e((v) => {
|
|
2799
|
-
const
|
|
2800
|
-
return Math.min(
|
|
2793
|
+
const y = Math.ceil(v / 25) * 25;
|
|
2794
|
+
return Math.min(y - 25, mt);
|
|
2801
2795
|
});
|
|
2802
|
-
}, [e]),
|
|
2796
|
+
}, [e]), h = W(() => t === $i, [t]), p = W(() => t === mt, [t]), g = W(() => {
|
|
2803
2797
|
const v = l.get(i);
|
|
2804
2798
|
return v ? v.page.getViewport({ scale: 1, rotation: s[i] }) : null;
|
|
2805
2799
|
}, [l, i, s]), c = E(
|
|
2806
2800
|
(v) => {
|
|
2807
|
-
const
|
|
2801
|
+
const y = ((g == null ? void 0 : g.width) || 0) + 2 * Mt, R = ((g == null ? void 0 : g.height) || 0) + 2 * Mt, x = (o == null ? void 0 : o.clientWidth) || 0, I = (o == null ? void 0 : o.clientHeight) || 0, O = yo(
|
|
2808
2802
|
v,
|
|
2809
2803
|
x,
|
|
2810
2804
|
I,
|
|
2811
|
-
|
|
2805
|
+
y,
|
|
2812
2806
|
R,
|
|
2813
2807
|
m
|
|
2814
2808
|
);
|
|
@@ -2821,30 +2815,30 @@ const Ie = {
|
|
|
2821
2815
|
},
|
|
2822
2816
|
[e, c]
|
|
2823
2817
|
);
|
|
2824
|
-
return
|
|
2825
|
-
|
|
2818
|
+
return D(() => (o && S.current.observe(o), () => {
|
|
2819
|
+
S.current.disconnect();
|
|
2826
2820
|
}), [o]), typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: t, setZoomLevel: e }) : r ? /* @__PURE__ */ M("div", { className: Re["rp-zoom-wrapper"], children: [
|
|
2827
2821
|
/* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomOutTooltip, children: /* @__PURE__ */ a(
|
|
2828
2822
|
ie,
|
|
2829
2823
|
{
|
|
2830
|
-
disabled:
|
|
2831
|
-
onClick:
|
|
2824
|
+
disabled: h,
|
|
2825
|
+
onClick: T,
|
|
2832
2826
|
"aria-label": u == null ? void 0 : u.zoomOutTooltip,
|
|
2833
|
-
children: /* @__PURE__ */ a(
|
|
2827
|
+
children: /* @__PURE__ */ a(Ui, {})
|
|
2834
2828
|
}
|
|
2835
2829
|
) }),
|
|
2836
2830
|
!d && /* @__PURE__ */ a(
|
|
2837
|
-
|
|
2831
|
+
Tt,
|
|
2838
2832
|
{
|
|
2839
2833
|
container: n,
|
|
2840
|
-
open:
|
|
2841
|
-
onOpenChange:
|
|
2834
|
+
open: C,
|
|
2835
|
+
onOpenChange: b,
|
|
2842
2836
|
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomSelectTooltip, children: /* @__PURE__ */ M(
|
|
2843
2837
|
ie,
|
|
2844
2838
|
{
|
|
2845
2839
|
className: re(
|
|
2846
2840
|
Re["rp-current-zoom-wrapper"],
|
|
2847
|
-
|
|
2841
|
+
C && Re.active
|
|
2848
2842
|
),
|
|
2849
2843
|
"aria-label": u == null ? void 0 : u.zoomSelectTooltip,
|
|
2850
2844
|
children: [
|
|
@@ -2865,12 +2859,12 @@ const Ie = {
|
|
|
2865
2859
|
className: Re["rp-zoom-dropdown-content"],
|
|
2866
2860
|
children: [
|
|
2867
2861
|
/* @__PURE__ */ M(Qe, { children: [
|
|
2868
|
-
/* @__PURE__ */ a(Ce, { onClick: () => _(
|
|
2869
|
-
/* @__PURE__ */ a(Ce, { onClick: () => _(
|
|
2870
|
-
/* @__PURE__ */ a(Ce, { onClick: () => _(
|
|
2862
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(at.ACTUAL), children: u == null ? void 0 : u.zoomActualSize }),
|
|
2863
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(at.PAGE_FIT), children: u == null ? void 0 : u.zoomPageFit }),
|
|
2864
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(at.PAGE_WIDTH), children: u == null ? void 0 : u.zoomPageWidth })
|
|
2871
2865
|
] }),
|
|
2872
|
-
/* @__PURE__ */ a(
|
|
2873
|
-
/* @__PURE__ */ a(Qe, { children:
|
|
2866
|
+
/* @__PURE__ */ a(xt, {}),
|
|
2867
|
+
/* @__PURE__ */ a(Qe, { children: Gi.map((v) => /* @__PURE__ */ M(Ce, { onClick: () => _(v), children: [
|
|
2874
2868
|
v,
|
|
2875
2869
|
" %"
|
|
2876
2870
|
] }, v)) })
|
|
@@ -2885,12 +2879,12 @@ const Ie = {
|
|
|
2885
2879
|
disabled: p,
|
|
2886
2880
|
onClick: w,
|
|
2887
2881
|
"aria-label": u == null ? void 0 : u.zoomInTooltip,
|
|
2888
|
-
children: /* @__PURE__ */ a(
|
|
2882
|
+
children: /* @__PURE__ */ a(qi, {})
|
|
2889
2883
|
}
|
|
2890
2884
|
) })
|
|
2891
2885
|
] }) : null;
|
|
2892
2886
|
}, on = () => {
|
|
2893
|
-
const { totalMatches: t, nextMatch: e, prevMatch: n } =
|
|
2887
|
+
const { totalMatches: t, nextMatch: e, prevMatch: n } = It(), { localeMessages: o } = se();
|
|
2894
2888
|
return /* @__PURE__ */ M(me, { children: [
|
|
2895
2889
|
/* @__PURE__ */ a(
|
|
2896
2890
|
Y,
|
|
@@ -2925,7 +2919,7 @@ const Ie = {
|
|
|
2925
2919
|
}, an = () => {
|
|
2926
2920
|
const { searchIcon: t } = pe();
|
|
2927
2921
|
return t || /* @__PURE__ */ a(So, {});
|
|
2928
|
-
},
|
|
2922
|
+
}, Bi = () => {
|
|
2929
2923
|
const { container: t } = ge(), [e, n] = G(!1), { pdf: o } = J(), [r, i] = G(null), {
|
|
2930
2924
|
searchOptions: s,
|
|
2931
2925
|
setSearchOptions: l,
|
|
@@ -2933,14 +2927,14 @@ const Ie = {
|
|
|
2933
2927
|
setSearch: u,
|
|
2934
2928
|
totalMatches: m,
|
|
2935
2929
|
currentMatchPosition: P,
|
|
2936
|
-
nextMatch:
|
|
2937
|
-
prevMatch:
|
|
2938
|
-
search:
|
|
2939
|
-
} =
|
|
2930
|
+
nextMatch: f,
|
|
2931
|
+
prevMatch: C,
|
|
2932
|
+
search: b
|
|
2933
|
+
} = It(), { searchTool: S = !0 } = ve(), [w, T] = G(b), { localeMessages: h } = se(), { isSmallScreen: p } = Pe(), [g, c] = G(null), _ = E(() => {
|
|
2940
2934
|
n(!0);
|
|
2941
2935
|
}, []), v = E(() => {
|
|
2942
|
-
u(""),
|
|
2943
|
-
}, [u]),
|
|
2936
|
+
u(""), T(""), n(!1);
|
|
2937
|
+
}, [u]), y = ($) => {
|
|
2944
2938
|
const U = $.key === "Enter", V = $.key === " ";
|
|
2945
2939
|
(U || V) && v();
|
|
2946
2940
|
}, R = E(
|
|
@@ -2950,33 +2944,33 @@ const Ie = {
|
|
|
2950
2944
|
[e]
|
|
2951
2945
|
), x = E(
|
|
2952
2946
|
($) => {
|
|
2953
|
-
$.shiftKey && $.key === "Enter" ?
|
|
2947
|
+
$.shiftKey && $.key === "Enter" ? C() : $.key === "Enter" && b !== w ? u(w) : $.key === "Enter" && f();
|
|
2954
2948
|
},
|
|
2955
|
-
[w,
|
|
2949
|
+
[w, C, f, u, b]
|
|
2956
2950
|
);
|
|
2957
|
-
|
|
2951
|
+
D(() => (window.addEventListener("keydown", R), () => {
|
|
2958
2952
|
window.removeEventListener("keydown", R);
|
|
2959
|
-
}), [R]),
|
|
2953
|
+
}), [R]), D(() => {
|
|
2960
2954
|
r && setTimeout(() => {
|
|
2961
2955
|
r.focus();
|
|
2962
2956
|
}, 0);
|
|
2963
2957
|
}, [r]);
|
|
2964
2958
|
const I = E(($) => {
|
|
2965
|
-
|
|
2959
|
+
T($.target.value);
|
|
2966
2960
|
}, []), O = E(() => {
|
|
2967
|
-
|
|
2961
|
+
T(""), u("");
|
|
2968
2962
|
}, [u]), A = W(() => `${P} / ${m}`, [P, m]), { wholeWords: F, matchCase: L } = W(() => s, [s]), N = E(
|
|
2969
2963
|
($) => {
|
|
2970
2964
|
l((U) => ({ ...U, matchCase: $ }));
|
|
2971
2965
|
},
|
|
2972
2966
|
[l]
|
|
2973
|
-
),
|
|
2967
|
+
), z = E(
|
|
2974
2968
|
($) => {
|
|
2975
2969
|
l((U) => ({ ...U, wholeWords: $ }));
|
|
2976
2970
|
},
|
|
2977
2971
|
[l]
|
|
2978
2972
|
);
|
|
2979
|
-
|
|
2973
|
+
D(() => {
|
|
2980
2974
|
v();
|
|
2981
2975
|
}, [o, v]);
|
|
2982
2976
|
const k = W(() => (g == null ? void 0 : g.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [g]), q = E(
|
|
@@ -3003,8 +2997,8 @@ const Ie = {
|
|
|
3003
2997
|
},
|
|
3004
2998
|
[k]
|
|
3005
2999
|
);
|
|
3006
|
-
return
|
|
3007
|
-
|
|
3000
|
+
return S ? /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
3001
|
+
Tt,
|
|
3008
3002
|
{
|
|
3009
3003
|
open: e,
|
|
3010
3004
|
container: t,
|
|
@@ -3012,12 +3006,12 @@ const Ie = {
|
|
|
3012
3006
|
align: "start",
|
|
3013
3007
|
tabIndex: 0,
|
|
3014
3008
|
avoidCollisions: !1,
|
|
3015
|
-
triggerComponent: /* @__PURE__ */ a(Y, { content:
|
|
3009
|
+
triggerComponent: /* @__PURE__ */ a(Y, { content: h == null ? void 0 : h.searchButtonTooltip, children: /* @__PURE__ */ a(
|
|
3016
3010
|
ie,
|
|
3017
3011
|
{
|
|
3018
3012
|
onClick: _,
|
|
3019
3013
|
active: e,
|
|
3020
|
-
"aria-label":
|
|
3014
|
+
"aria-label": h == null ? void 0 : h.searchButtonTooltip,
|
|
3021
3015
|
children: /* @__PURE__ */ a(an, {})
|
|
3022
3016
|
}
|
|
3023
3017
|
) }),
|
|
@@ -3031,14 +3025,14 @@ const Ie = {
|
|
|
3031
3025
|
children: [
|
|
3032
3026
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input-wrapper"], children: [
|
|
3033
3027
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input"], children: [
|
|
3034
|
-
/* @__PURE__ */ a(Y, { content:
|
|
3028
|
+
/* @__PURE__ */ a(Y, { content: h == null ? void 0 : h.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
3035
3029
|
dn,
|
|
3036
3030
|
{
|
|
3037
3031
|
value: w,
|
|
3038
3032
|
onKeyDown: x,
|
|
3039
3033
|
onChange: I,
|
|
3040
3034
|
icon: /* @__PURE__ */ a(an, {}),
|
|
3041
|
-
placeholder:
|
|
3035
|
+
placeholder: h == null ? void 0 : h.searchInputPlaceholder,
|
|
3042
3036
|
className: te["rp-search-input"],
|
|
3043
3037
|
ref: i,
|
|
3044
3038
|
id: "search-input",
|
|
@@ -3047,8 +3041,8 @@ const Ie = {
|
|
|
3047
3041
|
children: !!w && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: O, children: /* @__PURE__ */ a(xo, {}) })
|
|
3048
3042
|
}
|
|
3049
3043
|
) }),
|
|
3050
|
-
d ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(
|
|
3051
|
-
p && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(Ht, { onKeyPress:
|
|
3044
|
+
d ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(Ct, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: A }),
|
|
3045
|
+
p && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(Ht, { onKeyPress: y, handleClose: v }) })
|
|
3052
3046
|
] }),
|
|
3053
3047
|
/* @__PURE__ */ M("div", { className: te["rp-search-tool-input-checkboxes"], children: [
|
|
3054
3048
|
p && /* @__PURE__ */ a(on, {}),
|
|
@@ -3059,70 +3053,70 @@ const Ie = {
|
|
|
3059
3053
|
name: "matchCase",
|
|
3060
3054
|
value: L,
|
|
3061
3055
|
onChange: N,
|
|
3062
|
-
children:
|
|
3056
|
+
children: h == null ? void 0 : h.searchMatchCaseLabel
|
|
3063
3057
|
}
|
|
3064
3058
|
),
|
|
3065
|
-
!p && /* @__PURE__ */ a(Y, { content:
|
|
3059
|
+
!p && /* @__PURE__ */ a(Y, { content: h == null ? void 0 : h.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: te["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
3066
3060
|
/* @__PURE__ */ a(
|
|
3067
3061
|
$t,
|
|
3068
3062
|
{
|
|
3069
3063
|
tabIndex: 0,
|
|
3070
3064
|
name: "wholeWord",
|
|
3071
3065
|
value: F,
|
|
3072
|
-
onChange:
|
|
3073
|
-
children:
|
|
3066
|
+
onChange: z,
|
|
3067
|
+
children: h == null ? void 0 : h.searchWholeWordsLabel
|
|
3074
3068
|
}
|
|
3075
3069
|
),
|
|
3076
|
-
!p && /* @__PURE__ */ a(Y, { content:
|
|
3070
|
+
!p && /* @__PURE__ */ a(Y, { content: h == null ? void 0 : h.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { tabIndex: 0, className: te["rp-search-icon-info"], children: /* @__PURE__ */ a(Gt, {}) }) })
|
|
3077
3071
|
] })
|
|
3078
3072
|
] }),
|
|
3079
3073
|
!p && /* @__PURE__ */ M("div", { className: te["rp-search-tool-controls"], children: [
|
|
3080
3074
|
/* @__PURE__ */ a(on, {}),
|
|
3081
|
-
/* @__PURE__ */ a(Ht, { onKeyPress:
|
|
3075
|
+
/* @__PURE__ */ a(Ht, { onKeyPress: y, handleClose: v })
|
|
3082
3076
|
] })
|
|
3083
3077
|
]
|
|
3084
3078
|
}
|
|
3085
3079
|
)
|
|
3086
3080
|
}
|
|
3087
3081
|
) }) : null;
|
|
3088
|
-
},
|
|
3082
|
+
}, Zi = "_loading_wazy2_1", De = {
|
|
3089
3083
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3090
3084
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3091
3085
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
3092
3086
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
|
|
3093
3087
|
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
3094
3088
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3095
|
-
loading:
|
|
3096
|
-
},
|
|
3089
|
+
loading: Zi
|
|
3090
|
+
}, ji = ({ percentage: t }) => {
|
|
3097
3091
|
const { cancel: e } = tt(), { localeMessages: n } = se();
|
|
3098
|
-
return t < 1 ? null : /* @__PURE__ */ a("div", { className: re(
|
|
3099
|
-
/* @__PURE__ */ M("div", { className: re(
|
|
3092
|
+
return t < 1 ? null : /* @__PURE__ */ a("div", { className: re(De["rp-loading-overlay"]), children: /* @__PURE__ */ M("div", { className: re(De["rp-loading-modal"]), children: [
|
|
3093
|
+
/* @__PURE__ */ M("div", { className: re(De["rp-loading-title"]), children: [
|
|
3100
3094
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3101
3095
|
"..."
|
|
3102
3096
|
] }),
|
|
3103
|
-
/* @__PURE__ */ a("div", { className: re(
|
|
3097
|
+
/* @__PURE__ */ a("div", { className: re(De["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
3104
3098
|
"div",
|
|
3105
3099
|
{
|
|
3106
|
-
className: re(
|
|
3100
|
+
className: re(De["rp-loading-progress"]),
|
|
3107
3101
|
style: { width: `${t}%` }
|
|
3108
3102
|
}
|
|
3109
3103
|
) }),
|
|
3110
|
-
/* @__PURE__ */ a("button", { className: re(
|
|
3104
|
+
/* @__PURE__ */ a("button", { className: re(De["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3111
3105
|
] }) });
|
|
3112
|
-
},
|
|
3106
|
+
}, Ki = Ve((t, e) => {
|
|
3113
3107
|
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Pe(), { percentage: i } = o || {}, s = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
3114
3108
|
return /* @__PURE__ */ M("div", { children: [
|
|
3115
3109
|
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: ke["rp-toolbar-content"], children: /* @__PURE__ */ M("div", { className: ke["rp-toolbar-wrapper"], style: s(), children: [
|
|
3116
3110
|
/* @__PURE__ */ M("div", { "data-rp": "topBarLeft", className: ke["rp-toolbar-start"], children: [
|
|
3117
|
-
/* @__PURE__ */ a(
|
|
3111
|
+
/* @__PURE__ */ a(Bi, {}),
|
|
3118
3112
|
/* @__PURE__ */ a(li, {})
|
|
3119
3113
|
] }),
|
|
3120
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: ke["rp-toolbar-middle"], children: /* @__PURE__ */ a(
|
|
3121
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: ke["rp-toolbar-end"], children: /* @__PURE__ */ a(
|
|
3114
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: ke["rp-toolbar-middle"], children: /* @__PURE__ */ a(Vi, {}) }),
|
|
3115
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: ke["rp-toolbar-end"], children: /* @__PURE__ */ a(Mi, {}) })
|
|
3122
3116
|
] }) }),
|
|
3123
|
-
n && i ? /* @__PURE__ */ a(
|
|
3117
|
+
n && i ? /* @__PURE__ */ a(ji, { percentage: i }) : null
|
|
3124
3118
|
] });
|
|
3125
|
-
}),
|
|
3119
|
+
}), gt = {
|
|
3126
3120
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
|
|
3127
3121
|
"rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
|
|
3128
3122
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
|
|
@@ -3133,22 +3127,22 @@ const Ie = {
|
|
|
3133
3127
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3134
3128
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3135
3129
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3136
|
-
},
|
|
3137
|
-
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate: i } = Ue(), s = H(null), l = yn(), { pages: d } = J(), [u, m] = G(null), P = H(!1),
|
|
3130
|
+
}, Xi = (t) => {
|
|
3131
|
+
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate: i } = Ue(), s = H(null), l = yn(), { pages: d } = J(), [u, m] = G(null), P = H(!1), f = H(), C = W(() => n ? We["rp-thumbnail-active"] : "", [n]), b = W(() => ({
|
|
3138
3132
|
width: Math.round(o.width),
|
|
3139
3133
|
height: Math.round(o.height)
|
|
3140
|
-
}), [o]),
|
|
3134
|
+
}), [o]), S = E(() => {
|
|
3141
3135
|
e && r(e);
|
|
3142
3136
|
}, [r, e]);
|
|
3143
|
-
return
|
|
3137
|
+
return D(() => {
|
|
3144
3138
|
const w = d.get(e);
|
|
3145
|
-
|
|
3146
|
-
}, [d, e]),
|
|
3139
|
+
f.current === w || (m(null), f.current = w);
|
|
3140
|
+
}, [d, e]), D(() => {
|
|
3147
3141
|
const w = d.get(e);
|
|
3148
3142
|
if (!s.current || !e || !w || u)
|
|
3149
3143
|
return;
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3144
|
+
const T = new IntersectionObserver((h) => {
|
|
3145
|
+
h.forEach((p) => {
|
|
3152
3146
|
if (P.current) {
|
|
3153
3147
|
P.current = !1, l.removeQueue(`thumbnail-${e}`);
|
|
3154
3148
|
return;
|
|
@@ -3177,13 +3171,13 @@ const Ie = {
|
|
|
3177
3171
|
}
|
|
3178
3172
|
});
|
|
3179
3173
|
});
|
|
3180
|
-
return s.current &&
|
|
3181
|
-
|
|
3174
|
+
return s.current && T.observe(s.current), () => {
|
|
3175
|
+
T.disconnect(), l.removeQueue(`thumbnail-${e}`);
|
|
3182
3176
|
};
|
|
3183
3177
|
}, [l, e, d, u]), /* @__PURE__ */ M(
|
|
3184
3178
|
"div",
|
|
3185
3179
|
{
|
|
3186
|
-
onClick:
|
|
3180
|
+
onClick: S,
|
|
3187
3181
|
id: `page-${e}`,
|
|
3188
3182
|
className: We["rp-thumbnail-wrapper"],
|
|
3189
3183
|
ref: s,
|
|
@@ -3194,13 +3188,13 @@ const Ie = {
|
|
|
3194
3188
|
style: {
|
|
3195
3189
|
transform: `rotate(${i[e || 0]}deg)`
|
|
3196
3190
|
},
|
|
3197
|
-
className: re(
|
|
3191
|
+
className: re(C, We["rp-thumbnail"]),
|
|
3198
3192
|
children: u ? /* @__PURE__ */ a(
|
|
3199
3193
|
"img",
|
|
3200
3194
|
{
|
|
3201
3195
|
src: u,
|
|
3202
|
-
width:
|
|
3203
|
-
height:
|
|
3196
|
+
width: b.width,
|
|
3197
|
+
height: b.height,
|
|
3204
3198
|
alt: "thumbnail"
|
|
3205
3199
|
}
|
|
3206
3200
|
) : /* @__PURE__ */ a(
|
|
@@ -3208,10 +3202,10 @@ const Ie = {
|
|
|
3208
3202
|
{
|
|
3209
3203
|
className: We["rp-thumbnail-loader"],
|
|
3210
3204
|
style: {
|
|
3211
|
-
width: `${
|
|
3212
|
-
height: `${
|
|
3205
|
+
width: `${b.width}px`,
|
|
3206
|
+
height: `${b.height}px`
|
|
3213
3207
|
},
|
|
3214
|
-
children: /* @__PURE__ */ a(
|
|
3208
|
+
children: /* @__PURE__ */ a(Ct, {})
|
|
3215
3209
|
}
|
|
3216
3210
|
)
|
|
3217
3211
|
}
|
|
@@ -3223,36 +3217,36 @@ const Ie = {
|
|
|
3223
3217
|
}, sn = {
|
|
3224
3218
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
3225
3219
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
3226
|
-
},
|
|
3220
|
+
}, Qi = 16, Yi = (t, e) => {
|
|
3227
3221
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3228
|
-
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
3229
|
-
},
|
|
3222
|
+
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Qi);
|
|
3223
|
+
}, Ji = Ve((t, e) => {
|
|
3230
3224
|
const { show: n } = t, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages: i, addPage: s, thumbnailLength: l, addToPage: d } = Cn(), u = H(null), m = H(1);
|
|
3231
3225
|
cn(e, () => u.current);
|
|
3232
|
-
const P = W(() => Object.values(i), [i]),
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3226
|
+
const P = W(() => Object.values(i), [i]), f = E(() => {
|
|
3227
|
+
const C = l + 1;
|
|
3228
|
+
C <= r && s(C);
|
|
3235
3229
|
}, [s, r, l]);
|
|
3236
|
-
return
|
|
3237
|
-
o > l ? d(o) : n && m.current !== o && (
|
|
3238
|
-
}, [o, l, d, n, P]), Pr(u.current,
|
|
3239
|
-
var
|
|
3230
|
+
return D(() => {
|
|
3231
|
+
o > l ? d(o) : n && m.current !== o && (Yi(u.current, o), m.current = o);
|
|
3232
|
+
}, [o, l, d, n, P]), Pr(u.current, f), /* @__PURE__ */ a("div", { ref: u, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: sn["rp-thumbnails"], children: n ? P.map((C, b) => {
|
|
3233
|
+
var S, w;
|
|
3240
3234
|
return /* @__PURE__ */ a(
|
|
3241
|
-
|
|
3235
|
+
Xi,
|
|
3242
3236
|
{
|
|
3243
|
-
isFocused: o === ((
|
|
3244
|
-
pageNumber: (w =
|
|
3245
|
-
loading:
|
|
3246
|
-
viewport:
|
|
3247
|
-
defaultRotation:
|
|
3237
|
+
isFocused: o === ((S = C.page) == null ? void 0 : S.pageNumber),
|
|
3238
|
+
pageNumber: (w = C.page) == null ? void 0 : w.pageNumber,
|
|
3239
|
+
loading: C.loading,
|
|
3240
|
+
viewport: C.viewport,
|
|
3241
|
+
defaultRotation: C.defaultRotation
|
|
3248
3242
|
},
|
|
3249
|
-
|
|
3243
|
+
b
|
|
3250
3244
|
);
|
|
3251
3245
|
}) : null }) });
|
|
3252
|
-
}),
|
|
3246
|
+
}), ea = () => {
|
|
3253
3247
|
const { thumbnailIcon: t } = pe();
|
|
3254
3248
|
return t || /* @__PURE__ */ a(wr, {});
|
|
3255
|
-
},
|
|
3249
|
+
}, ta = () => {
|
|
3256
3250
|
const { active: t, setActive: e } = Cn(), [n, o] = G(200), r = H(null), { thumbnailTool: i, sidebarEnable: s } = ve(), { localeMessages: l } = se(), d = E(() => {
|
|
3257
3251
|
e((m) => !m);
|
|
3258
3252
|
}, []), u = W(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: d, active: t }) : i ? /* @__PURE__ */ a(Y, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
@@ -3261,25 +3255,25 @@ const Ie = {
|
|
|
3261
3255
|
onClick: d,
|
|
3262
3256
|
active: t,
|
|
3263
3257
|
"aria-label": l == null ? void 0 : l.thumbnailTooltip,
|
|
3264
|
-
children: /* @__PURE__ */ a(
|
|
3258
|
+
children: /* @__PURE__ */ a(ea, {})
|
|
3265
3259
|
}
|
|
3266
3260
|
) }) : null, [i, t, d, l]);
|
|
3267
3261
|
return /* @__PURE__ */ a(me, { children: s && /* @__PURE__ */ M(
|
|
3268
3262
|
"div",
|
|
3269
3263
|
{
|
|
3270
3264
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3271
|
-
className:
|
|
3265
|
+
className: gt["rp-sidebar-content-wrapper"],
|
|
3272
3266
|
"data-rp": "sidebar",
|
|
3273
3267
|
children: [
|
|
3274
|
-
/* @__PURE__ */ a("div", { className:
|
|
3268
|
+
/* @__PURE__ */ a("div", { className: gt["rp-sidebar-content"], children: u }),
|
|
3275
3269
|
/* @__PURE__ */ M(
|
|
3276
3270
|
"div",
|
|
3277
3271
|
{
|
|
3278
3272
|
"data-rp": "thumbnailSidebar",
|
|
3279
3273
|
hidden: !t,
|
|
3280
|
-
className:
|
|
3274
|
+
className: gt["rp-thumbnails-wrapper"],
|
|
3281
3275
|
children: [
|
|
3282
|
-
/* @__PURE__ */ a(
|
|
3276
|
+
/* @__PURE__ */ a(Ji, { show: t, ref: r }),
|
|
3283
3277
|
/* @__PURE__ */ a(Tr, { onWidthChange: o, thumbnailRef: r })
|
|
3284
3278
|
]
|
|
3285
3279
|
}
|
|
@@ -3287,7 +3281,7 @@ const Ie = {
|
|
|
3287
3281
|
]
|
|
3288
3282
|
}
|
|
3289
3283
|
) });
|
|
3290
|
-
},
|
|
3284
|
+
}, Js = Ve((t, e) => {
|
|
3291
3285
|
const {
|
|
3292
3286
|
children: n,
|
|
3293
3287
|
slots: o,
|
|
@@ -3298,21 +3292,21 @@ const Ie = {
|
|
|
3298
3292
|
onLoaded: d,
|
|
3299
3293
|
cleanupOnLoaded: u,
|
|
3300
3294
|
onLayoutWidthChange: m
|
|
3301
|
-
} = t, [P,
|
|
3302
|
-
return
|
|
3295
|
+
} = t, [P, f] = G(null), { setContainer: C, setContentRef: b } = ge(), { loading: S } = J(), { LoaderImageComponent: w } = hn();
|
|
3296
|
+
return D(() => (d && d(), () => {
|
|
3303
3297
|
u && u();
|
|
3304
|
-
}), [d, u]), /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Ir, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Cr, { slots: o, children: /* @__PURE__ */ a(yr, { icons: r, children: /* @__PURE__ */ M(Sr, { getContainerRef:
|
|
3298
|
+
}), [d, u]), /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Ir, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Cr, { slots: o, children: /* @__PURE__ */ a(yr, { icons: r, children: /* @__PURE__ */ M(Sr, { getContainerRef: C, style: i, className: s, children: [
|
|
3305
3299
|
/* @__PURE__ */ M(xr, { children: [
|
|
3306
3300
|
/* @__PURE__ */ M("div", { className: be["rp-layout"], children: [
|
|
3307
|
-
/* @__PURE__ */ a(
|
|
3301
|
+
/* @__PURE__ */ a(Ki, { ref: f }),
|
|
3308
3302
|
/* @__PURE__ */ M("div", { className: be["rp-content"], children: [
|
|
3309
|
-
/* @__PURE__ */ a("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ a(
|
|
3310
|
-
/* @__PURE__ */ a("div", { ref:
|
|
3303
|
+
/* @__PURE__ */ a("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ a(ta, {}) }),
|
|
3304
|
+
/* @__PURE__ */ a("div", { ref: b, className: be["rp-pages"], children: n })
|
|
3311
3305
|
] })
|
|
3312
3306
|
] }),
|
|
3313
3307
|
/* @__PURE__ */ a(br, {})
|
|
3314
3308
|
] }),
|
|
3315
|
-
|
|
3309
|
+
S ? /* @__PURE__ */ a(
|
|
3316
3310
|
"div",
|
|
3317
3311
|
{
|
|
3318
3312
|
className: be["rp-loader"],
|
|
@@ -3344,33 +3338,33 @@ const Ie = {
|
|
|
3344
3338
|
});
|
|
3345
3339
|
export {
|
|
3346
3340
|
Fo as A,
|
|
3347
|
-
|
|
3341
|
+
xi as B,
|
|
3348
3342
|
No as C,
|
|
3349
3343
|
ri as D,
|
|
3350
3344
|
Kn as E,
|
|
3351
3345
|
Bn as F,
|
|
3352
|
-
|
|
3346
|
+
Mi as G,
|
|
3353
3347
|
on as H,
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3348
|
+
Bi as I,
|
|
3349
|
+
ji as J,
|
|
3350
|
+
Ki as K,
|
|
3357
3351
|
Rn as L,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3352
|
+
ki as M,
|
|
3353
|
+
Xi as N,
|
|
3354
|
+
Wi as O,
|
|
3355
|
+
Vs as P,
|
|
3356
|
+
Ji as Q,
|
|
3357
|
+
Xs as R,
|
|
3358
|
+
js as S,
|
|
3359
|
+
Zs as T,
|
|
3360
|
+
ta as U,
|
|
3361
|
+
Vi as Z,
|
|
3362
|
+
Js as a,
|
|
3369
3363
|
qn as b,
|
|
3370
3364
|
tt as c,
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3365
|
+
It as d,
|
|
3366
|
+
Ks as e,
|
|
3367
|
+
Bs as f,
|
|
3374
3368
|
vn as g,
|
|
3375
3369
|
Io as h,
|
|
3376
3370
|
wn as i,
|
|
@@ -3383,10 +3377,10 @@ export {
|
|
|
3383
3377
|
Pn as p,
|
|
3384
3378
|
Tn as q,
|
|
3385
3379
|
yn as r,
|
|
3386
|
-
|
|
3380
|
+
zo as s,
|
|
3387
3381
|
Wo as t,
|
|
3388
3382
|
oe as u,
|
|
3389
|
-
|
|
3383
|
+
Rt as v,
|
|
3390
3384
|
ei as w,
|
|
3391
3385
|
oi as x,
|
|
3392
3386
|
ii as y,
|