@scrippsproduct/networks-ui-library 1.1.0-alpha.1 → 1.1.0-alpha.10

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 (338) hide show
  1. package/dist/Carousel.module-CNJzZW2-.mjs +14 -0
  2. package/dist/{ChoicesItem-CGIr6Qga.mjs → ChoicesItem-CT9fXB0I.mjs} +22 -23
  3. package/dist/PageHero.module-BM0IV1P5.mjs +8 -0
  4. package/dist/ResultsTable.module-1zxhXaem.mjs +14 -0
  5. package/dist/{SocialShareButton-BXGVUD-z.mjs → SocialShareButton-BMhRS9Qr.mjs} +12 -7
  6. package/dist/assets/AdBlock.css +1 -1
  7. package/dist/assets/AirDateFormatter.css +1 -1
  8. package/dist/assets/AnchorTag.css +1 -1
  9. package/dist/assets/BasicGridModule.css +1 -1
  10. package/dist/assets/Button.css +1 -1
  11. package/dist/assets/Carousel.css +1 -1
  12. package/dist/assets/ChannelSearch.css +1 -1
  13. package/dist/assets/ChoicesItem.css +1 -1
  14. package/dist/assets/ContentHero.css +1 -1
  15. package/dist/assets/CtaBlock.css +1 -1
  16. package/dist/assets/CustomDataList.css +1 -1
  17. package/dist/assets/DateNavigation.css +1 -1
  18. package/dist/assets/DeviceAndPlatformLists.css +1 -1
  19. package/dist/assets/Figure2.css +1 -1
  20. package/dist/assets/FindUs.css +1 -1
  21. package/dist/assets/GradientButton.css +1 -1
  22. package/dist/assets/ImageCard.css +1 -1
  23. package/dist/assets/InlineNavigation.css +1 -1
  24. package/dist/assets/LogoListItem.css +1 -1
  25. package/dist/assets/ModalContainer.css +1 -1
  26. package/dist/assets/PageHero.css +1 -1
  27. package/dist/assets/ProgramAirdate.css +1 -1
  28. package/dist/assets/PromotionBlock.css +1 -1
  29. package/dist/assets/ResultsTable.css +1 -1
  30. package/dist/assets/ScheduleLayout.css +1 -0
  31. package/dist/assets/ScheduleList.css +1 -1
  32. package/dist/assets/ShowAboutLayout.css +1 -1
  33. package/dist/assets/ShowSlide.css +1 -1
  34. package/dist/assets/SocialLinks.css +1 -1
  35. package/dist/assets/TextSlide.css +1 -1
  36. package/dist/assets/TwoColumnSlide.css +1 -1
  37. package/dist/assets/UpcomingList.css +1 -1
  38. package/dist/components/AdBlock/AdBlock.d.ts +20 -1
  39. package/dist/components/AdBlock/AdBlock.js +118 -83
  40. package/dist/components/AdBlock/index.d.ts +2 -1
  41. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.d.ts +7 -1
  42. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.js +17 -12
  43. package/dist/components/AdjustableTwoColumnGrid/index.d.ts +2 -1
  44. package/dist/components/AirDateFormatter/AirDateFormatter.d.ts +5 -4
  45. package/dist/components/AirDateFormatter/AirDateFormatter.js +21 -22
  46. package/dist/components/AirDateFormatter/index.d.ts +2 -1
  47. package/dist/components/AnchorTag/AnchorTag.d.ts +10 -1
  48. package/dist/components/AnchorTag/AnchorTag.js +22 -23
  49. package/dist/components/AnchorTag/index.d.ts +2 -1
  50. package/dist/components/BCVideoPlayer/BCVideoPlayer.d.ts +19 -12
  51. package/dist/components/BCVideoPlayer/BCVideoPlayer.js +39 -37
  52. package/dist/components/BCVideoPlayer/index.d.ts +2 -1
  53. package/dist/components/BasicGridModule/BasicGridModule.d.ts +19 -17
  54. package/dist/components/BasicGridModule/BasicGridModule.js +57 -51
  55. package/dist/components/BasicGridModule/index.d.ts +2 -1
  56. package/dist/components/Button/Button.d.ts +18 -17
  57. package/dist/components/Button/Button.js +31 -32
  58. package/dist/components/Button/index.d.ts +2 -1
  59. package/dist/components/ButtonAnchor/ButtonAnchor.d.ts +5 -5
  60. package/dist/components/ButtonAnchor/ButtonAnchor.js +7 -5
  61. package/dist/components/ButtonAnchor/index.d.ts +2 -1
  62. package/dist/components/Carousel/Carousel.js +1 -1
  63. package/dist/components/Carousel/index.d.ts +2 -1
  64. package/dist/components/Carousel/navigations/Pagination.js +12 -10
  65. package/dist/components/CarouselSlide/CarouselSlide.js +25 -87
  66. package/dist/components/CarouselSlide/slide-layouts/ImageCard/ImageCard.d.ts +1 -1
  67. package/dist/components/CarouselSlide/slide-layouts/ImageCard/ImageCard.js +3 -4
  68. package/dist/components/CarouselSlide/slide-layouts/Show/ShowSlide.d.ts +18 -16
  69. package/dist/components/CarouselSlide/slide-layouts/Show/ShowSlide.js +49 -34
  70. package/dist/components/CarouselSlide/slide-layouts/Text/TextSlide.js +5 -5
  71. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.d.ts +5 -4
  72. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +10 -11
  73. package/dist/components/CarouselSlide/slide-layouts/Video/VideoSlide.d.ts +8 -1
  74. package/dist/components/CarouselSlide/slide-layouts/Video/VideoSlide.js +19 -15
  75. package/dist/components/CastInfoLayout/CastInfoLayout.d.ts +16 -1
  76. package/dist/components/CastInfoLayout/CastInfoLayout.js +31 -21
  77. package/dist/components/ChannelSearch/ChannelSearch.d.ts +18 -16
  78. package/dist/components/ChannelSearch/ChannelSearch.js +80 -63
  79. package/dist/components/ChannelSearch/index.d.ts +2 -1
  80. package/dist/components/ChoicesItem/ChoicesItem.d.ts +7 -4
  81. package/dist/components/ChoicesItem/ChoicesItem.js +3 -4
  82. package/dist/components/ChoicesItem/index.d.ts +2 -1
  83. package/dist/components/ChoicesItem/index.js +1 -1
  84. package/dist/components/ChoicesList/ChoicesList.d.ts +4 -3
  85. package/dist/components/ChoicesList/ChoicesList.js +3 -4
  86. package/dist/components/ChoicesList/index.d.ts +2 -1
  87. package/dist/components/Concat/Concat.d.ts +4 -3
  88. package/dist/components/Concat/Concat.js +5 -5
  89. package/dist/components/Concat/index.d.ts +2 -1
  90. package/dist/components/CreateChoiceList/CreateChoiceList.d.ts +7 -5
  91. package/dist/components/CreateChoiceList/CreateChoiceList.js +38 -9
  92. package/dist/components/CreateChoiceList/index.d.ts +2 -1
  93. package/dist/components/CtaBlock/CtaBlock.d.ts +13 -15
  94. package/dist/components/CtaBlock/CtaBlock.js +23 -22
  95. package/dist/components/CtaBlock/index.d.ts +2 -1
  96. package/dist/components/CustomDataList/CustomDataList.d.ts +12 -10
  97. package/dist/components/CustomDataList/CustomDataList.js +200 -174
  98. package/dist/components/CustomDataList/index.d.ts +2 -1
  99. package/dist/components/CustomSelect/CustomSelect.d.ts +16 -13
  100. package/dist/components/CustomSelect/CustomSelect.js +224 -154
  101. package/dist/components/CustomSelect/index.d.ts +2 -1
  102. package/dist/components/DateNavigation/DateNavigation.d.ts +1 -4
  103. package/dist/components/DateNavigation/DateNavigation.js +125 -82
  104. package/dist/components/DateNavigation/index.d.ts +2 -1
  105. package/dist/components/DatePicker/index.d.ts +2 -1
  106. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.d.ts +14 -4
  107. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.js +40 -33
  108. package/dist/components/DeviceAndPlatformLists/index.d.ts +2 -1
  109. package/dist/components/DrawerNavigation/DrawerNavigation.d.ts +21 -1
  110. package/dist/components/DrawerNavigation/DrawerNavigation.js +75 -56
  111. package/dist/components/DrawerNavigation/index.d.ts +2 -1
  112. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.d.ts +6 -5
  113. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.js +18 -14
  114. package/dist/components/EqualSizeFlexRow/index.d.ts +2 -1
  115. package/dist/components/EqualSizeGrid/EqualSizeGrid.d.ts +7 -6
  116. package/dist/components/EqualSizeGrid/EqualSizeGrid.js +17 -12
  117. package/dist/components/EqualSizeGrid/index.d.ts +2 -1
  118. package/dist/components/ErrorHandler/ErrorHandler.d.ts +5 -4
  119. package/dist/components/ErrorHandler/ErrorHandler.js +3 -4
  120. package/dist/components/ErrorHandler/index.d.ts +2 -1
  121. package/dist/components/FeaturedList/FeaturedList.d.ts +8 -6
  122. package/dist/components/FeaturedList/FeaturedList.js +44 -36
  123. package/dist/components/FeaturedList/index.d.ts +2 -1
  124. package/dist/components/Figure/Figure.d.ts +5 -4
  125. package/dist/components/Figure/Figure.js +8 -9
  126. package/dist/components/Figure/index.d.ts +2 -1
  127. package/dist/components/FindUs/FindUs.d.ts +24 -1
  128. package/dist/components/FindUs/FindUs.js +70 -63
  129. package/dist/components/FindUs/index.d.ts +2 -1
  130. package/dist/components/FooterNavigation/FooterNavigation.d.ts +9 -3
  131. package/dist/components/FooterNavigation/FooterNavigation.js +10 -11
  132. package/dist/components/FooterNavigation/index.d.ts +2 -1
  133. package/dist/components/GenericList/GenericList.d.ts +6 -5
  134. package/dist/components/GenericList/GenericList.js +13 -14
  135. package/dist/components/GenericList/index.d.ts +2 -1
  136. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.d.ts +9 -8
  137. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.js +46 -30
  138. package/dist/components/GetAirdateWrapper/index.d.ts +2 -1
  139. package/dist/components/GradientButton/GradientButton.d.ts +15 -14
  140. package/dist/components/GradientButton/GradientButton.js +37 -40
  141. package/dist/components/GradientButton/index.d.ts +2 -1
  142. package/dist/components/GridList/GridList.d.ts +6 -5
  143. package/dist/components/GridList/GridList.js +14 -10
  144. package/dist/components/GridList/index.d.ts +2 -1
  145. package/dist/components/ImageCard/ImageCard.d.ts +27 -1
  146. package/dist/components/ImageCard/ImageCard.js +59 -58
  147. package/dist/components/ImageCard/ImageCardCore.d.ts +6 -2
  148. package/dist/components/ImageCard/ImageCardCore.js +115 -89
  149. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.d.ts +11 -14
  150. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.js +25 -18
  151. package/dist/components/InfoPanel/InfoPanel.d.ts +10 -8
  152. package/dist/components/InfoPanel/InfoPanel.js +2 -2
  153. package/dist/components/InfoPanel/index.d.ts +2 -1
  154. package/dist/components/InlineNavigation/InlineNavigation.d.ts +7 -5
  155. package/dist/components/InlineNavigation/InlineNavigation.js +13 -10
  156. package/dist/components/Input/Input.d.ts +10 -9
  157. package/dist/components/Input/Input.js +47 -40
  158. package/dist/components/Input/index.d.ts +2 -1
  159. package/dist/components/InstructionsList/InstructionsList.d.ts +5 -4
  160. package/dist/components/InstructionsList/InstructionsList.js +20 -10
  161. package/dist/components/InstructionsList/index.d.ts +2 -1
  162. package/dist/components/Loading/Loading.d.ts +8 -7
  163. package/dist/components/Loading/Loading.js +25 -20
  164. package/dist/components/Loading/index.d.ts +2 -1
  165. package/dist/components/LoadingV2/LoadingV2.d.ts +7 -6
  166. package/dist/components/LoadingV2/LoadingV2.js +31 -21
  167. package/dist/components/LoadingV2/index.d.ts +2 -1
  168. package/dist/components/LogoListItem/LogoListItem.d.ts +7 -6
  169. package/dist/components/LogoListItem/LogoListItem.js +34 -17
  170. package/dist/components/LogoListItem/index.d.ts +2 -1
  171. package/dist/components/LogoNavigation/LogoNavigation.d.ts +13 -4
  172. package/dist/components/LogoNavigation/LogoNavigation.js +23 -18
  173. package/dist/components/LogoNavigation/index.d.ts +2 -1
  174. package/dist/components/ModalContainer/ModalContainer.d.ts +8 -8
  175. package/dist/components/ModalContainer/ModalContainer.js +84 -72
  176. package/dist/components/ModalContainer/index.d.ts +2 -1
  177. package/dist/components/MultiLayeredFigure/MultiLayeredFigure.d.ts +6 -5
  178. package/dist/components/MultiLayeredFigure/MultiLayeredFigure.js +13 -10
  179. package/dist/components/MultiLayeredFigure/index.d.ts +2 -1
  180. package/dist/components/NavList/NavList.d.ts +9 -7
  181. package/dist/components/NavList/NavList.js +56 -20
  182. package/dist/components/NavList/index.d.ts +2 -1
  183. package/dist/components/Overlay/Overlay.d.ts +5 -5
  184. package/dist/components/Overlay/Overlay.js +8 -5
  185. package/dist/components/PageHero/PageHero.d.ts +6 -5
  186. package/dist/components/PageHero/PageHero.js +29 -16
  187. package/dist/components/PageHero/index.d.ts +2 -1
  188. package/dist/components/PageHero/page-hero-layouts/ContentHero/ContentHero.d.ts +2 -13
  189. package/dist/components/PageHero/page-hero-layouts/ContentHero/ContentHero.js +17 -10
  190. package/dist/components/PageHero/page-hero-layouts/ContentHero/index.d.ts +2 -1
  191. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.d.ts +7 -5
  192. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +108 -42
  193. package/dist/components/PageHero/page-hero-layouts/IONShow/index.d.ts +2 -1
  194. package/dist/components/PageHero/page-hero-layouts/ImageOnly/ImageOnlyHero.d.ts +2 -12
  195. package/dist/components/PageHero/page-hero-layouts/ImageOnly/ImageOnlyHero.js +13 -7
  196. package/dist/components/PageHero/page-hero-layouts/ImageOnly/index.d.ts +2 -1
  197. package/dist/components/PageHero/page-hero-layouts/page-hero.d.js +1 -0
  198. package/dist/components/ProgramAirdate/ProgramAirdate.d.ts +14 -10
  199. package/dist/components/ProgramAirdate/ProgramAirdate.js +72 -67
  200. package/dist/components/ProgramAirdate/index.d.ts +2 -1
  201. package/dist/components/PromotionBlock/PromotionBlock.d.ts +11 -4
  202. package/dist/components/PromotionBlock/PromotionBlock.js +36 -26
  203. package/dist/components/PromotionBlock/index.d.ts +2 -1
  204. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.d.ts +5 -4
  205. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.js +8 -6
  206. package/dist/components/PromotionsRowBlock/index.d.ts +2 -1
  207. package/dist/components/PromotionsRowModule/PromotionsRowModule.d.ts +25 -5
  208. package/dist/components/PromotionsRowModule/PromotionsRowModule.js +48 -48
  209. package/dist/components/PromotionsRowModule/index.d.ts +2 -1
  210. package/dist/components/RescanInstructions/RescanInstructions.d.ts +3 -3
  211. package/dist/components/RescanInstructions/RescanInstructions.js +29 -18
  212. package/dist/components/RescanInstructions/index.d.ts +2 -1
  213. package/dist/components/ResponsiveImage/ResponsiveImage.d.ts +13 -12
  214. package/dist/components/ResponsiveImage/ResponsiveImage.js +16 -20
  215. package/dist/components/ResponsiveImage/index.d.ts +2 -1
  216. package/dist/components/ResultsTable/ResultsTable.d.ts +10 -6
  217. package/dist/components/ResultsTable/ResultsTable.js +21 -16
  218. package/dist/components/ResultsTable/index.d.ts +2 -1
  219. package/dist/components/ResultsTableBody/ResultsTableBody.d.ts +9 -5
  220. package/dist/components/ResultsTableBody/ResultsTableBody.js +21 -16
  221. package/dist/components/ResultsTableBody/index.d.ts +2 -1
  222. package/dist/components/ResultsTableHeader/ResultsTableHeader.d.ts +7 -3
  223. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +4 -5
  224. package/dist/components/ResultsTableHeader/index.d.ts +2 -1
  225. package/dist/components/ScheduleLayout/ScheduleContext.d.ts +27 -0
  226. package/dist/components/ScheduleLayout/ScheduleContext.js +1931 -0
  227. package/dist/components/ScheduleLayout/ScheduleLayout.d.ts +16 -5
  228. package/dist/components/ScheduleLayout/ScheduleLayout.js +98 -24
  229. package/dist/components/ScheduleLayout/index.d.ts +2 -1
  230. package/dist/components/ScheduleLayout/useScheduleContext.d.ts +15 -0
  231. package/dist/components/ScheduleLayout/useScheduleContext.js +12 -0
  232. package/dist/components/ScheduleList/ScheduleList.d.ts +5 -5
  233. package/dist/components/ScheduleList/ScheduleList.js +162 -60
  234. package/dist/components/ScheduleList/index.d.ts +2 -1
  235. package/dist/components/ScheduleList/schedule-list-items/AirDateSegment.d.ts +6 -4
  236. package/dist/components/ScheduleList/schedule-list-items/AirDateSegment.js +28 -17
  237. package/dist/components/ScheduleList/schedule-list-items/MovieItem.d.ts +9 -7
  238. package/dist/components/ScheduleList/schedule-list-items/MovieItem.js +46 -34
  239. package/dist/components/ScheduleList/schedule-list-items/SeriesItem.d.ts +9 -7
  240. package/dist/components/ScheduleList/schedule-list-items/SeriesItem.js +48 -32
  241. package/dist/components/ScheduleList/schedule-list-items/SportsItem.d.ts +9 -7
  242. package/dist/components/ScheduleList/schedule-list-items/SportsItem.js +46 -34
  243. package/dist/components/SectionedContent/SectionedContent.d.ts +11 -3
  244. package/dist/components/SectionedContent/SectionedContent.js +14 -15
  245. package/dist/components/SectionedContent/index.d.ts +2 -1
  246. package/dist/components/Select/Select.d.ts +15 -11
  247. package/dist/components/Select/Select.js +21 -21
  248. package/dist/components/Select/index.d.ts +2 -1
  249. package/dist/components/ShowAboutContent/ShowAboutContent.d.ts +10 -8
  250. package/dist/components/ShowAboutContent/ShowAboutContent.js +27 -28
  251. package/dist/components/ShowAboutContent/index.d.ts +2 -1
  252. package/dist/components/ShowAboutLayout/ShowAboutLayout.d.ts +10 -8
  253. package/dist/components/ShowAboutLayout/ShowAboutLayout.js +91 -42
  254. package/dist/components/ShowAboutLayout/index.d.ts +2 -1
  255. package/dist/components/SocialLinks/SocialLinks.d.ts +15 -9
  256. package/dist/components/SocialLinks/SocialLinks.js +192 -138
  257. package/dist/components/SocialShareBlock/SocialShareBlock.d.ts +9 -8
  258. package/dist/components/SocialShareBlock/SocialShareBlock.js +20 -22
  259. package/dist/components/SocialShareBlock/index.d.ts +2 -1
  260. package/dist/components/SocialShareButton/SocialShareButton.d.ts +8 -7
  261. package/dist/components/SocialShareButton/SocialShareButton.js +3 -4
  262. package/dist/components/SocialShareButton/index.d.ts +2 -1
  263. package/dist/components/SocialShareButton/index.js +1 -1
  264. package/dist/components/StringList/StringList.d.ts +6 -5
  265. package/dist/components/StringList/StringList.js +16 -12
  266. package/dist/components/StringList/index.d.ts +2 -1
  267. package/dist/components/TabContent/TabContent.d.ts +5 -4
  268. package/dist/components/TabContent/TabContent.js +9 -7
  269. package/dist/components/TabContent/index.d.ts +2 -1
  270. package/dist/components/TabNavigation/TabNavigation.d.ts +7 -5
  271. package/dist/components/TabNavigation/TabNavigation.js +58 -53
  272. package/dist/components/TabNavigation/index.d.ts +2 -1
  273. package/dist/components/TabbedContent/TabbedContent.d.ts +20 -4
  274. package/dist/components/TabbedContent/TabbedContent.js +24 -8
  275. package/dist/components/TabbedContent/index.d.ts +2 -1
  276. package/dist/components/TextArea/TextArea.d.ts +9 -1
  277. package/dist/components/TextArea/TextArea.js +13 -13
  278. package/dist/components/TextArea/index.d.ts +2 -1
  279. package/dist/components/UpcomingList/UpcomingList.d.ts +5 -4
  280. package/dist/components/UpcomingList/UpcomingList.js +55 -41
  281. package/dist/containers/GetFeatruedListContainer.d.ts +22 -15
  282. package/dist/containers/GetFeatruedListContainer.js +16 -16
  283. package/dist/containers/NowPlayingContainer.d.ts +17 -15
  284. package/dist/containers/NowPlayingContainer.js +18 -16
  285. package/dist/custom-elements.d.js +1 -0
  286. package/dist/data-resources/FakeDataResource.d.ts +77 -68
  287. package/dist/data-resources/FakeDataResource.js +244 -142
  288. package/dist/error-boundries/BlankErrorBoundry.d.ts +14 -9
  289. package/dist/error-boundries/BlankErrorBoundry.js +5 -5
  290. package/dist/error-boundries/GeneralErrorBoundry.d.ts +15 -10
  291. package/dist/error-boundries/GeneralErrorBoundry.js +10 -10
  292. package/dist/hooks/{useGetSchedule.d.ts → getSchedule.d.ts} +12 -4
  293. package/dist/hooks/getSchedule.js +62 -0
  294. package/dist/hooks/useGetUpcoming.d.ts +8 -6
  295. package/dist/hooks/useGetUpcoming.js +22 -25
  296. package/dist/icons/Facebook.js +6 -6
  297. package/dist/icons/Tiktok.js +15 -7
  298. package/dist/icons/Twitter.js +7 -7
  299. package/dist/index.d.ts +1 -0
  300. package/dist/index.js +35 -33
  301. package/dist/logger-C0N7U0YY.mjs +67 -0
  302. package/dist/settings.js +6 -5
  303. package/dist/utils/Redirect.d.ts +2 -2
  304. package/dist/utils/analytics.js +1 -1
  305. package/dist/utils/date-helpers.d.ts +3 -2
  306. package/dist/utils/date-helpers.js +26 -26
  307. package/dist/utils/events.js +8 -6
  308. package/dist/utils/getFeaturedList.d.ts +28 -8
  309. package/dist/utils/getFeaturedList.js +58 -45
  310. package/dist/utils/getFeaturedListImages.d.ts +15 -5
  311. package/dist/utils/getFeaturedListImages.js +27 -16
  312. package/dist/utils/getOnNowProgram.d.ts +17 -3
  313. package/dist/utils/getOnNowProgram.js +106 -68
  314. package/dist/utils/getSchedule.d.ts +8 -6
  315. package/dist/utils/getSchedule.js +6 -1
  316. package/dist/utils/getUpcomingPrograms.d.ts +10 -7
  317. package/dist/utils/getUpcomingPrograms.js +5 -4
  318. package/dist/utils/getViewingPlatforms.d.ts +6 -16
  319. package/dist/utils/getViewingPlatforms.js +14 -11
  320. package/dist/utils/gtm.js +1 -1
  321. package/dist/utils/helpers.d.ts +9 -9
  322. package/dist/utils/helpers.js +69 -65
  323. package/dist/utils/program-helpers.d.ts +14 -20
  324. package/dist/utils/program-helpers.js +9 -8
  325. package/dist/utils/series-helpers.d.ts +14 -20
  326. package/dist/utils/series-helpers.js +9 -8
  327. package/package.json +19 -14
  328. package/dist/Carousel.module-DOrBKQEQ.mjs +0 -14
  329. package/dist/PageHero.module-BdV8z_Xv.mjs +0 -8
  330. package/dist/ResultsTable.module-B7M9y7hd.mjs +0 -14
  331. package/dist/components/CarouselSlide/slide-layouts/NetworkCallout/NetworkCalloutSlide.stories.d.ts +0 -28
  332. package/dist/components/CarouselSlide/slide-layouts/NetworkCallout/NetworkCalloutSlide.stories.js +0 -42
  333. package/dist/components/CarouselSlide/slide-layouts/Show/ShowSlide.stories.d.ts +0 -170
  334. package/dist/components/CarouselSlide/slide-layouts/Show/ShowSlide.stories.js +0 -193
  335. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.stories.d.ts +0 -17
  336. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.stories.js +0 -49
  337. package/dist/facebook-HCcA1M1m.mjs +0 -54
  338. package/dist/hooks/useGetSchedule.js +0 -58
