@tanstack/preact-query 5.101.4 → 5.102.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 (400) hide show
  1. package/README.md +15 -1
  2. package/build/legacy/HydrationBoundary.cjs +35 -79
  3. package/build/legacy/HydrationBoundary.cjs.map +1 -1
  4. package/build/legacy/HydrationBoundary.d.cts +15 -2
  5. package/build/legacy/HydrationBoundary.d.cts.map +1 -0
  6. package/build/legacy/HydrationBoundary.d.ts +15 -2
  7. package/build/legacy/HydrationBoundary.d.ts.map +1 -0
  8. package/build/legacy/HydrationBoundary.js +31 -51
  9. package/build/legacy/HydrationBoundary.js.map +1 -1
  10. package/build/legacy/IsRestoringProvider.cjs +10 -35
  11. package/build/legacy/IsRestoringProvider.cjs.map +1 -1
  12. package/build/legacy/IsRestoringProvider.d.cts +6 -2
  13. package/build/legacy/IsRestoringProvider.d.cts.map +1 -0
  14. package/build/legacy/IsRestoringProvider.d.ts +6 -2
  15. package/build/legacy/IsRestoringProvider.d.ts.map +1 -0
  16. package/build/legacy/IsRestoringProvider.js +7 -8
  17. package/build/legacy/IsRestoringProvider.js.map +1 -1
  18. package/build/legacy/QueryClientProvider.cjs +26 -58
  19. package/build/legacy/QueryClientProvider.cjs.map +1 -1
  20. package/build/legacy/QueryClientProvider.d.cts +13 -4
  21. package/build/legacy/QueryClientProvider.d.cts.map +1 -0
  22. package/build/legacy/QueryClientProvider.d.ts +13 -4
  23. package/build/legacy/QueryClientProvider.d.ts.map +1 -0
  24. package/build/legacy/QueryClientProvider.js +21 -29
  25. package/build/legacy/QueryClientProvider.js.map +1 -1
  26. package/build/legacy/QueryErrorResetBoundary.cjs +29 -53
  27. package/build/legacy/QueryErrorResetBoundary.cjs.map +1 -1
  28. package/build/legacy/QueryErrorResetBoundary.d.cts +19 -8
  29. package/build/legacy/QueryErrorResetBoundary.d.cts.map +1 -0
  30. package/build/legacy/QueryErrorResetBoundary.d.ts +19 -8
  31. package/build/legacy/QueryErrorResetBoundary.d.ts.map +1 -0
  32. package/build/legacy/QueryErrorResetBoundary.js +24 -24
  33. package/build/legacy/QueryErrorResetBoundary.js.map +1 -1
  34. package/build/legacy/errorBoundaryUtils.cjs +20 -53
  35. package/build/legacy/errorBoundaryUtils.cjs.map +1 -1
  36. package/build/legacy/errorBoundaryUtils.d.cts +15 -3
  37. package/build/legacy/errorBoundaryUtils.d.cts.map +1 -0
  38. package/build/legacy/errorBoundaryUtils.d.ts +15 -3
  39. package/build/legacy/errorBoundaryUtils.d.ts.map +1 -0
  40. package/build/legacy/errorBoundaryUtils.js +15 -24
  41. package/build/legacy/errorBoundaryUtils.js.map +1 -1
  42. package/build/legacy/index.cjs +55 -95
  43. package/build/legacy/index.cjs.map +1 -1
  44. package/build/legacy/index.d.cts +21 -205
  45. package/build/legacy/index.d.ts +21 -205
  46. package/build/legacy/index.js +11 -39
  47. package/build/legacy/index.js.map +1 -1
  48. package/build/legacy/infiniteQueryOptions.cjs +6 -30
  49. package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
  50. package/build/legacy/infiniteQueryOptions.d.cts +18 -4
  51. package/build/legacy/infiniteQueryOptions.d.cts.map +1 -0
  52. package/build/legacy/infiniteQueryOptions.d.ts +18 -4
  53. package/build/legacy/infiniteQueryOptions.d.ts.map +1 -0
  54. package/build/legacy/infiniteQueryOptions.js +5 -5
  55. package/build/legacy/infiniteQueryOptions.js.map +1 -1
  56. package/build/legacy/mutationOptions.cjs +6 -30
  57. package/build/legacy/mutationOptions.cjs.map +1 -1
  58. package/build/legacy/mutationOptions.d.cts +8 -1
  59. package/build/legacy/mutationOptions.d.cts.map +1 -0
  60. package/build/legacy/mutationOptions.d.ts +8 -1
  61. package/build/legacy/mutationOptions.d.ts.map +1 -0
  62. package/build/legacy/mutationOptions.js +5 -5
  63. package/build/legacy/mutationOptions.js.map +1 -1
  64. package/build/legacy/queryOptions.cjs +6 -30
  65. package/build/legacy/queryOptions.cjs.map +1 -1
  66. package/build/legacy/queryOptions.d.cts +19 -4
  67. package/build/legacy/queryOptions.d.cts.map +1 -0
  68. package/build/legacy/queryOptions.d.ts +19 -4
  69. package/build/legacy/queryOptions.d.ts.map +1 -0
  70. package/build/legacy/queryOptions.js +5 -5
  71. package/build/legacy/queryOptions.js.map +1 -1
  72. package/build/legacy/suspense.cjs +20 -55
  73. package/build/legacy/suspense.cjs.map +1 -1
  74. package/build/legacy/suspense.d.cts +10 -5
  75. package/build/legacy/suspense.d.cts.map +1 -0
  76. package/build/legacy/suspense.d.ts +10 -5
  77. package/build/legacy/suspense.d.ts.map +1 -0
  78. package/build/legacy/suspense.js +16 -26
  79. package/build/legacy/suspense.js.map +1 -1
  80. package/build/legacy/types.cjs +3 -17
  81. package/build/legacy/types.cjs.map +1 -1
  82. package/build/legacy/types.d.cts +54 -24
  83. package/build/legacy/types.d.cts.map +1 -0
  84. package/build/legacy/types.d.ts +54 -24
  85. package/build/legacy/types.d.ts.map +1 -0
  86. package/build/legacy/types.js +5 -0
  87. package/build/legacy/types.js.map +1 -1
  88. package/build/legacy/useBaseQuery.cjs +48 -118
  89. package/build/legacy/useBaseQuery.cjs.map +1 -1
  90. package/build/legacy/useBaseQuery.d.cts +7 -1
  91. package/build/legacy/useBaseQuery.d.cts.map +1 -0
  92. package/build/legacy/useBaseQuery.d.ts +7 -1
  93. package/build/legacy/useBaseQuery.d.ts.map +1 -0
  94. package/build/legacy/useBaseQuery.js +44 -99
  95. package/build/legacy/useBaseQuery.js.map +1 -1
  96. package/build/legacy/useInfiniteQuery.cjs +8 -36
  97. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  98. package/build/legacy/useInfiniteQuery.d.cts +10 -1
  99. package/build/legacy/useInfiniteQuery.d.cts.map +1 -0
  100. package/build/legacy/useInfiniteQuery.d.ts +10 -1
  101. package/build/legacy/useInfiniteQuery.d.ts.map +1 -0
  102. package/build/legacy/useInfiniteQuery.js +6 -10
  103. package/build/legacy/useInfiniteQuery.js.map +1 -1
  104. package/build/legacy/useIsFetching.cjs +12 -42
  105. package/build/legacy/useIsFetching.cjs.map +1 -1
  106. package/build/legacy/useIsFetching.d.cts +6 -1
  107. package/build/legacy/useIsFetching.d.cts.map +1 -0
  108. package/build/legacy/useIsFetching.d.ts +6 -1
  109. package/build/legacy/useIsFetching.d.ts.map +1 -0
  110. package/build/legacy/useIsFetching.js +9 -15
  111. package/build/legacy/useIsFetching.js.map +1 -1
  112. package/build/legacy/useMutation.cjs +24 -60
  113. package/build/legacy/useMutation.cjs.map +1 -1
  114. package/build/legacy/useMutation.d.cts +7 -1
  115. package/build/legacy/useMutation.d.cts.map +1 -0
  116. package/build/legacy/useMutation.d.ts +7 -1
  117. package/build/legacy/useMutation.d.ts.map +1 -0
  118. package/build/legacy/useMutation.js +21 -38
  119. package/build/legacy/useMutation.js.map +1 -1
  120. package/build/legacy/useMutationState.cjs +30 -68
  121. package/build/legacy/useMutationState.cjs.map +1 -1
  122. package/build/legacy/useMutationState.d.cts +12 -2
  123. package/build/legacy/useMutationState.d.cts.map +1 -0
  124. package/build/legacy/useMutationState.d.ts +12 -2
  125. package/build/legacy/useMutationState.d.ts.map +1 -0
  126. package/build/legacy/useMutationState.js +26 -40
  127. package/build/legacy/useMutationState.js.map +1 -1
  128. package/build/legacy/usePrefetchInfiniteQuery.cjs +9 -34
  129. package/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -1
  130. package/build/legacy/usePrefetchInfiniteQuery.d.cts +7 -1
  131. package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -0
  132. package/build/legacy/usePrefetchInfiniteQuery.d.ts +7 -1
  133. package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -0
  134. package/build/legacy/usePrefetchInfiniteQuery.js +7 -8
  135. package/build/legacy/usePrefetchInfiniteQuery.js.map +1 -1
  136. package/build/legacy/usePrefetchQuery.cjs +9 -34
  137. package/build/legacy/usePrefetchQuery.cjs.map +1 -1
  138. package/build/legacy/usePrefetchQuery.d.cts +7 -1
  139. package/build/legacy/usePrefetchQuery.d.cts.map +1 -0
  140. package/build/legacy/usePrefetchQuery.d.ts +7 -1
  141. package/build/legacy/usePrefetchQuery.d.ts.map +1 -0
  142. package/build/legacy/usePrefetchQuery.js +7 -8
  143. package/build/legacy/usePrefetchQuery.js.map +1 -1
  144. package/build/legacy/useQueries.cjs +64 -114
  145. package/build/legacy/useQueries.cjs.map +1 -1
  146. package/build/legacy/useQueries.d.cts +57 -3
  147. package/build/legacy/useQueries.d.cts.map +1 -0
  148. package/build/legacy/useQueries.d.ts +57 -3
  149. package/build/legacy/useQueries.d.ts.map +1 -0
  150. package/build/legacy/useQueries.js +60 -99
  151. package/build/legacy/useQueries.js.map +1 -1
  152. package/build/legacy/useQuery.cjs +8 -32
  153. package/build/legacy/useQuery.cjs.map +1 -1
  154. package/build/legacy/useQuery.d.cts +10 -1
  155. package/build/legacy/useQuery.d.cts.map +1 -0
  156. package/build/legacy/useQuery.d.ts +10 -1
  157. package/build/legacy/useQuery.d.ts.map +1 -0
  158. package/build/legacy/useQuery.js +6 -6
  159. package/build/legacy/useQuery.js.map +1 -1
  160. package/build/legacy/useSuspenseInfiniteQuery.cjs +18 -47
  161. package/build/legacy/useSuspenseInfiniteQuery.cjs.map +1 -1
  162. package/build/legacy/useSuspenseInfiniteQuery.d.cts +7 -1
  163. package/build/legacy/useSuspenseInfiniteQuery.d.cts.map +1 -0
  164. package/build/legacy/useSuspenseInfiniteQuery.d.ts +7 -1
  165. package/build/legacy/useSuspenseInfiniteQuery.d.ts.map +1 -0
  166. package/build/legacy/useSuspenseInfiniteQuery.js +15 -20
  167. package/build/legacy/useSuspenseInfiniteQuery.js.map +1 -1
  168. package/build/legacy/useSuspenseQueries.cjs +23 -52
  169. package/build/legacy/useSuspenseQueries.cjs.map +1 -1
  170. package/build/legacy/useSuspenseQueries.d.cts +60 -3
  171. package/build/legacy/useSuspenseQueries.d.cts.map +1 -0
  172. package/build/legacy/useSuspenseQueries.d.ts +60 -3
  173. package/build/legacy/useSuspenseQueries.d.ts.map +1 -0
  174. package/build/legacy/useSuspenseQueries.js +20 -25
  175. package/build/legacy/useSuspenseQueries.js.map +1 -1
  176. package/build/legacy/useSuspenseQuery.cjs +18 -48
  177. package/build/legacy/useSuspenseQuery.cjs.map +1 -1
  178. package/build/legacy/useSuspenseQuery.d.cts +7 -1
  179. package/build/legacy/useSuspenseQuery.d.cts.map +1 -0
  180. package/build/legacy/useSuspenseQuery.d.ts +7 -1
  181. package/build/legacy/useSuspenseQuery.d.ts.map +1 -0
  182. package/build/legacy/useSuspenseQuery.js +15 -21
  183. package/build/legacy/useSuspenseQuery.js.map +1 -1
  184. package/build/legacy/utils.cjs +43 -72
  185. package/build/legacy/utils.cjs.map +1 -1
  186. package/build/legacy/utils.d.cts +6 -2
  187. package/build/legacy/utils.d.cts.map +1 -0
  188. package/build/legacy/utils.d.ts +6 -2
  189. package/build/legacy/utils.d.ts.map +1 -0
  190. package/build/legacy/utils.js +40 -45
  191. package/build/legacy/utils.js.map +1 -1
  192. package/build/modern/HydrationBoundary.cjs +35 -79
  193. package/build/modern/HydrationBoundary.cjs.map +1 -1
  194. package/build/modern/HydrationBoundary.d.cts +15 -2
  195. package/build/modern/HydrationBoundary.d.cts.map +1 -0
  196. package/build/modern/HydrationBoundary.d.ts +15 -2
  197. package/build/modern/HydrationBoundary.d.ts.map +1 -0
  198. package/build/modern/HydrationBoundary.js +31 -51
  199. package/build/modern/HydrationBoundary.js.map +1 -1
  200. package/build/modern/IsRestoringProvider.cjs +10 -35
  201. package/build/modern/IsRestoringProvider.cjs.map +1 -1
  202. package/build/modern/IsRestoringProvider.d.cts +6 -2
  203. package/build/modern/IsRestoringProvider.d.cts.map +1 -0
  204. package/build/modern/IsRestoringProvider.d.ts +6 -2
  205. package/build/modern/IsRestoringProvider.d.ts.map +1 -0
  206. package/build/modern/IsRestoringProvider.js +7 -8
  207. package/build/modern/IsRestoringProvider.js.map +1 -1
  208. package/build/modern/QueryClientProvider.cjs +26 -58
  209. package/build/modern/QueryClientProvider.cjs.map +1 -1
  210. package/build/modern/QueryClientProvider.d.cts +13 -4
  211. package/build/modern/QueryClientProvider.d.cts.map +1 -0
  212. package/build/modern/QueryClientProvider.d.ts +13 -4
  213. package/build/modern/QueryClientProvider.d.ts.map +1 -0
  214. package/build/modern/QueryClientProvider.js +21 -29
  215. package/build/modern/QueryClientProvider.js.map +1 -1
  216. package/build/modern/QueryErrorResetBoundary.cjs +29 -53
  217. package/build/modern/QueryErrorResetBoundary.cjs.map +1 -1
  218. package/build/modern/QueryErrorResetBoundary.d.cts +19 -8
  219. package/build/modern/QueryErrorResetBoundary.d.cts.map +1 -0
  220. package/build/modern/QueryErrorResetBoundary.d.ts +19 -8
  221. package/build/modern/QueryErrorResetBoundary.d.ts.map +1 -0
  222. package/build/modern/QueryErrorResetBoundary.js +24 -24
  223. package/build/modern/QueryErrorResetBoundary.js.map +1 -1
  224. package/build/modern/errorBoundaryUtils.cjs +20 -53
  225. package/build/modern/errorBoundaryUtils.cjs.map +1 -1
  226. package/build/modern/errorBoundaryUtils.d.cts +15 -3
  227. package/build/modern/errorBoundaryUtils.d.cts.map +1 -0
  228. package/build/modern/errorBoundaryUtils.d.ts +15 -3
  229. package/build/modern/errorBoundaryUtils.d.ts.map +1 -0
  230. package/build/modern/errorBoundaryUtils.js +15 -24
  231. package/build/modern/errorBoundaryUtils.js.map +1 -1
  232. package/build/modern/index.cjs +55 -95
  233. package/build/modern/index.cjs.map +1 -1
  234. package/build/modern/index.d.cts +21 -205
  235. package/build/modern/index.d.ts +21 -205
  236. package/build/modern/index.js +11 -39
  237. package/build/modern/index.js.map +1 -1
  238. package/build/modern/infiniteQueryOptions.cjs +6 -30
  239. package/build/modern/infiniteQueryOptions.cjs.map +1 -1
  240. package/build/modern/infiniteQueryOptions.d.cts +18 -4
  241. package/build/modern/infiniteQueryOptions.d.cts.map +1 -0
  242. package/build/modern/infiniteQueryOptions.d.ts +18 -4
  243. package/build/modern/infiniteQueryOptions.d.ts.map +1 -0
  244. package/build/modern/infiniteQueryOptions.js +5 -5
  245. package/build/modern/infiniteQueryOptions.js.map +1 -1
  246. package/build/modern/mutationOptions.cjs +6 -30
  247. package/build/modern/mutationOptions.cjs.map +1 -1
  248. package/build/modern/mutationOptions.d.cts +8 -1
  249. package/build/modern/mutationOptions.d.cts.map +1 -0
  250. package/build/modern/mutationOptions.d.ts +8 -1
  251. package/build/modern/mutationOptions.d.ts.map +1 -0
  252. package/build/modern/mutationOptions.js +5 -5
  253. package/build/modern/mutationOptions.js.map +1 -1
  254. package/build/modern/queryOptions.cjs +6 -30
  255. package/build/modern/queryOptions.cjs.map +1 -1
  256. package/build/modern/queryOptions.d.cts +19 -4
  257. package/build/modern/queryOptions.d.cts.map +1 -0
  258. package/build/modern/queryOptions.d.ts +19 -4
  259. package/build/modern/queryOptions.d.ts.map +1 -0
  260. package/build/modern/queryOptions.js +5 -5
  261. package/build/modern/queryOptions.js.map +1 -1
  262. package/build/modern/suspense.cjs +20 -55
  263. package/build/modern/suspense.cjs.map +1 -1
  264. package/build/modern/suspense.d.cts +10 -5
  265. package/build/modern/suspense.d.cts.map +1 -0
  266. package/build/modern/suspense.d.ts +10 -5
  267. package/build/modern/suspense.d.ts.map +1 -0
  268. package/build/modern/suspense.js +16 -26
  269. package/build/modern/suspense.js.map +1 -1
  270. package/build/modern/types.cjs +3 -17
  271. package/build/modern/types.cjs.map +1 -1
  272. package/build/modern/types.d.cts +54 -24
  273. package/build/modern/types.d.cts.map +1 -0
  274. package/build/modern/types.d.ts +54 -24
  275. package/build/modern/types.d.ts.map +1 -0
  276. package/build/modern/types.js +5 -0
  277. package/build/modern/types.js.map +1 -1
  278. package/build/modern/useBaseQuery.cjs +48 -115
  279. package/build/modern/useBaseQuery.cjs.map +1 -1
  280. package/build/modern/useBaseQuery.d.cts +7 -1
  281. package/build/modern/useBaseQuery.d.cts.map +1 -0
  282. package/build/modern/useBaseQuery.d.ts +7 -1
  283. package/build/modern/useBaseQuery.d.ts.map +1 -0
  284. package/build/modern/useBaseQuery.js +44 -96
  285. package/build/modern/useBaseQuery.js.map +1 -1
  286. package/build/modern/useInfiniteQuery.cjs +8 -36
  287. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  288. package/build/modern/useInfiniteQuery.d.cts +10 -1
  289. package/build/modern/useInfiniteQuery.d.cts.map +1 -0
  290. package/build/modern/useInfiniteQuery.d.ts +10 -1
  291. package/build/modern/useInfiniteQuery.d.ts.map +1 -0
  292. package/build/modern/useInfiniteQuery.js +6 -10
  293. package/build/modern/useInfiniteQuery.js.map +1 -1
  294. package/build/modern/useIsFetching.cjs +12 -42
  295. package/build/modern/useIsFetching.cjs.map +1 -1
  296. package/build/modern/useIsFetching.d.cts +6 -1
  297. package/build/modern/useIsFetching.d.cts.map +1 -0
  298. package/build/modern/useIsFetching.d.ts +6 -1
  299. package/build/modern/useIsFetching.d.ts.map +1 -0
  300. package/build/modern/useIsFetching.js +9 -15
  301. package/build/modern/useIsFetching.js.map +1 -1
  302. package/build/modern/useMutation.cjs +24 -60
  303. package/build/modern/useMutation.cjs.map +1 -1
  304. package/build/modern/useMutation.d.cts +7 -1
  305. package/build/modern/useMutation.d.cts.map +1 -0
  306. package/build/modern/useMutation.d.ts +7 -1
  307. package/build/modern/useMutation.d.ts.map +1 -0
  308. package/build/modern/useMutation.js +21 -38
  309. package/build/modern/useMutation.js.map +1 -1
  310. package/build/modern/useMutationState.cjs +30 -68
  311. package/build/modern/useMutationState.cjs.map +1 -1
  312. package/build/modern/useMutationState.d.cts +12 -2
  313. package/build/modern/useMutationState.d.cts.map +1 -0
  314. package/build/modern/useMutationState.d.ts +12 -2
  315. package/build/modern/useMutationState.d.ts.map +1 -0
  316. package/build/modern/useMutationState.js +26 -40
  317. package/build/modern/useMutationState.js.map +1 -1
  318. package/build/modern/usePrefetchInfiniteQuery.cjs +9 -34
  319. package/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -1
  320. package/build/modern/usePrefetchInfiniteQuery.d.cts +7 -1
  321. package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -0
  322. package/build/modern/usePrefetchInfiniteQuery.d.ts +7 -1
  323. package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -0
  324. package/build/modern/usePrefetchInfiniteQuery.js +7 -8
  325. package/build/modern/usePrefetchInfiniteQuery.js.map +1 -1
  326. package/build/modern/usePrefetchQuery.cjs +9 -34
  327. package/build/modern/usePrefetchQuery.cjs.map +1 -1
  328. package/build/modern/usePrefetchQuery.d.cts +7 -1
  329. package/build/modern/usePrefetchQuery.d.cts.map +1 -0
  330. package/build/modern/usePrefetchQuery.d.ts +7 -1
  331. package/build/modern/usePrefetchQuery.d.ts.map +1 -0
  332. package/build/modern/usePrefetchQuery.js +7 -8
  333. package/build/modern/usePrefetchQuery.js.map +1 -1
  334. package/build/modern/useQueries.cjs +64 -114
  335. package/build/modern/useQueries.cjs.map +1 -1
  336. package/build/modern/useQueries.d.cts +57 -3
  337. package/build/modern/useQueries.d.cts.map +1 -0
  338. package/build/modern/useQueries.d.ts +57 -3
  339. package/build/modern/useQueries.d.ts.map +1 -0
  340. package/build/modern/useQueries.js +60 -99
  341. package/build/modern/useQueries.js.map +1 -1
  342. package/build/modern/useQuery.cjs +8 -32
  343. package/build/modern/useQuery.cjs.map +1 -1
  344. package/build/modern/useQuery.d.cts +10 -1
  345. package/build/modern/useQuery.d.cts.map +1 -0
  346. package/build/modern/useQuery.d.ts +10 -1
  347. package/build/modern/useQuery.d.ts.map +1 -0
  348. package/build/modern/useQuery.js +6 -6
  349. package/build/modern/useQuery.js.map +1 -1
  350. package/build/modern/useSuspenseInfiniteQuery.cjs +18 -47
  351. package/build/modern/useSuspenseInfiniteQuery.cjs.map +1 -1
  352. package/build/modern/useSuspenseInfiniteQuery.d.cts +7 -1
  353. package/build/modern/useSuspenseInfiniteQuery.d.cts.map +1 -0
  354. package/build/modern/useSuspenseInfiniteQuery.d.ts +7 -1
  355. package/build/modern/useSuspenseInfiniteQuery.d.ts.map +1 -0
  356. package/build/modern/useSuspenseInfiniteQuery.js +15 -20
  357. package/build/modern/useSuspenseInfiniteQuery.js.map +1 -1
  358. package/build/modern/useSuspenseQueries.cjs +23 -52
  359. package/build/modern/useSuspenseQueries.cjs.map +1 -1
  360. package/build/modern/useSuspenseQueries.d.cts +60 -3
  361. package/build/modern/useSuspenseQueries.d.cts.map +1 -0
  362. package/build/modern/useSuspenseQueries.d.ts +60 -3
  363. package/build/modern/useSuspenseQueries.d.ts.map +1 -0
  364. package/build/modern/useSuspenseQueries.js +20 -25
  365. package/build/modern/useSuspenseQueries.js.map +1 -1
  366. package/build/modern/useSuspenseQuery.cjs +18 -48
  367. package/build/modern/useSuspenseQuery.cjs.map +1 -1
  368. package/build/modern/useSuspenseQuery.d.cts +7 -1
  369. package/build/modern/useSuspenseQuery.d.cts.map +1 -0
  370. package/build/modern/useSuspenseQuery.d.ts +7 -1
  371. package/build/modern/useSuspenseQuery.d.ts.map +1 -0
  372. package/build/modern/useSuspenseQuery.js +15 -21
  373. package/build/modern/useSuspenseQuery.js.map +1 -1
  374. package/build/modern/utils.cjs +43 -72
  375. package/build/modern/utils.cjs.map +1 -1
  376. package/build/modern/utils.d.cts +6 -2
  377. package/build/modern/utils.d.cts.map +1 -0
  378. package/build/modern/utils.d.ts +6 -2
  379. package/build/modern/utils.d.ts.map +1 -0
  380. package/build/modern/utils.js +40 -45
  381. package/build/modern/utils.js.map +1 -1
  382. package/build/query-codemods/root.eslint.config.js +1 -1
  383. package/package.json +7 -9
  384. package/src/errorBoundaryUtils.ts +7 -5
  385. package/src/infiniteQueryOptions.ts +7 -10
  386. package/src/queryOptions.ts +7 -10
  387. package/src/suspense.ts +0 -5
  388. package/src/types.ts +47 -10
  389. package/src/useBaseQuery.ts +11 -41
  390. package/src/useMutation.ts +6 -2
  391. package/src/useMutationState.ts +32 -7
  392. package/src/usePrefetchInfiniteQuery.tsx +6 -9
  393. package/src/usePrefetchQuery.tsx +12 -4
  394. package/src/useQueries.ts +4 -3
  395. package/src/useQuery.ts +3 -3
  396. package/src/useSuspenseInfiniteQuery.ts +1 -0
  397. package/build/legacy/_tsup-dts-rollup.d.cts +0 -954
  398. package/build/legacy/_tsup-dts-rollup.d.ts +0 -954
  399. package/build/modern/_tsup-dts-rollup.d.cts +0 -954
  400. package/build/modern/_tsup-dts-rollup.d.ts +0 -954
