@react-pdf-kit/viewer 2.6.0-beta.2 → 2.6.0

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