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