@@ -1,79 +1,50 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/utils.ts
21
- var utils_exports = {};
22
- __export(utils_exports, {
23
- useSyncExternalStore: () => useSyncExternalStore,
24
- useSyncExternalStoreWithSelector: () => useSyncExternalStoreWithSelector
25
- });
26
- module.exports = __toCommonJS(utils_exports);
27
- var import_hooks = require("preact/hooks");
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let preact_hooks = require("preact/hooks");
3
+ //#region src/utils.ts
28
4
  function useSyncExternalStore(subscribe, getSnapshot) {
29
- const value = getSnapshot();
30
- const [{ _instance }, forceUpdate] = (0, import_hooks.useState)({
31
- _instance: { _value: value, _getSnapshot: getSnapshot }
32
- });
33
- (0, import_hooks.useLayoutEffect)(() => {
34
- _instance._value = value;
35
- _instance._getSnapshot = getSnapshot;
36
- if (didSnapshotChange(_instance)) {
37
- forceUpdate({ _instance });
38
- }
39
- }, [subscribe, value, getSnapshot]);
40
- (0, import_hooks.useEffect)(() => {
41
- if (didSnapshotChange(_instance)) {
42
- forceUpdate({ _instance });
43
- }
44
- return subscribe(() => {
45
- if (didSnapshotChange(_instance)) {
46
- forceUpdate({ _instance });
47
- }
48
- });
49
- }, [subscribe]);
50
- return value;
5
+ const value = getSnapshot();
6
+ const [{ _instance }, forceUpdate] = (0, preact_hooks.useState)({ _instance: {
7
+ _value: value,
8
+ _getSnapshot: getSnapshot
9
+ } });
10
+ (0, preact_hooks.useLayoutEffect)(() => {
11
+ _instance._value = value;
12
+ _instance._getSnapshot = getSnapshot;
13
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
14
+ }, [
15
+ subscribe,
16
+ value,
17
+ getSnapshot
18
+ ]);
19
+ (0, preact_hooks.useEffect)(() => {
20
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
21
+ return subscribe(() => {
22
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
23
+ });
24
+ }, [subscribe]);
25
+ return value;
51
26
  }
