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