@streamlayer/react 0.34.0 → 0.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var Me=Object.defineProperty;var ge=(e,s,i)=>s in e?Me(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i;var U=(e,s,i)=>(ge(e,typeof s!="symbol"?s+"":s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ve=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ne=()=>n.r1,Ae=n.styled_default(Ne())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Se=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.r1,Le=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:s,label:i})=>{const o=e?n.o[e]:{label:i,iconName:void 0};return t.jsxs(Te,{children:[t.jsxs(ve,{children:[(o==null?void 0:o.iconName)&&t.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&t.jsx(De,{children:o.label})]}),t.jsx(Se,{onClick:s,children:t.jsx(Le,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(s=>s[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Ee=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:s})=>t.jsxs(Ee,{children:[t.jsx(we,{children:s}),t.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ze=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Oe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:s})=>t.jsxs(be,{children:[t.jsx(ze,{children:e}),t.jsx(Oe,{children:s})]}),Qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Pe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ue=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Je=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ke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VMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ae=({avatar:e,name:s,points:i,friendsRank:o,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:m})=>t.jsxs(Qe,{children:[t.jsx($e,{children:t.jsxs(Re,{children:[t.jsxs(Ke,{children:[e&&t.jsx(Pe,{alt:"avatar",src:e}),!e&&t.jsx(Je,{children:oe(s||"")})]}),t.jsxs(Ue,{children:[t.jsx(qe,{children:s}),t.jsxs(Ye,{children:[t.jsxs(We,{children:[t.jsx(Ve,{alt:"rank-icon",src:Xe}),t.jsxs(Fe,{children:[re(i),t.jsx(Be,{children:"PTS"})]})]}),t.jsx(He,{}),t.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),t.jsxs(_e,{children:[t.jsxs(Ge,{children:[t.jsx(G,{indicator:o||0,title:"Friends rank"}),t.jsx(G,{indicator:r||0,title:"Global rank"})]}),t.jsxs(Ze,{children:[t.jsx($,{indicator:l||0,title:"Win streak"}),t.jsx($,{indicator:a||0,title:"Correct"}),t.jsx($,{indicator:d||0,title:"Incorrect"}),t.jsx($,{indicator:`${m||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.r1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>t.jsx(es,{children:t.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:s})=>t.jsxs(is,{children:[t.jsx(n.r1,{name:"icon-check-circle"}),t.jsx(os,{children:e}),t.jsx(rs,{children:s})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.r1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),O=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),b=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:s,questionVoted:i,questionType:o,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:m,enteredAnActiveQuestion:h,marketClosed:p})=>{const I=i&&(o===n.QuestionType.TRIVIA||o===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,f=o===n.QuestionType.PREDICTION&&!r,N=p&&o===n.QuestionType.PREDICTION&&!i&&!h||o===n.QuestionType.PREDICTION&&m&&c&&h,x=I&&f,M=I&&r,y=o===n.QuestionType.PREDICTION&&i&&c&&r,T=i&&o===n.QuestionType.POLL&&c;if(!a&&!d&&!x&&!M&&!N&&!T&&!y)return null;const g=s?"correct":"incorrect",v=s?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return t.jsxs(ls,{"data-isPrediction":f,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(O,{children:t.jsx(n.r1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Expired"})}),t.jsx(q,{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(O,{children:t.jsx(n.r1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),N&&t.jsxs(t.Fragment,{children:[t.jsx(O,{children:t.jsx(n.r1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),x&&t.jsxs(t.Fragment,{children:[t.jsx(cs,{name:"icon-prediction"}),t.jsx(b,{children:"Stay tuned to see if your prediction was correct."})]}),T&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":"correct",children:t.jsx(n.r1,{name:"correct"})}),t.jsx(b,{children:"That's for answering. Please stay tuned for the next question."})]}),(M||y)&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":g,children:t.jsx(n.r1,{name:g})}),t.jsx("div",{children:t.jsxs(_,{children:[t.jsx(us,{"data-feedbackType":g,children:v==null?void 0:v.title}),t.jsx(b,{children:v==null?void 0:v.description})]})})]})]})},ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),hs=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Is=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),fs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ys=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),xs=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),js=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ms=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),gs=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Ts=()=>le,vs=n.styled_default(Ts())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ns=()=>le,As=n.styled_default(Ns())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ds=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ss=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ks=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),Ls=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Es=()=>n.r1,ws=n.styled_default(Es())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),Z={[n.QuestionImages.CENTERED]:e=>t.jsx(vs,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>t.jsx(Ms,{children:t.jsx(gs,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>t.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:s,correct:i,youVoted:o,questionVoted:r})=>{if(e===n.QuestionType.POLL&&o)return"correct";if(e===n.QuestionType.PREDICTION){if(s&&r)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return e===n.QuestionType.TRIVIA&&r&&o?i?"correct":"incorrect":"unset"},bs=({questionType:e,questionVoted:s,correct:i,hasCorrectAnswer:o,questionStatus:r})=>e===n.QuestionType.TRIVIA?s&&i:e===n.QuestionType.PREDICTION?s&&i&&o||r===n.QuestionStatus.RESOLVED&&i:!1,zs=e=>{var s;const{id:i,icon:o,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:m,questionVoted:h,imageMode:p,answerTimeExpired:I,questionStatus:f,isLoading:N,questionType:x,correct:M,hasCorrectAnswer:y,votedAfterQuestionClosed:T,enteredAnActiveQuestion:g,marketClosed:v}=e,k=Cs(e),w=bs({questionType:x,questionVoted:h,correct:M,hasCorrectAnswer:y,questionStatus:f}),E=v&&x===n.QuestionType.PREDICTION,Q=h||E,j=x===n.QuestionType.PREDICTION&&!h&&f!==n.QuestionStatus.RESOLVED;return t.jsxs(ys,{value:i,"data-selected":m,"data-answer-state":k,disabled:h||N||I||E&&!g||E&&g&&T,"data-is-not-checked":h&&!m&&k!=="incorrect",onClick:D=>{c(x===n.QuestionType.PREDICTION?v:f===n.QuestionStatus.RESOLVED),d(D)},children:[t.jsx(xs,{"data-answer-state":k,style:{width:`${Q?l:0}%`}}),t.jsxs(js,{children:[o&&p&&((s=Z[p])==null?void 0:s.call(Z,o)),t.jsx(Ds,{children:r}),j&&t.jsxs("div",{children:[t.jsx(n.d,{value:a}),t.jsx(ks,{children:"pts"})]}),Q&&t.jsxs(Ss,{children:[w&&t.jsx(ws,{name:"selected"}),t.jsx(Ls,{children:t.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Os=({isPlaying:e,duration:s,startAt:i=0,updateInterval:o=0,onComplete:r,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),m=u.useRef(i),h=u.useRef(i*-1e3),p=u.useRef(null),I=u.useRef(null),f=u.useRef(null),N=y=>{let T=y/1e3;if(I.current===null){I.current=T,p.current=requestAnimationFrame(N);return}let g=T-I.current,v=c.current+g;I.current=T,c.current=v;let k=m.current+(o===0?v:(v/o|0)*o),w=m.current+v,E=typeof s=="number"&&w>=s;d(E?s:k),E||(p.current=requestAnimationFrame(N))},x=()=>{p.current&&cancelAnimationFrame(p.current),f.current&&clearTimeout(f.current),I.current=null},M=u.useCallback(y=>{x(),c.current=0;let T=typeof y=="number"?y:i;m.current=T,d(T),e&&(p.current=requestAnimationFrame(N))},[e,i]);return J(()=>{if(l==null||l(a),s&&a>=s){h.current+=s*1e3;let{shouldRepeat:y=!1,delay:T=0,newStartAt:g}=(r==null?void 0:r(h.current/1e3))||{};y&&(f.current=setTimeout(()=>M(g),T*1e3))}},[a,s]),J(()=>(e&&(p.current=requestAnimationFrame(N)),x),[e,s,o]),{elapsedTime:a,reset:M}},Qs=(e,s,i)=>{let o=e/2,r=s/2,l=o-r,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${o},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},K=(e,s)=>e===0||e===s?0:typeof s=="number"?e-s:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,s,i,o,r)=>{if(o===0)return s;let l=(r?o-e:e)/o;return s+i*l},X=e=>{var s,i;return(i=(s=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(o,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:s.map(o=>parseInt(o,16)))!=null?i:[]},Rs=(e,s)=>{var i;let{colors:o,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof o=="string")return o;let a=(i=r==null?void 0:r.findIndex((I,f)=>I>=s&&s>=r[f+1]))!=null?i:-1;if(!r||a===-1)return o[0];if(!l)return o[a];let d=r[a]-s,c=r[a]-r[a+1],m=X(o[a]),h=X(o[a+1]),p=!!e.isGrowing;return`rgb(${m.map((I,f)=>de(d,I,h[f]-I,c,p)|0).join(",")})`},Ps=e=>{let{duration:s,initialRemainingTime:i,updateInterval:o,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:m="clockwise",onComplete:h,onUpdate:p}=e,I=u.useRef(),f=Math.max(l,a??0),{path:N,pathLength:x}=Qs(r,f,m),{elapsedTime:M}=Os({isPlaying:d,duration:s,startAt:K(s,i),updateInterval:o,onUpdate:typeof p=="function"?T=>{let g=Math.ceil(s-T);g!==I.current&&(I.current=g,p(g))}:void 0,onComplete:typeof h=="function"?T=>{var g;let{shouldRepeat:v,delay:k,newInitialRemainingTime:w}=(g=h(T))!=null?g:{};if(v)return{shouldRepeat:v,delay:k,newStartAt:K(s,w)}}:void 0}),y=s-M;return{elapsedTime:M,path:N,pathLength:x,remainingTime:Math.ceil(y),rotation:m,size:r,stroke:Rs(e,y),strokeDashoffset:de(M,0,x,s,c),strokeWidth:l}},ce=e=>{let{children:s,strokeLinecap:i,trailColor:o,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:m,elapsedTime:h,size:p,strokeWidth:I}=Ps(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:o??"#d9d9d9",strokeWidth:r??I}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:a,strokeDashoffset:c})),typeof s=="function"&&u.createElement("div",{style:_s},s({remainingTime:m,elapsedTime:h,color:d})))};ce.displayName="CountdownCircleTimer";const Us=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],qs=[10,10,1,0],Ys=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:s=30,onTimerExpired:i})=>{const[o,r]=u.useState(s>10?Vs:ee),l=({remainingTime:c})=>t.jsx(Ys,{children:c}),a=u.useCallback(()=>{i==null||i(),r(Ws)},[i,r]),d=u.useCallback(c=>{c===10&&r(ee)},[r]);return t.jsx(ce,{isPlaying:e,duration:s,colors:Us,colorsTime:qs,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Zs=()=>n.r1,Js=n.styled_default(Zs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Ks=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Xs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:s,isPlayingTimer:i,isTimer:o,questionType:r,timerDuration:l,onTimerExpired:a})=>t.jsxs(Bs,{style:{justifyContent:r===n.QuestionType.PREDICTION?"center":"space-between"},children:[t.jsxs(Hs,{children:[e&&t.jsx(Gs,{children:e}),s!==void 0&&r!==n.QuestionType.POLL&&t.jsxs(t.Fragment,{children:[t.jsx(Js,{name:"icon-trophy"}),t.jsxs(Ks,{children:[t.jsx(Xs,{children:t.jsx(n.d,{value:s})}),t.jsx(et,{children:"PTS"})]})]})]}),o&&r!==n.QuestionType.PREDICTION&&t.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:s,vote:i,close:o})=>{var r,l;const a=e.subject,d=e.type,c=e.status,m=(r=e.options)==null?void 0:r.options,h=e.marketClosed,[p,I]=u.useState(!1),[f,N]=u.useState(!1),[x,M]=u.useState(!0),[y,T]=u.useState(!1),[g,v]=u.useState(""),k=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?h&&M(!1):c===n.QuestionStatus.RESOLVED&&M(!1)},[]);const w=u.useCallback(A=>{N(A),I(!0)},[]),E=u.useCallback(async A=>{if(k){const z=A.currentTarget.value;v(z),await i(k,z)}},[k,v,i]),Q=u.useCallback(()=>{T(!0),setTimeout(o,3e3)},[o]),j=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),D=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),L=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),Ie=u.useMemo(()=>e?e.answers.map(A=>{var z;return{...A,questionVoted:!!j,youSelected:g===A.id,isLoading:s,hasCorrectAnswer:D,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(z=e.appearance)==null?void 0:z.images,onVote:E}}):[],[D,y,s,e,j,c,E,g]),fe=m&&(m.case==="trivia"||m.case==="prediction")?m.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!j&&!x,B=d===n.QuestionType.TRIVIA&&f&&p&&x,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(j&&!D||j&&D&&L!=null&&L.youVoted):!0,[d,j,D,L]),ye=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&j&&(!D||D&&L!=null&&L.youVoted))return j.points;if(!(C||y))return c===n.QuestionStatus.RESOLVED?0:j?j.correct?j.points:0:L==null?void 0:L.points},[y,j,L,c,C,d,D]),xe=u.useMemo(()=>d===n.QuestionType.PREDICTION&&j?D?D&&L!=null&&L.youVoted?"You won":"":"To win":C||y?"Time expired":d===n.QuestionType.POLL?"Time remaining":j?"You won":"To win",[y,d,j,C,D,L]),je=j||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&x;return t.jsx(n.r,{"data-question-header":"true",children:t.jsx(ms,{children:t.jsxs(hs,{children:[t.jsx(ps,{feedbackMessages:fe,questionVoted:!!j,questionVotedCorrectly:j==null?void 0:j.correct,questionType:d,hasCorrectAnswer:D,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h}),H&&t.jsx(st,{title:xe,points:ye,onTimerExpired:Q,questionType:e.type,isTimer:!s,isPlayingTimer:!j,timerDuration:je?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?t.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):t.jsxs(t.Fragment,{children:[t.jsx(Is,{style:H?{}:{marginTop:0},children:a}),t.jsx(fs,{children:Ie.map(A=>t.jsx(zs,{...A,markThatVoted:w,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:s,title:i,isPickHistory:o,instantView:r,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(r==null?void 0:r.image)||s;return t.jsxs(nt,{children:[a&&t.jsxs(at,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&t.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),d&&!(r!=null&&r.video)&&t.jsx(lt,{src:d}),t.jsxs(it,{children:[t.jsx(ot,{children:o?i:r==null?void 0:r.heading}),t.jsx(rt,{children:o?l==null?void 0:l.body:r==null?void 0:r.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...s})=>t.jsxs(dt,{children:[t.jsx(ue,{instantView:e,...s}),(e==null?void 0:e.webLink)&&t.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,t.jsx(n.r1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),ht=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),It=({created:e,...s})=>{const i=u.useMemo(()=>{if(e){const o=new Date(e);if(F(o))return{date:V(o),time:W(o)}}return null},[e]);return t.jsxs(pt,{children:[i&&t.jsxs(mt,{children:[i.date," · ",i.time]}),s.title&&t.jsx(ht,{children:s.title}),t.jsx(n.u,{...s})]})},ft=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),yt=({openedQuestion:e})=>{var s,i;return((s=e==null?void 0:e.attributes)==null?void 0:s.attributes.case)==="insight"?t.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?t.jsx(It,{created:e.attributes.created,...e.attributes.attributes.value}):null},xt=({extendedQuestion:e,vote:s,close:i})=>{const{loading:o,data:r}=e;return r?t.jsx(tt,{vote:s,close:i,openedQuestion:r,isLoading:!!o}):null},jt=({gamification:e})=>{var s;const i=n.useStore(e.openedQuestion.$store),o=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const r=i.type;return t.jsxs(ft,{children:[t.jsx(ie,{close:e.closeQuestion,type:((s=i.attributes)==null?void 0:s.type)||n.QuestionType.UNSET}),r==="question"&&t.jsx(xt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:o}),r!=="question"&&t.jsx(yt,{openedQuestion:i}),t.jsx(ns,{sponsorLogo:""})]})},Mt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),gt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Tt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),vt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var P=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(P||{});const se=({title:e,active:s,onClick:i})=>t.jsx(Tt,{onClick:i,"data-selected":s,children:t.jsx(vt,{children:e})}),Nt=({activePage:e="home",toggleActivePage:s})=>t.jsx(Mt,{children:t.jsxs(gt,{"data-position":e==="home"?"left":"right",children:[t.jsx(se,{title:"Home",active:e==="home",onClick:()=>s("home")}),t.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>s("leaderboard")})]})});function At(e){var s=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,o=e.startIndex,r=e.stopIndex;return!(o>i||r<s)}function Dt(e){for(var s=e.isItemLoaded,i=e.itemCount,o=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,m=r;m<=l;m++){var h=s(m);h?c!==null&&(a.push(d,c),d=c=null):(c=m,d===null&&(d=m))}if(c!==null){for(var p=Math.min(Math.max(c,d+o-1),i-1),I=c+1;I<=p&&!s(I);I++)c=I;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<o&&a[0]>0;){var f=a[0]-1;if(!s(f))a[0]=f;else break}return a}var St=function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")},kt=function(){function e(s,i){for(var o=0;o<i.length;o++){var r=i[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}return function(s,i,o){return i&&e(s.prototype,i),o&&e(s,o),s}}(),Lt=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)},te=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};(function(e){Lt(s,e);function s(){var i,o,r,l;St(this,s);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(o=(r=te(this,(i=s.__proto__||Object.getPrototypeOf(s)).call.apply(i,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(m){var h=m.visibleStartIndex,p=m.visibleStopIndex;r._lastRenderedStartIndex=h,r._lastRenderedStopIndex=p,r._ensureRowsLoaded(h,p)},r._setRef=function(m){r._listRef=m},o),te(r,l)}return kt(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 l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,m=c===void 0?10:c,h=l.threshold,p=h===void 0?15:h,I=Dt({isItemLoaded:a,itemCount:d,minimumBatchSize:m,startIndex:Math.max(0,o-p),stopIndex:Math.min(d-1,r+p)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(f,N){return I[N]!==f}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(o){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(m){var h=o[m],p=o[m+1],I=l(h,p);I!=null&&I.then(function(){if(At({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:h,stopIndex:p})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(h,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<o.length;d+=2)a(d)}}]),s})(u.PureComponent);const Et=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),wt=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ct=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),bt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),zt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ot=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),$t=()=>n.r1,_t=n.styled_default($t())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Rt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pt=Rt,Ut=Pt;function me(){}function he(){}he.resetWarningCache=me;var qt=function(){function e(o,r,l,a,d,c){if(c!==Ut){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function s(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:he,resetWarningCache:me};return i.PropTypes=i,i};pe.exports=qt();var Yt=pe.exports;const S=n.getDefaultExportFromCjs(Yt);class Y extends u.Component{constructor(s){super(s),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let s=!1;const i={get passive(){s=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return s}eventListenerOptions(){let s=this.props.useCapture;return this.isPassiveSupported()?s={useCapture:this.props.useCapture,passive:!0}:s={passive:!1},s}setDefaultLoader(s){this.defaultLoader=s}detachMousewheelListener(){let s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(s){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(s&&s.parentNode)}filterProps(s){return s}attachScrollListener(){const s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;let i=window;this.props.useWindow===!1&&(i=s),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}scrollListener(){const s=this.scrollComponent,i=window,o=this.getParentElement(s);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(s,a)}else this.props.isReverse?r=o.scrollTop:r=s.scrollHeight-o.scrollTop-o.clientHeight;r<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(s,i){return s?this.calculateTopPosition(s)+(s.offsetHeight-i-window.innerHeight):0}calculateTopPosition(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}render(){const s=this.filterProps(this.props),{children:i,element:o,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:m,ref:h,threshold:p,useCapture:I,useWindow:f,getScrollParent:N,...x}=s;x.ref=y=>{this.scrollComponent=y,h&&h(y)};const M=[i];return r&&(d?a?M.unshift(d):M.push(d):this.defaultLoader&&(a?M.unshift(this.defaultLoader):M.push(this.defaultLoader))),u.createElement(o,x,M)}}U(Y,"propTypes",{children:S.node.isRequired,element:S.node,hasMore:S.bool,initialLoad:S.bool,isReverse:S.bool,loader:S.node,loadMore:S.func.isRequired,pageStart:S.number,ref:S.func,getScrollParent:S.func,threshold:S.number,useCapture:S.bool,useWindow:S.bool}),U(Y,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Vt=({rank:e,avatar:s,name:i,points:o,isCurrentUser:r,openItemDetail:l,style:a})=>t.jsxs(Et,{onClick:l,style:a,children:[t.jsx(wt,{children:e||0}),t.jsxs(zt,{children:[s?t.jsx(Ct,{alt:"leaderboard-item-avatar",src:s}):t.jsx(bt,{children:oe(i||"")}),t.jsxs(Ot,{children:[t.jsx(Qt,{children:i||""}),r&&t.jsx(_t,{name:"icon-star"})]})]}),t.jsx("div",{children:re(o)})]}),Wt=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Ft=({items:e,currentUserId:s,openItemDetail:i,fetchMore:o,scrollNode:r,hasMore:l})=>t.jsx(Y,{loadMore:o,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:t.jsx(Wt,{children:e.map(a=>t.jsx(Vt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!s&&s===a.userId},a.userId))})}),Bt=({deepLink:e})=>{const{data:s}=n.useStore(e.$store),i=s==null?void 0:s.url,o=e.desktopLink;return t.jsx(n.O,{inviteLink:i||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."})},Ht=({gamification:e,scrollNode:s,scrollStore:i})=>{const{data:o,hasMore:r}=n.useStore(e.leaderboardList.$store);return o!=null&&o.length?t.jsx(Ft,{items:o,scrollNode:s,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:r,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):t.jsx(Bt,{deepLink:e.deepLink})},Gt=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Kt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Xt=()=>n.r1,R=n.styled_default(Xt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),en=()=>n.r1,sn=n.styled_default(en())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),nn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),on=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),rn={[n.PickHistoryStatus.LOST]:t.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:t.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:t.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:t.jsx(R,{name:"icon-arrow"})},an=({questionId:e,questionType:s,questionStatus:i,subject:o,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[s],c=rn[a];return d?t.jsxs(Gt,{onClick:()=>l==null?void 0:l(e),children:[t.jsxs(nn,{children:[t.jsxs(Zt,{children:[t.jsx(sn,{"data-type-trivia":s===n.QuestionType.TRIVIA,"data-type-poll":s===n.QuestionType.POLL,name:d.iconName}),t.jsxs(tn,{children:[d.label,s===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),t.jsx(Jt,{children:o||""})]}),t.jsx(Kt,{children:r?t.jsx(on,{children:"Play"}):c})]}):null},ln=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),dn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:s,...i})=>t.jsxs(ln,{children:[t.jsx(ue,{questionId:s,...i,isPickHistory:!0}),e&&t.jsx(dn,{onClick:()=>e(s),children:"View Insight"})]}),un=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),pn=()=>n.c,mn=n.styled_default(pn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),hn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),In=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),fn=({openTweet:e,created:s,...i})=>{const o=u.useMemo(()=>{if(s){const r=new Date(s);if(F(r))return{date:V(r),time:W(r)}}return null},[s]);return t.jsxs(un,{children:[o&&t.jsxs(hn,{children:[o.date," · ",o.time]}),i.title&&t.jsx(In,{children:i.title}),t.jsx(n.u,{...i}),e&&t.jsx(mn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},yn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),xn=({questions:e,openQuestion:s})=>t.jsx(yn,{children:e==null?void 0:e.map(i=>{var o,r,l;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const a=i.attributes.attributes.value;return t.jsx(an,{openQuestion:s,...a},a.questionId)}if(i.type==="insight"&&((r=i.attributes)==null?void 0:r.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return t.jsx(cn,{openInsight:s,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return t.jsx(fn,{openTweet:s,...a,tweetId:d,created:c},d)}return null})}),jn=({store:e,openQuestion:s})=>{const i=n.useStore(e);return i!=null&&i.data?t.jsx(xn,{openQuestion:s,questions:i.data}):t.jsx("div",{children:"wait questions..."})},Mn=({userSummary:e})=>{var s;const[i,o]=u.useState(void 0);return u.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&o(l.data)});return()=>{r()}},[e]),i!=null&&i.summary?t.jsx(ae,{...i.summary,successRate:(s=i.percentage)==null?void 0:s.correct}):t.jsx("div",{children:"wait user..."})},gn=({gamification:e,className:s,scrollStore:i,scrollNode:o})=>{const[r,l]=u.useState(!1),[a,d]=u.useState(P.HOME),[,c]=u.useTransition(),m=p=>{c(()=>d(p))},h=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){h(!1),i.setKey("tabsShown",!1);return}h(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),t.jsxs("div",{className:s,children:[t.jsx(n.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:r?"-60px":"0px"},children:t.jsx(Nt,{activePage:a,toggleActivePage:m})}),a===P.HOME&&t.jsxs(t.Fragment,{children:[t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Mn,{userSummary:e.userSummary})}),t.jsx(n.n,{children:t.jsx(jn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===P.LEADERBOARD&&t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Ht,{scrollStore:i,scrollNode:o,gamification:e})})]})},Tn=()=>n.x,ne=n.styled_default(Tn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),vn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Nn=({correct:e,incorrect:s})=>{const i=e+s;return i===0?0:Math.round(e/i*100)},An=({gamification:e,scrollStore:s,className:i,appNode:o,scrollNode:r})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return t.jsxs(t.Fragment,{children:[l&&o.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsx(jt,{gamification:e})}),o.current),a&&o.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsxs(vn,{children:[t.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),t.jsx(n.a,{children:t.jsx(ae,{...a,successRate:Nn(a)})})]})}),o.current),t.jsx(gn,{scrollStore:s,scrollNode:r,className:i,gamification:e})]})};exports.default=An;
1
+ "use strict";var Me=Object.defineProperty;var ge=(e,s,i)=>s in e?Me(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i;var U=(e,s,i)=>(ge(e,typeof s!="symbol"?s+"":s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ve=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ne=()=>n.c1,Ae=n.styled_default(Ne())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Se=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.c1,Le=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:s,label:i})=>{const o=e?n.o[e]:{label:i,iconName:void 0};return t.jsxs(Te,{children:[t.jsxs(ve,{children:[(o==null?void 0:o.iconName)&&t.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&t.jsx(De,{children:o.label})]}),t.jsx(Se,{onClick:s,children:t.jsx(Le,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(s=>s[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Ee=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:s})=>t.jsxs(Ee,{children:[t.jsx(we,{children:s}),t.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ze=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Oe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:s})=>t.jsxs(be,{children:[t.jsx(ze,{children:e}),t.jsx(Oe,{children:s})]}),Qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Pe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ue=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Je=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ke=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Xe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMj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NC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ae=({avatar:e,name:s,points:i,friendsRank:o,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:m})=>t.jsxs(Qe,{children:[t.jsx($e,{children:t.jsxs(Re,{children:[t.jsxs(Ke,{children:[e&&t.jsx(Pe,{alt:"avatar",src:e}),!e&&t.jsx(Je,{children:oe(s||"")})]}),t.jsxs(Ue,{children:[t.jsx(qe,{children:s}),t.jsxs(Ye,{children:[t.jsxs(We,{children:[t.jsx(Ve,{alt:"rank-icon",src:Xe}),t.jsxs(Fe,{children:[re(i),t.jsx(Be,{children:"PTS"})]})]}),t.jsx(He,{}),t.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),t.jsxs(_e,{children:[t.jsxs(Ge,{children:[t.jsx(G,{indicator:o||0,title:"Friends rank"}),t.jsx(G,{indicator:r||0,title:"Global rank"})]}),t.jsxs(Ze,{children:[t.jsx($,{indicator:l||0,title:"Win streak"}),t.jsx($,{indicator:a||0,title:"Correct"}),t.jsx($,{indicator:d||0,title:"Incorrect"}),t.jsx($,{indicator:`${m||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.c1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>t.jsx(es,{children:t.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:s})=>t.jsxs(is,{children:[t.jsx(n.c1,{name:"icon-check-circle"}),t.jsx(os,{children:e}),t.jsx(rs,{children:s})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.c1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),O=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),b=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:s,questionVoted:i,questionType:o,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:m,enteredAnActiveQuestion:h,marketClosed:p})=>{const I=i&&(o===n.QuestionType.TRIVIA||o===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,f=o===n.QuestionType.PREDICTION&&!r,N=p&&o===n.QuestionType.PREDICTION&&!i&&!h||o===n.QuestionType.PREDICTION&&m&&c&&h,x=I&&f,M=I&&r,y=o===n.QuestionType.PREDICTION&&i&&c&&r,T=i&&o===n.QuestionType.POLL&&c;if(!a&&!d&&!x&&!M&&!N&&!T&&!y)return null;const g=s?"correct":"incorrect",v=s?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return t.jsxs(ls,{"data-isPrediction":f,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Expired"})}),t.jsx(q,{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(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),N&&t.jsxs(t.Fragment,{children:[t.jsx(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),x&&t.jsxs(t.Fragment,{children:[t.jsx(cs,{name:"icon-prediction"}),t.jsx(b,{children:"Stay tuned to see if your prediction was correct."})]}),T&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":"correct",children:t.jsx(n.c1,{name:"correct"})}),t.jsx(b,{children:"That's for answering. Please stay tuned for the next question."})]}),(M||y)&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":g,children:t.jsx(n.c1,{name:g})}),t.jsx("div",{children:t.jsxs(_,{children:[t.jsx(us,{"data-feedbackType":g,children:v==null?void 0:v.title}),t.jsx(b,{children:v==null?void 0:v.description})]})})]})]})},ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),hs=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Is=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),fs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ys=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),xs=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),js=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ms=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),gs=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Ts=()=>le,vs=n.styled_default(Ts())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ns=()=>le,As=n.styled_default(Ns())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ds=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ss=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ks=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),Ls=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Es=()=>n.c1,ws=n.styled_default(Es())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),Z={[n.QuestionImages.CENTERED]:e=>t.jsx(vs,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>t.jsx(Ms,{children:t.jsx(gs,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>t.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:s,correct:i,youVoted:o,questionVoted:r})=>{if(e===n.QuestionType.POLL&&o)return"correct";if(e===n.QuestionType.PREDICTION){if(s&&r)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return e===n.QuestionType.TRIVIA&&r&&o?i?"correct":"incorrect":"unset"},bs=({questionType:e,questionVoted:s,correct:i,hasCorrectAnswer:o,questionStatus:r})=>e===n.QuestionType.TRIVIA?s&&i:e===n.QuestionType.PREDICTION?s&&i&&o||r===n.QuestionStatus.RESOLVED&&i:!1,zs=e=>{var s;const{id:i,icon:o,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:m,questionVoted:h,imageMode:p,answerTimeExpired:I,questionStatus:f,isLoading:N,questionType:x,correct:M,hasCorrectAnswer:y,votedAfterQuestionClosed:T,enteredAnActiveQuestion:g,marketClosed:v}=e,k=Cs(e),w=bs({questionType:x,questionVoted:h,correct:M,hasCorrectAnswer:y,questionStatus:f}),E=v&&x===n.QuestionType.PREDICTION,Q=h||E,j=x===n.QuestionType.PREDICTION&&!h&&f!==n.QuestionStatus.RESOLVED;return t.jsxs(ys,{value:i,"data-selected":m,"data-answer-state":k,disabled:h||N||I||E&&!g||E&&g&&T,"data-is-not-checked":h&&!m&&k!=="incorrect",onClick:D=>{c(x===n.QuestionType.PREDICTION?v:f===n.QuestionStatus.RESOLVED),d(D)},children:[t.jsx(xs,{"data-answer-state":k,style:{width:`${Q?l:0}%`}}),t.jsxs(js,{children:[o&&p&&((s=Z[p])==null?void 0:s.call(Z,o)),t.jsx(Ds,{children:r}),j&&t.jsxs("div",{children:[t.jsx(n.d,{value:a}),t.jsx(ks,{children:"pts"})]}),Q&&t.jsxs(Ss,{children:[w&&t.jsx(ws,{name:"selected"}),t.jsx(Ls,{children:t.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Os=({isPlaying:e,duration:s,startAt:i=0,updateInterval:o=0,onComplete:r,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),m=u.useRef(i),h=u.useRef(i*-1e3),p=u.useRef(null),I=u.useRef(null),f=u.useRef(null),N=y=>{let T=y/1e3;if(I.current===null){I.current=T,p.current=requestAnimationFrame(N);return}let g=T-I.current,v=c.current+g;I.current=T,c.current=v;let k=m.current+(o===0?v:(v/o|0)*o),w=m.current+v,E=typeof s=="number"&&w>=s;d(E?s:k),E||(p.current=requestAnimationFrame(N))},x=()=>{p.current&&cancelAnimationFrame(p.current),f.current&&clearTimeout(f.current),I.current=null},M=u.useCallback(y=>{x(),c.current=0;let T=typeof y=="number"?y:i;m.current=T,d(T),e&&(p.current=requestAnimationFrame(N))},[e,i]);return J(()=>{if(l==null||l(a),s&&a>=s){h.current+=s*1e3;let{shouldRepeat:y=!1,delay:T=0,newStartAt:g}=(r==null?void 0:r(h.current/1e3))||{};y&&(f.current=setTimeout(()=>M(g),T*1e3))}},[a,s]),J(()=>(e&&(p.current=requestAnimationFrame(N)),x),[e,s,o]),{elapsedTime:a,reset:M}},Qs=(e,s,i)=>{let o=e/2,r=s/2,l=o-r,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${o},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},K=(e,s)=>e===0||e===s?0:typeof s=="number"?e-s:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,s,i,o,r)=>{if(o===0)return s;let l=(r?o-e:e)/o;return s+i*l},X=e=>{var s,i;return(i=(s=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(o,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:s.map(o=>parseInt(o,16)))!=null?i:[]},Rs=(e,s)=>{var i;let{colors:o,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof o=="string")return o;let a=(i=r==null?void 0:r.findIndex((I,f)=>I>=s&&s>=r[f+1]))!=null?i:-1;if(!r||a===-1)return o[0];if(!l)return o[a];let d=r[a]-s,c=r[a]-r[a+1],m=X(o[a]),h=X(o[a+1]),p=!!e.isGrowing;return`rgb(${m.map((I,f)=>de(d,I,h[f]-I,c,p)|0).join(",")})`},Ps=e=>{let{duration:s,initialRemainingTime:i,updateInterval:o,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:m="clockwise",onComplete:h,onUpdate:p}=e,I=u.useRef(),f=Math.max(l,a??0),{path:N,pathLength:x}=Qs(r,f,m),{elapsedTime:M}=Os({isPlaying:d,duration:s,startAt:K(s,i),updateInterval:o,onUpdate:typeof p=="function"?T=>{let g=Math.ceil(s-T);g!==I.current&&(I.current=g,p(g))}:void 0,onComplete:typeof h=="function"?T=>{var g;let{shouldRepeat:v,delay:k,newInitialRemainingTime:w}=(g=h(T))!=null?g:{};if(v)return{shouldRepeat:v,delay:k,newStartAt:K(s,w)}}:void 0}),y=s-M;return{elapsedTime:M,path:N,pathLength:x,remainingTime:Math.ceil(y),rotation:m,size:r,stroke:Rs(e,y),strokeDashoffset:de(M,0,x,s,c),strokeWidth:l}},ce=e=>{let{children:s,strokeLinecap:i,trailColor:o,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:m,elapsedTime:h,size:p,strokeWidth:I}=Ps(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:o??"#d9d9d9",strokeWidth:r??I}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:a,strokeDashoffset:c})),typeof s=="function"&&u.createElement("div",{style:_s},s({remainingTime:m,elapsedTime:h,color:d})))};ce.displayName="CountdownCircleTimer";const Us=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],qs=[10,10,1,0],Ys=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:s=30,onTimerExpired:i})=>{const[o,r]=u.useState(s>10?Vs:ee),l=({remainingTime:c})=>t.jsx(Ys,{children:c}),a=u.useCallback(()=>{i==null||i(),r(Ws)},[i,r]),d=u.useCallback(c=>{c===10&&r(ee)},[r]);return t.jsx(ce,{isPlaying:e,duration:s,colors:Us,colorsTime:qs,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Zs=()=>n.c1,Js=n.styled_default(Zs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Ks=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Xs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:s,isPlayingTimer:i,isTimer:o,questionType:r,timerDuration:l,onTimerExpired:a})=>t.jsxs(Bs,{style:{justifyContent:r===n.QuestionType.PREDICTION?"center":"space-between"},children:[t.jsxs(Hs,{children:[e&&t.jsx(Gs,{children:e}),s!==void 0&&r!==n.QuestionType.POLL&&t.jsxs(t.Fragment,{children:[t.jsx(Js,{name:"icon-trophy"}),t.jsxs(Ks,{children:[t.jsx(Xs,{children:t.jsx(n.d,{value:s})}),t.jsx(et,{children:"PTS"})]})]})]}),o&&r!==n.QuestionType.PREDICTION&&t.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:s,vote:i,close:o})=>{var r,l;const a=e.subject,d=e.type,c=e.status,m=(r=e.options)==null?void 0:r.options,h=e.marketClosed,[p,I]=u.useState(!1),[f,N]=u.useState(!1),[x,M]=u.useState(!0),[y,T]=u.useState(!1),[g,v]=u.useState(""),k=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?h&&M(!1):c===n.QuestionStatus.RESOLVED&&M(!1)},[]);const w=u.useCallback(A=>{N(A),I(!0)},[]),E=u.useCallback(async A=>{if(k){const z=A.currentTarget.value;v(z),await i(k,z)}},[k,v,i]),Q=u.useCallback(()=>{T(!0),setTimeout(o,3e3)},[o]),j=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),D=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),L=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),Ie=u.useMemo(()=>e?e.answers.map(A=>{var z;return{...A,questionVoted:!!j,youSelected:g===A.id,isLoading:s,hasCorrectAnswer:D,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(z=e.appearance)==null?void 0:z.images,onVote:E}}):[],[D,y,s,e,j,c,E,g]),fe=m&&(m.case==="trivia"||m.case==="prediction")?m.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!j&&!x,B=d===n.QuestionType.TRIVIA&&f&&p&&x,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(j&&!D||j&&D&&L!=null&&L.youVoted):!0,[d,j,D,L]),ye=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&j&&(!D||D&&L!=null&&L.youVoted))return j.points;if(!(C||y))return c===n.QuestionStatus.RESOLVED?0:j?j.correct?j.points:0:L==null?void 0:L.points},[y,j,L,c,C,d,D]),xe=u.useMemo(()=>d===n.QuestionType.PREDICTION&&j?D?D&&L!=null&&L.youVoted?"You won":"":"To win":C||y?"Time expired":d===n.QuestionType.POLL?"Time remaining":j?"You won":"To win",[y,d,j,C,D,L]),je=j||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&x;return t.jsx(n.r,{"data-question-header":"true",children:t.jsx(ms,{children:t.jsxs(hs,{children:[t.jsx(ps,{feedbackMessages:fe,questionVoted:!!j,questionVotedCorrectly:j==null?void 0:j.correct,questionType:d,hasCorrectAnswer:D,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h}),H&&t.jsx(st,{title:xe,points:ye,onTimerExpired:Q,questionType:e.type,isTimer:!s,isPlayingTimer:!j,timerDuration:je?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?t.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):t.jsxs(t.Fragment,{children:[t.jsx(Is,{style:H?{}:{marginTop:0},children:a}),t.jsx(fs,{children:Ie.map(A=>t.jsx(zs,{...A,markThatVoted:w,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:s,title:i,isPickHistory:o,instantView:r,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(r==null?void 0:r.image)||s;return t.jsxs(nt,{children:[a&&t.jsxs(at,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&t.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),d&&!(r!=null&&r.video)&&t.jsx(lt,{src:d}),t.jsxs(it,{children:[t.jsx(ot,{children:o?i:r==null?void 0:r.heading}),t.jsx(rt,{children:o?l==null?void 0:l.body:r==null?void 0:r.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...s})=>t.jsxs(dt,{children:[t.jsx(ue,{instantView:e,...s}),(e==null?void 0:e.webLink)&&t.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,t.jsx(n.c1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),ht=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),It=({created:e,...s})=>{const i=u.useMemo(()=>{if(e){const o=new Date(e);if(F(o))return{date:V(o),time:W(o)}}return null},[e]);return t.jsxs(pt,{children:[i&&t.jsxs(mt,{children:[i.date," · ",i.time]}),s.title&&t.jsx(ht,{children:s.title}),t.jsx(n.u,{...s})]})},ft=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),yt=({openedQuestion:e})=>{var s,i;return((s=e==null?void 0:e.attributes)==null?void 0:s.attributes.case)==="insight"?t.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?t.jsx(It,{created:e.attributes.created,...e.attributes.attributes.value}):null},xt=({extendedQuestion:e,vote:s,close:i})=>{const{loading:o,data:r}=e;return r?t.jsx(tt,{vote:s,close:i,openedQuestion:r,isLoading:!!o}):null},jt=({gamification:e})=>{var s;const i=n.useStore(e.openedQuestion.$store),o=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const r=i.type;return t.jsxs(ft,{children:[t.jsx(ie,{close:e.closeQuestion,type:((s=i.attributes)==null?void 0:s.type)||n.QuestionType.UNSET}),r==="question"&&t.jsx(xt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:o}),r!=="question"&&t.jsx(yt,{openedQuestion:i}),t.jsx(ns,{sponsorLogo:""})]})},Mt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),gt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Tt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),vt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var P=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(P||{});const se=({title:e,active:s,onClick:i})=>t.jsx(Tt,{onClick:i,"data-selected":s,children:t.jsx(vt,{children:e})}),Nt=({activePage:e="home",toggleActivePage:s})=>t.jsx(Mt,{children:t.jsxs(gt,{"data-position":e==="home"?"left":"right",children:[t.jsx(se,{title:"Home",active:e==="home",onClick:()=>s("home")}),t.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>s("leaderboard")})]})});function At(e){var s=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,o=e.startIndex,r=e.stopIndex;return!(o>i||r<s)}function Dt(e){for(var s=e.isItemLoaded,i=e.itemCount,o=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,m=r;m<=l;m++){var h=s(m);h?c!==null&&(a.push(d,c),d=c=null):(c=m,d===null&&(d=m))}if(c!==null){for(var p=Math.min(Math.max(c,d+o-1),i-1),I=c+1;I<=p&&!s(I);I++)c=I;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<o&&a[0]>0;){var f=a[0]-1;if(!s(f))a[0]=f;else break}return a}var St=function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")},kt=function(){function e(s,i){for(var o=0;o<i.length;o++){var r=i[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}return function(s,i,o){return i&&e(s.prototype,i),o&&e(s,o),s}}(),Lt=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)},te=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};(function(e){Lt(s,e);function s(){var i,o,r,l;St(this,s);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(o=(r=te(this,(i=s.__proto__||Object.getPrototypeOf(s)).call.apply(i,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(m){var h=m.visibleStartIndex,p=m.visibleStopIndex;r._lastRenderedStartIndex=h,r._lastRenderedStopIndex=p,r._ensureRowsLoaded(h,p)},r._setRef=function(m){r._listRef=m},o),te(r,l)}return kt(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 l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,m=c===void 0?10:c,h=l.threshold,p=h===void 0?15:h,I=Dt({isItemLoaded:a,itemCount:d,minimumBatchSize:m,startIndex:Math.max(0,o-p),stopIndex:Math.min(d-1,r+p)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(f,N){return I[N]!==f}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(o){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(m){var h=o[m],p=o[m+1],I=l(h,p);I!=null&&I.then(function(){if(At({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:h,stopIndex:p})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(h,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<o.length;d+=2)a(d)}}]),s})(u.PureComponent);const Et=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),wt=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ct=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),bt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),zt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ot=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),$t=()=>n.c1,_t=n.styled_default($t())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Rt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pt=Rt,Ut=Pt;function me(){}function he(){}he.resetWarningCache=me;var qt=function(){function e(o,r,l,a,d,c){if(c!==Ut){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function s(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:he,resetWarningCache:me};return i.PropTypes=i,i};pe.exports=qt();var Yt=pe.exports;const S=n.getDefaultExportFromCjs(Yt);class Y extends u.Component{constructor(s){super(s),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let s=!1;const i={get passive(){s=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return s}eventListenerOptions(){let s=this.props.useCapture;return this.isPassiveSupported()?s={useCapture:this.props.useCapture,passive:!0}:s={passive:!1},s}setDefaultLoader(s){this.defaultLoader=s}detachMousewheelListener(){let s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(s){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(s&&s.parentNode)}filterProps(s){return s}attachScrollListener(){const s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;let i=window;this.props.useWindow===!1&&(i=s),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}scrollListener(){const s=this.scrollComponent,i=window,o=this.getParentElement(s);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(s,a)}else this.props.isReverse?r=o.scrollTop:r=s.scrollHeight-o.scrollTop-o.clientHeight;r<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(s,i){return s?this.calculateTopPosition(s)+(s.offsetHeight-i-window.innerHeight):0}calculateTopPosition(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}render(){const s=this.filterProps(this.props),{children:i,element:o,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:m,ref:h,threshold:p,useCapture:I,useWindow:f,getScrollParent:N,...x}=s;x.ref=y=>{this.scrollComponent=y,h&&h(y)};const M=[i];return r&&(d?a?M.unshift(d):M.push(d):this.defaultLoader&&(a?M.unshift(this.defaultLoader):M.push(this.defaultLoader))),u.createElement(o,x,M)}}U(Y,"propTypes",{children:S.node.isRequired,element:S.node,hasMore:S.bool,initialLoad:S.bool,isReverse:S.bool,loader:S.node,loadMore:S.func.isRequired,pageStart:S.number,ref:S.func,getScrollParent:S.func,threshold:S.number,useCapture:S.bool,useWindow:S.bool}),U(Y,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Vt=({rank:e,avatar:s,name:i,points:o,isCurrentUser:r,openItemDetail:l,style:a})=>t.jsxs(Et,{onClick:l,style:a,children:[t.jsx(wt,{children:e||0}),t.jsxs(zt,{children:[s?t.jsx(Ct,{alt:"leaderboard-item-avatar",src:s}):t.jsx(bt,{children:oe(i||"")}),t.jsxs(Ot,{children:[t.jsx(Qt,{children:i||""}),r&&t.jsx(_t,{name:"icon-star"})]})]}),t.jsx("div",{children:re(o)})]}),Wt=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Ft=({items:e,currentUserId:s,openItemDetail:i,fetchMore:o,scrollNode:r,hasMore:l})=>t.jsx(Y,{loadMore:o,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:t.jsx(Wt,{children:e.map(a=>t.jsx(Vt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!s&&s===a.userId},a.userId))})}),Bt=({deepLink:e})=>{const{data:s}=n.useStore(e.$store),i=s==null?void 0:s.url,o=e.desktopLink;return t.jsx(n.O,{inviteLink:i||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."})},Ht=({gamification:e,scrollNode:s,scrollStore:i})=>{const{data:o,hasMore:r}=n.useStore(e.leaderboardList.$store);return o!=null&&o.length?t.jsx(Ft,{items:o,scrollNode:s,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:r,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):t.jsx(Bt,{deepLink:e.deepLink})},Gt=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Kt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Xt=()=>n.c1,R=n.styled_default(Xt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),en=()=>n.c1,sn=n.styled_default(en())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),nn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),on=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),rn={[n.PickHistoryStatus.LOST]:t.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:t.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:t.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:t.jsx(R,{name:"icon-arrow"})},an=({questionId:e,questionType:s,questionStatus:i,subject:o,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[s],c=rn[a];return d?t.jsxs(Gt,{onClick:()=>l==null?void 0:l(e),children:[t.jsxs(nn,{children:[t.jsxs(Zt,{children:[t.jsx(sn,{"data-type-trivia":s===n.QuestionType.TRIVIA,"data-type-poll":s===n.QuestionType.POLL,name:d.iconName}),t.jsxs(tn,{children:[d.label,s===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),t.jsx(Jt,{children:o||""})]}),t.jsx(Kt,{children:r?t.jsx(on,{children:"Play"}):c})]}):null},ln=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),dn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:s,...i})=>t.jsxs(ln,{children:[t.jsx(ue,{questionId:s,...i,isPickHistory:!0}),e&&t.jsx(dn,{onClick:()=>e(s),children:"View Insight"})]}),un=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),pn=()=>n.c,mn=n.styled_default(pn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),hn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),In=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),fn=({openTweet:e,created:s,...i})=>{const o=u.useMemo(()=>{if(s){const r=new Date(s);if(F(r))return{date:V(r),time:W(r)}}return null},[s]);return t.jsxs(un,{children:[o&&t.jsxs(hn,{children:[o.date," · ",o.time]}),i.title&&t.jsx(In,{children:i.title}),t.jsx(n.u,{...i}),e&&t.jsx(mn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},yn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),xn=({questions:e,openQuestion:s})=>t.jsx(yn,{children:e==null?void 0:e.map(i=>{var o,r,l;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const a=i.attributes.attributes.value;return t.jsx(an,{openQuestion:s,...a},a.questionId)}if(i.type==="insight"&&((r=i.attributes)==null?void 0:r.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return t.jsx(cn,{openInsight:s,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return t.jsx(fn,{openTweet:s,...a,tweetId:d,created:c},d)}return null})}),jn=({store:e,openQuestion:s})=>{const i=n.useStore(e);return i!=null&&i.data?t.jsx(xn,{openQuestion:s,questions:i.data}):t.jsx("div",{children:"wait questions..."})},Mn=({userSummary:e})=>{var s;const[i,o]=u.useState(void 0);return u.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&o(l.data)});return()=>{r()}},[e]),i!=null&&i.summary?t.jsx(ae,{...i.summary,successRate:(s=i.percentage)==null?void 0:s.correct}):t.jsx("div",{children:"wait user..."})},gn=({gamification:e,className:s,scrollStore:i,scrollNode:o})=>{const[r,l]=u.useState(!1),[a,d]=u.useState(P.HOME),[,c]=u.useTransition(),m=p=>{c(()=>d(p))},h=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){h(!1),i.setKey("tabsShown",!1);return}h(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),t.jsxs("div",{className:s,children:[t.jsx(n.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:r?"-60px":"0px"},children:t.jsx(Nt,{activePage:a,toggleActivePage:m})}),a===P.HOME&&t.jsxs(t.Fragment,{children:[t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Mn,{userSummary:e.userSummary})}),t.jsx(n.n,{children:t.jsx(jn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===P.LEADERBOARD&&t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Ht,{scrollStore:i,scrollNode:o,gamification:e})})]})},Tn=()=>n.x,ne=n.styled_default(Tn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),vn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Nn=({correct:e,incorrect:s})=>{const i=e+s;return i===0?0:Math.round(e/i*100)},An=({gamification:e,scrollStore:s,className:i,appNode:o,scrollNode:r})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return t.jsxs(t.Fragment,{children:[l&&o.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsx(jt,{gamification:e})}),o.current),a&&o.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsxs(vn,{children:[t.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),t.jsx(n.a,{children:t.jsx(ae,{...a,successRate:Nn(a)})})]})}),o.current),t.jsx(gn,{scrollStore:s,scrollNode:r,className:i,gamification:e})]})};exports.default=An;