52
27
  function didSnapshotChange(inst) {
53
- const latestGetSnapshot = inst._getSnapshot;
54
- const prevValue = inst._value;
55
- try {
56
- const nextValue = latestGetSnapshot();
57
- return !Object.is(prevValue, nextValue);
58
- } catch (_error) {
59
- return true;
60
- }
28
+ const latestGetSnapshot = inst._getSnapshot;
29
+ const prevValue = inst._value;
30
+ try {
31
+ const nextValue = latestGetSnapshot();
32
+ return !Object.is(prevValue, nextValue);
33
+ } catch (_error) {
34
+ return true;
35
+ }
61
36
  }
62
37
  function useSyncExternalStoreWithSelector(subscribe, getSnapshot, selector, isEqual) {
63
- const selectedSnapshotRef = (0, import_hooks.useRef)();
64
- const getSelectedSnapshot = () => {
65
- const snapshot = getSnapshot();
66
- const selected = selector(snapshot);
67
- if (selectedSnapshotRef.current === void 0 || !isEqual(selectedSnapshotRef.current, selected)) {
68
- selectedSnapshotRef.current = selected;
69
- }
70
- return selectedSnapshotRef.current;
71
- };
72
- return useSyncExternalStore(subscribe, getSelectedSnapshot);
38
+ const selectedSnapshotRef = (0, preact_hooks.useRef)();
39
+ const getSelectedSnapshot = () => {
40
+ const selected = selector(getSnapshot());
41
+ if (selectedSnapshotRef.current === void 0 || !isEqual(selectedSnapshotRef.current, selected)) selectedSnapshotRef.current = selected;
42
+ return selectedSnapshotRef.current;
43
+ };
44
+ return useSyncExternalStore(subscribe, getSelectedSnapshot);
73
45
  }
