Module 514547

19,701 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{O9:()=>eF,Vn:()=>eL,Wj:()=>eU,mL:()=>er,Cv:()=>ez,Yl:()=>eS,Nb:()=>eQ,tZ:()=>eV,pT:()=>eX,UH:()=>e4,$P:()=>e0,YW:()=>eb,zW:()=>e$,NC:()=>eh,j$:()=>eM,fc:()=>eD,p5:()=>eq,SD:()=>eT,aC:()=>eH,FA:()=>eK,LS:()=>eg,RR:()=>ew,Ns:()=>e1,Iq:()=>ep,Qh:()=>ef,t9:()=>e3,XD:()=>eJ,ZP:()=>em,UX:()=>eG,mn:()=>eE,C5:()=>ej,sb:()=>eZ,I3:()=>ey,Qo:()=>eB,In:()=>ek,H6:()=>eW,a5:()=>eY,F3:()=>ex,L1:()=>eI,oH:()=>ev,do:()=>eC,S5:()=>eN,Du:()=>eP}),n(321073),n(801541);var i,r,a,s=n(582128),l=n(435558),o=n(181370),d=n.n(o),c=n(889137),u=n(323889),_=n(412703),E=n(114046);n(731355);var A=n(517846),h=n(462887),I=n(17928),f=n(736653),p=n(787389),T=n(183636),m=n(429913);n(674658);var g=n(27620),S=n(773669),N=n(885386),C=n(734057),O=n(30370),R=n(287809),L=n(174459),D=n(927813),y=n(403362),v=n(975571),b=n(252424),M=n(723702),P=n(428262);n(323874),n(14289),n(35956),n(562465),n(228366),n(181658);var U=n(291749);n(107195),n(881615),n(404851),n(544180),n(265704);var w=n(710969),G=n(652215),x=n(178540),k=n(352774),F=n(859703),V=n(24001);n(192444);var B=n(302654),H=n(945810);let j=(0,H.mj)({name:"2026-07-renewable-end-date-sort",kind:"user",defaultConfig:{enabled:!1},variations:{0:{enabled:!1},1:{enabled:!0}}});(0,H.mj)({name:"2026-05-bounties-stage-1",kind:"user",defaultConfig:{enabled:!1,verticalScrollEnabled:!1,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:50},variations:{1:{enabled:!0,verticalScrollEnabled:!1,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:50},2:{enabled:!0,verticalScrollEnabled:!1,loopingEnabled:!0,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:50},3:{enabled:!0,verticalScrollEnabled:!1,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:30},4:{enabled:!0,verticalScrollEnabled:!1,loopingEnabled:!1,ctaTimerMilliSeconds:0,rewardTimerSeconds:15,orbAmount:50},5:{enabled:!0,verticalScrollEnabled:!1,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:25,orbAmount:50},6:{enabled:!0,verticalScrollEnabled:!0,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:50},7:{enabled:!0,verticalScrollEnabled:!0,loopingEnabled:!0,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:50},8:{enabled:!0,verticalScrollEnabled:!0,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:15,orbAmount:30},9:{enabled:!0,verticalScrollEnabled:!0,loopingEnabled:!1,ctaTimerMilliSeconds:0,rewardTimerSeconds:15,orbAmount:50},10:{enabled:!0,verticalScrollEnabled:!0,loopingEnabled:!1,ctaTimerMilliSeconds:3e3,rewardTimerSeconds:25,orbAmount:50}}}),(0,H.mj)({name:"2026-07-bounties-vertical-scroll",kind:"user",defaultConfig:{enabled:!1,verticalScrollEnabled:!1,scrollAffordanceVariant:"none",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:0,ctaTimerMilliSeconds:0},variations:{1:{enabled:!0,verticalScrollEnabled:!1,scrollAffordanceVariant:"none",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:0,ctaTimerMilliSeconds:0},2:{enabled:!0,verticalScrollEnabled:!0,scrollAffordanceVariant:"none",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:0,ctaTimerMilliSeconds:0},3:{enabled:!0,verticalScrollEnabled:!0,scrollAffordanceVariant:"indicator",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:0,ctaTimerMilliSeconds:0},4:{enabled:!0,verticalScrollEnabled:!0,scrollAffordanceVariant:"auto",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:0,ctaTimerMilliSeconds:0},5:{enabled:!0,verticalScrollEnabled:!0,scrollAffordanceVariant:"peek",autoScrollLeadMs:3e3,autoScrollEndCardMs:3e3,peekFraction:.12,ctaTimerMilliSeconds:0}}}),(0,H.mj)({name:"2026-03-quest-home-bounties",kind:"user",defaultConfig:{enabled:!1},variations:{1:{enabled:!0}}});var W=n(971276),Y=n(561844);n(590202);var K=n(971649),$=n(651892),z=n(639214),q=n(576761),Z=n(901406),X=n(801365),Q=n(792620),J=n(814793),ee=n(753386),et=n(190107),en=n(202541),ei=n(375708);function er(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetchPolicy:"cache-only",callerSource:"unknown"},[t,n]=s.useState(!1),i=(0,I.yK)([F.A],()=>[...F.A.quests.values()]),r=(0,I.yK)([F.A],()=>[...F.A.excludedQuests.values()]),{isFetchingCurrentQuests:a,lastFetchedCurrentQuests:l}=(0,I.cf)([F.A],()=>({isFetchingCurrentQuests:F.A.isFetchingCurrentQuests,lastFetchedCurrentQuests:F.A.lastFetchedCurrentQuests})),o=(0,W.s)();return s.useEffect(()=>{let i;switch(e.fetchPolicy){case"cache-only":return;case"cache-or-network":i=0===l;break;case"cache-and-network":i=!0;break;default:e.fetchPolicy;return}if(i&&o&&!t&&!a){if(n(!0),(0,k.N1)(),(0,M.isMac)()&&"focused"!==T.A.getState())return;let{enableNewRequestBehavior:t}=B.A.getConfig({location:"QuestHookUseQuests"});if(t)return;(0,k.r8)(V.p9.DESKTOP_ACCOUNT_PANEL_AREA,`use_quests_${e.callerSource}`)}},[e.fetchPolicy,o,t,a,l,e.callerSource]),{quests:i,excludedQuests:r,isFetchingCurrentQuests:a,hasFetched:t}}function ea(e,t,n,i){let r=e.id===et.aJ,a=t.id===et.aJ,s=r&&e.userStatus?.completedAt==null;if(s!==(a&&t.userStatus?.completedAt==null))return s?-1:1;let l=!(0,w.Ic)(e),o=e.userStatus?.claimedAt!=null,d=t.userStatus?.claimedAt!=null,c=e.userStatus?.enrolledAt!=null,u=t.userStatus?.enrolledAt!=null,_=20*D.A.Millis.MINUTE,E=e2(e,_),A=e2(t,_);if(l){var h,I,f;let r,a,{questHomeHero:s,isQuestHomeHeroShelfEnabled:l}=n;if(null!=s&&!l){let n=(0,J.I0)(s,e.id),i=(0,J.I0)(s,t.id);if(n||i)return n?-1:1}return E!==A&&(E||A)?E?1:-1:o!==d?o?1:-1:c!==u?c?-1:1:(h=e,I=t,r=(f=i).get(h.id),a=f.get(I.id),null!=r&&null!=a?r!==a?r-a:h.id!==I.id?h.id<I.id?-1:1:0:null!=r?-1:null!=a?1:eA(h.config.expiresAt,I.config.expiresAt,1))}return o!==d?o?-1:1:c!==u?c?-1:1:eA(e.config.expiresAt,t.config.expiresAt,0)}function es(e,t,n){return eA(e.config.startsAt,t.config.startsAt,0)}function el(e,t,n){let i=e.userStatus?.enrolledAt,r=t.userStatus?.enrolledAt;return null==i&&null==r?eA(e.config.expiresAt,t.config.expiresAt,0):null!=i&&null==r?-1:null==i&&null!=r?1:eA(i,r,0)}function eo(e,t,n){return eA(e.config.expiresAt,t.config.expiresAt,1)}function ed(e,t){switch(t){case et.Pc.VIDEO:return(0,Q.vv)(e);case et.Pc.PLAY:return(0,Q.t)({quest:e})||(0,Q.fE)({quest:e})||(0,Q.vl)(e)||(0,Q.g5)(e)||(0,Q.Cr)(e);default:return!1}}function ec(e,t){switch(t){case et.BQ.VIRTUAL_CURRENCY:return(0,X.ks)(e.config);case et.BQ.COLLECTIBLE:return(0,X.tU)(e.config);case et.BQ.IN_GAME:return(0,X.HG)(e.config)||(0,X.r7)(e.config);default:return!1}}let eu={},e_={questHomeHero:null,isQuestHomeHeroShelfEnabled:!1,currentUserId:null,isRenewableEndDateSortEnabled:!1};function eE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eu,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e_,{sortMethod:r,filters:a}=n,s=null==a||0===a.length?e:function(e,t){if(0===t.length)return e;let n=(0,l.groupBy)(t,"group");return e.filter(e=>Object.entries(n).every(t=>{let n,[i,r]=t;return n=function(e){switch(e){case"task":return ed;case"reward":return ec}}(i),0===r.length||r.some(t=>n(e,t.filter))}))}(e,a),o=function(e,t,n){let i=new Map;if(!n||null==t)return i;for(let n of e){var r;(0,J.iM)(n,et.Li.RENEWABLE_END_DATE)&&i.set(n.id,(r=n.id,d().v3(`${t}:${r}`)>>>0))}return i}(s,i.currentUserId,i.isRenewableEndDateSortEnabled),c=(t=function(e){switch(e){case et.kL.MOST_RECENT:return es;case et.kL.RECENTLY_ENROLLED:return el;case et.kL.EXPIRING_SOON:return eo;case et.kL.SUGGESTED:default:return ea}}(r),function(e,n){let r=!(0,w.Ic)(e);return!(0,w.Ic)(n)!==r?r?-1:1:t(e,n,i,o)});return s.sort(c)}function eA(e,t,n){return e.localeCompare(t)*(0===n?-1:1)}var eh=((i={}).ALL="all",i.CLAIMED="claimed",i.PREVIEW_TOOL="preview_tool",i),eI=((r={}).TAB="tab",r.QUEST_ID="quest_id",r.SORT="sort",r.FILTER="filter",r.AD_CREATIVE_IDS="ad_creative_ids",r);function ef(e){let t,n,i,r,a,l,o,d,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eu,{quests:u,excludedQuests:_,isFetchingCurrentQuests:E,hasFetched:A}=er({fetchPolicy:"cache-and-network",callerSource:"use_filtered_quests"}),h=new Map(u.map(e=>[e.id,e])),f=(t=function(){let e=(0,I.bG)([F.A],()=>F.A.getQuestHomeHero()),{isShelfEnabled:t}=e3(e),n=(0,I.bG)([R.default],()=>R.default.getCurrentUser()?.id??null),{enabled:i}=j.useConfig({location:et.rE.QUEST_HOME_MOBILE});return s.useMemo(()=>({questHomeHero:e,isQuestHomeHeroShelfEnabled:t,currentUserId:n,isRenewableEndDateSortEnabled:!1}),[e,t,n,!1])}(),n=s.useRef([]),i=s.useRef(c.sortMethod),r=s.useRef(c.filters),a=s.useRef(0),l=s.useRef(t),s.useMemo(()=>{if(0===u.length)return[];if(n.current.length>0&&a.current===u.length&&i.current===c.sortMethod&&r.current===c.filters&&l.current===t)return n.current;let e=eE(u,c,t).map(e=>e.id);return n.current=e,i.current=c.sortMethod,r.current=c.filters,a.current=u.length,l.current=t,e},[u,c,t])),p=(o=s.useMemo(()=>u.filter(e=>{let t=e.userStatus?.completedAt!=null,n=e.userStatus?.claimedAt!=null;return t&&n}),[u]),d=s.useRef([]),s.useMemo(()=>{if(0===o.length)return[];if(d.current.length>0&&d.current.length===o.length)return d.current;let e=o.sort((e,t)=>{let n=e.userStatus?.claimedAt==null;return n!==(t.userStatus?.claimedAt==null)?n?-1:1:eA(e.config.rewardsConfig.rewardsExpireAt,t.config.rewardsConfig.rewardsExpireAt,0)}).map(e=>e.id);return d.current=e,e},[o])),T=[];for(let t of"all"===e?f:p){let n=h.get(t),i=null!=n&&"all"===e&&c.removeExpiredQuests&&(0,w.Ic)(n)&&!(0,w.GR)(n.userStatus);null==n||i||T.push(n)}return{quests:T,excludedQuests:_,isFetchingCurrentQuests:E,hasFetched:A}}function ep(){let e=s.useRef(!1),t=(0,I.yK)([F.A],()=>Array.from(F.A.claimedQuests.values())),n=(0,I.bG)([F.A],()=>F.A.isFetchingClaimedQuests);return s.useEffect(()=>{n||e.current||(e.current=!0,(0,k.HA)())},[n]),{claimedQuests:t,isFetchingClaimedQuests:n}}function eT(e,t){let n=eg(e),i=(0,X.ks)(e.config),r=(0,X.KK)(e.config),a=t!==q.MA.INELIGIBLE;return!n&&i&&r&&a}function em(e){return(0,I.bG)([F.A],()=>{let t=F.A.getQuest(e);return null==t?null:(0,X.b)(t.config)},[e])}function eg(e){return(0,I.bG)([F.A],()=>null!=e&&F.A.isQuestExpired(e.id),[e])}function eS(e,t,n){let i=(0,I.bG)([C.A],()=>C.A.getChannel(t?.channelId)??null),r=(0,I.bG)([F.A],()=>null!=F.A.questEnrollmentBlockedUntil,[]),a=(0,I.bG)([R.default],()=>R.default.getCurrentUser()?.id),s=(0,I.bG)([F.A],()=>null!=e&&F.A.isQuestExpired(e.id),[e]);if(null==e||r||s||a===n)return!1;let l=e.userStatus?.claimedAt!=null,o=(0,J.Ll)(t,i);return!l||!!o}function eN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dateStyle:"short"},n=(0,I.bG)([S.default],()=>S.default.locale);return s.useMemo(()=>null==e?"":new Date(e).toLocaleDateString(n,t),[e,t,n])}function eC(e){let{quest:t,content:n,ctaContent:i,sourceQuestContent:r}=e,a=(0,K.wW)();return s.useCallback(()=>{t.id===et.Fw?window.open(v.A.getArticleURL(G.MVz.VIRTUAL_CURRENCY_LEARN_MORE)):(0,Z.pu)(t,{content:n,ctaContent:i,impressionId:a(),sourceQuestContent:r})},[t,n,i,a,r])}function eO(e){return(0,I.bG)([F.A],()=>F.A.isProgressingOnDesktop(e.id))}function eR(e){return s.useMemo(()=>(0,Q.YL)(e),[e])}function eL(e){let t,n=eO(e),i=eR(e),r=(t=(0,I.bG)([F.A],()=>F.A.getOptimisticProgress(e.id,_.n.WATCH_VIDEO)),s.useMemo(()=>(0,ee.J$)(e),[e,t]));return n||i||r}let eD=e=>{let t=s.useCallback(()=>(0,Q.Yh)(e),[e]),[n,i]=s.useState(t()),r=s.useCallback(()=>i(t()),[t]),a=eL(e);return s.useEffect(()=>{if(e.userStatus?.enrolledAt==null||e.userStatus?.completedAt!=null||e.userStatus?.claimedAt!=null||!a)return void r();let t=window.setInterval(()=>{r()},+D.A.Millis.SECOND);return()=>{clearInterval(t),r()}},[e,a,r]),n};function ey(e){return s.useMemo(()=>(0,Q.JC)(e),[e])}function ev(e){let t=s.useMemo(()=>{let t=new Set;for(let n of e){let e=(0,Q.F9)(n);null!=e&&t.add(e)}return Array.from(t)},[e]);return(0,m.A)(t)}function eb(e){let t=(0,I.bG)([F.A],()=>F.A.quests),n=ev(Array.from(t.values())),i=s.useMemo(()=>{let n=(0,J.$e)(t,et.zO);return(0,z.BM)(n,e)},[e,t,n]);return eg(i)?null:i}function eM(e){return s.useMemo(()=>({handleComplete:()=>(0,k.Yb)(e),handleProgress:t=>(0,k.Yb)(e,t),handleResetStatusClick:()=>(0,k.UZ)(e),handleResetDismissibilityClick:()=>(0,k.Gt)(e),handleOverridePreviewClick:t=>(0,k.L4)(t,e),handleResetHasBeenSeenClick:()=>(0,k.qV)(u.p.QUEST,[e])}),[e])}function eP(){let{fetching:e,accounts:t}=(0,I.cf)([O.A],()=>({fetching:O.A.isFetching(),accounts:O.A.getAccounts()})),{xboxAccounts:n,playstationAccounts:i,xboxAndPlaystationAccounts:r}=s.useMemo(()=>{let e=t.filter(e=>!1===e.revoked),n=e.filter(e=>e.type===G.fg2.XBOX),i=e.filter(e=>e.type===G.fg2.PLAYSTATION),r=n.concat(i);return{xboxAccounts:n,playstationAccounts:i,xboxAndPlaystationAccounts:r}},[t]);return{fetching:e,xboxAccounts:n,playstationAccounts:i,xboxAndPlaystationAccounts:r}}function eU(e){let{questId:t,preview:n,beforeRequest:i,afterRequest:r}=e,[a,l]=s.useState(!1),o=(0,I.bG)([O.A],()=>O.A.getAccounts()),d=(0,x.O)(e=>e.clearErrorHintsByType),c=s.useCallback(e=>x.O.getState().setErrorHints(t,e),[t]);return s.useEffect(()=>{d(t,E._.EXPIRED_CREDENTIAL)},[o,d,t]),{startConsoleQuest:s.useCallback(async()=>{if(a)return;i?.(),l(!0);let e=null;try{e=await (0,k.vD)(t,n),c(e.errorHints)}finally{l(!1),r?.()}},[a,i,r,n,t,c]),startingConsoleQuest:a}}function ew(e){let{quest:t}=e,{xboxAndPlaystationAccounts:n}=eP(),i=eL(t),r=0===n.length;return(0,Q.g5)(t)&&r&&!i}function eG(){let{xboxAccounts:e,playstationAccounts:t}=eP(),n=e.length>0,i=t.length>0,r=v.A.getArticleURL(G.MVz.QUEST_HOW_TO_PLAYSTATION),a=v.A.getArticleURL(G.MVz.QUEST_HOW_TO_XBOX),s=ei.intl.format(ei.t.beN4DG,{psHelpdeskArticle:r,xboxHelpdeskArticle:a}),l=ei.intl.format(ei.t.HVS7nh,{helpdeskArticle:i?r:a});return{message:n&&!i||!n&&i?l:s,xboxURL:a,playstationURL:r}}var ex=((a={})[a.UNACCEPTED=0]="UNACCEPTED",a[a.ACCEPTED=1]="ACCEPTED",a[a.IN_PROGRESS=2]="IN_PROGRESS",a[a.COMPLETED=3]="COMPLETED",a[a.CLAIMED=4]="CLAIMED",a);function ek(e){let t=e.userStatus?.enrolledAt!=null,n=e.userStatus?.completedAt!=null,i=e.userStatus?.claimedAt!=null,r=eD(e).percentComplete>0;return i?4:n?3:r&&t?2:1*!!t}function eF(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,I.bG)([S.default],()=>S.default.locale),{percentComplete:i}=eD(e),r=ey(e),a=null!=r?r.percentComplete:i,s=100*a,l=null==r||t?(0,b.l9)(n,a,{roundingMode:"floor"}):`${r?.progress}/${r?.target}`;return{completedRatio:a,percentComplete:s,completedRatioDisplay:l}}function eV(e){return[(0,I.bG)([F.A],()=>F.A.selectedTaskPlatform(e)),s.useCallback(t=>(0,k.lx)(e,t),[e])]}function eB(e,t){let[n,i]=eV(e.id),r=s.useMemo(()=>(0,Z.UR)(e),[e]),a=r.includes(et.fO.DESKTOP),l=r.includes(et.fO.CONSOLE),o=eO(e),d=eR(e),u=s.useMemo(()=>(0,c.YW)(t).with({percentComplete:0},()=>null).with({taskType:_.n.PLAY_ON_DESKTOP},()=>et.fO.DESKTOP).with({taskType:_.n.PLAY_ACTIVITY},()=>et.fO.DESKTOP).with({taskType:_.n.WATCH_VIDEO},()=>et.fO.DESKTOP).with({taskType:_.n.WATCH_VIDEO_ON_MOBILE},()=>et.fO.DESKTOP).with({taskType:_.n.STREAM_ON_DESKTOP},()=>et.fO.DESKTOP).with({taskType:_.n.PLAY_ON_XBOX},()=>et.fO.CONSOLE).with({taskType:_.n.PLAY_ON_PLAYSTATION},()=>et.fO.CONSOLE).with({taskType:_.n.ACHIEVEMENT_IN_GAME},()=>et.fO.DESKTOP).with({taskType:_.n.ACHIEVEMENT_IN_ACTIVITY},()=>et.fO.DESKTOP).exhaustive(),[t]),E=o?et.fO.DESKTOP:d?et.fO.CONSOLE:null;return[s.useMemo(()=>(0,c.YW)({lastPlatformProgress:u,currentProgressingPlatform:E,selectedPlatform:n}).with({currentProgressingPlatform:et.fO.CONSOLE},()=>V.X0.CONSOLE).with({currentProgressingPlatform:et.fO.DESKTOP},()=>V.X0.DESKTOP).with({currentProgressingPlatform:null,lastPlatformProgress:et.fO.CONSOLE},()=>V.X0.CONSOLE).with({currentProgressingPlatform:null,lastPlatformProgress:et.fO.DESKTOP},()=>V.X0.DESKTOP).with({currentProgressingPlatform:null,lastPlatformProgress:null,selectedPlatform:et.fO.CONSOLE},()=>V.X0.CONSOLE).with({currentProgressingPlatform:null,lastPlatformProgress:null,selectedPlatform:et.fO.DESKTOP},()=>V.X0.DESKTOP).with({currentProgressingPlatform:null,lastPlatformProgress:null,selectedPlatform:null},()=>l&&a?V.X0.SELECT:l?V.X0.CONSOLE:V.X0.DESKTOP).exhaustive(),[l,a,u,E,n]),r,i]}function eH(e){let t=ey(e),n=eD(e),[i]=eB(e,n),r=eg(e),a=e.userStatus?.enrolledAt!=null,s=e.userStatus?.completedAt!=null,l=_.o.DESKTOP.has(n.taskType)&&n.percentComplete>0,o=0===n.percentComplete,d=a&&!s&&!r&&null==t&&(l||o&&i===V.X0.DESKTOP),c=(0,M.isWeb)()&&d&&!(0,Z.W1)(e),u=(0,M.isMac)()&&n.taskType===_.n.STREAM_ON_DESKTOP&&d,E=[];return u&&E.push(ei.intl.string(ei.t.MFGxFM)),c&&E.push(ei.intl.string(ei.t.BV6xDm)),E}function ej(e){return(0,I.bG)([F.A],()=>F.A.quests).get(e)??null}function eW(e){let{mode:t,questContent:n,sourceQuestContent:i,questId:r}=e,a=s.useRef(null);s.useEffect(()=>{null!=r&&a.current!==t&&((0,Y.Mm)({mode:t,prevMode:a.current,questContent:n,questId:r,sourceQuestContent:i}),a.current=t)},[r,n,t,i]),s.useEffect(()=>{if(null!=r)return()=>{(0,Y.Mm)({mode:null,prevMode:a.current,questContent:n,questId:r,sourceQuestContent:i})}},[r,n,i])}function eY(e,t){let n=(0,I.bG)([F.A],()=>F.A.getQuest(e),[e]),i=(0,f.Ay)();return s.useMemo(()=>{if(null==n)return null;let e=t??((0,h.M)(i)?G.NJ8.DARK:G.NJ8.LIGHT);return(0,U.tW)(n,U.fY.COSPONSOR_LOGO_TYPE,e)},[i,t,n])}function eK(e){let t=(0,I.bG)([R.default],()=>R.default.getCurrentUser()),n=(0,X.mq)(e,t),i=(0,X.k5)(e),r=(0,X.$5)(e),a=(0,X.Y7)(e),s=(0,X.JX)(e),l=(0,P.TW)(t,en.PremiumTypes.TIER_2);if(null==i)return ei.intl.formatToPlainString(ei.t.l9uXL8,{decorationName:n});let o=ei.intl.formatToPlainString(ei.t.o97tNn,{rewardName:n}),d=ei.intl.formatToPlainString(ei.t.PkyRZo,{rewardName:n,expirationDate:r}),c=ei.intl.formatToPlainString(ei.t.ie4YK0,{rewardName:n,duration:i}),u=ei.intl.formatToPlainString(ei.t.yCpc0U,{duration:i,rewardName:n});return s?a?l?o:c:l?d:u:ei.intl.formatToPlainString(ei.t.tTlItm,{duration:i,decorationName:n})}function e$(e){let t=(0,Q.TP)(e);return{launchInGameActivity:(0,p.A)({applicationId:t})}}function ez(){return(0,I.yK)([F.A],()=>[...F.A.quests.values()]).some(e=>e.preview)}function eq(){return ez()}function eZ(e){let t=e?.userStatus!=null&&(0,w.gO)(e.userStatus,V.uF.ACTIVITY_PANEL),n=eg(e??null),i=e?.userStatus?.claimedAt!=null,r=(0,I.bG)([F.A],()=>null!=F.A.questEnrollmentBlockedUntil,[]);return!t&&!n&&!i&&!r}function eX(){let e=(0,I.yK)([F.A],()=>[...F.A.quests.values()]);return s.useMemo(()=>e.filter(e=>e.preview),[e])}function eQ(){let e=et.pc;return s.useMemo(()=>e.map(e=>{let[t,n]=e;return{heading:(0,$.fx)(t),options:n}}),[e])}function eJ(){return s.useMemo(()=>Object.keys(et.kL).map(e=>({label:(0,$.Js)(et.kL[e]),value:et.kL[e]})),[])}function e0(e){let{selectedSortMethod:t,selectedFilters:n,numQuestsVisible:i}=e,r=s.useRef(null),a=s.useRef(null);s.useEffect(()=>{L.default.track(G.HAw.QUEST_HOME_SORT_METHOD_CHANGED,{sort_method:t,previous_sort_method:r.current}),r.current=t},[t]),s.useEffect(()=>{let e=n.map(e=>e.filter);L.default.track(G.HAw.QUEST_HOME_FILTERS_CHANGED,{filters:e,previous_filters:a.current??[],num_quests_visible:i}),a.current=e},[n,i])}function e1(e){return s.useMemo(()=>R.default.getCurrentUser()?.isStaff()===!0,[])||e.preview}function e2(e,t){let n=e.userStatus?.completedAt!=null;return e.userStatus?.enrolledAt!=null&&!n&&Date.now()-new Date(e.userStatus?.enrolledAt).getTime()>t}function e3(e){let t=(0,I.bG)([F.A],()=>F.A.quests),n=e?.questIds;return s.useMemo(()=>{if(null==n)return{shelfQuests:[],isShelfEnabled:!1};let e=n.map(e=>t.get(e)).filter(y.Vq).filter(e=>!(0,w.Ic)(e));return e.length<=1?{shelfQuests:[],isShelfEnabled:!1}:{shelfQuests:e,isShelfEnabled:!0}},[t,n])}function e4(e){let t=N.H1.useSetting(),n=e.userStatus?.enrolledAt!=null;return s.useCallback(()=>{if(n)return;let i=t?A.w.AD_IMPRESSION_QUEST_BAR_OPT_OUT:A.w.AD_IMPRESSION_QUEST_BAR_OPT_IN;(0,g.hs)(i,{quest_id:e.id})},[t,n,e.id])}D.A.Millis.HOUR,D.A.Millis.MINUTE}