@@ -0,0 +1,1931 @@
1
+ var pe = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var Jt = (e, t, s) => t.has(e) || pe("Cannot " + s);
5
+ var r = (e, t, s) => (Jt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), o = (e, t, s, i) => (Jt(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), v = (e, t, s) => (Jt(e, t, "access private method"), s);
6
+ var Gt = (e, t, s, i) => ({
7
+ set _(n) {
8
+ o(e, t, n, s);
9
+ },
10
+ get _() {
11
+ return r(e, t, i);
12
+ }
13
+ });
14
+ import { jsx as zt } from "react/jsx-runtime";
15
+ import * as L from "react";
16
+ import { createContext as $e, useState as me, useRef as We, useCallback as Je, useEffect as ve, useMemo as Ze } from "react";
17
+ import { f as Bt } from "../../format-YhWt2D8M.mjs";
18
+ import { l as Y } from "../../logger-C0N7U0YY.mjs";
19
+ var Kt = class {
20
+ constructor() {
21
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
22
+ }
23
+ subscribe(e) {
24
+ return this.listeners.add(e), this.onSubscribe(), () => {
25
+ this.listeners.delete(e), this.onUnsubscribe();
26
+ };
27
+ }
28
+ hasListeners() {
29
+ return this.listeners.size > 0;
30
+ }
31
+ onSubscribe() {
32
+ }
33
+ onUnsubscribe() {
34
+ }
35
+ }, Xe = {
36
+ // We need the wrapper function syntax below instead of direct references to
37
+ // global setTimeout etc.
38
+ //
39
+ // BAD: `setTimeout: setTimeout`
40
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
41
+ //
42
+ // If we use direct references here, then anything that wants to spy on or
43
+ // replace the global setTimeout (like tests) won't work since we'll already
44
+ // have a hard reference to the original implementation at the time when this
45
+ // file was imported.
46
+ setTimeout: (e, t) => setTimeout(e, t),
47
+ clearTimeout: (e) => clearTimeout(e),
48
+ setInterval: (e, t) => setInterval(e, t),
49
+ clearInterval: (e) => clearInterval(e)
50
+ }, G, ct, Qe, Ye = (Qe = class {
51
+ constructor() {
52
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
53
+ // type at app boot; and if we leave that type, then any new timer provider
54
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
55
+ //
56
+ // We settle for type safety for the TimeoutProvider type, and accept that
57
+ // this class is unsafe internally to allow for extension.
58
+ c(this, G, Xe);
59
+ c(this, ct, !1);
60
+ }
61
+ setTimeoutProvider(e) {
62
+ process.env.NODE_ENV !== "production" && r(this, ct) && e !== r(this, G) && console.error(
63
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
64
+ { previous: r(this, G), provider: e }
65
+ ), o(this, G, e), process.env.NODE_ENV !== "production" && o(this, ct, !1);
66
+ }
67
+ setTimeout(e, t) {
68
+ return process.env.NODE_ENV !== "production" && o(this, ct, !0), r(this, G).setTimeout(e, t);
69
+ }
70
+ clearTimeout(e) {
71
+ r(this, G).clearTimeout(e);
72
+ }
73
+ setInterval(e, t) {
74
+ return process.env.NODE_ENV !== "production" && o(this, ct, !0), r(this, G).setInterval(e, t);
75
+ }
76
+ clearInterval(e) {
77
+ r(this, G).clearInterval(e);
78
+ }
79
+ }, G = new WeakMap(), ct = new WeakMap(), Qe), ht = new Ye();
80
+ function ts(e) {
81
+ setTimeout(e, 0);
82
+ }
83
+ var wt = typeof window > "u" || "Deno" in globalThis;
84
+ function j() {
85
+ }
86
+ function es(e, t) {
87
+ return typeof e == "function" ? e(t) : e;
88
+ }
89
+ function Zt(e) {
90
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
91
+ }
92
+ function _e(e, t) {
93
+ return Math.max(e + (t || 0) - Date.now(), 0);
94
+ }
95
+ function ut(e, t) {
96
+ return typeof e == "function" ? e(t) : e;
97
+ }
98
+ function k(e, t) {
99
+ return typeof e == "function" ? e(t) : e;
100
+ }
101
+ function ge(e, t) {
102
+ const {
103
+ type: s = "all",
104
+ exact: i,
105
+ fetchStatus: n,
106
+ predicate: a,
107
+ queryKey: h,
108
+ stale: u
109
+ } = e;
110
+ if (h) {
111
+ if (i) {
112
+ if (t.queryHash !== de(h, t.options))
113
+ return !1;
114
+ } else if (!Ut(t.queryKey, h))
115
+ return !1;
116
+ }
117
+ if (s !== "all") {
118
+ const d = t.isActive();
119
+ if (s === "active" && !d || s === "inactive" && d)
120
+ return !1;
121
+ }
122
+ return !(typeof u == "boolean" && t.isStale() !== u || n && n !== t.state.fetchStatus || a && !a(t));
123
+ }
124
+ function be(e, t) {
125
+ const { exact: s, status: i, predicate: n, mutationKey: a } = e;
126
+ if (a) {
127
+ if (!t.options.mutationKey)
128
+ return !1;
129
+ if (s) {
130
+ if (xt(t.options.mutationKey) !== xt(a))
131
+ return !1;
132
+ } else if (!Ut(t.options.mutationKey, a))
133
+ return !1;
134
+ }
135
+ return !(i && t.state.status !== i || n && !n(t));
136
+ }
137
+ function de(e, t) {
138
+ return ((t == null ? void 0 : t.queryKeyHashFn) || xt)(e);
139
+ }
140
+ function xt(e) {
141
+ return JSON.stringify(
142
+ e,
143
+ (t, s) => te(s) ? Object.keys(s).sort().reduce((i, n) => (i[n] = s[n], i), {}) : s
144
+ );
145
+ }
146
+ function Ut(e, t) {
147
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => Ut(e[s], t[s])) : !1;
148
+ }
149
+ var ss = Object.prototype.hasOwnProperty;
150
+ function Xt(e, t) {
151
+ if (e === t)
152
+ return e;
153
+ const s = we(e) && we(t);
154
+ if (!s && !(te(e) && te(t))) return t;
155
+ const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), h = a.length, u = s ? new Array(h) : {};
156
+ let d = 0;
157
+ for (let b = 0; b < h; b++) {
158
+ const E = s ? b : a[b], f = e[E], C = t[E];
159
+ if (f === C) {
160
+ u[E] = f, (s ? b < n : ss.call(e, E)) && d++;
161
+ continue;
162
+ }
163
+ if (f === null || C === null || typeof f != "object" || typeof C != "object") {
164
+ u[E] = C;
165
+ continue;
166
+ }
167
+ const y = Xt(f, C);
168
+ u[E] = y, y === f && d++;
169
+ }
170
+ return n === h && d === n ? e : u;
171
+ }
172
+ function Yt(e, t) {
173
+ if (!t || Object.keys(e).length !== Object.keys(t).length)
174
+ return !1;
175
+ for (const s in e)
176
+ if (e[s] !== t[s])
177
+ return !1;
178
+ return !0;
179
+ }
180
+ function we(e) {
181
+ return Array.isArray(e) && e.length === Object.keys(e).length;
182
+ }
183
+ function te(e) {
184
+ if (!Se(e))
185
+ return !1;
186
+ const t = e.constructor;
187
+ if (t === void 0)
188
+ return !0;
189
+ const s = t.prototype;
190
+ return !(!Se(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
191
+ }
192
+ function Se(e) {
193
+ return Object.prototype.toString.call(e) === "[object Object]";
194
+ }
195
+ function rs(e) {
196
+ return new Promise((t) => {
197
+ ht.setTimeout(t, e);
198
+ });
199
+ }
200
+ function ee(e, t, s) {
201
+ if (typeof s.structuralSharing == "function")
202
+ return s.structuralSharing(e, t);
203
+ if (s.structuralSharing !== !1) {
204
+ if (process.env.NODE_ENV !== "production")
205
+ try {
206
+ return Xt(e, t);
207
+ } catch (i) {
208
+ throw console.error(
209
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${i}`
210
+ ), i;
211
+ }
212
+ return Xt(e, t);
213
+ }
214
+ return t;
215
+ }
216
+ function is(e, t, s = 0) {
217
+ const i = [...e, t];
218
+ return s && i.length > s ? i.slice(1) : i;
219
+ }
220
+ function ns(e, t, s = 0) {
221
+ const i = [t, ...e];
222
+ return s && i.length > s ? i.slice(0, -1) : i;
223
+ }
224
+ var $t = Symbol();
225
+ function ke(e, t) {
226
+ return process.env.NODE_ENV !== "production" && e.queryFn === $t && console.error(
227
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
228
+ ), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === $t ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
229
+ }
230
+ function as(e, t) {
231
+ return typeof e == "function" ? e(...t) : !!e;
232
+ }
233
+ var lt, et, Ct, De, os = (De = class extends Kt {
234
+ constructor() {
235
+ super();
236
+ c(this, lt);
237
+ c(this, et);
238
+ c(this, Ct);
239
+ o(this, Ct, (t) => {
240
+ if (!wt && window.addEventListener) {
241
+ const s = () => t();
242
+ return window.addEventListener("visibilitychange", s, !1), () => {
243
+ window.removeEventListener("visibilitychange", s);
244
+ };
245
+ }
246
+ });
247
+ }
248
+ onSubscribe() {
249
+ r(this, et) || this.setEventListener(r(this, Ct));
250
+ }
251
+ onUnsubscribe() {
252
+ var t;
253
+ this.hasListeners() || ((t = r(this, et)) == null || t.call(this), o(this, et, void 0));
254
+ }
255
+ setEventListener(t) {
256
+ var s;
257
+ o(this, Ct, t), (s = r(this, et)) == null || s.call(this), o(this, et, t((i) => {
258
+ typeof i == "boolean" ? this.setFocused(i) : this.onFocus();
259
+ }));
260
+ }
261
+ setFocused(t) {
262
+ r(this, lt) !== t && (o(this, lt, t), this.onFocus());
263
+ }
264
+ onFocus() {
265
+ const t = this.isFocused();
266
+ this.listeners.forEach((s) => {
267
+ s(t);
268
+ });
269
+ }
270
+ isFocused() {
271
+ var t;
272
+ return typeof r(this, lt) == "boolean" ? r(this, lt) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
273
+ }
274
+ }, lt = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), De), fe = new os();
275
+ function se() {
276
+ let e, t;
277
+ const s = new Promise((n, a) => {
278
+ e = n, t = a;
279
+ });
280
+ s.status = "pending", s.catch(() => {
281
+ });
282
+ function i(n) {
283
+ Object.assign(s, n), delete s.resolve, delete s.reject;
284
+ }
285
+ return s.resolve = (n) => {
286
+ i({
287
+ status: "fulfilled",
288
+ value: n
289
+ }), e(n);
290
+ }, s.reject = (n) => {
291
+ i({
292
+ status: "rejected",
293
+ reason: n
294
+ }), t(n);
295
+ }, s;
296
+ }
297
+ var us = ts;
298
+ function hs() {
299
+ let e = [], t = 0, s = (u) => {
300
+ u();
301
+ }, i = (u) => {
302
+ u();
303
+ }, n = us;
304
+ const a = (u) => {
305
+ t ? e.push(u) : n(() => {
306
+ s(u);
307
+ });
308
+ }, h = () => {
309
+ const u = e;
310
+ e = [], u.length && n(() => {
311
+ i(() => {
312
+ u.forEach((d) => {
313
+ s(d);
314
+ });
315
+ });
316
+ });
317
+ };
318
+ return {
319
+ batch: (u) => {
320
+ let d;
321
+ t++;
322
+ try {
323
+ d = u();
324
+ } finally {
325
+ t--, t || h();
326
+ }
327
+ return d;
328
+ },
329
+ /**
330
+ * All calls to the wrapped function will be batched.
331
+ */
332
+ batchCalls: (u) => (...d) => {
333
+ a(() => {
334
+ u(...d);
335
+ });
336
+ },
337
+ schedule: a,
338
+ /**
339
+ * Use this method to set a custom notify function.
340
+ * This can be used to for example wrap notifications with `React.act` while running tests.
341
+ */
342
+ setNotifyFunction: (u) => {
343
+ s = u;
344
+ },
345
+ /**
346
+ * Use this method to set a custom function to batch notifications together into a single tick.
347
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
348
+ */
349
+ setBatchNotifyFunction: (u) => {
350
+ i = u;
351
+ },
352
+ setScheduler: (u) => {
353
+ n = u;
354
+ }
355
+ };
356
+ }
357
+ var T = hs(), Ot, st, Et, Te, cs = (Te = class extends Kt {
358
+ constructor() {
359
+ super();
360
+ c(this, Ot, !0);
361
+ c(this, st);
362
+ c(this, Et);
363
+ o(this, Et, (t) => {
364
+ if (!wt && window.addEventListener) {
365
+ const s = () => t(!0), i = () => t(!1);
366
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", i, !1), () => {
367
+ window.removeEventListener("online", s), window.removeEventListener("offline", i);
368
+ };
369
+ }
370
+ });
371
+ }
372
+ onSubscribe() {
373
+ r(this, st) || this.setEventListener(r(this, Et));
374
+ }
375
+ onUnsubscribe() {
376
+ var t;
377
+ this.hasListeners() || ((t = r(this, st)) == null || t.call(this), o(this, st, void 0));
378
+ }
379
+ setEventListener(t) {
380
+ var s;
381
+ o(this, Et, t), (s = r(this, st)) == null || s.call(this), o(this, st, t(this.setOnline.bind(this)));
382
+ }
383
+ setOnline(t) {
384
+ r(this, Ot) !== t && (o(this, Ot, t), this.listeners.forEach((i) => {
385
+ i(t);
386
+ }));
387
+ }
388
+ isOnline() {
389
+ return r(this, Ot);
390
+ }
391
+ }, Ot = new WeakMap(), st = new WeakMap(), Et = new WeakMap(), Te), Wt = new cs();
392
+ function ls(e) {
393
+ return Math.min(1e3 * 2 ** e, 3e4);
394
+ }
395
+ function Le(e) {
396
+ return (e ?? "online") === "online" ? Wt.isOnline() : !0;
397
+ }
398
+ var re = class extends Error {
399
+ constructor(e) {
400
+ super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
401
+ }
402
+ };
403
+ function Ke(e) {
404
+ let t = !1, s = 0, i;
405
+ const n = se(), a = () => n.status !== "pending", h = (m) => {
406
+ var p;
407
+ if (!a()) {
408
+ const O = new re(m);
409
+ C(O), (p = e.onCancel) == null || p.call(e, O);
410
+ }
411
+ }, u = () => {
412
+ t = !0;
413
+ }, d = () => {
414
+ t = !1;
415
+ }, b = () => fe.isFocused() && (e.networkMode === "always" || Wt.isOnline()) && e.canRun(), E = () => Le(e.networkMode) && e.canRun(), f = (m) => {
416
+ a() || (i == null || i(), n.resolve(m));
417
+ }, C = (m) => {
418
+ a() || (i == null || i(), n.reject(m));
419
+ }, y = () => new Promise((m) => {
420
+ var p;
421
+ i = (O) => {
422
+ (a() || b()) && m(O);
423
+ }, (p = e.onPause) == null || p.call(e);
424
+ }).then(() => {
425
+ var m;
426
+ i = void 0, a() || (m = e.onContinue) == null || m.call(e);
427
+ }), R = () => {
428
+ if (a())
429
+ return;
430
+ let m;
431
+ const p = s === 0 ? e.initialPromise : void 0;
432
+ try {
433
+ m = p ?? e.fn();
434
+ } catch (O) {
435
+ m = Promise.reject(O);
436
+ }
437
+ Promise.resolve(m).then(f).catch((O) => {
438
+ var x;
439
+ if (a())
440
+ return;
441
+ const M = e.retry ?? (wt ? 0 : 3), P = e.retryDelay ?? ls, l = typeof P == "function" ? P(s, O) : P, Q = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, O);
442
+ if (t || !Q) {
443
+ C(O);
444
+ return;
445
+ }
446
+ s++, (x = e.onFail) == null || x.call(e, s, O), rs(l).then(() => b() ? void 0 : y()).then(() => {
447
+ t ? C(O) : R();
448
+ });
449
+ });
450
+ };
451
+ return {
452
+ promise: n,
453
+ status: () => n.status,
454
+ cancel: h,
455
+ continue: () => (i == null || i(), n),
456
+ cancelRetry: u,
457
+ continueRetry: d,
458
+ canStart: E,
459
+ start: () => (E() ? R() : y().then(R), n)
460
+ };
461
+ }
462
+ var dt, Ie, He = (Ie = class {
463
+ constructor() {
464
+ c(this, dt);
465
+ }
466
+ destroy() {
467
+ this.clearGcTimeout();
468
+ }
469
+ scheduleGc() {
470
+ this.clearGcTimeout(), Zt(this.gcTime) && o(this, dt, ht.setTimeout(() => {
471
+ this.optionalRemove();
472
+ }, this.gcTime));
473
+ }
474
+ updateGcTime(e) {
475
+ this.gcTime = Math.max(
476
+ this.gcTime || 0,
477
+ e ?? (wt ? 1 / 0 : 300 * 1e3)
478
+ );
479
+ }
480
+ clearGcTimeout() {
481
+ r(this, dt) && (ht.clearTimeout(r(this, dt)), o(this, dt, void 0));
482
+ }
483
+ }, dt = new WeakMap(), Ie), ft, Pt, _, yt, D, jt, pt, K, $, qe, ds = (qe = class extends He {
484
+ constructor(t) {
485
+ super();
486
+ c(this, K);
487
+ c(this, ft);
488
+ c(this, Pt);
489
+ c(this, _);
490
+ c(this, yt);
491
+ c(this, D);
492
+ c(this, jt);
493
+ c(this, pt);
494
+ o(this, pt, !1), o(this, jt, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, yt, t.client), o(this, _, r(this, yt).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, ft, Oe(this.options)), this.state = t.state ?? r(this, ft), this.scheduleGc();
495
+ }
496
+ get meta() {
497
+ return this.options.meta;
498
+ }
499
+ get promise() {
500
+ var t;
501
+ return (t = r(this, D)) == null ? void 0 : t.promise;
502
+ }
503
+ setOptions(t) {
504
+ if (this.options = { ...r(this, jt), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
505
+ const s = Oe(this.options);
506
+ s.data !== void 0 && (this.setState(
507
+ Ce(s.data, s.dataUpdatedAt)
508
+ ), o(this, ft, s));
509
+ }
510
+ }
511
+ optionalRemove() {
512
+ !this.observers.length && this.state.fetchStatus === "idle" && r(this, _).remove(this);
513
+ }
514
+ setData(t, s) {
515
+ const i = ee(this.state.data, t, this.options);
516
+ return v(this, K, $).call(this, {
517
+ data: i,
518
+ type: "success",
519
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
520
+ manual: s == null ? void 0 : s.manual
521
+ }), i;
522
+ }
523
+ setState(t, s) {
524
+ v(this, K, $).call(this, { type: "setState", state: t, setStateOptions: s });
525
+ }
526
+ cancel(t) {
527
+ var i, n;
528
+ const s = (i = r(this, D)) == null ? void 0 : i.promise;
529
+ return (n = r(this, D)) == null || n.cancel(t), s ? s.then(j).catch(j) : Promise.resolve();
530
+ }
531
+ destroy() {
532
+ super.destroy(), this.cancel({ silent: !0 });
533
+ }
534
+ reset() {
535
+ this.destroy(), this.setState(r(this, ft));
536
+ }
537
+ isActive() {
538
+ return this.observers.some(
539
+ (t) => k(t.options.enabled, this) !== !1
540
+ );
541
+ }
542
+ isDisabled() {
543
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === $t || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
544
+ }
545
+ isStatic() {
546
+ return this.getObserversCount() > 0 ? this.observers.some(
547
+ (t) => ut(t.options.staleTime, this) === "static"
548
+ ) : !1;
549
+ }
550
+ isStale() {
551
+ return this.getObserversCount() > 0 ? this.observers.some(
552
+ (t) => t.getCurrentResult().isStale
553
+ ) : this.state.data === void 0 || this.state.isInvalidated;
554
+ }
555
+ isStaleByTime(t = 0) {
556
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !_e(this.state.dataUpdatedAt, t);
557
+ }
558
+ onFocus() {
559
+ var s;
560
+ const t = this.observers.find((i) => i.shouldFetchOnWindowFocus());
561
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = r(this, D)) == null || s.continue();
562
+ }
563
+ onOnline() {
564
+ var s;
565
+ const t = this.observers.find((i) => i.shouldFetchOnReconnect());
566
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = r(this, D)) == null || s.continue();
567
+ }
568
+ addObserver(t) {
569
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), r(this, _).notify({ type: "observerAdded", query: this, observer: t }));
570
+ }
571
+ removeObserver(t) {
572
+ this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (r(this, D) && (r(this, pt) ? r(this, D).cancel({ revert: !0 }) : r(this, D).cancelRetry()), this.scheduleGc()), r(this, _).notify({ type: "observerRemoved", query: this, observer: t }));
573
+ }
574
+ getObserversCount() {
575
+ return this.observers.length;
576
+ }
577
+ invalidate() {
578
+ this.state.isInvalidated || v(this, K, $).call(this, { type: "invalidate" });
579
+ }
580
+ async fetch(t, s) {
581
+ var d, b, E, f, C, y, R, m, p, O, M, P;
582
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
583
+ // re-start the fetch; there is a chance that the query is still in a
584
+ // pending state when that happens
585
+ ((d = r(this, D)) == null ? void 0 : d.status()) !== "rejected") {
586
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
587
+ this.cancel({ silent: !0 });
588
+ else if (r(this, D))
589
+ return r(this, D).continueRetry(), r(this, D).promise;
590
+ }
591
+ if (t && this.setOptions(t), !this.options.queryFn) {
592
+ const l = this.observers.find((Q) => Q.options.queryFn);
593
+ l && this.setOptions(l.options);
594
+ }
595
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
596
+ "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
597
+ ));
598
+ const i = new AbortController(), n = (l) => {
599
+ Object.defineProperty(l, "signal", {
600
+ enumerable: !0,
601
+ get: () => (o(this, pt, !0), i.signal)
602
+ });
603
+ }, a = () => {
604
+ const l = ke(this.options, s), x = (() => {
605
+ const Z = {
606
+ client: r(this, yt),
607
+ queryKey: this.queryKey,
608
+ meta: this.meta
609
+ };
610
+ return n(Z), Z;
611
+ })();
612
+ return o(this, pt, !1), this.options.persister ? this.options.persister(
613
+ l,
614
+ x,
615
+ this
616
+ ) : l(x);
617
+ }, u = (() => {
618
+ const l = {
619
+ fetchOptions: s,
620
+ options: this.options,
621
+ queryKey: this.queryKey,
622
+ client: r(this, yt),
623
+ state: this.state,
624
+ fetchFn: a
625
+ };
626
+ return n(l), l;
627
+ })();
628
+ (b = this.options.behavior) == null || b.onFetch(u, this), o(this, Pt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((E = u.fetchOptions) == null ? void 0 : E.meta)) && v(this, K, $).call(this, { type: "fetch", meta: (f = u.fetchOptions) == null ? void 0 : f.meta }), o(this, D, Ke({
629
+ initialPromise: s == null ? void 0 : s.initialPromise,
630
+ fn: u.fetchFn,
631
+ onCancel: (l) => {
632
+ l instanceof re && l.revert && this.setState({
633
+ ...r(this, Pt),
634
+ fetchStatus: "idle"
635
+ }), i.abort();
636
+ },
637
+ onFail: (l, Q) => {
638
+ v(this, K, $).call(this, { type: "failed", failureCount: l, error: Q });
639
+ },
640
+ onPause: () => {
641
+ v(this, K, $).call(this, { type: "pause" });
642
+ },
643
+ onContinue: () => {
644
+ v(this, K, $).call(this, { type: "continue" });
645
+ },
646
+ retry: u.options.retry,
647
+ retryDelay: u.options.retryDelay,
648
+ networkMode: u.options.networkMode,
649
+ canRun: () => !0
650
+ }));
651
+ try {
652
+ const l = await r(this, D).start();
653
+ if (l === void 0)
654
+ throw process.env.NODE_ENV !== "production" && console.error(
655
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
656
+ ), new Error(`${this.queryHash} data is undefined`);
657
+ return this.setData(l), (y = (C = r(this, _).config).onSuccess) == null || y.call(C, l, this), (m = (R = r(this, _).config).onSettled) == null || m.call(
658
+ R,
659
+ l,
660
+ this.state.error,
661
+ this
662
+ ), l;
663
+ } catch (l) {
664
+ if (l instanceof re) {
665
+ if (l.silent)
666
+ return r(this, D).promise;
667
+ if (l.revert) {
668
+ if (this.state.data === void 0)
669
+ throw l;
670
+ return this.state.data;
671
+ }
672
+ }
673
+ throw v(this, K, $).call(this, {
674
+ type: "error",
675
+ error: l
676
+ }), (O = (p = r(this, _).config).onError) == null || O.call(
677
+ p,
678
+ l,
679
+ this
680
+ ), (P = (M = r(this, _).config).onSettled) == null || P.call(
681
+ M,
682
+ this.state.data,
683
+ l,
684
+ this
685
+ ), l;
686
+ } finally {
687
+ this.scheduleGc();
688
+ }
689
+ }
690
+ }, ft = new WeakMap(), Pt = new WeakMap(), _ = new WeakMap(), yt = new WeakMap(), D = new WeakMap(), jt = new WeakMap(), pt = new WeakMap(), K = new WeakSet(), $ = function(t) {
691
+ const s = (i) => {
692
+ switch (t.type) {
693
+ case "failed":
694
+ return {
695
+ ...i,
696
+ fetchFailureCount: t.failureCount,
697
+ fetchFailureReason: t.error
698
+ };
699
+ case "pause":
700
+ return {
701
+ ...i,
702
+ fetchStatus: "paused"
703
+ };
704
+ case "continue":
705
+ return {
706
+ ...i,
707
+ fetchStatus: "fetching"
708
+ };
709
+ case "fetch":
710
+ return {
711
+ ...i,
712
+ ...Ge(i.data, this.options),
713
+ fetchMeta: t.meta ?? null
714
+ };
715
+ case "success":
716
+ const n = {
717
+ ...i,
718
+ ...Ce(t.data, t.dataUpdatedAt),
719
+ dataUpdateCount: i.dataUpdateCount + 1,
720
+ ...!t.manual && {
721
+ fetchStatus: "idle",
722
+ fetchFailureCount: 0,
723
+ fetchFailureReason: null
724
+ }
725
+ };
726
+ return o(this, Pt, t.manual ? n : void 0), n;
727
+ case "error":
728
+ const a = t.error;
729
+ return {
730
+ ...i,
731
+ error: a,
732
+ errorUpdateCount: i.errorUpdateCount + 1,
733
+ errorUpdatedAt: Date.now(),
734
+ fetchFailureCount: i.fetchFailureCount + 1,
735
+ fetchFailureReason: a,
736
+ fetchStatus: "idle",
737
+ status: "error"
738
+ };
739
+ case "invalidate":
740
+ return {
741
+ ...i,
742
+ isInvalidated: !0
743
+ };
744
+ case "setState":
745
+ return {
746
+ ...i,
747
+ ...t.state
748
+ };
749
+ }
750
+ };
751
+ this.state = s(this.state), T.batch(() => {
752
+ this.observers.forEach((i) => {
753
+ i.onQueryUpdate();
754
+ }), r(this, _).notify({ query: this, type: "updated", action: t });
755
+ });
756
+ }, qe);
757
+ function Ge(e, t) {
758
+ return {
759
+ fetchFailureCount: 0,
760
+ fetchFailureReason: null,
761
+ fetchStatus: Le(t.networkMode) ? "fetching" : "paused",
762
+ ...e === void 0 && {
763
+ error: null,
764
+ status: "pending"
765
+ }
766
+ };
767
+ }
768
+ function Ce(e, t) {
769
+ return {
770
+ data: e,
771
+ dataUpdatedAt: t ?? Date.now(),
772
+ error: null,
773
+ isInvalidated: !1,
774
+ status: "success"
775
+ };
776
+ }
777
+ function Oe(e) {
778
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, i = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
779
+ return {
780
+ data: t,
781
+ dataUpdateCount: 0,
782
+ dataUpdatedAt: s ? i ?? Date.now() : 0,
783
+ error: null,
784
+ errorUpdateCount: 0,
785
+ errorUpdatedAt: 0,
786
+ fetchFailureCount: 0,
787
+ fetchFailureReason: null,
788
+ fetchMeta: null,
789
+ isInvalidated: !1,
790
+ status: s ? "success" : "pending",
791
+ fetchStatus: "idle"
792
+ };
793
+ }
794
+ var U, g, Nt, q, mt, Ft, W, rt, _t, Rt, Mt, vt, gt, it, Qt, S, At, ie, ne, ae, oe, ue, he, ce, Be, Ae, fs = (Ae = class extends Kt {
795
+ constructor(t, s) {
796
+ super();
797
+ c(this, S);
798
+ c(this, U);
799
+ c(this, g);
800
+ c(this, Nt);
801
+ c(this, q);
802
+ c(this, mt);
803
+ c(this, Ft);
804
+ c(this, W);
805
+ c(this, rt);
806
+ c(this, _t);
807
+ c(this, Rt);
808
+ // This property keeps track of the last query with defined data.
809
+ // It will be used to pass the previous data and query to the placeholder function between renders.
810
+ c(this, Mt);
811
+ c(this, vt);
812
+ c(this, gt);
813
+ c(this, it);
814
+ c(this, Qt, /* @__PURE__ */ new Set());
815
+ this.options = s, o(this, U, t), o(this, rt, null), o(this, W, se()), this.bindMethods(), this.setOptions(s);
816
+ }
817
+ bindMethods() {
818
+ this.refetch = this.refetch.bind(this);
819
+ }
820
+ onSubscribe() {
821
+ this.listeners.size === 1 && (r(this, g).addObserver(this), Ee(r(this, g), this.options) ? v(this, S, At).call(this) : this.updateResult(), v(this, S, oe).call(this));
822
+ }
823
+ onUnsubscribe() {
824
+ this.hasListeners() || this.destroy();
825
+ }
826
+ shouldFetchOnReconnect() {
827
+ return le(
828
+ r(this, g),
829
+ this.options,
830
+ this.options.refetchOnReconnect
831
+ );
832
+ }
833
+ shouldFetchOnWindowFocus() {
834
+ return le(
835
+ r(this, g),
836
+ this.options,
837
+ this.options.refetchOnWindowFocus
838
+ );
839
+ }
840
+ destroy() {
841
+ this.listeners = /* @__PURE__ */ new Set(), v(this, S, ue).call(this), v(this, S, he).call(this), r(this, g).removeObserver(this);
842
+ }
843
+ setOptions(t) {
844
+ const s = this.options, i = r(this, g);
845
+ if (this.options = r(this, U).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, r(this, g)) != "boolean")
846
+ throw new Error(
847
+ "Expected enabled to be a boolean or a callback that returns a boolean"
848
+ );
849
+ v(this, S, ce).call(this), r(this, g).setOptions(this.options), s._defaulted && !Yt(this.options, s) && r(this, U).getQueryCache().notify({
850
+ type: "observerOptionsUpdated",
851
+ query: r(this, g),
852
+ observer: this
853
+ });
854
+ const n = this.hasListeners();
855
+ n && Pe(
856
+ r(this, g),
857
+ i,
858
+ this.options,
859
+ s
860
+ ) && v(this, S, At).call(this), this.updateResult(), n && (r(this, g) !== i || k(this.options.enabled, r(this, g)) !== k(s.enabled, r(this, g)) || ut(this.options.staleTime, r(this, g)) !== ut(s.staleTime, r(this, g))) && v(this, S, ie).call(this);
861
+ const a = v(this, S, ne).call(this);
862
+ n && (r(this, g) !== i || k(this.options.enabled, r(this, g)) !== k(s.enabled, r(this, g)) || a !== r(this, it)) && v(this, S, ae).call(this, a);
863
+ }
864
+ getOptimisticResult(t) {
865
+ const s = r(this, U).getQueryCache().build(r(this, U), t), i = this.createResult(s, t);
866
+ return ps(this, i) && (o(this, q, i), o(this, Ft, this.options), o(this, mt, r(this, g).state)), i;
867
+ }
868
+ getCurrentResult() {
869
+ return r(this, q);
870
+ }
871
+ trackResult(t, s) {
872
+ return new Proxy(t, {
873
+ get: (i, n) => (this.trackProp(n), s == null || s(n), n === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && r(this, W).status === "pending" && r(this, W).reject(
874
+ new Error(
875
+ "experimental_prefetchInRender feature flag is not enabled"
876
+ )
877
+ )), Reflect.get(i, n))
878
+ });
879
+ }
880
+ trackProp(t) {
881
+ r(this, Qt).add(t);
882
+ }
883
+ getCurrentQuery() {
884
+ return r(this, g);
885
+ }
886
+ refetch({ ...t } = {}) {
887
+ return this.fetch({
888
+ ...t
889
+ });
890
+ }
891
+ fetchOptimistic(t) {
892
+ const s = r(this, U).defaultQueryOptions(t), i = r(this, U).getQueryCache().build(r(this, U), s);
893
+ return i.fetch().then(() => this.createResult(i, s));
894
+ }
895
+ fetch(t) {
896
+ return v(this, S, At).call(this, {
897
+ ...t,
898
+ cancelRefetch: t.cancelRefetch ?? !0
899
+ }).then(() => (this.updateResult(), r(this, q)));
900
+ }
901
+ createResult(t, s) {
902
+ var X;
903
+ const i = r(this, g), n = this.options, a = r(this, q), h = r(this, mt), u = r(this, Ft), b = t !== i ? t.state : r(this, Nt), { state: E } = t;
904
+ let f = { ...E }, C = !1, y;
905
+ if (s._optimisticResults) {
906
+ const w = this.hasListeners(), N = !w && Ee(t, s), St = w && Pe(t, i, s, n);
907
+ (N || St) && (f = {
908
+ ...f,
909
+ ...Ge(E.data, t.options)
910
+ }), s._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
911
+ }
912
+ let { error: R, errorUpdatedAt: m, status: p } = f;
913
+ y = f.data;
914
+ let O = !1;
915
+ if (s.placeholderData !== void 0 && y === void 0 && p === "pending") {
916
+ let w;
917
+ a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (w = a.data, O = !0) : w = typeof s.placeholderData == "function" ? s.placeholderData(
918
+ (X = r(this, Mt)) == null ? void 0 : X.state.data,
919
+ r(this, Mt)
920
+ ) : s.placeholderData, w !== void 0 && (p = "success", y = ee(
921
+ a == null ? void 0 : a.data,
922
+ w,
923
+ s
924
+ ), C = !0);
925
+ }
926
+ if (s.select && y !== void 0 && !O)
927
+ if (a && y === (h == null ? void 0 : h.data) && s.select === r(this, _t))
928
+ y = r(this, Rt);
929
+ else
930
+ try {
931
+ o(this, _t, s.select), y = s.select(y), y = ee(a == null ? void 0 : a.data, y, s), o(this, Rt, y), o(this, rt, null);
932
+ } catch (w) {
933
+ o(this, rt, w);
934
+ }
935
+ r(this, rt) && (R = r(this, rt), y = r(this, Rt), m = Date.now(), p = "error");
936
+ const M = f.fetchStatus === "fetching", P = p === "pending", l = p === "error", Q = P && M, x = y !== void 0, I = {
937
+ status: p,
938
+ fetchStatus: f.fetchStatus,
939
+ isPending: P,
940
+ isSuccess: p === "success",
941
+ isError: l,
942
+ isInitialLoading: Q,
943
+ isLoading: Q,
944
+ data: y,
945
+ dataUpdatedAt: f.dataUpdatedAt,
946
+ error: R,
947
+ errorUpdatedAt: m,
948
+ failureCount: f.fetchFailureCount,
949
+ failureReason: f.fetchFailureReason,
950
+ errorUpdateCount: f.errorUpdateCount,
951
+ isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
952
+ isFetchedAfterMount: f.dataUpdateCount > b.dataUpdateCount || f.errorUpdateCount > b.errorUpdateCount,
953
+ isFetching: M,
954
+ isRefetching: M && !P,
955
+ isLoadingError: l && !x,
956
+ isPaused: f.fetchStatus === "paused",
957
+ isPlaceholderData: C,
958
+ isRefetchError: l && x,
959
+ isStale: ye(t, s),
960
+ refetch: this.refetch,
961
+ promise: r(this, W),
962
+ isEnabled: k(s.enabled, t) !== !1
963
+ };
964
+ if (this.options.experimental_prefetchInRender) {
965
+ const w = (Ht) => {
966
+ I.status === "error" ? Ht.reject(I.error) : I.data !== void 0 && Ht.resolve(I.data);
967
+ }, N = () => {
968
+ const Ht = o(this, W, I.promise = se());
969
+ w(Ht);
970
+ }, St = r(this, W);
971
+ switch (St.status) {
972
+ case "pending":
973
+ t.queryHash === i.queryHash && w(St);
974
+ break;
975
+ case "fulfilled":
976
+ (I.status === "error" || I.data !== St.value) && N();
977
+ break;
978
+ case "rejected":
979
+ (I.status !== "error" || I.error !== St.reason) && N();
980
+ break;
981
+ }
982
+ }
983
+ return I;
984
+ }
985
+ updateResult() {
986
+ const t = r(this, q), s = this.createResult(r(this, g), this.options);
987
+ if (o(this, mt, r(this, g).state), o(this, Ft, this.options), r(this, mt).data !== void 0 && o(this, Mt, r(this, g)), Yt(s, t))
988
+ return;
989
+ o(this, q, s);
990
+ const i = () => {
991
+ if (!t)
992
+ return !0;
993
+ const { notifyOnChangeProps: n } = this.options, a = typeof n == "function" ? n() : n;
994
+ if (a === "all" || !a && !r(this, Qt).size)
995
+ return !0;
996
+ const h = new Set(
997
+ a ?? r(this, Qt)
998
+ );
999
+ return this.options.throwOnError && h.add("error"), Object.keys(r(this, q)).some((u) => {
1000
+ const d = u;
1001
+ return r(this, q)[d] !== t[d] && h.has(d);
1002
+ });
1003
+ };
1004
+ v(this, S, Be).call(this, { listeners: i() });
1005
+ }
1006
+ onQueryUpdate() {
1007
+ this.updateResult(), this.hasListeners() && v(this, S, oe).call(this);
1008
+ }
1009
+ }, U = new WeakMap(), g = new WeakMap(), Nt = new WeakMap(), q = new WeakMap(), mt = new WeakMap(), Ft = new WeakMap(), W = new WeakMap(), rt = new WeakMap(), _t = new WeakMap(), Rt = new WeakMap(), Mt = new WeakMap(), vt = new WeakMap(), gt = new WeakMap(), it = new WeakMap(), Qt = new WeakMap(), S = new WeakSet(), At = function(t) {
1010
+ v(this, S, ce).call(this);
1011
+ let s = r(this, g).fetch(
1012
+ this.options,
1013
+ t
1014
+ );
1015
+ return t != null && t.throwOnError || (s = s.catch(j)), s;
1016
+ }, ie = function() {
1017
+ v(this, S, ue).call(this);
1018
+ const t = ut(
1019
+ this.options.staleTime,
1020
+ r(this, g)
1021
+ );
1022
+ if (wt || r(this, q).isStale || !Zt(t))
1023
+ return;
1024
+ const i = _e(r(this, q).dataUpdatedAt, t) + 1;
1025
+ o(this, vt, ht.setTimeout(() => {
1026
+ r(this, q).isStale || this.updateResult();
1027
+ }, i));
1028
+ }, ne = function() {
1029
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(r(this, g)) : this.options.refetchInterval) ?? !1;
1030
+ }, ae = function(t) {
1031
+ v(this, S, he).call(this), o(this, it, t), !(wt || k(this.options.enabled, r(this, g)) === !1 || !Zt(r(this, it)) || r(this, it) === 0) && o(this, gt, ht.setInterval(() => {
1032
+ (this.options.refetchIntervalInBackground || fe.isFocused()) && v(this, S, At).call(this);
1033
+ }, r(this, it)));
1034
+ }, oe = function() {
1035
+ v(this, S, ie).call(this), v(this, S, ae).call(this, v(this, S, ne).call(this));
1036
+ }, ue = function() {
1037
+ r(this, vt) && (ht.clearTimeout(r(this, vt)), o(this, vt, void 0));
1038
+ }, he = function() {
1039
+ r(this, gt) && (ht.clearInterval(r(this, gt)), o(this, gt, void 0));
1040
+ }, ce = function() {
1041
+ const t = r(this, U).getQueryCache().build(r(this, U), this.options);
1042
+ if (t === r(this, g))
1043
+ return;
1044
+ const s = r(this, g);
1045
+ o(this, g, t), o(this, Nt, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1046
+ }, Be = function(t) {
1047
+ T.batch(() => {
1048
+ t.listeners && this.listeners.forEach((s) => {
1049
+ s(r(this, q));
1050
+ }), r(this, U).getQueryCache().notify({
1051
+ query: r(this, g),
1052
+ type: "observerResultsUpdated"
1053
+ });
1054
+ });
1055
+ }, Ae);
1056
+ function ys(e, t) {
1057
+ return k(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
1058
+ }
1059
+ function Ee(e, t) {
1060
+ return ys(e, t) || e.state.data !== void 0 && le(e, t, t.refetchOnMount);
1061
+ }
1062
+ function le(e, t, s) {
1063
+ if (k(t.enabled, e) !== !1 && ut(t.staleTime, e) !== "static") {
1064
+ const i = typeof s == "function" ? s(e) : s;
1065
+ return i === "always" || i !== !1 && ye(e, t);
1066
+ }
1067
+ return !1;
1068
+ }
1069
+ function Pe(e, t, s, i) {
1070
+ return (e !== t || k(i.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ye(e, s);
1071
+ }
1072
+ function ye(e, t) {
1073
+ return k(t.enabled, e) !== !1 && e.isStaleByTime(ut(t.staleTime, e));
1074
+ }
1075
+ function ps(e, t) {
1076
+ return !Yt(e.getCurrentResult(), t);
1077
+ }
1078
+ function Fe(e) {
1079
+ return {
1080
+ onFetch: (t, s) => {
1081
+ var E, f, C, y, R;
1082
+ const i = t.options, n = (C = (f = (E = t.fetchOptions) == null ? void 0 : E.meta) == null ? void 0 : f.fetchMore) == null ? void 0 : C.direction, a = ((y = t.state.data) == null ? void 0 : y.pages) || [], h = ((R = t.state.data) == null ? void 0 : R.pageParams) || [];
1083
+ let u = { pages: [], pageParams: [] }, d = 0;
1084
+ const b = async () => {
1085
+ let m = !1;
1086
+ const p = (P) => {
1087
+ Object.defineProperty(P, "signal", {
1088
+ enumerable: !0,
1089
+ get: () => (t.signal.aborted ? m = !0 : t.signal.addEventListener("abort", () => {
1090
+ m = !0;
1091
+ }), t.signal)
1092
+ });
1093
+ }, O = ke(t.options, t.fetchOptions), M = async (P, l, Q) => {
1094
+ if (m)
1095
+ return Promise.reject();
1096
+ if (l == null && P.pages.length)
1097
+ return Promise.resolve(P);
1098
+ const Z = (() => {
1099
+ const N = {
1100
+ client: t.client,
1101
+ queryKey: t.queryKey,
1102
+ pageParam: l,
1103
+ direction: Q ? "backward" : "forward",
1104
+ meta: t.options.meta
1105
+ };
1106
+ return p(N), N;
1107
+ })(), I = await O(Z), { maxPages: X } = t.options, w = Q ? ns : is;
1108
+ return {
1109
+ pages: w(P.pages, I, X),
1110
+ pageParams: w(P.pageParams, l, X)
1111
+ };
1112
+ };
1113
+ if (n && a.length) {
1114
+ const P = n === "backward", l = P ? ms : Re, Q = {
1115
+ pages: a,
1116
+ pageParams: h
1117
+ }, x = l(i, Q);
1118
+ u = await M(Q, x, P);
1119
+ } else {
1120
+ const P = e ?? a.length;
1121
+ do {
1122
+ const l = d === 0 ? h[0] ?? i.initialPageParam : Re(i, u);
1123
+ if (d > 0 && l == null)
1124
+ break;
1125
+ u = await M(u, l), d++;
1126
+ } while (d < P);
1127
+ }
1128
+ return u;
1129
+ };
1130
+ t.options.persister ? t.fetchFn = () => {
1131
+ var m, p;
1132
+ return (p = (m = t.options).persister) == null ? void 0 : p.call(
1133
+ m,
1134
+ b,
1135
+ {
1136
+ client: t.client,
1137
+ queryKey: t.queryKey,
1138
+ meta: t.options.meta,
1139
+ signal: t.signal
1140
+ },
1141
+ s
1142
+ );
1143
+ } : t.fetchFn = b;
1144
+ }
1145
+ };
1146
+ }
1147
+ function Re(e, { pages: t, pageParams: s }) {
1148
+ const i = t.length - 1;
1149
+ return t.length > 0 ? e.getNextPageParam(
1150
+ t[i],
1151
+ t,
1152
+ s[i],
1153
+ s
1154
+ ) : void 0;
1155
+ }
1156
+ function ms(e, { pages: t, pageParams: s }) {
1157
+ var i;
1158
+ return t.length > 0 ? (i = e.getPreviousPageParam) == null ? void 0 : i.call(e, t[0], t, s[0], s) : void 0;
1159
+ }
1160
+ var kt, B, A, bt, V, tt, xe, vs = (xe = class extends He {
1161
+ constructor(t) {
1162
+ super();
1163
+ c(this, V);
1164
+ c(this, kt);
1165
+ c(this, B);
1166
+ c(this, A);
1167
+ c(this, bt);
1168
+ o(this, kt, t.client), this.mutationId = t.mutationId, o(this, A, t.mutationCache), o(this, B, []), this.state = t.state || gs(), this.setOptions(t.options), this.scheduleGc();
1169
+ }
1170
+ setOptions(t) {
1171
+ this.options = t, this.updateGcTime(this.options.gcTime);
1172
+ }
1173
+ get meta() {
1174
+ return this.options.meta;
1175
+ }
1176
+ addObserver(t) {
1177
+ r(this, B).includes(t) || (r(this, B).push(t), this.clearGcTimeout(), r(this, A).notify({
1178
+ type: "observerAdded",
1179
+ mutation: this,
1180
+ observer: t
1181
+ }));
1182
+ }
1183
+ removeObserver(t) {
1184
+ o(this, B, r(this, B).filter((s) => s !== t)), this.scheduleGc(), r(this, A).notify({
1185
+ type: "observerRemoved",
1186
+ mutation: this,
1187
+ observer: t
1188
+ });
1189
+ }
1190
+ optionalRemove() {
1191
+ r(this, B).length || (this.state.status === "pending" ? this.scheduleGc() : r(this, A).remove(this));
1192
+ }
1193
+ continue() {
1194
+ var t;
1195
+ return ((t = r(this, bt)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
1196
+ this.execute(this.state.variables);
1197
+ }
1198
+ async execute(t) {
1199
+ var h, u, d, b, E, f, C, y, R, m, p, O, M, P, l, Q, x, Z, I, X;
1200
+ const s = () => {
1201
+ v(this, V, tt).call(this, { type: "continue" });
1202
+ }, i = {
1203
+ client: r(this, kt),
1204
+ meta: this.options.meta,
1205
+ mutationKey: this.options.mutationKey
1206
+ };
1207
+ o(this, bt, Ke({
1208
+ fn: () => this.options.mutationFn ? this.options.mutationFn(t, i) : Promise.reject(new Error("No mutationFn found")),
1209
+ onFail: (w, N) => {
1210
+ v(this, V, tt).call(this, { type: "failed", failureCount: w, error: N });
1211
+ },
1212
+ onPause: () => {
1213
+ v(this, V, tt).call(this, { type: "pause" });
1214
+ },
1215
+ onContinue: s,
1216
+ retry: this.options.retry ?? 0,
1217
+ retryDelay: this.options.retryDelay,
1218
+ networkMode: this.options.networkMode,
1219
+ canRun: () => r(this, A).canRun(this)
1220
+ }));
1221
+ const n = this.state.status === "pending", a = !r(this, bt).canStart();
1222
+ try {
1223
+ if (n)
1224
+ s();
1225
+ else {
1226
+ v(this, V, tt).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (h = r(this, A).config).onMutate) == null ? void 0 : u.call(
1227
+ h,
1228
+ t,
1229
+ this,
1230
+ i
1231
+ ));
1232
+ const N = await ((b = (d = this.options).onMutate) == null ? void 0 : b.call(
1233
+ d,
1234
+ t,
1235
+ i
1236
+ ));
1237
+ N !== this.state.context && v(this, V, tt).call(this, {
1238
+ type: "pending",
1239
+ context: N,
1240
+ variables: t,
1241
+ isPaused: a
1242
+ });
1243
+ }
1244
+ const w = await r(this, bt).start();
1245
+ return await ((f = (E = r(this, A).config).onSuccess) == null ? void 0 : f.call(
1246
+ E,
1247
+ w,
1248
+ t,
1249
+ this.state.context,
1250
+ this,
1251
+ i
1252
+ )), await ((y = (C = this.options).onSuccess) == null ? void 0 : y.call(
1253
+ C,
1254
+ w,
1255
+ t,
1256
+ this.state.context,
1257
+ i
1258
+ )), await ((m = (R = r(this, A).config).onSettled) == null ? void 0 : m.call(
1259
+ R,
1260
+ w,
1261
+ null,
1262
+ this.state.variables,
1263
+ this.state.context,
1264
+ this,
1265
+ i
1266
+ )), await ((O = (p = this.options).onSettled) == null ? void 0 : O.call(
1267
+ p,
1268
+ w,
1269
+ null,
1270
+ t,
1271
+ this.state.context,
1272
+ i
1273
+ )), v(this, V, tt).call(this, { type: "success", data: w }), w;
1274
+ } catch (w) {
1275
+ try {
1276
+ throw await ((P = (M = r(this, A).config).onError) == null ? void 0 : P.call(
1277
+ M,
1278
+ w,
1279
+ t,
1280
+ this.state.context,
1281
+ this,
1282
+ i
1283
+ )), await ((Q = (l = this.options).onError) == null ? void 0 : Q.call(
1284
+ l,
1285
+ w,
1286
+ t,
1287
+ this.state.context,
1288
+ i
1289
+ )), await ((Z = (x = r(this, A).config).onSettled) == null ? void 0 : Z.call(
1290
+ x,
1291
+ void 0,
1292
+ w,
1293
+ this.state.variables,
1294
+ this.state.context,
1295
+ this,
1296
+ i
1297
+ )), await ((X = (I = this.options).onSettled) == null ? void 0 : X.call(
1298
+ I,
1299
+ void 0,
1300
+ w,
1301
+ t,
1302
+ this.state.context,
1303
+ i
1304
+ )), w;
1305
+ } finally {
1306
+ v(this, V, tt).call(this, { type: "error", error: w });
1307
+ }
1308
+ } finally {
1309
+ r(this, A).runNext(this);
1310
+ }
1311
+ }
1312
+ }, kt = new WeakMap(), B = new WeakMap(), A = new WeakMap(), bt = new WeakMap(), V = new WeakSet(), tt = function(t) {
1313
+ const s = (i) => {
1314
+ switch (t.type) {
1315
+ case "failed":
1316
+ return {
1317
+ ...i,
1318
+ failureCount: t.failureCount,
1319
+ failureReason: t.error
1320
+ };
1321
+ case "pause":
1322
+ return {
1323
+ ...i,
1324
+ isPaused: !0
1325
+ };
1326
+ case "continue":
1327
+ return {
1328
+ ...i,
1329
+ isPaused: !1
1330
+ };
1331
+ case "pending":
1332
+ return {
1333
+ ...i,
1334
+ context: t.context,
1335
+ data: void 0,
1336
+ failureCount: 0,
1337
+ failureReason: null,
1338
+ error: null,
1339
+ isPaused: t.isPaused,
1340
+ status: "pending",
1341
+ variables: t.variables,
1342
+ submittedAt: Date.now()
1343
+ };
1344
+ case "success":
1345
+ return {
1346
+ ...i,
1347
+ data: t.data,
1348
+ failureCount: 0,
1349
+ failureReason: null,
1350
+ error: null,
1351
+ status: "success",
1352
+ isPaused: !1
1353
+ };
1354
+ case "error":
1355
+ return {
1356
+ ...i,
1357
+ data: void 0,
1358
+ error: t.error,
1359
+ failureCount: i.failureCount + 1,
1360
+ failureReason: t.error,
1361
+ isPaused: !1,
1362
+ status: "error"
1363
+ };
1364
+ }
1365
+ };
1366
+ this.state = s(this.state), T.batch(() => {
1367
+ r(this, B).forEach((i) => {
1368
+ i.onMutationUpdate(t);
1369
+ }), r(this, A).notify({
1370
+ mutation: this,
1371
+ type: "updated",
1372
+ action: t
1373
+ });
1374
+ });
1375
+ }, xe);
1376
+ function gs() {
1377
+ return {
1378
+ context: void 0,
1379
+ data: void 0,
1380
+ error: null,
1381
+ failureCount: 0,
1382
+ failureReason: null,
1383
+ isPaused: !1,
1384
+ status: "idle",
1385
+ variables: void 0,
1386
+ submittedAt: 0
1387
+ };
1388
+ }
1389
+ var J, H, Lt, Ue, bs = (Ue = class extends Kt {
1390
+ constructor(t = {}) {
1391
+ super();
1392
+ c(this, J);
1393
+ c(this, H);
1394
+ c(this, Lt);
1395
+ this.config = t, o(this, J, /* @__PURE__ */ new Set()), o(this, H, /* @__PURE__ */ new Map()), o(this, Lt, 0);
1396
+ }
1397
+ build(t, s, i) {
1398
+ const n = new vs({
1399
+ client: t,
1400
+ mutationCache: this,
1401
+ mutationId: ++Gt(this, Lt)._,
1402
+ options: t.defaultMutationOptions(s),
1403
+ state: i
1404
+ });
1405
+ return this.add(n), n;
1406
+ }
1407
+ add(t) {
1408
+ r(this, J).add(t);
1409
+ const s = Vt(t);
1410
+ if (typeof s == "string") {
1411
+ const i = r(this, H).get(s);
1412
+ i ? i.push(t) : r(this, H).set(s, [t]);
1413
+ }
1414
+ this.notify({ type: "added", mutation: t });
1415
+ }
1416
+ remove(t) {
1417
+ if (r(this, J).delete(t)) {
1418
+ const s = Vt(t);
1419
+ if (typeof s == "string") {
1420
+ const i = r(this, H).get(s);
1421
+ if (i)
1422
+ if (i.length > 1) {
1423
+ const n = i.indexOf(t);
1424
+ n !== -1 && i.splice(n, 1);
1425
+ } else i[0] === t && r(this, H).delete(s);
1426
+ }
1427
+ }
1428
+ this.notify({ type: "removed", mutation: t });
1429
+ }
1430
+ canRun(t) {
1431
+ const s = Vt(t);
1432
+ if (typeof s == "string") {
1433
+ const i = r(this, H).get(s), n = i == null ? void 0 : i.find(
1434
+ (a) => a.state.status === "pending"
1435
+ );
1436
+ return !n || n === t;
1437
+ } else
1438
+ return !0;
1439
+ }
1440
+ runNext(t) {
1441
+ var i;
1442
+ const s = Vt(t);
1443
+ if (typeof s == "string") {
1444
+ const n = (i = r(this, H).get(s)) == null ? void 0 : i.find((a) => a !== t && a.state.isPaused);
1445
+ return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
1446
+ } else
1447
+ return Promise.resolve();
1448
+ }
1449
+ clear() {
1450
+ T.batch(() => {
1451
+ r(this, J).forEach((t) => {
1452
+ this.notify({ type: "removed", mutation: t });
1453
+ }), r(this, J).clear(), r(this, H).clear();
1454
+ });
1455
+ }
1456
+ getAll() {
1457
+ return Array.from(r(this, J));
1458
+ }
1459
+ find(t) {
1460
+ const s = { exact: !0, ...t };
1461
+ return this.getAll().find(
1462
+ (i) => be(s, i)
1463
+ );
1464
+ }
1465
+ findAll(t = {}) {
1466
+ return this.getAll().filter((s) => be(t, s));
1467
+ }
1468
+ notify(t) {
1469
+ T.batch(() => {
1470
+ this.listeners.forEach((s) => {
1471
+ s(t);
1472
+ });
1473
+ });
1474
+ }
1475
+ resumePausedMutations() {
1476
+ const t = this.getAll().filter((s) => s.state.isPaused);
1477
+ return T.batch(
1478
+ () => Promise.all(
1479
+ t.map((s) => s.continue().catch(j))
1480
+ )
1481
+ );
1482
+ }
1483
+ }, J = new WeakMap(), H = new WeakMap(), Lt = new WeakMap(), Ue);
1484
+ function Vt(e) {
1485
+ var t;
1486
+ return (t = e.options.scope) == null ? void 0 : t.id;
1487
+ }
1488
+ var z, je, ws = (je = class extends Kt {
1489
+ constructor(t = {}) {
1490
+ super();
1491
+ c(this, z);
1492
+ this.config = t, o(this, z, /* @__PURE__ */ new Map());
1493
+ }
1494
+ build(t, s, i) {
1495
+ const n = s.queryKey, a = s.queryHash ?? de(n, s);
1496
+ let h = this.get(a);
1497
+ return h || (h = new ds({
1498
+ client: t,
1499
+ queryKey: n,
1500
+ queryHash: a,
1501
+ options: t.defaultQueryOptions(s),
1502
+ state: i,
1503
+ defaultOptions: t.getQueryDefaults(n)
1504
+ }), this.add(h)), h;
1505
+ }
1506
+ add(t) {
1507
+ r(this, z).has(t.queryHash) || (r(this, z).set(t.queryHash, t), this.notify({
1508
+ type: "added",
1509
+ query: t
1510
+ }));
1511
+ }
1512
+ remove(t) {
1513
+ const s = r(this, z).get(t.queryHash);
1514
+ s && (t.destroy(), s === t && r(this, z).delete(t.queryHash), this.notify({ type: "removed", query: t }));
1515
+ }
1516
+ clear() {
1517
+ T.batch(() => {
1518
+ this.getAll().forEach((t) => {
1519
+ this.remove(t);
1520
+ });
1521
+ });
1522
+ }
1523
+ get(t) {
1524
+ return r(this, z).get(t);
1525
+ }
1526
+ getAll() {
1527
+ return [...r(this, z).values()];
1528
+ }
1529
+ find(t) {
1530
+ const s = { exact: !0, ...t };
1531
+ return this.getAll().find(
1532
+ (i) => ge(s, i)
1533
+ );
1534
+ }
1535
+ findAll(t = {}) {
1536
+ const s = this.getAll();
1537
+ return Object.keys(t).length > 0 ? s.filter((i) => ge(t, i)) : s;
1538
+ }
1539
+ notify(t) {
1540
+ T.batch(() => {
1541
+ this.listeners.forEach((s) => {
1542
+ s(t);
1543
+ });
1544
+ });
1545
+ }
1546
+ onFocus() {
1547
+ T.batch(() => {
1548
+ this.getAll().forEach((t) => {
1549
+ t.onFocus();
1550
+ });
1551
+ });
1552
+ }
1553
+ onOnline() {
1554
+ T.batch(() => {
1555
+ this.getAll().forEach((t) => {
1556
+ t.onOnline();
1557
+ });
1558
+ });
1559
+ }
1560
+ }, z = new WeakMap(), je), F, nt, at, Dt, Tt, ot, It, qt, Ne, Ss = (Ne = class {
1561
+ constructor(e = {}) {
1562
+ c(this, F);
1563
+ c(this, nt);
1564
+ c(this, at);
1565
+ c(this, Dt);
1566
+ c(this, Tt);
1567
+ c(this, ot);
1568
+ c(this, It);
1569
+ c(this, qt);
1570
+ o(this, F, e.queryCache || new ws()), o(this, nt, e.mutationCache || new bs()), o(this, at, e.defaultOptions || {}), o(this, Dt, /* @__PURE__ */ new Map()), o(this, Tt, /* @__PURE__ */ new Map()), o(this, ot, 0);
1571
+ }
1572
+ mount() {
1573
+ Gt(this, ot)._++, r(this, ot) === 1 && (o(this, It, fe.subscribe(async (e) => {
1574
+ e && (await this.resumePausedMutations(), r(this, F).onFocus());
1575
+ })), o(this, qt, Wt.subscribe(async (e) => {
1576
+ e && (await this.resumePausedMutations(), r(this, F).onOnline());
1577
+ })));
1578
+ }
1579
+ unmount() {
1580
+ var e, t;
1581
+ Gt(this, ot)._--, r(this, ot) === 0 && ((e = r(this, It)) == null || e.call(this), o(this, It, void 0), (t = r(this, qt)) == null || t.call(this), o(this, qt, void 0));
1582
+ }
1583
+ isFetching(e) {
1584
+ return r(this, F).findAll({ ...e, fetchStatus: "fetching" }).length;
1585
+ }
1586
+ isMutating(e) {
1587
+ return r(this, nt).findAll({ ...e, status: "pending" }).length;
1588
+ }
1589
+ /**
1590
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
1591
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1592
+ *
1593
+ * Hint: Do not use this function inside a component, because it won't receive updates.
1594
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1595
+ */
1596
+ getQueryData(e) {
1597
+ var s;
1598
+ const t = this.defaultQueryOptions({ queryKey: e });
1599
+ return (s = r(this, F).get(t.queryHash)) == null ? void 0 : s.state.data;
1600
+ }
1601
+ ensureQueryData(e) {
1602
+ const t = this.defaultQueryOptions(e), s = r(this, F).build(this, t), i = s.state.data;
1603
+ return i === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(ut(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(i));
1604
+ }
1605
+ getQueriesData(e) {
1606
+ return r(this, F).findAll(e).map(({ queryKey: t, state: s }) => {
1607
+ const i = s.data;
1608
+ return [t, i];
1609
+ });
1610
+ }
1611
+ setQueryData(e, t, s) {
1612
+ const i = this.defaultQueryOptions({ queryKey: e }), n = r(this, F).get(
1613
+ i.queryHash
1614
+ ), a = n == null ? void 0 : n.state.data, h = es(t, a);
1615
+ if (h !== void 0)
1616
+ return r(this, F).build(this, i).setData(h, { ...s, manual: !0 });
1617
+ }
1618
+ setQueriesData(e, t, s) {
1619
+ return T.batch(
1620
+ () => r(this, F).findAll(e).map(({ queryKey: i }) => [
1621
+ i,
1622
+ this.setQueryData(i, t, s)
1623
+ ])
1624
+ );
1625
+ }
1626
+ getQueryState(e) {
1627
+ var s;
1628
+ const t = this.defaultQueryOptions({ queryKey: e });
1629
+ return (s = r(this, F).get(
1630
+ t.queryHash
1631
+ )) == null ? void 0 : s.state;
1632
+ }
1633
+ removeQueries(e) {
1634
+ const t = r(this, F);
1635
+ T.batch(() => {
1636
+ t.findAll(e).forEach((s) => {
1637
+ t.remove(s);
1638
+ });
1639
+ });
1640
+ }
1641
+ resetQueries(e, t) {
1642
+ const s = r(this, F);
1643
+ return T.batch(() => (s.findAll(e).forEach((i) => {
1644
+ i.reset();
1645
+ }), this.refetchQueries(
1646
+ {
1647
+ type: "active",
1648
+ ...e
1649
+ },
1650
+ t
1651
+ )));
1652
+ }
1653
+ cancelQueries(e, t = {}) {
1654
+ const s = { revert: !0, ...t }, i = T.batch(
1655
+ () => r(this, F).findAll(e).map((n) => n.cancel(s))
1656
+ );
1657
+ return Promise.all(i).then(j).catch(j);
1658
+ }
1659
+ invalidateQueries(e, t = {}) {
1660
+ return T.batch(() => (r(this, F).findAll(e).forEach((s) => {
1661
+ s.invalidate();
1662
+ }), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
1663
+ {
1664
+ ...e,
1665
+ type: (e == null ? void 0 : e.refetchType) ?? (e == null ? void 0 : e.type) ?? "active"
1666
+ },
1667
+ t
1668
+ )));
1669
+ }
1670
+ refetchQueries(e, t = {}) {
1671
+ const s = {
1672
+ ...t,
1673
+ cancelRefetch: t.cancelRefetch ?? !0
1674
+ }, i = T.batch(
1675
+ () => r(this, F).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1676
+ let a = n.fetch(void 0, s);
1677
+ return s.throwOnError || (a = a.catch(j)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1678
+ })
1679
+ );
1680
+ return Promise.all(i).then(j);
1681
+ }
1682
+ fetchQuery(e) {
1683
+ const t = this.defaultQueryOptions(e);
1684
+ t.retry === void 0 && (t.retry = !1);
1685
+ const s = r(this, F).build(this, t);
1686
+ return s.isStaleByTime(
1687
+ ut(t.staleTime, s)
1688
+ ) ? s.fetch(t) : Promise.resolve(s.state.data);
1689
+ }
1690
+ prefetchQuery(e) {
1691
+ return this.fetchQuery(e).then(j).catch(j);
1692
+ }
1693
+ fetchInfiniteQuery(e) {
1694
+ return e.behavior = Fe(e.pages), this.fetchQuery(e);
1695
+ }
1696
+ prefetchInfiniteQuery(e) {
1697
+ return this.fetchInfiniteQuery(e).then(j).catch(j);
1698
+ }
1699
+ ensureInfiniteQueryData(e) {
1700
+ return e.behavior = Fe(e.pages), this.ensureQueryData(e);
1701
+ }
1702
+ resumePausedMutations() {
1703
+ return Wt.isOnline() ? r(this, nt).resumePausedMutations() : Promise.resolve();
1704
+ }
1705
+ getQueryCache() {
1706
+ return r(this, F);
1707
+ }
1708
+ getMutationCache() {
1709
+ return r(this, nt);
1710
+ }
1711
+ getDefaultOptions() {
1712
+ return r(this, at);
1713
+ }
1714
+ setDefaultOptions(e) {
1715
+ o(this, at, e);
1716
+ }
1717
+ setQueryDefaults(e, t) {
1718
+ r(this, Dt).set(xt(e), {
1719
+ queryKey: e,
1720
+ defaultOptions: t
1721
+ });
1722
+ }
1723
+ getQueryDefaults(e) {
1724
+ const t = [...r(this, Dt).values()], s = {};
1725
+ return t.forEach((i) => {
1726
+ Ut(e, i.queryKey) && Object.assign(s, i.defaultOptions);
1727
+ }), s;
1728
+ }
1729
+ setMutationDefaults(e, t) {
1730
+ r(this, Tt).set(xt(e), {
1731
+ mutationKey: e,
1732
+ defaultOptions: t
1733
+ });
1734
+ }
1735
+ getMutationDefaults(e) {
1736
+ const t = [...r(this, Tt).values()], s = {};
1737
+ return t.forEach((i) => {
1738
+ Ut(e, i.mutationKey) && Object.assign(s, i.defaultOptions);
1739
+ }), s;
1740
+ }
1741
+ defaultQueryOptions(e) {
1742
+ if (e._defaulted)
1743
+ return e;
1744
+ const t = {
1745
+ ...r(this, at).queries,
1746
+ ...this.getQueryDefaults(e.queryKey),
1747
+ ...e,
1748
+ _defaulted: !0
1749
+ };
1750
+ return t.queryHash || (t.queryHash = de(
1751
+ t.queryKey,
1752
+ t
1753
+ )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === $t && (t.enabled = !1), t;
1754
+ }
1755
+ defaultMutationOptions(e) {
1756
+ return e != null && e._defaulted ? e : {
1757
+ ...r(this, at).mutations,
1758
+ ...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
1759
+ ...e,
1760
+ _defaulted: !0
1761
+ };
1762
+ }
1763
+ clear() {
1764
+ r(this, F).clear(), r(this, nt).clear();
1765
+ }
1766
+ }, F = new WeakMap(), nt = new WeakMap(), at = new WeakMap(), Dt = new WeakMap(), Tt = new WeakMap(), ot = new WeakMap(), It = new WeakMap(), qt = new WeakMap(), Ne), Ve = L.createContext(
1767
+ void 0
1768
+ ), Cs = (e) => {
1769
+ const t = L.useContext(Ve);
1770
+ if (!t)
1771
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1772
+ return t;
1773
+ }, Os = ({
1774
+ client: e,
1775
+ children: t
1776
+ }) => (L.useEffect(() => (e.mount(), () => {
1777
+ e.unmount();
1778
+ }), [e]), /* @__PURE__ */ zt(Ve.Provider, { value: e, children: t })), ze = L.createContext(!1), Es = () => L.useContext(ze);
1779
+ ze.Provider;
1780
+ function Ps() {
1781
+ let e = !1;
1782
+ return {
1783
+ clearReset: () => {
1784
+ e = !1;
1785
+ },
1786
+ reset: () => {
1787
+ e = !0;
1788
+ },
1789
+ isReset: () => e
1790
+ };
1791
+ }
1792
+ var Fs = L.createContext(Ps()), Rs = () => L.useContext(Fs), Ms = (e, t) => {
1793
+ (e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
1794
+ }, Qs = (e) => {
1795
+ L.useEffect(() => {
1796
+ e.clearReset();
1797
+ }, [e]);
1798
+ }, Ds = ({
1799
+ result: e,
1800
+ errorResetBoundary: t,
1801
+ throwOnError: s,
1802
+ query: i,
1803
+ suspense: n
1804
+ }) => e.isError && !t.isReset() && !e.isFetching && i && (n && e.data === void 0 || as(s, [e.error, i])), Ts = (e) => {
1805
+ if (e.suspense) {
1806
+ const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), i = e.staleTime;
1807
+ e.staleTime = typeof i == "function" ? (...n) => s(i(...n)) : s(i), typeof e.gcTime == "number" && (e.gcTime = Math.max(
1808
+ e.gcTime,
1809
+ 1e3
1810
+ ));
1811
+ }
1812
+ }, Is = (e, t) => e.isLoading && e.isFetching && !t, qs = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Me = (e, t, s) => t.fetchOptimistic(e).catch(() => {
1813
+ s.clearReset();
1814
+ });
1815
+ function As(e, t, s) {
1816
+ var f, C, y, R, m;
1817
+ if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
1818
+ throw new Error(
1819
+ 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
1820
+ );
1821
+ const i = Es(), n = Rs(), a = Cs(), h = a.defaultQueryOptions(e);
1822
+ (C = (f = a.getDefaultOptions().queries) == null ? void 0 : f._experimental_beforeQuery) == null || C.call(
1823
+ f,
1824
+ h
1825
+ ), process.env.NODE_ENV !== "production" && (h.queryFn || console.error(
1826
+ `[${h.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1827
+ )), h._optimisticResults = i ? "isRestoring" : "optimistic", Ts(h), Ms(h, n), Qs(n);
1828
+ const u = !a.getQueryCache().get(h.queryHash), [d] = L.useState(
1829
+ () => new t(
1830
+ a,
1831
+ h
1832
+ )
1833
+ ), b = d.getOptimisticResult(h), E = !i && e.subscribed !== !1;
1834
+ if (L.useSyncExternalStore(
1835
+ L.useCallback(
1836
+ (p) => {
1837
+ const O = E ? d.subscribe(T.batchCalls(p)) : j;
1838
+ return d.updateResult(), O;
1839
+ },
1840
+ [d, E]
1841
+ ),
1842
+ () => d.getCurrentResult(),
1843
+ () => d.getCurrentResult()
1844
+ ), L.useEffect(() => {
1845
+ d.setOptions(h);
1846
+ }, [h, d]), qs(h, b))
1847
+ throw Me(h, d, n);
1848
+ if (Ds({
1849
+ result: b,
1850
+ errorResetBoundary: n,
1851
+ throwOnError: h.throwOnError,
1852
+ query: a.getQueryCache().get(h.queryHash),
1853
+ suspense: h.suspense
1854
+ }))
1855
+ throw b.error;
1856
+ if ((R = (y = a.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || R.call(
1857
+ y,
1858
+ h,
1859
+ b
1860
+ ), h.experimental_prefetchInRender && !wt && Is(b, i)) {
1861
+ const p = u ? (
1862
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1863
+ Me(h, d, n)
1864
+ ) : (
1865
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1866
+ (m = a.getQueryCache().get(h.queryHash)) == null ? void 0 : m.promise
1867
+ );
1868
+ p == null || p.catch(j).finally(() => {
1869
+ d.updateResult();
1870
+ });
1871
+ }
1872
+ return h.notifyOnChangeProps ? b : d.trackResult(b);
1873
+ }
1874
+ function xs(e, t) {
1875
+ return As(e, fs);
1876
+ }
1877
+ const Us = $e(void 0), js = new Ss({
1878
+ defaultOptions: {
1879
+ queries: {
1880
+ retry: 1,
1881
+ refetchOnWindowFocus: !1,
1882
+ staleTime: 1e3 * 60 * 15
1883
+ // 15 minutes
1884
+ }
1885
+ }
1886
+ });
1887
+ function Ns({
1888
+ fetchSchedule: e,
1889
+ initialSchedule: t = [],
1890
+ weeks: s,
1891
+ handleDateChanged: i = () => !0,
1892
+ children: n
1893
+ }) {
1894
+ const [a, h] = me(s[0][0].date), [u, d] = me(!1), b = We(Bt(s[0][0].date, "yyyy-MM-dd"));
1895
+ Y.setComponent("ScheduleContext"), Y.log("fetchSchedule:", e);
1896
+ const E = Je((p) => {
1897
+ const O = Bt(p, "yyyy-MM-dd");
1898
+ O !== b.current && (d(!0), b.current = O), h(p), i(p);
1899
+ }, [i]), { data: f, isLoading: C, isError: y, error: R } = xs({
1900
+ queryKey: ["schedule", Bt(a, "yyyy-MM-dd")],
1901
+ queryFn: () => e(a),
1902
+ staleTime: 1e3 * 60 * 15,
1903
+ // 15 minutes
1904
+ retry: 1
1905
+ });
1906
+ Y.log("useQuery result - data:", f, "isLoading:", C, "currentDate:", Bt(a, "yyyy-MM-dd")), ve(() => {
1907
+ f !== void 0 && u && (d(!1), Y.log("Schedule data loaded, ending transition state. Data:", f));
1908
+ }, [f, u]), ve(() => {
1909
+ y && (Y.log("Error fetching schedule for date:", a), Y.log("Error detials: ", R)), Y.log("ScheduleContext currentDate changed to:", a);
1910
+ }, [a, y, R]);
1911
+ const m = Ze(() => {
1912
+ const p = f ?? t;
1913
+ return Y.log("useMemo recalculating - data:", f, "initialSchedule:", t, "resulting schedule:", p), {
1914
+ schedule: p,
1915
+ weeks: s,
1916
+ currentDate: a,
1917
+ isLoading: C || u,
1918
+ isError: y,
1919
+ setCurrentDate: E
1920
+ };
1921
+ }, [f, t, s, a, C, u, y, E]);
1922
+ return /* @__PURE__ */ zt(Us.Provider, { value: m, children: n });
1923
+ }
1924
+ function Gs(e) {
1925
+ return /* @__PURE__ */ zt(Os, { client: js, children: /* @__PURE__ */ zt(Ns, { ...e }) });
1926
+ }
1927
+ export {
1928
+ Us as ScheduleContext,
1929
+ Gs as ScheduleProvider,
1930
+ Gs as default
1931
+ };