74
- // Annotate the CommonJS export names for ESM import in node:
75
- 0 && (module.exports = {
76
- useSyncExternalStore,
77
- useSyncExternalStoreWithSelector
78
- });
46
+ //#endregion
47
+ exports.useSyncExternalStore = useSyncExternalStore;
48
+ exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
49
+
79
50
  //# sourceMappingURL=utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks'\n\n/**\n * This is taken from https://github.com/preactjs/preact/blob/main/compat/src/hooks.js#L8-L54\n * which is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation.\n * This way we don't have to import preact/compat with side effects\n */\ntype InternalStore = {\n _value: any\n _getSnapshot: () => any\n}\ntype StoreRef = {\n _instance: InternalStore\n}\nexport function useSyncExternalStore(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => any,\n) {\n const value = getSnapshot()\n\n const [{ _instance }, forceUpdate] = useState<StoreRef>({\n _instance: { _value: value, _getSnapshot: getSnapshot },\n })\n\n useLayoutEffect(() => {\n _instance._value = value\n _instance._getSnapshot = getSnapshot\n\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n }, [subscribe, value, getSnapshot])\n\n useEffect(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n\n return subscribe(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n })\n }, [subscribe])\n\n return value\n}\n\nfunction didSnapshotChange(inst: {\n _getSnapshot: () => any\n _value: any\n}): boolean {\n const latestGetSnapshot = inst._getSnapshot\n const prevValue = inst._value\n try {\n const nextValue = latestGetSnapshot()\n return !Object.is(prevValue, nextValue)\n // eslint-disable-next-line no-unused-vars\n } catch (_error) {\n return true\n }\n}\n\nexport function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => TSnapshot,\n selector: (snapshot: TSnapshot) => TSelected,\n isEqual: (a: TSelected, b: TSelected) => boolean,\n): TSelected {\n const selectedSnapshotRef = useRef<TSelected | undefined>()\n\n const getSelectedSnapshot = () => {\n const snapshot = getSnapshot()\n const selected = selector(snapshot)\n\n if (\n selectedSnapshotRef.current === undefined ||\n !isEqual(selectedSnapshotRef.current, selected)\n ) {\n selectedSnapshotRef.current = selected\n }\n\n return selectedSnapshotRef.current\n }\n\n return useSyncExternalStore(subscribe, getSelectedSnapshot)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6D;AAetD,SAAS,qBACd,WACA,aACA;AACA,QAAM,QAAQ,YAAY;AAE1B,QAAM,CAAC,EAAE,UAAU,GAAG,WAAW,QAAI,uBAAmB;AAAA,IACtD,WAAW,EAAE,QAAQ,OAAO,cAAc,YAAY;AAAA,EACxD,CAAC;AAED,oCAAgB,MAAM;AACpB,cAAU,SAAS;AACnB,cAAU,eAAe;AAEzB,QAAI,kBAAkB,SAAS,GAAG;AAChC,kBAAY,EAAE,UAAU,CAAC;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,WAAW,OAAO,WAAW,CAAC;AAElC,8BAAU,MAAM;AACd,QAAI,kBAAkB,SAAS,GAAG;AAChC,kBAAY,EAAE,UAAU,CAAC;AAAA,IAC3B;AAEA,WAAO,UAAU,MAAM;AACrB,UAAI,kBAAkB,SAAS,GAAG;AAChC,oBAAY,EAAE,UAAU,CAAC;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,SAAS,CAAC;AAEd,SAAO;AACT;AAEA,SAAS,kBAAkB,MAGf;AACV,QAAM,oBAAoB,KAAK;AAC/B,QAAM,YAAY,KAAK;AACvB,MAAI;AACF,UAAM,YAAY,kBAAkB;AACpC,WAAO,CAAC,OAAO,GAAG,WAAW,SAAS;AAAA,EAExC,SAAS,QAAQ;AACf,WAAO;AAAA,EACT;AACF;AAEO,SAAS,iCACd,WACA,aACA,UACA,SACW;AACX,QAAM,0BAAsB,qBAA8B;AAE1D,QAAM,sBAAsB,MAAM;AAChC,UAAM,WAAW,YAAY;AAC7B,UAAM,WAAW,SAAS,QAAQ;AAElC,QACE,oBAAoB,YAAY,UAChC,CAAC,QAAQ,oBAAoB,SAAS,QAAQ,GAC9C;AACA,0BAAoB,UAAU;AAAA,IAChC;AAEA,WAAO,oBAAoB;AAAA,EAC7B;AAEA,SAAO,qBAAqB,WAAW,mBAAmB;AAC5D;","names":[]}
