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