@pdf-viewer/react 0.4.0-beta.1

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 (306) hide show
  1. package/README.md +3 -0
  2. package/dist/Container.module-cb7b45b9.js +14 -0
  3. package/dist/RPSplitter.module-13d612c4.js +7 -0
  4. package/dist/RPTheme.module-f756e5cd.js +7 -0
  5. package/dist/Thumbnails-06fa1aa5.js +2657 -0
  6. package/dist/WrapperLayout.module-147bc943.js +6 -0
  7. package/dist/assets/Button.css +1 -0
  8. package/dist/assets/Checkbox.css +1 -0
  9. package/dist/assets/Container.css +1 -0
  10. package/dist/assets/DropDown.css +1 -0
  11. package/dist/assets/Input.css +1 -0
  12. package/dist/assets/LoaderIcon.css +1 -0
  13. package/dist/assets/MenuItem.css +1 -0
  14. package/dist/assets/MenuSeparator.css +1 -0
  15. package/dist/assets/PropertyItem.css +1 -0
  16. package/dist/assets/RPSplitter.css +1 -0
  17. package/dist/assets/RPTheme.css +1 -0
  18. package/dist/assets/RotateTool.css +1 -0
  19. package/dist/assets/Thumbnails.css +1 -0
  20. package/dist/assets/WrapperLayout.css +1 -0
  21. package/dist/clsx-0c6e471a.js +22 -0
  22. package/dist/components/RPConfig.js +1347 -0
  23. package/dist/components/RPController.js +49 -0
  24. package/dist/components/RPDocument.js +9 -0
  25. package/dist/components/RPDropFileZone.js +33 -0
  26. package/dist/components/RPTheme.js +21 -0
  27. package/dist/components/RPViewer.js +37 -0
  28. package/dist/components/icons/CheckIcon.js +22 -0
  29. package/dist/components/icons/ChevronUpIcon.js +22 -0
  30. package/dist/components/icons/ClearIcon.js +25 -0
  31. package/dist/components/icons/ClockwiseIcon.js +22 -0
  32. package/dist/components/icons/CloseIcon.js +22 -0
  33. package/dist/components/icons/DarkPdfIcon.js +15 -0
  34. package/dist/components/icons/DualPageIcon.js +22 -0
  35. package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
  36. package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
  37. package/dist/components/icons/FullScreenIcon.js +22 -0
  38. package/dist/components/icons/GoToDownIcon.js +22 -0
  39. package/dist/components/icons/HandModeDefaultIcon.js +22 -0
  40. package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
  41. package/dist/components/icons/InfoIcon.js +22 -0
  42. package/dist/components/icons/LightPdfIcon.js +15 -0
  43. package/dist/components/icons/LoaderIcon.js +17 -0
  44. package/dist/components/icons/MoonIcon.js +22 -0
  45. package/dist/components/icons/PageScrollingIcon.js +24 -0
  46. package/dist/components/icons/PrintDefaultIcon.js +23 -0
  47. package/dist/components/icons/SearchIcon.js +22 -0
  48. package/dist/components/icons/SinglePageIcon.js +22 -0
  49. package/dist/components/icons/SunIcon.js +25 -0
  50. package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
  51. package/dist/components/icons/ThreeDotIcon.js +22 -0
  52. package/dist/components/icons/Thumbnail.js +54 -0
  53. package/dist/components/icons/VerticalScrollingIcon.js +24 -0
  54. package/dist/components/icons/WrappedScrollingIcon.js +24 -0
  55. package/dist/components/icons/ZoomInIcon.js +22 -0
  56. package/dist/components/icons/ZoomOutIcon.js +22 -0
  57. package/dist/components/layout/Container.js +28 -0
  58. package/dist/components/layout/RPLayout.js +59 -0
  59. package/dist/components/layout/WrapperLayout.js +11 -0
  60. package/dist/components/layout/sidebar/RPSidebar.js +34 -0
  61. package/dist/components/layout/sidebar/RPSplitter.js +10 -0
  62. package/dist/components/layout/sidebar/Thumbnail.js +8 -0
  63. package/dist/components/layout/sidebar/Thumbnails.js +7 -0
  64. package/dist/components/layout/toolbar/DarkModeTool.js +23 -0
  65. package/dist/components/layout/toolbar/DocumentDialog.js +36 -0
  66. package/dist/components/layout/toolbar/DocumentProperties.js +19 -0
  67. package/dist/components/layout/toolbar/FileDownloadTool.js +11 -0
  68. package/dist/components/layout/toolbar/FileUploadTool.js +21 -0
  69. package/dist/components/layout/toolbar/FullScreenTool.js +46 -0
  70. package/dist/components/layout/toolbar/MenuItem.js +12 -0
  71. package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
  72. package/dist/components/layout/toolbar/MostPageTool.js +36 -0
  73. package/dist/components/layout/toolbar/OtherTool.js +21 -0
  74. package/dist/components/layout/toolbar/Paginate.js +12 -0
  75. package/dist/components/layout/toolbar/PrintTool.js +11 -0
  76. package/dist/components/layout/toolbar/PropertyItem.js +12 -0
  77. package/dist/components/layout/toolbar/RPToolbar.js +8 -0
  78. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
  79. package/dist/components/layout/toolbar/RotateTool.js +33 -0
  80. package/dist/components/layout/toolbar/ScrollModeTool.js +54 -0
  81. package/dist/components/layout/toolbar/SearchTool.js +40 -0
  82. package/dist/components/layout/toolbar/SelectionModeTool.js +36 -0
  83. package/dist/components/layout/toolbar/ViewModeTool.js +31 -0
  84. package/dist/components/layout/toolbar/ZoomTool.js +41 -0
  85. package/dist/components/page/AnnotationLayer.js +37 -0
  86. package/dist/components/page/CanvasLayer.js +33 -0
  87. package/dist/components/page/DualPage.js +6 -0
  88. package/dist/components/page/RPPage.js +33 -0
  89. package/dist/components/page/SinglePage.js +6 -0
  90. package/dist/components/page/TextLayer.js +34 -0
  91. package/dist/components/ui/Button.js +22 -0
  92. package/dist/components/ui/Checkbox.js +301 -0
  93. package/dist/components/ui/DropDown.js +29 -0
  94. package/dist/components/ui/Input.js +26 -0
  95. package/dist/components/ui/LoadingIndicator.js +6 -0
  96. package/dist/contexts/ConfigContext.js +13 -0
  97. package/dist/contexts/DarkModeContext.js +28 -0
  98. package/dist/contexts/DropFileZoneContext.js +50 -0
  99. package/dist/contexts/FileInputContext.js +38 -0
  100. package/dist/contexts/FullScreenContext.js +18 -0
  101. package/dist/contexts/IconContext.js +11 -0
  102. package/dist/contexts/InitialStateContext.js +11 -0
  103. package/dist/contexts/LayerContext.js +8 -0
  104. package/dist/contexts/LayoutContainerContext.js +10 -0
  105. package/dist/contexts/LicenseContext.js +15 -0
  106. package/dist/contexts/OtherToolContext.js +18 -0
  107. package/dist/contexts/PageViewportContext.js +8 -0
  108. package/dist/contexts/PaginateContext.js +11 -0
  109. package/dist/contexts/PrintContext.js +8 -0
  110. package/dist/contexts/RPDocumentContext.js +49 -0
  111. package/dist/contexts/RenderedPagesCache.js +14 -0
  112. package/dist/contexts/RotateContext.js +23 -0
  113. package/dist/contexts/ScrollModeContext.js +21 -0
  114. package/dist/contexts/ScrollStateContext.js +13 -0
  115. package/dist/contexts/SearchContext.js +8 -0
  116. package/dist/contexts/SelectionModeContext.js +23 -0
  117. package/dist/contexts/ThemeContext.js +7 -0
  118. package/dist/contexts/ThumbnailsContext.js +8 -0
  119. package/dist/contexts/ToolbarComponentContext.js +41 -0
  120. package/dist/contexts/ViewModeContext.js +28 -0
  121. package/dist/contexts/ViewportContext.js +62 -0
  122. package/dist/contexts/VirtualGridContext.js +15 -0
  123. package/dist/contexts/VirtualScrollContext.js +53 -0
  124. package/dist/contexts/ZoomContext.js +46 -0
  125. package/dist/index-3459164c.js +3609 -0
  126. package/dist/index-743c36f0.js +139 -0
  127. package/dist/main.js +37 -0
  128. package/dist/types/components/RPConfig.d.ts +3 -0
  129. package/dist/types/components/RPController.d.ts +3 -0
  130. package/dist/types/components/RPDocument.d.ts +3 -0
  131. package/dist/types/components/RPDropFileZone.d.ts +2 -0
  132. package/dist/types/components/RPTheme.d.ts +3 -0
  133. package/dist/types/components/RPViewer.d.ts +2 -0
  134. package/dist/types/components/icons/CheckIcon.d.ts +2 -0
  135. package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
  136. package/dist/types/components/icons/ClearIcon.d.ts +2 -0
  137. package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
  138. package/dist/types/components/icons/CloseIcon.d.ts +2 -0
  139. package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
  140. package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
  141. package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
  142. package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
  143. package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
  144. package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
  145. package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
  146. package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
  147. package/dist/types/components/icons/InfoIcon.d.ts +2 -0
  148. package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
  149. package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
  150. package/dist/types/components/icons/MoonIcon.d.ts +2 -0
  151. package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
  152. package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
  153. package/dist/types/components/icons/SearchIcon.d.ts +2 -0
  154. package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
  155. package/dist/types/components/icons/SunIcon.d.ts +2 -0
  156. package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
  157. package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
  158. package/dist/types/components/icons/Thumbnail.d.ts +2 -0
  159. package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
  160. package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
  161. package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
  162. package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
  163. package/dist/types/components/layout/Container.d.ts +9 -0
  164. package/dist/types/components/layout/RPLayout.d.ts +3 -0
  165. package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
  166. package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
  167. package/dist/types/components/layout/sidebar/RPSplitter.d.ts +7 -0
  168. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
  169. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +5 -0
  170. package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
  171. package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
  172. package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
  173. package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
  174. package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
  175. package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
  176. package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
  177. package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
  178. package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
  179. package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
  180. package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
  181. package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
  182. package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
  183. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -0
  184. package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
  185. package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
  186. package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
  187. package/dist/types/components/layout/toolbar/SearchTool.d.ts +2 -0
  188. package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
  189. package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
  190. package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
  191. package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
  192. package/dist/types/components/page/CanvasLayer.d.ts +8 -0
  193. package/dist/types/components/page/DualPage.d.ts +5 -0
  194. package/dist/types/components/page/RPPage.d.ts +6 -0
  195. package/dist/types/components/page/SinglePage.d.ts +5 -0
  196. package/dist/types/components/page/TextLayer.d.ts +6 -0
  197. package/dist/types/components/ui/Button.d.ts +6 -0
  198. package/dist/types/components/ui/Checkbox.d.ts +8 -0
  199. package/dist/types/components/ui/DropDown.d.ts +9 -0
  200. package/dist/types/components/ui/Input.d.ts +6 -0
  201. package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
  202. package/dist/types/contexts/ConfigContext.d.ts +5 -0
  203. package/dist/types/contexts/DarkModeContext.d.ts +5 -0
  204. package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
  205. package/dist/types/contexts/FileInputContext.d.ts +7 -0
  206. package/dist/types/contexts/FullScreenContext.d.ts +7 -0
  207. package/dist/types/contexts/IconContext.d.ts +7 -0
  208. package/dist/types/contexts/InitialStateContext.d.ts +5 -0
  209. package/dist/types/contexts/LayerContext.d.ts +5 -0
  210. package/dist/types/contexts/LayoutContainerContext.d.ts +8 -0
  211. package/dist/types/contexts/LicenseContext.d.ts +7 -0
  212. package/dist/types/contexts/OtherToolContext.d.ts +9 -0
  213. package/dist/types/contexts/PageViewportContext.d.ts +4 -0
  214. package/dist/types/contexts/PaginateContext.d.ts +5 -0
  215. package/dist/types/contexts/PrintContext.d.ts +7 -0
  216. package/dist/types/contexts/RPDocumentContext.d.ts +10 -0
  217. package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
  218. package/dist/types/contexts/RotateContext.d.ts +5 -0
  219. package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
  220. package/dist/types/contexts/ScrollStateContext.d.ts +8 -0
  221. package/dist/types/contexts/SearchContext.d.ts +7 -0
  222. package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
  223. package/dist/types/contexts/ThemeContext.d.ts +4 -0
  224. package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
  225. package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
  226. package/dist/types/contexts/ViewModeContext.d.ts +5 -0
  227. package/dist/types/contexts/ViewportContext.d.ts +28 -0
  228. package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
  229. package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
  230. package/dist/types/contexts/ZoomContext.d.ts +5 -0
  231. package/dist/types/main.d.ts +20 -0
  232. package/dist/types/utils/appConsole.d.ts +24 -0
  233. package/dist/types/utils/charators.d.ts +12 -0
  234. package/dist/types/utils/constants.d.ts +2 -0
  235. package/dist/types/utils/convertPdfDate.d.ts +1 -0
  236. package/dist/types/utils/dateFormatter.d.ts +1 -0
  237. package/dist/types/utils/formatFileSize.d.ts +1 -0
  238. package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
  239. package/dist/types/utils/getZoomLevel.d.ts +2 -0
  240. package/dist/types/utils/highlight.d.ts +8 -0
  241. package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
  242. package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
  243. package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
  244. package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
  245. package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
  246. package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
  247. package/dist/types/utils/hooks/useGrabScroll.d.ts +10 -0
  248. package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
  249. package/dist/types/utils/hooks/useLicense.d.ts +2 -0
  250. package/dist/types/utils/hooks/useLoadPdf.d.ts +7 -0
  251. package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
  252. package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
  253. package/dist/types/utils/hooks/usePageDimension.d.ts +4 -0
  254. package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
  255. package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
  256. package/dist/types/utils/hooks/usePrint.d.ts +11 -0
  257. package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
  258. package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
  259. package/dist/types/utils/hooks/useRotate.d.ts +4 -0
  260. package/dist/types/utils/hooks/useScrollToPage.d.ts +4 -0
  261. package/dist/types/utils/hooks/useSearch.d.ts +14 -0
  262. package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
  263. package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +12 -0
  264. package/dist/types/utils/hooks/useWatermark.d.ts +4 -0
  265. package/dist/types/utils/link_service.d.ts +71 -0
  266. package/dist/types/utils/renderPage.d.ts +2 -0
  267. package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
  268. package/dist/types/utils/types.d.ts +562 -0
  269. package/dist/utils/appConsole.js +42 -0
  270. package/dist/utils/charators.js +48 -0
  271. package/dist/utils/constants.js +5 -0
  272. package/dist/utils/convertPdfDate.js +25 -0
  273. package/dist/utils/dateFormatter.js +7 -0
  274. package/dist/utils/formatFileSize.js +9 -0
  275. package/dist/utils/getThumbnailViewport.js +7 -0
  276. package/dist/utils/getZoomLevel.js +18 -0
  277. package/dist/utils/highlight.js +145 -0
  278. package/dist/utils/hooks/useDarkMode.js +11 -0
  279. package/dist/utils/hooks/useDarkModeProps.js +12 -0
  280. package/dist/utils/hooks/useDebounce.js +15 -0
  281. package/dist/utils/hooks/useElementSize.js +21 -0
  282. package/dist/utils/hooks/useFileDownload.js +32 -0
  283. package/dist/utils/hooks/useFullScreen.js +29 -0
  284. package/dist/utils/hooks/useGrabScroll.js +45 -0
  285. package/dist/utils/hooks/useInfiniteScroll.js +19 -0
  286. package/dist/utils/hooks/useLicense.js +102 -0
  287. package/dist/utils/hooks/useLoadPdf.js +50 -0
  288. package/dist/utils/hooks/useLoadWorker.js +13 -0
  289. package/dist/utils/hooks/useMousePressed.js +20 -0
  290. package/dist/utils/hooks/usePageDimension.js +24 -0
  291. package/dist/utils/hooks/usePaginate.js +33 -0
  292. package/dist/utils/hooks/usePdfProperties.js +40 -0
  293. package/dist/utils/hooks/usePrint.js +33 -0
  294. package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
  295. package/dist/utils/hooks/useResizeObserver.js +22 -0
  296. package/dist/utils/hooks/useRotate.js +13 -0
  297. package/dist/utils/hooks/useScrollToPage.js +34 -0
  298. package/dist/utils/hooks/useSearch.js +33 -0
  299. package/dist/utils/hooks/useThumbnail.js +34 -0
  300. package/dist/utils/hooks/useVirtualReactWindow.js +34 -0
  301. package/dist/utils/hooks/useWatermark.js +62 -0
  302. package/dist/utils/link_service.js +98 -0
  303. package/dist/utils/renderPage.js +15 -0
  304. package/dist/utils/sanitizeExternalUrl.js +16 -0
  305. package/dist/utils/types.js +10 -0
  306. package/package.json +90 -0
