@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,1492 @@
1
+ var St = (e, t, s) => {
2
+ if (!t.has(e))
3
+ throw TypeError("Cannot " + s);
4
+ };
5
+ var i = (e, t, s) => (St(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => {
6
+ if (t.has(e))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ t instanceof WeakSet ? t.add(e) : t.set(e, s);
9
+ }, o = (e, t, s, r) => (St(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s);
10
+ var bt = (e, t, s, r) => ({
11
+ set _(n) {
12
+ o(e, t, n, s);
13
+ },
14
+ get _() {
15
+ return i(e, t, r);
16
+ }
17
+ }), F = (e, t, s) => (St(e, t, "access private method"), s);
18
+ import { jsx as dt } from "react/jsx-runtime";
19
+ import { RPTheme as te } from "./RPTheme.js";
20
+ import { ConfigContextProvider as ee } from "../contexts/ConfigContext.js";
21
+ import { useLoadWorker as se } from "../utils/hooks/useLoadWorker.js";
22
+ import * as Bt from "react";
23
+ import { LicenseProvider as re } from "../contexts/LicenseContext.js";
24
+ import "../contexts/ThemeContext.js";
25
+ import "pdfjs-dist";
26
+ import "../utils/hooks/useLicense.js";
27
+ import "../utils/appConsole.js";
28
+ var Ct = class {
29
+ constructor() {
30
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
31
+ }
32
+ subscribe(e) {
33
+ return this.listeners.add(e), this.onSubscribe(), () => {
34
+ this.listeners.delete(e), this.onUnsubscribe();
35
+ };
36
+ }
37
+ hasListeners() {
38
+ return this.listeners.size > 0;
39
+ }
40
+ onSubscribe() {
41
+ }
42
+ onUnsubscribe() {
43
+ }
44
+ }, ie = {
45
+ // We need the wrapper function syntax below instead of direct references to
46
+ // global setTimeout etc.
47
+ //
48
+ // BAD: `setTimeout: setTimeout`
49
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
50
+ //
51
+ // If we use direct references here, then anything that wants to spy on or
52
+ // replace the global setTimeout (like tests) won't work since we'll already
53
+ // have a hard reference to the original implementation at the time when this
54
+ // file was imported.
55
+ setTimeout: (e, t) => setTimeout(e, t),
56
+ clearTimeout: (e) => clearTimeout(e),
57
+ setInterval: (e, t) => setInterval(e, t),
58
+ clearInterval: (e) => clearInterval(e)
59
+ }, x, W, Ut, ne = (Ut = class {
60
+ constructor() {
61
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
62
+ // type at app boot; and if we leave that type, then any new timer provider
63
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
64
+ //
65
+ // We settle for type safety for the TimeoutProvider type, and accept that
66
+ // this class is unsafe internally to allow for extension.
67
+ c(this, x, ie);
68
+ c(this, W, !1);
69
+ }
70
+ setTimeoutProvider(e) {
71
+ process.env.NODE_ENV !== "production" && i(this, W) && e !== i(this, x) && console.error(
72
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
73
+ { previous: i(this, x), provider: e }
74
+ ), o(this, x, e), process.env.NODE_ENV !== "production" && o(this, W, !1);
75
+ }
76
+ setTimeout(e, t) {
77
+ return process.env.NODE_ENV !== "production" && o(this, W, !0), i(this, x).setTimeout(e, t);
78
+ }
79
+ clearTimeout(e) {
80
+ i(this, x).clearTimeout(e);
81
+ }
82
+ setInterval(e, t) {
83
+ return process.env.NODE_ENV !== "production" && o(this, W, !0), i(this, x).setInterval(e, t);
84
+ }
85
+ clearInterval(e) {
86
+ i(this, x).clearInterval(e);
87
+ }
88
+ }, x = new WeakMap(), W = new WeakMap(), Ut), Et = new ne();
89
+ function ae(e) {
90
+ setTimeout(e, 0);
91
+ }
92
+ var Ft = typeof window > "u" || "Deno" in globalThis;
93
+ function R() {
94
+ }
95
+ function oe(e, t) {
96
+ return typeof e == "function" ? e(t) : e;
97
+ }
98
+ function ue(e) {
99
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
100
+ }
101
+ function he(e, t) {
102
+ return Math.max(e + (t || 0) - Date.now(), 0);
103
+ }
104
+ function Dt(e, t) {
105
+ return typeof e == "function" ? e(t) : e;
106
+ }
107
+ function ce(e, t) {
108
+ return typeof e == "function" ? e(t) : e;
109
+ }
110
+ function Tt(e, t) {
111
+ const {
112
+ type: s = "all",
113
+ exact: r,
114
+ fetchStatus: n,
115
+ predicate: a,
116
+ queryKey: l,
117
+ stale: u
118
+ } = e;
119
+ if (l) {
120
+ if (r) {
121
+ if (t.queryHash !== Mt(l, t.options))
122
+ return !1;
123
+ } else if (!yt(t.queryKey, l))
124
+ return !1;
125
+ }
126
+ if (s !== "all") {
127
+ const f = t.isActive();
128
+ if (s === "active" && !f || s === "inactive" && f)
129
+ return !1;
130
+ }
131
+ return !(typeof u == "boolean" && t.isStale() !== u || n && n !== t.state.fetchStatus || a && !a(t));
132
+ }
133
+ function Rt(e, t) {
134
+ const { exact: s, status: r, predicate: n, mutationKey: a } = e;
135
+ if (a) {
136
+ if (!t.options.mutationKey)
137
+ return !1;
138
+ if (s) {
139
+ if (ft(t.options.mutationKey) !== ft(a))
140
+ return !1;
141
+ } else if (!yt(t.options.mutationKey, a))
142
+ return !1;
143
+ }
144
+ return !(r && t.state.status !== r || n && !n(t));
145
+ }
146
+ function Mt(e, t) {
147
+ return ((t == null ? void 0 : t.queryKeyHashFn) || ft)(e);
148
+ }
149
+ function ft(e) {
150
+ return JSON.stringify(
151
+ e,
152
+ (t, s) => At(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
153
+ );
154
+ }
155
+ function yt(e, t) {
156
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => yt(e[s], t[s])) : !1;
157
+ }
158
+ var le = Object.prototype.hasOwnProperty;
159
+ function qt(e, t) {
160
+ if (e === t)
161
+ return e;
162
+ const s = It(e) && It(t);
163
+ if (!s && !(At(e) && At(t)))
164
+ return t;
165
+ const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), l = a.length, u = s ? new Array(l) : {};
166
+ let f = 0;
167
+ for (let O = 0; O < l; O++) {
168
+ const v = s ? O : a[O], C = e[v], g = t[v];
169
+ if (C === g) {
170
+ u[v] = C, (s ? O < n : le.call(e, v)) && f++;
171
+ continue;
172
+ }
173
+ if (C === null || g === null || typeof C != "object" || typeof g != "object") {
174
+ u[v] = g;
175
+ continue;
176
+ }
177
+ const q = qt(C, g);
178
+ u[v] = q, q === C && f++;
179
+ }
180
+ return n === l && f === n ? e : u;
181
+ }
182
+ function It(e) {
183
+ return Array.isArray(e) && e.length === Object.keys(e).length;
184
+ }
185
+ function At(e) {
186
+ if (!jt(e))
187
+ return !1;
188
+ const t = e.constructor;
189
+ if (t === void 0)
190
+ return !0;
191
+ const s = t.prototype;
192
+ return !(!jt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
193
+ }
194
+ function jt(e) {
195
+ return Object.prototype.toString.call(e) === "[object Object]";
196
+ }
197
+ function de(e) {
198
+ return new Promise((t) => {
199
+ Et.setTimeout(t, e);
200
+ });
201
+ }
202
+ function fe(e, t, s) {
203
+ if (typeof s.structuralSharing == "function")
204
+ return s.structuralSharing(e, t);
205
+ if (s.structuralSharing !== !1) {
206
+ if (process.env.NODE_ENV !== "production")
207
+ try {
208
+ return qt(e, t);
209
+ } catch (r) {
210
+ throw console.error(
211
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
212
+ ), r;
213
+ }
214
+ return qt(e, t);
215
+ }
216
+ return t;
217
+ }
218
+ function ye(e, t, s = 0) {
219
+ const r = [...e, t];
220
+ return s && r.length > s ? r.slice(1) : r;
221
+ }
222
+ function pe(e, t, s = 0) {
223
+ const r = [t, ...e];
224
+ return s && r.length > s ? r.slice(0, -1) : r;
225
+ }
226
+ var Pt = Symbol();
227
+ function Jt(e, t) {
228
+ return process.env.NODE_ENV !== "production" && e.queryFn === Pt && console.error(
229
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
230
+ ), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === Pt ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
231
+ }
232
+ var Z, G, rt, Nt, me = (Nt = class extends Ct {
233
+ constructor() {
234
+ super();
235
+ c(this, Z, void 0);
236
+ c(this, G, void 0);
237
+ c(this, rt, void 0);
238
+ o(this, rt, (t) => {
239
+ if (!Ft && window.addEventListener) {
240
+ const s = () => t();
241
+ return window.addEventListener("visibilitychange", s, !1), () => {
242
+ window.removeEventListener("visibilitychange", s);
243
+ };
244
+ }
245
+ });
246
+ }
247
+ onSubscribe() {
248
+ i(this, G) || this.setEventListener(i(this, rt));
249
+ }
250
+ onUnsubscribe() {
251
+ var t;
252
+ this.hasListeners() || ((t = i(this, G)) == null || t.call(this), o(this, G, void 0));
253
+ }
254
+ setEventListener(t) {
255
+ var s;
256
+ o(this, rt, t), (s = i(this, G)) == null || s.call(this), o(this, G, t((r) => {
257
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
258
+ }));
259
+ }
260
+ setFocused(t) {
261
+ i(this, Z) !== t && (o(this, Z, t), this.onFocus());
262
+ }
263
+ onFocus() {
264
+ const t = this.isFocused();
265
+ this.listeners.forEach((s) => {
266
+ s(t);
267
+ });
268
+ }
269
+ isFocused() {
270
+ var t;
271
+ return typeof i(this, Z) == "boolean" ? i(this, Z) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
272
+ }
273
+ }, Z = new WeakMap(), G = new WeakMap(), rt = new WeakMap(), Nt), Wt = new me();
274
+ function ve() {
275
+ let e, t;
276
+ const s = new Promise((n, a) => {
277
+ e = n, t = a;
278
+ });
279
+ s.status = "pending", s.catch(() => {
280
+ });
281
+ function r(n) {
282
+ Object.assign(s, n), delete s.resolve, delete s.reject;
283
+ }
284
+ return s.resolve = (n) => {
285
+ r({
286
+ status: "fulfilled",
287
+ value: n
288
+ }), e(n);
289
+ }, s.reject = (n) => {
290
+ r({
291
+ status: "rejected",
292
+ reason: n
293
+ }), t(n);
294
+ }, s;
295
+ }
296
+ var ge = ae;
297
+ function be() {
298
+ let e = [], t = 0, s = (u) => {
299
+ u();
300
+ }, r = (u) => {
301
+ u();
302
+ }, n = ge;
303
+ const a = (u) => {
304
+ t ? e.push(u) : n(() => {
305
+ s(u);
306
+ });
307
+ }, l = () => {
308
+ const u = e;
309
+ e = [], u.length && n(() => {
310
+ r(() => {
311
+ u.forEach((f) => {
312
+ s(f);
313
+ });
314
+ });
315
+ });
316
+ };
317
+ return {
318
+ batch: (u) => {
319
+ let f;
320
+ t++;
321
+ try {
322
+ f = u();
323
+ } finally {
324
+ t--, t || l();
325
+ }
326
+ return f;
327
+ },
328
+ /**
329
+ * All calls to the wrapped function will be batched.
330
+ */
331
+ batchCalls: (u) => (...f) => {
332
+ a(() => {
333
+ u(...f);
334
+ });
335
+ },
336
+ schedule: a,
337
+ /**
338
+ * Use this method to set a custom notify function.
339
+ * This can be used to for example wrap notifications with `React.act` while running tests.
340
+ */
341
+ setNotifyFunction: (u) => {
342
+ s = u;
343
+ },
344
+ /**
345
+ * Use this method to set a custom function to batch notifications together into a single tick.
346
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
347
+ */
348
+ setBatchNotifyFunction: (u) => {
349
+ r = u;
350
+ },
351
+ setScheduler: (u) => {
352
+ n = u;
353
+ }
354
+ };
355
+ }
356
+ var D = be(), it, _, nt, Ht, we = (Ht = class extends Ct {
357
+ constructor() {
358
+ super();
359
+ c(this, it, !0);
360
+ c(this, _, void 0);
361
+ c(this, nt, void 0);
362
+ o(this, nt, (t) => {
363
+ if (!Ft && window.addEventListener) {
364
+ const s = () => t(!0), r = () => t(!1);
365
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
366
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
367
+ };
368
+ }
369
+ });
370
+ }
371
+ onSubscribe() {
372
+ i(this, _) || this.setEventListener(i(this, nt));
373
+ }
374
+ onUnsubscribe() {
375
+ var t;
376
+ this.hasListeners() || ((t = i(this, _)) == null || t.call(this), o(this, _, void 0));
377
+ }
378
+ setEventListener(t) {
379
+ var s;
380
+ o(this, nt, t), (s = i(this, _)) == null || s.call(this), o(this, _, t(this.setOnline.bind(this)));
381
+ }
382
+ setOnline(t) {
383
+ i(this, it) !== t && (o(this, it, t), this.listeners.forEach((r) => {
384
+ r(t);
385
+ }));
386
+ }
387
+ isOnline() {
388
+ return i(this, it);
389
+ }
390
+ }, it = new WeakMap(), _ = new WeakMap(), nt = new WeakMap(), Ht), Ot = new we();
391
+ function Pe(e) {
392
+ return Math.min(1e3 * 2 ** e, 3e4);
393
+ }
394
+ function Zt(e) {
395
+ return (e ?? "online") === "online" ? Ot.isOnline() : !0;
396
+ }
397
+ var Qt = class extends Error {
398
+ constructor(e) {
399
+ super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
400
+ }
401
+ };
402
+ function Xt(e) {
403
+ let t = !1, s = 0, r;
404
+ const n = ve(), a = () => n.status !== "pending", l = (d) => {
405
+ var b;
406
+ if (!a()) {
407
+ const m = new Qt(d);
408
+ g(m), (b = e.onCancel) == null || b.call(e, m);
409
+ }
410
+ }, u = () => {
411
+ t = !0;
412
+ }, f = () => {
413
+ t = !1;
414
+ }, O = () => Wt.isFocused() && (e.networkMode === "always" || Ot.isOnline()) && e.canRun(), v = () => Zt(e.networkMode) && e.canRun(), C = (d) => {
415
+ a() || (r == null || r(), n.resolve(d));
416
+ }, g = (d) => {
417
+ a() || (r == null || r(), n.reject(d));
418
+ }, q = () => new Promise((d) => {
419
+ var b;
420
+ r = (m) => {
421
+ (a() || O()) && d(m);
422
+ }, (b = e.onPause) == null || b.call(e);
423
+ }).then(() => {
424
+ var d;
425
+ r = void 0, a() || (d = e.onContinue) == null || d.call(e);
426
+ }), Q = () => {
427
+ if (a())
428
+ return;
429
+ let d;
430
+ const b = s === 0 ? e.initialPromise : void 0;
431
+ try {
432
+ d = b ?? e.fn();
433
+ } catch (m) {
434
+ d = Promise.reject(m);
435
+ }
436
+ Promise.resolve(d).then(C).catch((m) => {
437
+ var T;
438
+ if (a())
439
+ return;
440
+ const A = e.retry ?? (Ft ? 0 : 3), p = e.retryDelay ?? Pe, h = typeof p == "function" ? p(s, m) : p, S = A === !0 || typeof A == "number" && s < A || typeof A == "function" && A(s, m);
441
+ if (t || !S) {
442
+ g(m);
443
+ return;
444
+ }
445
+ s++, (T = e.onFail) == null || T.call(e, s, m), de(h).then(() => O() ? void 0 : q()).then(() => {
446
+ t ? g(m) : Q();
447
+ });
448
+ });
449
+ };
450
+ return {
451
+ promise: n,
452
+ status: () => n.status,
453
+ cancel: l,
454
+ continue: () => (r == null || r(), n),
455
+ cancelRetry: u,
456
+ continueRetry: f,
457
+ canStart: v,
458
+ start: () => (v() ? Q() : q().then(Q), n)
459
+ };
460
+ }
461
+ var X, Lt, Yt = (Lt = class {
462
+ constructor() {
463
+ c(this, X, void 0);
464
+ }
465
+ destroy() {
466
+ this.clearGcTimeout();
467
+ }
468
+ scheduleGc() {
469
+ this.clearGcTimeout(), ue(this.gcTime) && o(this, X, Et.setTimeout(() => {
470
+ this.optionalRemove();
471
+ }, this.gcTime));
472
+ }
473
+ updateGcTime(e) {
474
+ this.gcTime = Math.max(
475
+ this.gcTime || 0,
476
+ e ?? (Ft ? 1 / 0 : 5 * 60 * 1e3)
477
+ );
478
+ }
479
+ clearGcTimeout() {
480
+ i(this, X) && (Et.clearTimeout(i(this, X)), o(this, X, void 0));
481
+ }
482
+ }, X = new WeakMap(), Lt), Y, at, M, tt, P, pt, et, I, N, Gt, Oe = (Gt = class extends Yt {
483
+ constructor(t) {
484
+ super();
485
+ c(this, I);
486
+ c(this, Y, void 0);
487
+ c(this, at, void 0);
488
+ c(this, M, void 0);
489
+ c(this, tt, void 0);
490
+ c(this, P, void 0);
491
+ c(this, pt, void 0);
492
+ c(this, et, void 0);
493
+ o(this, et, !1), o(this, pt, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, tt, t.client), o(this, M, i(this, tt).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, Y, xt(this.options)), this.state = t.state ?? i(this, Y), this.scheduleGc();
494
+ }
495
+ get meta() {
496
+ return this.options.meta;
497
+ }
498
+ get promise() {
499
+ var t;
500
+ return (t = i(this, P)) == null ? void 0 : t.promise;
501
+ }
502
+ setOptions(t) {
503
+ if (this.options = { ...i(this, pt), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
504
+ const s = xt(this.options);
505
+ s.data !== void 0 && (this.setData(s.data, {
506
+ updatedAt: s.dataUpdatedAt,
507
+ manual: !0
508
+ }), o(this, Y, s));
509
+ }
510
+ }
511
+ optionalRemove() {
512
+ !this.observers.length && this.state.fetchStatus === "idle" && i(this, M).remove(this);
513
+ }
514
+ setData(t, s) {
515
+ const r = fe(this.state.data, t, this.options);
516
+ return F(this, I, N).call(this, {
517
+ data: r,
518
+ type: "success",
519
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
520
+ manual: s == null ? void 0 : s.manual
521
+ }), r;
522
+ }
523
+ setState(t, s) {
524
+ F(this, I, N).call(this, { type: "setState", state: t, setStateOptions: s });
525
+ }
526
+ cancel(t) {
527
+ var r, n;
528
+ const s = (r = i(this, P)) == null ? void 0 : r.promise;
529
+ return (n = i(this, P)) == null || n.cancel(t), s ? s.then(R).catch(R) : Promise.resolve();
530
+ }
531
+ destroy() {
532
+ super.destroy(), this.cancel({ silent: !0 });
533
+ }
534
+ reset() {
535
+ this.destroy(), this.setState(i(this, Y));
536
+ }
537
+ isActive() {
538
+ return this.observers.some(
539
+ (t) => ce(t.options.enabled, this) !== !1
540
+ );
541
+ }
542
+ isDisabled() {
543
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Pt || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
544
+ }
545
+ isStatic() {
546
+ return this.getObserversCount() > 0 ? this.observers.some(
547
+ (t) => Dt(t.options.staleTime, this) === "static"
548
+ ) : !1;
549
+ }
550
+ isStale() {
551
+ return this.getObserversCount() > 0 ? this.observers.some(
552
+ (t) => t.getCurrentResult().isStale
553
+ ) : this.state.data === void 0 || this.state.isInvalidated;
554
+ }
555
+ isStaleByTime(t = 0) {
556
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !he(this.state.dataUpdatedAt, t);
557
+ }
558
+ onFocus() {
559
+ var s;
560
+ const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
561
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
562
+ }
563
+ onOnline() {
564
+ var s;
565
+ const t = this.observers.find((r) => r.shouldFetchOnReconnect());
566
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
567
+ }
568
+ addObserver(t) {
569
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), i(this, M).notify({ type: "observerAdded", query: this, observer: t }));
570
+ }
571
+ removeObserver(t) {
572
+ this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (i(this, P) && (i(this, et) ? i(this, P).cancel({ revert: !0 }) : i(this, P).cancelRetry()), this.scheduleGc()), i(this, M).notify({ type: "observerRemoved", query: this, observer: t }));
573
+ }
574
+ getObserversCount() {
575
+ return this.observers.length;
576
+ }
577
+ invalidate() {
578
+ this.state.isInvalidated || F(this, I, N).call(this, { type: "invalidate" });
579
+ }
580
+ async fetch(t, s) {
581
+ var f, O, v, C, g, q, Q, d, b, m, A, p;
582
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
583
+ // re-start the fetch; there is a chance that the query is still in a
584
+ // pending state when that happens
585
+ ((f = i(this, P)) == null ? void 0 : f.status()) !== "rejected") {
586
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
587
+ this.cancel({ silent: !0 });
588
+ else if (i(this, P))
589
+ return i(this, P).continueRetry(), i(this, P).promise;
590
+ }
591
+ if (t && this.setOptions(t), !this.options.queryFn) {
592
+ const h = this.observers.find((S) => S.options.queryFn);
593
+ h && this.setOptions(h.options);
594
+ }
595
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
596
+ "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
597
+ ));
598
+ const r = new AbortController(), n = (h) => {
599
+ Object.defineProperty(h, "signal", {
600
+ enumerable: !0,
601
+ get: () => (o(this, et, !0), r.signal)
602
+ });
603
+ }, a = () => {
604
+ const h = Jt(this.options, s), T = (() => {
605
+ const B = {
606
+ client: i(this, tt),
607
+ queryKey: this.queryKey,
608
+ meta: this.meta
609
+ };
610
+ return n(B), B;
611
+ })();
612
+ return o(this, et, !1), this.options.persister ? this.options.persister(
613
+ h,
614
+ T,
615
+ this
616
+ ) : h(T);
617
+ }, u = (() => {
618
+ const h = {
619
+ fetchOptions: s,
620
+ options: this.options,
621
+ queryKey: this.queryKey,
622
+ client: i(this, tt),
623
+ state: this.state,
624
+ fetchFn: a
625
+ };
626
+ return n(h), h;
627
+ })();
628
+ (O = this.options.behavior) == null || O.onFetch(u, this), o(this, at, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((v = u.fetchOptions) == null ? void 0 : v.meta)) && F(this, I, N).call(this, { type: "fetch", meta: (C = u.fetchOptions) == null ? void 0 : C.meta }), o(this, P, Xt({
629
+ initialPromise: s == null ? void 0 : s.initialPromise,
630
+ fn: u.fetchFn,
631
+ onCancel: (h) => {
632
+ h instanceof Qt && h.revert && this.setState({
633
+ ...i(this, at),
634
+ fetchStatus: "idle"
635
+ }), r.abort();
636
+ },
637
+ onFail: (h, S) => {
638
+ F(this, I, N).call(this, { type: "failed", failureCount: h, error: S });
639
+ },
640
+ onPause: () => {
641
+ F(this, I, N).call(this, { type: "pause" });
642
+ },
643
+ onContinue: () => {
644
+ F(this, I, N).call(this, { type: "continue" });
645
+ },
646
+ retry: u.options.retry,
647
+ retryDelay: u.options.retryDelay,
648
+ networkMode: u.options.networkMode,
649
+ canRun: () => !0
650
+ }));
651
+ try {
652
+ const h = await i(this, P).start();
653
+ if (h === void 0)
654
+ throw process.env.NODE_ENV !== "production" && console.error(
655
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
656
+ ), new Error(`${this.queryHash} data is undefined`);
657
+ return this.setData(h), (q = (g = i(this, M).config).onSuccess) == null || q.call(g, h, this), (d = (Q = i(this, M).config).onSettled) == null || d.call(
658
+ Q,
659
+ h,
660
+ this.state.error,
661
+ this
662
+ ), h;
663
+ } catch (h) {
664
+ if (h instanceof Qt) {
665
+ if (h.silent)
666
+ return i(this, P).promise;
667
+ if (h.revert) {
668
+ if (this.state.data === void 0)
669
+ throw h;
670
+ return this.state.data;
671
+ }
672
+ }
673
+ throw F(this, I, N).call(this, {
674
+ type: "error",
675
+ error: h
676
+ }), (m = (b = i(this, M).config).onError) == null || m.call(
677
+ b,
678
+ h,
679
+ this
680
+ ), (p = (A = i(this, M).config).onSettled) == null || p.call(
681
+ A,
682
+ this.state.data,
683
+ h,
684
+ this
685
+ ), h;
686
+ } finally {
687
+ this.scheduleGc();
688
+ }
689
+ }
690
+ }, Y = new WeakMap(), at = new WeakMap(), M = new WeakMap(), tt = new WeakMap(), P = new WeakMap(), pt = new WeakMap(), et = new WeakMap(), I = new WeakSet(), N = function(t) {
691
+ const s = (r) => {
692
+ switch (t.type) {
693
+ case "failed":
694
+ return {
695
+ ...r,
696
+ fetchFailureCount: t.failureCount,
697
+ fetchFailureReason: t.error
698
+ };
699
+ case "pause":
700
+ return {
701
+ ...r,
702
+ fetchStatus: "paused"
703
+ };
704
+ case "continue":
705
+ return {
706
+ ...r,
707
+ fetchStatus: "fetching"
708
+ };
709
+ case "fetch":
710
+ return {
711
+ ...r,
712
+ ...Ce(r.data, this.options),
713
+ fetchMeta: t.meta ?? null
714
+ };
715
+ case "success":
716
+ const n = {
717
+ ...r,
718
+ data: t.data,
719
+ dataUpdateCount: r.dataUpdateCount + 1,
720
+ dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
721
+ error: null,
722
+ isInvalidated: !1,
723
+ status: "success",
724
+ ...!t.manual && {
725
+ fetchStatus: "idle",
726
+ fetchFailureCount: 0,
727
+ fetchFailureReason: null
728
+ }
729
+ };
730
+ return o(this, at, t.manual ? n : void 0), n;
731
+ case "error":
732
+ const a = t.error;
733
+ return {
734
+ ...r,
735
+ error: a,
736
+ errorUpdateCount: r.errorUpdateCount + 1,
737
+ errorUpdatedAt: Date.now(),
738
+ fetchFailureCount: r.fetchFailureCount + 1,
739
+ fetchFailureReason: a,
740
+ fetchStatus: "idle",
741
+ status: "error"
742
+ };
743
+ case "invalidate":
744
+ return {
745
+ ...r,
746
+ isInvalidated: !0
747
+ };
748
+ case "setState":
749
+ return {
750
+ ...r,
751
+ ...t.state
752
+ };
753
+ }
754
+ };
755
+ this.state = s(this.state), D.batch(() => {
756
+ this.observers.forEach((r) => {
757
+ r.onQueryUpdate();
758
+ }), i(this, M).notify({ query: this, type: "updated", action: t });
759
+ });
760
+ }, Gt);
761
+ function Ce(e, t) {
762
+ return {
763
+ fetchFailureCount: 0,
764
+ fetchFailureReason: null,
765
+ fetchStatus: Zt(t.networkMode) ? "fetching" : "paused",
766
+ ...e === void 0 && {
767
+ error: null,
768
+ status: "pending"
769
+ }
770
+ };
771
+ }
772
+ function xt(e) {
773
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
774
+ return {
775
+ data: t,
776
+ dataUpdateCount: 0,
777
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
778
+ error: null,
779
+ errorUpdateCount: 0,
780
+ errorUpdatedAt: 0,
781
+ fetchFailureCount: 0,
782
+ fetchFailureReason: null,
783
+ fetchMeta: null,
784
+ isInvalidated: !1,
785
+ status: s ? "success" : "pending",
786
+ fetchStatus: "idle"
787
+ };
788
+ }
789
+ function kt(e) {
790
+ return {
791
+ onFetch: (t, s) => {
792
+ var v, C, g, q, Q;
793
+ const r = t.options, n = (g = (C = (v = t.fetchOptions) == null ? void 0 : v.meta) == null ? void 0 : C.fetchMore) == null ? void 0 : g.direction, a = ((q = t.state.data) == null ? void 0 : q.pages) || [], l = ((Q = t.state.data) == null ? void 0 : Q.pageParams) || [];
794
+ let u = { pages: [], pageParams: [] }, f = 0;
795
+ const O = async () => {
796
+ let d = !1;
797
+ const b = (p) => {
798
+ Object.defineProperty(p, "signal", {
799
+ enumerable: !0,
800
+ get: () => (t.signal.aborted ? d = !0 : t.signal.addEventListener("abort", () => {
801
+ d = !0;
802
+ }), t.signal)
803
+ });
804
+ }, m = Jt(t.options, t.fetchOptions), A = async (p, h, S) => {
805
+ if (d)
806
+ return Promise.reject();
807
+ if (h == null && p.pages.length)
808
+ return Promise.resolve(p);
809
+ const B = (() => {
810
+ const J = {
811
+ client: t.client,
812
+ queryKey: t.queryKey,
813
+ pageParam: h,
814
+ direction: S ? "backward" : "forward",
815
+ meta: t.options.meta
816
+ };
817
+ return b(J), J;
818
+ })(), gt = await m(B), { maxPages: lt } = t.options, w = S ? pe : ye;
819
+ return {
820
+ pages: w(p.pages, gt, lt),
821
+ pageParams: w(p.pageParams, h, lt)
822
+ };
823
+ };
824
+ if (n && a.length) {
825
+ const p = n === "backward", h = p ? Fe : Kt, S = {
826
+ pages: a,
827
+ pageParams: l
828
+ }, T = h(r, S);
829
+ u = await A(S, T, p);
830
+ } else {
831
+ const p = e ?? a.length;
832
+ do {
833
+ const h = f === 0 ? l[0] ?? r.initialPageParam : Kt(r, u);
834
+ if (f > 0 && h == null)
835
+ break;
836
+ u = await A(u, h), f++;
837
+ } while (f < p);
838
+ }
839
+ return u;
840
+ };
841
+ t.options.persister ? t.fetchFn = () => {
842
+ var d, b;
843
+ return (b = (d = t.options).persister) == null ? void 0 : b.call(
844
+ d,
845
+ O,
846
+ {
847
+ client: t.client,
848
+ queryKey: t.queryKey,
849
+ meta: t.options.meta,
850
+ signal: t.signal
851
+ },
852
+ s
853
+ );
854
+ } : t.fetchFn = O;
855
+ }
856
+ };
857
+ }
858
+ function Kt(e, { pages: t, pageParams: s }) {
859
+ const r = t.length - 1;
860
+ return t.length > 0 ? e.getNextPageParam(
861
+ t[r],
862
+ t,
863
+ s[r],
864
+ s
865
+ ) : void 0;
866
+ }
867
+ function Fe(e, { pages: t, pageParams: s }) {
868
+ var r;
869
+ return t.length > 0 ? (r = e.getPreviousPageParam) == null ? void 0 : r.call(e, t[0], t, s[0], s) : void 0;
870
+ }
871
+ var mt, k, E, st, K, L, _t, Se = (_t = class extends Yt {
872
+ constructor(t) {
873
+ super();
874
+ c(this, K);
875
+ c(this, mt, void 0);
876
+ c(this, k, void 0);
877
+ c(this, E, void 0);
878
+ c(this, st, void 0);
879
+ o(this, mt, t.client), this.mutationId = t.mutationId, o(this, E, t.mutationCache), o(this, k, []), this.state = t.state || Ee(), this.setOptions(t.options), this.scheduleGc();
880
+ }
881
+ setOptions(t) {
882
+ this.options = t, this.updateGcTime(this.options.gcTime);
883
+ }
884
+ get meta() {
885
+ return this.options.meta;
886
+ }
887
+ addObserver(t) {
888
+ i(this, k).includes(t) || (i(this, k).push(t), this.clearGcTimeout(), i(this, E).notify({
889
+ type: "observerAdded",
890
+ mutation: this,
891
+ observer: t
892
+ }));
893
+ }
894
+ removeObserver(t) {
895
+ o(this, k, i(this, k).filter((s) => s !== t)), this.scheduleGc(), i(this, E).notify({
896
+ type: "observerRemoved",
897
+ mutation: this,
898
+ observer: t
899
+ });
900
+ }
901
+ optionalRemove() {
902
+ i(this, k).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, E).remove(this));
903
+ }
904
+ continue() {
905
+ var t;
906
+ return ((t = i(this, st)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
907
+ this.execute(this.state.variables);
908
+ }
909
+ async execute(t) {
910
+ var l, u, f, O, v, C, g, q, Q, d, b, m, A, p, h, S, T, B, gt, lt;
911
+ const s = () => {
912
+ F(this, K, L).call(this, { type: "continue" });
913
+ }, r = {
914
+ client: i(this, mt),
915
+ meta: this.options.meta,
916
+ mutationKey: this.options.mutationKey
917
+ };
918
+ o(this, st, Xt({
919
+ fn: () => this.options.mutationFn ? this.options.mutationFn(t, r) : Promise.reject(new Error("No mutationFn found")),
920
+ onFail: (w, J) => {
921
+ F(this, K, L).call(this, { type: "failed", failureCount: w, error: J });
922
+ },
923
+ onPause: () => {
924
+ F(this, K, L).call(this, { type: "pause" });
925
+ },
926
+ onContinue: s,
927
+ retry: this.options.retry ?? 0,
928
+ retryDelay: this.options.retryDelay,
929
+ networkMode: this.options.networkMode,
930
+ canRun: () => i(this, E).canRun(this)
931
+ }));
932
+ const n = this.state.status === "pending", a = !i(this, st).canStart();
933
+ try {
934
+ if (n)
935
+ s();
936
+ else {
937
+ F(this, K, L).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (l = i(this, E).config).onMutate) == null ? void 0 : u.call(
938
+ l,
939
+ t,
940
+ this,
941
+ r
942
+ ));
943
+ const J = await ((O = (f = this.options).onMutate) == null ? void 0 : O.call(
944
+ f,
945
+ t,
946
+ r
947
+ ));
948
+ J !== this.state.context && F(this, K, L).call(this, {
949
+ type: "pending",
950
+ context: J,
951
+ variables: t,
952
+ isPaused: a
953
+ });
954
+ }
955
+ const w = await i(this, st).start();
956
+ return await ((C = (v = i(this, E).config).onSuccess) == null ? void 0 : C.call(
957
+ v,
958
+ w,
959
+ t,
960
+ this.state.context,
961
+ this,
962
+ r
963
+ )), await ((q = (g = this.options).onSuccess) == null ? void 0 : q.call(
964
+ g,
965
+ w,
966
+ t,
967
+ this.state.context,
968
+ r
969
+ )), await ((d = (Q = i(this, E).config).onSettled) == null ? void 0 : d.call(
970
+ Q,
971
+ w,
972
+ null,
973
+ this.state.variables,
974
+ this.state.context,
975
+ this,
976
+ r
977
+ )), await ((m = (b = this.options).onSettled) == null ? void 0 : m.call(
978
+ b,
979
+ w,
980
+ null,
981
+ t,
982
+ this.state.context,
983
+ r
984
+ )), F(this, K, L).call(this, { type: "success", data: w }), w;
985
+ } catch (w) {
986
+ try {
987
+ throw await ((p = (A = i(this, E).config).onError) == null ? void 0 : p.call(
988
+ A,
989
+ w,
990
+ t,
991
+ this.state.context,
992
+ this,
993
+ r
994
+ )), await ((S = (h = this.options).onError) == null ? void 0 : S.call(
995
+ h,
996
+ w,
997
+ t,
998
+ this.state.context,
999
+ r
1000
+ )), await ((B = (T = i(this, E).config).onSettled) == null ? void 0 : B.call(
1001
+ T,
1002
+ void 0,
1003
+ w,
1004
+ this.state.variables,
1005
+ this.state.context,
1006
+ this,
1007
+ r
1008
+ )), await ((lt = (gt = this.options).onSettled) == null ? void 0 : lt.call(
1009
+ gt,
1010
+ void 0,
1011
+ w,
1012
+ t,
1013
+ this.state.context,
1014
+ r
1015
+ )), w;
1016
+ } finally {
1017
+ F(this, K, L).call(this, { type: "error", error: w });
1018
+ }
1019
+ } finally {
1020
+ i(this, E).runNext(this);
1021
+ }
1022
+ }
1023
+ }, mt = new WeakMap(), k = new WeakMap(), E = new WeakMap(), st = new WeakMap(), K = new WeakSet(), L = function(t) {
1024
+ const s = (r) => {
1025
+ switch (t.type) {
1026
+ case "failed":
1027
+ return {
1028
+ ...r,
1029
+ failureCount: t.failureCount,
1030
+ failureReason: t.error
1031
+ };
1032
+ case "pause":
1033
+ return {
1034
+ ...r,
1035
+ isPaused: !0
1036
+ };
1037
+ case "continue":
1038
+ return {
1039
+ ...r,
1040
+ isPaused: !1
1041
+ };
1042
+ case "pending":
1043
+ return {
1044
+ ...r,
1045
+ context: t.context,
1046
+ data: void 0,
1047
+ failureCount: 0,
1048
+ failureReason: null,
1049
+ error: null,
1050
+ isPaused: t.isPaused,
1051
+ status: "pending",
1052
+ variables: t.variables,
1053
+ submittedAt: Date.now()
1054
+ };
1055
+ case "success":
1056
+ return {
1057
+ ...r,
1058
+ data: t.data,
1059
+ failureCount: 0,
1060
+ failureReason: null,
1061
+ error: null,
1062
+ status: "success",
1063
+ isPaused: !1
1064
+ };
1065
+ case "error":
1066
+ return {
1067
+ ...r,
1068
+ data: void 0,
1069
+ error: t.error,
1070
+ failureCount: r.failureCount + 1,
1071
+ failureReason: t.error,
1072
+ isPaused: !1,
1073
+ status: "error"
1074
+ };
1075
+ }
1076
+ };
1077
+ this.state = s(this.state), D.batch(() => {
1078
+ i(this, k).forEach((r) => {
1079
+ r.onMutationUpdate(t);
1080
+ }), i(this, E).notify({
1081
+ mutation: this,
1082
+ type: "updated",
1083
+ action: t
1084
+ });
1085
+ });
1086
+ }, _t);
1087
+ function Ee() {
1088
+ return {
1089
+ context: void 0,
1090
+ data: void 0,
1091
+ error: null,
1092
+ failureCount: 0,
1093
+ failureReason: null,
1094
+ isPaused: !1,
1095
+ status: "idle",
1096
+ variables: void 0,
1097
+ submittedAt: 0
1098
+ };
1099
+ }
1100
+ var H, j, vt, Vt, De = (Vt = class extends Ct {
1101
+ constructor(t = {}) {
1102
+ super();
1103
+ c(this, H, void 0);
1104
+ c(this, j, void 0);
1105
+ c(this, vt, void 0);
1106
+ this.config = t, o(this, H, /* @__PURE__ */ new Set()), o(this, j, /* @__PURE__ */ new Map()), o(this, vt, 0);
1107
+ }
1108
+ build(t, s, r) {
1109
+ const n = new Se({
1110
+ client: t,
1111
+ mutationCache: this,
1112
+ mutationId: ++bt(this, vt)._,
1113
+ options: t.defaultMutationOptions(s),
1114
+ state: r
1115
+ });
1116
+ return this.add(n), n;
1117
+ }
1118
+ add(t) {
1119
+ i(this, H).add(t);
1120
+ const s = wt(t);
1121
+ if (typeof s == "string") {
1122
+ const r = i(this, j).get(s);
1123
+ r ? r.push(t) : i(this, j).set(s, [t]);
1124
+ }
1125
+ this.notify({ type: "added", mutation: t });
1126
+ }
1127
+ remove(t) {
1128
+ if (i(this, H).delete(t)) {
1129
+ const s = wt(t);
1130
+ if (typeof s == "string") {
1131
+ const r = i(this, j).get(s);
1132
+ if (r)
1133
+ if (r.length > 1) {
1134
+ const n = r.indexOf(t);
1135
+ n !== -1 && r.splice(n, 1);
1136
+ } else
1137
+ r[0] === t && i(this, j).delete(s);
1138
+ }
1139
+ }
1140
+ this.notify({ type: "removed", mutation: t });
1141
+ }
1142
+ canRun(t) {
1143
+ const s = wt(t);
1144
+ if (typeof s == "string") {
1145
+ const r = i(this, j).get(s), n = r == null ? void 0 : r.find(
1146
+ (a) => a.state.status === "pending"
1147
+ );
1148
+ return !n || n === t;
1149
+ } else
1150
+ return !0;
1151
+ }
1152
+ runNext(t) {
1153
+ var r;
1154
+ const s = wt(t);
1155
+ if (typeof s == "string") {
1156
+ const n = (r = i(this, j).get(s)) == null ? void 0 : r.find((a) => a !== t && a.state.isPaused);
1157
+ return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
1158
+ } else
1159
+ return Promise.resolve();
1160
+ }
1161
+ clear() {
1162
+ D.batch(() => {
1163
+ i(this, H).forEach((t) => {
1164
+ this.notify({ type: "removed", mutation: t });
1165
+ }), i(this, H).clear(), i(this, j).clear();
1166
+ });
1167
+ }
1168
+ getAll() {
1169
+ return Array.from(i(this, H));
1170
+ }
1171
+ find(t) {
1172
+ const s = { exact: !0, ...t };
1173
+ return this.getAll().find(
1174
+ (r) => Rt(s, r)
1175
+ );
1176
+ }
1177
+ findAll(t = {}) {
1178
+ return this.getAll().filter((s) => Rt(t, s));
1179
+ }
1180
+ notify(t) {
1181
+ D.batch(() => {
1182
+ this.listeners.forEach((s) => {
1183
+ s(t);
1184
+ });
1185
+ });
1186
+ }
1187
+ resumePausedMutations() {
1188
+ const t = this.getAll().filter((s) => s.state.isPaused);
1189
+ return D.batch(
1190
+ () => Promise.all(
1191
+ t.map((s) => s.continue().catch(R))
1192
+ )
1193
+ );
1194
+ }
1195
+ }, H = new WeakMap(), j = new WeakMap(), vt = new WeakMap(), Vt);
1196
+ function wt(e) {
1197
+ var t;
1198
+ return (t = e.options.scope) == null ? void 0 : t.id;
1199
+ }
1200
+ var U, $t, qe = ($t = class extends Ct {
1201
+ constructor(t = {}) {
1202
+ super();
1203
+ c(this, U, void 0);
1204
+ this.config = t, o(this, U, /* @__PURE__ */ new Map());
1205
+ }
1206
+ build(t, s, r) {
1207
+ const n = s.queryKey, a = s.queryHash ?? Mt(n, s);
1208
+ let l = this.get(a);
1209
+ return l || (l = new Oe({
1210
+ client: t,
1211
+ queryKey: n,
1212
+ queryHash: a,
1213
+ options: t.defaultQueryOptions(s),
1214
+ state: r,
1215
+ defaultOptions: t.getQueryDefaults(n)
1216
+ }), this.add(l)), l;
1217
+ }
1218
+ add(t) {
1219
+ i(this, U).has(t.queryHash) || (i(this, U).set(t.queryHash, t), this.notify({
1220
+ type: "added",
1221
+ query: t
1222
+ }));
1223
+ }
1224
+ remove(t) {
1225
+ const s = i(this, U).get(t.queryHash);
1226
+ s && (t.destroy(), s === t && i(this, U).delete(t.queryHash), this.notify({ type: "removed", query: t }));
1227
+ }
1228
+ clear() {
1229
+ D.batch(() => {
1230
+ this.getAll().forEach((t) => {
1231
+ this.remove(t);
1232
+ });
1233
+ });
1234
+ }
1235
+ get(t) {
1236
+ return i(this, U).get(t);
1237
+ }
1238
+ getAll() {
1239
+ return [...i(this, U).values()];
1240
+ }
1241
+ find(t) {
1242
+ const s = { exact: !0, ...t };
1243
+ return this.getAll().find(
1244
+ (r) => Tt(s, r)
1245
+ );
1246
+ }
1247
+ findAll(t = {}) {
1248
+ const s = this.getAll();
1249
+ return Object.keys(t).length > 0 ? s.filter((r) => Tt(t, r)) : s;
1250
+ }
1251
+ notify(t) {
1252
+ D.batch(() => {
1253
+ this.listeners.forEach((s) => {
1254
+ s(t);
1255
+ });
1256
+ });
1257
+ }
1258
+ onFocus() {
1259
+ D.batch(() => {
1260
+ this.getAll().forEach((t) => {
1261
+ t.onFocus();
1262
+ });
1263
+ });
1264
+ }
1265
+ onOnline() {
1266
+ D.batch(() => {
1267
+ this.getAll().forEach((t) => {
1268
+ t.onOnline();
1269
+ });
1270
+ });
1271
+ }
1272
+ }, U = new WeakMap(), $t), y, V, $, ot, ut, z, ht, ct, zt, Ae = (zt = class {
1273
+ constructor(e = {}) {
1274
+ c(this, y, void 0);
1275
+ c(this, V, void 0);
1276
+ c(this, $, void 0);
1277
+ c(this, ot, void 0);
1278
+ c(this, ut, void 0);
1279
+ c(this, z, void 0);
1280
+ c(this, ht, void 0);
1281
+ c(this, ct, void 0);
1282
+ o(this, y, e.queryCache || new qe()), o(this, V, e.mutationCache || new De()), o(this, $, e.defaultOptions || {}), o(this, ot, /* @__PURE__ */ new Map()), o(this, ut, /* @__PURE__ */ new Map()), o(this, z, 0);
1283
+ }
1284
+ mount() {
1285
+ bt(this, z)._++, i(this, z) === 1 && (o(this, ht, Wt.subscribe(async (e) => {
1286
+ e && (await this.resumePausedMutations(), i(this, y).onFocus());
1287
+ })), o(this, ct, Ot.subscribe(async (e) => {
1288
+ e && (await this.resumePausedMutations(), i(this, y).onOnline());
1289
+ })));
1290
+ }
1291
+ unmount() {
1292
+ var e, t;
1293
+ bt(this, z)._--, i(this, z) === 0 && ((e = i(this, ht)) == null || e.call(this), o(this, ht, void 0), (t = i(this, ct)) == null || t.call(this), o(this, ct, void 0));
1294
+ }
1295
+ isFetching(e) {
1296
+ return i(this, y).findAll({ ...e, fetchStatus: "fetching" }).length;
1297
+ }
1298
+ isMutating(e) {
1299
+ return i(this, V).findAll({ ...e, status: "pending" }).length;
1300
+ }
1301
+ /**
1302
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
1303
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1304
+ *
1305
+ * Hint: Do not use this function inside a component, because it won't receive updates.
1306
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1307
+ */
1308
+ getQueryData(e) {
1309
+ var s;
1310
+ const t = this.defaultQueryOptions({ queryKey: e });
1311
+ return (s = i(this, y).get(t.queryHash)) == null ? void 0 : s.state.data;
1312
+ }
1313
+ ensureQueryData(e) {
1314
+ const t = this.defaultQueryOptions(e), s = i(this, y).build(this, t), r = s.state.data;
1315
+ return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(Dt(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
1316
+ }
1317
+ getQueriesData(e) {
1318
+ return i(this, y).findAll(e).map(({ queryKey: t, state: s }) => {
1319
+ const r = s.data;
1320
+ return [t, r];
1321
+ });
1322
+ }
1323
+ setQueryData(e, t, s) {
1324
+ const r = this.defaultQueryOptions({ queryKey: e }), n = i(this, y).get(
1325
+ r.queryHash
1326
+ ), a = n == null ? void 0 : n.state.data, l = oe(t, a);
1327
+ if (l !== void 0)
1328
+ return i(this, y).build(this, r).setData(l, { ...s, manual: !0 });
1329
+ }
1330
+ setQueriesData(e, t, s) {
1331
+ return D.batch(
1332
+ () => i(this, y).findAll(e).map(({ queryKey: r }) => [
1333
+ r,
1334
+ this.setQueryData(r, t, s)
1335
+ ])
1336
+ );
1337
+ }
1338
+ getQueryState(e) {
1339
+ var s;
1340
+ const t = this.defaultQueryOptions({ queryKey: e });
1341
+ return (s = i(this, y).get(
1342
+ t.queryHash
1343
+ )) == null ? void 0 : s.state;
1344
+ }
1345
+ removeQueries(e) {
1346
+ const t = i(this, y);
1347
+ D.batch(() => {
1348
+ t.findAll(e).forEach((s) => {
1349
+ t.remove(s);
1350
+ });
1351
+ });
1352
+ }
1353
+ resetQueries(e, t) {
1354
+ const s = i(this, y);
1355
+ return D.batch(() => (s.findAll(e).forEach((r) => {
1356
+ r.reset();
1357
+ }), this.refetchQueries(
1358
+ {
1359
+ type: "active",
1360
+ ...e
1361
+ },
1362
+ t
1363
+ )));
1364
+ }
1365
+ cancelQueries(e, t = {}) {
1366
+ const s = { revert: !0, ...t }, r = D.batch(
1367
+ () => i(this, y).findAll(e).map((n) => n.cancel(s))
1368
+ );
1369
+ return Promise.all(r).then(R).catch(R);
1370
+ }
1371
+ invalidateQueries(e, t = {}) {
1372
+ return D.batch(() => (i(this, y).findAll(e).forEach((s) => {
1373
+ s.invalidate();
1374
+ }), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
1375
+ {
1376
+ ...e,
1377
+ type: (e == null ? void 0 : e.refetchType) ?? (e == null ? void 0 : e.type) ?? "active"
1378
+ },
1379
+ t
1380
+ )));
1381
+ }
1382
+ refetchQueries(e, t = {}) {
1383
+ const s = {
1384
+ ...t,
1385
+ cancelRefetch: t.cancelRefetch ?? !0
1386
+ }, r = D.batch(
1387
+ () => i(this, y).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1388
+ let a = n.fetch(void 0, s);
1389
+ return s.throwOnError || (a = a.catch(R)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1390
+ })
1391
+ );
1392
+ return Promise.all(r).then(R);
1393
+ }
1394
+ fetchQuery(e) {
1395
+ const t = this.defaultQueryOptions(e);
1396
+ t.retry === void 0 && (t.retry = !1);
1397
+ const s = i(this, y).build(this, t);
1398
+ return s.isStaleByTime(
1399
+ Dt(t.staleTime, s)
1400
+ ) ? s.fetch(t) : Promise.resolve(s.state.data);
1401
+ }
1402
+ prefetchQuery(e) {
1403
+ return this.fetchQuery(e).then(R).catch(R);
1404
+ }
1405
+ fetchInfiniteQuery(e) {
1406
+ return e.behavior = kt(e.pages), this.fetchQuery(e);
1407
+ }
1408
+ prefetchInfiniteQuery(e) {
1409
+ return this.fetchInfiniteQuery(e).then(R).catch(R);
1410
+ }
1411
+ ensureInfiniteQueryData(e) {
1412
+ return e.behavior = kt(e.pages), this.ensureQueryData(e);
1413
+ }
1414
+ resumePausedMutations() {
1415
+ return Ot.isOnline() ? i(this, V).resumePausedMutations() : Promise.resolve();
1416
+ }
1417
+ getQueryCache() {
1418
+ return i(this, y);
1419
+ }
1420
+ getMutationCache() {
1421
+ return i(this, V);
1422
+ }
1423
+ getDefaultOptions() {
1424
+ return i(this, $);
1425
+ }
1426
+ setDefaultOptions(e) {
1427
+ o(this, $, e);
1428
+ }
1429
+ setQueryDefaults(e, t) {
1430
+ i(this, ot).set(ft(e), {
1431
+ queryKey: e,
1432
+ defaultOptions: t
1433
+ });
1434
+ }
1435
+ getQueryDefaults(e) {
1436
+ const t = [...i(this, ot).values()], s = {};
1437
+ return t.forEach((r) => {
1438
+ yt(e, r.queryKey) && Object.assign(s, r.defaultOptions);
1439
+ }), s;
1440
+ }
1441
+ setMutationDefaults(e, t) {
1442
+ i(this, ut).set(ft(e), {
1443
+ mutationKey: e,
1444
+ defaultOptions: t
1445
+ });
1446
+ }
1447
+ getMutationDefaults(e) {
1448
+ const t = [...i(this, ut).values()], s = {};
1449
+ return t.forEach((r) => {
1450
+ yt(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
1451
+ }), s;
1452
+ }
1453
+ defaultQueryOptions(e) {
1454
+ if (e._defaulted)
1455
+ return e;
1456
+ const t = {
1457
+ ...i(this, $).queries,
1458
+ ...this.getQueryDefaults(e.queryKey),
1459
+ ...e,
1460
+ _defaulted: !0
1461
+ };
1462
+ return t.queryHash || (t.queryHash = Mt(
1463
+ t.queryKey,
1464
+ t
1465
+ )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Pt && (t.enabled = !1), t;
1466
+ }
1467
+ defaultMutationOptions(e) {
1468
+ return e != null && e._defaulted ? e : {
1469
+ ...i(this, $).mutations,
1470
+ ...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
1471
+ ...e,
1472
+ _defaulted: !0
1473
+ };
1474
+ }
1475
+ clear() {
1476
+ i(this, y).clear(), i(this, V).clear();
1477
+ }
1478
+ }, y = new WeakMap(), V = new WeakMap(), $ = new WeakMap(), ot = new WeakMap(), ut = new WeakMap(), z = new WeakMap(), ht = new WeakMap(), ct = new WeakMap(), zt), Qe = Bt.createContext(
1479
+ void 0
1480
+ ), Me = ({
1481
+ client: e,
1482
+ children: t
1483
+ }) => (Bt.useEffect(() => (e.mount(), () => {
1484
+ e.unmount();
1485
+ }), [e]), /* @__PURE__ */ dt(Qe.Provider, { value: e, children: t }));
1486
+ const Te = new Ae(), Ge = (e) => {
1487
+ const { children: t, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: a, ...l } = e, { workerUrlAdded: u } = se(n);
1488
+ return /* @__PURE__ */ dt(Me, { client: Te, children: /* @__PURE__ */ dt(re, { licenseKey: a, children: /* @__PURE__ */ dt(ee, { workerUrlAdded: u, ...l, children: /* @__PURE__ */ dt(te, { customDarkVariables: r, customVariables: s, children: t }) }) }) });
1489
+ };
1490
+ export {
1491
+ Ge as RPConfig
1492
+ };