1
+ {"version":3,"file":"utils.cjs","names":["useState","useRef"],"sources":["../../src/utils.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks'\n\n/**\n * This is taken from https://github.com/preactjs/preact/blob/main/compat/src/hooks.js#L8-L54\n * which is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation.\n * This way we don't have to import preact/compat with side effects\n */\ntype InternalStore = {\n _value: any\n _getSnapshot: () => any\n}\ntype StoreRef = {\n _instance: InternalStore\n}\nexport function useSyncExternalStore(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => any,\n) {\n const value = getSnapshot()\n\n const [{ _instance }, forceUpdate] = useState<StoreRef>({\n _instance: { _value: value, _getSnapshot: getSnapshot },\n })\n\n useLayoutEffect(() => {\n _instance._value = value\n _instance._getSnapshot = getSnapshot\n\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n }, [subscribe, value, getSnapshot])\n\n useEffect(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n\n return subscribe(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n })\n }, [subscribe])\n\n return value\n}\n\nfunction didSnapshotChange(inst: {\n _getSnapshot: () => any\n _value: any\n}): boolean {\n const latestGetSnapshot = inst._getSnapshot\n const prevValue = inst._value\n try {\n const nextValue = latestGetSnapshot()\n return !Object.is(prevValue, nextValue)\n // eslint-disable-next-line no-unused-vars\n } catch (_error) {\n return true\n }\n}\n\nexport function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => TSnapshot,\n selector: (snapshot: TSnapshot) => TSelected,\n isEqual: (a: TSelected, b: TSelected) => boolean,\n): TSelected {\n const selectedSnapshotRef = useRef<TSelected | undefined>()\n\n const getSelectedSnapshot = () => {\n const snapshot = getSnapshot()\n const selected = selector(snapshot)\n\n if (\n selectedSnapshotRef.current === undefined ||\n !isEqual(selectedSnapshotRef.current, selected)\n ) {\n selectedSnapshotRef.current = selected\n }\n\n return selectedSnapshotRef.current\n }\n\n return useSyncExternalStore(subscribe, getSelectedSnapshot)\n}\n"],"mappings":";;;AAeA,SAAgB,qBACd,WACA,aACA;CACA,MAAM,QAAQ,YAAY;CAE1B,MAAM,CAAC,EAAE,aAAa,gBAAA,GAAeA,aAAAA,SAAAA,CAAmB,EACtD,WAAW;EAAE,QAAQ;EAAO,cAAc;CAAY,EACxD,CAAC;CAED,CAAA,GAAA,aAAA,gBAAA,OAAsB;EACpB,UAAU,SAAS;EACnB,UAAU,eAAe;EAEzB,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;CAE7B,GAAG;EAAC;EAAW;EAAO;CAAW,CAAC;CAElC,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;EAG3B,OAAO,gBAAgB;GACrB,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;EAE7B,CAAC;CACH,GAAG,CAAC,SAAS,CAAC;CAEd,OAAO;AACT;AAEA,SAAS,kBAAkB,MAGf;CACV,MAAM,oBAAoB,KAAK;CAC/B,MAAM,YAAY,KAAK;CACvB,IAAI;EACF,MAAM,YAAY,kBAAkB;EACpC,OAAO,CAAC,OAAO,GAAG,WAAW,SAAS;CAExC,SAAS,QAAQ;EACf,OAAO;CACT;AACF;AAEA,SAAgB,iCACd,WACA,aACA,UACA,SACW;CACX,MAAM,uBAAA,GAAsBC,aAAAA,OAAAA,CAA8B;CAE1D,MAAM,4BAA4B;EAEhC,MAAM,WAAW,SADA,YACgB,CAAC;EAElC,IACE,oBAAoB,YAAY,KAAA,KAChC,CAAC,QAAQ,oBAAoB,SAAS,QAAQ,GAE9C,oBAAoB,UAAU;EAGhC,OAAO,oBAAoB;CAC7B;CAEA,OAAO,qBAAqB,WAAW,mBAAmB;AAC5D"}
@@ -1,2 +1,6 @@
1
- export { useSyncExternalStore } from './_tsup-dts-rollup.cjs';
2
- export { useSyncExternalStoreWithSelector } from './_tsup-dts-rollup.cjs';
1
+ //#region src/utils.d.ts
2
+ declare function useSyncExternalStore(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => any): any;
3
+ declare function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => TSnapshot, selector: (snapshot: TSnapshot) => TSelected, isEqual: (a: TSelected, b: TSelected) => boolean): TSelected;
4
+ //#endregion
5
+ export { useSyncExternalStore, useSyncExternalStoreWithSelector };
6
+ //# sourceMappingURL=utils.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";iBAegB,qBACd,YAAY,0CACZ;iBA+Cc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
@@ -1,2 +1,6 @@
1
- export { useSyncExternalStore } from './_tsup-dts-rollup.js';
2
- export { useSyncExternalStoreWithSelector } from './_tsup-dts-rollup.js';
1
+ //#region src/utils.d.ts
2
+ declare function useSyncExternalStore(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => any): any;
3
+ declare function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => TSnapshot, selector: (snapshot: TSnapshot) => TSelected, isEqual: (a: TSelected, b: TSelected) => boolean): TSelected;
4
+ //#endregion
5
+ export { useSyncExternalStore, useSyncExternalStoreWithSelector };
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";iBAegB,qBACd,YAAY,0CACZ;iBA+Cc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
@@ -1,53 +1,48 @@
1
- // src/utils.ts
2
1
  import { useEffect, useLayoutEffect, useRef, useState } from "preact/hooks";
2
+ //#region src/utils.ts
3
3
  function useSyncExternalStore(subscribe, getSnapshot) {
4
- const value = getSnapshot();
5
- const [{ _instance }, forceUpdate] = useState({
6
- _instance: { _value: value, _getSnapshot: getSnapshot }
7
- });
8
- useLayoutEffect(() => {
9
- _instance._value = value;
10
- _instance._getSnapshot = getSnapshot;
11
- if (didSnapshotChange(_instance)) {
12
- forceUpdate({ _instance });
13
- }
14
- }, [subscribe, value, getSnapshot]);
15
- useEffect(() => {
16
- if (didSnapshotChange(_instance)) {
17
- forceUpdate({ _instance });
18
- }
19
- return subscribe(() => {
20
- if (didSnapshotChange(_instance)) {
21
- forceUpdate({ _instance });
22
- }
23
- });
24
- }, [subscribe]);
25
- return value;
4
+ const value = getSnapshot();
5
+ const [{ _instance }, forceUpdate] = useState({ _instance: {
6
+ _value: value,
7
+ _getSnapshot: getSnapshot
8
+ } });
9
+ useLayoutEffect(() => {
10
+ _instance._value = value;
11
+ _instance._getSnapshot = getSnapshot;
12
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
13
+ }, [
14
+ subscribe,
15
+ value,
16
+ getSnapshot
17
+ ]);
18
+ useEffect(() => {
19
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
20
+ return subscribe(() => {
21
+ if (didSnapshotChange(_instance)) forceUpdate({ _instance });
22
+ });
23
+ }, [subscribe]);
24
+ return value;
26
25
  }
27
26
  function didSnapshotChange(inst) {
28
- const latestGetSnapshot = inst._getSnapshot;
29
- const prevValue = inst._value;
30
- try {
31
- const nextValue = latestGetSnapshot();
32
- return !Object.is(prevValue, nextValue);
33
- } catch (_error) {
34
- return true;
35
- }
27
+ const latestGetSnapshot = inst._getSnapshot;
28
+ const prevValue = inst._value;
29
+ try {
30
+ const nextValue = latestGetSnapshot();
31
+ return !Object.is(prevValue, nextValue);
32
+ } catch (_error) {
33
+ return true;
34
+ }
36
35
  }
