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