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