37
36
  function useSyncExternalStoreWithSelector(subscribe, getSnapshot, selector, isEqual) {
38
- const selectedSnapshotRef = useRef();
39
- const getSelectedSnapshot = () => {
40
- const snapshot = getSnapshot();
41
- const selected = selector(snapshot);
42
- if (selectedSnapshotRef.current === void 0 || !isEqual(selectedSnapshotRef.current, selected)) {
43
- selectedSnapshotRef.current = selected;
44
- }
45
- return selectedSnapshotRef.current;
46
- };
47
- return useSyncExternalStore(subscribe, getSelectedSnapshot);
37
+ const selectedSnapshotRef = useRef();
38
+ const getSelectedSnapshot = () => {
39
+ const selected = selector(getSnapshot());
40
+ if (selectedSnapshotRef.current === void 0 || !isEqual(selectedSnapshotRef.current, selected)) selectedSnapshotRef.current = selected;
41
+ return selectedSnapshotRef.current;
42
+ };
43
+ return useSyncExternalStore(subscribe, getSelectedSnapshot);
48
44
  }
49
- export {
50
- useSyncExternalStore,
51
- useSyncExternalStoreWithSelector
52
- };
45
+ //#endregion
46
+ export { useSyncExternalStore, useSyncExternalStoreWithSelector };
47
+
53
48
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks'\n\n/**\n * This is taken from https://github.com/preactjs/preact/blob/main/compat/src/hooks.js#L8-L54\n * which is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation.\n * This way we don't have to import preact/compat with side effects\n */\ntype InternalStore = {\n _value: any\n _getSnapshot: () => any\n}\ntype StoreRef = {\n _instance: InternalStore\n}\nexport function useSyncExternalStore(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => any,\n) {\n const value = getSnapshot()\n\n const [{ _instance }, forceUpdate] = useState<StoreRef>({\n _instance: { _value: value, _getSnapshot: getSnapshot },\n })\n\n useLayoutEffect(() => {\n _instance._value = value\n _instance._getSnapshot = getSnapshot\n\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n }, [subscribe, value, getSnapshot])\n\n useEffect(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n\n return subscribe(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n })\n }, [subscribe])\n\n return value\n}\n\nfunction didSnapshotChange(inst: {\n _getSnapshot: () => any\n _value: any\n}): boolean {\n const latestGetSnapshot = inst._getSnapshot\n const prevValue = inst._value\n try {\n const nextValue = latestGetSnapshot()\n return !Object.is(prevValue, nextValue)\n // eslint-disable-next-line no-unused-vars\n } catch (_error) {\n return true\n }\n}\n\nexport function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => TSnapshot,\n selector: (snapshot: TSnapshot) => TSelected,\n isEqual: (a: TSelected, b: TSelected) => boolean,\n): TSelected {\n const selectedSnapshotRef = useRef<TSelected | undefined>()\n\n const getSelectedSnapshot = () => {\n const snapshot = getSnapshot()\n const selected = selector(snapshot)\n\n if (\n selectedSnapshotRef.current === undefined ||\n !isEqual(selectedSnapshotRef.current, selected)\n ) {\n selectedSnapshotRef.current = selected\n }\n\n return selectedSnapshotRef.current\n }\n\n return useSyncExternalStore(subscribe, getSelectedSnapshot)\n}\n"],"mappings":";AAAA,SAAS,WAAW,iBAAiB,QAAQ,gBAAgB;AAetD,SAAS,qBACd,WACA,aACA;AACA,QAAM,QAAQ,YAAY;AAE1B,QAAM,CAAC,EAAE,UAAU,GAAG,WAAW,IAAI,SAAmB;AAAA,IACtD,WAAW,EAAE,QAAQ,OAAO,cAAc,YAAY;AAAA,EACxD,CAAC;AAED,kBAAgB,MAAM;AACpB,cAAU,SAAS;AACnB,cAAU,eAAe;AAEzB,QAAI,kBAAkB,SAAS,GAAG;AAChC,kBAAY,EAAE,UAAU,CAAC;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,WAAW,OAAO,WAAW,CAAC;AAElC,YAAU,MAAM;AACd,QAAI,kBAAkB,SAAS,GAAG;AAChC,kBAAY,EAAE,UAAU,CAAC;AAAA,IAC3B;AAEA,WAAO,UAAU,MAAM;AACrB,UAAI,kBAAkB,SAAS,GAAG;AAChC,oBAAY,EAAE,UAAU,CAAC;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,SAAS,CAAC;AAEd,SAAO;AACT;AAEA,SAAS,kBAAkB,MAGf;AACV,QAAM,oBAAoB,KAAK;AAC/B,QAAM,YAAY,KAAK;AACvB,MAAI;AACF,UAAM,YAAY,kBAAkB;AACpC,WAAO,CAAC,OAAO,GAAG,WAAW,SAAS;AAAA,EAExC,SAAS,QAAQ;AACf,WAAO;AAAA,EACT;AACF;AAEO,SAAS,iCACd,WACA,aACA,UACA,SACW;AACX,QAAM,sBAAsB,OAA8B;AAE1D,QAAM,sBAAsB,MAAM;AAChC,UAAM,WAAW,YAAY;AAC7B,UAAM,WAAW,SAAS,QAAQ;AAElC,QACE,oBAAoB,YAAY,UAChC,CAAC,QAAQ,oBAAoB,SAAS,QAAQ,GAC9C;AACA,0BAAoB,UAAU;AAAA,IAChC;AAEA,WAAO,oBAAoB;AAAA,EAC7B;AAEA,SAAO,qBAAqB,WAAW,mBAAmB;AAC5D;","names":[]}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks'\n\n/**\n * This is taken from https://github.com/preactjs/preact/blob/main/compat/src/hooks.js#L8-L54\n * which is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation.\n * This way we don't have to import preact/compat with side effects\n */\ntype InternalStore = {\n _value: any\n _getSnapshot: () => any\n}\ntype StoreRef = {\n _instance: InternalStore\n}\nexport function useSyncExternalStore(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => any,\n) {\n const value = getSnapshot()\n\n const [{ _instance }, forceUpdate] = useState<StoreRef>({\n _instance: { _value: value, _getSnapshot: getSnapshot },\n })\n\n useLayoutEffect(() => {\n _instance._value = value\n _instance._getSnapshot = getSnapshot\n\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n }, [subscribe, value, getSnapshot])\n\n useEffect(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n\n return subscribe(() => {\n if (didSnapshotChange(_instance)) {\n forceUpdate({ _instance })\n }\n })\n }, [subscribe])\n\n return value\n}\n\nfunction didSnapshotChange(inst: {\n _getSnapshot: () => any\n _value: any\n}): boolean {\n const latestGetSnapshot = inst._getSnapshot\n const prevValue = inst._value\n try {\n const nextValue = latestGetSnapshot()\n return !Object.is(prevValue, nextValue)\n // eslint-disable-next-line no-unused-vars\n } catch (_error) {\n return true\n }\n}\n\nexport function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => TSnapshot,\n selector: (snapshot: TSnapshot) => TSelected,\n isEqual: (a: TSelected, b: TSelected) => boolean,\n): TSelected {\n const selectedSnapshotRef = useRef<TSelected | undefined>()\n\n const getSelectedSnapshot = () => {\n const snapshot = getSnapshot()\n const selected = selector(snapshot)\n\n if (\n selectedSnapshotRef.current === undefined ||\n !isEqual(selectedSnapshotRef.current, selected)\n ) {\n selectedSnapshotRef.current = selected\n }\n\n return selectedSnapshotRef.current\n }\n\n return useSyncExternalStore(subscribe, getSelectedSnapshot)\n}\n"],"mappings":";;AAeA,SAAgB,qBACd,WACA,aACA;CACA,MAAM,QAAQ,YAAY;CAE1B,MAAM,CAAC,EAAE,aAAa,eAAe,SAAmB,EACtD,WAAW;EAAE,QAAQ;EAAO,cAAc;CAAY,EACxD,CAAC;CAED,sBAAsB;EACpB,UAAU,SAAS;EACnB,UAAU,eAAe;EAEzB,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;CAE7B,GAAG;EAAC;EAAW;EAAO;CAAW,CAAC;CAElC,gBAAgB;EACd,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;EAG3B,OAAO,gBAAgB;GACrB,IAAI,kBAAkB,SAAS,GAC7B,YAAY,EAAE,UAAU,CAAC;EAE7B,CAAC;CACH,GAAG,CAAC,SAAS,CAAC;CAEd,OAAO;AACT;AAEA,SAAS,kBAAkB,MAGf;CACV,MAAM,oBAAoB,KAAK;CAC/B,MAAM,YAAY,KAAK;CACvB,IAAI;EACF,MAAM,YAAY,kBAAkB;EACpC,OAAO,CAAC,OAAO,GAAG,WAAW,SAAS;CAExC,SAAS,QAAQ;EACf,OAAO;CACT;AACF;AAEA,SAAgB,iCACd,WACA,aACA,UACA,SACW;CACX,MAAM,sBAAsB,OAA8B;CAE1D,MAAM,4BAA4B;EAEhC,MAAM,WAAW,SADA,YACgB,CAAC;EAElC,IACE,oBAAoB,YAAY,KAAA,KAChC,CAAC,QAAQ,oBAAoB,SAAS,QAAQ,GAE9C,oBAAoB,UAAU;EAGhC,OAAO,oBAAoB;CAC7B;CAEA,OAAO,qBAAqB,WAAW,mBAAmB;AAC5D"}
@@ -1,82 +1,38 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_QueryClientProvider = require("./QueryClientProvider.cjs");
3
+ let _tanstack_query_core = require("@tanstack/query-core");
4
+ let preact = require("preact");
5
+ let preact_hooks = require("preact/hooks");
6
+ let preact_jsx_runtime = require("preact/jsx-runtime");
7
+ //#region src/HydrationBoundary.tsx
8
+ const HydrationBoundary = ({ children, options = {}, state, queryClient }) => {
9
+ const client = require_QueryClientProvider.useQueryClient(queryClient);
10
+ const optionsRef = (0, preact_hooks.useRef)(options);
11
+ (0, preact_hooks.useEffect)(() => {
12
+ optionsRef.current = options;
13
+ });
14
+ const hydrationQueue = (0, preact_hooks.useMemo)(() => {
15
+ if (state) {
16
+ if (typeof state !== "object") return;
17
+ const queryCache = client.getQueryCache();
18
+ const queries = state.queries || [];
19
+ const newQueries = [];
20
+ const existingQueries = [];
21
+ for (const dehydratedQuery of queries) {
22
+ const existingQuery = queryCache.get(dehydratedQuery.queryHash);
23
+ if (!existingQuery) newQueries.push(dehydratedQuery);
24
+ else if (dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt) existingQueries.push(dehydratedQuery);
25
+ }
26
+ if (newQueries.length > 0) (0, _tanstack_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current);
27
+ if (existingQueries.length > 0) return existingQueries;
28
+ }
29
+ }, [client, state]);
30
+ (0, preact_hooks.useEffect)(() => {
31
+ if (hydrationQueue) (0, _tanstack_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current);
32
+ }, [client, hydrationQueue]);
33
+ return /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(preact.Fragment, { children });
9
34
  };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+ //#endregion
36
+ exports.HydrationBoundary = HydrationBoundary;
19
37
 
20
- // src/HydrationBoundary.tsx
21
- var HydrationBoundary_exports = {};
22
- __export(HydrationBoundary_exports, {
23
- HydrationBoundary: () => HydrationBoundary
24
- });
25
- module.exports = __toCommonJS(HydrationBoundary_exports);
26
- var import_query_core = require("@tanstack/query-core");
27
- var import_preact = require("preact");
28
- var import_hooks = require("preact/hooks");
29
- var import_QueryClientProvider = require("./QueryClientProvider.cjs");
30
- var import_jsx_runtime = require("preact/jsx-runtime");
31
- var HydrationBoundary = ({
32
- children,
33
- options = {},
34
- state,
35
- queryClient
36
- }) => {
37
- const client = (0, import_QueryClientProvider.useQueryClient)(queryClient);
38
- const optionsRef = (0, import_hooks.useRef)(options);
39
- (0, import_hooks.useEffect)(() => {
40
- optionsRef.current = options;
41
- });
42
- const hydrationQueue = (0, import_hooks.useMemo)(() => {
43
- if (state) {
44
- if (typeof state !== "object") {
45
- return;
46
- }
47
- const queryCache = client.getQueryCache();
48
- const queries = state.queries || [];
49
- const newQueries = [];
50
- const existingQueries = [];
51
- for (const dehydratedQuery of queries) {
52
- const existingQuery = queryCache.get(dehydratedQuery.queryHash);
53
- if (!existingQuery) {
54
- newQueries.push(dehydratedQuery);
55
- } else {
56
- const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt;
57
- if (hydrationIsNewer) {
58
- existingQueries.push(dehydratedQuery);
59
- }
60
- }
61
- }
62
- if (newQueries.length > 0) {
63
- (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current);
64
- }
65
- if (existingQueries.length > 0) {
66
- return existingQueries;
67
- }
68
- }
69
- return void 0;
70
- }, [client, state]);
71
- (0, import_hooks.useEffect)(() => {
72
- if (hydrationQueue) {
73
- (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current);
74
- }
75
- }, [client, hydrationQueue]);
76
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preact.Fragment, { children });
77
- };
78
- // Annotate the CommonJS export names for ESM import in node:
79
- 0 && (module.exports = {
80
- HydrationBoundary
81
- });
82
38
  //# sourceMappingURL=HydrationBoundary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/query-core'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\nimport { Fragment } from 'preact'\nimport type { ComponentChildren } from 'preact'\nimport { useEffect, useMemo, useRef } from 'preact/hooks'\n\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {\n defaultOptions?: OmitKeyof<\n Exclude<HydrateOptions['defaultOptions'], undefined>,\n 'mutations'\n >\n }\n children?: ComponentChildren\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = useRef(options)\n useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined = useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return <Fragment>{children}</Fragment>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAwB;AAOxB,oBAAyB;AAEzB,mBAA2C;AAE3C,iCAA+B;AAgGtB;AAlFF,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,iBAAa,qBAAO,OAAO;AACjC,8BAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,qBAAyD,sBAAQ,MAAM;AAC3E,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eAAe,cAAc,MAAM;AAEvD,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,uCAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAElB,8BAAU,MAAM;AACd,QAAI,gBAAgB;AAClB,qCAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO,4CAAC,0BAAU,UAAS;AAC7B;","names":[]}
1
+ {"version":3,"file":"HydrationBoundary.cjs","names":["useQueryClient","useRef","useMemo","Fragment"],"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/query-core'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\nimport { Fragment } from 'preact'\nimport type { ComponentChildren } from 'preact'\nimport { useEffect, useMemo, useRef } from 'preact/hooks'\n\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {\n defaultOptions?: OmitKeyof<\n Exclude<HydrateOptions['defaultOptions'], undefined>,\n 'mutations'\n >\n }\n children?: ComponentChildren\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = useRef(options)\n useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined = useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return <Fragment>{children}</Fragment>\n}\n"],"mappings":";;;;;;;AAyBA,MAAa,qBAAqB,EAChC,UACA,UAAU,CAAC,GACX,OACA,kBAC4B;CAC5B,MAAM,SAASA,4BAAAA,eAAe,WAAW;CAEzC,MAAM,cAAA,GAAaC,aAAAA,OAAAA,CAAO,OAAO;CACjC,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,WAAW,UAAU;CACvB,CAAC;CAiBD,MAAM,kBAAA,GAAyDC,aAAAA,QAAAA,OAAc;EAC3E,IAAI,OAAO;GACT,IAAI,OAAO,UAAU,UACnB;GAGF,MAAM,aAAa,OAAO,cAAc;GAKxC,MAAM,UAAU,MAAM,WAAW,CAAC;GAElC,MAAM,aAAyC,CAAC;GAChD,MAAM,kBAA8C,CAAC;GACrD,KAAK,MAAM,mBAAmB,SAAS;IACrC,MAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;IAE9D,IAAI,CAAC,eACH,WAAW,KAAK,eAAe;SAW/B,IARE,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,KAAA,KACjC,gBAAgB,eAAe,cAAc,MAAM,eAGrD,gBAAgB,KAAK,eAAe;GAG1C;GAEA,IAAI,WAAW,SAAS,GAGtB,CAAA,GAAA,qBAAA,QAAA,CAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;GAE7D,IAAI,gBAAgB,SAAS,GAC3B,OAAO;EAEX;CAEF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAElB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,gBACF,CAAA,GAAA,qBAAA,QAAA,CAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;CAEnE,GAAG,CAAC,QAAQ,cAAc,CAAC;CAE3B,OAAO,iBAAA,GAAA,mBAAA,IAAA,CAACC,OAAAA,UAAD,EAAW,SAAmB,CAAA;AACvC"}
@@ -1,2 +1,15 @@
1
- export { HydrationBoundaryProps } from './_tsup-dts-rollup.cjs';
2
- export { HydrationBoundary } from './_tsup-dts-rollup.cjs';
1
+ import { DehydratedState, HydrateOptions, OmitKeyof, QueryClient } from "@tanstack/query-core";
2
+ import { ComponentChildren } from "preact";
3
+ //#region src/HydrationBoundary.d.ts
4
+ interface HydrationBoundaryProps {
5
+ state: DehydratedState | null | undefined;
6
+ options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {
7
+ defaultOptions?: OmitKeyof<Exclude<HydrateOptions['defaultOptions'], undefined>, 'mutations'>;
8
+ };
9
+ children?: ComponentChildren;
10
+ queryClient?: QueryClient;
11
+ }
12
+ declare const HydrationBoundary: ({ children, options, state, queryClient }: HydrationBoundaryProps) => import("preact").JSX.Element;
13
+ //#endregion
14
+ export { HydrationBoundary, HydrationBoundaryProps };
15
+ //# sourceMappingURL=HydrationBoundary.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HydrationBoundary.d.cts","names":[],"sources":["../../src/HydrationBoundary.tsx"],"mappings":";;;UAaiB;EACf,OAAO;EACP,UAAU,UAAU;IAClB,iBAAiB,UACf,QAAQ;;EAIZ,WAAW;EACX,cAAc;;cAGH,sBAAqB,UAAA,SAAA,OAAA,eAK/B,4CAAsB,IAAA"}
@@ -1,2 +1,15 @@
1
- export { HydrationBoundaryProps } from './_tsup-dts-rollup.js';
2
- export { HydrationBoundary } from './_tsup-dts-rollup.js';
1
+ import { DehydratedState, HydrateOptions, OmitKeyof, QueryClient } from "@tanstack/query-core";
2
+ import { ComponentChildren } from "preact";
3
+ //#region src/HydrationBoundary.d.ts
4
+ interface HydrationBoundaryProps {
5
+ state: DehydratedState | null | undefined;
6
+ options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {
7
+ defaultOptions?: OmitKeyof<Exclude<HydrateOptions['defaultOptions'], undefined>, 'mutations'>;
8
+ };
9
+ children?: ComponentChildren;
10
+ queryClient?: QueryClient;
11
+ }
12
+ declare const HydrationBoundary: ({ children, options, state, queryClient }: HydrationBoundaryProps) => import("preact").JSX.Element;
13
+ //#endregion
14
+ export { HydrationBoundary, HydrationBoundaryProps };
15
+ //# sourceMappingURL=HydrationBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HydrationBoundary.d.ts","names":[],"sources":["../../src/HydrationBoundary.tsx"],"mappings":";;;UAaiB;EACf,OAAO;EACP,UAAU,UAAU;IAClB,iBAAiB,UACf,QAAQ;;EAIZ,WAAW;EACX,cAAc;;cAGH,sBAAqB,UAAA,SAAA,OAAA,eAK/B,4CAAsB,IAAA"}
@@ -1,57 +1,37 @@
1
- // src/HydrationBoundary.tsx
1
+ import { useQueryClient } from "./QueryClientProvider.js";
2
2
  import { hydrate } from "@tanstack/query-core";
