@react-pdf-kit/viewer 2.0.0-beta.7 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ToolbarLayout.module-5b868e64.js → ToolbarLayout.module-8d56d12b.js} +164 -161
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +1 -1
- package/dist/components/RPController.js +5 -5
- package/dist/components/RPPages.js +5 -5
- package/dist/components/RPProvider.js +5 -5
- package/dist/components/layout/LayoutContainer.js +5 -5
- package/dist/components/layout/RPDefaultLayout.js +5 -5
- package/dist/components/layout/RPLayout.js +7 -7
- package/dist/components/layout/sidebar/RPSidebar.js +4 -4
- package/dist/components/layout/sidebar/Thumbnail.js +5 -5
- package/dist/components/layout/sidebar/Thumbnails.js +5 -5
- package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +5 -5
- package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +4 -4
- package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
- package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
- package/dist/components/layout/toolbar/MenuItem.js +3 -3
- package/dist/components/layout/toolbar/MenuSeparator.js +3 -3
- package/dist/components/layout/toolbar/MostPageTool.js +5 -5
- package/dist/components/layout/toolbar/OtherTool.js +4 -4
- package/dist/components/layout/toolbar/Paginate.js +4 -4
- package/dist/components/layout/toolbar/PrintTool.js +4 -4
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +4 -4
- package/dist/components/layout/toolbar/RPToolbar.js +5 -5
- package/dist/components/layout/toolbar/RPToolbarEnd.js +4 -4
- package/dist/components/layout/toolbar/RotateTool.js +3 -3
- package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +4 -4
- package/dist/components/layout/toolbar/SearchTool.js +4 -4
- package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
- package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
- package/dist/components/layout/toolbar/ToolbarCustom.js +5 -5
- package/dist/components/layout/toolbar/ToolbarDefault.js +5 -5
- package/dist/components/layout/toolbar/ToolbarLayout.js +5 -5
- package/dist/components/layout/toolbar/ViewModeTool.js +3 -3
- package/dist/components/layout/toolbar/ZoomTool.js +4 -4
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +4 -4
- package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +4 -4
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/InputPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/NextPageTool.js +5 -5
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/PrintTool.js +4 -4
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +5 -5
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +5 -5
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +5 -5
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +3 -3
- package/dist/components/page/AnnotationLayer.js +5 -5
- package/dist/components/page/CanvasLayer.js +5 -5
- package/dist/components/page/DualPage.js +5 -5
- package/dist/components/page/RPPage.js +5 -5
- package/dist/components/page/SinglePage.js +5 -5
- package/dist/components/page/TextHighlightLayer.js +5 -5
- package/dist/components/page/TextLayer.js +5 -5
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +3 -3
- package/dist/components/ui/LoadingIndicator.js +5 -5
- package/dist/components/ui/RPTooltip.js +118 -102
- package/dist/contexts/FullScreenContext.js +17 -10
- package/dist/contexts/LocalizationContext.js +24 -29
- package/dist/contexts/PaginationContext.js +5 -5
- package/dist/contexts/PrintContext.js +5 -5
- package/dist/contexts/RPDocumentContext.js +7 -7
- package/dist/contexts/RenderQueueProvider.js +5 -5
- package/dist/contexts/SearchContext.js +5 -5
- package/dist/contexts/ThumbnailsContext.js +5 -5
- package/dist/contexts/ZoomContext.js +22 -22
- package/dist/{floating-ui.react-dom-6b2fe0df.js → floating-ui.react-dom-d22a10b4.js} +3 -3
- package/dist/{index-f563c6f0.js → index-3bf64864.js} +97 -100
- package/dist/{index-35c7f4a2.js → index-c9a2990a.js} +3 -3
- package/dist/main.js +92 -94
- package/dist/types/main.d.ts +0 -2
- package/dist/utils/hooks/useFileDownload.js +5 -5
- package/dist/utils/hooks/useHighlight.js +28 -28
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLocalization.js +13 -13
- package/dist/utils/hooks/usePaginate.js +5 -5
- package/dist/utils/hooks/usePresentPage.js +5 -5
- package/dist/utils/hooks/usePrint.js +5 -5
- package/dist/utils/hooks/useScrollToPage.js +5 -5
- package/dist/utils/hooks/useSearch.js +5 -5
- package/dist/utils/hooks/useThumbnail.js +5 -5
- package/dist/utils/hooks/useVirtualReactWindow.js +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i, Fragment as pe, jsxs as W } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as M, useEffect as z, useCallback as N, useState as H, useMemo as
|
|
3
|
+
import { useRef as M, useEffect as z, useCallback as N, useState as H, useMemo as F, createContext as Ve, useContext as Be, useImperativeHandle as pn, createElement as Ke, PureComponent as lo, Component as uo, memo as hn, Fragment as po, forwardRef as ho } from "react";
|
|
4
4
|
import { ChevronUpIcon as Ue } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as ce } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as fn } from "./components/ui/Input.js";
|
|
@@ -22,7 +22,7 @@ import "./contexts/FileInputContext.js";
|
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
23
|
import { findMatches as Co, resetDivs as Po, highlightMatches as yo, isMatchEntireWord as Io } from "./utils/highlight.js";
|
|
24
24
|
import { useLayoutContainer as be } from "./contexts/LayoutContainerContext.js";
|
|
25
|
-
import { useDimensionPagesContext as
|
|
25
|
+
import { useDimensionPagesContext as je } from "./contexts/DimensionPagesContext.js";
|
|
26
26
|
import { useLocalizationContext as de } from "./contexts/LocalizationContext.js";
|
|
27
27
|
import { useHighlightContext as So } from "./contexts/HighlightContext.js";
|
|
28
28
|
import "./contexts/LicenseContext.js";
|
|
@@ -51,11 +51,11 @@ import { useToolbarComponentContext as Te, ToolbarComponentProvider as Go } from
|
|
|
51
51
|
import { RPSplitter as Uo } from "./components/layout/sidebar/RPSplitter.js";
|
|
52
52
|
import { WrapperLayout as Vo } from "./components/layout/WrapperLayout.js";
|
|
53
53
|
import { RPDropFileZone as Bo } from "./components/RPDropFileZone.js";
|
|
54
|
-
import { c as Ce, L as
|
|
55
|
-
import K from "./components/ui/RPTooltip.js";
|
|
54
|
+
import { c as Ce, L as jo } from "./LayoutWrapper-6224491f.js";
|
|
56
55
|
import { c as ne, S as Ht } from "./SearchCloseButton-08d57275.js";
|
|
57
56
|
import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
58
|
-
import { useIconContext as ge, IconProvider as
|
|
57
|
+
import { useIconContext as ge, IconProvider as Zo } from "./contexts/IconContext.js";
|
|
58
|
+
import K from "./components/ui/RPTooltip.js";
|
|
59
59
|
import { UIDropDown as St } from "./components/ui/DropDown.js";
|
|
60
60
|
import { MenuItem as Pe } from "./components/layout/toolbar/MenuItem.js";
|
|
61
61
|
import { MenuSeparator as xt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
@@ -85,9 +85,9 @@ import { appConsole as mr } from "./utils/appConsole.js";
|
|
|
85
85
|
import { FileUploadTool as wn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
86
86
|
import { DarkModeTool as gr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
87
87
|
import { ThreeDotIcon as vr } from "./components/icons/ThreeDotIcon.js";
|
|
88
|
-
import { c as wr, u as Et, P as
|
|
89
|
-
import { D as Cr,
|
|
90
|
-
import { a as Pr, h as yr, u as Ir, F as Sr, b as xr, G as Je } from "./index-
|
|
88
|
+
import { c as wr, u as Et, P as Ze, a as Ge, b as Nt, k as _r, e as br, i as Tr } from "./index-c9a2990a.js";
|
|
89
|
+
import { D as Cr, d as pt } from "./floating-ui.react-dom-d22a10b4.js";
|
|
90
|
+
import { a as Pr, h as yr, u as Ir, F as Sr, b as xr, G as Je } from "./index-3bf64864.js";
|
|
91
91
|
import { CloseIcon as Rr } from "./components/icons/CloseIcon.js";
|
|
92
92
|
import { DocumentProperties as Lr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
93
93
|
import { RotateTool as Er } from "./components/layout/toolbar/RotateTool.js";
|
|
@@ -103,9 +103,9 @@ import { ZoomOutIcon as kr } from "./components/icons/ZoomOutIcon.js";
|
|
|
103
103
|
import { isZoomOutDisabled as Wr, isZoomInDisabled as Mr } from "./utils/zoom.js";
|
|
104
104
|
import { SearchIcon as Tn } from "./components/icons/SearchIcon.js";
|
|
105
105
|
import { ClearIcon as Hr } from "./components/icons/ClearIcon.js";
|
|
106
|
-
import { InfoIcon as
|
|
106
|
+
import { InfoIcon as jt } from "./components/icons/InfoIcon.js";
|
|
107
107
|
const Cn = () => {
|
|
108
|
-
const { viewMode: t } = He(), { scrollMode: e } = ze(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = nt(), { setFocusedPage: a } = ue(), c = M(), { columnCount: d } = mn(), { widths: s, heights: m } =
|
|
108
|
+
const { viewMode: t } = He(), { scrollMode: e } = ze(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = nt(), { setFocusedPage: a } = ue(), c = M(), { columnCount: d } = mn(), { widths: s, heights: m } = je(), g = M(e), C = M(t), u = M(d), { targetScrollPage: v } = gn();
|
|
109
109
|
z(() => {
|
|
110
110
|
n != null && n.scrollToItem && (c.current = n);
|
|
111
111
|
}, [n]), z(() => {
|
|
@@ -203,7 +203,7 @@ const Cn = () => {
|
|
|
203
203
|
]
|
|
204
204
|
) };
|
|
205
205
|
}, $r = (t = 1) => {
|
|
206
|
-
const [e, n] = H(t), [r, o] = H(0), { scrollToPage: a } = Cn(), c = M(1), { viewMode: d } = He(), { scrollMode: s } = ze(), { widths: m } =
|
|
206
|
+
const [e, n] = H(t), [r, o] = H(0), { scrollToPage: a } = Cn(), c = M(1), { viewMode: d } = He(), { scrollMode: s } = ze(), { widths: m } = je(), { pagesRef: g } = be(), C = Lt(e, 100), u = N(
|
|
207
207
|
(h) => {
|
|
208
208
|
if (!/^[0-9]*$/g.test(h.toString()) || !h)
|
|
209
209
|
return { success: !1, currentPage: c.current };
|
|
@@ -226,7 +226,7 @@ const Cn = () => {
|
|
|
226
226
|
}, [d, m, g, r]), b = N(() => {
|
|
227
227
|
let h = e - 1;
|
|
228
228
|
T(h) && (h = e - 2), P(h);
|
|
229
|
-
}, [P, e, d, s, T]), y =
|
|
229
|
+
}, [P, e, d, s, T]), y = F(() => d === Oe.DUAL_PAGE && s === re.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, d, s]), p = N(() => {
|
|
230
230
|
if (y)
|
|
231
231
|
return;
|
|
232
232
|
let h = e + 1;
|
|
@@ -335,8 +335,8 @@ const Cn = () => {
|
|
|
335
335
|
};
|
|
336
336
|
try {
|
|
337
337
|
return A.render(R).promise;
|
|
338
|
-
} catch (
|
|
339
|
-
throw
|
|
338
|
+
} catch (k) {
|
|
339
|
+
throw k instanceof ko || console.error(k), k;
|
|
340
340
|
}
|
|
341
341
|
}, y = N(() => {
|
|
342
342
|
const l = window.print;
|
|
@@ -405,8 +405,8 @@ const Cn = () => {
|
|
|
405
405
|
P();
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
I.push(
|
|
408
|
+
const k = await p(_);
|
|
409
|
+
I.push(k);
|
|
410
410
|
const $ = parseFloat((I.length / O * 100).toFixed(2));
|
|
411
411
|
r({
|
|
412
412
|
loadedPages: A,
|
|
@@ -464,34 +464,37 @@ const Cn = () => {
|
|
|
464
464
|
}), vc = ({ children: t }) => {
|
|
465
465
|
const [e, n] = H(null), [r, o] = H(null), { print: a, cancel: c, progress: d, isComplete: s, isError: m, error: g, showDefaultProgress: C } = qr(), u = N((y) => {
|
|
466
466
|
y && typeof y == "function" && o(() => y);
|
|
467
|
-
}, []), v = (
|
|
468
|
-
g && y(g);
|
|
469
|
-
}, P = N(
|
|
467
|
+
}, []), v = N(
|
|
470
468
|
(y) => {
|
|
471
|
-
|
|
469
|
+
g && y(g);
|
|
472
470
|
},
|
|
473
|
-
[
|
|
474
|
-
)
|
|
471
|
+
[g]
|
|
472
|
+
), P = N((y) => {
|
|
473
|
+
n(() => y);
|
|
474
|
+
}, []), T = N(() => {
|
|
475
|
+
r && (r(), o(null));
|
|
476
|
+
}, [r]);
|
|
475
477
|
z(() => {
|
|
476
478
|
s && r && T();
|
|
477
|
-
}, [s, r]), z(() => {
|
|
479
|
+
}, [s, r, T]), z(() => {
|
|
478
480
|
m && v((y) => {
|
|
479
481
|
console.error(y);
|
|
480
482
|
});
|
|
481
483
|
}, [m]), z(() => {
|
|
482
484
|
d && e && e(d);
|
|
483
485
|
}, [d, e]);
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
486
|
+
const b = F(
|
|
487
|
+
() => ({
|
|
488
|
+
print: a,
|
|
489
|
+
cancel: c,
|
|
490
|
+
setOnProgress: P,
|
|
491
|
+
setOnComplete: u,
|
|
492
|
+
setOnError: v,
|
|
493
|
+
progress: d,
|
|
494
|
+
showDefaultProgress: C
|
|
495
|
+
}),
|
|
496
|
+
[a, c, P, u, v, d, C]
|
|
497
|
+
);
|
|
495
498
|
return /* @__PURE__ */ i(yn.Provider, { value: b, children: t });
|
|
496
499
|
}, it = () => {
|
|
497
500
|
const t = Be(yn);
|
|
@@ -499,7 +502,7 @@ const Cn = () => {
|
|
|
499
502
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
500
503
|
return t;
|
|
501
504
|
}, Gr = () => {
|
|
502
|
-
const [t, e] = H({}), { pages: n } = oe(), r =
|
|
505
|
+
const [t, e] = H({}), { pages: n } = oe(), r = F(() => Object.keys(t).length, [t]), o = N(
|
|
503
506
|
(c) => {
|
|
504
507
|
if (!n.size)
|
|
505
508
|
return;
|
|
@@ -562,15 +565,15 @@ const Cn = () => {
|
|
|
562
565
|
}
|
|
563
566
|
);
|
|
564
567
|
}, Ur = (t = {}, e = "") => {
|
|
565
|
-
const [n, r] = H(e), [o, a] = H(!1), { pdf: c, pages: d } = oe(), { widths: s, heights: m } =
|
|
568
|
+
const [n, r] = H(e), [o, a] = H(!1), { pdf: c, pages: d } = oe(), { widths: s, heights: m } = je(), g = M(!n), { currentZoom: C } = tt(), [u, v] = H([]), { setFocusedPage: P } = ue(), { columnCount: T } = He(), { pageRotate: b } = ot(), [y, p] = H(0), { pageScrollElementRef: h, virtualScrollableElementRef: f } = nt(), { scrollMode: l } = ze(), { pagesRef: w } = be(), _ = M({}), I = M(0), x = F(() => y === 0 ? null : u[y - 1], [y, u]), S = F(() => u.length, [u]), L = N(
|
|
566
569
|
(E) => {
|
|
567
570
|
if (E === 0)
|
|
568
571
|
return;
|
|
569
572
|
const R = u[E - 1];
|
|
570
573
|
if (!R || !d)
|
|
571
574
|
return;
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
575
|
+
const k = f || h;
|
|
576
|
+
if (!k || !w)
|
|
574
577
|
return;
|
|
575
578
|
const $ = d.get(R.page);
|
|
576
579
|
if (l === re.PAGE_SCROLLING && P(R.page), !$)
|
|
@@ -581,11 +584,11 @@ const Cn = () => {
|
|
|
581
584
|
q = We(m, fe), G = We(s, ve);
|
|
582
585
|
}
|
|
583
586
|
l === re.HORIZONTAL_SCROLLING && (G = s.slice(0, R.page - 1).reduce((ee, Y) => ee + Y, 0));
|
|
584
|
-
const
|
|
587
|
+
const j = {
|
|
585
588
|
height: m[R.page - 1],
|
|
586
589
|
width: s[R.page - 1]
|
|
587
590
|
}, V = b[R.page], { leftInPage: ie, topInPage: U } = hr(
|
|
588
|
-
|
|
591
|
+
j,
|
|
589
592
|
w,
|
|
590
593
|
R.rect,
|
|
591
594
|
C,
|
|
@@ -594,7 +597,7 @@ const Cn = () => {
|
|
|
594
597
|
left: Math.max(Q, 0),
|
|
595
598
|
top: Math.max(J, 0)
|
|
596
599
|
};
|
|
597
|
-
|
|
600
|
+
k.scrollTo({
|
|
598
601
|
...te,
|
|
599
602
|
behavior: "smooth"
|
|
600
603
|
});
|
|
@@ -627,14 +630,14 @@ const Cn = () => {
|
|
|
627
630
|
}, [S, L]), A = N(async (E) => {
|
|
628
631
|
if (!E)
|
|
629
632
|
return {};
|
|
630
|
-
const R = E.numPages,
|
|
633
|
+
const R = E.numPages, k = {};
|
|
631
634
|
for (let $ = 1; $ <= R; $++) {
|
|
632
635
|
if (g.current)
|
|
633
636
|
throw "close pop over";
|
|
634
637
|
const q = await E.getPage($);
|
|
635
|
-
|
|
638
|
+
k[$.toString()] = await q.getTextContent();
|
|
636
639
|
}
|
|
637
|
-
return
|
|
640
|
+
return k;
|
|
638
641
|
}, []);
|
|
639
642
|
return z(() => {
|
|
640
643
|
if (!n) {
|
|
@@ -643,16 +646,16 @@ const Cn = () => {
|
|
|
643
646
|
}
|
|
644
647
|
g.current = !1, a(!0), v([]), p(0), A(c).then((E) => {
|
|
645
648
|
_.current = E;
|
|
646
|
-
const
|
|
649
|
+
const k = Object.keys(E).reduce(($, q) => {
|
|
647
650
|
const G = Co(
|
|
648
651
|
[n],
|
|
649
652
|
E[q],
|
|
650
653
|
Number(q) - 1,
|
|
651
654
|
t
|
|
652
|
-
).map((
|
|
655
|
+
).map((j, V) => ({ ...j, page: Number(q), pageMatchIdx: V }));
|
|
653
656
|
return [...$, ...G];
|
|
654
657
|
}, []);
|
|
655
|
-
v(
|
|
658
|
+
v(k), p(k.length ? 1 : 0);
|
|
656
659
|
}).catch(() => {
|
|
657
660
|
v([]), p(0);
|
|
658
661
|
}).finally(() => a(!1));
|
|
@@ -723,7 +726,7 @@ const Cn = () => {
|
|
|
723
726
|
}, Ot = () => Be(xn), Rn = Ve(null), bc = ({ children: t }) => {
|
|
724
727
|
const e = M(!1), [n, r] = H([]), o = N((s) => {
|
|
725
728
|
r((m) => [...m, { id: s.page.pageNumber.toString(), data: s, priority: 0 }]);
|
|
726
|
-
}, []), a =
|
|
729
|
+
}, []), a = F(() => new Ro(o), [o]), { focusedPage: c } = ue(), d = N((s) => (e.current = !0, Lo(
|
|
727
730
|
s.data.page,
|
|
728
731
|
s.data.canvasElem,
|
|
729
732
|
s.data.options
|
|
@@ -795,15 +798,15 @@ const Cn = () => {
|
|
|
795
798
|
g.removeQueue(C.current);
|
|
796
799
|
};
|
|
797
800
|
}, [a, e, c, s, r, n, g, m]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
|
|
798
|
-
}, Br = "
|
|
799
|
-
"rp-text-layer": "_rp-text-
|
|
801
|
+
}, Br = "_selecting_1553j_14", jr = "_markedContent_1553j_37", we = {
|
|
802
|
+
"rp-text-layer": "_rp-text-layer_1553j_1",
|
|
800
803
|
selecting: Br,
|
|
801
|
-
markedContent:
|
|
802
|
-
"rp-text-layer-text": "_rp-text-layer-
|
|
803
|
-
},
|
|
804
|
+
markedContent: jr,
|
|
805
|
+
"rp-text-layer-text": "_rp-text-layer-text_1553j_61"
|
|
806
|
+
}, Zr = (t) => {
|
|
804
807
|
const { pageNumber: e } = t, { pages: n } = oe(), r = M(null), { matches: o, currentMatch: a } = Ot(), [c, d] = H(
|
|
805
808
|
[]
|
|
806
|
-
), s = M(), m = M(), g = M([]), C =
|
|
809
|
+
), s = M(), m = M(), g = M([]), C = F(() => o.filter((p) => p.pageIndex === e - 1), [o, e]), u = N(
|
|
807
810
|
(p, h, f = !1) => {
|
|
808
811
|
if (f && Po(p, h), !C.length) {
|
|
809
812
|
g.current = [], d([]);
|
|
@@ -864,8 +867,8 @@ const Cn = () => {
|
|
|
864
867
|
const _ = /* @__PURE__ */ new Set();
|
|
865
868
|
for (let E = 0; E < w.rangeCount; E++) {
|
|
866
869
|
const R = w.getRangeAt(E);
|
|
867
|
-
T().forEach((
|
|
868
|
-
R.intersectsNode(
|
|
870
|
+
T().forEach((k) => {
|
|
871
|
+
R.intersectsNode(k) && !_.has(k) && _.add(k);
|
|
869
872
|
});
|
|
870
873
|
}
|
|
871
874
|
T().forEach((E) => {
|
|
@@ -958,7 +961,7 @@ const Cn = () => {
|
|
|
958
961
|
};
|
|
959
962
|
let Xr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
960
963
|
const Qr = (t) => {
|
|
961
|
-
const { pageNumber: e } = t, n = M(null), { pages: r, pdf: o } = oe(), { interactiveForm: a } = yt(), c = M(), [d, s] = H(), { goToPage: m } = ue(), { scrollMode: g } = ze(), { print: C } = it(), { download: u } =
|
|
964
|
+
const { pageNumber: e } = t, n = M(null), { pages: r, pdf: o } = oe(), { interactiveForm: a } = yt(), c = M(), [d, s] = H(), { goToPage: m } = ue(), { scrollMode: g } = ze(), { print: C } = it(), { download: u } = Zn(), v = F(() => r.get(e), [r, e]), P = F(() => v == null ? void 0 : v.page.getViewport(), [v]);
|
|
962
965
|
z(() => {
|
|
963
966
|
c.current && (c.current.div.replaceChildren(), c.current = void 0);
|
|
964
967
|
}, [o]), z(() => {
|
|
@@ -1060,7 +1063,7 @@ const Qr = (t) => {
|
|
|
1060
1063
|
r(f);
|
|
1061
1064
|
})();
|
|
1062
1065
|
}, [o, t]);
|
|
1063
|
-
const u =
|
|
1066
|
+
const u = F(() => a ? a.map((p) => {
|
|
1064
1067
|
var h, f;
|
|
1065
1068
|
return {
|
|
1066
1069
|
...nr(p.keyword, (h = p.options) == null ? void 0 : h.matchCase, (f = p.options) == null ? void 0 : f.wholeWords),
|
|
@@ -1111,11 +1114,11 @@ const Qr = (t) => {
|
|
|
1111
1114
|
w.setStart(_, x), w.setEnd(_, S + 1);
|
|
1112
1115
|
const L = document.createElement("span");
|
|
1113
1116
|
L.style.width = "auto", w.surroundContents(L);
|
|
1114
|
-
const O = L.getBoundingClientRect(), D = p.getBoundingClientRect(), A = D.height, E = D.width, R = 100 * (O.left - D.left) / E,
|
|
1117
|
+
const O = L.getBoundingClientRect(), D = p.getBoundingClientRect(), A = D.height, E = D.width, R = 100 * (O.left - D.left) / E, k = 100 * (O.top - D.top) / A, $ = 100 * O.height / A, q = 100 * O.width / E;
|
|
1115
1118
|
return rr(L), {
|
|
1116
1119
|
keywordStr: h,
|
|
1117
1120
|
left: R,
|
|
1118
|
-
top:
|
|
1121
|
+
top: k,
|
|
1119
1122
|
height: $,
|
|
1120
1123
|
width: q,
|
|
1121
1124
|
pageHeight: A,
|
|
@@ -1158,26 +1161,26 @@ const Qr = (t) => {
|
|
|
1158
1161
|
return;
|
|
1159
1162
|
const E = L.flags.indexOf("g") === -1 ? new RegExp(L, `${L.flags}g`) : L;
|
|
1160
1163
|
let R;
|
|
1161
|
-
const
|
|
1164
|
+
const k = [];
|
|
1162
1165
|
for (; (R = E.exec(I)) !== null; )
|
|
1163
|
-
O && !Io(I, R.index, R[0].length) ||
|
|
1166
|
+
O && !Io(I, R.index, R[0].length) || k.push({
|
|
1164
1167
|
keyword: E,
|
|
1165
1168
|
startIndex: R.index,
|
|
1166
1169
|
endIndex: E.lastIndex
|
|
1167
1170
|
});
|
|
1168
|
-
const $ =
|
|
1171
|
+
const $ = k.map((q) => ({
|
|
1169
1172
|
keyword: q.keyword,
|
|
1170
1173
|
indexes: l.slice(q.startIndex, q.endIndex),
|
|
1171
1174
|
color: D
|
|
1172
1175
|
}));
|
|
1173
1176
|
for (const q of $) {
|
|
1174
1177
|
const G = q.indexes.reduce(
|
|
1175
|
-
(
|
|
1178
|
+
(j, V) => (j[V.spanIdx] = (j[V.spanIdx] || []).concat([V]), j),
|
|
1176
1179
|
{}
|
|
1177
1180
|
);
|
|
1178
|
-
for (const
|
|
1179
|
-
if (
|
|
1180
|
-
const V =
|
|
1181
|
+
for (const j of Object.values(G))
|
|
1182
|
+
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1183
|
+
const V = j, ie = f[V[0].spanIdx], U = T(
|
|
1181
1184
|
p,
|
|
1182
1185
|
A,
|
|
1183
1186
|
ie,
|
|
@@ -1225,7 +1228,7 @@ const Qr = (t) => {
|
|
|
1225
1228
|
height: 0
|
|
1226
1229
|
});
|
|
1227
1230
|
pn(e, () => v.current);
|
|
1228
|
-
const b =
|
|
1231
|
+
const b = F(() => g.current ? c[n] : 0, [n, c]);
|
|
1229
1232
|
z(() => {
|
|
1230
1233
|
if (a && (g.current = a.get(n), g.current)) {
|
|
1231
1234
|
const f = g.current.page.getViewport({
|
|
@@ -1235,7 +1238,7 @@ const Qr = (t) => {
|
|
|
1235
1238
|
T(f);
|
|
1236
1239
|
}
|
|
1237
1240
|
}, [a, n, b, s]);
|
|
1238
|
-
const y =
|
|
1241
|
+
const y = F(() => {
|
|
1239
1242
|
switch (b) {
|
|
1240
1243
|
case 90:
|
|
1241
1244
|
return `${P.width / 2}px ${P.width / 2}px`;
|
|
@@ -1278,7 +1281,7 @@ const Qr = (t) => {
|
|
|
1278
1281
|
/* @__PURE__ */ i(Vr, { onLoading: p, onLoaded: h, pageNumber: n }),
|
|
1279
1282
|
C && m && /* @__PURE__ */ i("div", { className: ht["rp-loader-wrapper"], children: /* @__PURE__ */ i(m, {}) }),
|
|
1280
1283
|
/* @__PURE__ */ i(ir, { pageNumber: n }),
|
|
1281
|
-
d && /* @__PURE__ */ i(
|
|
1284
|
+
d && /* @__PURE__ */ i(Zr, { pageNumber: n }),
|
|
1282
1285
|
/* @__PURE__ */ i(Jr, { pageNumber: n, viewport: P }),
|
|
1283
1286
|
/* @__PURE__ */ i(Qr, { pageNumber: n })
|
|
1284
1287
|
]
|
|
@@ -1297,7 +1300,7 @@ function bt() {
|
|
|
1297
1300
|
return t;
|
|
1298
1301
|
}, bt.apply(null, arguments);
|
|
1299
1302
|
}
|
|
1300
|
-
function
|
|
1303
|
+
function Zt(t) {
|
|
1301
1304
|
if (t === void 0)
|
|
1302
1305
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1303
1306
|
return t;
|
|
@@ -1395,8 +1398,8 @@ function ci(t) {
|
|
|
1395
1398
|
ei(p, y);
|
|
1396
1399
|
function p(f) {
|
|
1397
1400
|
var l;
|
|
1398
|
-
return l = y.call(this, f) || this, l._instanceProps = P(l.props,
|
|
1399
|
-
instance:
|
|
1401
|
+
return l = y.call(this, f) || this, l._instanceProps = P(l.props, Zt(l)), l._resetIsScrollingTimeoutId = null, l._outerRef = void 0, l.state = {
|
|
1402
|
+
instance: Zt(l),
|
|
1400
1403
|
isScrolling: !1,
|
|
1401
1404
|
horizontalScrollDirection: "forward",
|
|
1402
1405
|
scrollLeft: typeof l.props.initialScrollLeft == "number" ? l.props.initialScrollLeft : 0,
|
|
@@ -1456,12 +1459,12 @@ function ci(t) {
|
|
|
1456
1459
|
break;
|
|
1457
1460
|
}
|
|
1458
1461
|
R = Math.max(0, Math.min(R, D - x));
|
|
1459
|
-
var
|
|
1462
|
+
var k = Math.max(0, Math.min(L, O - I));
|
|
1460
1463
|
return {
|
|
1461
1464
|
isScrolling: !0,
|
|
1462
1465
|
horizontalScrollDirection: A.scrollLeft < S ? "forward" : "backward",
|
|
1463
1466
|
scrollLeft: R,
|
|
1464
|
-
scrollTop:
|
|
1467
|
+
scrollTop: k,
|
|
1465
1468
|
verticalScrollDirection: A.scrollTop < L ? "forward" : "backward",
|
|
1466
1469
|
scrollUpdateWasRequested: !1
|
|
1467
1470
|
};
|
|
@@ -1495,12 +1498,12 @@ function ci(t) {
|
|
|
1495
1498
|
};
|
|
1496
1499
|
}, this._resetIsScrollingDebounced);
|
|
1497
1500
|
}, h.scrollToItem = function(l) {
|
|
1498
|
-
var w = l.align, _ = w === void 0 ? "auto" : w, I = l.columnIndex, x = l.rowIndex, S = this.props, L = S.columnCount, O = S.height, D = S.rowCount, A = S.width, E = this.state, R = E.scrollLeft,
|
|
1501
|
+
var w = l.align, _ = w === void 0 ? "auto" : w, I = l.columnIndex, x = l.rowIndex, S = this.props, L = S.columnCount, O = S.height, D = S.rowCount, A = S.width, E = this.state, R = E.scrollLeft, k = E.scrollTop, $ = ii();
|
|
1499
1502
|
I !== void 0 && (I = Math.max(0, Math.min(I, L - 1))), x !== void 0 && (x = Math.max(0, Math.min(x, D - 1)));
|
|
1500
|
-
var q = c(this.props, this._instanceProps), G = d(this.props, this._instanceProps),
|
|
1503
|
+
var q = c(this.props, this._instanceProps), G = d(this.props, this._instanceProps), j = G > A ? $ : 0, V = q > O ? $ : 0;
|
|
1501
1504
|
this.scrollTo({
|
|
1502
1505
|
scrollLeft: I !== void 0 ? s(this.props, I, _, R, this._instanceProps, V) : R,
|
|
1503
|
-
scrollTop: x !== void 0 ? m(this.props, x, _,
|
|
1506
|
+
scrollTop: x !== void 0 ? m(this.props, x, _, k, this._instanceProps, j) : k
|
|
1504
1507
|
});
|
|
1505
1508
|
}, h.componentDidMount = function() {
|
|
1506
1509
|
var l = this.props, w = l.initialScrollLeft, _ = l.initialScrollTop;
|
|
@@ -1534,14 +1537,14 @@ function ci(t) {
|
|
|
1534
1537
|
}, h.componentWillUnmount = function() {
|
|
1535
1538
|
this._resetIsScrollingTimeoutId !== null && Yt(this._resetIsScrollingTimeoutId);
|
|
1536
1539
|
}, h.render = function() {
|
|
1537
|
-
var l = this.props, w = l.children, _ = l.className, I = l.columnCount, x = l.direction, S = l.height, L = l.innerRef, O = l.innerElementType, D = l.innerTagName, A = l.itemData, E = l.itemKey, R = E === void 0 ? si : E,
|
|
1540
|
+
var l = this.props, w = l.children, _ = l.className, I = l.columnCount, x = l.direction, S = l.height, L = l.innerRef, O = l.innerElementType, D = l.innerTagName, A = l.itemData, E = l.itemKey, R = E === void 0 ? si : E, k = l.outerElementType, $ = l.outerTagName, q = l.rowCount, G = l.style, j = l.useIsScrolling, V = l.width, ie = this.state.isScrolling, U = this._getHorizontalRangeToRender(), Q = U[0], J = U[1], te = this._getVerticalRangeToRender(), ee = te[0], Y = te[1], ve = [];
|
|
1538
1541
|
if (I > 0 && q)
|
|
1539
1542
|
for (var fe = ee; fe <= Y; fe++)
|
|
1540
1543
|
for (var Se = Q; Se <= J; Se++)
|
|
1541
1544
|
ve.push(Ke(w, {
|
|
1542
1545
|
columnIndex: Se,
|
|
1543
1546
|
data: A,
|
|
1544
|
-
isScrolling:
|
|
1547
|
+
isScrolling: j ? ie : void 0,
|
|
1545
1548
|
key: R({
|
|
1546
1549
|
columnIndex: Se,
|
|
1547
1550
|
data: A,
|
|
@@ -1551,7 +1554,7 @@ function ci(t) {
|
|
|
1551
1554
|
style: this._getItemStyle(fe, Se)
|
|
1552
1555
|
}));
|
|
1553
1556
|
var xe = c(this.props, this._instanceProps), st = d(this.props, this._instanceProps);
|
|
1554
|
-
return Ke(
|
|
1557
|
+
return Ke(k || $ || "div", {
|
|
1555
1558
|
className: _,
|
|
1556
1559
|
onScroll: this._onScroll,
|
|
1557
1560
|
ref: this._outerRefSetter,
|
|
@@ -1576,25 +1579,25 @@ function ci(t) {
|
|
|
1576
1579
|
}, h._callPropsCallbacks = function() {
|
|
1577
1580
|
var l = this.props, w = l.columnCount, _ = l.onItemsRendered, I = l.onScroll, x = l.rowCount;
|
|
1578
1581
|
if (typeof _ == "function" && w > 0 && x > 0) {
|
|
1579
|
-
var S = this._getHorizontalRangeToRender(), L = S[0], O = S[1], D = S[2], A = S[3], E = this._getVerticalRangeToRender(), R = E[0],
|
|
1580
|
-
this._callOnItemsRendered(L, O, R,
|
|
1582
|
+
var S = this._getHorizontalRangeToRender(), L = S[0], O = S[1], D = S[2], A = S[3], E = this._getVerticalRangeToRender(), R = E[0], k = E[1], $ = E[2], q = E[3];
|
|
1583
|
+
this._callOnItemsRendered(L, O, R, k, D, A, $, q);
|
|
1581
1584
|
}
|
|
1582
1585
|
if (typeof I == "function") {
|
|
1583
|
-
var G = this.state,
|
|
1584
|
-
this._callOnScroll(V, ie,
|
|
1586
|
+
var G = this.state, j = G.horizontalScrollDirection, V = G.scrollLeft, ie = G.scrollTop, U = G.scrollUpdateWasRequested, Q = G.verticalScrollDirection;
|
|
1587
|
+
this._callOnScroll(V, ie, j, Q, U);
|
|
1585
1588
|
}
|
|
1586
1589
|
}, h._getHorizontalRangeToRender = function() {
|
|
1587
1590
|
var l = this.props, w = l.columnCount, _ = l.overscanColumnCount, I = l.overscanColumnsCount, x = l.overscanCount, S = l.rowCount, L = this.state, O = L.horizontalScrollDirection, D = L.isScrolling, A = L.scrollLeft, E = _ || I || x || 1;
|
|
1588
1591
|
if (w === 0 || S === 0)
|
|
1589
1592
|
return [0, 0, 0, 0];
|
|
1590
|
-
var R = r(this.props, A, this._instanceProps),
|
|
1591
|
-
return [Math.max(0, R - $), Math.max(0, Math.min(w - 1,
|
|
1593
|
+
var R = r(this.props, A, this._instanceProps), k = o(this.props, R, A, this._instanceProps), $ = !D || O === "backward" ? Math.max(1, E) : 1, q = !D || O === "forward" ? Math.max(1, E) : 1;
|
|
1594
|
+
return [Math.max(0, R - $), Math.max(0, Math.min(w - 1, k + q)), R, k];
|
|
1592
1595
|
}, h._getVerticalRangeToRender = function() {
|
|
1593
1596
|
var l = this.props, w = l.columnCount, _ = l.overscanCount, I = l.overscanRowCount, x = l.overscanRowsCount, S = l.rowCount, L = this.state, O = L.isScrolling, D = L.verticalScrollDirection, A = L.scrollTop, E = I || x || _ || 1;
|
|
1594
1597
|
if (w === 0 || S === 0)
|
|
1595
1598
|
return [0, 0, 0, 0];
|
|
1596
|
-
var R = u(this.props, A, this._instanceProps),
|
|
1597
|
-
return [Math.max(0, R - $), Math.max(0, Math.min(S - 1,
|
|
1599
|
+
var R = u(this.props, A, this._instanceProps), k = v(this.props, R, A, this._instanceProps), $ = !O || D === "backward" ? Math.max(1, E) : 1, q = !O || D === "forward" ? Math.max(1, E) : 1;
|
|
1600
|
+
return [Math.max(0, R - $), Math.max(0, Math.min(S - 1, k + q)), R, k];
|
|
1598
1601
|
}, p;
|
|
1599
1602
|
}(lo), e.defaultProps = {
|
|
1600
1603
|
direction: "ltr",
|
|
@@ -1771,7 +1774,7 @@ function fi(t, e) {
|
|
|
1771
1774
|
return !on(n, o) && !on(r, a);
|
|
1772
1775
|
}
|
|
1773
1776
|
const mi = () => {
|
|
1774
|
-
const { viewMode: t } = He(), { scrollMode: e } = ze(), { setColumnCount: n } = mn(), { virtualScrollableElementRef: r } = nt(), o =
|
|
1777
|
+
const { viewMode: t } = He(), { scrollMode: e } = ze(), { setColumnCount: n } = mn(), { virtualScrollableElementRef: r } = nt(), o = je(), a = F(() => o.heights.length, [o.heights]), c = F(() => e === re.HORIZONTAL_SCROLLING ? a : t === Oe.DUAL_PAGE ? 2 : 1, [t, e, e, a, r]), d = F(() => o.widths.reduce((b, y, p) => {
|
|
1775
1778
|
const h = p % c;
|
|
1776
1779
|
return (!b[h] || y > b[h]) && (b[h] = y), b;
|
|
1777
1780
|
}, []), [o.widths, c]), s = N(
|
|
@@ -1793,13 +1796,13 @@ const mi = () => {
|
|
|
1793
1796
|
z(() => {
|
|
1794
1797
|
n(c);
|
|
1795
1798
|
}, [c, n]);
|
|
1796
|
-
const g =
|
|
1799
|
+
const g = F(() => e === re.HORIZONTAL_SCROLLING || e === re.PAGE_SCROLLING ? 1 : Math.round(a / c), [c, a, e]), C = F(() => o.heights.reduce((T, b) => T + b, 0) / o.heights.length || 0, [o]), u = F(() => o.widths.reduce((T, b) => T + b, 0) / o.widths.length || 0, [o]), v = F(() => {
|
|
1797
1800
|
const { rowsHeight: T, columnsWidth: b } = Rt(o, c);
|
|
1798
1801
|
return {
|
|
1799
1802
|
rowsHeight: T,
|
|
1800
1803
|
columnsWidth: b
|
|
1801
1804
|
};
|
|
1802
|
-
}, [o, c]), P =
|
|
1805
|
+
}, [o, c]), P = F(() => ({
|
|
1803
1806
|
width: v.columnsWidth.reduce((T, b) => T + b, 0),
|
|
1804
1807
|
height: v.rowsHeight.reduce((T, b) => T + b, 0)
|
|
1805
1808
|
}), [v]);
|
|
@@ -1988,14 +1991,14 @@ class vi extends uo {
|
|
|
1988
1991
|
}
|
|
1989
1992
|
}
|
|
1990
1993
|
const wi = hn(({ widths: t, heights: e }) => {
|
|
1991
|
-
const { focusedPage: n, totalPages: r } = ue(), o =
|
|
1994
|
+
const { focusedPage: n, totalPages: r } = ue(), o = F(() => {
|
|
1992
1995
|
const d = [], s = Math.ceil(n / 2) * 2 - 1;
|
|
1993
1996
|
if (d.push(s), s + 1 <= r) {
|
|
1994
1997
|
const m = s + 1;
|
|
1995
1998
|
d.push(m);
|
|
1996
1999
|
}
|
|
1997
2000
|
return d;
|
|
1998
|
-
}, [n, r]), a =
|
|
2001
|
+
}, [n, r]), a = F(() => {
|
|
1999
2002
|
const d = n % 2 === 1 ? n - 1 : n - 2, s = Math.floor(d / 2), m = e(s), g = t(d), C = t(d + 1);
|
|
2000
2003
|
return [
|
|
2001
2004
|
{
|
|
@@ -2011,14 +2014,14 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2011
2014
|
height: m
|
|
2012
2015
|
}
|
|
2013
2016
|
];
|
|
2014
|
-
}, [t, e, o]), c =
|
|
2017
|
+
}, [t, e, o]), c = F(() => a.reduce((d, s) => d + Number(s.width || 0), 0), [a]);
|
|
2015
2018
|
return /* @__PURE__ */ i("div", { style: { width: c, position: "relative" }, children: o.map((d, s) => /* @__PURE__ */ i(Dt, { style: a[s], pageNumber: d }, d)) });
|
|
2016
2019
|
}), _i = ({ widths: t, heights: e }) => {
|
|
2017
|
-
const { focusedPage: n } = ue(), r =
|
|
2020
|
+
const { focusedPage: n } = ue(), r = F(() => ({
|
|
2018
2021
|
position: "absolute",
|
|
2019
2022
|
width: t(n - 1),
|
|
2020
2023
|
height: e(n - 1)
|
|
2021
|
-
}), [t, e, n]), o =
|
|
2024
|
+
}), [t, e, n]), o = F(() => t(n - 1), [t]);
|
|
2022
2025
|
return /* @__PURE__ */ i(
|
|
2023
2026
|
"div",
|
|
2024
2027
|
{
|
|
@@ -2030,7 +2033,7 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2030
2033
|
}
|
|
2031
2034
|
);
|
|
2032
2035
|
}, bi = (t, e, n) => {
|
|
2033
|
-
const r = M(), { contentRef: o } = be(), { heights: a, widths: c } =
|
|
2036
|
+
const r = M(), { contentRef: o } = be(), { heights: a, widths: c } = je(), { setFocusedPage: d } = ue(), [s, m] = H([]), { targetScrollPage: g } = gn(), C = Lt(s, 0, 500), u = F(() => {
|
|
2034
2037
|
const { rowsHeight: P, columnsWidth: T } = Rt({ heights: a, widths: c }, t);
|
|
2035
2038
|
return a.map((b, y) => {
|
|
2036
2039
|
const p = c[y], h = ar(y + 1, t), f = T.slice(0, h.columnIndex).reduce((I, x) => I + x, 0), l = P.slice(0, h.rowIndex).reduce((I, x) => I + x, 0), w = f + p, _ = l + b;
|
|
@@ -2124,11 +2127,11 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2124
2127
|
viewMode: w,
|
|
2125
2128
|
scrollMode: l
|
|
2126
2129
|
}), A = M(!1), E = M(), { isFullScreen: R } = To(), {
|
|
2127
|
-
pageDimension:
|
|
2130
|
+
pageDimension: k,
|
|
2128
2131
|
rowCount: $,
|
|
2129
2132
|
rowHeight: q,
|
|
2130
2133
|
columnCount: G,
|
|
2131
|
-
columnWidth:
|
|
2134
|
+
columnWidth: j,
|
|
2132
2135
|
estimatedColumnWidth: V,
|
|
2133
2136
|
estimatedRowHeight: ie,
|
|
2134
2137
|
totalDimension: U
|
|
@@ -2141,12 +2144,12 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2141
2144
|
dr(o);
|
|
2142
2145
|
const { isPressed: Y } = cr(), { selectionMode: ve } = bo(), { initializeGrabScroll: fe, resetGrabState: Se } = lr({
|
|
2143
2146
|
isPressed: Y
|
|
2144
|
-
}), xe =
|
|
2147
|
+
}), xe = F(() => ve === mo.HAND, [ve]), st = F(() => ({
|
|
2145
2148
|
columnCount: G
|
|
2146
2149
|
}), [G]), ct = N(
|
|
2147
2150
|
(B) => {
|
|
2148
|
-
const
|
|
2149
|
-
!R &&
|
|
2151
|
+
const Z = document.activeElement !== o;
|
|
2152
|
+
!R && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), p()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(), y()));
|
|
2150
2153
|
},
|
|
2151
2154
|
[y, p, R, l]
|
|
2152
2155
|
);
|
|
@@ -2155,18 +2158,18 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2155
2158
|
}), [ct]), z(() => {
|
|
2156
2159
|
if (_.current && (_.current.style.position = "relative"), !!s)
|
|
2157
2160
|
for (let B = 0; B < $; B++)
|
|
2158
|
-
for (let
|
|
2161
|
+
for (let Z = 0; Z < G; Z++)
|
|
2159
2162
|
s.resetAfterIndices({
|
|
2160
|
-
columnIndex:
|
|
2163
|
+
columnIndex: Z,
|
|
2161
2164
|
rowIndex: B,
|
|
2162
2165
|
shouldForceUpdate: !0
|
|
2163
2166
|
});
|
|
2164
|
-
}, [$, G,
|
|
2167
|
+
}, [$, G, k, s]);
|
|
2165
2168
|
const to = N(
|
|
2166
|
-
(B,
|
|
2169
|
+
(B, Z) => {
|
|
2167
2170
|
if (!v)
|
|
2168
2171
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2169
|
-
const Re = ee.current.scrollTop >
|
|
2172
|
+
const Re = ee.current.scrollTop > Z, Le = ee.current.scrollLeft > B;
|
|
2170
2173
|
return Re || Le ? ee.current : {
|
|
2171
2174
|
scrollTop: v.scrollTop,
|
|
2172
2175
|
scrollLeft: v.scrollLeft
|
|
@@ -2174,7 +2177,7 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2174
2177
|
},
|
|
2175
2178
|
[v]
|
|
2176
2179
|
), kt = N(
|
|
2177
|
-
(B,
|
|
2180
|
+
(B, Z) => {
|
|
2178
2181
|
if (D.current.viewMode !== w || D.current.scrollMode !== l) {
|
|
2179
2182
|
te.current && clearTimeout(te.current), A.current = !0, d(f, "auto"), te.current = setTimeout(() => {
|
|
2180
2183
|
requestAnimationFrame(() => {
|
|
@@ -2184,10 +2187,10 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2184
2187
|
return;
|
|
2185
2188
|
}
|
|
2186
2189
|
const Le = B.scrollTop, lt = B.scrollLeft;
|
|
2187
|
-
if (!
|
|
2190
|
+
if (!Z.height || !Z.width)
|
|
2188
2191
|
return;
|
|
2189
2192
|
A.current = !0;
|
|
2190
|
-
const { height: Ee, width: dt } =
|
|
2193
|
+
const { height: Ee, width: dt } = Z, { height: Wt, width: Mt } = O.current;
|
|
2191
2194
|
if (Wt === Ee && Mt === dt)
|
|
2192
2195
|
return;
|
|
2193
2196
|
const io = Le / Wt * Ee, ao = lt / Mt * dt, so = Math.round(Math.min(io, Ee)) || 0, co = Math.round(Math.min(ao, dt)) || 0;
|
|
@@ -2200,8 +2203,8 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2200
2203
|
});
|
|
2201
2204
|
});
|
|
2202
2205
|
}, 0), O.current = {
|
|
2203
|
-
height:
|
|
2204
|
-
width:
|
|
2206
|
+
height: Z.height,
|
|
2207
|
+
width: Z.width
|
|
2205
2208
|
};
|
|
2206
2209
|
},
|
|
2207
2210
|
[v, w, l, d]
|
|
@@ -2211,15 +2214,15 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2211
2214
|
const B = Array.from({ length: $ }).reduce(
|
|
2212
2215
|
(Le, lt, Ee) => Le + q(Ee),
|
|
2213
2216
|
0
|
|
2214
|
-
),
|
|
2215
|
-
(Le, lt, Ee) => Le +
|
|
2217
|
+
), Z = Array.from({ length: G }).reduce(
|
|
2218
|
+
(Le, lt, Ee) => Le + j(Ee),
|
|
2216
2219
|
0
|
|
2217
|
-
), Re = to(
|
|
2218
|
-
ee.current = Re, kt(Re, { height: B, width:
|
|
2220
|
+
), Re = to(Z, B);
|
|
2221
|
+
ee.current = Re, kt(Re, { height: B, width: Z }), u({
|
|
2219
2222
|
height: B,
|
|
2220
|
-
width:
|
|
2223
|
+
width: Z
|
|
2221
2224
|
});
|
|
2222
|
-
}, [
|
|
2225
|
+
}, [k, $, G, kt]);
|
|
2223
2226
|
const no = N(
|
|
2224
2227
|
(B) => {
|
|
2225
2228
|
ee.current = {
|
|
@@ -2237,13 +2240,13 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2237
2240
|
}, [v, T, J]), z(() => () => {
|
|
2238
2241
|
te.current && clearTimeout(te.current);
|
|
2239
2242
|
}, []);
|
|
2240
|
-
const oo =
|
|
2243
|
+
const oo = F(() => ae(se["rp-pages-container"], {
|
|
2241
2244
|
[se["rp-cursor-grab"]]: xe && !Y,
|
|
2242
2245
|
[se["rp-cursor-grabbing"]]: xe && Y
|
|
2243
2246
|
}), [xe, Y]), ro = N(
|
|
2244
2247
|
(B) => {
|
|
2245
2248
|
if (xe && B) {
|
|
2246
|
-
const
|
|
2249
|
+
const Z = ae(se["rp-pages"]), Re = document.querySelector(`.${Z}`);
|
|
2247
2250
|
fe(Re);
|
|
2248
2251
|
}
|
|
2249
2252
|
},
|
|
@@ -2266,7 +2269,7 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2266
2269
|
h,
|
|
2267
2270
|
Q
|
|
2268
2271
|
]), /* @__PURE__ */ W(pe, { children: [
|
|
2269
|
-
/* @__PURE__ */ i(
|
|
2272
|
+
/* @__PURE__ */ i(jo, { ref: c, children: /* @__PURE__ */ i(
|
|
2270
2273
|
Dn,
|
|
2271
2274
|
{
|
|
2272
2275
|
id: r,
|
|
@@ -2277,13 +2280,13 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2277
2280
|
"--scale-round-x": `${Bt(t.current.sx)[1]}px`,
|
|
2278
2281
|
"--scale-round-y": `${Bt(t.current.sy)[1]}px`
|
|
2279
2282
|
},
|
|
2280
|
-
children: /* @__PURE__ */ i(vi, { style: { minHeight: "50px" }, children: ({ width: B, height:
|
|
2283
|
+
children: /* @__PURE__ */ i(vi, { style: { minHeight: "50px" }, children: ({ width: B, height: Z }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: ro, style: { width: B, height: Z }, children: l === re.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2281
2284
|
"div",
|
|
2282
2285
|
{
|
|
2283
2286
|
ref: g,
|
|
2284
|
-
style: { width: B, height:
|
|
2287
|
+
style: { width: B, height: Z },
|
|
2285
2288
|
className: ae(se["rp-pages"], se["rp-page-scrolling-wrapper"]),
|
|
2286
|
-
children: w === Oe.DUAL_PAGE ? /* @__PURE__ */ i(wi, { widths:
|
|
2289
|
+
children: w === Oe.DUAL_PAGE ? /* @__PURE__ */ i(wi, { widths: j, heights: q }) : /* @__PURE__ */ i(_i, { widths: j, heights: q })
|
|
2287
2290
|
}
|
|
2288
2291
|
) : ie ? /* @__PURE__ */ i(
|
|
2289
2292
|
ui,
|
|
@@ -2294,9 +2297,9 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2294
2297
|
innerRef: _,
|
|
2295
2298
|
onScroll: no,
|
|
2296
2299
|
columnCount: G,
|
|
2297
|
-
columnWidth:
|
|
2300
|
+
columnWidth: j,
|
|
2298
2301
|
rowHeight: q,
|
|
2299
|
-
height:
|
|
2302
|
+
height: Z,
|
|
2300
2303
|
width: B,
|
|
2301
2304
|
estimatedColumnWidth: V,
|
|
2302
2305
|
estimatedRowHeight: ie,
|
|
@@ -2375,7 +2378,7 @@ const wi = hn(({ widths: t, heights: e }) => {
|
|
|
2375
2378
|
h.key === "Enter" && T();
|
|
2376
2379
|
},
|
|
2377
2380
|
[T]
|
|
2378
|
-
), p =
|
|
2381
|
+
), p = F(() => C === Oe.DUAL_PAGE && u === re.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, C, u]);
|
|
2379
2382
|
return !s || !m ? null : typeof s != "boolean" ? /* @__PURE__ */ i(
|
|
2380
2383
|
s,
|
|
2381
2384
|
{
|
|
@@ -2469,7 +2472,7 @@ var Fn = "DialogTrigger", Si = X.forwardRef(
|
|
|
2469
2472
|
(t, e) => {
|
|
2470
2473
|
const { __scopeDialog: n, ...r } = t, o = he(Fn, n), a = Et(e, o.triggerRef);
|
|
2471
2474
|
return /* @__PURE__ */ i(
|
|
2472
|
-
|
|
2475
|
+
Ze.button,
|
|
2473
2476
|
{
|
|
2474
2477
|
type: "button",
|
|
2475
2478
|
"aria-haspopup": "dialog",
|
|
@@ -2505,7 +2508,7 @@ var Ri = Tr("DialogOverlay.RemoveScroll"), Li = X.forwardRef(
|
|
|
2505
2508
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2506
2509
|
// ie. when `Overlay` and `Content` are siblings
|
|
2507
2510
|
/* @__PURE__ */ i(Pr, { as: Ri, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ i(
|
|
2508
|
-
|
|
2511
|
+
Ze.div,
|
|
2509
2512
|
{
|
|
2510
2513
|
"data-state": Ft(o.open),
|
|
2511
2514
|
...r,
|
|
@@ -2610,14 +2613,14 @@ var Ei = X.forwardRef(
|
|
|
2610
2613
|
), At = "DialogTitle", qn = X.forwardRef(
|
|
2611
2614
|
(t, e) => {
|
|
2612
2615
|
const { __scopeDialog: n, ...r } = t, o = he(At, n);
|
|
2613
|
-
return /* @__PURE__ */ i(
|
|
2616
|
+
return /* @__PURE__ */ i(Ze.h2, { id: o.titleId, ...r, ref: e });
|
|
2614
2617
|
}
|
|
2615
2618
|
);
|
|
2616
2619
|
qn.displayName = At;
|
|
2617
2620
|
var Gn = "DialogDescription", Oi = X.forwardRef(
|
|
2618
2621
|
(t, e) => {
|
|
2619
2622
|
const { __scopeDialog: n, ...r } = t, o = he(Gn, n);
|
|
2620
|
-
return /* @__PURE__ */ i(
|
|
2623
|
+
return /* @__PURE__ */ i(Ze.p, { id: o.descriptionId, ...r, ref: e });
|
|
2621
2624
|
}
|
|
2622
2625
|
);
|
|
2623
2626
|
Oi.displayName = Gn;
|
|
@@ -2625,7 +2628,7 @@ var Un = "DialogClose", Vn = X.forwardRef(
|
|
|
2625
2628
|
(t, e) => {
|
|
2626
2629
|
const { __scopeDialog: n, ...r } = t, o = he(Un, n);
|
|
2627
2630
|
return /* @__PURE__ */ i(
|
|
2628
|
-
|
|
2631
|
+
Ze.button,
|
|
2629
2632
|
{
|
|
2630
2633
|
type: "button",
|
|
2631
2634
|
...r,
|
|
@@ -2639,12 +2642,12 @@ Vn.displayName = Un;
|
|
|
2639
2642
|
function Ft(t) {
|
|
2640
2643
|
return t ? "open" : "closed";
|
|
2641
2644
|
}
|
|
2642
|
-
var Bn = "DialogTitleWarning", [Pc,
|
|
2645
|
+
var Bn = "DialogTitleWarning", [Pc, jn] = _r(Bn, {
|
|
2643
2646
|
contentName: De,
|
|
2644
2647
|
titleName: At,
|
|
2645
2648
|
docsSlug: "dialog"
|
|
2646
2649
|
}), Di = ({ titleId: t }) => {
|
|
2647
|
-
const e =
|
|
2650
|
+
const e = jn(Bn), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2648
2651
|
|
|
2649
2652
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2650
2653
|
|
|
@@ -2653,7 +2656,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2653
2656
|
t && (document.getElementById(t) || console.error(n));
|
|
2654
2657
|
}, [n, t]), null;
|
|
2655
2658
|
}, zi = "DialogDescriptionWarning", Ai = ({ contentRef: t, descriptionId: e }) => {
|
|
2656
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
2659
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jn(zi).contentName}}.`;
|
|
2657
2660
|
return X.useEffect(() => {
|
|
2658
2661
|
var a;
|
|
2659
2662
|
const o = (a = t.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
@@ -2669,7 +2672,7 @@ const Ne = {
|
|
|
2669
2672
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2670
2673
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2671
2674
|
}, qi = () => {
|
|
2672
|
-
const { pdfProperties: t } = oe(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = No(), { localeMessages: o } = de(), a =
|
|
2675
|
+
const { pdfProperties: t } = oe(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = No(), { localeMessages: o } = de(), a = F(() => {
|
|
2673
2676
|
if (!t)
|
|
2674
2677
|
return [];
|
|
2675
2678
|
const {
|
|
@@ -2722,7 +2725,7 @@ const Ne = {
|
|
|
2722
2725
|
}, cn = ".pdf", Ui = (t) => URL.createObjectURL(t), Vi = async (t) => {
|
|
2723
2726
|
const n = await (await fetch(t)).blob();
|
|
2724
2727
|
return Ui(n);
|
|
2725
|
-
},
|
|
2728
|
+
}, Zn = () => {
|
|
2726
2729
|
const { filename: t, pdfSrc: e } = oe(), { downloadFilename: n } = xo(), r = (a) => {
|
|
2727
2730
|
const c = n || a;
|
|
2728
2731
|
return c.endsWith(cn) ? c : `${c}${cn}`;
|
|
@@ -2736,16 +2739,16 @@ const Ne = {
|
|
|
2736
2739
|
}, Kn = () => {
|
|
2737
2740
|
const { downloadIcon: t } = ge(), { downloadIcon: e } = me();
|
|
2738
2741
|
return t || e || /* @__PURE__ */ i(Dr, {});
|
|
2739
|
-
}, Xn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Bi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Xn, { localeMessages: e, children: /* @__PURE__ */ i(ce, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ i(Kn, {}) }) }),
|
|
2742
|
+
}, Xn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Bi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Xn, { localeMessages: e, children: /* @__PURE__ */ i(ce, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ i(Kn, {}) }) }), ji = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Pe, { onClick: t, children: /* @__PURE__ */ W(Xn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2740
2743
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Kn, {}) }),
|
|
2741
2744
|
e == null ? void 0 : e.downloadFileLabel
|
|
2742
2745
|
] }) }), Qn = () => {
|
|
2743
|
-
const { download: t } =
|
|
2744
|
-
return !e || !n ? null : r ? /* @__PURE__ */ i(
|
|
2746
|
+
const { download: t } = Zn(), { downloadTool: e = !0 } = Te(), { downloadTool: n = !0 } = ye(), { isSmallScreen: r } = Ie(), { localeMessages: o } = de(), a = o == null ? void 0 : o.downloadFileTooltip;
|
|
2747
|
+
return !e || !n ? null : r ? /* @__PURE__ */ i(ji, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(n, { download: t }) }) : /* @__PURE__ */ i(Bi, { download: t, localeMessages: o });
|
|
2745
2748
|
}, Yn = () => {
|
|
2746
2749
|
const { printIcon: t } = ge(), { printIcon: e } = me();
|
|
2747
2750
|
return t || e || /* @__PURE__ */ i(zr, {});
|
|
2748
|
-
}, Jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }),
|
|
2751
|
+
}, Jn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Zi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(Jn, { localeMessages: e, children: /* @__PURE__ */ i(ce, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ i(Yn, {}) }) }), Ki = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(Pe, { onClick: t, children: /* @__PURE__ */ W(Jn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2749
2752
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Yn, {}) }),
|
|
2750
2753
|
e == null ? void 0 : e.printLabel
|
|
2751
2754
|
] }) }), eo = () => {
|
|
@@ -2772,7 +2775,7 @@ const Ne = {
|
|
|
2772
2775
|
progress: a,
|
|
2773
2776
|
showDefaultProgress: c
|
|
2774
2777
|
}
|
|
2775
|
-
) }) : /* @__PURE__ */ i(
|
|
2778
|
+
) }) : /* @__PURE__ */ i(Zi, { print: t, localeMessages: g });
|
|
2776
2779
|
}, Xi = {
|
|
2777
2780
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2778
2781
|
}, Qi = () => {
|
|
@@ -2782,7 +2785,7 @@ const Ne = {
|
|
|
2782
2785
|
const { goToLastPageIcon: t } = ge(), { goToLastPageIcon: e } = me();
|
|
2783
2786
|
return t || e || /* @__PURE__ */ i(bn, {});
|
|
2784
2787
|
}, ln = { width: "100%" }, Ji = () => {
|
|
2785
|
-
const { goToPage: t, totalPages: e, focusedPage: n } = ue(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = ye(), { localeMessages: a } = de(), c =
|
|
2788
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = ue(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = ye(), { localeMessages: a } = de(), c = F(() => n === 1, [n]), d = F(() => n === e, [n, e]), s = N(() => {
|
|
2786
2789
|
t(1);
|
|
2787
2790
|
}, [t]), m = N(() => {
|
|
2788
2791
|
t(e);
|
|
@@ -2825,7 +2828,7 @@ const Ne = {
|
|
|
2825
2828
|
new ResizeObserver((E) => {
|
|
2826
2829
|
L(E[0].contentRect.height);
|
|
2827
2830
|
})
|
|
2828
|
-
), D =
|
|
2831
|
+
), D = F(() => C || m || g || s || d || P || o && (a || c || u || v), [
|
|
2829
2832
|
a,
|
|
2830
2833
|
c,
|
|
2831
2834
|
u,
|
|
@@ -2836,7 +2839,7 @@ const Ne = {
|
|
|
2836
2839
|
g,
|
|
2837
2840
|
C,
|
|
2838
2841
|
o
|
|
2839
|
-
]), A =
|
|
2842
|
+
]), A = F(() => l || h || f || p || y || I || o && (T || b || w || _), [
|
|
2840
2843
|
T,
|
|
2841
2844
|
b,
|
|
2842
2845
|
w,
|
|
@@ -2907,7 +2910,7 @@ const Ne = {
|
|
|
2907
2910
|
"rp-current-zoom-text": "_rp-current-zoom-text_1yldl_24",
|
|
2908
2911
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1yldl_28"
|
|
2909
2912
|
}, oa = ({ zoomLevel: t, className: e }) => {
|
|
2910
|
-
const { localeMessages: n } = de(), r =
|
|
2913
|
+
const { localeMessages: n } = de(), r = F(() => {
|
|
2911
2914
|
switch (t) {
|
|
2912
2915
|
case Me.ACTUAL:
|
|
2913
2916
|
return n == null ? void 0 : n.zoomActualSize;
|
|
@@ -2943,7 +2946,7 @@ const Ne = {
|
|
|
2943
2946
|
const p = Math.ceil(n * 100 / 25) * 25;
|
|
2944
2947
|
return Math.min(p - 25, Gt);
|
|
2945
2948
|
});
|
|
2946
|
-
}, [e, n]), b =
|
|
2949
|
+
}, [e, n]), b = F(() => Wr(n), [n]), y = F(() => Mr(n), [n]);
|
|
2947
2950
|
return z(() => (o && v.current.observe(o), () => {
|
|
2948
2951
|
v.current.disconnect();
|
|
2949
2952
|
}), [o]), !a || !c ? null : typeof a == "function" ? /* @__PURE__ */ i(a, { zoomLevel: t, setZoomLevel: e }) : typeof c == "function" ? /* @__PURE__ */ i(c, { zoomLevel: t, setZoomLevel: e }) : /* @__PURE__ */ W("div", { className: Fe["rp-zoom-wrapper"], children: [
|
|
@@ -3099,12 +3102,12 @@ const Ne = {
|
|
|
3099
3102
|
h(U.target.value);
|
|
3100
3103
|
}, []), R = N(() => {
|
|
3101
3104
|
h(""), g("");
|
|
3102
|
-
}, [g]),
|
|
3105
|
+
}, [g]), k = F(() => `${u} / ${C}`, [u, C]), { wholeWords: $, matchCase: q } = F(() => d, [d]), G = N(
|
|
3103
3106
|
(U) => {
|
|
3104
3107
|
s((Q) => ({ ...Q, matchCase: U }));
|
|
3105
3108
|
},
|
|
3106
3109
|
[s]
|
|
3107
|
-
),
|
|
3110
|
+
), j = N(
|
|
3108
3111
|
(U) => {
|
|
3109
3112
|
s((Q) => ({ ...Q, wholeWords: U }));
|
|
3110
3113
|
},
|
|
@@ -3113,7 +3116,7 @@ const Ne = {
|
|
|
3113
3116
|
z(() => {
|
|
3114
3117
|
o && I && L();
|
|
3115
3118
|
}, [o, L]);
|
|
3116
|
-
const V =
|
|
3119
|
+
const V = F(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]), ie = N(
|
|
3117
3120
|
(U) => {
|
|
3118
3121
|
if (U.key === "Tab") {
|
|
3119
3122
|
const Q = document.activeElement;
|
|
@@ -3181,7 +3184,7 @@ const Ne = {
|
|
|
3181
3184
|
children: !!p && /* @__PURE__ */ i("span", { className: ne["rp-search-tool-input-clear"], onClick: R, children: /* @__PURE__ */ i(Hr, {}) })
|
|
3182
3185
|
}
|
|
3183
3186
|
) }),
|
|
3184
|
-
m ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(vn, { className: ne["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children:
|
|
3187
|
+
m ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(vn, { className: ne["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: k }),
|
|
3185
3188
|
l && /* @__PURE__ */ i("div", { className: ne["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: O, handleClose: L }) })
|
|
3186
3189
|
] }),
|
|
3187
3190
|
/* @__PURE__ */ W("div", { className: ne["rp-search-tool-input-checkboxes"], children: [
|
|
@@ -3196,18 +3199,18 @@ const Ne = {
|
|
|
3196
3199
|
children: f == null ? void 0 : f.searchMatchCaseLabel
|
|
3197
3200
|
}
|
|
3198
3201
|
),
|
|
3199
|
-
!l && /* @__PURE__ */ i(K, { content: f == null ? void 0 : f.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: ne["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(
|
|
3202
|
+
!l && /* @__PURE__ */ i(K, { content: f == null ? void 0 : f.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: ne["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(jt, {}) }) }),
|
|
3200
3203
|
/* @__PURE__ */ i(
|
|
3201
3204
|
$t,
|
|
3202
3205
|
{
|
|
3203
3206
|
tabIndex: 0,
|
|
3204
3207
|
name: "wholeWord",
|
|
3205
3208
|
value: $,
|
|
3206
|
-
onChange:
|
|
3209
|
+
onChange: j,
|
|
3207
3210
|
children: f == null ? void 0 : f.searchWholeWordsLabel
|
|
3208
3211
|
}
|
|
3209
3212
|
),
|
|
3210
|
-
!l && /* @__PURE__ */ i(K, { content: f == null ? void 0 : f.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { tabIndex: 0, className: ne["rp-search-icon-info"], children: /* @__PURE__ */ i(
|
|
3213
|
+
!l && /* @__PURE__ */ i(K, { content: f == null ? void 0 : f.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { tabIndex: 0, className: ne["rp-search-icon-info"], children: /* @__PURE__ */ i(jt, {}) }) })
|
|
3211
3214
|
] })
|
|
3212
3215
|
] }),
|
|
3213
3216
|
!l && /* @__PURE__ */ W("div", { className: ne["rp-search-tool-controls"], children: [
|
|
@@ -3270,7 +3273,7 @@ const Ne = {
|
|
|
3270
3273
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3271
3274
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3272
3275
|
}, ha = (t) => {
|
|
3273
|
-
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = ue(), { pageRotate: a } = ot(), c = M(null), d = Ln(), { pages: s } = oe(), [m, g] = H(null), C = M(!1), u = M(), v =
|
|
3276
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = ue(), { pageRotate: a } = ot(), c = M(null), d = Ln(), { pages: s } = oe(), [m, g] = H(null), C = M(!1), u = M(), v = F(() => n ? qe["rp-thumbnail-active"] : "", [n]), P = F(() => ({
|
|
3274
3277
|
width: Math.round(r.width),
|
|
3275
3278
|
height: Math.round(r.height)
|
|
3276
3279
|
}), [r]), T = N(() => {
|
|
@@ -3365,7 +3368,7 @@ const Ne = {
|
|
|
3365
3368
|
}, ga = rt((t, e) => {
|
|
3366
3369
|
const { show: n, width: r } = t, { focusedPage: o, totalPages: a } = ue(), { thumbnailPages: c, addPage: d, thumbnailLength: s, addToPage: m } = Sn(), g = M(null), C = M(1);
|
|
3367
3370
|
pn(e, () => g.current);
|
|
3368
|
-
const u =
|
|
3371
|
+
const u = F(() => Object.values(c), [c]), v = N(() => {
|
|
3369
3372
|
const P = s + 1;
|
|
3370
3373
|
P <= a && d(P);
|
|
3371
3374
|
}, [d, a, s]);
|
|
@@ -3391,7 +3394,7 @@ const Ne = {
|
|
|
3391
3394
|
}, wa = () => {
|
|
3392
3395
|
const { active: t, setActive: e } = Sn(), [n, r] = H(Qo), o = M(null), a = M(null), { thumbnailTool: c, sidebarEnable: d } = Te(), { localeMessages: s } = de(), m = N(() => {
|
|
3393
3396
|
e((C) => !C);
|
|
3394
|
-
}, []), g =
|
|
3397
|
+
}, []), g = F(() => typeof c != "boolean" && c ? /* @__PURE__ */ i(c, { onClick: m, active: t }) : c ? /* @__PURE__ */ i(K, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3395
3398
|
ce,
|
|
3396
3399
|
{
|
|
3397
3400
|
onClick: m,
|
|
@@ -3445,7 +3448,7 @@ const Ne = {
|
|
|
3445
3448
|
return z(() => (s && s(), () => {
|
|
3446
3449
|
m && m();
|
|
3447
3450
|
}), [s, m]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3448
|
-
/* @__PURE__ */ i(Dn, { toolbarRef: C, ref: e, children: /* @__PURE__ */ i(qo, { mobileWidth: d, onLayoutWidthChange: g, children: /* @__PURE__ */ i(Go, { slots: r, children: /* @__PURE__ */ i(
|
|
3451
|
+
/* @__PURE__ */ i(Dn, { toolbarRef: C, ref: e, children: /* @__PURE__ */ i(qo, { mobileWidth: d, onLayoutWidthChange: g, children: /* @__PURE__ */ i(Go, { slots: r, children: /* @__PURE__ */ i(Zo, { icons: o, children: /* @__PURE__ */ W($o, { getContainerRef: v, style: a, className: c, children: [
|
|
3449
3452
|
/* @__PURE__ */ W(Vo, { children: [
|
|
3450
3453
|
/* @__PURE__ */ W("div", { className: Ce["rp-layout"], children: [
|
|
3451
3454
|
/* @__PURE__ */ i(
|
|
@@ -3507,7 +3510,7 @@ export {
|
|
|
3507
3510
|
Rn as E,
|
|
3508
3511
|
Ln as F,
|
|
3509
3512
|
Vr as G,
|
|
3510
|
-
|
|
3513
|
+
Zr as H,
|
|
3511
3514
|
Qr as I,
|
|
3512
3515
|
Jr as J,
|
|
3513
3516
|
Dt as K,
|
|
@@ -3529,7 +3532,7 @@ export {
|
|
|
3529
3532
|
pa as _,
|
|
3530
3533
|
yc as a,
|
|
3531
3534
|
wa as a0,
|
|
3532
|
-
|
|
3535
|
+
Zn as b,
|
|
3533
3536
|
it as c,
|
|
3534
3537
|
Ot as d,
|
|
3535
3538
|
Sn as e,
|