@@ -0,0 +1,1347 @@
1
+ var be = (t, e, s) => {
2
+ if (!e.has(t))
3
+ throw TypeError("Cannot " + s);
4
+ };
5
+ var i = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), l = (t, e, s) => {
6
+ if (e.has(t))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ e instanceof WeakSet ? e.add(t) : e.set(t, s);
9
+ }, o = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
10
+ var de = (t, e, s, r) => ({
11
+ set _(n) {
12
+ o(t, e, n, s);
13
+ },
14
+ get _() {
15
+ return i(t, e, r);
16
+ }
17
+ }), P = (t, e, s) => (be(t, e, "access private method"), s);
18
+ import { jsx as ae } from "react/jsx-runtime";
19
+ import { RPTheme as Ve } from "./RPTheme.js";
20
+ import { ConfigContextProvider as $e } from "../contexts/ConfigContext.js";
21
+ import { useLoadWorker as ze } from "../utils/hooks/useLoadWorker.js";
22
+ import * as Ie from "react";
23
+ import { LicenseProvider as Be } from "../contexts/LicenseContext.js";
24
+ var me = class {
25
+ constructor() {
26
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
27
+ }
28
+ subscribe(t) {
29
+ return this.listeners.add(t), this.onSubscribe(), () => {
30
+ this.listeners.delete(t), this.onUnsubscribe();
31
+ };
32
+ }
33
+ hasListeners() {
34
+ return this.listeners.size > 0;
35
+ }
36
+ onSubscribe() {
37
+ }
38
+ onUnsubscribe() {
39
+ }
40
+ }, ve = typeof window > "u" || "Deno" in globalThis;
41
+ function R() {
42
+ }
43
+ function Je(t, e) {
44
+ return typeof t == "function" ? t(e) : t;
45
+ }
46
+ function We(t) {
47
+ return typeof t == "number" && t >= 0 && t !== 1 / 0;
48
+ }
49
+ function Xe(t, e) {
50
+ return Math.max(t + (e || 0) - Date.now(), 0);
51
+ }
52
+ function Se(t, e) {
53
+ return typeof t == "function" ? t(e) : t;
54
+ }
55
+ function Ye(t, e) {
56
+ return typeof t == "function" ? t(e) : t;
57
+ }
58
+ function Fe(t, e) {
59
+ const {
60
+ type: s = "all",
61
+ exact: r,
62
+ fetchStatus: n,
63
+ predicate: u,
64
+ queryKey: h,
65
+ stale: a
66
+ } = t;
67
+ if (h) {
68
+ if (r) {
69
+ if (e.queryHash !== Oe(h, e.options))
70
+ return !1;
71
+ } else if (!oe(e.queryKey, h))
72
+ return !1;
73
+ }
74
+ if (s !== "all") {
75
+ const f = e.isActive();
76
+ if (s === "active" && !f || s === "inactive" && f)
77
+ return !1;
78
+ }
79
+ return !(typeof a == "boolean" && e.isStale() !== a || n && n !== e.state.fetchStatus || u && !u(e));
80
+ }
81
+ function Ce(t, e) {
82
+ const { exact: s, status: r, predicate: n, mutationKey: u } = t;
83
+ if (u) {
84
+ if (!e.options.mutationKey)
85
+ return !1;
86
+ if (s) {
87
+ if (ue(e.options.mutationKey) !== ue(u))
88
+ return !1;
89
+ } else if (!oe(e.options.mutationKey, u))
90
+ return !1;
91
+ }
92
+ return !(r && e.state.status !== r || n && !n(e));
93
+ }
94
+ function Oe(t, e) {
95
+ return ((e == null ? void 0 : e.queryKeyHashFn) || ue)(t);
96
+ }
97
+ function ue(t) {
98
+ return JSON.stringify(
99
+ t,
100
+ (e, s) => Pe(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
101
+ );
102
+ }
103
+ function oe(t, e) {
104
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !oe(t[s], e[s])) : !1;
105
+ }
106
+ function we(t, e) {
107
+ if (t === e)
108
+ return t;
109
+ const s = qe(t) && qe(e);
110
+ if (s || Pe(t) && Pe(e)) {
111
+ const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), h = u.length, a = s ? [] : {};
112
+ let f = 0;
113
+ for (let w = 0; w < h; w++) {
114
+ const m = s ? w : u[w];
115
+ (!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (a[m] = void 0, f++) : (a[m] = we(t[m], e[m]), a[m] === t[m] && t[m] !== void 0 && f++);
116
+ }
117
+ return n === h && f === n ? t : a;
118
+ }
119
+ return e;
120
+ }
121
+ function qe(t) {
122
+ return Array.isArray(t) && t.length === Object.keys(t).length;
123
+ }
124
+ function Pe(t) {
125
+ if (!De(t))
126
+ return !1;
127
+ const e = t.constructor;
128
+ if (e === void 0)
129
+ return !0;
130
+ const s = e.prototype;
131
+ return !(!De(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
132
+ }
133
+ function De(t) {
134
+ return Object.prototype.toString.call(t) === "[object Object]";
135
+ }
136
+ function Ze(t) {
137
+ return new Promise((e) => {
138
+ setTimeout(e, t);
139
+ });
140
+ }
141
+ function et(t, e, s) {
142
+ if (typeof s.structuralSharing == "function")
143
+ return s.structuralSharing(t, e);
144
+ if (s.structuralSharing !== !1) {
145
+ if (process.env.NODE_ENV !== "production")
146
+ try {
147
+ return we(t, e);
148
+ } catch (r) {
149
+ console.error(
150
+ `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}`
151
+ );
152
+ }
153
+ return we(t, e);
154
+ }
155
+ return e;
156
+ }
157
+ function tt(t, e, s = 0) {
158
+ const r = [...t, e];
159
+ return s && r.length > s ? r.slice(1) : r;
160
+ }
161
+ function st(t, e, s = 0) {
162
+ const r = [e, ...t];
163
+ return s && r.length > s ? r.slice(0, -1) : r;
164
+ }
165
+ var ye = Symbol();
166
+ function xe(t, e) {
167
+ return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error(
168
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
169
+ ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
170
+ }
171
+ var z, L, X, Qe, rt = (Qe = class extends me {
172
+ constructor() {
173
+ super();
174
+ l(this, z, void 0);
175
+ l(this, L, void 0);
176
+ l(this, X, void 0);
177
+ o(this, X, (e) => {
178
+ if (!ve && window.addEventListener) {
179
+ const s = () => e();
180
+ return window.addEventListener("visibilitychange", s, !1), () => {
181
+ window.removeEventListener("visibilitychange", s);
182
+ };
183
+ }
184
+ });
185
+ }
186
+ onSubscribe() {
187
+ i(this, L) || this.setEventListener(i(this, X));
188
+ }
189
+ onUnsubscribe() {
190
+ var e;
191
+ this.hasListeners() || ((e = i(this, L)) == null || e.call(this), o(this, L, void 0));
192
+ }
193
+ setEventListener(e) {
194
+ var s;
195
+ o(this, X, e), (s = i(this, L)) == null || s.call(this), o(this, L, e((r) => {
196
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
197
+ }));
198
+ }
199
+ setFocused(e) {
200
+ i(this, z) !== e && (o(this, z, e), this.onFocus());
201
+ }
202
+ onFocus() {
203
+ const e = this.isFocused();
204
+ this.listeners.forEach((s) => {
205
+ s(e);
206
+ });
207
+ }
208
+ isFocused() {
209
+ var e;
210
+ return typeof i(this, z) == "boolean" ? i(this, z) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
211
+ }
212
+ }, z = new WeakMap(), L = new WeakMap(), X = new WeakMap(), Qe), He = new rt(), Y, N, Z, Me, it = (Me = class extends me {
213
+ constructor() {
214
+ super();
215
+ l(this, Y, !0);
216
+ l(this, N, void 0);
217
+ l(this, Z, void 0);
218
+ o(this, Z, (e) => {
219
+ if (!ve && window.addEventListener) {
220
+ const s = () => e(!0), r = () => e(!1);
221
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
222
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
223
+ };
224
+ }
225
+ });
226
+ }
227
+ onSubscribe() {
228
+ i(this, N) || this.setEventListener(i(this, Z));
229
+ }
230
+ onUnsubscribe() {
231
+ var e;
232
+ this.hasListeners() || ((e = i(this, N)) == null || e.call(this), o(this, N, void 0));
233
+ }
234
+ setEventListener(e) {
235
+ var s;
236
+ o(this, Z, e), (s = i(this, N)) == null || s.call(this), o(this, N, e(this.setOnline.bind(this)));
237
+ }
238
+ setOnline(e) {
239
+ i(this, Y) !== e && (o(this, Y, e), this.listeners.forEach((r) => {
240
+ r(e);
241
+ }));
242
+ }
243
+ isOnline() {
244
+ return i(this, Y);
245
+ }
246
+ }, Y = new WeakMap(), N = new WeakMap(), Z = new WeakMap(), Me), pe = new it();
247
+ function nt() {
248
+ let t, e;
249
+ const s = new Promise((n, u) => {
250
+ t = n, e = u;
251
+ });
252
+ s.status = "pending", s.catch(() => {
253
+ });
254
+ function r(n) {
255
+ Object.assign(s, n), delete s.resolve, delete s.reject;
256
+ }
257
+ return s.resolve = (n) => {
258
+ r({
259
+ status: "fulfilled",
260
+ value: n
261
+ }), t(n);
262
+ }, s.reject = (n) => {
263
+ r({
264
+ status: "rejected",
265
+ reason: n
266
+ }), e(n);
267
+ }, s;
268
+ }
269
+ function at(t) {
270
+ return Math.min(1e3 * 2 ** t, 3e4);
271
+ }
272
+ function Le(t) {
273
+ return (t ?? "online") === "online" ? pe.isOnline() : !0;
274
+ }
275
+ var Ne = class extends Error {
276
+ constructor(t) {
277
+ super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
278
+ }
279
+ };
280
+ function ge(t) {
281
+ return t instanceof Ne;
282
+ }
283
+ function Ge(t) {
284
+ let e = !1, s = 0, r = !1, n;
285
+ const u = nt(), h = (c) => {
286
+ var p;
287
+ r || (y(new Ne(c)), (p = t.abort) == null || p.call(t));
288
+ }, a = () => {
289
+ e = !0;
290
+ }, f = () => {
291
+ e = !1;
292
+ }, w = () => He.isFocused() && (t.networkMode === "always" || pe.isOnline()) && t.canRun(), m = () => Le(t.networkMode) && t.canRun(), d = (c) => {
293
+ var p;
294
+ r || (r = !0, (p = t.onSuccess) == null || p.call(t, c), n == null || n(), u.resolve(c));
295
+ }, y = (c) => {
296
+ var p;
297
+ r || (r = !0, (p = t.onError) == null || p.call(t, c), n == null || n(), u.reject(c));
298
+ }, q = () => new Promise((c) => {
299
+ var p;
300
+ n = (D) => {
301
+ (r || w()) && c(D);
302
+ }, (p = t.onPause) == null || p.call(t);
303
+ }).then(() => {
304
+ var c;
305
+ n = void 0, r || (c = t.onContinue) == null || c.call(t);
306
+ }), S = () => {
307
+ if (r)
308
+ return;
309
+ let c;
310
+ const p = s === 0 ? t.initialPromise : void 0;
311
+ try {
312
+ c = p ?? t.fn();
313
+ } catch (D) {
314
+ c = Promise.reject(D);
315
+ }
316
+ Promise.resolve(c).then(d).catch((D) => {
317
+ var j;
318
+ if (r)
319
+ return;
320
+ const M = t.retry ?? (ve ? 0 : 3), b = t.retryDelay ?? at, E = typeof b == "function" ? b(s, D) : b, k = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, D);
321
+ if (e || !k) {
322
+ y(D);
323
+ return;
324
+ }
325
+ s++, (j = t.onFail) == null || j.call(t, s, D), Ze(E).then(() => w() ? void 0 : q()).then(() => {
326
+ e ? y(D) : S();
327
+ });
328
+ });
329
+ };
330
+ return {
331
+ promise: u,
332
+ cancel: h,
333
+ continue: () => (n == null || n(), u),
334
+ cancelRetry: a,
335
+ continueRetry: f,
336
+ canStart: m,
337
+ start: () => (m() ? S() : q().then(S), u)
338
+ };
339
+ }
340
+ function ut() {
341
+ let t = [], e = 0, s = (a) => {
342
+ a();
343
+ }, r = (a) => {
344
+ a();
345
+ }, n = (a) => setTimeout(a, 0);
346
+ const u = (a) => {
347
+ e ? t.push(a) : n(() => {
348
+ s(a);
349
+ });
350
+ }, h = () => {
351
+ const a = t;
352
+ t = [], a.length && n(() => {
353
+ r(() => {
354
+ a.forEach((f) => {
355
+ s(f);
356
+ });
357
+ });
358
+ });
359
+ };
360
+ return {
361
+ batch: (a) => {
362
+ let f;
363
+ e++;
364
+ try {
365
+ f = a();
366
+ } finally {
367
+ e--, e || h();
368
+ }
369
+ return f;
370
+ },
371
+ /**
372
+ * All calls to the wrapped function will be batched.
373
+ */
374
+ batchCalls: (a) => (...f) => {
375
+ u(() => {
376
+ a(...f);
377
+ });
378
+ },
379
+ schedule: u,
380
+ /**
381
+ * Use this method to set a custom notify function.
382
+ * This can be used to for example wrap notifications with `React.act` while running tests.
383
+ */
384
+ setNotifyFunction: (a) => {
385
+ s = a;
386
+ },
387
+ /**
388
+ * Use this method to set a custom function to batch notifications together into a single tick.
389
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
390
+ */
391
+ setBatchNotifyFunction: (a) => {
392
+ r = a;
393
+ },
394
+ setScheduler: (a) => {
395
+ n = a;
396
+ }
397
+ };
398
+ }
399
+ var C = ut(), B, Re, _e = (Re = class {
400
+ constructor() {
401
+ l(this, B, void 0);
402
+ }
403
+ destroy() {
404
+ this.clearGcTimeout();
405
+ }
406
+ scheduleGc() {
407
+ this.clearGcTimeout(), We(this.gcTime) && o(this, B, setTimeout(() => {
408
+ this.optionalRemove();
409
+ }, this.gcTime));
410
+ }
411
+ updateGcTime(t) {
412
+ this.gcTime = Math.max(
413
+ this.gcTime || 0,
414
+ t ?? (ve ? 1 / 0 : 5 * 60 * 1e3)
415
+ );
416
+ }
417
+ clearGcTimeout() {
418
+ i(this, B) && (clearTimeout(i(this, B)), o(this, B, void 0));
419
+ }
420
+ }, B = new WeakMap(), Re), ee, te, Q, O, he, J, T, x, Te, ot = (Te = class extends _e {
421
+ constructor(e) {
422
+ super();
423
+ l(this, T);
424
+ l(this, ee, void 0);
425
+ l(this, te, void 0);
426
+ l(this, Q, void 0);
427
+ l(this, O, void 0);
428
+ l(this, he, void 0);
429
+ l(this, J, void 0);
430
+ o(this, J, !1), o(this, he, e.defaultOptions), this.setOptions(e.options), this.observers = [], o(this, Q, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, o(this, ee, ct(this.options)), this.state = e.state ?? i(this, ee), this.scheduleGc();
431
+ }
432
+ get meta() {
433
+ return this.options.meta;
434
+ }
435
+ get promise() {
436
+ var e;
437
+ return (e = i(this, O)) == null ? void 0 : e.promise;
438
+ }
439
+ setOptions(e) {
440
+ this.options = { ...i(this, he), ...e }, this.updateGcTime(this.options.gcTime);
441
+ }
442
+ optionalRemove() {
443
+ !this.observers.length && this.state.fetchStatus === "idle" && i(this, Q).remove(this);
444
+ }
445
+ setData(e, s) {
446
+ const r = et(this.state.data, e, this.options);
447
+ return P(this, T, x).call(this, {
448
+ data: r,
449
+ type: "success",
450
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
451
+ manual: s == null ? void 0 : s.manual
452
+ }), r;
453
+ }
454
+ setState(e, s) {
455
+ P(this, T, x).call(this, { type: "setState", state: e, setStateOptions: s });
456
+ }
457
+ cancel(e) {
458
+ var r, n;
459
+ const s = (r = i(this, O)) == null ? void 0 : r.promise;
460
+ return (n = i(this, O)) == null || n.cancel(e), s ? s.then(R).catch(R) : Promise.resolve();
461
+ }
462
+ destroy() {
463
+ super.destroy(), this.cancel({ silent: !0 });
464
+ }
465
+ reset() {
466
+ this.destroy(), this.setState(i(this, ee));
467
+ }
468
+ isActive() {
469
+ return this.observers.some(
470
+ (e) => Ye(e.options.enabled, this) !== !1
471
+ );
472
+ }
473
+ isDisabled() {
474
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ye || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
475
+ }
476
+ isStale() {
477
+ return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
478
+ (e) => e.getCurrentResult().isStale
479
+ ) : this.state.data === void 0;
480
+ }
481
+ isStaleByTime(e = 0) {
482
+ return this.state.isInvalidated || this.state.data === void 0 || !Xe(this.state.dataUpdatedAt, e);
483
+ }
484
+ onFocus() {
485
+ var s;
486
+ const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
487
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, O)) == null || s.continue();
488
+ }
489
+ onOnline() {
490
+ var s;
491
+ const e = this.observers.find((r) => r.shouldFetchOnReconnect());
492
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, O)) == null || s.continue();
493
+ }
494
+ addObserver(e) {
495
+ this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, Q).notify({ type: "observerAdded", query: this, observer: e }));
496
+ }
497
+ removeObserver(e) {
498
+ this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, O) && (i(this, J) ? i(this, O).cancel({ revert: !0 }) : i(this, O).cancelRetry()), this.scheduleGc()), i(this, Q).notify({ type: "observerRemoved", query: this, observer: e }));
499
+ }
500
+ getObserversCount() {
501
+ return this.observers.length;
502
+ }
503
+ invalidate() {
504
+ this.state.isInvalidated || P(this, T, x).call(this, { type: "invalidate" });
505
+ }
506
+ fetch(e, s) {
507
+ var f, w, m;
508
+ if (this.state.fetchStatus !== "idle") {
509
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
510
+ this.cancel({ silent: !0 });
511
+ else if (i(this, O))
512
+ return i(this, O).continueRetry(), i(this, O).promise;
513
+ }
514
+ if (e && this.setOptions(e), !this.options.queryFn) {
515
+ const d = this.observers.find((y) => y.options.queryFn);
516
+ d && this.setOptions(d.options);
517
+ }
518
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
519
+ "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']"
520
+ ));
521
+ const r = new AbortController(), n = (d) => {
522
+ Object.defineProperty(d, "signal", {
523
+ enumerable: !0,
524
+ get: () => (o(this, J, !0), r.signal)
525
+ });
526
+ }, u = () => {
527
+ const d = xe(this.options, s), y = {
528
+ queryKey: this.queryKey,
529
+ meta: this.meta
530
+ };
531
+ return n(y), o(this, J, !1), this.options.persister ? this.options.persister(
532
+ d,
533
+ y,
534
+ this
535
+ ) : d(y);
536
+ }, h = {
537
+ fetchOptions: s,
538
+ options: this.options,
539
+ queryKey: this.queryKey,
540
+ state: this.state,
541
+ fetchFn: u
542
+ };
543
+ n(h), (f = this.options.behavior) == null || f.onFetch(
544
+ h,
545
+ this
546
+ ), o(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((w = h.fetchOptions) == null ? void 0 : w.meta)) && P(this, T, x).call(this, { type: "fetch", meta: (m = h.fetchOptions) == null ? void 0 : m.meta });
547
+ const a = (d) => {
548
+ var y, q, S, c;
549
+ ge(d) && d.silent || P(this, T, x).call(this, {
550
+ type: "error",
551
+ error: d
552
+ }), ge(d) || ((q = (y = i(this, Q).config).onError) == null || q.call(
553
+ y,
554
+ d,
555
+ this
556
+ ), (c = (S = i(this, Q).config).onSettled) == null || c.call(
557
+ S,
558
+ this.state.data,
559
+ d,
560
+ this
561
+ )), this.scheduleGc();
562
+ };
563
+ return o(this, O, Ge({
564
+ initialPromise: s == null ? void 0 : s.initialPromise,
565
+ fn: h.fetchFn,
566
+ abort: r.abort.bind(r),
567
+ onSuccess: (d) => {
568
+ var y, q, S, c;
569
+ if (d === void 0) {
570
+ process.env.NODE_ENV !== "production" && console.error(
571
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
572
+ ), a(new Error(`${this.queryHash} data is undefined`));
573
+ return;
574
+ }
575
+ try {
576
+ this.setData(d);
577
+ } catch (p) {
578
+ a(p);
579
+ return;
580
+ }
581
+ (q = (y = i(this, Q).config).onSuccess) == null || q.call(y, d, this), (c = (S = i(this, Q).config).onSettled) == null || c.call(
582
+ S,
583
+ d,
584
+ this.state.error,
585
+ this
586
+ ), this.scheduleGc();
587
+ },
588
+ onError: a,
589
+ onFail: (d, y) => {
590
+ P(this, T, x).call(this, { type: "failed", failureCount: d, error: y });
591
+ },
592
+ onPause: () => {
593
+ P(this, T, x).call(this, { type: "pause" });
594
+ },
595
+ onContinue: () => {
596
+ P(this, T, x).call(this, { type: "continue" });
597
+ },
598
+ retry: h.options.retry,
599
+ retryDelay: h.options.retryDelay,
600
+ networkMode: h.options.networkMode,
601
+ canRun: () => !0
602
+ })), i(this, O).start();
603
+ }
604
+ }, ee = new WeakMap(), te = new WeakMap(), Q = new WeakMap(), O = new WeakMap(), he = new WeakMap(), J = new WeakMap(), T = new WeakSet(), x = function(e) {
605
+ const s = (r) => {
606
+ switch (e.type) {
607
+ case "failed":
608
+ return {
609
+ ...r,
610
+ fetchFailureCount: e.failureCount,
611
+ fetchFailureReason: e.error
612
+ };
613
+ case "pause":
614
+ return {
615
+ ...r,
616
+ fetchStatus: "paused"
617
+ };
618
+ case "continue":
619
+ return {
620
+ ...r,
621
+ fetchStatus: "fetching"
622
+ };
623
+ case "fetch":
624
+ return {
625
+ ...r,
626
+ ...ht(r.data, this.options),
627
+ fetchMeta: e.meta ?? null
628
+ };
629
+ case "success":
630
+ return {
631
+ ...r,
632
+ data: e.data,
633
+ dataUpdateCount: r.dataUpdateCount + 1,
634
+ dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
635
+ error: null,
636
+ isInvalidated: !1,
637
+ status: "success",
638
+ ...!e.manual && {
639
+ fetchStatus: "idle",
640
+ fetchFailureCount: 0,
641
+ fetchFailureReason: null
642
+ }
643
+ };
644
+ case "error":
645
+ const n = e.error;
646
+ return ge(n) && n.revert && i(this, te) ? { ...i(this, te), fetchStatus: "idle" } : {
647
+ ...r,
648
+ error: n,
649
+ errorUpdateCount: r.errorUpdateCount + 1,
650
+ errorUpdatedAt: Date.now(),
651
+ fetchFailureCount: r.fetchFailureCount + 1,
652
+ fetchFailureReason: n,
653
+ fetchStatus: "idle",
654
+ status: "error"
655
+ };
656
+ case "invalidate":
657
+ return {
658
+ ...r,
659
+ isInvalidated: !0
660
+ };
661
+ case "setState":
662
+ return {
663
+ ...r,
664
+ ...e.state
665
+ };
666
+ }
667
+ };
668
+ this.state = s(this.state), C.batch(() => {
669
+ this.observers.forEach((r) => {
670
+ r.onQueryUpdate();
671
+ }), i(this, Q).notify({ query: this, type: "updated", action: e });
672
+ });
673
+ }, Te);
674
+ function ht(t, e) {
675
+ return {
676
+ fetchFailureCount: 0,
677
+ fetchFailureReason: null,
678
+ fetchStatus: Le(e.networkMode) ? "fetching" : "paused",
679
+ ...t === void 0 && {
680
+ error: null,
681
+ status: "pending"
682
+ }
683
+ };
684
+ }
685
+ function ct(t) {
686
+ const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
687
+ return {
688
+ data: e,
689
+ dataUpdateCount: 0,
690
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
691
+ error: null,
692
+ errorUpdateCount: 0,
693
+ errorUpdatedAt: 0,
694
+ fetchFailureCount: 0,
695
+ fetchFailureReason: null,
696
+ fetchMeta: null,
697
+ isInvalidated: !1,
698
+ status: s ? "success" : "pending",
699
+ fetchStatus: "idle"
700
+ };
701
+ }
702
+ var K, ke, lt = (ke = class extends me {
703
+ constructor(e = {}) {
704
+ super();
705
+ l(this, K, void 0);
706
+ this.config = e, o(this, K, /* @__PURE__ */ new Map());
707
+ }
708
+ build(e, s, r) {
709
+ const n = s.queryKey, u = s.queryHash ?? Oe(n, s);
710
+ let h = this.get(u);
711
+ return h || (h = new ot({
712
+ cache: this,
713
+ queryKey: n,
714
+ queryHash: u,
715
+ options: e.defaultQueryOptions(s),
716
+ state: r,
717
+ defaultOptions: e.getQueryDefaults(n)
718
+ }), this.add(h)), h;
719
+ }
720
+ add(e) {
721
+ i(this, K).has(e.queryHash) || (i(this, K).set(e.queryHash, e), this.notify({
722
+ type: "added",
723
+ query: e
724
+ }));
725
+ }
726
+ remove(e) {
727
+ const s = i(this, K).get(e.queryHash);
728
+ s && (e.destroy(), s === e && i(this, K).delete(e.queryHash), this.notify({ type: "removed", query: e }));
729
+ }
730
+ clear() {
731
+ C.batch(() => {
732
+ this.getAll().forEach((e) => {
733
+ this.remove(e);
734
+ });
735
+ });
736
+ }
737
+ get(e) {
738
+ return i(this, K).get(e);
739
+ }
740
+ getAll() {
741
+ return [...i(this, K).values()];
742
+ }
743
+ find(e) {
744
+ const s = { exact: !0, ...e };
745
+ return this.getAll().find(
746
+ (r) => Fe(s, r)
747
+ );
748
+ }
749
+ findAll(e = {}) {
750
+ const s = this.getAll();
751
+ return Object.keys(e).length > 0 ? s.filter((r) => Fe(e, r)) : s;
752
+ }
753
+ notify(e) {
754
+ C.batch(() => {
755
+ this.listeners.forEach((s) => {
756
+ s(e);
757
+ });
758
+ });
759
+ }
760
+ onFocus() {
761
+ C.batch(() => {
762
+ this.getAll().forEach((e) => {
763
+ e.onFocus();
764
+ });
765
+ });
766
+ }
767
+ onOnline() {
768
+ C.batch(() => {
769
+ this.getAll().forEach((e) => {
770
+ e.onOnline();
771
+ });
772
+ });
773
+ }
774
+ }, K = new WeakMap(), ke), U, F, W, I, H, je, dt = (je = class extends _e {
775
+ constructor(e) {
776
+ super();
777
+ l(this, I);
778
+ l(this, U, void 0);
779
+ l(this, F, void 0);
780
+ l(this, W, void 0);
781
+ this.mutationId = e.mutationId, o(this, F, e.mutationCache), o(this, U, []), this.state = e.state || ft(), this.setOptions(e.options), this.scheduleGc();
782
+ }
783
+ setOptions(e) {
784
+ this.options = e, this.updateGcTime(this.options.gcTime);
785
+ }
786
+ get meta() {
787
+ return this.options.meta;
788
+ }
789
+ addObserver(e) {
790
+ i(this, U).includes(e) || (i(this, U).push(e), this.clearGcTimeout(), i(this, F).notify({
791
+ type: "observerAdded",
792
+ mutation: this,
793
+ observer: e
794
+ }));
795
+ }
796
+ removeObserver(e) {
797
+ o(this, U, i(this, U).filter((s) => s !== e)), this.scheduleGc(), i(this, F).notify({
798
+ type: "observerRemoved",
799
+ mutation: this,
800
+ observer: e
801
+ });
802
+ }
803
+ optionalRemove() {
804
+ i(this, U).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, F).remove(this));
805
+ }
806
+ continue() {
807
+ var e;
808
+ return ((e = i(this, W)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
809
+ this.execute(this.state.variables);
810
+ }
811
+ async execute(e) {
812
+ var n, u, h, a, f, w, m, d, y, q, S, c, p, D, M, b, E, k, j, le;
813
+ o(this, W, Ge({
814
+ fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
815
+ onFail: (g, $) => {
816
+ P(this, I, H).call(this, { type: "failed", failureCount: g, error: $ });
817
+ },
818
+ onPause: () => {
819
+ P(this, I, H).call(this, { type: "pause" });
820
+ },
821
+ onContinue: () => {
822
+ P(this, I, H).call(this, { type: "continue" });
823
+ },
824
+ retry: this.options.retry ?? 0,
825
+ retryDelay: this.options.retryDelay,
826
+ networkMode: this.options.networkMode,
827
+ canRun: () => i(this, F).canRun(this)
828
+ }));
829
+ const s = this.state.status === "pending", r = !i(this, W).canStart();
830
+ try {
831
+ if (!s) {
832
+ P(this, I, H).call(this, { type: "pending", variables: e, isPaused: r }), await ((u = (n = i(this, F).config).onMutate) == null ? void 0 : u.call(
833
+ n,
834
+ e,
835
+ this
836
+ ));
837
+ const $ = await ((a = (h = this.options).onMutate) == null ? void 0 : a.call(h, e));
838
+ $ !== this.state.context && P(this, I, H).call(this, {
839
+ type: "pending",
840
+ context: $,
841
+ variables: e,
842
+ isPaused: r
843
+ });
844
+ }
845
+ const g = await i(this, W).start();
846
+ return await ((w = (f = i(this, F).config).onSuccess) == null ? void 0 : w.call(
847
+ f,
848
+ g,
849
+ e,
850
+ this.state.context,
851
+ this
852
+ )), await ((d = (m = this.options).onSuccess) == null ? void 0 : d.call(m, g, e, this.state.context)), await ((q = (y = i(this, F).config).onSettled) == null ? void 0 : q.call(
853
+ y,
854
+ g,
855
+ null,
856
+ this.state.variables,
857
+ this.state.context,
858
+ this
859
+ )), await ((c = (S = this.options).onSettled) == null ? void 0 : c.call(S, g, null, e, this.state.context)), P(this, I, H).call(this, { type: "success", data: g }), g;
860
+ } catch (g) {
861
+ try {
862
+ throw await ((D = (p = i(this, F).config).onError) == null ? void 0 : D.call(
863
+ p,
864
+ g,
865
+ e,
866
+ this.state.context,
867
+ this
868
+ )), await ((b = (M = this.options).onError) == null ? void 0 : b.call(
869
+ M,
870
+ g,
871
+ e,
872
+ this.state.context
873
+ )), await ((k = (E = i(this, F).config).onSettled) == null ? void 0 : k.call(
874
+ E,
875
+ void 0,
876
+ g,
877
+ this.state.variables,
878
+ this.state.context,
879
+ this
880
+ )), await ((le = (j = this.options).onSettled) == null ? void 0 : le.call(
881
+ j,
882
+ void 0,
883
+ g,
884
+ e,
885
+ this.state.context
886
+ )), g;
887
+ } finally {
888
+ P(this, I, H).call(this, { type: "error", error: g });
889
+ }
890
+ } finally {
891
+ i(this, F).runNext(this);
892
+ }
893
+ }
894
+ }, U = new WeakMap(), F = new WeakMap(), W = new WeakMap(), I = new WeakSet(), H = function(e) {
895
+ const s = (r) => {
896
+ switch (e.type) {
897
+ case "failed":
898
+ return {
899
+ ...r,
900
+ failureCount: e.failureCount,
901
+ failureReason: e.error
902
+ };
903
+ case "pause":
904
+ return {
905
+ ...r,
906
+ isPaused: !0
907
+ };
908
+ case "continue":
909
+ return {
910
+ ...r,
911
+ isPaused: !1
912
+ };
913
+ case "pending":
914
+ return {
915
+ ...r,
916
+ context: e.context,
917
+ data: void 0,
918
+ failureCount: 0,
919
+ failureReason: null,
920
+ error: null,
921
+ isPaused: e.isPaused,
922
+ status: "pending",
923
+ variables: e.variables,
924
+ submittedAt: Date.now()
925
+ };
926
+ case "success":
927
+ return {
928
+ ...r,
929
+ data: e.data,
930
+ failureCount: 0,
931
+ failureReason: null,
932
+ error: null,
933
+ status: "success",
934
+ isPaused: !1
935
+ };
936
+ case "error":
937
+ return {
938
+ ...r,
939
+ data: void 0,
940
+ error: e.error,
941
+ failureCount: r.failureCount + 1,
942
+ failureReason: e.error,
943
+ isPaused: !1,
944
+ status: "error"
945
+ };
946
+ }
947
+ };
948
+ this.state = s(this.state), C.batch(() => {
949
+ i(this, U).forEach((r) => {
950
+ r.onMutationUpdate(e);
951
+ }), i(this, F).notify({
952
+ mutation: this,
953
+ type: "updated",
954
+ action: e
955
+ });
956
+ });
957
+ }, je);
958
+ function ft() {
959
+ return {
960
+ context: void 0,
961
+ data: void 0,
962
+ error: null,
963
+ failureCount: 0,
964
+ failureReason: null,
965
+ isPaused: !1,
966
+ status: "idle",
967
+ variables: void 0,
968
+ submittedAt: 0
969
+ };
970
+ }
971
+ var A, ce, Ke, yt = (Ke = class extends me {
972
+ constructor(e = {}) {
973
+ super();
974
+ l(this, A, void 0);
975
+ l(this, ce, void 0);
976
+ this.config = e, o(this, A, /* @__PURE__ */ new Map()), o(this, ce, Date.now());
977
+ }
978
+ build(e, s, r) {
979
+ const n = new dt({
980
+ mutationCache: this,
981
+ mutationId: ++de(this, ce)._,
982
+ options: e.defaultMutationOptions(s),
983
+ state: r
984
+ });
985
+ return this.add(n), n;
986
+ }
987
+ add(e) {
988
+ const s = fe(e), r = i(this, A).get(s) ?? [];
989
+ r.push(e), i(this, A).set(s, r), this.notify({ type: "added", mutation: e });
990
+ }
991
+ remove(e) {
992
+ var r;
993
+ const s = fe(e);
994
+ if (i(this, A).has(s)) {
995
+ const n = (r = i(this, A).get(s)) == null ? void 0 : r.filter((u) => u !== e);
996
+ n && (n.length === 0 ? i(this, A).delete(s) : i(this, A).set(s, n));
997
+ }
998
+ this.notify({ type: "removed", mutation: e });
999
+ }
1000
+ canRun(e) {
1001
+ var r;
1002
+ const s = (r = i(this, A).get(fe(e))) == null ? void 0 : r.find((n) => n.state.status === "pending");
1003
+ return !s || s === e;
1004
+ }
1005
+ runNext(e) {
1006
+ var r;
1007
+ const s = (r = i(this, A).get(fe(e))) == null ? void 0 : r.find((n) => n !== e && n.state.isPaused);
1008
+ return (s == null ? void 0 : s.continue()) ?? Promise.resolve();
1009
+ }
1010
+ clear() {
1011
+ C.batch(() => {
1012
+ this.getAll().forEach((e) => {
1013
+ this.remove(e);
1014
+ });
1015
+ });
1016
+ }
1017
+ getAll() {
1018
+ return [...i(this, A).values()].flat();
1019
+ }
1020
+ find(e) {
1021
+ const s = { exact: !0, ...e };
1022
+ return this.getAll().find(
1023
+ (r) => Ce(s, r)
1024
+ );
1025
+ }
1026
+ findAll(e = {}) {
1027
+ return this.getAll().filter((s) => Ce(e, s));
1028
+ }
1029
+ notify(e) {
1030
+ C.batch(() => {
1031
+ this.listeners.forEach((s) => {
1032
+ s(e);
1033
+ });
1034
+ });
1035
+ }
1036
+ resumePausedMutations() {
1037
+ const e = this.getAll().filter((s) => s.state.isPaused);
1038
+ return C.batch(
1039
+ () => Promise.all(
1040
+ e.map((s) => s.continue().catch(R))
1041
+ )
1042
+ );
1043
+ }
1044
+ }, A = new WeakMap(), ce = new WeakMap(), Ke);
1045
+ function fe(t) {
1046
+ var e;
1047
+ return ((e = t.options.scope) == null ? void 0 : e.id) ?? String(t.mutationId);
1048
+ }
1049
+ function Ee(t) {
1050
+ return {
1051
+ onFetch: (e, s) => {
1052
+ var m, d, y, q, S;
1053
+ const r = e.options, n = (y = (d = (m = e.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : y.direction, u = ((q = e.state.data) == null ? void 0 : q.pages) || [], h = ((S = e.state.data) == null ? void 0 : S.pageParams) || [];
1054
+ let a = { pages: [], pageParams: [] }, f = 0;
1055
+ const w = async () => {
1056
+ let c = !1;
1057
+ const p = (b) => {
1058
+ Object.defineProperty(b, "signal", {
1059
+ enumerable: !0,
1060
+ get: () => (e.signal.aborted ? c = !0 : e.signal.addEventListener("abort", () => {
1061
+ c = !0;
1062
+ }), e.signal)
1063
+ });
1064
+ }, D = xe(e.options, e.fetchOptions), M = async (b, E, k) => {
1065
+ if (c)
1066
+ return Promise.reject();
1067
+ if (E == null && b.pages.length)
1068
+ return Promise.resolve(b);
1069
+ const j = {
1070
+ queryKey: e.queryKey,
1071
+ pageParam: E,
1072
+ direction: k ? "backward" : "forward",
1073
+ meta: e.options.meta
1074
+ };
1075
+ p(j);
1076
+ const le = await D(
1077
+ j
1078
+ ), { maxPages: g } = e.options, $ = k ? st : tt;
1079
+ return {
1080
+ pages: $(b.pages, le, g),
1081
+ pageParams: $(b.pageParams, E, g)
1082
+ };
1083
+ };
1084
+ if (n && u.length) {
1085
+ const b = n === "backward", E = b ? pt : Ae, k = {
1086
+ pages: u,
1087
+ pageParams: h
1088
+ }, j = E(r, k);
1089
+ a = await M(k, j, b);
1090
+ } else {
1091
+ const b = t ?? u.length;
1092
+ do {
1093
+ const E = f === 0 ? h[0] ?? r.initialPageParam : Ae(r, a);
1094
+ if (f > 0 && E == null)
1095
+ break;
1096
+ a = await M(a, E), f++;
1097
+ } while (f < b);
1098
+ }
1099
+ return a;
1100
+ };
1101
+ e.options.persister ? e.fetchFn = () => {
1102
+ var c, p;
1103
+ return (p = (c = e.options).persister) == null ? void 0 : p.call(
1104
+ c,
1105
+ w,
1106
+ {
1107
+ queryKey: e.queryKey,
1108
+ meta: e.options.meta,
1109
+ signal: e.signal
1110
+ },
1111
+ s
1112
+ );
1113
+ } : e.fetchFn = w;
1114
+ }
1115
+ };
1116
+ }
1117
+ function Ae(t, { pages: e, pageParams: s }) {
1118
+ const r = e.length - 1;
1119
+ return e.length > 0 ? t.getNextPageParam(
1120
+ e[r],
1121
+ e,
1122
+ s[r],
1123
+ s
1124
+ ) : void 0;
1125
+ }
1126
+ function pt(t, { pages: e, pageParams: s }) {
1127
+ var r;
1128
+ return e.length > 0 ? (r = t.getPreviousPageParam) == null ? void 0 : r.call(t, e[0], e, s[0], s) : void 0;
1129
+ }
1130
+ var v, G, _, se, re, V, ie, ne, Ue, mt = (Ue = class {
1131
+ constructor(t = {}) {
1132
+ l(this, v, void 0);
1133
+ l(this, G, void 0);
1134
+ l(this, _, void 0);
1135
+ l(this, se, void 0);
1136
+ l(this, re, void 0);
1137
+ l(this, V, void 0);
1138
+ l(this, ie, void 0);
1139
+ l(this, ne, void 0);
1140
+ o(this, v, t.queryCache || new lt()), o(this, G, t.mutationCache || new yt()), o(this, _, t.defaultOptions || {}), o(this, se, /* @__PURE__ */ new Map()), o(this, re, /* @__PURE__ */ new Map()), o(this, V, 0);
1141
+ }
1142
+ mount() {
1143
+ de(this, V)._++, i(this, V) === 1 && (o(this, ie, He.subscribe(async (t) => {
1144
+ t && (await this.resumePausedMutations(), i(this, v).onFocus());
1145
+ })), o(this, ne, pe.subscribe(async (t) => {
1146
+ t && (await this.resumePausedMutations(), i(this, v).onOnline());
1147
+ })));
1148
+ }
1149
+ unmount() {
1150
+ var t, e;
1151
+ de(this, V)._--, i(this, V) === 0 && ((t = i(this, ie)) == null || t.call(this), o(this, ie, void 0), (e = i(this, ne)) == null || e.call(this), o(this, ne, void 0));
1152
+ }
1153
+ isFetching(t) {
1154
+ return i(this, v).findAll({ ...t, fetchStatus: "fetching" }).length;
1155
+ }
1156
+ isMutating(t) {
1157
+ return i(this, G).findAll({ ...t, status: "pending" }).length;
1158
+ }
1159
+ getQueryData(t) {
1160
+ var s;
1161
+ const e = this.defaultQueryOptions({ queryKey: t });
1162
+ return (s = i(this, v).get(e.queryHash)) == null ? void 0 : s.state.data;
1163
+ }
1164
+ ensureQueryData(t) {
1165
+ const e = this.getQueryData(t.queryKey);
1166
+ if (e === void 0)
1167
+ return this.fetchQuery(t);
1168
+ {
1169
+ const s = this.defaultQueryOptions(t), r = i(this, v).build(this, s);
1170
+ return t.revalidateIfStale && r.isStaleByTime(Se(s.staleTime, r)) && this.prefetchQuery(s), Promise.resolve(e);
1171
+ }
1172
+ }
1173
+ getQueriesData(t) {
1174
+ return i(this, v).findAll(t).map(({ queryKey: e, state: s }) => {
1175
+ const r = s.data;
1176
+ return [e, r];
1177
+ });
1178
+ }
1179
+ setQueryData(t, e, s) {
1180
+ const r = this.defaultQueryOptions({ queryKey: t }), n = i(this, v).get(
1181
+ r.queryHash
1182
+ ), u = n == null ? void 0 : n.state.data, h = Je(e, u);
1183
+ if (h !== void 0)
1184
+ return i(this, v).build(this, r).setData(h, { ...s, manual: !0 });
1185
+ }
1186
+ setQueriesData(t, e, s) {
1187
+ return C.batch(
1188
+ () => i(this, v).findAll(t).map(({ queryKey: r }) => [
1189
+ r,
1190
+ this.setQueryData(r, e, s)
1191
+ ])
1192
+ );
1193
+ }
1194
+ getQueryState(t) {
1195
+ var s;
1196
+ const e = this.defaultQueryOptions({ queryKey: t });
1197
+ return (s = i(this, v).get(e.queryHash)) == null ? void 0 : s.state;
1198
+ }
1199
+ removeQueries(t) {
1200
+ const e = i(this, v);
1201
+ C.batch(() => {
1202
+ e.findAll(t).forEach((s) => {
1203
+ e.remove(s);
1204
+ });
1205
+ });
1206
+ }
1207
+ resetQueries(t, e) {
1208
+ const s = i(this, v), r = {
1209
+ type: "active",
1210
+ ...t
1211
+ };
1212
+ return C.batch(() => (s.findAll(t).forEach((n) => {
1213
+ n.reset();
1214
+ }), this.refetchQueries(r, e)));
1215
+ }
1216
+ cancelQueries(t = {}, e = {}) {
1217
+ const s = { revert: !0, ...e }, r = C.batch(
1218
+ () => i(this, v).findAll(t).map((n) => n.cancel(s))
1219
+ );
1220
+ return Promise.all(r).then(R).catch(R);
1221
+ }
1222
+ invalidateQueries(t = {}, e = {}) {
1223
+ return C.batch(() => {
1224
+ if (i(this, v).findAll(t).forEach((r) => {
1225
+ r.invalidate();
1226
+ }), t.refetchType === "none")
1227
+ return Promise.resolve();
1228
+ const s = {
1229
+ ...t,
1230
+ type: t.refetchType ?? t.type ?? "active"
1231
+ };
1232
+ return this.refetchQueries(s, e);
1233
+ });
1234
+ }
1235
+ refetchQueries(t = {}, e) {
1236
+ const s = {
1237
+ ...e,
1238
+ cancelRefetch: (e == null ? void 0 : e.cancelRefetch) ?? !0
1239
+ }, r = C.batch(
1240
+ () => i(this, v).findAll(t).filter((n) => !n.isDisabled()).map((n) => {
1241
+ let u = n.fetch(void 0, s);
1242
+ return s.throwOnError || (u = u.catch(R)), n.state.fetchStatus === "paused" ? Promise.resolve() : u;
1243
+ })
1244
+ );
1245
+ return Promise.all(r).then(R);
1246
+ }
1247
+ fetchQuery(t) {
1248
+ const e = this.defaultQueryOptions(t);
1249
+ e.retry === void 0 && (e.retry = !1);
1250
+ const s = i(this, v).build(this, e);
1251
+ return s.isStaleByTime(
1252
+ Se(e.staleTime, s)
1253
+ ) ? s.fetch(e) : Promise.resolve(s.state.data);
1254
+ }
1255
+ prefetchQuery(t) {
1256
+ return this.fetchQuery(t).then(R).catch(R);
1257
+ }
1258
+ fetchInfiniteQuery(t) {
1259
+ return t.behavior = Ee(t.pages), this.fetchQuery(t);
1260
+ }
1261
+ prefetchInfiniteQuery(t) {
1262
+ return this.fetchInfiniteQuery(t).then(R).catch(R);
1263
+ }
1264
+ ensureInfiniteQueryData(t) {
1265
+ return t.behavior = Ee(t.pages), this.ensureQueryData(t);
1266
+ }
1267
+ resumePausedMutations() {
1268
+ return pe.isOnline() ? i(this, G).resumePausedMutations() : Promise.resolve();
1269
+ }
1270
+ getQueryCache() {
1271
+ return i(this, v);
1272
+ }
1273
+ getMutationCache() {
1274
+ return i(this, G);
1275
+ }
1276
+ getDefaultOptions() {
1277
+ return i(this, _);
1278
+ }
1279
+ setDefaultOptions(t) {
1280
+ o(this, _, t);
1281
+ }
1282
+ setQueryDefaults(t, e) {
1283
+ i(this, se).set(ue(t), {
1284
+ queryKey: t,
1285
+ defaultOptions: e
1286
+ });
1287
+ }
1288
+ getQueryDefaults(t) {
1289
+ const e = [...i(this, se).values()];
1290
+ let s = {};
1291
+ return e.forEach((r) => {
1292
+ oe(t, r.queryKey) && (s = { ...s, ...r.defaultOptions });
1293
+ }), s;
1294
+ }
1295
+ setMutationDefaults(t, e) {
1296
+ i(this, re).set(ue(t), {
1297
+ mutationKey: t,
1298
+ defaultOptions: e
1299
+ });
1300
+ }
1301
+ getMutationDefaults(t) {
1302
+ const e = [...i(this, re).values()];
1303
+ let s = {};
1304
+ return e.forEach((r) => {
1305
+ oe(t, r.mutationKey) && (s = { ...s, ...r.defaultOptions });
1306
+ }), s;
1307
+ }
1308
+ defaultQueryOptions(t) {
1309
+ if (t._defaulted)
1310
+ return t;
1311
+ const e = {
1312
+ ...i(this, _).queries,
1313
+ ...this.getQueryDefaults(t.queryKey),
1314
+ ...t,
1315
+ _defaulted: !0
1316
+ };
1317
+ return e.queryHash || (e.queryHash = Oe(
1318
+ e.queryKey,
1319
+ e
1320
+ )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.enabled !== !0 && e.queryFn === ye && (e.enabled = !1), e;
1321
+ }
1322
+ defaultMutationOptions(t) {
1323
+ return t != null && t._defaulted ? t : {
1324
+ ...i(this, _).mutations,
1325
+ ...(t == null ? void 0 : t.mutationKey) && this.getMutationDefaults(t.mutationKey),
1326
+ ...t,
1327
+ _defaulted: !0
1328
+ };
1329
+ }
1330
+ clear() {
1331
+ i(this, v).clear(), i(this, G).clear();
1332
+ }
1333
+ }, v = new WeakMap(), G = new WeakMap(), _ = new WeakMap(), se = new WeakMap(), re = new WeakMap(), V = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), Ue), vt = Ie.createContext(
1334
+ void 0
1335
+ ), bt = ({
1336
+ client: t,
1337
+ children: e
1338
+ }) => (Ie.useEffect(() => (t.mount(), () => {
1339
+ t.unmount();
1340
+ }), [t]), /* @__PURE__ */ ae(vt.Provider, { value: t, children: e }));
1341
+ const gt = new mt(), qt = (t) => {
1342
+ const { children: e, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: u, ...h } = t, { workerUrlAdded: a } = ze(n);
1343
+ return /* @__PURE__ */ ae(bt, { client: gt, children: /* @__PURE__ */ ae(Be, { licenseKey: u, children: /* @__PURE__ */ ae($e, { workerUrlAdded: a, ...h, children: /* @__PURE__ */ ae(Ve, { customDarkVariables: r, customVariables: s, children: e }) }) }) });
1344
+ };
1345
+ export {
1346
+ qt as RPConfig
1347
+ };