3
3
  import { Fragment } from "preact";
4
4
  import { useEffect, useMemo, useRef } from "preact/hooks";
5
- import { useQueryClient } from "./QueryClientProvider.js";
6
5
  import { jsx } from "preact/jsx-runtime";
7
- var HydrationBoundary = ({
8
- children,
9
- options = {},
10
- state,
11
- queryClient
12
- }) => {
13
- const client = useQueryClient(queryClient);
14
- const optionsRef = useRef(options);
15
- useEffect(() => {
16
- optionsRef.current = options;
17
- });
18
- const hydrationQueue = useMemo(() => {
19
- if (state) {
20
- if (typeof state !== "object") {
21
- return;
22
- }
23
- const queryCache = client.getQueryCache();
24
- const queries = state.queries || [];
25
- const newQueries = [];
26
- const existingQueries = [];
27
- for (const dehydratedQuery of queries) {
28
- const existingQuery = queryCache.get(dehydratedQuery.queryHash);
29
- if (!existingQuery) {
30
- newQueries.push(dehydratedQuery);
31
- } else {
32
- const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt;
33
- if (hydrationIsNewer) {
34
- existingQueries.push(dehydratedQuery);
35
- }
36
- }
37
- }
38
- if (newQueries.length > 0) {
39
- hydrate(client, { queries: newQueries }, optionsRef.current);
40
- }
41
- if (existingQueries.length > 0) {
42
- return existingQueries;
43
- }
44
- }
45
- return void 0;
46
- }, [client, state]);
47
- useEffect(() => {
48
- if (hydrationQueue) {
49
- hydrate(client, { queries: hydrationQueue }, optionsRef.current);
50
- }
51
- }, [client, hydrationQueue]);
52
- return /* @__PURE__ */ jsx(Fragment, { children });
53
- };
54
- export {
55
- HydrationBoundary
6
+ //#region src/HydrationBoundary.tsx
7
+ const HydrationBoundary = ({ children, options = {}, state, queryClient }) => {
8
+ const client = useQueryClient(queryClient);
9
+ const optionsRef = useRef(options);
10
+ useEffect(() => {
11
+ optionsRef.current = options;
12
+ });
13
+ const hydrationQueue = useMemo(() => {
14
+ if (state) {
15
+ if (typeof state !== "object") return;
16
+ const queryCache = client.getQueryCache();
17
+ const queries = state.queries || [];
18
+ const newQueries = [];
19
+ const existingQueries = [];
20
+ for (const dehydratedQuery of queries) {
21
+ const existingQuery = queryCache.get(dehydratedQuery.queryHash);
22
+ if (!existingQuery) newQueries.push(dehydratedQuery);
23
+ else if (dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt) existingQueries.push(dehydratedQuery);
24
+ }
25
+ if (newQueries.length > 0) hydrate(client, { queries: newQueries }, optionsRef.current);
26
+ if (existingQueries.length > 0) return existingQueries;
27
+ }
28
+ }, [client, state]);
29
+ useEffect(() => {
30
+ if (hydrationQueue) hydrate(client, { queries: hydrationQueue }, optionsRef.current);
31
+ }, [client, hydrationQueue]);
32
+ return /* @__PURE__ */ jsx(Fragment, { children });
56
33
  };
34
+ //#endregion
35
+ export { HydrationBoundary };
36
+
57
37
  //# sourceMappingURL=HydrationBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/query-core'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\nimport { Fragment } from 'preact'\nimport type { ComponentChildren } from 'preact'\nimport { useEffect, useMemo, useRef } from 'preact/hooks'\n\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {\n defaultOptions?: OmitKeyof<\n Exclude<HydrateOptions['defaultOptions'], undefined>,\n 'mutations'\n >\n }\n children?: ComponentChildren\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = useRef(options)\n useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined = useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return <Fragment>{children}</Fragment>\n}\n"],"mappings":";AAAA,SAAS,eAAe;AAOxB,SAAS,gBAAgB;AAEzB,SAAS,WAAW,SAAS,cAAc;AAE3C,SAAS,sBAAsB;AAgGtB;AAlFF,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,aAAa,OAAO,OAAO;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBAAyD,QAAQ,MAAM;AAC3E,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eAAe,cAAc,MAAM;AAEvD,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAElB,YAAU,MAAM;AACd,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO,oBAAC,YAAU,UAAS;AAC7B;","names":[]}
1
+ {"version":3,"file":"HydrationBoundary.js","names":[],"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/query-core'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\nimport { Fragment } from 'preact'\nimport type { ComponentChildren } from 'preact'\nimport { useEffect, useMemo, useRef } from 'preact/hooks'\n\nimport { useQueryClient } from './QueryClientProvider'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof<HydrateOptions, 'defaultOptions'> & {\n defaultOptions?: OmitKeyof<\n Exclude<HydrateOptions['defaultOptions'], undefined>,\n 'mutations'\n >\n }\n children?: ComponentChildren\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = useRef(options)\n useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined = useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return <Fragment>{children}</Fragment>\n}\n"],"mappings":";;;;;;AAyBA,MAAa,qBAAqB,EAChC,UACA,UAAU,CAAC,GACX,OACA,kBAC4B;CAC5B,MAAM,SAAS,eAAe,WAAW;CAEzC,MAAM,aAAa,OAAO,OAAO;CACjC,gBAAgB;EACd,WAAW,UAAU;CACvB,CAAC;CAiBD,MAAM,iBAAyD,cAAc;EAC3E,IAAI,OAAO;GACT,IAAI,OAAO,UAAU,UACnB;GAGF,MAAM,aAAa,OAAO,cAAc;GAKxC,MAAM,UAAU,MAAM,WAAW,CAAC;GAElC,MAAM,aAAyC,CAAC;GAChD,MAAM,kBAA8C,CAAC;GACrD,KAAK,MAAM,mBAAmB,SAAS;IACrC,MAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;IAE9D,IAAI,CAAC,eACH,WAAW,KAAK,eAAe;SAW/B,IARE,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,KAAA,KACjC,gBAAgB,eAAe,cAAc,MAAM,eAGrD,gBAAgB,KAAK,eAAe;GAG1C;GAEA,IAAI,WAAW,SAAS,GAGtB,QAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;GAE7D,IAAI,gBAAgB,SAAS,GAC3B,OAAO;EAEX;CAEF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAElB,gBAAgB;EACd,IAAI,gBACF,QAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;CAEnE,GAAG,CAAC,QAAQ,cAAc,CAAC;CAE3B,OAAO,oBAAC,UAAD,EAAW,SAAmB,CAAA;AACvC"}