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