1"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[353],{15311(e,n,o){o.r(n),o.d(n,{CompetitionPage:()=>B,CompetitionPageView:()=>V});var t=o(50016),a=o(33651),r=o(13403),i=o(58264),E=o(5704),s=o(21141),_=o(97350),c=o(27316),O=o(1100),l=o(25694),N=o(39916),p=o(51198),C=o(13313),u=o(61449),A=o(18509),S=o(306),R=o(29733),d=o(81720),T=o(84242),m=o(1948),U=o(44296),L=o(40230),P=o(92872),I=o(40068),g=o.n(I),y=o(94807),M=o(15546),f=o(96239),h=o(40908),G=o(97206),D=o(76966),w=o(48010),v=o(47192),F=o(9036),b=o(9101),k=o(62296),H=o(17116),Y=o(90076);const W=new k.Parser,Q=t.memo((e=>{const{comp:n}=e;if(null!==n){const o=W.parse((0,H.k0)(!1,n,e.config.appUrl,`${window.location.pathname}${window.location.search}`,e.config.facebookConfig.appId,e.config.appleAppStoreId,e.config.package,e.config.appName,e.config.appLaunchProtocol,e.config.environment));return(0,Y.jsx)(b.mg,{children:o})}return null})),B=e=>{var n;const o=(0,a.wA)(),r=(0,a.d4)(C.getCompetition),{leaders:i,leaderboardConfig:O}=(0,M.ZL)(null!==(n=null===r||void 0===r?void 0:r.id)&&void 0!==n?n:null,!1,!0),U=(0,a.d4)(S.getIsMute),L=(0,t.useCallback)((e=>o(e)),[o]),P=(0,t.useCallback)((()=>o((0,E.by)())),[o]),I=(0,t.useCallback)(((e,n)=>o((0,_.fetchCompetition)([e,n]))),[o]),g=(0,t.useCallback)((()=>o((0,s.JZ)())),[o]),y=(0,t.useCallback)((e=>o((0,l.addOverlay)(e))),[o]),f=(0,t.useCallback)((e=>o((0,s.S9)(e))),[o]),w=(0,t.useCallback)((e=>o((0,s.u9)(e))),[o]),v=(0,t.useCallback)((e=>o((0,_.fetchEnterCompetition)(e))),[o]),b=(0,t.useCallback)((e=>o((0,_.fetchFollowUser)(e))),[o]),k=(0,t.useCallback)((e=>o((0,_.fetchUnfollowUser)(e))),[o]),H=(0,t.useCallback)((e=>(0,G.Dd)(e.name,e.eventParams)),[]),W=(0,t.useCallback)((e=>{(0,G.X3)(e)}),[]),Q=(0,t.useCallback)((()=>o((0,h.Uz)(F.a.PROFILE))),[o]),B=(0,t.useCallback)((()=>o((0,h.oB)())),[o]),x=(0,t.useCallback)((()=>{r&&o((0,c.setChatRead)(r.id,new Date))}),[r,o]),K=(0,t.useCallback)((()=>o((0,c.setMute)(!U))),[U,o]);return(0,Y.jsx)(V,{...e,currentOverlay:(0,a.d4)(d.getCurrentOverlay),isCompetitionDataReady:(0,a.d4)(A.Us),config:(0,a.d4)(D.z),configForApp:(0,a.d4)(D.l),remoteConfig:(0,a.d4)(T.LO),upcomingComps:(0,a.d4)(u.getUpcomingCompetitionsExcludingEntered),comp:(0,a.d4)(C.getCompetition),compSummary:(0,a.d4)(u.getCurrentCompetitionSummary),compSummaryAndEntry:(0,a.d4)(u.getCurrentCompetitionSummaryAndEntry),localAnswers:(0,a.d4)(N.getCurrentCompetitionsLocalAnswers),questions:(0,a.d4)(C.getQuestions),status:(0,a.d4)(C.getCompetitionStatusResponse),counts:(0,a.d4)(C.getCompetitionCountsResponse),vips:(0,a.d4)(C.getCompetitionVipsResponse),chat:(0,a.d4)(C.getCompetitionChatResponse),chatLastReadMs:(0,a.d4)(S.getCompChatLastReadMs),leaderboardConfig:O,leaderboard:i,authUser:(0,a.d4)(p.getAuthUserForApp),user:(0,a.d4)(m.getUser),userFollowing:(0,a.d4)(m.getUserIsFollowingResponse),userEntry:(0,a.d4)(m.getUsersCurrentCompetitionEntry),enterCompetitionStatus:(0,a.d4)(m.getUsersCurrentCompEntryStatus),profileImageUpload:(0,a.d4)(R.z_),talkingPoints:(0,a.d4)(C.getCompTalkingPointsResponse),isMute:U,temporaryUserScore:(0,a.d4)(p.getTemporaryUserScore),onDispatchAction:L,onAnonymousLogin:P,onAddOverlay:y,onFetchCompetition:I,onExitCompetition:g,onQuestionAnswered:f,onQuestionLiked:w,onEnterCompetition:v,onFollowUser:b,onUnfollowUser:k,onAnalytics:H,onSetCurrentScreen:W,onEditProfile:Q,onOpenAccountScreenForLogin:B,onCompChatRead:x,onMute:K})},V=t.memo((e=>{var n,o,a;const E=null!==(n=null===(o=(0,r.zy)().state)||void 0===o?void 0:o.launchContext)&&void 0!==n?n:{},s=(0,t.useRef)(null),_=(0,t.useRef)(null),[c,l]=(0,t.useState)(0),[N,p]=(0,t.useState)(0),{vendor:C,key:u}=(0,r.g)(),A=(0,r.Zp)(),{configForApp:S,remoteConfig:R,comp:d,compSummary:T,compSummaryAndEntry:m,upcomingComps:I,localAnswers:M,questions:h,status:G,counts:D,vips:F,chat:b,chatLastReadMs:k,leaderboardConfig:H,leaderboard:W,isCompetitionDataReady:B,authUser:V,user:$,userFollowing:Z,userEntry:q,enterCompetitionStatus:z,profileImageUpload:J,talkingPoints:X,isMute:ee,temporaryUserScore:ne,onDispatchAction:oe,onAnonymousLogin:te,onFetchCompetition:ae,onExitCompetition:re,onAddOverlay:ie,onQuestionAnswered:Ee,onQuestionLiked:se,onEnterCompetition:_e,onF
1ollowUser:ce,onUnfollowUser:Oe,onAnalytics:le,onSetCurrentScreen:Ne,onEditProfile:pe,onOpenAccountScreenForLogin:Ce,onCompChatRead:ue,onMute:Ae}=e,Se=e.config.gameUrl;m&&m.vendor.isMiniLeague&&(E.mode="direct");const Re=e=>{j((0,i.I8)(i.cn.ON_APP_ACTION,e),s.current)},de=(0,t.useCallback)((e=>{if(e.origin.includes(Se)||e.origin.includes("localhost:3002")){const n=e.data;if(g().info("[Message]",n),n.name===i.cn.APP_READY&&p(N+1),n.name===i.cn.REQUEST_LOGIN){!0===n.payload?te():Ce()}if(n.name===i.cn.SET_EDIT_PROFILE&&pe(),n.name===i.cn.SET_ANSWER&&Ee(n.payload),n.name===i.cn.SET_LIKE&&se(n.payload),n.name===i.cn.SET_COMP_ENTRY&&(ie((0,U.getEnterCompOverlay)({entry:n.payload})),_e(n.payload)),n.name===i.cn.SET_ANSWER_CHANGE&&_e(n.payload),n.name===i.cn.SET_FOLLOWING&&ce(n.payload),n.name===i.cn.SET_UNFOLLOWING&&Oe(n.payload),n.name===i.cn.REQUEST_OVERLAY)if(n.payload.type===L.OverlayType.SIMPLE_MESSAGE){let e=n.payload;ie((0,y.assertType)({...e,onCloseRoutine:e.onCloseRoutine?()=>Re(e.onCloseRoutine):void 0,onActionRoutine:e.onActionRoutine?()=>Re(e.onActionRoutine):void 0}))}else if(n.payload.type===L.OverlayType.UPLOAD_PROFILE_IMAGE)oe((0,O.U
1d)());else if(n.payload.type===L.OverlayType.PLAYER_PROFILE||n.payload.type===L.OverlayType.COMPARE){const e=n.payload;e.questions&&(e.questions=e.questions.map((e=>(0,P.processSerialisedTimestamps)(e)))),ie(n.payload)}else if(n.payload.type===L.OverlayType.CHALLENGE_DETAILS){const e=n.payload;e.group=(0,P.processSerialisedTimestamps)(e.group),ie(n.payload)}else ie(n.payload);if(n.name===i.cn.SET_CURRENT_SCREEN&&(_.current!==i.bp.CHAT&&n.payload!==i.bp.CHAT||ue(),_.current=n.payload,Ne(n.payload)),n.name===i.cn.SET_ANALYTICS&&le(n.payload),n.name===i.cn.SET_MUTE&&Ae(),n.name===i.cn.SET_NAVIGATE){const e=n.payload;e.type===i.sm.HOME?A({pathname:"/",search:window.location.search}):e.type===i.sm.BACK?A.length>0?A(-1):A({pathname:"/",search:window.location.search}):e.type===i.sm.VENDOR?A({pathname:`/${e.path}`,search:window.location.search}):e.type===i.sm.PATH?A({pathname:e.path,search:window.location.search}):e.type===i.sm.LEADERBOARD?A({pathname:`/leaderboard/${e.path}`,search:window.location.search}):e.type===i.sm.URL?window.open(e.path,"_blank"):e.type===i.sm.RELOAD&&l(c+1)}}}),[Se,N,te,Ce,pe,Ee,se,ie,_e,ce,Oe,oe,Ne,ue,le,Ae,A,c]),Te=(0,t.useRef)(!0);(0,t.useEffect)((()=>{Te.current?Te.current=!1:(g().info("Leaving current competition"),re())}),[C,u,re]),(0,t.useEffect)((()=>{C&&u&&ae(C,u)}),[C,u,ae]),(0,t.useEffect)((()=>(window.addEventListener("message",de),()=>window.removeEventListener("message",de))),[de]),(0,t.useEffect)((()=>()=>{_.current===i.bp.CHAT&&ue()}),[ue,b]),(0,t.useEffect)((()=>()=>{g().info("Unmounting competition"),re()}),[re]);const me=B?N:0;return K(i.cn.ON_CONFIG,S,me,s.current),K(i.cn.ON_REMOTE_CONFIG,R,me,s.current),K(i.cn.ON_COMP,d,me,s.current),K(i.cn.ON_COMP_SUMMARY,T,me,s.current),K(i.cn.ON_UPCOMING_COMPS,I,me,s.current),K(i.cn.ON_LOCAL_ANSWERS,M,me,s.current),K(i.cn.ON_COMP_QUESTIONS,h,me,s.current),K(i.cn.ON_COMP_STATUS,G,me,s.current),K(i.cn.ON_COMP_COUNTS,D,me,s.current),K(i.cn.ON_COMP_TALKING_POINTS,X,me,s.current),K(i.cn.ON_COMP_VIPS,F,N,s.current),K(i.cn.ON_COMP_CHAT,b,me,s.current),K(i.cn.ON_COMP_CHAT_LAST_READ,k,me,s.current),K(i.cn.ON_COMP_LEADERBOARD_CONFIG,H,me,s.current),K(i.cn.ON_COMP_LEADERBOARD,W,me,s.current),K(i.cn.ON_AUTH_USER,V,me,s.current,!0),K(i.cn.ON_USER,$,me,s.current),K(i.cn.ON_USER_FOLLOWING,Z,me,s.current),K(i.cn.ON_USER_ENTRY,q,me,s.current,!0),K(i.cn.ON_COMP_ENTRY_STATUS,z,me,s.current),K(i.cn.ON_PROFILE_IMAGE_UPLOAD,J,me,s.current),K(i.cn.ON_MUTE,ee,me,s.current),K(i.cn.ON_AUTH_TEMPORARY_USER_SCORE,ne,me,s.current),(0,Y.jsxs)(v.L,{children:[(0,Y.jsx)(Q,{config:e.config,comp:e.comp}),(0,Y.jsx)("iframe",{ref:s,className:"competition-page__iframe",src:x(e.config,E),title:"Chancer Game",allow:"encrypted-media;"},`${C}/${u}/${c}/${null!==(a=null===$||void 0===$?void 0:$.id)&&void 0!==a?a:""}`),(0,Y.jsx)("div",{className:"competition-page__top-icons-container",children:(0,Y.jsx)("div",{className:"competition-page__back-container",children:(0,Y.jsx)("div",{className:"competition-page__back",onClick:()=>{(0,w.Mg)()?A(-1):A({pathname:"/",search:window.location.search})},children:(0,Y.jsx)(f.mj,{})})})})]})})),x=(e,n)=>{const o=n?e.gameUrl.includes("?")?"&":"?"+new URLSearchParams(n).toString():"";return`${window.location.host.includes("localhost:3007")?"http://localhost:3002":e.gameUrl}${o}`},K=function(e,n,o,a){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,t.useEffect)((()=>{(null!==n||r)&&o>0&&j((0,i.I8)(e,n),a)}),[e,n,r,o,a])},j=(e,n)=>
1{n&&n.contentWindow&&n.contentWindow.postMessage(e,"*")}},58264(e,n){var o,t,a,r;n.I8=n.bp=n.sm=n.cn=void 0,function(e){e.APP_READY="APP_READY",e.ON_CONFIG="ON_CONFIG",e.ON_REMOTE_CONFIG="ON_REMOTE_CONFIG",e.ON_LOCAL_ANSWERS="ON_LOCAL_ANSWERS",e.ON_UPCOMING_COMPS="ON_UPCOMING_COMPS",e.ON_COMP="ON_COMP",e.ON_COMP_SUMMARY="ON_COMP_SUMMARY",e.ON_COMP_QUESTIONS="ON_COMP_QUESTIONS",e.ON_COMP_STATUS="ON_COMP_STATUS",e.ON_COMP_COUNTS="ON_COMP_COUNTS",e.ON_COMP_VIPS="ON_COMP_VIPS",e.ON_COMP_CHAT="ON_COMP_CHAT",e.ON_COMP_CHAT_LAST_READ="ON_COMP_CHAT_LAST_READ",e.ON_COMP_TALKING_POINTS="ON_COMP_TALKING_POINTS",e.ON_COMP_LEADERBOARD_CONFIG="ON_COMP_LEADERBOARD_CONFIG",e.ON_COMP_LEADERBOARD="ON_COMP_LEADERBOARD",e.ON_AUTH_USER="ON_AUTH_USER",e.ON_AUTH_TEMPORARY_USER_SCORE="ON_AUTH_TEMPORARY_USER_SCORE",e.ON_USER="ON_USER",e.ON_USER_PRIVATE="ON_USER_PRIVATE",e.ON_USER_FOLLOWING="ON_USER_FOLLOWING",e.ON_USER_ENTRY="ON_USER_ENTRY",e.ON_COMP_ENTRY_STATUS="ON_COMP_ENTRY_STATUS",e.ON_APP_ACTION="ON_APP_ACTION",e.ON_PROFILE_IMAGE_UPLOAD="ON_PROFILE_IMAGE_UPLOAD",e.ON_MUTE="ON_MUTE",e.ON_USER_CHALLENGES="ON_USER_CHALLENGES",e.ON_USER_CHALLENGE_COUNTS="ON_USER_CHALLENGE_COUNTS",e.ON_USER_CHALLENGE_READ_COUNTS="ON_USER_CHALLENGE_READ_COUNTS",e.SET_NAVIGATE="SET_NAVIGATE",e.SET_FOLLOWING="SET_FOLLOWING",e.SET_UNFOLLOWING="SET_UNFOLLOWING",e.SET_ANSWER="SET_ANSWER",e.SET_LIKE="SET_LIKE",e.SET_COMP_ENTRY="SET_COMP_ENTRY",e.SET_ANSWER_CHANGE="SET_ANSWER_CHANGE",e.SET_ANALYTICS="SET_ANALYTICS",e.SET_CURRENT_SCREEN="SET_CURRENT_SCREEN",e.SET_EDIT_PROFILE="SET_EDIT_PROFILE",e.SET_MUTE="SET_MUTE",e.REQUEST_LOGIN="REQUEST_LOGIN",e.REQUEST_OVERLAY="REQUEST_OVERLAY",e.REQUEST_USER_BY_ID="REQUEST_USER_BY_ID"}(o||(n.cn=o={})),function(e){e.HOME="HOME",e.BACK="BACK",e.PATH="COMP",e.VENDOR="VENDOR",e.LEADERBOARD="LEADERBOARD",e.URL="URL",e.RELOAD="RELOAD",e.GROUP_CHALLENGE_NEW="GROUP_CHALLENGE_NEW"}(t||(n.sm=t={})),function(e){e.GO_HOME="GO_HOME",e.GO_LEADERBOARD="GO_LEADERBOARD"}(a||(a={})),function(e){e.COMPETITION="Competition",e.QUESTIONS_COMPLETE="QuestionsComplete",e.LEADERBOARD="Leaderboard",e.CHAT="Chatt",e.LATEST="Latest",e.TALKING_POINTS="TalkingPoints",e.ANSWERS="Answers",e.PRIZES="Prizes",e.QUESTION_PREFIX="Question_",e.ENTRY_CONFIRMED="GameEntryConfirmed",e.ENTRY_LOGIN="GameEntryLogin",e.ENTRY_USERNAME="GameEntryUsername"}(r||(n.bp=r={}));n.I8=function(e,n){return{name:e,payload:n}}},21141(e,n,o){n.JZ=n.u9=n.S9=void 0;var t=o(63541);n.S9=function(e){return{type:t.ActionType.QUESTION_ANSWERED,payload:e}};n.u9=function(e){return{type:t.ActionType.QUESTION_LIKED,payload:e}};n.JZ=function(){return{type:t.ActionType.RESET_INITIAL_VIEW_STATE,payload:null}}},18509(e,n,o){n.Us=void 0;var t=o(51198),a=o(13313),r=o(56667);n.Us=(0,r.createSelector)(t.getIsUserAnonymous,t.getIsLoggingIn,(function(e){return null!==e.auth.user&&null===e.serverApis.firestore.userEntries.lastUpdated||e.serverApis.firestore.userEntries.isUpdating}),(function(e){return e.serverApis.firestore.getTempEntry.isUpdating}),(function(e){return e.serverApis.firestore.competitionStatus.isUpdating}),a.getQuestions,a.getCompetitionError,(function(e,n,o,t,a,r,i){return!!e||!(n||o||t||a||i)&&null!==r})),(0,r.createSelector)(a.getCompetitionError,(function(e){return null!==e}))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.