Build 574548stable
Module 265704
1,527 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";let i,r,s,a,o,l;n.d(t,{A:()=>h});var u=n(17928),c=n(228366);function d(){i=!1,r=[],s=new Set,a=new Set,o=new Map,l=new Map}d();class _ extends u.Ay.Store{static displayName="BountyStore";get isFetchingQuestHomeBounties(){return i}get questHomeBounties(){return r}isBountyCompleted(e){return s.has(e)}getCompletedBountyCount(e){let t=0;for(let n of e)s.has(n.id)&&t++;return t}isClaimingBountyReward(e){return a.has(e)}areAllBountiesCompleted(){return r.every(e=>s.has(e.id))}getAdDecisionByPlacementAndAdCreativeId(e,t){return o.get(e)?.get(t)??null}getBountyVideoProgress(e){return l.get(e)??null}}let h=new _(c.h,{LOGOUT:function(){d()},BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_BEGIN:function(){i=!0},BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_SUCCESS:function(e){let{bounties:t,placement:n,adDecisionsByAdCreativeId:a}=e;i=!1,r=t,s=new Set,l=new Map,(o=new Map(o)).set(n,a)},BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_FAILURE:function(e){let{placement:t}=e;i=!1,r=[],s=new Set,(o=new Map(o)).delete(t)},BOUNTIES_CLAIM_REWARD_BEGIN:function(e){let{bountyId:t}=e,n=new Set(a);n.add(t),a=n},BOUNTIES_CLAIM_REWARD_SUCCESS:function(e){let{bountyId:t}=e,n=new Set(a);n.delete(t),a=n;let i=new Set(s);i.add(t),s=i},BOUNTIES_CLAIM_REWARD_FAILURE:function(e){let{bountyId:t}=e,n=new Set(a);n.delete(t),a=n},BOUNTIES_VIDEO_PROGRESS_UPDATE:function(e){let{bountyId:t,timestampSec:n,maxTimestampSec:i,duration:r}=e,s=new Map(l);s.set(t,{timestampSec:n,maxTimestampSec:i,duration:r}),l=s},AD_SESSION_RESET:function(){l=new Map}})}