Loading
function(e,t,n){n.d(t,{H:()=>c,X:()=>d});var l=n(627968),i=n(64700),r=n(702841),a=n(617710),s=n(579908),o=n(636194);let u=i.createContext(void 0);function d(e){let t=i.useContext(u);if(null==t)throw Error(`${e??"useGroupListingsFetchContext"} must be used within a GroupListingsFetchContextProvider`);let{listingsLoaded:n,fetchGroupListingsForGuild:l}=t;return i.useEffect(()=>{l()},[l]),n}function c(e){let{guildId:t,children:n,refetchOnMount:d,includeSoftDeleted:c,countryCode:m,dontFetchWhileTrue:f}=e,h=(0,r.bG)([a.A],()=>a.A.isConnected()),x=(0,r.bG)([o.A],()=>null!=t?o.A.getSubscriptionGroupListingsForGuildFetchState(t):o.e.FETCHED),[E,g]=i.useState(!0===d),A=i.useCallback(()=>{if(null==t||!h||!0===f)return;let e=o.A.getSubscriptionGroupListingsForGuildFetchState(t);(E||e===o.e.NOT_FETCHED)&&(g(!1),s.WA(t,{includeSoftDeleted:c,countryCode:m}))},[h,t,c,m,f,E]),p=x===o.e.FETCHED&&!E;return(0,l.jsx)(u.Provider,{value:{listingsLoaded:p,fetchGroupListingsForGuild:A},children:n})}}