@react-pdf-kit/viewer 2.8.0-beta.0 → 2.8.0-beta.10
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/README.md +44 -30
- package/dist/{AnnotationLayer-C6UTOVmc.js → AnnotationLayer-CyOYh0Tw.js} +2 -2
- package/dist/{Button-BNlmxWrV.js → Button-DBu3SaMk.js} +1 -1
- package/dist/CanvasLayer-CJqCJ30J.js +111 -0
- package/dist/{Checkbox-Brta-YKG.js → Checkbox-CSIEUyO8.js} +4 -4
- package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
- package/dist/Container-BuamPhw4.js +18 -0
- package/dist/{DocumentDialog-C9G7lVTh.js → DocumentDialog-cRr9sSSH.js} +4 -4
- package/dist/{DropDown-DikL-krI.js → DropDown-CM6xEwZC.js} +2 -2
- package/dist/{Input-DjSWOjCI.js → Input-Dpo1Xfxe.js} +1 -1
- package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
- package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-0E8WHnSN.js} +8 -8
- package/dist/MenuItem-lItnKNd5.js +31 -0
- package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-CaFxd8b5.js} +1 -1
- package/dist/Paginate.module-DhE7N8AA.js +9 -0
- package/dist/PaginationContext-DIzsZhFd.js +194 -0
- package/dist/{PasswordModal-BIr84lGN.js → PasswordModal-CxHFn0pB.js} +13 -13
- package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
- package/dist/RPLayout.module-BH5r8dDc.js +14 -0
- package/dist/RPPages-U8QNLlIa.js +686 -0
- package/dist/{RPTooltip-ZZoFqP7C.js → RPTooltip-QWwWh4HW.js} +127 -95
- package/dist/SearchTool.module-DY8Ucfb_.js +17 -0
- package/dist/{SkipLink-CdcjClGB.js → SkipLink-Dj83gZdk.js} +3 -3
- package/dist/{TextLayer-DWGFN9SF.js → TextLayer-D-V9kogG.js} +5 -5
- package/dist/{Thumbnail-CU1p9tZ6.js → Thumbnail-BXMk0OWF.js} +8 -8
- package/dist/{Thumbnails-VMbfTvqt.js → Thumbnails-BIuN8LZ8.js} +2 -2
- package/dist/assets/AnnotationLayer.css +1 -1
- package/dist/assets/CanvasLayer.css +1 -0
- package/dist/assets/LoadingIndicator.css +1 -1
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/Paginate.css +1 -1
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/RPLayout.css +1 -1
- package/dist/assets/RPPages.css +1 -1
- package/dist/assets/SearchTool.css +1 -1
- package/dist/assets/SkipLink.css +1 -1
- package/dist/assets/TextLayer.css +1 -1
- package/dist/assets/Thumbnail.css +1 -1
- package/dist/assets/style.js +1 -1
- package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
- package/dist/components/RPController.js +39 -39
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/icons/LoaderIcon.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/LayoutContainer.js +7 -7
- package/dist/components/layout/LayoutWrapper.js +5 -5
- package/dist/components/layout/RPDefaultLayout.js +56 -55
- package/dist/components/layout/RPLayout.js +39 -38
- package/dist/components/layout/SkipLink.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +3 -3
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +7 -7
- package/dist/components/layout/toolbar/FileDownloadTool.js +7 -7
- package/dist/components/layout/toolbar/FileUploadTool.js +7 -7
- package/dist/components/layout/toolbar/FullScreenTool.js +10 -9
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +25 -31
- package/dist/components/layout/toolbar/OtherTool.js +6 -6
- package/dist/components/layout/toolbar/Paginate.js +20 -5
- package/dist/components/layout/toolbar/PrintTool.js +7 -7
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +12 -12
- package/dist/components/layout/toolbar/ScrollModeTool.js +18 -18
- package/dist/components/layout/toolbar/SearchCloseButton.js +3 -3
- package/dist/components/layout/toolbar/SearchResultNavigator.js +3 -3
- package/dist/components/layout/toolbar/SearchTool.js +134 -122
- package/dist/components/layout/toolbar/SelectionModeTool.js +12 -12
- package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +18 -18
- package/dist/components/layout/toolbar/ZoomTool.js +86 -84
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
- package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/InputPageTool.js +37 -26
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
- 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 +2 -2
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +25 -23
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +25 -23
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -5
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +8 -8
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +2 -48
- package/dist/components/page/DualPage.js +2 -2
- package/dist/components/page/DualPageWithCover.js +2 -2
- package/dist/components/page/RPPage.js +94 -2
- package/dist/components/page/SinglePage.js +2 -2
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/Input.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +1 -1
- package/dist/components/ui/RPTooltip.js +1 -1
- package/dist/contexts/DimensionPagesContext.js +38 -22
- package/dist/contexts/ElementPageContext.js +46 -39
- package/dist/contexts/ElementThumbnailContext.js +1 -1
- package/dist/contexts/LoaderContext.js +1 -1
- package/dist/contexts/LocalizationContext.js +12 -6
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +26 -18
- package/dist/contexts/RenderedPagesCache.js +32 -13
- package/dist/contexts/VirtualScrollContext.js +10 -13
- package/dist/contexts/ZoomContext.js +119 -61
- package/dist/{de_DE--0LF-SJR.js → de_DE-x4Z-jQrz.js} +54 -6
- package/dist/{dist-7FA4Do6I.js → dist-B2hwhF6G.js} +7 -7
- package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
- package/dist/{dist-C3WNMuW2.js → dist-CNbFpoT1.js} +2 -2
- package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
- package/dist/{dist-CKteKPPA.js → dist-VbpVNBs6.js} +7 -7
- package/dist/icons.js +1 -1
- package/dist/{lib-BiapEtK1.js → lib-CSInlR9T.js} +142 -237
- package/dist/{main-B74-PfMa.js → main-DCzVrq0G.js} +3 -3
- package/dist/main.js +5 -5
- package/dist/style-CJtyyrJx.js +5 -0
- package/dist/types/components/page/CanvasLayer.d.ts +4 -1
- package/dist/types/components/ui/RPTooltip.d.ts +3 -2
- package/dist/types/contexts/RenderQueueProvider.d.ts +2 -0
- package/dist/types/contexts/RenderedPagesCache.d.ts +3 -0
- package/dist/types/contexts/VirtualScrollContext.d.ts +0 -3
- package/dist/types/locales/de_DE.json.d.ts +11 -2
- package/dist/types/locales/en_US.json.d.ts +11 -2
- package/dist/types/locales/it_IT.json.d.ts +11 -2
- package/dist/types/locales/pt_PT.json.d.ts +11 -2
- package/dist/types/locales/th_TH.json.d.ts +11 -2
- package/dist/types/locales/zh_CN.json.d.ts +11 -2
- package/dist/types/utils/Queue.d.ts +1 -0
- package/dist/types/utils/const.d.ts +3 -0
- package/dist/types/utils/constants.d.ts +9 -0
- package/dist/types/utils/documentLayout.d.ts +60 -0
- package/dist/types/utils/hooks/usePinch.d.ts +14 -1
- package/dist/types/utils/hooks/usePresentPage.d.ts +2 -2
- package/dist/types/utils/hooks/useZoomOrigin.d.ts +4 -0
- package/dist/types/utils/types.d.ts +25 -2
- package/dist/types/utils/zoom.d.ts +2 -0
- package/dist/utils/Queue.js +5 -0
- package/dist/utils/const.js +2 -2
- package/dist/utils/constants.js +2 -2
- package/dist/utils/documentLayout.js +141 -0
- package/dist/utils/hooks/useLicense.js +2 -2
- package/dist/utils/hooks/useLoadPdf.js +73 -63
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePinch.js +109 -56
- package/dist/utils/hooks/usePresentPage.js +33 -57
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +66 -67
- package/dist/utils/hooks/useZoomOrigin.js +37 -0
- package/dist/utils/renderPage.js +21 -14
- package/dist/utils/types.js +3 -3
- package/dist/utils/zoom.js +8 -2
- package/package.json +1 -1
- package/dist/Container-DTWaZzc7.js +0 -16
- package/dist/MenuItem-BJDWfzAw.js +0 -15
- package/dist/Paginate.module-B0GMw-MB.js +0 -8
- package/dist/PaginationContext-C5CJiEW-.js +0 -242
- package/dist/RPLayout.module-Vc3h4xxS.js +0 -14
- package/dist/RPPage-BsDixmqF.js +0 -91
- package/dist/RPPages-BkEFexWu.js +0 -1007
- package/dist/SearchTool.module-DUkVXfOn.js +0 -16
- package/dist/assets/RPPage.css +0 -1
- package/dist/contexts/VirtualGridContext.js +0 -18
- package/dist/style-BPQRJJJ7.js +0 -5
- package/dist/types/contexts/VirtualGridContext.d.ts +0 -9
- package/dist/types/utils/calculatePage.d.ts +0 -12
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +0 -17
- package/dist/utils/calculatePage.js +0 -30
- package/dist/utils/hooks/useVirtualReactWindow.js +0 -86
- /package/dist/{TextHighlightLayer-BSVgBxR3.js → TextHighlightLayer-3vIZbRyL.js} +0 -0
package/dist/RPPages-BkEFexWu.js
DELETED
|
@@ -1,1007 +0,0 @@
|
|
|
1
|
-
import { ErrorType as e, ScrollMode as t, SelectionMode as n, ViewMode as r } from "./utils/types.js";
|
|
2
|
-
import { useDocumentPasswordContext as i } from "./contexts/DocumentPasswordContext.js";
|
|
3
|
-
import { useDocumentContext as a } from "./contexts/RPDocumentContext.js";
|
|
4
|
-
import { useInitialStateContext as o } from "./contexts/InitialStateContext.js";
|
|
5
|
-
import { useScrollModeContext as s } from "./contexts/ScrollModeContext.js";
|
|
6
|
-
import { useViewModeContext as c } from "./contexts/ViewModeContext.js";
|
|
7
|
-
import { useVirtualScrollContext as l } from "./contexts/VirtualScrollContext.js";
|
|
8
|
-
import { useLayoutContainer as u } from "./contexts/LayoutContainerContext.js";
|
|
9
|
-
import { useEventCallbackContext as d } from "./contexts/EventCallbackContext.js";
|
|
10
|
-
import { useDebounce as f } from "./utils/hooks/useDebounce.js";
|
|
11
|
-
import { getPageFromPosition as p } from "./utils/calculatePage.js";
|
|
12
|
-
import { a as m, r as h } from "./PaginationContext-C5CJiEW-.js";
|
|
13
|
-
import { useSelectionModeContext as g } from "./contexts/SelectionModeContext.js";
|
|
14
|
-
import { useFullScreenContext as _ } from "./contexts/FullScreenContext.js";
|
|
15
|
-
import { t as v } from "./clsx-B7LyVm5O.js";
|
|
16
|
-
import { useLoaderContext as ee } from "./contexts/LoaderContext.js";
|
|
17
|
-
import { t as y } from "./RPPage-BsDixmqF.js";
|
|
18
|
-
import { useVirtualReactWindow as te } from "./utils/hooks/useVirtualReactWindow.js";
|
|
19
|
-
import { DualPage as ne } from "./components/page/DualPage.js";
|
|
20
|
-
import { DualPageWithCover as re } from "./components/page/DualPageWithCover.js";
|
|
21
|
-
import { SinglePage as ie } from "./components/page/SinglePage.js";
|
|
22
|
-
import { useMousePressed as ae } from "./utils/hooks/useMousePressed.js";
|
|
23
|
-
import { useGrabScroll as oe } from "./utils/hooks/useGrabScroll.js";
|
|
24
|
-
import { usePinch as se } from "./utils/hooks/usePinch.js";
|
|
25
|
-
import { t as b } from "./PasswordModal-BIr84lGN.js";
|
|
26
|
-
import { usePresentPage as x } from "./utils/hooks/usePresentPage.js";
|
|
27
|
-
import { LayoutContainer as ce } from "./components/layout/LayoutContainer.js";
|
|
28
|
-
import { LayoutWrapper as le } from "./components/layout/LayoutWrapper.js";
|
|
29
|
-
import { useCopyText as ue } from "./utils/hooks/useCopyText.js";
|
|
30
|
-
import { useTextSelection as de } from "./utils/hooks/useTextSelection.js";
|
|
31
|
-
import { approximateFraction as fe } from "./utils/approximateFragtion.js";
|
|
32
|
-
import { Component as pe, PureComponent as S, createElement as C, memo as me, useCallback as w, useEffect as T, useMemo as he, useRef as E, useState as ge } from "react";
|
|
33
|
-
import { OutputScale as _e } from "pdfjs-dist";
|
|
34
|
-
import { Fragment as ve, jsx as D, jsxs as ye } from "react/jsx-runtime";
|
|
35
|
-
import './assets/RPPages.css';//#region lib/components/RPPages.module.css
|
|
36
|
-
var O = {
|
|
37
|
-
"rp-pages": "_rp-pages_fn8tz_1",
|
|
38
|
-
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_fn8tz_6",
|
|
39
|
-
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_fn8tz_11",
|
|
40
|
-
"rp-not-supported-list": "_rp-not-supported-list_fn8tz_15",
|
|
41
|
-
"rp-pages-container": "_rp-pages-container_fn8tz_23",
|
|
42
|
-
"rp-viewer": "_rp-viewer_fn8tz_65",
|
|
43
|
-
"rp-cursor-grab": "_rp-cursor-grab_fn8tz_70",
|
|
44
|
-
"rp-cursor-grabbing": "_rp-cursor-grabbing_fn8tz_78",
|
|
45
|
-
"rp-loader": "_rp-loader_fn8tz_86",
|
|
46
|
-
"rp-not-supported": "_rp-not-supported_fn8tz_15",
|
|
47
|
-
"rp-not-supported-content": "_rp-not-supported-content_fn8tz_102",
|
|
48
|
-
"rp-load-error": "_rp-load-error_fn8tz_108",
|
|
49
|
-
"rp-load-error-message": "_rp-load-error-message_fn8tz_116"
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
53
|
-
function k() {
|
|
54
|
-
return k = Object.assign ? Object.assign.bind() : function(e) {
|
|
55
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
56
|
-
var n = arguments[t];
|
|
57
|
-
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
58
|
-
}
|
|
59
|
-
return e;
|
|
60
|
-
}, k.apply(null, arguments);
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
64
|
-
function A(e) {
|
|
65
|
-
if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
66
|
-
return e;
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
70
|
-
function be(e, t) {
|
|
71
|
-
return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
72
|
-
return e.__proto__ = t, e;
|
|
73
|
-
}, be(e, t);
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
77
|
-
function xe(e, t) {
|
|
78
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, be(e, t);
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js
|
|
82
|
-
var Se = Number.isNaN || function(e) {
|
|
83
|
-
return typeof e == "number" && e !== e;
|
|
84
|
-
};
|
|
85
|
-
function Ce(e, t) {
|
|
86
|
-
return !!(e === t || Se(e) && Se(t));
|
|
87
|
-
}
|
|
88
|
-
function j(e, t) {
|
|
89
|
-
if (e.length !== t.length) return !1;
|
|
90
|
-
for (var n = 0; n < e.length; n++) if (!Ce(e[n], t[n])) return !1;
|
|
91
|
-
return !0;
|
|
92
|
-
}
|
|
93
|
-
function M(e, t) {
|
|
94
|
-
t === void 0 && (t = j);
|
|
95
|
-
var n, r = [], i, a = !1;
|
|
96
|
-
function o() {
|
|
97
|
-
var o = [...arguments];
|
|
98
|
-
return a && n === this && t(o, r) ? i : (i = e.apply(this, o), a = !0, n = this, r = o, i);
|
|
99
|
-
}
|
|
100
|
-
return o;
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
104
|
-
function N(e, t) {
|
|
105
|
-
if (e == null) return {};
|
|
106
|
-
var n = {};
|
|
107
|
-
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
108
|
-
if (t.indexOf(r) !== -1) continue;
|
|
109
|
-
n[r] = e[r];
|
|
110
|
-
}
|
|
111
|
-
return n;
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region node_modules/.pnpm/react-window@1.8.11_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-window/dist/index.esm.js
|
|
115
|
-
var P = typeof performance == "object" && typeof performance.now == "function" ? function() {
|
|
116
|
-
return performance.now();
|
|
117
|
-
} : function() {
|
|
118
|
-
return Date.now();
|
|
119
|
-
};
|
|
120
|
-
function we(e) {
|
|
121
|
-
cancelAnimationFrame(e.id);
|
|
122
|
-
}
|
|
123
|
-
function Te(e, t) {
|
|
124
|
-
var n = P();
|
|
125
|
-
function r() {
|
|
126
|
-
P() - n >= t ? e.call(null) : i.id = requestAnimationFrame(r);
|
|
127
|
-
}
|
|
128
|
-
var i = { id: requestAnimationFrame(r) };
|
|
129
|
-
return i;
|
|
130
|
-
}
|
|
131
|
-
var F = -1;
|
|
132
|
-
function Ee(e) {
|
|
133
|
-
if (e === void 0 && (e = !1), F === -1 || e) {
|
|
134
|
-
var t = document.createElement("div"), n = t.style;
|
|
135
|
-
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), F = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
136
|
-
}
|
|
137
|
-
return F;
|
|
138
|
-
}
|
|
139
|
-
var I = null;
|
|
140
|
-
function De(e) {
|
|
141
|
-
if (e === void 0 && (e = !1), I === null || e) {
|
|
142
|
-
var t = document.createElement("div"), n = t.style;
|
|
143
|
-
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
144
|
-
var r = document.createElement("div"), i = r.style;
|
|
145
|
-
return i.width = "100px", i.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? I = "positive-descending" : (t.scrollLeft = 1, I = t.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(t), I;
|
|
146
|
-
}
|
|
147
|
-
return I;
|
|
148
|
-
}
|
|
149
|
-
var Oe = 150, L = function(e) {
|
|
150
|
-
var t = e.columnIndex;
|
|
151
|
-
return e.data, e.rowIndex + ":" + t;
|
|
152
|
-
}, R = null, z = null, B = null;
|
|
153
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet !== void 0 && (R = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakSet(), B = /* @__PURE__ */ new WeakSet());
|
|
154
|
-
function ke(e) {
|
|
155
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, i = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, o = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, l = e.getOffsetForRowAndAlignment, u = e.getRowHeight, d = e.getRowOffset, f = e.getRowStartIndexForOffset, p = e.getRowStopIndexForStartIndex, m = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
|
|
156
|
-
return t = /* @__PURE__ */ function(e) {
|
|
157
|
-
xe(t, e);
|
|
158
|
-
function t(t) {
|
|
159
|
-
var r = e.call(this, t) || this;
|
|
160
|
-
return r._instanceProps = m(r.props, A(r)), r._resetIsScrollingTimeoutId = null, r._outerRef = void 0, r.state = {
|
|
161
|
-
instance: A(r),
|
|
162
|
-
isScrolling: !1,
|
|
163
|
-
horizontalScrollDirection: "forward",
|
|
164
|
-
scrollLeft: typeof r.props.initialScrollLeft == "number" ? r.props.initialScrollLeft : 0,
|
|
165
|
-
scrollTop: typeof r.props.initialScrollTop == "number" ? r.props.initialScrollTop : 0,
|
|
166
|
-
scrollUpdateWasRequested: !1,
|
|
167
|
-
verticalScrollDirection: "forward"
|
|
168
|
-
}, r._callOnItemsRendered = void 0, r._callOnItemsRendered = M(function(e, t, n, i, a, o, s, c) {
|
|
169
|
-
return r.props.onItemsRendered({
|
|
170
|
-
overscanColumnStartIndex: e,
|
|
171
|
-
overscanColumnStopIndex: t,
|
|
172
|
-
overscanRowStartIndex: n,
|
|
173
|
-
overscanRowStopIndex: i,
|
|
174
|
-
visibleColumnStartIndex: a,
|
|
175
|
-
visibleColumnStopIndex: o,
|
|
176
|
-
visibleRowStartIndex: s,
|
|
177
|
-
visibleRowStopIndex: c
|
|
178
|
-
});
|
|
179
|
-
}), r._callOnScroll = void 0, r._callOnScroll = M(function(e, t, n, i, a) {
|
|
180
|
-
return r.props.onScroll({
|
|
181
|
-
horizontalScrollDirection: n,
|
|
182
|
-
scrollLeft: e,
|
|
183
|
-
scrollTop: t,
|
|
184
|
-
verticalScrollDirection: i,
|
|
185
|
-
scrollUpdateWasRequested: a
|
|
186
|
-
});
|
|
187
|
-
}), r._getItemStyle = void 0, r._getItemStyle = function(e, t) {
|
|
188
|
-
var i = r.props, o = i.columnWidth, s = i.direction, c = i.rowHeight, l = r._getItemStyleCache(h && o, h && s, h && c), f = e + ":" + t, p;
|
|
189
|
-
if (l.hasOwnProperty(f)) p = l[f];
|
|
190
|
-
else {
|
|
191
|
-
var m = n(r.props, t, r._instanceProps), g = s === "rtl";
|
|
192
|
-
l[f] = p = {
|
|
193
|
-
position: "absolute",
|
|
194
|
-
left: g ? void 0 : m,
|
|
195
|
-
right: g ? m : void 0,
|
|
196
|
-
top: d(r.props, e, r._instanceProps),
|
|
197
|
-
height: u(r.props, e, r._instanceProps),
|
|
198
|
-
width: a(r.props, t, r._instanceProps)
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
return p;
|
|
202
|
-
}, r._getItemStyleCache = void 0, r._getItemStyleCache = M(function(e, t, n) {
|
|
203
|
-
return {};
|
|
204
|
-
}), r._onScroll = function(e) {
|
|
205
|
-
var t = e.currentTarget, n = t.clientHeight, i = t.clientWidth, a = t.scrollLeft, o = t.scrollTop, s = t.scrollHeight, c = t.scrollWidth;
|
|
206
|
-
r.setState(function(e) {
|
|
207
|
-
if (e.scrollLeft === a && e.scrollTop === o) return null;
|
|
208
|
-
var t = r.props.direction, l = a;
|
|
209
|
-
if (t === "rtl") switch (De()) {
|
|
210
|
-
case "negative":
|
|
211
|
-
l = -a;
|
|
212
|
-
break;
|
|
213
|
-
case "positive-descending":
|
|
214
|
-
l = c - i - a;
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
l = Math.max(0, Math.min(l, c - i));
|
|
218
|
-
var u = Math.max(0, Math.min(o, s - n));
|
|
219
|
-
return {
|
|
220
|
-
isScrolling: !0,
|
|
221
|
-
horizontalScrollDirection: e.scrollLeft < a ? "forward" : "backward",
|
|
222
|
-
scrollLeft: l,
|
|
223
|
-
scrollTop: u,
|
|
224
|
-
verticalScrollDirection: e.scrollTop < o ? "forward" : "backward",
|
|
225
|
-
scrollUpdateWasRequested: !1
|
|
226
|
-
};
|
|
227
|
-
}, r._resetIsScrollingDebounced);
|
|
228
|
-
}, r._outerRefSetter = function(e) {
|
|
229
|
-
var t = r.props.outerRef;
|
|
230
|
-
r._outerRef = e, typeof t == "function" ? t(e) : typeof t == "object" && t && t.hasOwnProperty("current") && (t.current = e);
|
|
231
|
-
}, r._resetIsScrollingDebounced = function() {
|
|
232
|
-
r._resetIsScrollingTimeoutId !== null && we(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Te(r._resetIsScrolling, Oe);
|
|
233
|
-
}, r._resetIsScrolling = function() {
|
|
234
|
-
r._resetIsScrollingTimeoutId = null, r.setState({ isScrolling: !1 }, function() {
|
|
235
|
-
r._getItemStyleCache(-1);
|
|
236
|
-
});
|
|
237
|
-
}, r;
|
|
238
|
-
}
|
|
239
|
-
t.getDerivedStateFromProps = function(e, t) {
|
|
240
|
-
return V(e, t), g(e), null;
|
|
241
|
-
};
|
|
242
|
-
var _ = t.prototype;
|
|
243
|
-
return _.scrollTo = function(e) {
|
|
244
|
-
var t = e.scrollLeft, n = e.scrollTop;
|
|
245
|
-
t !== void 0 && (t = Math.max(0, t)), n !== void 0 && (n = Math.max(0, n)), this.setState(function(e) {
|
|
246
|
-
return t === void 0 && (t = e.scrollLeft), n === void 0 && (n = e.scrollTop), e.scrollLeft === t && e.scrollTop === n ? null : {
|
|
247
|
-
horizontalScrollDirection: e.scrollLeft < t ? "forward" : "backward",
|
|
248
|
-
scrollLeft: t,
|
|
249
|
-
scrollTop: n,
|
|
250
|
-
scrollUpdateWasRequested: !0,
|
|
251
|
-
verticalScrollDirection: e.scrollTop < n ? "forward" : "backward"
|
|
252
|
-
};
|
|
253
|
-
}, this._resetIsScrollingDebounced);
|
|
254
|
-
}, _.scrollToItem = function(e) {
|
|
255
|
-
var t = e.align, n = t === void 0 ? "auto" : t, r = e.columnIndex, i = e.rowIndex, a = this.props, u = a.columnCount, d = a.height, f = a.rowCount, p = a.width, m = this.state, h = m.scrollLeft, g = m.scrollTop, _ = Ee();
|
|
256
|
-
r !== void 0 && (r = Math.max(0, Math.min(r, u - 1))), i !== void 0 && (i = Math.max(0, Math.min(i, f - 1)));
|
|
257
|
-
var v = o(this.props, this._instanceProps), ee = s(this.props, this._instanceProps) > p ? _ : 0, y = v > d ? _ : 0;
|
|
258
|
-
this.scrollTo({
|
|
259
|
-
scrollLeft: r === void 0 ? h : c(this.props, r, n, h, this._instanceProps, y),
|
|
260
|
-
scrollTop: i === void 0 ? g : l(this.props, i, n, g, this._instanceProps, ee)
|
|
261
|
-
});
|
|
262
|
-
}, _.componentDidMount = function() {
|
|
263
|
-
var e = this.props, t = e.initialScrollLeft, n = e.initialScrollTop;
|
|
264
|
-
if (this._outerRef != null) {
|
|
265
|
-
var r = this._outerRef;
|
|
266
|
-
typeof t == "number" && (r.scrollLeft = t), typeof n == "number" && (r.scrollTop = n);
|
|
267
|
-
}
|
|
268
|
-
this._callPropsCallbacks();
|
|
269
|
-
}, _.componentDidUpdate = function() {
|
|
270
|
-
var e = this.props.direction, t = this.state, n = t.scrollLeft, r = t.scrollTop;
|
|
271
|
-
if (t.scrollUpdateWasRequested && this._outerRef != null) {
|
|
272
|
-
var i = this._outerRef;
|
|
273
|
-
if (e === "rtl") switch (De()) {
|
|
274
|
-
case "negative":
|
|
275
|
-
i.scrollLeft = -n;
|
|
276
|
-
break;
|
|
277
|
-
case "positive-ascending":
|
|
278
|
-
i.scrollLeft = n;
|
|
279
|
-
break;
|
|
280
|
-
default:
|
|
281
|
-
var a = i.clientWidth;
|
|
282
|
-
i.scrollLeft = i.scrollWidth - a - n;
|
|
283
|
-
break;
|
|
284
|
-
}
|
|
285
|
-
else i.scrollLeft = Math.max(0, n);
|
|
286
|
-
i.scrollTop = Math.max(0, r);
|
|
287
|
-
}
|
|
288
|
-
this._callPropsCallbacks();
|
|
289
|
-
}, _.componentWillUnmount = function() {
|
|
290
|
-
this._resetIsScrollingTimeoutId !== null && we(this._resetIsScrollingTimeoutId);
|
|
291
|
-
}, _.render = function() {
|
|
292
|
-
var e = this.props, t = e.children, n = e.className, r = e.columnCount, i = e.direction, a = e.height, c = e.innerRef, l = e.innerElementType, u = e.innerTagName, d = e.itemData, f = e.itemKey, p = f === void 0 ? L : f, m = e.outerElementType, h = e.outerTagName, g = e.rowCount, _ = e.style, v = e.useIsScrolling, ee = e.width, y = this.state.isScrolling, te = this._getHorizontalRangeToRender(), ne = te[0], re = te[1], ie = this._getVerticalRangeToRender(), ae = ie[0], oe = ie[1], se = [];
|
|
293
|
-
if (r > 0 && g) for (var b = ae; b <= oe; b++) for (var x = ne; x <= re; x++) se.push(C(t, {
|
|
294
|
-
columnIndex: x,
|
|
295
|
-
data: d,
|
|
296
|
-
isScrolling: v ? y : void 0,
|
|
297
|
-
key: p({
|
|
298
|
-
columnIndex: x,
|
|
299
|
-
data: d,
|
|
300
|
-
rowIndex: b
|
|
301
|
-
}),
|
|
302
|
-
rowIndex: b,
|
|
303
|
-
style: this._getItemStyle(b, x)
|
|
304
|
-
}));
|
|
305
|
-
var ce = o(this.props, this._instanceProps), le = s(this.props, this._instanceProps);
|
|
306
|
-
return C(m || h || "div", {
|
|
307
|
-
className: n,
|
|
308
|
-
onScroll: this._onScroll,
|
|
309
|
-
ref: this._outerRefSetter,
|
|
310
|
-
style: k({
|
|
311
|
-
position: "relative",
|
|
312
|
-
height: a,
|
|
313
|
-
width: ee,
|
|
314
|
-
overflow: "auto",
|
|
315
|
-
WebkitOverflowScrolling: "touch",
|
|
316
|
-
willChange: "transform",
|
|
317
|
-
direction: i
|
|
318
|
-
}, _)
|
|
319
|
-
}, C(l || u || "div", {
|
|
320
|
-
children: se,
|
|
321
|
-
ref: c,
|
|
322
|
-
style: {
|
|
323
|
-
height: ce,
|
|
324
|
-
pointerEvents: y ? "none" : void 0,
|
|
325
|
-
width: le
|
|
326
|
-
}
|
|
327
|
-
}));
|
|
328
|
-
}, _._callPropsCallbacks = function() {
|
|
329
|
-
var e = this.props, t = e.columnCount, n = e.onItemsRendered, r = e.onScroll, i = e.rowCount;
|
|
330
|
-
if (typeof n == "function" && t > 0 && i > 0) {
|
|
331
|
-
var a = this._getHorizontalRangeToRender(), o = a[0], s = a[1], c = a[2], l = a[3], u = this._getVerticalRangeToRender(), d = u[0], f = u[1], p = u[2], m = u[3];
|
|
332
|
-
this._callOnItemsRendered(o, s, d, f, c, l, p, m);
|
|
333
|
-
}
|
|
334
|
-
if (typeof r == "function") {
|
|
335
|
-
var h = this.state, g = h.horizontalScrollDirection, _ = h.scrollLeft, v = h.scrollTop, ee = h.scrollUpdateWasRequested, y = h.verticalScrollDirection;
|
|
336
|
-
this._callOnScroll(_, v, g, y, ee);
|
|
337
|
-
}
|
|
338
|
-
}, _._getHorizontalRangeToRender = function() {
|
|
339
|
-
var e = this.props, t = e.columnCount, n = e.overscanColumnCount, a = e.overscanColumnsCount, o = e.overscanCount, s = e.rowCount, c = this.state, l = c.horizontalScrollDirection, u = c.isScrolling, d = c.scrollLeft, f = n || a || o || 1;
|
|
340
|
-
if (t === 0 || s === 0) return [
|
|
341
|
-
0,
|
|
342
|
-
0,
|
|
343
|
-
0,
|
|
344
|
-
0
|
|
345
|
-
];
|
|
346
|
-
var p = r(this.props, d, this._instanceProps), m = i(this.props, p, d, this._instanceProps), h = !u || l === "backward" ? Math.max(1, f) : 1, g = !u || l === "forward" ? Math.max(1, f) : 1;
|
|
347
|
-
return [
|
|
348
|
-
Math.max(0, p - h),
|
|
349
|
-
Math.max(0, Math.min(t - 1, m + g)),
|
|
350
|
-
p,
|
|
351
|
-
m
|
|
352
|
-
];
|
|
353
|
-
}, _._getVerticalRangeToRender = function() {
|
|
354
|
-
var e = this.props, t = e.columnCount, n = e.overscanCount, r = e.overscanRowCount, i = e.overscanRowsCount, a = e.rowCount, o = this.state, s = o.isScrolling, c = o.verticalScrollDirection, l = o.scrollTop, u = r || i || n || 1;
|
|
355
|
-
if (t === 0 || a === 0) return [
|
|
356
|
-
0,
|
|
357
|
-
0,
|
|
358
|
-
0,
|
|
359
|
-
0
|
|
360
|
-
];
|
|
361
|
-
var d = f(this.props, l, this._instanceProps), m = p(this.props, d, l, this._instanceProps), h = !s || c === "backward" ? Math.max(1, u) : 1, g = !s || c === "forward" ? Math.max(1, u) : 1;
|
|
362
|
-
return [
|
|
363
|
-
Math.max(0, d - h),
|
|
364
|
-
Math.max(0, Math.min(a - 1, m + g)),
|
|
365
|
-
d,
|
|
366
|
-
m
|
|
367
|
-
];
|
|
368
|
-
}, t;
|
|
369
|
-
}(S), t.defaultProps = {
|
|
370
|
-
direction: "ltr",
|
|
371
|
-
itemData: void 0,
|
|
372
|
-
useIsScrolling: !1
|
|
373
|
-
}, t;
|
|
374
|
-
}
|
|
375
|
-
var V = function(e, t) {
|
|
376
|
-
var n = e.children, r = e.direction, i = e.height, a = e.innerTagName, o = e.outerTagName, s = e.overscanColumnsCount, c = e.overscanCount, l = e.overscanRowsCount, u = e.width, d = t.instance;
|
|
377
|
-
if (process.env.NODE_ENV !== "production") {
|
|
378
|
-
if (typeof c == "number" && R && !R.has(d) && (R.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof s == "number" || typeof l == "number") && z && !z.has(d) && (z.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || o != null) && B && !B.has(d) && (B.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), n == null) throw Error("An invalid \"children\" prop has been specified. Value should be a React component. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
|
|
379
|
-
switch (r) {
|
|
380
|
-
case "ltr":
|
|
381
|
-
case "rtl": break;
|
|
382
|
-
default: throw Error("An invalid \"direction\" prop has been specified. Value should be either \"ltr\" or \"rtl\". " + ("\"" + r + "\" was specified."));
|
|
383
|
-
}
|
|
384
|
-
if (typeof u != "number") throw Error("An invalid \"width\" prop has been specified. Grids must specify a number for width. " + ("\"" + (u === null ? "null" : typeof u) + "\" was specified."));
|
|
385
|
-
if (typeof i != "number") throw Error("An invalid \"height\" prop has been specified. Grids must specify a number for height. " + ("\"" + (i === null ? "null" : typeof i) + "\" was specified."));
|
|
386
|
-
}
|
|
387
|
-
}, Ae = 50, je = function(e, t) {
|
|
388
|
-
var n = e.rowCount, r = t.rowMetadataMap, i = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, o = 0;
|
|
389
|
-
if (a >= n && (a = n - 1), a >= 0) {
|
|
390
|
-
var s = r[a];
|
|
391
|
-
o = s.offset + s.size;
|
|
392
|
-
}
|
|
393
|
-
var c = (n - a - 1) * i;
|
|
394
|
-
return o + c;
|
|
395
|
-
}, H = function(e, t) {
|
|
396
|
-
var n = e.columnCount, r = t.columnMetadataMap, i = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, o = 0;
|
|
397
|
-
if (a >= n && (a = n - 1), a >= 0) {
|
|
398
|
-
var s = r[a];
|
|
399
|
-
o = s.offset + s.size;
|
|
400
|
-
}
|
|
401
|
-
var c = (n - a - 1) * i;
|
|
402
|
-
return o + c;
|
|
403
|
-
}, U = function(e, t, n, r) {
|
|
404
|
-
var i, a, o;
|
|
405
|
-
if (e === "column" ? (i = r.columnMetadataMap, a = t.columnWidth, o = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, a = t.rowHeight, o = r.lastMeasuredRowIndex), n > o) {
|
|
406
|
-
var s = 0;
|
|
407
|
-
if (o >= 0) {
|
|
408
|
-
var c = i[o];
|
|
409
|
-
s = c.offset + c.size;
|
|
410
|
-
}
|
|
411
|
-
for (var l = o + 1; l <= n; l++) {
|
|
412
|
-
var u = a(l);
|
|
413
|
-
i[l] = {
|
|
414
|
-
offset: s,
|
|
415
|
-
size: u
|
|
416
|
-
}, s += u;
|
|
417
|
-
}
|
|
418
|
-
e === "column" ? r.lastMeasuredColumnIndex = n : r.lastMeasuredRowIndex = n;
|
|
419
|
-
}
|
|
420
|
-
return i[n];
|
|
421
|
-
}, Me = function(e, t, n, r) {
|
|
422
|
-
var i, a;
|
|
423
|
-
return e === "column" ? (i = n.columnMetadataMap, a = n.lastMeasuredColumnIndex) : (i = n.rowMetadataMap, a = n.lastMeasuredRowIndex), (a > 0 ? i[a].offset : 0) >= r ? Ne(e, t, n, a, 0, r) : Pe(e, t, n, Math.max(0, a), r);
|
|
424
|
-
}, Ne = function(e, t, n, r, i, a) {
|
|
425
|
-
for (; i <= r;) {
|
|
426
|
-
var o = i + Math.floor((r - i) / 2), s = U(e, t, o, n).offset;
|
|
427
|
-
if (s === a) return o;
|
|
428
|
-
s < a ? i = o + 1 : s > a && (r = o - 1);
|
|
429
|
-
}
|
|
430
|
-
return i > 0 ? i - 1 : 0;
|
|
431
|
-
}, Pe = function(e, t, n, r, i) {
|
|
432
|
-
for (var a = e === "column" ? t.columnCount : t.rowCount, o = 1; r < a && U(e, t, r, n).offset < i;) r += o, o *= 2;
|
|
433
|
-
return Ne(e, t, n, Math.min(r, a - 1), Math.floor(r / 2), i);
|
|
434
|
-
}, Fe = function(e, t, n, r, i, a, o) {
|
|
435
|
-
var s = e === "column" ? t.width : t.height, c = U(e, t, n, a), l = e === "column" ? H(t, a) : je(t, a), u = Math.max(0, Math.min(l - s, c.offset)), d = Math.max(0, c.offset - s + o + c.size);
|
|
436
|
-
switch (r === "smart" && (r = i >= d - s && i <= u + s ? "auto" : "center"), r) {
|
|
437
|
-
case "start": return u;
|
|
438
|
-
case "end": return d;
|
|
439
|
-
case "center": return Math.round(d + (u - d) / 2);
|
|
440
|
-
default: return i >= d && i <= u ? i : d > u || i < d ? d : u;
|
|
441
|
-
}
|
|
442
|
-
}, Ie = /* @__PURE__ */ ke({
|
|
443
|
-
getColumnOffset: function(e, t, n) {
|
|
444
|
-
return U("column", e, t, n).offset;
|
|
445
|
-
},
|
|
446
|
-
getColumnStartIndexForOffset: function(e, t, n) {
|
|
447
|
-
return Me("column", e, n, t);
|
|
448
|
-
},
|
|
449
|
-
getColumnStopIndexForStartIndex: function(e, t, n, r) {
|
|
450
|
-
for (var i = e.columnCount, a = e.width, o = U("column", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("column", e, l, r).size;
|
|
451
|
-
return l;
|
|
452
|
-
},
|
|
453
|
-
getColumnWidth: function(e, t, n) {
|
|
454
|
-
return n.columnMetadataMap[t].size;
|
|
455
|
-
},
|
|
456
|
-
getEstimatedTotalHeight: je,
|
|
457
|
-
getEstimatedTotalWidth: H,
|
|
458
|
-
getOffsetForColumnAndAlignment: function(e, t, n, r, i, a) {
|
|
459
|
-
return Fe("column", e, t, n, r, i, a);
|
|
460
|
-
},
|
|
461
|
-
getOffsetForRowAndAlignment: function(e, t, n, r, i, a) {
|
|
462
|
-
return Fe("row", e, t, n, r, i, a);
|
|
463
|
-
},
|
|
464
|
-
getRowOffset: function(e, t, n) {
|
|
465
|
-
return U("row", e, t, n).offset;
|
|
466
|
-
},
|
|
467
|
-
getRowHeight: function(e, t, n) {
|
|
468
|
-
return n.rowMetadataMap[t].size;
|
|
469
|
-
},
|
|
470
|
-
getRowStartIndexForOffset: function(e, t, n) {
|
|
471
|
-
return Me("row", e, n, t);
|
|
472
|
-
},
|
|
473
|
-
getRowStopIndexForStartIndex: function(e, t, n, r) {
|
|
474
|
-
for (var i = e.rowCount, a = e.height, o = U("row", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("row", e, l, r).size;
|
|
475
|
-
return l;
|
|
476
|
-
},
|
|
477
|
-
initInstanceProps: function(e, t) {
|
|
478
|
-
var n = e, r = n.estimatedColumnWidth, i = n.estimatedRowHeight, a = {
|
|
479
|
-
columnMetadataMap: {},
|
|
480
|
-
estimatedColumnWidth: r || Ae,
|
|
481
|
-
estimatedRowHeight: i || Ae,
|
|
482
|
-
lastMeasuredColumnIndex: -1,
|
|
483
|
-
lastMeasuredRowIndex: -1,
|
|
484
|
-
rowMetadataMap: {}
|
|
485
|
-
};
|
|
486
|
-
return t.resetAfterColumnIndex = function(e, n) {
|
|
487
|
-
n === void 0 && (n = !0), t.resetAfterIndices({
|
|
488
|
-
columnIndex: e,
|
|
489
|
-
shouldForceUpdate: n
|
|
490
|
-
});
|
|
491
|
-
}, t.resetAfterRowIndex = function(e, n) {
|
|
492
|
-
n === void 0 && (n = !0), t.resetAfterIndices({
|
|
493
|
-
rowIndex: e,
|
|
494
|
-
shouldForceUpdate: n
|
|
495
|
-
});
|
|
496
|
-
}, t.resetAfterIndices = function(e) {
|
|
497
|
-
var n = e.columnIndex, r = e.rowIndex, i = e.shouldForceUpdate, o = i === void 0 ? !0 : i;
|
|
498
|
-
typeof n == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, n - 1)), typeof r == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, r - 1)), t._getItemStyleCache(-1), o && t.forceUpdate();
|
|
499
|
-
}, a;
|
|
500
|
-
},
|
|
501
|
-
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
502
|
-
validateProps: function(e) {
|
|
503
|
-
var t = e.columnWidth, n = e.rowHeight;
|
|
504
|
-
if (process.env.NODE_ENV !== "production") {
|
|
505
|
-
if (typeof t != "function") throw Error("An invalid \"columnWidth\" prop has been specified. Value should be a function. " + ("\"" + (t === null ? "null" : typeof t) + "\" was specified."));
|
|
506
|
-
if (typeof n != "function") throw Error("An invalid \"rowHeight\" prop has been specified. Value should be a function. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
});
|
|
510
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet;
|
|
511
|
-
function W(e, t) {
|
|
512
|
-
for (var n in e) if (!(n in t)) return !0;
|
|
513
|
-
for (var r in t) if (e[r] !== t[r]) return !0;
|
|
514
|
-
return !1;
|
|
515
|
-
}
|
|
516
|
-
var G = ["style"], K = ["style"];
|
|
517
|
-
function q(e, t) {
|
|
518
|
-
var n = e.style, r = N(e, G), i = t.style, a = N(t, K);
|
|
519
|
-
return !W(n, i) && !W(r, a);
|
|
520
|
-
}
|
|
521
|
-
//#endregion
|
|
522
|
-
//#region node_modules/.pnpm/react-virtualized-auto-sizer@1.0.26_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.esm.js
|
|
523
|
-
var J = typeof window < "u" ? window : typeof self < "u" ? self : global, Y = null, X = null, Le = 20, Z = J.clearTimeout, Re = J.setTimeout, Q = J.cancelAnimationFrame || J.mozCancelAnimationFrame || J.webkitCancelAnimationFrame, $ = J.requestAnimationFrame || J.mozRequestAnimationFrame || J.webkitRequestAnimationFrame;
|
|
524
|
-
Q == null || $ == null ? (Y = Z, X = function(e) {
|
|
525
|
-
return Re(e, Le);
|
|
526
|
-
}) : (Y = function([e, t]) {
|
|
527
|
-
Q(e), Z(t);
|
|
528
|
-
}, X = function(e) {
|
|
529
|
-
let t = $(function() {
|
|
530
|
-
Z(n), e();
|
|
531
|
-
}), n = Re(function() {
|
|
532
|
-
Q(t), e();
|
|
533
|
-
}, Le);
|
|
534
|
-
return [t, n];
|
|
535
|
-
});
|
|
536
|
-
function ze(e) {
|
|
537
|
-
let t, n, r, i, a, o, s, c = typeof document < "u" && document.attachEvent;
|
|
538
|
-
if (!c) {
|
|
539
|
-
o = function(e) {
|
|
540
|
-
let t = e.__resizeTriggers__, n = t.firstElementChild, r = t.lastElementChild, i = n.firstElementChild;
|
|
541
|
-
r.scrollLeft = r.scrollWidth, r.scrollTop = r.scrollHeight, i.style.width = n.offsetWidth + 1 + "px", i.style.height = n.offsetHeight + 1 + "px", n.scrollLeft = n.scrollWidth, n.scrollTop = n.scrollHeight;
|
|
542
|
-
}, a = function(e) {
|
|
543
|
-
return e.offsetWidth !== e.__resizeLast__.width || e.offsetHeight !== e.__resizeLast__.height;
|
|
544
|
-
}, s = function(e) {
|
|
545
|
-
if (e.target.className && typeof e.target.className.indexOf == "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) return;
|
|
546
|
-
let t = this;
|
|
547
|
-
o(this), this.__resizeRAF__ && Y(this.__resizeRAF__), this.__resizeRAF__ = X(function() {
|
|
548
|
-
a(t) && (t.__resizeLast__.width = t.offsetWidth, t.__resizeLast__.height = t.offsetHeight, t.__resizeListeners__.forEach(function(n) {
|
|
549
|
-
n.call(t, e);
|
|
550
|
-
}));
|
|
551
|
-
});
|
|
552
|
-
};
|
|
553
|
-
let e = !1, c = "";
|
|
554
|
-
r = "animationstart";
|
|
555
|
-
let l = "Webkit Moz O ms".split(" "), u = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), d = "";
|
|
556
|
-
{
|
|
557
|
-
let t = document.createElement("fakeelement");
|
|
558
|
-
if (t.style.animationName !== void 0 && (e = !0), e === !1) {
|
|
559
|
-
for (let n = 0; n < l.length; n++) if (t.style[l[n] + "AnimationName"] !== void 0) {
|
|
560
|
-
d = l[n], c = "-" + d.toLowerCase() + "-", r = u[n], e = !0;
|
|
561
|
-
break;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
n = "resizeanim", t = "@" + c + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", i = c + "animation: 1ms " + n + "; ";
|
|
566
|
-
}
|
|
567
|
-
let l = function(n) {
|
|
568
|
-
if (!n.getElementById("detectElementResize")) {
|
|
569
|
-
let r = (t || "") + ".resize-triggers { " + (i || "") + "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%; }", a = n.head || n.getElementsByTagName("head")[0], o = n.createElement("style");
|
|
570
|
-
o.id = "detectElementResize", o.type = "text/css", e != null && o.setAttribute("nonce", e), o.styleSheet ? o.styleSheet.cssText = r : o.appendChild(n.createTextNode(r)), a.appendChild(o);
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
return {
|
|
574
|
-
addResizeListener: function(e, t) {
|
|
575
|
-
if (c) e.attachEvent("onresize", t);
|
|
576
|
-
else {
|
|
577
|
-
if (!e.__resizeTriggers__) {
|
|
578
|
-
let t = e.ownerDocument, i = J.getComputedStyle(e);
|
|
579
|
-
i && i.position === "static" && (e.style.position = "relative"), l(t), e.__resizeLast__ = {}, e.__resizeListeners__ = [], (e.__resizeTriggers__ = t.createElement("div")).className = "resize-triggers";
|
|
580
|
-
let a = t.createElement("div");
|
|
581
|
-
a.className = "expand-trigger", a.appendChild(t.createElement("div"));
|
|
582
|
-
let c = t.createElement("div");
|
|
583
|
-
c.className = "contract-trigger", e.__resizeTriggers__.appendChild(a), e.__resizeTriggers__.appendChild(c), e.appendChild(e.__resizeTriggers__), o(e), e.addEventListener("scroll", s, !0), r && (e.__resizeTriggers__.__animationListener__ = function(t) {
|
|
584
|
-
t.animationName === n && o(e);
|
|
585
|
-
}, e.__resizeTriggers__.addEventListener(r, e.__resizeTriggers__.__animationListener__));
|
|
586
|
-
}
|
|
587
|
-
e.__resizeListeners__.push(t);
|
|
588
|
-
}
|
|
589
|
-
},
|
|
590
|
-
removeResizeListener: function(e, t) {
|
|
591
|
-
if (c) e.detachEvent("onresize", t);
|
|
592
|
-
else if (e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t), 1), !e.__resizeListeners__.length) {
|
|
593
|
-
e.removeEventListener("scroll", s, !0), e.__resizeTriggers__.__animationListener__ && (e.__resizeTriggers__.removeEventListener(r, e.__resizeTriggers__.__animationListener__), e.__resizeTriggers__.__animationListener__ = null);
|
|
594
|
-
try {
|
|
595
|
-
e.__resizeTriggers__ = !e.removeChild(e.__resizeTriggers__);
|
|
596
|
-
} catch {}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
var Be = class extends pe {
|
|
602
|
-
constructor(...e) {
|
|
603
|
-
super(...e), this.state = {
|
|
604
|
-
height: this.props.defaultHeight || 0,
|
|
605
|
-
width: this.props.defaultWidth || 0
|
|
606
|
-
}, this._autoSizer = null, this._detectElementResize = null, this._didLogDeprecationWarning = !1, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
607
|
-
this._timeoutId = null;
|
|
608
|
-
let { disableHeight: e, disableWidth: t, onResize: n } = this.props;
|
|
609
|
-
if (this._parentNode) {
|
|
610
|
-
let r = window.getComputedStyle(this._parentNode) || {}, i = parseFloat(r.paddingLeft || "0"), a = parseFloat(r.paddingRight || "0"), o = parseFloat(r.paddingTop || "0"), s = parseFloat(r.paddingBottom || "0"), c = this._parentNode.getBoundingClientRect(), l = c.height - o - s, u = c.width - i - a;
|
|
611
|
-
if (!e && this.state.height !== l || !t && this.state.width !== u) {
|
|
612
|
-
this.setState({
|
|
613
|
-
height: l,
|
|
614
|
-
width: u
|
|
615
|
-
});
|
|
616
|
-
let e = () => {
|
|
617
|
-
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
618
|
-
};
|
|
619
|
-
typeof n == "function" && n({
|
|
620
|
-
height: l,
|
|
621
|
-
width: u,
|
|
622
|
-
get scaledHeight() {
|
|
623
|
-
return e(), l;
|
|
624
|
-
},
|
|
625
|
-
get scaledWidth() {
|
|
626
|
-
return e(), u;
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}, this._setRef = (e) => {
|
|
632
|
-
this._autoSizer = e;
|
|
633
|
-
};
|
|
634
|
-
}
|
|
635
|
-
componentDidMount() {
|
|
636
|
-
let { nonce: e } = this.props, t = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
637
|
-
if (t != null && t.ownerDocument && t.ownerDocument.defaultView && t instanceof t.ownerDocument.defaultView.HTMLElement) {
|
|
638
|
-
this._parentNode = t;
|
|
639
|
-
let n = t.ownerDocument.defaultView.ResizeObserver;
|
|
640
|
-
n == null ? (this._detectElementResize = ze(e), this._detectElementResize.addResizeListener(t, this._onResize)) : (this._resizeObserver = new n(() => {
|
|
641
|
-
this._timeoutId = setTimeout(this._onResize, 0);
|
|
642
|
-
}), this._resizeObserver.observe(t)), this._onResize();
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
componentWillUnmount() {
|
|
646
|
-
this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
|
|
647
|
-
}
|
|
648
|
-
render() {
|
|
649
|
-
let { children: e, defaultHeight: t, defaultWidth: n, disableHeight: r = !1, disableWidth: i = !1, doNotBailOutOnEmptyChildren: a = !1, nonce: o, onResize: s, style: c = {}, tagName: l = "div", ...u } = this.props, { height: d, width: f } = this.state, p = { overflow: "visible" }, m = {}, h = !1;
|
|
650
|
-
return r || (d === 0 && (h = !0), p.height = 0, m.height = d, m.scaledHeight = d), i || (f === 0 && (h = !0), p.width = 0, m.width = f, m.scaledWidth = f), a && (h = !1), C(l, {
|
|
651
|
-
ref: this._setRef,
|
|
652
|
-
style: {
|
|
653
|
-
...p,
|
|
654
|
-
...c
|
|
655
|
-
},
|
|
656
|
-
...u
|
|
657
|
-
}, !h && e(m));
|
|
658
|
-
}
|
|
659
|
-
}, Ve = me(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
|
|
660
|
-
let i = p(t, e, n.columnCount, n.isDualPageWithCover);
|
|
661
|
-
if (i <= 0) return null;
|
|
662
|
-
if (n.isDualPageWithCover) {
|
|
663
|
-
let a = i === n.totalPages && n.totalPages % 2 == 0;
|
|
664
|
-
if (t === 0 && i === 1 || a && e === 0) {
|
|
665
|
-
let e = n.columnWidths.reduce((e, t) => e + t, 0);
|
|
666
|
-
return /* @__PURE__ */ D("div", {
|
|
667
|
-
style: {
|
|
668
|
-
...r,
|
|
669
|
-
width: e,
|
|
670
|
-
display: "flex",
|
|
671
|
-
justifyContent: "center",
|
|
672
|
-
alignItems: "flex-start"
|
|
673
|
-
},
|
|
674
|
-
children: /* @__PURE__ */ D(y, {
|
|
675
|
-
style: { position: "relative" },
|
|
676
|
-
pageNumber: i
|
|
677
|
-
}, i)
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
return n.columnCount === 2 ? /* @__PURE__ */ D("div", {
|
|
682
|
-
style: {
|
|
683
|
-
...r,
|
|
684
|
-
display: "flex",
|
|
685
|
-
justifyContent: e === 0 ? "flex-end" : "flex-start",
|
|
686
|
-
alignItems: "flex-start"
|
|
687
|
-
},
|
|
688
|
-
children: /* @__PURE__ */ D(y, {
|
|
689
|
-
style: { position: "relative" },
|
|
690
|
-
pageNumber: i
|
|
691
|
-
}, i)
|
|
692
|
-
}) : /* @__PURE__ */ D(y, {
|
|
693
|
-
style: r,
|
|
694
|
-
pageNumber: i
|
|
695
|
-
}, i);
|
|
696
|
-
}, q), He = () => {
|
|
697
|
-
let p = E(new _e()), { initialPage: y = 1, initialScrollMode: pe } = o(), { pagesRef: S, setPagesRef: C, setContentRef: me } = u(), { scrollToPage: k } = m();
|
|
698
|
-
ue(S);
|
|
699
|
-
let { virtualScrollRef: A, getVirtualScrollRef: be, getPageScrollElementRef: xe, getVirtualScrollableElementRef: Se, setTotalInnerDimensions: Ce, virtualScrollableElementRef: j, totalInnerDimensions: M, pageScrollElementRef: N } = l(), P = E(y > 1), [we, Te] = ge(y > 1), { nextPage: F, prevPage: Ee, setFocusedPage: I, focusedPage: De, totalPages: Oe } = h(), { scrollMode: L } = s(), { viewMode: R } = c(), z = E(null), B = E(null), { loading: ke, error: V } = a(), { passwordRequired: Ae } = i(), { LoaderImageComponent: je } = ee(), H = E(M), U = E({
|
|
700
|
-
viewMode: R,
|
|
701
|
-
scrollMode: L
|
|
702
|
-
}), Me = E(!1), Ne = E(), { isFullScreen: Pe } = _(), { pageDimension: Fe, rowCount: W, rowHeight: G, columnCount: K, columnWidth: q, estimatedColumnWidth: J, estimatedRowHeight: Y, totalDimension: X } = te(), Le = f(M, 100), { onScroll: Z, onTextSelect: Re } = d();
|
|
703
|
-
de({
|
|
704
|
-
onTextSelect: Re,
|
|
705
|
-
pagesRef: S
|
|
706
|
-
});
|
|
707
|
-
let Q = E();
|
|
708
|
-
x(K, W, j, R);
|
|
709
|
-
let $ = E({
|
|
710
|
-
scrollTop: 0,
|
|
711
|
-
scrollLeft: 0
|
|
712
|
-
});
|
|
713
|
-
se(S);
|
|
714
|
-
let { isPressed: ze } = ae(), { selectionMode: He } = g(), { initializeGrabScroll: Ue, resetGrabState: We } = oe({ isPressed: ze }), Ge = he(() => He === n.HAND, [He]), Ke = he(() => {
|
|
715
|
-
let e = Array.from({ length: K }, (e, t) => q(t));
|
|
716
|
-
return {
|
|
717
|
-
columnCount: K,
|
|
718
|
-
isDualPageWithCover: R === r.DUAL_PAGE_WITH_COVER,
|
|
719
|
-
columnWidths: e,
|
|
720
|
-
totalPages: Oe
|
|
721
|
-
};
|
|
722
|
-
}, [
|
|
723
|
-
K,
|
|
724
|
-
R,
|
|
725
|
-
q,
|
|
726
|
-
Oe
|
|
727
|
-
]), qe = w((e) => {
|
|
728
|
-
let t = document.activeElement !== S;
|
|
729
|
-
!Pe && t || (["ArrowUp", "ArrowLeft"].includes(e.key) ? (e.preventDefault(), Ee()) : ["ArrowDown", "ArrowRight"].includes(e.key) && (e.preventDefault(), F()));
|
|
730
|
-
}, [
|
|
731
|
-
F,
|
|
732
|
-
Ee,
|
|
733
|
-
Pe,
|
|
734
|
-
L
|
|
735
|
-
]);
|
|
736
|
-
T(() => (window.addEventListener("keydown", qe), () => {
|
|
737
|
-
window.removeEventListener("keydown", qe);
|
|
738
|
-
}), [qe]), T(() => {
|
|
739
|
-
if (z.current && (z.current.style.position = "relative"), A) for (let e = 0; e < W; e++) for (let t = 0; t < K; t++) A.resetAfterIndices({
|
|
740
|
-
columnIndex: t,
|
|
741
|
-
rowIndex: e,
|
|
742
|
-
shouldForceUpdate: !0
|
|
743
|
-
});
|
|
744
|
-
}, [
|
|
745
|
-
W,
|
|
746
|
-
K,
|
|
747
|
-
Fe,
|
|
748
|
-
A
|
|
749
|
-
]);
|
|
750
|
-
let Je = w((e, t) => {
|
|
751
|
-
if (!j) return {
|
|
752
|
-
scrollTop: 0,
|
|
753
|
-
scrollLeft: 0
|
|
754
|
-
};
|
|
755
|
-
let n = $.current.scrollTop > t, r = $.current.scrollLeft > e;
|
|
756
|
-
return n || r ? $.current : {
|
|
757
|
-
scrollTop: j.scrollTop,
|
|
758
|
-
scrollLeft: j.scrollLeft
|
|
759
|
-
};
|
|
760
|
-
}, [j]), Ye = w((e, t) => {
|
|
761
|
-
if (U.current.viewMode !== R || U.current.scrollMode !== L) {
|
|
762
|
-
Q.current && clearTimeout(Q.current), Me.current = !0, k(De, "auto"), Q.current = setTimeout(() => {
|
|
763
|
-
requestAnimationFrame(() => {
|
|
764
|
-
U.current = {
|
|
765
|
-
viewMode: R,
|
|
766
|
-
scrollMode: L
|
|
767
|
-
};
|
|
768
|
-
});
|
|
769
|
-
}, 100);
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
let n = e.scrollTop, r = e.scrollLeft;
|
|
773
|
-
if (!t.height || !t.width) return;
|
|
774
|
-
Me.current = !0;
|
|
775
|
-
let { height: i, width: a } = t, { height: o, width: s } = H.current;
|
|
776
|
-
if (o === i && s === a) return;
|
|
777
|
-
if (P.current && y > 1) {
|
|
778
|
-
H.current = {
|
|
779
|
-
height: t.height,
|
|
780
|
-
width: t.width
|
|
781
|
-
};
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
if (!o || !s) {
|
|
785
|
-
H.current = {
|
|
786
|
-
height: t.height,
|
|
787
|
-
width: t.width
|
|
788
|
-
};
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
if (n === 0 && r === 0) {
|
|
792
|
-
H.current = {
|
|
793
|
-
height: t.height,
|
|
794
|
-
width: t.width
|
|
795
|
-
};
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
|
-
let c = n / o * i, l = r / s * a, u = Math.round(Math.min(c, i)) || 0, d = Math.round(Math.min(l, a)) || 0;
|
|
799
|
-
Ne.current = setTimeout(() => {
|
|
800
|
-
requestAnimationFrame(() => {
|
|
801
|
-
j?.scrollTo({
|
|
802
|
-
top: u,
|
|
803
|
-
left: d,
|
|
804
|
-
behavior: "auto"
|
|
805
|
-
});
|
|
806
|
-
});
|
|
807
|
-
}, 0), H.current = {
|
|
808
|
-
height: t.height,
|
|
809
|
-
width: t.width
|
|
810
|
-
};
|
|
811
|
-
}, [
|
|
812
|
-
j,
|
|
813
|
-
R,
|
|
814
|
-
L,
|
|
815
|
-
k,
|
|
816
|
-
y
|
|
817
|
-
]);
|
|
818
|
-
T(() => {
|
|
819
|
-
clearTimeout(Ne.current);
|
|
820
|
-
let e = Array.from({ length: W }).reduce((e, t, n) => e + G(n), 0), t = Array.from({ length: K }).reduce((e, t, n) => e + q(n), 0), n = Je(t, e);
|
|
821
|
-
$.current = n, Ye(n, {
|
|
822
|
-
height: e,
|
|
823
|
-
width: t
|
|
824
|
-
}), Ce({
|
|
825
|
-
height: e,
|
|
826
|
-
width: t
|
|
827
|
-
});
|
|
828
|
-
}, [
|
|
829
|
-
Fe,
|
|
830
|
-
W,
|
|
831
|
-
K,
|
|
832
|
-
Ye
|
|
833
|
-
]);
|
|
834
|
-
let Xe = w((e) => {
|
|
835
|
-
$.current = {
|
|
836
|
-
scrollTop: e.scrollTop,
|
|
837
|
-
scrollLeft: e.scrollLeft
|
|
838
|
-
};
|
|
839
|
-
}, [j]);
|
|
840
|
-
T(() => {
|
|
841
|
-
if (Z) return N && N.addEventListener("scroll", Z), j && j.addEventListener("scroll", Z), () => {
|
|
842
|
-
N?.removeEventListener("scroll", Z), j?.removeEventListener("scroll", Z);
|
|
843
|
-
};
|
|
844
|
-
}, [
|
|
845
|
-
j,
|
|
846
|
-
N,
|
|
847
|
-
Z
|
|
848
|
-
]), T(() => () => {
|
|
849
|
-
Q.current && clearTimeout(Q.current);
|
|
850
|
-
}, []);
|
|
851
|
-
let Ze = he(() => v(O["rp-pages-container"], {
|
|
852
|
-
[O["rp-cursor-grab"]]: Ge && !ze,
|
|
853
|
-
[O["rp-cursor-grabbing"]]: Ge && ze
|
|
854
|
-
}), [Ge, ze]), Qe = w((e) => {
|
|
855
|
-
if (Ge && e) {
|
|
856
|
-
let e = v(O["rp-pages"]);
|
|
857
|
-
Ue(document.querySelector(`.${e}`));
|
|
858
|
-
}
|
|
859
|
-
}, [
|
|
860
|
-
Ge,
|
|
861
|
-
Ue,
|
|
862
|
-
O
|
|
863
|
-
]);
|
|
864
|
-
return T(() => {
|
|
865
|
-
ke && We();
|
|
866
|
-
}, [ke]), T(() => {
|
|
867
|
-
if (V !== e.INVALID_OR_CORRUPTED_PDF) return;
|
|
868
|
-
let t = requestAnimationFrame(() => {
|
|
869
|
-
B.current?.focus();
|
|
870
|
-
});
|
|
871
|
-
return () => {
|
|
872
|
-
cancelAnimationFrame(t);
|
|
873
|
-
};
|
|
874
|
-
}, [V]), T(() => {
|
|
875
|
-
if (!(Le.height === 0 || !P.current)) {
|
|
876
|
-
if (pe === t.PAGE_SCROLLING) {
|
|
877
|
-
y !== De && N && I(y), P.current = !1, Te(!1);
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
j && (k(y, "auto"), (j.scrollLeft > 0 || j.scrollTop > 0) && (I(y), P.current = !1, Te(!1)));
|
|
881
|
-
}
|
|
882
|
-
}, [
|
|
883
|
-
k,
|
|
884
|
-
pe,
|
|
885
|
-
N,
|
|
886
|
-
I,
|
|
887
|
-
Le,
|
|
888
|
-
j
|
|
889
|
-
]), /* @__PURE__ */ ye(ve, { children: [/* @__PURE__ */ D(le, {
|
|
890
|
-
ref: me,
|
|
891
|
-
children: /* @__PURE__ */ D(ce, {
|
|
892
|
-
ref: C,
|
|
893
|
-
tabIndex: -1,
|
|
894
|
-
className: Ze,
|
|
895
|
-
style: {
|
|
896
|
-
"--scale-round-x": `${fe(p.current.sx)[1]}px`,
|
|
897
|
-
"--scale-round-y": `${fe(p.current.sy)[1]}px`
|
|
898
|
-
},
|
|
899
|
-
children: /* @__PURE__ */ D(Be, {
|
|
900
|
-
style: { minHeight: "50px" },
|
|
901
|
-
children: ({ width: n, height: i }) => /* @__PURE__ */ D("div", {
|
|
902
|
-
"data-rp": "pages",
|
|
903
|
-
ref: Qe,
|
|
904
|
-
style: {
|
|
905
|
-
width: n,
|
|
906
|
-
height: i,
|
|
907
|
-
...we && { visibility: "hidden" }
|
|
908
|
-
},
|
|
909
|
-
children: L === t.PAGE_SCROLLING ? V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
|
|
910
|
-
ref: B,
|
|
911
|
-
className: O["rp-load-error"],
|
|
912
|
-
style: {
|
|
913
|
-
width: n,
|
|
914
|
-
height: i
|
|
915
|
-
},
|
|
916
|
-
tabIndex: -1,
|
|
917
|
-
role: "alert",
|
|
918
|
-
"aria-live": "assertive",
|
|
919
|
-
"aria-atomic": "true",
|
|
920
|
-
children: /* @__PURE__ */ D("div", {
|
|
921
|
-
className: O["rp-load-error-message"],
|
|
922
|
-
children: "Invalid or corrupted PDF file."
|
|
923
|
-
})
|
|
924
|
-
}) : /* @__PURE__ */ D("div", {
|
|
925
|
-
ref: xe,
|
|
926
|
-
style: {
|
|
927
|
-
width: n,
|
|
928
|
-
height: i
|
|
929
|
-
},
|
|
930
|
-
className: v(O["rp-pages"], O["rp-page-scrolling-wrapper"]),
|
|
931
|
-
children: R === r.DUAL_PAGE ? /* @__PURE__ */ D(ne, {
|
|
932
|
-
widths: q,
|
|
933
|
-
heights: G
|
|
934
|
-
}) : R === r.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ D(re, {
|
|
935
|
-
widths: q,
|
|
936
|
-
heights: G
|
|
937
|
-
}) : /* @__PURE__ */ D(ie, {
|
|
938
|
-
widths: q,
|
|
939
|
-
heights: G
|
|
940
|
-
})
|
|
941
|
-
}) : Y ? /* @__PURE__ */ D(Ie, {
|
|
942
|
-
ref: be,
|
|
943
|
-
itemData: Ke,
|
|
944
|
-
outerRef: Se,
|
|
945
|
-
innerRef: z,
|
|
946
|
-
onScroll: Xe,
|
|
947
|
-
columnCount: K,
|
|
948
|
-
columnWidth: q,
|
|
949
|
-
rowHeight: G,
|
|
950
|
-
height: i,
|
|
951
|
-
width: n,
|
|
952
|
-
estimatedColumnWidth: J,
|
|
953
|
-
estimatedRowHeight: Y,
|
|
954
|
-
rowCount: W,
|
|
955
|
-
className: v(O["rp-pages"], L === t.HORIZONTAL_SCROLLING ? O["rp-pages-horizontal-scroll"] : ""),
|
|
956
|
-
style: {
|
|
957
|
-
"--rp-pages-height": `${X.height}px`,
|
|
958
|
-
"--rp-pages-width": `${X.width}px`,
|
|
959
|
-
"--rp-row-count": `${W}`,
|
|
960
|
-
"--rp-column-count": `${K}`
|
|
961
|
-
},
|
|
962
|
-
children: Ve
|
|
963
|
-
}) : !ke && !V ? /* @__PURE__ */ D("div", {
|
|
964
|
-
className: O["rp-loader"],
|
|
965
|
-
style: {
|
|
966
|
-
display: "flex",
|
|
967
|
-
justifyContent: "center",
|
|
968
|
-
alignItems: "center",
|
|
969
|
-
height: "100%",
|
|
970
|
-
width: "100%"
|
|
971
|
-
},
|
|
972
|
-
children: je && /* @__PURE__ */ D(je, {})
|
|
973
|
-
}) : V === e.NOT_SUPPORTED ? /* @__PURE__ */ D("div", {
|
|
974
|
-
className: O["rp-not-supported"],
|
|
975
|
-
children: /* @__PURE__ */ ye("div", {
|
|
976
|
-
className: O["rp-not-supported-content"],
|
|
977
|
-
children: ["React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:", /* @__PURE__ */ D("div", { children: /* @__PURE__ */ ye("ul", {
|
|
978
|
-
className: O["rp-not-supported-list"],
|
|
979
|
-
children: [
|
|
980
|
-
/* @__PURE__ */ D("li", { children: "Chrome 126+" }),
|
|
981
|
-
/* @__PURE__ */ D("li", { children: "Edge 126+" }),
|
|
982
|
-
/* @__PURE__ */ D("li", { children: "Firefox 126+" }),
|
|
983
|
-
/* @__PURE__ */ D("li", { children: "Safari 18.4+" }),
|
|
984
|
-
/* @__PURE__ */ D("li", { children: "Safari iOS 18.4+" }),
|
|
985
|
-
/* @__PURE__ */ D("li", { children: "Chrome Android 126+" })
|
|
986
|
-
]
|
|
987
|
-
}) })]
|
|
988
|
-
})
|
|
989
|
-
}) : V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
|
|
990
|
-
ref: B,
|
|
991
|
-
className: O["rp-load-error"],
|
|
992
|
-
tabIndex: -1,
|
|
993
|
-
role: "alert",
|
|
994
|
-
"aria-live": "assertive",
|
|
995
|
-
"aria-atomic": "true",
|
|
996
|
-
children: /* @__PURE__ */ D("div", {
|
|
997
|
-
className: O["rp-load-error-message"],
|
|
998
|
-
children: "Invalid or corrupted PDF file."
|
|
999
|
-
})
|
|
1000
|
-
}) : null
|
|
1001
|
-
})
|
|
1002
|
-
})
|
|
1003
|
-
})
|
|
1004
|
-
}), Ae && /* @__PURE__ */ D(b, {})] });
|
|
1005
|
-
};
|
|
1006
|
-
//#endregion
|
|
1007
|
-
export { He as t };
|