@streamlayer/react 0.31.6 → 0.31.8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./index4.js"),k=require("@nanostores/react"),z=require("./masters2.js"),y=require("@streamlayer/sdk-web-types"),S=require("react"),Ne=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("@lottiefiles/react-lottie-player");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=r.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=r.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>r.n1,Oe=r.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=r.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ke=r.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ce=()=>r.n1,be=r.styled_default(Ce())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),de=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===y.QuestionType.TRIVIA,"data-type-poll":e===y.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(ke,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},ue=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),pe=e=>e?e.toLocaleString("en-US"):"0",we=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Ee=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),$e=r.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Qe=r.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=r.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Qe,{children:t}),s.jsx(Re,{children:e})]}),Ue=r.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=r.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=r.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=r.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=r.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=r.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=r.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=r.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=r.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ze=r.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=r.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=r.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=r.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=r.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=r.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=r.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=r.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=r.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),rt=r.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),ot="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEw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gNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",me=({avatar:e,name:t,points:n,friendsRank:i,rank:o,streak:p,correct:c,incorrect:m,inTop:u,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(rt,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:ue(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ze,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:ot}),s.jsxs(Xe,{children:[pe(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",u||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(G,{indicator:i||0,title:"Friends rank"}),s.jsx(G,{indicator:o||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx($,{indicator:p||0,title:"Win streak"}),s.jsx($,{indicator:c||0,title:"Correct"}),s.jsx($,{indicator:m||0,title:"Incorrect"}),s.jsx($,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=r.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),lt=r.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ct=r.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),dt=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(r.n1,{name:"icon-check-circle"}),s.jsx(lt,{children:e}),s.jsx(ct,{children:t})]}),ut=r.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),pt=()=>r.n1,mt=r.styled_default(pt())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=r.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=r.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),It=r.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=r.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=r.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:o,questionStatus:p})=>{const c=n&&(i===y.QuestionType.TRIVIA||i===y.QuestionType.PREDICTION);if(!c&&p!==y.QuestionStatus.RESOLVED)return null;const m=i===y.QuestionType.PREDICTION&&!o,u=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ut,{"data-isPrediction":m,children:[p===y.QuestionStatus.RESOLVED&&i===y.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(r.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),c&&m&&s.jsxs(s.Fragment,{children:[s.jsx(mt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),c&&o&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":u,children:s.jsx(r.n1,{name:u})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(It,{"data-feedbackType":u,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},yt=r.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),xt=r.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=r.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),jt=r.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Mt=r.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=r.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Tt=r.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Nt=r.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),At=r.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),Ie=r.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),St=()=>Ie,Dt=r.styled_default(St())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),zt=()=>Ie,Ot=r.styled_default(zt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=r.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),kt=r.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ct=r.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),bt=()=>r.n1,wt=r.styled_default(bt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[y.QuestionImages.CENTERED]:e=>s.jsx(Dt,{alt:"option-icon",src:e}),[y.QuestionImages.TRANSPARENT]:e=>s.jsx(Nt,{children:s.jsx(At,{style:{backgroundImage:`url(${e})`}})}),[y.QuestionImages.ROUNDED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[y.QuestionImages.NONE]:()=>null,[y.QuestionImages.UNSET]:()=>null},Et=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:o})=>{if(e===y.QuestionType.POLL&&i)return"correct";if(e===y.QuestionType.PREDICTION){if(t&&o)return i?n?"correct":"incorrect":n?"correct":"unset";if(i)return"correct"}return e===y.QuestionType.TRIVIA&&o?i?n?"correct":"incorrect":n?"correct":"unset":"unset"},Lt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:o})=>e===y.QuestionType.TRIVIA?t&&n:e===y.QuestionType.PREDICTION?t&&n&&i||o===y.QuestionStatus.RESOLVED&&n:!1,$t=e=>{var t;const{id:n,icon:i,text:o,percentageDecimal:p,onVote:c,youSelected:m,questionVoted:u,imageMode:I,answerTimeExpired:M,questionStatus:N,isLoading:j,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Et(e),d=Lt({questionType:v,questionVoted:u,correct:T,hasCorrectAnswer:a,questionStatus:N}),f=u||N===y.QuestionStatus.RESOLVED&&v===y.QuestionType.PREDICTION;return s.jsxs(Mt,{value:n,"data-selected":m,"data-answerState":l,disabled:u||j||M,onClick:c,children:[f&&s.jsx(vt,{"data-answerState":l,style:{width:`${p}%`}}),s.jsxs(Tt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(_t,{children:o}),f&&s.jsxs(kt,{children:[d&&s.jsx(wt,{name:"selected"}),s.jsx(Ct,{children:s.jsx(Ne.d,{value:p,suffix:"%"})})]})]})]})},Qt=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],Rt=[10,10,0],Ut=r.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=b.E.SECONDARY_GREEN6,ee=b.E.SECONDARY_RED3,Pt=b.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,o]=S.useState(t>10?qt:ee),p=({remainingTime:u})=>s.jsx(Ut,{children:u}),c=S.useCallback(()=>{n==null||n(),o(Pt)},[n,o]),m=S.useCallback(u=>{u===10&&o(ee)},[o]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:Qt,colorsTime:Rt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:p})},Wt=r.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Vt=r.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ft=r.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>r.n1,Ht=r.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Zt=r.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Gt=r.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=r.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:o,timerDuration:p,onTimerExpired:c})=>s.jsxs(Wt,{children:[s.jsxs(Vt,{children:[e&&s.jsx(Ft,{children:e}),t!==void 0&&o!==y.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Zt,{children:[s.jsx(Gt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),i&&s.jsx(Yt,{isPlaying:n,onTimerExpired:c,duration:p})]}),Xt=({openedQuestion:e,vote:t,close:n})=>{var i;const o=e.subject,p=e.type,c=(i=e.options)==null?void 0:i.options,[m,u]=S.useState(!1),[I,M]=S.useState(!1),[N,j]=S.useState(""),v=e==null?void 0:e.id,T=S.useCallback(async g=>{if(v){const h=g.currentTarget.value;j(h),M(!0),await t(v,h),M(!1)}},[v,j,t]),a=S.useCallback(()=>{u(!0),setTimeout(n,3e3)},[n]),l=S.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=S.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=S.useMemo(()=>e?e.answers.map(g=>{var h;return{...g,questionVoted:!!l,youSelected:N===g.id,isLoading:I,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:T}}):[],[d,m,I,e,l,T,N]),x=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(yt,{children:s.jsxs(xt,{children:[x&&s.jsx(ht,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:p,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==y.QuestionType.PREDICTION&&s.jsx(Kt,{title:m?"Time expired":e.type===y.QuestionType.POLL?"Time remaining":"To win",points:m?void 0:100,onTimerExpired:a,questionType:e.type,isTimer:!0,isPlayingTimer:!l,timerDuration:l?0:30}),m?s.jsx(dt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===y.QuestionType.PREDICTION,children:o}),s.jsx(jt,{children:f.map(g=>s.jsx($t,{...g},g.id))})]})]})})})},es=r.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=r.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=r.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=r.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=r.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),rs=r.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),fe=({created:e,image:t,title:n,instantView:i})=>{const o=S.useMemo(()=>{if(e){const c=new Date(e);if(Le(c))return{date:we(c),time:Ee(c)}}return null},[e]),p=(i==null?void 0:i.image)||t;return s.jsxs(es,{children:[o&&s.jsxs(is,{children:[o.date," · ",o.time]}),(i==null?void 0:i.video)&&s.jsx(z.w,{source:i.video.url,poster:i.video.thumbnailUrl}),p&&s.jsx(rs,{src:p}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||n}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},os=r.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),as=r.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(os,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(r.n1,{name:"icon-external-link"})]})]}),cs=r.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),ds=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ls,{created:e.attributes.created,...e.attributes.attributes.value}):null},us=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:o}=e;return!i&&o?s.jsx(Xt,{vote:t,close:n,openedQuestion:o}):null},ps=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const o=n.type;return s.jsxs(cs,{children:[s.jsx(de,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||y.QuestionType.UNSET}),o==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),o!=="question"&&s.jsx(ds,{openedQuestion:n})]})},ms=r.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Is=r.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=r.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=r.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(fs,{onClick:n,"data-selected":t,children:s.jsx(hs,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(Is,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},V(e,t)}function xs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||ne(e)&&ne(t))}function js(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gs(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=js);var n,i=[],o,p=!1;function c(){for(var m=[],u=0;u<arguments.length;u++)m[u]=arguments[u];return p&&n===this&&t(m,i)||(o=e.apply(this,m),p=!0,n=this,i=m),o}return c}var Ms=typeof performance=="object"&&typeof performance.now=="function",ie=Ms?function(){return performance.now()}:function(){return Date.now()};function re(e){cancelAnimationFrame(e.id)}function vs(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):o.id=requestAnimationFrame(i)}var o={id:requestAnimationFrame(i)};return o}var Y=-1;function oe(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var C=null;function ae(e){if(e===void 0&&(e=!1),C===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),o=i.style;return o.width="100px",o.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?C="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?C="negative":C="positive-ascending"),document.body.removeChild(t),C}return C}var Ts=150,Ns=function(t,n){return t};function As(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,p=e.getOffsetForIndexAndAlignment,c=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,u=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(N){xs(j,N);function j(T){var a;return a=N.call(this,T)||this,a._instanceProps=u(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,x=d.itemSize,g=d.layout,h=a._getItemStyleCache(I&&x,I&&g,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var D=n(a.props,l,a._instanceProps),O=o(a.props,l,a._instanceProps),_=f==="horizontal"||g==="horizontal",E=f==="rtl",L=_?D:0;h[l]=A={position:"absolute",left:E?void 0:L,right:E?L:void 0,top:_?0:D,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,x=d.scrollLeft,g=d.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,D=x;if(A==="rtl")switch(ae()){case"negative":D=-x;break;case"positive-descending":D=g-f-x;break}return D=Math.max(0,Math.min(D,g-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,x=d.scrollHeight,g=d.scrollTop;a.setState(function(h){if(h.scrollOffset===g)return null;var A=Math.max(0,Math.min(g,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&re(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=vs(a._resetIsScrolling,Ts)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return Ss(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,x=d.layout,g=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?oe():0:h=A.scrollHeight>A.clientHeight?oe():0}this.scrollTo(p(this.props,a,l,g,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=d:x.scrollTop=d}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,x=f.scrollOffset,g=f.scrollUpdateWasRequested;if(g&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,D=h.scrollWidth;h.scrollLeft=D-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&re(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,x=a.height,g=a.innerRef,h=a.innerElementType,A=a.innerTagName,D=a.itemCount,O=a.itemData,_=a.itemKey,E=_===void 0?Ns:_,L=a.layout,he=a.outerElementType,ye=a.outerTagName,xe=a.style,ge=a.useIsScrolling,je=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",Me=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),ve=B[0],Te=B[1],H=[];if(D>0)for(var w=ve;w<=Te;w++)H.push(S.createElement(l,{data:O,key:E(w,O),index:w,isScrolling:ge?F:void 0,style:this._getItemStyle(w)}));var Z=i(this.props,this._instanceProps);return S.createElement(he||ye||"div",{className:d,onScroll:Me,ref:this._outerRefSetter,style:W({position:"relative",height:x,width:je,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},S.createElement(h||A||"div",{children:H,ref:g,style:{height:U?"100%":Z,pointerEvents:F?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],x=l[2],g=l[3];this._callOnItemsRendered(d,f,x,g)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,D=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,D,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,x=f.isScrolling,g=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=c(this.props,h,this._instanceProps),D=m(this.props,A,h,this._instanceProps),O=!x||g==="backward"?Math.max(1,d):1,_=!x||g==="forward"?Math.max(1,d):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,D+_)),A,D]},j}(S.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ss=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ds=As({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,o,p,c){var m=t.direction,u=t.height,I=t.itemCount,M=t.itemSize,N=t.layout,j=t.width,v=m==="horizontal"||N==="horizontal",T=v?j:u,a=Math.max(0,I*M-T),l=Math.min(a,n*M),d=Math.max(0,n*M-T+M+c);switch(i==="smart"&&(o>=d-T&&o<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(T/2)?0:f>a+Math.floor(T/2)?a:f}case"auto":default:return o>=d&&o<=l?o:o<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,i){var o=t.direction,p=t.height,c=t.itemCount,m=t.itemSize,u=t.layout,I=t.width,M=o==="horizontal"||u==="horizontal",N=n*m,j=M?I:p,v=Math.ceil((j+i-N)/m);return Math.max(0,Math.min(c-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function zs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,o=e.stopIndex;return!(i>n||o<t)}function Os(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,o=e.startIndex,p=e.stopIndex,c=[],m=null,u=null,I=o;I<=p;I++){var M=t(I);M?u!==null&&(c.push(m,u),m=u=null):(u=I,m===null&&(m=I))}if(u!==null){for(var N=Math.min(Math.max(u,m+i-1),n-1),j=u+1;j<=N&&!t(j);j++)u=j;c.push(m,u)}if(c.length)for(;c[1]-c[0]+1<i&&c[0]>0;){var v=c[0]-1;if(!t(v))c[0]=v;else break}return c}var _s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ks=function(){function e(t,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Cs=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},bs=function(e){Cs(t,e);function t(){var n,i,o,p;_s(this,t);for(var c=arguments.length,m=Array(c),u=0;u<c;u++)m[u]=arguments[u];return p=(i=(o=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(I){var M=I.visibleStartIndex,N=I.visibleStopIndex;o._lastRenderedStartIndex=M,o._lastRenderedStopIndex=N,o._ensureRowsLoaded(M,N)},o._setRef=function(I){o._listRef=I},i),le(o,p)}return ks(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,o){var p=this.props,c=p.isItemLoaded,m=p.itemCount,u=p.minimumBatchSize,I=u===void 0?10:u,M=p.threshold,N=M===void 0?15:M,j=Os({isItemLoaded:c,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-N),stopIndex:Math.min(m-1,o+N)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,T){return j[T]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var o=this,p=this.props.loadMoreItems||this.props.loadMoreRows,c=function(I){var M=i[I],N=i[I+1],j=p(M,N);j!=null&&j.then(function(){if(zs({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:M,stopIndex:N})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(M,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)c(m)}}]),t}(S.PureComponent);const ws=r.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Es=r.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ls=r.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),$s=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Qs=r.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=r.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Us=r.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),qs=()=>r.n1,Ps=r.styled_default(qs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:n,points:i,isCurrentUser:o,openItemDetail:p,style:c})=>s.jsxs(ws,{onClick:p,style:c,children:[s.jsx(Es,{children:e||0}),s.jsxs(Qs,{children:[t?s.jsx(Ls,{alt:"leaderboard-item-avatar",src:t}):s.jsx($s,{children:ue(n||"")}),s.jsxs(Rs,{children:[s.jsx(Us,{children:n||""}),o&&s.jsx(Ps,{name:"icon-star"})]})]}),s.jsx("div",{children:pe(i)})]}),Ws=r.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Vs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:o,height:p})=>s.jsx(bs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Ws,{children:s.jsx(Ds,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:o,height:p,children:({index:u,style:I})=>s.jsx(Ys,{style:{...I,maxHeight:48},...e[u],openItemDetail:()=>n(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=k.useStore(e.$store);return s.jsx(z.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Bs=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Vs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Hs=r.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zs=r.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=r.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Js=r.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ks=()=>r.n1,Q=r.styled_default(Ks())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Xs=()=>r.n1,en=r.styled_default(Xs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=r.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),sn=r.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),nn=r.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),rn={[y.PickHistoryStatus.LOST]:s.jsx(Q,{name:"incorrectVoted"}),[y.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[y.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[y.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},on=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:o,openQuestion:p,status:c})=>{const m=z.o[t],u=rn[c];return m?s.jsxs(Hs,{onClick:()=>p==null?void 0:p(e),children:[s.jsxs(sn,{children:[s.jsxs(Zs,{children:[s.jsx(en,{"data-type-trivia":t===y.QuestionType.TRIVIA,"data-type-poll":t===y.QuestionType.POLL,name:m.iconName}),s.jsxs(tn,{children:[m.label,t===y.QuestionType.TRIVIA&&n===y.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:i||""})]}),s.jsx(Js,{children:o?s.jsx(nn,{children:"Play"}):u})]}):null},an=r.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),ln=r.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:t,...n})=>s.jsxs(an,{children:[s.jsx(fe,{questionId:t,...n}),e&&s.jsx(ln,{onClick:()=>e(t),children:"View Insight"})]}),dn=r.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:e,openQuestion:t})=>s.jsx(dn,{children:e==null?void 0:e.map(n=>{var i,o;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const p=n.attributes.attributes.value;return s.jsx(on,{openQuestion:t,...p},p.questionId)}if(n.type==="insight"&&((o=n.attributes)==null?void 0:o.attributes.case)==="insight"){const p=n.attributes.attributes.value;return s.jsx(cn,{openInsight:t,...p},p.questionId)}return null})}),pn=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(un,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},mn=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(me,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},In=({gamification:e})=>{const[t,n]=S.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(ys,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(mn,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(pn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Bs,{gamification:e})})]})},fn=()=>z.d,ce=r.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),hn=r.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),yn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},xn=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(ps,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(hn,{children:[s.jsx(de,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(me,{...i,successRate:yn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(In,{gamification:e})})]})};exports.default=xn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index4.js"),k=require("@nanostores/react"),z=require("./masters2.js"),y=require("@streamlayer/sdk-web-types"),D=require("react"),Ne=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("@lottiefiles/react-lottie-player");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=o.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=o.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>o.n1,Oe=o.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=o.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ke=o.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ce=()=>o.n1,be=o.styled_default(Ce())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),de=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===y.QuestionType.TRIVIA,"data-type-poll":e===y.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(ke,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},ue=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),pe=e=>e?e.toLocaleString("en-US"):"0",we=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Ee=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),$e=o.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Qe=o.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=o.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Qe,{children:t}),s.jsx(Re,{children:e})]}),Ue=o.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=o.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=o.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=o.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=o.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=o.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=o.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=o.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=o.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ze=o.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=o.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=o.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=o.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=o.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=o.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=o.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=o.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=o.styled_default("div")({name:"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jEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",me=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:u,correct:p,incorrect:m,inTop:c,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(ot,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:ue(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ze,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:rt}),s.jsxs(Xe,{children:[pe(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(G,{indicator:i||0,title:"Friends rank"}),s.jsx(G,{indicator:r||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx($,{indicator:u||0,title:"Win streak"}),s.jsx($,{indicator:p||0,title:"Correct"}),s.jsx($,{indicator:m||0,title:"Incorrect"}),s.jsx($,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=o.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),lt=o.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ct=o.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),dt=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(o.n1,{name:"icon-check-circle"}),s.jsx(lt,{children:e}),s.jsx(ct,{children:t})]}),ut=o.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),pt=()=>o.n1,mt=o.styled_default(pt())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=o.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=o.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),It=o.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=o.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:u})=>{const p=n&&(i===y.QuestionType.TRIVIA||i===y.QuestionType.PREDICTION);if(!p&&u!==y.QuestionStatus.RESOLVED)return null;const m=i===y.QuestionType.PREDICTION&&!r,c=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ut,{"data-isPrediction":m,children:[u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(o.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&s.jsxs(s.Fragment,{children:[s.jsx(mt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":c,children:s.jsx(o.n1,{name:c})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(It,{"data-feedbackType":c,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},yt=o.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),xt=o.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=o.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),jt=o.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Mt=o.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=o.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Tt=o.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Nt=o.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),At=o.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),Ie=o.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),St=()=>Ie,Dt=o.styled_default(St())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),zt=()=>Ie,Ot=o.styled_default(zt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=o.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),kt=o.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ct=o.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),bt=()=>o.n1,wt=o.styled_default(bt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[y.QuestionImages.CENTERED]:e=>s.jsx(Dt,{alt:"option-icon",src:e}),[y.QuestionImages.TRANSPARENT]:e=>s.jsx(Nt,{children:s.jsx(At,{style:{backgroundImage:`url(${e})`}})}),[y.QuestionImages.ROUNDED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[y.QuestionImages.NONE]:()=>null,[y.QuestionImages.UNSET]:()=>null},Et=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===y.QuestionType.POLL&&i)return"correct";if(e===y.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":"unset";if(i)return"correct"}return e===y.QuestionType.TRIVIA&&r&&i?n?"correct":"incorrect":"unset"},Lt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===y.QuestionType.TRIVIA?t&&n:e===y.QuestionType.PREDICTION?t&&n&&i||r===y.QuestionStatus.RESOLVED&&n:!1,$t=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:c,imageMode:I,answerTimeExpired:M,questionStatus:N,isLoading:j,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Et(e),d=Lt({questionType:v,questionVoted:c,correct:T,hasCorrectAnswer:a,questionStatus:N}),f=c||N===y.QuestionStatus.RESOLVED&&v===y.QuestionType.PREDICTION;return s.jsxs(Mt,{value:n,"data-selected":m,"data-answerState":l,disabled:c||j||M,"data-isNotChecked":c&&!m&&l!=="incorrect",onClick:p,children:[s.jsx(vt,{"data-answerState":l,style:{width:`${f?u:0}%`}}),s.jsxs(Tt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(_t,{children:r}),f&&s.jsxs(kt,{children:[d&&s.jsx(wt,{name:"selected"}),s.jsx(Ct,{children:s.jsx(Ne.d,{value:u,suffix:"%"})})]})]})]})},Qt=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],Rt=[10,10,0],Ut=o.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=b.E.SECONDARY_GREEN6,ee=b.E.SECONDARY_RED3,Pt=b.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=D.useState(t>10?qt:ee),u=({remainingTime:c})=>s.jsx(Ut,{children:c}),p=D.useCallback(()=>{n==null||n(),r(Pt)},[n,r]),m=D.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:Qt,colorsTime:Rt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:m,children:u})},Wt=o.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Vt=o.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ft=o.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>o.n1,Ht=o.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Zt=o.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Gt=o.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=o.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:r,timerDuration:u,onTimerExpired:p})=>s.jsxs(Wt,{children:[s.jsxs(Vt,{children:[e&&s.jsx(Ft,{children:e}),t!==void 0&&r!==y.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Zt,{children:[s.jsx(Gt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),i&&s.jsx(Yt,{isPlaying:n,onTimerExpired:p,duration:u})]}),Xt=({openedQuestion:e,isLoading:t,vote:n,close:i})=>{var r,u;const p=e.subject,m=e.type,c=(r=e.options)==null?void 0:r.options,[I,M]=D.useState(!1),[N,j]=D.useState(""),v=e==null?void 0:e.id,T=D.useCallback(async g=>{if(v){const h=g.currentTarget.value;j(h),await n(v,h)}},[v,j,n]),a=D.useCallback(()=>{M(!0),setTimeout(i,3e3)},[i]),l=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=D.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=D.useMemo(()=>e?e.answers.map(g=>{var h;return{...g,questionVoted:!!l,youSelected:N===g.id,isLoading:t,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:I,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:T}}):[],[d,I,t,e,l,T,N]),x=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(yt,{children:s.jsxs(xt,{children:[x&&s.jsx(ht,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==y.QuestionType.PREDICTION&&s.jsx(Kt,{title:I?"Time expired":e.type===y.QuestionType.POLL?"Time remaining":"To win",points:I?void 0:100,onTimerExpired:a,questionType:e.type,isTimer:!t,isPlayingTimer:!l,timerDuration:l?0:Number(((u=e==null?void 0:e.appearance)==null?void 0:u.autoHideInterval)||"30")}),I?s.jsx(dt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===y.QuestionType.PREDICTION,children:p}),s.jsx(jt,{children:f.map(g=>s.jsx($t,{...g},g.id))})]})]})})})},es=o.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=o.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=o.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=o.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=o.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),os=o.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),fe=({created:e,image:t,title:n,instantView:i})=>{const r=D.useMemo(()=>{if(e){const p=new Date(e);if(Le(p))return{date:we(p),time:Ee(p)}}return null},[e]),u=(i==null?void 0:i.image)||t;return s.jsxs(es,{children:[r&&s.jsxs(is,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(z.w,{source:i.video.url,poster:i.video.thumbnailUrl}),u&&s.jsx(os,{src:u}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||n}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},rs=o.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),as=o.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(rs,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.n1,{name:"icon-external-link"})]})]}),cs=o.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),ds=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ls,{created:e.attributes.created,...e.attributes.attributes.value}):null},us=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:r}=e;return r?s.jsx(Xt,{vote:t,close:n,openedQuestion:r,isLoading:!!i}):null},ps=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(cs,{children:[s.jsx(de,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||y.QuestionType.UNSET}),r==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(ds,{openedQuestion:n})]})},ms=o.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Is=o.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=o.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=o.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(fs,{onClick:n,"data-selected":t,children:s.jsx(hs,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(Is,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},V(e,t)}function xs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||ne(e)&&ne(t))}function js(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gs(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=js);var n,i=[],r,u=!1;function p(){for(var m=[],c=0;c<arguments.length;c++)m[c]=arguments[c];return u&&n===this&&t(m,i)||(r=e.apply(this,m),u=!0,n=this,i=m),r}return p}var Ms=typeof performance=="object"&&typeof performance.now=="function",ie=Ms?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function vs(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function re(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var C=null;function ae(e){if(e===void 0&&(e=!1),C===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?C="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?C="negative":C="positive-ascending"),document.body.removeChild(t),C}return C}var Ts=150,Ns=function(t,n){return t};function As(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,u=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,c=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(N){xs(j,N);function j(T){var a;return a=N.call(this,T)||this,a._instanceProps=c(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,x=d.itemSize,g=d.layout,h=a._getItemStyleCache(I&&x,I&&g,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var S=n(a.props,l,a._instanceProps),O=r(a.props,l,a._instanceProps),_=f==="horizontal"||g==="horizontal",E=f==="rtl",L=_?S:0;h[l]=A={position:"absolute",left:E?void 0:L,right:E?L:void 0,top:_?0:S,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,x=d.scrollLeft,g=d.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,S=x;if(A==="rtl")switch(ae()){case"negative":S=-x;break;case"positive-descending":S=g-f-x;break}return S=Math.max(0,Math.min(S,g-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,x=d.scrollHeight,g=d.scrollTop;a.setState(function(h){if(h.scrollOffset===g)return null;var A=Math.max(0,Math.min(g,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=vs(a._resetIsScrolling,Ts)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return Ss(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,x=d.layout,g=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?re():0:h=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(u(this.props,a,l,g,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=d:x.scrollTop=d}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,x=f.scrollOffset,g=f.scrollUpdateWasRequested;if(g&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,S=h.scrollWidth;h.scrollLeft=S-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,x=a.height,g=a.innerRef,h=a.innerElementType,A=a.innerTagName,S=a.itemCount,O=a.itemData,_=a.itemKey,E=_===void 0?Ns:_,L=a.layout,he=a.outerElementType,ye=a.outerTagName,xe=a.style,ge=a.useIsScrolling,je=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",Me=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),ve=B[0],Te=B[1],H=[];if(S>0)for(var w=ve;w<=Te;w++)H.push(D.createElement(l,{data:O,key:E(w,O),index:w,isScrolling:ge?F:void 0,style:this._getItemStyle(w)}));var Z=i(this.props,this._instanceProps);return D.createElement(he||ye||"div",{className:d,onScroll:Me,ref:this._outerRefSetter,style:W({position:"relative",height:x,width:je,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},D.createElement(h||A||"div",{children:H,ref:g,style:{height:U?"100%":Z,pointerEvents:F?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],x=l[2],g=l[3];this._callOnItemsRendered(d,f,x,g)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,S=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,S,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,x=f.isScrolling,g=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),S=m(this.props,A,h,this._instanceProps),O=!x||g==="backward"?Math.max(1,d):1,_=!x||g==="forward"?Math.max(1,d):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,S+_)),A,S]},j}(D.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ss=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ds=As({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,u,p){var m=t.direction,c=t.height,I=t.itemCount,M=t.itemSize,N=t.layout,j=t.width,v=m==="horizontal"||N==="horizontal",T=v?j:c,a=Math.max(0,I*M-T),l=Math.min(a,n*M),d=Math.max(0,n*M-T+M+p);switch(i==="smart"&&(r>=d-T&&r<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(T/2)?0:f>a+Math.floor(T/2)?a:f}case"auto":default:return r>=d&&r<=l?r:r<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,u=t.height,p=t.itemCount,m=t.itemSize,c=t.layout,I=t.width,M=r==="horizontal"||c==="horizontal",N=n*m,j=M?I:u,v=Math.ceil((j+i-N)/m);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function zs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function Os(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,u=e.stopIndex,p=[],m=null,c=null,I=r;I<=u;I++){var M=t(I);M?c!==null&&(p.push(m,c),m=c=null):(c=I,m===null&&(m=I))}if(c!==null){for(var N=Math.min(Math.max(c,m+i-1),n-1),j=c+1;j<=N&&!t(j);j++)c=j;p.push(m,c)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var _s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ks=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Cs=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},bs=function(e){Cs(t,e);function t(){var n,i,r,u;_s(this,t);for(var p=arguments.length,m=Array(p),c=0;c<p;c++)m[c]=arguments[c];return u=(i=(r=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(I){var M=I.visibleStartIndex,N=I.visibleStopIndex;r._lastRenderedStartIndex=M,r._lastRenderedStopIndex=N,r._ensureRowsLoaded(M,N)},r._setRef=function(I){r._listRef=I},i),le(r,u)}return ks(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var u=this.props,p=u.isItemLoaded,m=u.itemCount,c=u.minimumBatchSize,I=c===void 0?10:c,M=u.threshold,N=M===void 0?15:M,j=Os({isItemLoaded:p,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-N),stopIndex:Math.min(m-1,r+N)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,T){return j[T]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var M=i[I],N=i[I+1],j=u(M,N);j!=null&&j.then(function(){if(zs({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:M,stopIndex:N})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(M,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)p(m)}}]),t}(D.PureComponent);const ws=o.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Es=o.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ls=o.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),$s=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Qs=o.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=o.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Us=o.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),qs=()=>o.n1,Ps=o.styled_default(qs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:u,style:p})=>s.jsxs(ws,{onClick:u,style:p,children:[s.jsx(Es,{children:e||0}),s.jsxs(Qs,{children:[t?s.jsx(Ls,{alt:"leaderboard-item-avatar",src:t}):s.jsx($s,{children:ue(n||"")}),s.jsxs(Rs,{children:[s.jsx(Us,{children:n||""}),r&&s.jsx(Ps,{name:"icon-star"})]})]}),s.jsx("div",{children:pe(i)})]}),Ws=o.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Vs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:r,height:u})=>s.jsx(bs,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:m})=>s.jsx(Ws,{children:s.jsx(Ds,{itemSize:56,onItemsRendered:p,ref:m,itemCount:e.length,width:r,height:u,children:({index:c,style:I})=>s.jsx(Ys,{style:{...I,maxHeight:48},...e[c],openItemDetail:()=>n(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=k.useStore(e.$store);return s.jsx(z.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Bs=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Vs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Hs=o.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zs=o.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=o.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Js=o.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ks=()=>o.n1,Q=o.styled_default(Ks())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Xs=()=>o.n1,en=o.styled_default(Xs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=o.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),sn=o.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),nn=o.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),on={[y.PickHistoryStatus.LOST]:s.jsx(Q,{name:"incorrectVoted"}),[y.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[y.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[y.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},rn=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:u,status:p})=>{const m=z.o[t],c=on[p];return m?s.jsxs(Hs,{onClick:()=>u==null?void 0:u(e),children:[s.jsxs(sn,{children:[s.jsxs(Zs,{children:[s.jsx(en,{"data-type-trivia":t===y.QuestionType.TRIVIA,"data-type-poll":t===y.QuestionType.POLL,name:m.iconName}),s.jsxs(tn,{children:[m.label,t===y.QuestionType.TRIVIA&&n===y.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:i||""})]}),s.jsx(Js,{children:r?s.jsx(nn,{children:"Play"}):c})]}):null},an=o.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),ln=o.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:t,...n})=>s.jsxs(an,{children:[s.jsx(fe,{questionId:t,...n}),e&&s.jsx(ln,{onClick:()=>e(t),children:"View Insight"})]}),dn=o.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:e,openQuestion:t})=>s.jsx(dn,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const u=n.attributes.attributes.value;return s.jsx(rn,{openQuestion:t,...u},u.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const u=n.attributes.attributes.value;return s.jsx(cn,{openInsight:t,...u},u.questionId)}return null})}),pn=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(un,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},mn=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(me,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},In=({gamification:e})=>{const[t,n]=D.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(ys,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(mn,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(pn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Bs,{gamification:e})})]})},fn=()=>z.d,ce=o.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),hn=o.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),yn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},xn=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(ps,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(hn,{children:[s.jsx(de,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(me,{...i,successRate:yn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(In,{gamification:e})})]})};exports.default=xn;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,_e=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(r==null?void 0:r.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(ke,{children:r.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(_e,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",Ce=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),$e=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Le=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Le,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0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YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:i,friendsRank:r,rank:a,streak:c,correct:l,incorrect:m,inTop:u,successRate:h})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(i),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",u||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:r||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(C,{indicator:c||0,title:"Win streak"}),s.jsx(C,{indicator:l||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ot=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ct=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ot,{children:e}),s.jsx(lt,{children:t})]}),dt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ut=()=>n.n1,pt=n.styled_default(ut())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),mt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:a,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!a,u=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(dt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx(L,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":u,children:s.jsx(n.n1,{name:u})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(mt,{"data-feedbackType":u,children:h==null?void 0:h.title}),s.jsx(L,{children:h==null?void 0:h.description})]})})]})]})},It=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),yt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),jt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Mt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),vt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Tt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Nt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),At=()=>me,St=n.styled_default(At())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Dt=()=>me,zt=n.styled_default(Dt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),kt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ot=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),wt=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),_t=()=>n.n1,Ct=n.styled_default(_t())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(St,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Tt,{children:s.jsx(Nt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(zt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},bt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:a})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&a?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Et=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||a===n.QuestionStatus.RESOLVED&&i:!1,$t=e=>{var t;const{id:i,icon:r,text:a,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:u,imageMode:h,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:o}=e,d=bt(e),p=Et({questionType:v,questionVoted:u,correct:N,hasCorrectAnswer:o,questionStatus:g}),f=u||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(jt,{value:i,"data-selected":m,"data-answerState":d,disabled:u||I||M,onClick:l,children:[f&&s.jsx(Mt,{"data-answerState":d,style:{width:`${c}%`}}),s.jsxs(vt,{children:[r&&h&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(kt,{children:a}),f&&s.jsxs(Ot,{children:[p&&s.jsx(Ct,{name:"selected"}),s.jsx(wt,{children:s.jsx(n.d,{value:c,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,Lt=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[l,m]=T.useState(i),u=T.useRef(0),h=T.useRef(i),M=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,j=u.current+y;I.current=f,u.current=j;let x=h.current+(r===0?j:(j/r|0)*r),A=h.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},d=T.useCallback(p=>{o(),u.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(a==null?void 0:a(M.current/1e3))||{};p&&(v.current=setTimeout(()=>d(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,r]),{elapsedTime:l,reset:d}},Rt=(e,t,i)=>{let r=e/2,a=t/2,c=r-a,l=2*c,m=i==="clockwise"?"1,0":"0,1",u=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:u}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Qt=e=>({position:"relative",width:e,height:e}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,i,r,a)=>{if(r===0)return t;let c=(a?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,l)=>`#${a}${a}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},Pt=(e,t)=>{var i;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=a==null?void 0:a.findIndex((I,v)=>I>=t&&t>=a[v+1]))!=null?i:-1;if(!a||l===-1)return r[0];if(!c)return r[l];let m=a[l]-t,u=a[l]-a[l+1],h=K(r[l]),M=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>fe(m,I,M[v]-I,u,g)|0).join(",")})`},qt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:u=!1,rotation:h="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:o}=Rt(a,v,h),{elapsedTime:d}=Lt({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?f=>{var y;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(y=M(f))!=null?y:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-d;return{elapsedTime:d,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:h,size:a,stroke:Pt(e,p),strokeDashoffset:fe(d,0,o,t,u),strokeWidth:c}},he=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:a}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:u,remainingTime:h,elapsedTime:M,size:g,strokeWidth:I}=qt(e);return T.createElement("div",{style:Qt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:u})),typeof t=="function"&&T.createElement("div",{style:Ut},t({remainingTime:h,elapsedTime:M,color:m})))};he.displayName="CountdownCircleTimer";const Yt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Wt=[10,10,0],Ft=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Bt=n.E.NEUTRALS_GRAY3,Ht=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,a]=T.useState(t>10?Vt:X),c=({remainingTime:u})=>s.jsx(Ft,{children:u}),l=T.useCallback(()=>{i==null||i(),a(Bt)},[i,a]),m=T.useCallback(u=>{u===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Yt,colorsTime:Wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Gt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Kt=()=>n.n1,Xt=n.styled_default(Kt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),es=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),ts=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ss=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ns=({title:e,points:t,isPlayingTimer:i,isTimer:r,questionType:a,timerDuration:c,onTimerExpired:l})=>s.jsxs(Gt,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Jt,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:t}),s.jsx(ss,{children:"PTS"})]})]})]}),r&&s.jsx(Ht,{isPlaying:i,onTimerExpired:l,duration:c})]}),is=({openedQuestion:e,vote:t,close:i})=>{var r;const a=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,u]=T.useState(!1),[h,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async j=>{if(v){const x=j.currentTarget.value;I(x),M(!0),await t(v,x),M(!1)}},[v,I,t]),o=T.useCallback(()=>{u(!0),setTimeout(i,3e3)},[i]),d=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!d,youSelected:g===j.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,m,h,e,d,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(It,{children:s.jsxs(yt,{children:[y&&s.jsx(ht,{feedbackMessages:y,questionVoted:!!d,questionVotedCorrectly:d==null?void 0:d.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(ns,{title:m?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":"To win",points:m?void 0:100,onTimerExpired:o,questionType:e.type,isTimer:!0,isPlayingTimer:!d,timerDuration:d?0:30}),m?s.jsx(ct,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:a}),s.jsx(xt,{children:f.map(j=>s.jsx($t,{...j},j.id))})]})]})})})},rs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),as=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),os=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ls=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),cs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ds=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:i,instantView:r})=>{const a=T.useMemo(()=>{if(e){const l=new Date(e);if(Ee(l))return{date:Ce(l),time:be(l)}}return null},[e]),c=(r==null?void 0:r.image)||t;return s.jsxs(rs,{children:[a&&s.jsxs(cs,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&s.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),c&&s.jsx(ds,{src:c}),s.jsxs(as,{children:[s.jsx(os,{children:(r==null?void 0:r.heading)||i}),s.jsx(ls,{children:r==null?void 0:r.body})]})]})},us=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ps=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ms=({instantView:e,...t})=>s.jsxs(us,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ps,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),fs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),hs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ms,{created:e.attributes.created,...e.attributes.attributes.value}):null},Is=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:a}=e;return!r&&a?s.jsx(is,{vote:t,close:i,openedQuestion:a}):null},ys=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return s.jsxs(fs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(Is,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),a!=="question"&&s.jsx(hs,{openedQuestion:i})]})},gs=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),js=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Ms=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(js,{onClick:i,"data-selected":t,children:s.jsx(Ms,{children:e})}),vs=({activePage:e="home",toggleActivePage:t})=>s.jsx(gs,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},P(e,t)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ns(e,t){return!!(e===t||se(e)&&se(t))}function As(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!Ns(e[i],t[i]))return!1;return!0}function R(e,t){t===void 0&&(t=As);var i,r=[],a,c=!1;function l(){for(var m=[],u=0;u<arguments.length;u++)m[u]=arguments[u];return c&&i===this&&t(m,r)||(a=e.apply(this,m),c=!0,i=this,r=m),a}return l}var Ss=typeof performance=="object"&&typeof performance.now=="function",ne=Ss?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ds(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var zs=150,ks=function(t,i){return t};function Os(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,a=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,u=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){Ts(I,g);function I(N){var o;return o=g.call(this,N)||this,o._instanceProps=u(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(d,p,f,y){return o.props.onItemsRendered({overscanStartIndex:d,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),o._callOnScroll=void 0,o._callOnScroll=R(function(d,p,f){return o.props.onScroll({scrollDirection:d,scrollOffset:p,scrollUpdateWasRequested:f})}),o._getItemStyle=void 0,o._getItemStyle=function(d){var p=o.props,f=p.direction,y=p.itemSize,j=p.layout,x=o._getItemStyleCache(h&&y,h&&j,h&&f),A;if(x.hasOwnProperty(d))A=x[d];else{var S=i(o.props,d,o._instanceProps),D=a(o.props,d,o._instanceProps),z=f==="horizontal"||j==="horizontal",w=f==="rtl",_=z?S:0;x[d]=A={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(d,p,f){return{}}),o._onScrollHorizontal=function(d){var p=d.currentTarget,f=p.clientWidth,y=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===y)return null;var A=o.props.direction,S=y;if(A==="rtl")switch(ae()){case"negative":S=-y;break;case"positive-descending":S=j-f-y;break}return S=Math.max(0,Math.min(S,j-f)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(d){var p=d.currentTarget,f=p.clientHeight,y=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,y-f));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(d){var p=o.props.outerRef;o._outerRef=d,typeof p=="function"?p(d):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=d)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ds(o._resetIsScrolling,zs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}I.getDerivedStateFromProps=function(o,d){return ws(o,d),M(o),null};var v=I.prototype;return v.scrollTo=function(o){o=Math.max(0,o),this.setState(function(d){return d.scrollOffset===o?null:{scrollDirection:d.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(o,d){d===void 0&&(d="auto");var p=this.props,f=p.itemCount,y=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,f-1));var x=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,o,d,j,this._instanceProps,x))},v.componentDidMount=function(){var o=this.props,d=o.direction,p=o.initialScrollOffset,f=o.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;d==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var o=this.props,d=o.direction,p=o.layout,f=this.state,y=f.scrollOffset,j=f.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(d==="horizontal"||p==="horizontal")if(d==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var o=this.props,d=o.children,p=o.className,f=o.direction,y=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?ks:z,_=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,Me=o.width,q=this.state.isScrolling,$=f==="horizontal"||_==="horizontal",ve=$?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(d,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=r(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:ve,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:$?"100%":F,pointerEvents:q?"none":void 0,width:$?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var d=this._getRangeToRender(),p=d[0],f=d[1],y=d[2],j=d[3];this._callOnItemsRendered(p,f,y,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var o=this.props,d=o.itemCount,p=o.overscanCount,f=this.state,y=f.isScrolling,j=f.scrollDirection,x=f.scrollOffset;if(d===0)return[0,0,0,0];var A=l(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!y||j==="backward"?Math.max(1,p):1,z=!y||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(d-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ws=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},_s=Os({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,a,c,l){var m=t.direction,u=t.height,h=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:u,o=Math.max(0,h*M-N),d=Math.min(o,i*M),p=Math.max(0,i*M-N+M+l);switch(r==="smart"&&(a>=p-N&&a<=d+N?r="auto":r="center"),r){case"start":return d;case"end":return p;case"center":{var f=Math.round(p+(d-p)/2);return f<Math.ceil(N/2)?0:f>o+Math.floor(N/2)?o:f}case"auto":default:return a>=p&&a<=d?a:a<p?p:d}},getStartIndexForOffset:function(t,i){var r=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/a)))},getStopIndexForStartIndex:function(t,i,r){var a=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,u=t.layout,h=t.width,M=a==="horizontal"||u==="horizontal",g=i*m,I=M?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Cs(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,a=e.stopIndex;return!(r>i||a<t)}function bs(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,a=e.startIndex,c=e.stopIndex,l=[],m=null,u=null,h=a;h<=c;h++){var M=t(h);M?u!==null&&(l.push(m,u),m=u=null):(u=h,m===null&&(m=h))}if(u!==null){for(var g=Math.min(Math.max(u,m+r-1),i-1),I=u+1;I<=g&&!t(I);I++)u=I;l.push(m,u)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},$s=function(){function e(t,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),Ls=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Rs=function(e){Ls(t,e);function t(){var i,r,a,c;Es(this,t);for(var l=arguments.length,m=Array(l),u=0;u<l;u++)m[u]=arguments[u];return c=(r=(a=oe(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(h){var M=h.visibleStartIndex,g=h.visibleStopIndex;a._lastRenderedStartIndex=M,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(M,g)},a._setRef=function(h){a._listRef=h},r),oe(a,c)}return $s(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var c=this.props,l=c.isItemLoaded,m=c.itemCount,u=c.minimumBatchSize,h=u===void 0?10:u,M=c.threshold,g=M===void 0?15:M,I=bs({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var M=r[h],g=r[h+1],I=c(M,g);I!=null&&I.then(function(){if(Cs({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(M,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const Qs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Us=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ps=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ys=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ws=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Fs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>n.n1,Bs=n.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Hs=({rank:e,avatar:t,name:i,points:r,isCurrentUser:a,openItemDetail:c,style:l})=>s.jsxs(Qs,{onClick:c,style:l,children:[s.jsx(Us,{children:e||0}),s.jsxs(Ys,{children:[t?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:de(i||"")}),s.jsxs(Ws,{children:[s.jsx(Fs,{children:i||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(r)})]}),Gs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:a,height:c})=>s.jsx(Rs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Gs,{children:s.jsx(_s,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:a,height:c,children:({index:u,style:h})=>s.jsx(Hs,{style:{...h,maxHeight:48},...e[u],openItemDetail:()=>i(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),Js=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Ks=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Js,{deepLink:e.deepLink})},Xs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),en=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),nn=()=>n.n1,b=n.styled_default(nn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),rn=()=>n.n1,an=n.styled_default(rn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),on=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),cn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),dn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},un=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:a,openQuestion:c,status:l})=>{const m=n.o[t],u=dn[l];return m?s.jsxs(Xs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(ln,{children:[s.jsxs(en,{children:[s.jsx(an,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(on,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(tn,{children:r||""})]}),s.jsx(sn,{children:a?s.jsx(cn,{children:"Play"}):u})]}):null},pn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),mn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),fn=({openInsight:e,questionId:t,...i})=>s.jsxs(pn,{children:[s.jsx(Ie,{questionId:t,...i}),e&&s.jsx(mn,{onClick:()=>e(t),children:"View Insight"})]}),hn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),In=({questions:e,openQuestion:t})=>s.jsx(hn,{children:e==null?void 0:e.map(i=>{var r,a;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(un,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(fn,{openInsight:t,...c},c.questionId)}return null})}),yn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(In,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},gn=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(pe,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,i]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(vs,{activePage:t,toggleActivePage:i})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(gn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(yn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Ks,{gamification:e})})]})},jn=()=>n.d$1,le=n.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),Mn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),vn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},Tn=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(ys,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(Mn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...r,successRate:vn(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=Tn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,Ce=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:r})=>{const i=e?n.o[e]:{label:r,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(i==null?void 0:i.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ke,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(Ce,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",_e=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),_=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2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jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(r),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:i||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(_,{indicator:c||0,title:"Win streak"}),s.jsx(_,{indicator:l||0,title:"Correct"}),s.jsx(_,{indicator:m||0,title:"Incorrect"}),s.jsx(_,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ot=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ct=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ot,{children:e}),s.jsx(lt,{children:t})]}),dt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ut=()=>n.n1,pt=n.styled_default(ut())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),mt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:r,questionType:i,hasCorrectAnswer:a,questionStatus:c})=>{const l=r&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=i===n.QuestionType.PREDICTION&&!a,d=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(dt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&i===n.QuestionType.TRIVIA&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.n1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(mt,{"data-feedbackType":d,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},It=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),yt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),jt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Mt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),vt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Tt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Nt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),At=()=>me,St=n.styled_default(At())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Dt=()=>me,zt=n.styled_default(Dt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),kt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ot=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),wt=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Ct=()=>n.n1,_t=n.styled_default(Ct())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(St,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Tt,{children:s.jsx(Nt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(zt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},bt=({questionType:e,hasCorrectAnswer:t,correct:r,youVoted:i,questionVoted:a})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return i?r?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&a&&i?r?"correct":"incorrect":"unset"},Et=({questionType:e,questionVoted:t,correct:r,hasCorrectAnswer:i,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&r:e===n.QuestionType.PREDICTION?t&&r&&i||a===n.QuestionStatus.RESOLVED&&r:!1,Lt=e=>{var t;const{id:r,icon:i,text:a,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:f,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:o}=e,u=bt(e),p=Et({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:o,questionStatus:g}),h=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(jt,{value:r,"data-selected":m,"data-answerState":u,disabled:d||I||M,"data-isNotChecked":d&&!m&&u!=="incorrect",onClick:l,children:[s.jsx(Mt,{"data-answerState":u,style:{width:`${h?c:0}%`}}),s.jsxs(vt,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(kt,{children:a}),h&&s.jsxs(Ot,{children:[p&&s.jsx(_t,{name:"selected"}),s.jsx(wt,{children:s.jsx(n.d,{value:c,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,$t=({isPlaying:e,duration:t,startAt:r=0,updateInterval:i=0,onComplete:a,onUpdate:c})=>{let[l,m]=T.useState(r),d=T.useRef(0),f=T.useRef(r),M=T.useRef(r*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let h=p/1e3;if(I.current===null){I.current=h,g.current=requestAnimationFrame(N);return}let y=h-I.current,j=d.current+y;I.current=h,d.current=j;let x=f.current+(i===0?j:(j/i|0)*i),A=f.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{o(),d.current=0;let h=typeof p=="number"?p:r;f.current=h,m(h),e&&(g.current=requestAnimationFrame(N))},[e,r]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:h=0,newStartAt:y}=(a==null?void 0:a(M.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),h*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,i]),{elapsedTime:l,reset:u}},Rt=(e,t,r)=>{let i=e/2,a=t/2,c=i-a,l=2*c,m=r==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${i},${a} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Qt=e=>({position:"relative",width:e,height:e}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,r,i,a)=>{if(i===0)return t;let c=(a?i-e:e)/i;return t+r*c},K=e=>{var t,r;return(r=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,c,l)=>`#${a}${a}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?r:[]},Pt=(e,t)=>{var r;let{colors:i,colorsTime:a,isSmoothColorTransition:c=!0}=e;if(typeof i=="string")return i;let l=(r=a==null?void 0:a.findIndex((I,v)=>I>=t&&t>=a[v+1]))!=null?r:-1;if(!a||l===-1)return i[0];if(!c)return i[l];let m=a[l]-t,d=a[l]-a[l+1],f=K(i[l]),M=K(i[l+1]),g=!!e.isGrowing;return`rgb(${f.map((I,v)=>fe(m,I,M[v]-I,d,g)|0).join(",")})`},qt=e=>{let{duration:t,initialRemainingTime:r,updateInterval:i,size:a=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:f="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:o}=Rt(a,v,f),{elapsedTime:u}=$t({isPlaying:m,duration:t,startAt:J(t,r),updateInterval:i,onUpdate:typeof g=="function"?h=>{let y=Math.ceil(t-h);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?h=>{var y;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(y=M(h))!=null?y:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:f,size:a,stroke:Pt(e,p),strokeDashoffset:fe(u,0,o,t,d),strokeWidth:c}},he=e=>{let{children:t,strokeLinecap:r,trailColor:i,trailStrokeWidth:a}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:f,elapsedTime:M,size:g,strokeWidth:I}=qt(e);return T.createElement("div",{style:Qt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:i??"#d9d9d9",strokeWidth:a??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:r??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Ut},t({remainingTime:f,elapsedTime:M,color:m})))};he.displayName="CountdownCircleTimer";const Yt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Wt=[10,10,0],Ft=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Bt=n.E.NEUTRALS_GRAY3,Ht=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=T.useState(t>10?Vt:X),c=({remainingTime:d})=>s.jsx(Ft,{children:d}),l=T.useCallback(()=>{r==null||r(),a(Bt)},[r,a]),m=T.useCallback(d=>{d===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Yt,colorsTime:Wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:l,onUpdate:m,children:c})},Gt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Kt=()=>n.n1,Xt=n.styled_default(Kt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),es=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),ts=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ss=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ns=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:c,onTimerExpired:l})=>s.jsxs(Gt,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Jt,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:t}),s.jsx(ss,{children:"PTS"})]})]})]}),i&&s.jsx(Ht,{isPlaying:r,onTimerExpired:l,duration:c})]}),is=({openedQuestion:e,isLoading:t,vote:r,close:i})=>{var a,c;const l=e.subject,m=e.type,d=(a=e.options)==null?void 0:a.options,[f,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async j=>{if(v){const x=j.currentTarget.value;I(x),await r(v,x)}},[v,I,r]),o=T.useCallback(()=>{M(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),h=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!u,youSelected:g===j.id,isLoading:t,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:f,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,f,t,e,u,N,g]),y=d&&(d.case==="trivia"||d.case==="prediction")?d.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(It,{children:s.jsxs(yt,{children:[y&&s.jsx(ht,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:m,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(ns,{title:f?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":"To win",points:f?void 0:100,onTimerExpired:o,questionType:e.type,isTimer:!t,isPlayingTimer:!u,timerDuration:u?0:Number(((c=e==null?void 0:e.appearance)==null?void 0:c.autoHideInterval)||"30")}),f?s.jsx(ct,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:l}),s.jsx(xt,{children:h.map(j=>s.jsx(Lt,{...j},j.id))})]})]})})})},rs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),as=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),os=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ls=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),cs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ds=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:r,instantView:i})=>{const a=T.useMemo(()=>{if(e){const l=new Date(e);if(Ee(l))return{date:_e(l),time:be(l)}}return null},[e]),c=(i==null?void 0:i.image)||t;return s.jsxs(rs,{children:[a&&s.jsxs(cs,{children:[a.date," · ",a.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),c&&s.jsx(ds,{src:c}),s.jsxs(as,{children:[s.jsx(os,{children:(i==null?void 0:i.heading)||r}),s.jsx(ls,{children:i==null?void 0:i.body})]})]})},us=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ps=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ms=({instantView:e,...t})=>s.jsxs(us,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ps,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),fs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),hs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ms,{created:e.attributes.created,...e.attributes.attributes.value}):null},Is=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(is,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},ys=({gamification:e})=>{var t;const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!r)return null;const a=r.type;return s.jsxs(fs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(Is,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(hs,{openedQuestion:r})]})},gs=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),js=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Ms=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:r})=>s.jsx(js,{onClick:r,"data-selected":t,children:s.jsx(Ms,{children:e})}),vs=({activePage:e="home",toggleActivePage:t})=>s.jsx(gs,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},P(e,t)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ns(e,t){return!!(e===t||se(e)&&se(t))}function As(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Ns(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=As);var r,i=[],a,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&r===this&&t(m,i)||(a=e.apply(this,m),c=!0,r=this,i=m),a}return l}var Ss=typeof performance=="object"&&typeof performance.now=="function",ne=Ss?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ds(e,t){var r=ne();function i(){ne()-r>=t?e.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var zs=150,ks=function(t,r){return t};function Os(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,a=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){Ts(I,g);function I(N){var o;return o=g.call(this,N)||this,o._instanceProps=d(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(u,p,h,y){return o.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:h,visibleStopIndex:y})}),o._callOnScroll=void 0,o._callOnScroll=R(function(u,p,h){return o.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:h})}),o._getItemStyle=void 0,o._getItemStyle=function(u){var p=o.props,h=p.direction,y=p.itemSize,j=p.layout,x=o._getItemStyleCache(f&&y,f&&j,f&&h),A;if(x.hasOwnProperty(u))A=x[u];else{var S=r(o.props,u,o._instanceProps),D=a(o.props,u,o._instanceProps),z=h==="horizontal"||j==="horizontal",w=h==="rtl",C=z?S:0;x[u]=A={position:"absolute",left:w?void 0:C,right:w?C:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(u,p,h){return{}}),o._onScrollHorizontal=function(u){var p=u.currentTarget,h=p.clientWidth,y=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===y)return null;var A=o.props.direction,S=y;if(A==="rtl")switch(ae()){case"negative":S=-y;break;case"positive-descending":S=j-h-y;break}return S=Math.max(0,Math.min(S,j-h)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(u){var p=u.currentTarget,h=p.clientHeight,y=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,y-h));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(u){var p=o.props.outerRef;o._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ds(o._resetIsScrolling,zs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}I.getDerivedStateFromProps=function(o,u){return ws(o,u),M(o),null};var v=I.prototype;return v.scrollTo=function(o){o=Math.max(0,o),this.setState(function(u){return u.scrollOffset===o?null:{scrollDirection:u.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(o,u){u===void 0&&(u="auto");var p=this.props,h=p.itemCount,y=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,h-1));var x=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,o,u,j,this._instanceProps,x))},v.componentDidMount=function(){var o=this.props,u=o.direction,p=o.initialScrollOffset,h=o.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||h==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var o=this.props,u=o.direction,p=o.layout,h=this.state,y=h.scrollOffset,j=h.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var o=this.props,u=o.children,p=o.className,h=o.direction,y=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?ks:z,C=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,Me=o.width,q=this.state.isScrolling,L=h==="horizontal"||C==="horizontal",ve=L?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=i(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:ve,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:L?"100%":F,pointerEvents:q?"none":void 0,width:L?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var u=this._getRangeToRender(),p=u[0],h=u[1],y=u[2],j=u[3];this._callOnItemsRendered(p,h,y,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var o=this.props,u=o.itemCount,p=o.overscanCount,h=this.state,y=h.isScrolling,j=h.scrollDirection,x=h.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!y||j==="backward"?Math.max(1,p):1,z=!y||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ws=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Cs=Os({getItemOffset:function(t,r){var i=t.itemSize;return r*i},getItemSize:function(t,r){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var r=t.itemCount,i=t.itemSize;return i*r},getOffsetForIndexAndAlignment:function(t,r,i,a,c,l){var m=t.direction,d=t.height,f=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,o=Math.max(0,f*M-N),u=Math.min(o,r*M),p=Math.max(0,r*M-N+M+l);switch(i==="smart"&&(a>=p-N&&a<=u+N?i="auto":i="center"),i){case"start":return u;case"end":return p;case"center":{var h=Math.round(p+(u-p)/2);return h<Math.ceil(N/2)?0:h>o+Math.floor(N/2)?o:h}case"auto":default:return a>=p&&a<=u?a:a<p?p:u}},getStartIndexForOffset:function(t,r){var i=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(t,r,i){var a=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,f=t.width,M=a==="horizontal"||d==="horizontal",g=r*m,I=M?f:c,v=Math.ceil((I+i-g)/m);return Math.max(0,Math.min(l-1,r+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function _s(e){var t=e.lastRenderedStartIndex,r=e.lastRenderedStopIndex,i=e.startIndex,a=e.stopIndex;return!(i>r||a<t)}function bs(e){for(var t=e.isItemLoaded,r=e.itemCount,i=e.minimumBatchSize,a=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,f=a;f<=c;f++){var M=t(f);M?d!==null&&(l.push(m,d),m=d=null):(d=f,m===null&&(m=f))}if(d!==null){for(var g=Math.min(Math.max(d,m+i-1),r-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<i&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ls=function(){function e(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),$s=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Rs=function(e){$s(t,e);function t(){var r,i,a,c;Es(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(i=(a=oe(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(f){var M=f.visibleStartIndex,g=f.visibleStopIndex;a._lastRenderedStartIndex=M,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(M,g)},a._setRef=function(f){a._listRef=f},i),oe(a,c)}return Ls(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,a){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,f=d===void 0?10:d,M=c.threshold,g=M===void 0?15:M,I=bs({isItemLoaded:l,itemCount:m,minimumBatchSize:f,startIndex:Math.max(0,i-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(i){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(f){var M=i[f],g=i[f+1],I=c(M,g);I!=null&&I.then(function(){if(_s({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(M,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)l(m)}}]),t}(T.PureComponent);const Qs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Us=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ps=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ys=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ws=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Fs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>n.n1,Bs=n.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Hs=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:c,style:l})=>s.jsxs(Qs,{onClick:c,style:l,children:[s.jsx(Us,{children:e||0}),s.jsxs(Ys,{children:[t?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:de(r||"")}),s.jsxs(Ws,{children:[s.jsx(Fs,{children:r||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Gs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:c})=>s.jsx(Rs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:l,ref:m})=>s.jsx(Gs,{children:s.jsx(Cs,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:a,height:c,children:({index:d,style:f})=>s.jsx(Hs,{style:{...f,maxHeight:48},...e[d],openItemDetail:()=>r(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Js=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Ks=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Js,{deepLink:e.deepLink})},Xs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),en=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),nn=()=>n.n1,b=n.styled_default(nn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),rn=()=>n.n1,an=n.styled_default(rn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),on=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),cn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),dn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},un=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:c,status:l})=>{const m=n.o[t],d=dn[l];return m?s.jsxs(Xs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(ln,{children:[s.jsxs(en,{children:[s.jsx(an,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(on,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(tn,{children:i||""})]}),s.jsx(sn,{children:a?s.jsx(cn,{children:"Play"}):d})]}):null},pn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),mn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),fn=({openInsight:e,questionId:t,...r})=>s.jsxs(pn,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(mn,{onClick:()=>e(t),children:"View Insight"})]}),hn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),In=({questions:e,openQuestion:t})=>s.jsx(hn,{children:e==null?void 0:e.map(r=>{var i,a;if(r.type==="question"&&((i=r.attributes)==null?void 0:i.attributes.case)==="question"){const c=r.attributes.attributes.value;return s.jsx(un,{openQuestion:t,...c},c.questionId)}if(r.type==="insight"&&((a=r.attributes)==null?void 0:a.attributes.case)==="insight"){const c=r.attributes.attributes.value;return s.jsx(fn,{openInsight:t,...c},c.questionId)}return null})}),yn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(In,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},gn=({userSummary:e})=>{var t,r;const i=n.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(r=i.data.percentage)==null?void 0:r.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,r]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(vs,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(gn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(yn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Ks,{gamification:e})})]})},jn=()=>n.d$1,le=n.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),Mn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),vn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Tn=({gamification:e,className:t})=>{const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[r&&s.jsx(le,{className:t,children:s.jsx(ys,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(Mn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:vn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=Tn;