@streamlayer/react 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/provider.d.ts +2 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index2.js +5 -3
- package/lib/cjs/masters2.js +41 -41
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +60 -58
- package/lib/dist/es/gamification-feature.js +5 -5
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +14050 -13953
- package/lib/dist/index.d.ts +20 -12
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +85 -85
- package/lib/es/index2.js +30 -27
- package/lib/es/masters.js +3 -3
- package/lib/es/masters2.js +6482 -6407
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@streamlayer/sdk-web"),l=require("react"),f=(t,o,s,a)=>{const[i,u]=l.useState(null);return l.useEffect(()=>{let r=!1;if(!t)return console.error("streamlayer sdk key should be provided"),u(e=>(e!==null&&typeof e.disableApp=="function"&&e.disableApp(),null)),()=>{r=!0};const n=c.StreamLayer(t,s,a,{version:"0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@streamlayer/sdk-web"),l=require("react"),f=(t,o,s,a)=>{const[i,u]=l.useState(null);return l.useEffect(()=>{let r=!1;if(!t)return console.error("streamlayer sdk key should be provided"),u(e=>(e!==null&&typeof e.disableApp=="function"&&e.disableApp(),null)),()=>{r=!0};const n=c.StreamLayer(t,s,a,{version:"0.39.0"});if(o)for(const e of o)n.use(e);return n.ready().then(e=>{r||u(e.sdk)}).catch(e=>console.log(e)),()=>{r=!0,n.close(function(e){if(e)throw e})}},[t,s]),i};exports.useStreamLayerApp=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var ye=(e,t,o)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var U=(e,t,o)=>(ye(e,typeof t!="symbol"?t+"":t,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("./masters.js"),p=require("react"),xe=s.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ie=s.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),je=()=>s.c1,Ce=s.styled_default(je())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ge=s.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ae=s.styled_default("div")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),Te=()=>s.c1,be=s.styled_default(Te())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:e,close:t,label:o})=>{const i=e?s.o[e]:{label:o,iconName:void 0};return n.jsxs(xe,{children:[n.jsxs(Ie,{children:[(i==null?void 0:i.iconName)&&n.jsx(Ce,{"data-type-trivia":e===s.QuestionType.TRIVIA,"data-type-poll":e===s.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&n.jsx(ge,{children:i.label})]}),n.jsx(Ae,{onClick:t,children:n.jsx(be,{name:"icon-cross"})})]})},$e=s.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=s.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),_e=s.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Y=({indicator:e,title:t})=>n.jsxs($e,{children:[n.jsx(we,{children:t}),n.jsx(_e,{children:e})]}),Se=s.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Re=s.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),ke=s.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:t})=>n.jsxs(Se,{children:[n.jsx(Re,{children:e}),n.jsx(ke,{children:t})]}),Le=s.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ee=s.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Pe=s.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),qe=s.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Qe=s.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ne=s.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),De=s.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Oe=s.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Me=s.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ve=s.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=s.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ue=s.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),We=s.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Be=s.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),ze=s.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),He=s.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ye=s.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Ze="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",oe=({avatar:e,name:t,points:o,friendsRank:i,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:u})=>n.jsxs(Le,{children:[n.jsx(Ee,{children:n.jsxs(qe,{children:[n.jsxs(Ye,{children:[e&&n.jsx(Qe,{alt:"avatar",src:e}),!e&&n.jsx(He,{children:s.I(t||"")})]}),n.jsxs(Ne,{children:[n.jsx(De,{children:t}),n.jsxs(Oe,{children:[n.jsxs(Ve,{children:[n.jsx(Me,{alt:"rank-icon",src:Ze}),n.jsxs(Fe,{children:[s.s(o),n.jsx(Ue,{children:"PTS"})]})]}),n.jsx(We,{}),n.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),n.jsxs(Pe,{children:[n.jsxs(Be,{children:[n.jsx(Y,{indicator:i||0,title:"Friends rank"}),n.jsx(Y,{indicator:r||0,title:"Global rank"})]}),n.jsxs(ze,{children:[n.jsx(Q,{indicator:l||0,title:"Win streak"}),n.jsx(Q,{indicator:a||0,title:"Correct"}),n.jsx(Q,{indicator:d||0,title:"Incorrect"}),n.jsx(Q,{indicator:`${u||0}%`,title:"Succ. rate"})]})]})]}),Ge=s.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ke=()=>s.c1,Xe=s.styled_default(Ke())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>n.jsx(Ge,{children:n.jsx(Xe,{name:"mastersLogo"})}),es=s.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ss=s.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ts=s.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ns=({title:e,description:t})=>n.jsxs(es,{children:[n.jsx(s.c1,{name:"icon-check-circle"}),n.jsx(ss,{children:e}),n.jsx(ts,{children:t})]}),os=s.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),is=()=>s.c1,rs=s.styled_default(is())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),q=s.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),N=s.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=s.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),E=s.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),W=s.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ls=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:o,questionType:i,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:u,enteredAnActiveQuestion:h,marketClosed:f})=>{const m=o&&(i===s.QuestionType.TRIVIA||i===s.QuestionType.PREDICTION)&&c&&l!==s.QuestionStatus.RESOLVED,v=i===s.QuestionType.PREDICTION&&!r,C=f&&i===s.QuestionType.PREDICTION&&!o&&!h||i===s.QuestionType.PREDICTION&&u&&c&&h,j=m&&v,x=m&&r,y=i===s.QuestionType.PREDICTION&&o&&c&&r,A=o&&i===s.QuestionType.POLL&&c;if(!a&&!d&&!j&&!x&&!C&&!A&&!y)return null;const g=t?"correct":"incorrect",T=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return n.jsxs(os,{"data-isPrediction":v,children:[a&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(E,{children:"Question Expired"})}),n.jsx(W,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),d&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(E,{children:"Question Closed"})}),n.jsx(W,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),C&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(E,{children:"Question Closed"})}),n.jsx(W,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),j&&n.jsxs(n.Fragment,{children:[n.jsx(rs,{name:"icon-prediction"}),n.jsx(E,{children:"Stay tuned to see if your prediction was correct."})]}),A&&n.jsxs(n.Fragment,{children:[n.jsx(q,{"data-feedback-type":"correct",children:n.jsx(s.c1,{name:"correct"})}),n.jsx(E,{children:"That's for answering. Please stay tuned for the next question."})]}),(x||y)&&n.jsxs(n.Fragment,{children:[n.jsx(q,{"data-feedback-type":g,children:n.jsx(s.c1,{name:g})}),n.jsx("div",{children:n.jsxs(N,{children:[n.jsx(as,{"data-feedback-type":g,children:T==null?void 0:T.title}),n.jsx(E,{children:T==null?void 0:T.description})]})})]})]})},ds=s.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),cs=()=>s.c,us=s.styled_default(cs())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),ps=s.styled_default("div")({name:"Content",class:"c1hq58md",propsAsIs:!1}),hs=s.styled_default("div")({name:"Title",class:"t1c8nxcx",propsAsIs:!1}),ms=s.styled_default("div")({name:"Options",class:"oiozuc3",propsAsIs:!1}),fs=s.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vs=s.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),ys=s.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),xs=s.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Is=s.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ie=s.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),js=()=>ie,Cs=s.styled_default(js())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),gs=()=>ie,As=s.styled_default(gs())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ts=s.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),bs=s.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),$s=s.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),ws=s.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),_s=()=>s.c1,Ss=s.styled_default(_s())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),Z={[s.QuestionImages.CENTERED]:e=>n.jsx(Cs,{alt:"option-icon",src:e}),[s.QuestionImages.TRANSPARENT]:e=>n.jsx(xs,{children:n.jsx(Is,{style:{backgroundImage:`url(${e})`}})}),[s.QuestionImages.ROUNDED]:e=>n.jsx(As,{alt:"option-icon",src:e}),[s.QuestionImages.NONE]:()=>null,[s.QuestionImages.UNSET]:()=>null},Rs=({questionType:e,hasCorrectAnswer:t,correct:o,youVoted:i,questionVoted:r})=>{if(e===s.QuestionType.POLL&&i)return"correct";if(e===s.QuestionType.PREDICTION){if(t&&r)return i?o?"correct":"incorrect":"unset";if(i)return"correct"}return e===s.QuestionType.TRIVIA&&r&&i?o?"correct":"incorrect":"unset"},ks=({questionType:e,questionVoted:t,correct:o,hasCorrectAnswer:i,questionStatus:r})=>e===s.QuestionType.TRIVIA?t&&o:e===s.QuestionType.PREDICTION?t&&o&&i||r===s.QuestionStatus.RESOLVED&&o:!1,Ls=e=>{var t;const{id:o,icon:i,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:u,questionVoted:h,imageMode:f,answerTimeExpired:m,questionStatus:v,isLoading:C,questionType:j,correct:x,hasCorrectAnswer:y,votedAfterQuestionClosed:A,enteredAnActiveQuestion:g,marketClosed:T}=e,[S,k]=p.useState(l),R=Rs(e),M=ks({questionType:j,questionVoted:h,correct:x,hasCorrectAnswer:y,questionStatus:v}),I=T&&j===s.QuestionType.PREDICTION,b=h||I,$=j===s.QuestionType.PREDICTION&&!h&&!T,V=h&&!u&&R!=="incorrect";return p.useLayoutEffect(()=>{l>0&&(k(0),requestAnimationFrame(()=>{k(l)}))},[l]),n.jsxs(fs,{value:o,"data-selected":u,"data-answer-state":R,disabled:h||C||m||I&&!g||I&&g&&A,"data-is-not-checked":V,onClick:F=>{c(j===s.QuestionType.PREDICTION?T:v===s.QuestionStatus.RESOLVED),d(F)},children:[n.jsx(vs,{"data-answer-state":R,style:{width:`${b?S:0}%`}}),n.jsxs(ys,{children:[i&&f&&((t=Z[f])==null?void 0:t.call(Z,i)),n.jsx(Ts,{children:r}),$&&n.jsxs("div",{children:[a,n.jsx($s,{children:"pts"})]}),b&&n.jsxs(bs,{children:[M&&n.jsx(Ss,{name:"selected"}),n.jsx(ws,{children:n.jsx(s.d,{value:l,suffix:"%"})})]})]})]})};var G=typeof window>"u"?p.useEffect:p.useLayoutEffect,Es=({isPlaying:e,duration:t,startAt:o=0,updateInterval:i=0,onComplete:r,onUpdate:l})=>{let[a,d]=p.useState(o),c=p.useRef(0),u=p.useRef(o),h=p.useRef(o*-1e3),f=p.useRef(null),m=p.useRef(null),v=p.useRef(null),C=y=>{let A=y/1e3;if(m.current===null){m.current=A,f.current=requestAnimationFrame(C);return}let g=A-m.current,T=c.current+g;m.current=A,c.current=T;let S=u.current+(i===0?T:(T/i|0)*i),k=u.current+T,R=typeof t=="number"&&k>=t;d(R?t:S),R||(f.current=requestAnimationFrame(C))},j=()=>{f.current&&cancelAnimationFrame(f.current),v.current&&clearTimeout(v.current),m.current=null},x=p.useCallback(y=>{j(),c.current=0;let A=typeof y=="number"?y:o;u.current=A,d(A),e&&(f.current=requestAnimationFrame(C))},[e,o]);return G(()=>{if(l==null||l(a),t&&a>=t){h.current+=t*1e3;let{shouldRepeat:y=!1,delay:A=0,newStartAt:g}=(r==null?void 0:r(h.current/1e3))||{};y&&(v.current=setTimeout(()=>x(g),A*1e3))}},[a,t]),G(()=>(e&&(f.current=requestAnimationFrame(C)),j),[e,t,i]),{elapsedTime:a,reset:x}},Ps=(e,t,o)=>{let i=e/2,r=t/2,l=i-r,a=2*l,d=o==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${i},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},K=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,qs=e=>({position:"relative",width:e,height:e}),Qs={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},re=(e,t,o,i,r)=>{if(i===0)return t;let l=(r?i-e:e)/i;return t+o*l},X=e=>{var t,o;return(o=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?o:[]},Ns=(e,t)=>{var o;let{colors:i,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let a=(o=r==null?void 0:r.findIndex((m,v)=>m>=t&&t>=r[v+1]))!=null?o:-1;if(!r||a===-1)return i[0];if(!l)return i[a];let d=r[a]-t,c=r[a]-r[a+1],u=X(i[a]),h=X(i[a+1]),f=!!e.isGrowing;return`rgb(${u.map((m,v)=>re(d,m,h[v]-m,c,f)|0).join(",")})`},Ds=e=>{let{duration:t,initialRemainingTime:o,updateInterval:i,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:u="clockwise",onComplete:h,onUpdate:f}=e,m=p.useRef(),v=Math.max(l,a??0),{path:C,pathLength:j}=Ps(r,v,u),{elapsedTime:x}=Es({isPlaying:d,duration:t,startAt:K(t,o),updateInterval:i,onUpdate:typeof f=="function"?A=>{let g=Math.ceil(t-A);g!==m.current&&(m.current=g,f(g))}:void 0,onComplete:typeof h=="function"?A=>{var g;let{shouldRepeat:T,delay:S,newInitialRemainingTime:k}=(g=h(A))!=null?g:{};if(T)return{shouldRepeat:T,delay:S,newStartAt:K(t,k)}}:void 0}),y=t-x;return{elapsedTime:x,path:C,pathLength:j,remainingTime:Math.ceil(y),rotation:u,size:r,stroke:Ns(e,y),strokeDashoffset:re(x,0,j,t,c),strokeWidth:l}},ae=e=>{let{children:t,strokeLinecap:o,trailColor:i,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:u,elapsedTime:h,size:f,strokeWidth:m}=Ds(e);return p.createElement("div",{style:qs(f)},p.createElement("svg",{viewBox:`0 0 ${f} ${f}`,width:f,height:f,xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:r??m}),p.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:o??"round",strokeWidth:m,strokeDasharray:a,strokeDashoffset:c})),typeof t=="function"&&p.createElement("div",{style:Qs},t({remainingTime:u,elapsedTime:h,color:d})))};ae.displayName="CountdownCircleTimer";const Os=[s.E.PRIMARY_GREEN1,s.E.SECONDARY_RED1,s.E.SECONDARY_RED1,s.E.NEUTRALS_GRAY3],Ms=[10,10,1,0],Vs=s.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Fs=s.E.SECONDARY_GREEN6,J=s.E.SECONDARY_RED3,Us=s.E.NEUTRALS_GRAY3,Ws=({isPlaying:e=!0,duration:t=30,onTimerExpired:o})=>{const[i,r]=p.useState(t>10?Fs:J),l=({remainingTime:c})=>n.jsx(Vs,{children:c}),a=p.useCallback(()=>{o==null||o(),r(Us)},[o,r]),d=p.useCallback(c=>{c===10&&r(J)},[r]);return n.jsx(ae,{isPlaying:e,duration:t,colors:Os,colorsTime:Ms,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:a,onUpdate:d,children:l})},Bs=s.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),zs=s.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Hs=s.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Ys=()=>s.c1,Zs=s.styled_default(Ys())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Gs=s.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ks=s.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Xs=s.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Js=({title:e,points:t,isPlayingTimer:o,isTimer:i,animatePoints:r,questionType:l,timerDuration:a,onTimerExpired:d})=>n.jsxs(Bs,{style:{justifyContent:l===s.QuestionType.PREDICTION?"center":"space-between"},children:[n.jsxs(zs,{children:[e&&n.jsx(Hs,{children:e}),t!==void 0&&l!==s.QuestionType.POLL&&n.jsxs(n.Fragment,{children:[n.jsx(Zs,{name:"icon-trophy"}),n.jsxs(Gs,{children:[n.jsx(Ks,{children:r?n.jsx(s.d,{value:t,delay:.3}):t}),n.jsx(Xs,{children:"PTS"})]})]})]}),i&&l!==s.QuestionType.PREDICTION&&n.jsx(Ws,{isPlaying:o,onTimerExpired:d,duration:a})]}),et=({openedQuestion:e,isLoading:t,vote:o,close:i})=>{var r,l;const a=e.subject,d=e.type,c=e.status,u=(r=e.options)==null?void 0:r.options,h=e.marketClosed,[f,m]=p.useState(!1),[v,C]=p.useState(!1),[j,x]=p.useState(!0),[y,A]=p.useState(!1),[g,T]=p.useState(""),S=e==null?void 0:e.id;p.useEffect(()=>{d===s.QuestionType.PREDICTION?h&&x(!1):c===s.QuestionStatus.RESOLVED&&x(!1)},[]);const k=p.useCallback(w=>{C(w),m(!0)},[]),R=p.useCallback(async w=>{if(S){const P=w.currentTarget.value;T(P),await o(S,P)}},[S,T,o]),M=p.useCallback(()=>{A(!0),setTimeout(i,3e3)},[i]),I=p.useMemo(()=>e==null?void 0:e.answers.find(w=>w.youVoted===!0),[e]),b=p.useMemo(()=>!!(e!=null&&e.answers.find(w=>w.correct===!0)),[e]),$=p.useMemo(()=>e==null?void 0:e.answers.find(w=>w.correct===!0),[e]),V=p.useMemo(()=>e?e.answers.map(w=>{var P;return{...w,questionVoted:!!I,youSelected:g===w.id,isLoading:t,hasCorrectAnswer:b,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(P=e.appearance)==null?void 0:P.images,onVote:R}}):[],[b,y,t,e,I,c,R,g]),F=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0,L=c===s.QuestionStatus.RESOLVED&&d===s.QuestionType.TRIVIA&&!I&&!j,z=d===s.QuestionType.TRIVIA&&v&&f&&j,H=p.useMemo(()=>d===s.QuestionType.PREDICTION?!!(I&&!b||I&&b&&$!=null&&$.youVoted):!0,[d,I,b,$]),pe=p.useMemo(()=>{if(d===s.QuestionType.PREDICTION&&I&&(!b||b&&$!=null&&$.youVoted))return I.points;if(!(L||y))return c===s.QuestionStatus.RESOLVED?0:I?I.correct?I.points:0:$==null?void 0:$.points},[y,I,$,c,L,d,b]),he=p.useMemo(()=>d===s.QuestionType.PREDICTION&&I?b?b&&$!=null&&$.youVoted?"You won":"":"To win":L||y?"Time expired":d===s.QuestionType.POLL?"Time remaining":I?"You won":"To win",[y,d,I,L,b,$]),me=(d===s.QuestionType.TRIVIA||d===s.QuestionType.PREDICTION)&&I&&b&&($==null?void 0:$.youVoted),fe=I||L||z||d===s.QuestionType.TRIVIA&&c===s.QuestionStatus.RESOLVED&&j;return n.jsx(us,{children:n.jsx(ds,{children:n.jsxs(ps,{children:[n.jsx(ls,{feedbackMessages:F,questionVoted:!!I,questionVotedCorrectly:I==null?void 0:I.correct,questionType:d,hasCorrectAnswer:b,questionStatus:c,showExpiredNotification:L,showClosedNotificationTrivia:z,votedInCurrentRender:f,votedAfterQuestionClosed:v,enteredAnActiveQuestion:j,marketClosed:h}),H&&n.jsx(Js,{title:he,points:pe,onTimerExpired:M,questionType:e.type,isTimer:!t,isPlayingTimer:!I,animatePoints:me,timerDuration:fe?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?n.jsx(ns,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):n.jsxs(n.Fragment,{children:[n.jsx(hs,{style:H?{}:{marginTop:0},children:a}),n.jsx(ms,{children:V.map(w=>n.jsx(Ls,{...w,markThatVoted:k,votedAfterQuestionClosed:v,enteredAnActiveQuestion:j,marketClosed:h},w.id))})]})]})})})},st=s.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),tt=s.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),nt=s.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ot=s.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),it=s.styled_default("img")({name:"Image",class:"id3lh3p",propsAsIs:!1}),le=({instantView:e,isDetail:t,notification:o})=>{const i=e==null?void 0:e.heading,r=e==null?void 0:e.body,l=i||r,a=o==null?void 0:o.title,d=o==null?void 0:o.body;return n.jsxs(st,{children:[(e==null?void 0:e.video)&&n.jsx(s.w,{source:e.video.url,poster:e.video.thumbnailUrl}),(e==null?void 0:e.image)&&!(e!=null&&e.video)&&n.jsx(it,{src:e==null?void 0:e.image}),n.jsxs(tt,{children:[n.jsx(nt,{children:t&&l?i:a}),n.jsx(ot,{children:t&&l?r:d})]})]})},rt=s.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),at=s.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),lt=({instantView:e,...t})=>n.jsxs(rt,{children:[n.jsx(le,{instantView:e,...t,isDetail:!0}),(e==null?void 0:e.webLink)&&n.jsxs(at,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,n.jsx(s.c1,{name:"icon-external-link"})]})]}),dt=s.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),ct=s.styled_default("blockquote")({name:"Quote",class:"qb4q22c",propsAsIs:!1}),ut=e=>n.jsxs(dt,{children:[e.title&&n.jsx(ct,{children:e.title}),n.jsx(s.L,{...e,isDetail:!0})]}),pt=s.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),ht=({openedQuestion:e})=>{var t,o;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?n.jsx(lt,{...e.attributes.attributes.value}):((o=e==null?void 0:e.attributes)==null?void 0:o.attributes.case)==="tweet"?n.jsx(ut,{...e.attributes.attributes.value}):null},mt=({extendedQuestion:e,vote:t,close:o})=>{const{loading:i,data:r}=e;return r?n.jsx(et,{vote:t,close:o,openedQuestion:r,isLoading:!!i}):null},ft=({gamification:e})=>{var t;const o=s.useStore(e.openedQuestion.$store),i=s.useStore(e.openedQuestion.$extendedStore);if(!o)return null;const r=o.type;return n.jsxs(pt,{children:[n.jsx(ne,{close:e.closeQuestion,type:((t=o.attributes)==null?void 0:t.type)||s.QuestionType.UNSET}),r==="question"&&n.jsx(mt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&n.jsx(ht,{openedQuestion:o}),n.jsx(Je,{sponsorLogo:""})]})},vt=s.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),yt=s.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),xt=s.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),It=s.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var O=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(O||{});const ee=({title:e,active:t,onClick:o})=>n.jsx(xt,{onClick:o,"data-selected":t,children:n.jsx(It,{children:e})}),jt=({activePage:e="home",toggleActivePage:t})=>n.jsx(vt,{children:n.jsxs(yt,{"data-position":e==="home"?"left":"right",children:[n.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),n.jsx(ee,{title:"Friends",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})}),Ct=s.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),gt=s.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),At=s.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Tt=s.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),bt=s.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),$t=()=>s.c1,wt=s.styled_default($t())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),_t="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e",St=({title:e,description:t,onClick:o,className:i})=>n.jsxs(Ct,{onClick:o,className:i,children:[n.jsx(gt,{alt:"friends-icon",src:_t}),n.jsxs(At,{children:[n.jsx(Tt,{children:e}),n.jsx(bt,{children:t})]}),n.jsx(wt,{name:"icon-copy"})]});function Rt(e){var t=e.lastRenderedStartIndex,o=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>o||r<t)}function kt(e){for(var t=e.isItemLoaded,o=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,u=r;u<=l;u++){var h=t(u);h?c!==null&&(a.push(d,c),d=c=null):(c=u,d===null&&(d=u))}if(c!==null){for(var f=Math.min(Math.max(c,d+i-1),o-1),m=c+1;m<=f&&!t(m);m++)c=m;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<i&&a[0]>0;){var v=a[0]-1;if(!t(v))a[0]=v;else break}return a}var Lt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Et=function(){function e(t,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Pt=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},se=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e};(function(e){Pt(t,e);function t(){var o,i,r,l;Lt(this,t);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(i=(r=se(this,(o=t.__proto__||Object.getPrototypeOf(t)).call.apply(o,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(u){var h=u.visibleStartIndex,f=u.visibleStopIndex;r._lastRenderedStartIndex=h,r._lastRenderedStopIndex=f,r._ensureRowsLoaded(h,f)},r._setRef=function(u){r._listRef=u},i),se(r,l)}return Et(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,u=c===void 0?10:c,h=l.threshold,f=h===void 0?15:h,m=kt({isItemLoaded:a,itemCount:d,minimumBatchSize:u,startIndex:Math.max(0,i-f),stopIndex:Math.min(d-1,r+f)});(this._memoizedUnloadedRanges.length!==m.length||this._memoizedUnloadedRanges.some(function(v,C){return m[C]!==v}))&&(this._memoizedUnloadedRanges=m,this._loadUnloadedRanges(m))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var h=i[u],f=i[u+1],m=l(h,f);m!=null&&m.then(function(){if(Rt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:h,stopIndex:f})){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<i.length;d+=2)a(d)}}]),t})(p.PureComponent);const qt=s.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Qt=s.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Nt=s.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Dt=s.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ot=s.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Mt=s.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Vt=s.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Ft=()=>s.c1,Ut=s.styled_default(Ft())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var de={exports:{}},Wt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Bt=Wt,zt=Bt;function ce(){}function ue(){}ue.resetWarningCache=ce;var Ht=function(){function e(i,r,l,a,d,c){if(c!==zt){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ue,resetWarningCache:ce};return o.PropTypes=o,o};de.exports=Ht();var Yt=de.exports;const _=s.getDefaultExportFromCjs(Yt);class B extends p.Component{constructor(t){super(t),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 t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const o={get passive(){t=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const o=this.props.getScrollParent&&this.props.getScrollParent();return o??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let o=window;this.props.useWindow===!1&&(o=t),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,o=window,i=this.getParentElement(t);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=o.pageYOffset!==void 0?o.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(t,a)}else this.props.isReverse?r=i.scrollTop:r=t.scrollHeight-i.scrollTop-i.clientHeight;r<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=i.scrollHeight,this.beforeScrollTop=i.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,o){return t?this.calculateTopPosition(t)+(t.offsetHeight-o-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:o,element:i,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:u,ref:h,threshold:f,useCapture:m,useWindow:v,getScrollParent:C,...j}=t;j.ref=y=>{this.scrollComponent=y,h&&h(y)};const x=[o];return r&&(d?a?x.unshift(d):x.push(d):this.defaultLoader&&(a?x.unshift(this.defaultLoader):x.push(this.defaultLoader))),p.createElement(i,j,x)}}U(B,"propTypes",{children:_.node.isRequired,element:_.node,hasMore:_.bool,initialLoad:_.bool,isReverse:_.bool,loader:_.node,loadMore:_.func.isRequired,pageStart:_.number,ref:_.func,getScrollParent:_.func,threshold:_.number,useCapture:_.bool,useWindow:_.bool}),U(B,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Zt=({rank:e,avatar:t,name:o,points:i,isCurrentUser:r,openItemDetail:l,style:a})=>n.jsxs(qt,{onClick:l,style:a,children:[n.jsx(Qt,{children:e||0}),n.jsxs(Ot,{children:[t?n.jsx(Nt,{alt:"leaderboard-item-avatar",src:t}):n.jsx(Dt,{children:s.I(o||"")}),n.jsxs(Mt,{children:[n.jsx(Vt,{children:o||""}),r&&n.jsx(Ut,{name:"icon-star"})]})]}),n.jsx("div",{children:s.s(i)})]}),Gt=s.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Kt=({items:e,currentUserId:t,openItemDetail:o,fetchMore:i,scrollNode:r,hasMore:l})=>n.jsx(B,{loadMore:i,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:n.jsx(Gt,{children:e.map(a=>n.jsx(Zt,{...a,openItemDetail:()=>o(a.userId),isCurrentUser:!!t&&t===a.userId},a.userId))})}),Xt=({renderClipBoardNode:e,deepLink:t})=>n.jsx(s.F,{renderToNode:e,inviteLink:t,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."}),Jt=s.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),en=({gamification:e,scrollNode:t,scrollStore:o,renderClipBoardNode:i})=>{const{data:r,hasMore:l,loading:a,key:d}=s.useStore(e.leaderboardList.$store),{data:c}=s.useStore(e.deepLink.$store),[u,h]=s.h(i);return!r.length&&!a?n.jsx(Xt,{renderClipBoardNode:i,deepLink:c}):n.jsxs(n.Fragment,{children:[n.jsx(Kt,{items:r,scrollNode:t,scrollStore:o,fetchMore:e.leaderboardList.fetchMore,hasMore:l,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()},d),c&&n.jsx(Jt,{children:n.jsx(St,{onClick:()=>u(c),title:"Invite Friends",description:"Challenge them now!"})}),h]})},sn=s.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),tn=s.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),nn=s.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),on=s.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),rn=()=>s.c1,D=s.styled_default(rn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),an=()=>s.c1,ln=s.styled_default(an())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),dn=s.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),cn=s.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),un=s.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),pn={[s.PickHistoryStatus.LOST]:n.jsx(D,{name:"incorrectVoted"}),[s.PickHistoryStatus.WON]:n.jsx(D,{name:"icon-check"}),[s.PickHistoryStatus.UNSET]:n.jsx(D,{name:"icon-arrow"}),[s.PickHistoryStatus.DNP]:n.jsx(D,{name:"icon-arrow"})},hn=({questionId:e,questionType:t,questionStatus:o,subject:i,openForVoting:r,openQuestion:l,status:a})=>{const d=s.o[t],c=pn[a];return d?n.jsxs(sn,{onClick:()=>l==null?void 0:l(e),children:[n.jsxs(cn,{children:[n.jsxs(tn,{children:[n.jsx(ln,{"data-type-trivia":t===s.QuestionType.TRIVIA,"data-type-poll":t===s.QuestionType.POLL,name:d.iconName}),n.jsxs(dn,{children:[d.label,t===s.QuestionType.TRIVIA&&o===s.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(nn,{children:i||""})]}),n.jsx(on,{children:r?n.jsx(un,{children:"Play"}):c})]}):null},mn=s.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),fn=s.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),vn=({openInsight:e,questionId:t,...o})=>n.jsxs(mn,{children:[n.jsx(le,{questionId:t,...o}),e&&n.jsx(fn,{onClick:()=>e(t),children:"View Insight"})]}),yn=s.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),xn=()=>s.c$1,In=s.styled_default(xn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),jn=s.styled_default("blockquote")({name:"Quote",class:"q1hbaleq",propsAsIs:!1}),Cn=({openTweet:e,...t})=>n.jsxs(yn,{children:[t.title&&n.jsx(jn,{children:t.title}),n.jsx(s.L,{...t}),e&&n.jsx(In,{onClick:()=>e(t.tweetId),children:"View Insight"})]}),gn=s.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),An=({questions:e,openQuestion:t})=>n.jsx(gn,{children:e==null?void 0:e.map(o=>{var i,r,l;if(o.type==="question"&&((i=o.attributes)==null?void 0:i.attributes.case)==="question"){const a=o.attributes.attributes.value;return n.jsx(hn,{openQuestion:t,...a},a.questionId)}if(o.type==="insight"&&((r=o.attributes)==null?void 0:r.attributes.case)==="insight"){const a=o.attributes.attributes.value;return n.jsx(vn,{openInsight:t,...a},a.questionId)}if(o.type==="tweet"&&((l=o.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=o.attributes.attributes.value,d=o.attributes.id;return n.jsx(Cn,{openTweet:t,...a,tweetId:d},d)}return null})}),Tn=({store:e,openQuestion:t})=>{const o=s.useStore(e);return o!=null&&o.data?n.jsx(An,{openQuestion:t,questions:o.data}):n.jsx("div",{children:"wait questions..."})},bn=({userSummary:e})=>{var t;const[o,i]=p.useState(void 0);return p.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&i(l.data)});return()=>{r()}},[e]),o!=null&&o.summary?n.jsx(oe,{...o.summary,successRate:(t=o.percentage)==null?void 0:t.correct}):n.jsx("div",{children:"wait user..."})},$n=({gamification:e,className:t,scrollStore:o,scrollNode:i,appNode:r,style:l,responsiveStore:a,headerNode:d})=>{const{tabsShown:c}=s.useStore(o,{keys:["tabsShown"]}),[u,h]=p.useState(O.HOME),[,f]=p.useTransition(),{sdkInDesktopView:m}=s.useStore(a,{keys:["sdkInDesktopView"]}),v=x=>{f(()=>{var y;h(x),m===!1&&(((y=r.current)==null?void 0:y.getBoundingClientRect().y)||0)<0&&s.D(r,{behavior:"instant"})})};p.useEffect(()=>o.listen(x=>{if(x.scrollPosition===0){o.setKey("tabsShown",!0);return}o.setKey("tabsShown",x.scrollDirection==="backward")}),[o]);let C="0px";m?C=c?"0px":"calc(8px - var(--header-height) - var(--header-offset))":C=c?"calc(var(--header-height) + var(--header-offset))":"0px";const j=m?r:d;return n.jsxs(s.p,{className:t,style:l,children:[n.jsx(s.C,{style:{top:C},children:n.jsx(jt,{activePage:u,toggleActivePage:v})}),u===O.HOME&&n.jsxs(n.Fragment,{children:[n.jsx(s.n,{style:{paddingTop:"8px"},children:n.jsx(s.m,{children:n.jsx(bn,{userSummary:e.userSummary})})}),n.jsx(s.a,{style:{flex:1},children:n.jsx(Tn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),u===O.LEADERBOARD&&n.jsx(s.l,{children:n.jsx(en,{renderClipBoardNode:j,scrollStore:o,scrollNode:i,gamification:e})})]})},wn=()=>s.l$1,te=s.styled_default(wn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),_n=s.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Sn=({correct:e,incorrect:t})=>{const o=e+t;return o===0?0:Math.round(e/o*100)},Rn=({gamification:e,scrollStore:t,className:o,appNode:i,scrollNode:r,headerNode:l,responsiveStore:a})=>{const d=s.useStore(e.openedQuestion.$store),c=s.useStore(e.openedUser),{sdkInDesktopView:u}=s.useStore(a,{keys:["sdkInDesktopView"]}),h=p.useMemo(()=>{var f;const m=(((f=i.current)==null?void 0:f.getBoundingClientRect().y)||0)<0;if(!i.current||!d&&!c)return null;const v=d?n.jsx(te,{className:o,children:n.jsx(ft,{gamification:e})}):c?n.jsx(te,{className:o,children:n.jsxs(_n,{children:[n.jsx(ne,{label:"Friend's Rank",close:e.closeUser}),n.jsx(s.n,{children:n.jsx(oe,{...c,successRate:Sn(c)})})]})}):null;return s.C$1({Modal:v,container:i,useContainer:!u,fixedView:m})},[i,o,e,d,c,u]);return n.jsxs(n.Fragment,{children:[h,n.jsx($n,{appNode:i,headerNode:l,scrollStore:t,scrollNode:r,className:o,gamification:e,responsiveStore:a})]})};exports.default=Rn;
|
|
1
|
+
"use strict";var ye=Object.defineProperty;var ve=(e,t,o)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var U=(e,t,o)=>(ve(e,typeof t!="symbol"?t+"":t,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("./masters.js"),p=require("react"),xe=s.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ie=s.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),je=()=>s.c1,Ce=s.styled_default(je())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ge=s.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ae=s.styled_default("div")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),Te=()=>s.c1,be=s.styled_default(Te())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:e,close:t,label:o})=>{const i=e?s.o[e]:{label:o,iconName:void 0};return n.jsxs(xe,{children:[n.jsxs(Ie,{children:[(i==null?void 0:i.iconName)&&n.jsx(Ce,{"data-type-trivia":e===s.QuestionType.TRIVIA,"data-type-poll":e===s.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&n.jsx(ge,{children:i.label})]}),n.jsx(Ae,{onClick:t,children:n.jsx(be,{name:"icon-cross"})})]})},$e=s.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=s.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),_e=s.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Y=({indicator:e,title:t})=>n.jsxs($e,{children:[n.jsx(we,{children:t}),n.jsx(_e,{children:e})]}),Se=s.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Re=s.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),ke=s.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:t})=>n.jsxs(Se,{children:[n.jsx(Re,{children:e}),n.jsx(ke,{children:t})]}),Ee=s.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Le=s.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Pe=s.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),qe=s.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Qe=s.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ne=s.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),De=s.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Oe=s.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Me=s.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ve=s.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=s.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ue=s.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),We=s.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Be=s.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),ze=s.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),He=s.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ye=s.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Ze="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",oe=({avatar:e,name:t,points:o,friendsRank:i,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:u})=>n.jsxs(Ee,{children:[n.jsx(Le,{children:n.jsxs(qe,{children:[n.jsxs(Ye,{children:[e&&n.jsx(Qe,{alt:"avatar",src:e}),!e&&n.jsx(He,{children:s.I(t||"")})]}),n.jsxs(Ne,{children:[n.jsx(De,{children:t}),n.jsxs(Oe,{children:[n.jsxs(Ve,{children:[n.jsx(Me,{alt:"rank-icon",src:Ze}),n.jsxs(Fe,{children:[s.s(o),n.jsx(Ue,{children:"PTS"})]})]}),n.jsx(We,{}),n.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),n.jsxs(Pe,{children:[n.jsxs(Be,{children:[n.jsx(Y,{indicator:i||0,title:"Friends rank"}),n.jsx(Y,{indicator:r||0,title:"Global rank"})]}),n.jsxs(ze,{children:[n.jsx(Q,{indicator:l||0,title:"Win streak"}),n.jsx(Q,{indicator:a||0,title:"Correct"}),n.jsx(Q,{indicator:d||0,title:"Incorrect"}),n.jsx(Q,{indicator:`${u||0}%`,title:"Succ. rate"})]})]})]}),Ge=s.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ke=()=>s.c1,Xe=s.styled_default(Ke())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>n.jsx(Ge,{children:n.jsx(Xe,{name:"mastersLogo"})}),es=s.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ss=s.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ts=s.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ns=({title:e,description:t})=>n.jsxs(es,{children:[n.jsx(s.c1,{name:"icon-check-circle"}),n.jsx(ss,{children:e}),n.jsx(ts,{children:t})]}),os=s.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),is=()=>s.c1,rs=s.styled_default(is())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),q=s.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),N=s.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=s.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=s.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),W=s.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ls=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:o,questionType:i,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:u,enteredAnActiveQuestion:h,marketClosed:f})=>{const m=o&&(i===s.QuestionType.TRIVIA||i===s.QuestionType.PREDICTION)&&c&&l!==s.QuestionStatus.RESOLVED,y=i===s.QuestionType.PREDICTION&&!r,C=f&&i===s.QuestionType.PREDICTION&&!o&&!h||i===s.QuestionType.PREDICTION&&u&&c&&h,j=m&&y,x=m&&r,v=i===s.QuestionType.PREDICTION&&o&&c&&r,A=o&&i===s.QuestionType.POLL&&c;if(!a&&!d&&!j&&!x&&!C&&!A&&!v)return null;const g=t?"correct":"incorrect",T=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return n.jsxs(os,{"data-isPrediction":y,children:[a&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(L,{children:"Question Expired"})}),n.jsx(W,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),d&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(L,{children:"Question Closed"})}),n.jsx(W,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),C&&n.jsxs(n.Fragment,{children:[n.jsx(q,{children:n.jsx(s.c1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(N,{children:n.jsx(L,{children:"Question Closed"})}),n.jsx(W,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),j&&n.jsxs(n.Fragment,{children:[n.jsx(rs,{name:"icon-prediction"}),n.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),A&&n.jsxs(n.Fragment,{children:[n.jsx(q,{"data-feedback-type":"correct",children:n.jsx(s.c1,{name:"correct"})}),n.jsx(L,{children:"Thanks for answering. Please stay tuned for the next question."})]}),(x||v)&&n.jsxs(n.Fragment,{children:[n.jsx(q,{"data-feedback-type":g,children:n.jsx(s.c1,{name:g})}),n.jsx("div",{children:n.jsxs(N,{children:[n.jsx(as,{"data-feedback-type":g,children:T==null?void 0:T.title}),n.jsx(L,{children:T==null?void 0:T.description})]})})]})]})},ds=s.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),cs=()=>s.c,us=s.styled_default(cs())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),ps=s.styled_default("div")({name:"Content",class:"c1hq58md",propsAsIs:!1}),hs=s.styled_default("div")({name:"Title",class:"t1c8nxcx",propsAsIs:!1}),ms=s.styled_default("div")({name:"Options",class:"oiozuc3",propsAsIs:!1}),fs=s.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ys=s.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),vs=s.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),xs=s.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Is=s.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ie=s.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),js=()=>ie,Cs=s.styled_default(js())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),gs=()=>ie,As=s.styled_default(gs())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ts=s.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),bs=s.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),$s=s.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),ws=s.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),_s=()=>s.c1,Ss=s.styled_default(_s())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),Z={[s.QuestionImages.CENTERED]:e=>n.jsx(Cs,{alt:"option-icon",src:e}),[s.QuestionImages.TRANSPARENT]:e=>n.jsx(xs,{children:n.jsx(Is,{style:{backgroundImage:`url(${e})`}})}),[s.QuestionImages.ROUNDED]:e=>n.jsx(As,{alt:"option-icon",src:e}),[s.QuestionImages.NONE]:()=>null,[s.QuestionImages.UNSET]:()=>null},Rs=({questionType:e,hasCorrectAnswer:t,correct:o,youVoted:i,questionVoted:r})=>{if(e===s.QuestionType.POLL&&i)return"correct";if(e===s.QuestionType.PREDICTION){if(t&&r)return i?o?"correct":"incorrect":"unset";if(i)return"correct"}return e===s.QuestionType.TRIVIA&&r&&i?o?"correct":"incorrect":"unset"},ks=({questionType:e,questionVoted:t,correct:o,hasCorrectAnswer:i,questionStatus:r})=>e===s.QuestionType.TRIVIA?t&&o:e===s.QuestionType.PREDICTION?t&&o&&i||r===s.QuestionStatus.RESOLVED&&o:!1,Es=e=>{var t;const{id:o,icon:i,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:u,questionVoted:h,imageMode:f,answerTimeExpired:m,questionStatus:y,isLoading:C,questionType:j,correct:x,hasCorrectAnswer:v,votedAfterQuestionClosed:A,enteredAnActiveQuestion:g,marketClosed:T}=e,[S,k]=p.useState(l),R=Rs(e),M=ks({questionType:j,questionVoted:h,correct:x,hasCorrectAnswer:v,questionStatus:y}),I=T&&j===s.QuestionType.PREDICTION,b=h||I,$=j===s.QuestionType.PREDICTION&&!h&&!T,V=h&&!u&&R!=="incorrect";return p.useLayoutEffect(()=>{l>0&&(k(0),requestAnimationFrame(()=>{k(l)}))},[l]),n.jsxs(fs,{value:o,"data-selected":u,"data-answer-state":R,disabled:h||C||m||I&&!g||I&&g&&A,"data-is-not-checked":V,onClick:F=>{c(j===s.QuestionType.PREDICTION?T:y===s.QuestionStatus.RESOLVED),d(F)},children:[n.jsx(ys,{"data-answer-state":R,style:{width:`${b?S:0}%`}}),n.jsxs(vs,{children:[i&&f&&((t=Z[f])==null?void 0:t.call(Z,i)),n.jsx(Ts,{children:r}),$&&n.jsxs("div",{children:[a,n.jsx($s,{children:"pts"})]}),b&&n.jsxs(bs,{children:[M&&n.jsx(Ss,{name:"selected"}),n.jsx(ws,{children:n.jsx(s.d,{value:l,suffix:"%"})})]})]})]})};var G=typeof window>"u"?p.useEffect:p.useLayoutEffect,Ls=({isPlaying:e,duration:t,startAt:o=0,updateInterval:i=0,onComplete:r,onUpdate:l})=>{let[a,d]=p.useState(o),c=p.useRef(0),u=p.useRef(o),h=p.useRef(o*-1e3),f=p.useRef(null),m=p.useRef(null),y=p.useRef(null),C=v=>{let A=v/1e3;if(m.current===null){m.current=A,f.current=requestAnimationFrame(C);return}let g=A-m.current,T=c.current+g;m.current=A,c.current=T;let S=u.current+(i===0?T:(T/i|0)*i),k=u.current+T,R=typeof t=="number"&&k>=t;d(R?t:S),R||(f.current=requestAnimationFrame(C))},j=()=>{f.current&&cancelAnimationFrame(f.current),y.current&&clearTimeout(y.current),m.current=null},x=p.useCallback(v=>{j(),c.current=0;let A=typeof v=="number"?v:o;u.current=A,d(A),e&&(f.current=requestAnimationFrame(C))},[e,o]);return G(()=>{if(l==null||l(a),t&&a>=t){h.current+=t*1e3;let{shouldRepeat:v=!1,delay:A=0,newStartAt:g}=(r==null?void 0:r(h.current/1e3))||{};v&&(y.current=setTimeout(()=>x(g),A*1e3))}},[a,t]),G(()=>(e&&(f.current=requestAnimationFrame(C)),j),[e,t,i]),{elapsedTime:a,reset:x}},Ps=(e,t,o)=>{let i=e/2,r=t/2,l=i-r,a=2*l,d=o==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${i},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},K=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,qs=e=>({position:"relative",width:e,height:e}),Qs={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},re=(e,t,o,i,r)=>{if(i===0)return t;let l=(r?i-e:e)/i;return t+o*l},X=e=>{var t,o;return(o=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?o:[]},Ns=(e,t)=>{var o;let{colors:i,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let a=(o=r==null?void 0:r.findIndex((m,y)=>m>=t&&t>=r[y+1]))!=null?o:-1;if(!r||a===-1)return i[0];if(!l)return i[a];let d=r[a]-t,c=r[a]-r[a+1],u=X(i[a]),h=X(i[a+1]),f=!!e.isGrowing;return`rgb(${u.map((m,y)=>re(d,m,h[y]-m,c,f)|0).join(",")})`},Ds=e=>{let{duration:t,initialRemainingTime:o,updateInterval:i,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:u="clockwise",onComplete:h,onUpdate:f}=e,m=p.useRef(),y=Math.max(l,a??0),{path:C,pathLength:j}=Ps(r,y,u),{elapsedTime:x}=Ls({isPlaying:d,duration:t,startAt:K(t,o),updateInterval:i,onUpdate:typeof f=="function"?A=>{let g=Math.ceil(t-A);g!==m.current&&(m.current=g,f(g))}:void 0,onComplete:typeof h=="function"?A=>{var g;let{shouldRepeat:T,delay:S,newInitialRemainingTime:k}=(g=h(A))!=null?g:{};if(T)return{shouldRepeat:T,delay:S,newStartAt:K(t,k)}}:void 0}),v=t-x;return{elapsedTime:x,path:C,pathLength:j,remainingTime:Math.ceil(v),rotation:u,size:r,stroke:Ns(e,v),strokeDashoffset:re(x,0,j,t,c),strokeWidth:l}},ae=e=>{let{children:t,strokeLinecap:o,trailColor:i,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:u,elapsedTime:h,size:f,strokeWidth:m}=Ds(e);return p.createElement("div",{style:qs(f)},p.createElement("svg",{viewBox:`0 0 ${f} ${f}`,width:f,height:f,xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:r??m}),p.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:o??"round",strokeWidth:m,strokeDasharray:a,strokeDashoffset:c})),typeof t=="function"&&p.createElement("div",{style:Qs},t({remainingTime:u,elapsedTime:h,color:d})))};ae.displayName="CountdownCircleTimer";const Os=[s.E.PRIMARY_GREEN1,s.E.SECONDARY_RED1,s.E.SECONDARY_RED1,s.E.NEUTRALS_GRAY3],Ms=[10,10,1,0],Vs=s.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Fs=s.E.SECONDARY_GREEN6,J=s.E.SECONDARY_RED3,Us=s.E.NEUTRALS_GRAY3,Ws=({isPlaying:e=!0,duration:t=30,onTimerExpired:o})=>{const[i,r]=p.useState(t>10?Fs:J),l=({remainingTime:c})=>n.jsx(Vs,{children:c}),a=p.useCallback(()=>{o==null||o(),r(Us)},[o,r]),d=p.useCallback(c=>{c===10&&r(J)},[r]);return n.jsx(ae,{isPlaying:e,duration:t,colors:Os,colorsTime:Ms,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:a,onUpdate:d,children:l})},Bs=s.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),zs=s.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Hs=s.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Ys=()=>s.c1,Zs=s.styled_default(Ys())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Gs=s.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ks=s.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Xs=s.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Js=({title:e,points:t,isPlayingTimer:o,isTimer:i,animatePoints:r,questionType:l,timerDuration:a,onTimerExpired:d})=>n.jsxs(Bs,{style:{justifyContent:l===s.QuestionType.PREDICTION?"center":"space-between"},children:[n.jsxs(zs,{children:[e&&n.jsx(Hs,{children:e}),t!==void 0&&l!==s.QuestionType.POLL&&n.jsxs(n.Fragment,{children:[n.jsx(Zs,{name:"icon-trophy"}),n.jsxs(Gs,{children:[n.jsx(Ks,{children:r?n.jsx(s.d,{value:t,delay:.3}):t}),n.jsx(Xs,{children:"PTS"})]})]})]}),i&&l!==s.QuestionType.PREDICTION&&n.jsx(Ws,{isPlaying:o,onTimerExpired:d,duration:a})]}),et=({openedQuestion:e,isLoading:t,vote:o,close:i})=>{var r,l;const a=e.subject,d=e.type,c=e.status,u=(r=e.options)==null?void 0:r.options,h=e.marketClosed,[f,m]=p.useState(!1),[y,C]=p.useState(!1),[j,x]=p.useState(!0),[v,A]=p.useState(!1),[g,T]=p.useState(""),S=e==null?void 0:e.id;p.useEffect(()=>{d===s.QuestionType.PREDICTION?h&&x(!1):c===s.QuestionStatus.RESOLVED&&x(!1)},[]);const k=p.useCallback(w=>{C(w),m(!0)},[]),R=p.useCallback(async w=>{if(S){const P=w.currentTarget.value;T(P),await o(S,P)}},[S,T,o]),M=p.useCallback(()=>{A(!0),setTimeout(i,3e3)},[i]),I=p.useMemo(()=>e==null?void 0:e.answers.find(w=>w.youVoted===!0),[e]),b=p.useMemo(()=>!!(e!=null&&e.answers.find(w=>w.correct===!0)),[e]),$=p.useMemo(()=>e==null?void 0:e.answers.find(w=>w.correct===!0),[e]),V=p.useMemo(()=>e?e.answers.map(w=>{var P;return{...w,questionVoted:!!I,youSelected:g===w.id,isLoading:t,hasCorrectAnswer:b,questionType:e.type,answerTimeExpired:v,questionStatus:c,imageMode:(P=e.appearance)==null?void 0:P.images,onVote:R}}):[],[b,v,t,e,I,c,R,g]),F=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0,E=c===s.QuestionStatus.RESOLVED&&d===s.QuestionType.TRIVIA&&!I&&!j,z=d===s.QuestionType.TRIVIA&&y&&f&&j,H=p.useMemo(()=>d===s.QuestionType.PREDICTION?!!(I&&!b||I&&b&&$!=null&&$.youVoted):!0,[d,I,b,$]),pe=p.useMemo(()=>{if(d===s.QuestionType.PREDICTION&&I&&(!b||b&&$!=null&&$.youVoted))return I.points;if(!(E||v))return c===s.QuestionStatus.RESOLVED?0:I?I.correct?I.points:0:$==null?void 0:$.points},[v,I,$,c,E,d,b]),he=p.useMemo(()=>d===s.QuestionType.PREDICTION&&I?b?b&&$!=null&&$.youVoted?"You won":"":"To win":E||v?"Time expired":d===s.QuestionType.POLL?"Time remaining":I?"You won":"To win",[v,d,I,E,b,$]),me=(d===s.QuestionType.TRIVIA||d===s.QuestionType.PREDICTION)&&I&&b&&($==null?void 0:$.youVoted),fe=I||E||z||d===s.QuestionType.TRIVIA&&c===s.QuestionStatus.RESOLVED&&j;return n.jsx(us,{children:n.jsx(ds,{children:n.jsxs(ps,{children:[n.jsx(ls,{feedbackMessages:F,questionVoted:!!I,questionVotedCorrectly:I==null?void 0:I.correct,questionType:d,hasCorrectAnswer:b,questionStatus:c,showExpiredNotification:E,showClosedNotificationTrivia:z,votedInCurrentRender:f,votedAfterQuestionClosed:y,enteredAnActiveQuestion:j,marketClosed:h}),H&&n.jsx(Js,{title:he,points:pe,onTimerExpired:M,questionType:e.type,isTimer:!t,isPlayingTimer:!I,animatePoints:me,timerDuration:fe?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),v?n.jsx(ns,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):n.jsxs(n.Fragment,{children:[n.jsx(hs,{style:H?{}:{marginTop:0},children:a}),n.jsx(ms,{children:V.map(w=>n.jsx(Es,{...w,markThatVoted:k,votedAfterQuestionClosed:y,enteredAnActiveQuestion:j,marketClosed:h},w.id))})]})]})})})},st=s.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),tt=s.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),nt=s.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ot=s.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),it=s.styled_default("img")({name:"Image",class:"id3lh3p",propsAsIs:!1}),le=({instantView:e,isDetail:t,notification:o})=>{const i=e==null?void 0:e.heading,r=e==null?void 0:e.body,l=i||r,a=o==null?void 0:o.title,d=o==null?void 0:o.body;return n.jsxs(st,{children:[(e==null?void 0:e.video)&&n.jsx(s.H,{source:e.video.url,poster:e.video.thumbnailUrl}),(e==null?void 0:e.image)&&!(e!=null&&e.video)&&n.jsx(it,{src:e==null?void 0:e.image}),n.jsxs(tt,{children:[n.jsx(nt,{children:t&&l?i:a}),n.jsx(ot,{children:t&&l?r:d})]})]})},rt=s.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),at=s.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),lt=({instantView:e,...t})=>n.jsxs(rt,{children:[n.jsx(le,{instantView:e,...t,isDetail:!0}),(e==null?void 0:e.webLink)&&n.jsxs(at,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,n.jsx(s.c1,{name:"icon-external-link"})]})]}),dt=s.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),ct=s.styled_default("blockquote")({name:"Quote",class:"qb4q22c",propsAsIs:!1}),ut=e=>n.jsxs(dt,{children:[e.title&&n.jsx(ct,{children:e.title}),n.jsx(s.G,{...e,isDetail:!0})]}),pt=s.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),ht=({openedQuestion:e})=>{var t,o;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?n.jsx(lt,{...e.attributes.attributes.value}):((o=e==null?void 0:e.attributes)==null?void 0:o.attributes.case)==="tweet"?n.jsx(ut,{...e.attributes.attributes.value}):null},mt=({extendedQuestion:e,vote:t,close:o})=>{const{loading:i,data:r}=e;return r?n.jsx(et,{vote:t,close:o,openedQuestion:r,isLoading:!!i}):null},ft=({gamification:e})=>{var t;const o=s.useStore(e.openedQuestion.$store),i=s.useStore(e.openedQuestion.$extendedStore);if(!o)return null;const r=o.type;return n.jsxs(pt,{children:[n.jsx(ne,{close:e.closeQuestion,type:((t=o.attributes)==null?void 0:t.type)||s.QuestionType.UNSET}),r==="question"&&n.jsx(mt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&n.jsx(ht,{openedQuestion:o}),n.jsx(Je,{sponsorLogo:""})]})},yt=s.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),vt=s.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),xt=s.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),It=s.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var O=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(O||{});const ee=({title:e,active:t,onClick:o})=>n.jsx(xt,{onClick:o,"data-selected":t,children:n.jsx(It,{children:e})}),jt=({activePage:e="home",toggleActivePage:t})=>n.jsx(yt,{children:n.jsxs(vt,{"data-position":e==="home"?"left":"right",children:[n.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),n.jsx(ee,{title:"Friends",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})}),Ct=s.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),gt=s.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),At=s.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Tt=s.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),bt=s.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),$t=()=>s.c1,wt=s.styled_default($t())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),_t="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e",St=({title:e,description:t,onClick:o,className:i})=>n.jsxs(Ct,{onClick:o,className:i,children:[n.jsx(gt,{alt:"friends-icon",src:_t}),n.jsxs(At,{children:[n.jsx(Tt,{children:e}),n.jsx(bt,{children:t})]}),n.jsx(wt,{name:"icon-copy"})]});function Rt(e){var t=e.lastRenderedStartIndex,o=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>o||r<t)}function kt(e){for(var t=e.isItemLoaded,o=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,u=r;u<=l;u++){var h=t(u);h?c!==null&&(a.push(d,c),d=c=null):(c=u,d===null&&(d=u))}if(c!==null){for(var f=Math.min(Math.max(c,d+i-1),o-1),m=c+1;m<=f&&!t(m);m++)c=m;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<i&&a[0]>0;){var y=a[0]-1;if(!t(y))a[0]=y;else break}return a}var Et=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Lt=function(){function e(t,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Pt=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},se=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e};(function(e){Pt(t,e);function t(){var o,i,r,l;Et(this,t);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(i=(r=se(this,(o=t.__proto__||Object.getPrototypeOf(t)).call.apply(o,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(u){var h=u.visibleStartIndex,f=u.visibleStopIndex;r._lastRenderedStartIndex=h,r._lastRenderedStopIndex=f,r._ensureRowsLoaded(h,f)},r._setRef=function(u){r._listRef=u},i),se(r,l)}return Lt(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,u=c===void 0?10:c,h=l.threshold,f=h===void 0?15:h,m=kt({isItemLoaded:a,itemCount:d,minimumBatchSize:u,startIndex:Math.max(0,i-f),stopIndex:Math.min(d-1,r+f)});(this._memoizedUnloadedRanges.length!==m.length||this._memoizedUnloadedRanges.some(function(y,C){return m[C]!==y}))&&(this._memoizedUnloadedRanges=m,this._loadUnloadedRanges(m))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var h=i[u],f=i[u+1],m=l(h,f);m!=null&&m.then(function(){if(Rt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:h,stopIndex:f})){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<i.length;d+=2)a(d)}}]),t})(p.PureComponent);const qt=s.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Qt=s.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Nt=s.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Dt=s.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ot=s.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Mt=s.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Vt=s.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Ft=()=>s.c1,Ut=s.styled_default(Ft())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var de={exports:{}},Wt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Bt=Wt,zt=Bt;function ce(){}function ue(){}ue.resetWarningCache=ce;var Ht=function(){function e(i,r,l,a,d,c){if(c!==zt){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ue,resetWarningCache:ce};return o.PropTypes=o,o};de.exports=Ht();var Yt=de.exports;const _=s.getDefaultExportFromCjs(Yt);class B extends p.Component{constructor(t){super(t),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 t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const o={get passive(){t=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const o=this.props.getScrollParent&&this.props.getScrollParent();return o??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let o=window;this.props.useWindow===!1&&(o=t),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,o=window,i=this.getParentElement(t);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=o.pageYOffset!==void 0?o.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(t,a)}else this.props.isReverse?r=i.scrollTop:r=t.scrollHeight-i.scrollTop-i.clientHeight;r<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=i.scrollHeight,this.beforeScrollTop=i.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,o){return t?this.calculateTopPosition(t)+(t.offsetHeight-o-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:o,element:i,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:u,ref:h,threshold:f,useCapture:m,useWindow:y,getScrollParent:C,...j}=t;j.ref=v=>{this.scrollComponent=v,h&&h(v)};const x=[o];return r&&(d?a?x.unshift(d):x.push(d):this.defaultLoader&&(a?x.unshift(this.defaultLoader):x.push(this.defaultLoader))),p.createElement(i,j,x)}}U(B,"propTypes",{children:_.node.isRequired,element:_.node,hasMore:_.bool,initialLoad:_.bool,isReverse:_.bool,loader:_.node,loadMore:_.func.isRequired,pageStart:_.number,ref:_.func,getScrollParent:_.func,threshold:_.number,useCapture:_.bool,useWindow:_.bool}),U(B,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Zt=({rank:e,avatar:t,name:o,points:i,isCurrentUser:r,openItemDetail:l,style:a})=>n.jsxs(qt,{onClick:l,style:a,children:[n.jsx(Qt,{children:e||0}),n.jsxs(Ot,{children:[t?n.jsx(Nt,{alt:"leaderboard-item-avatar",src:t}):n.jsx(Dt,{children:s.I(o||"")}),n.jsxs(Mt,{children:[n.jsx(Vt,{children:o||""}),r&&n.jsx(Ut,{name:"icon-star"})]})]}),n.jsx("div",{children:s.s(i)})]}),Gt=s.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Kt=({items:e,currentUserId:t,openItemDetail:o,fetchMore:i,scrollNode:r,hasMore:l})=>n.jsx(B,{loadMore:i,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:n.jsx(Gt,{children:e.map(a=>n.jsx(Zt,{...a,openItemDetail:()=>o(a.userId),isCurrentUser:!!t&&t===a.userId},a.userId))})}),Xt=({renderClipBoardNode:e,deepLink:t})=>n.jsx(s.F,{renderToNode:e,inviteLink:t,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."}),Jt=s.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),en=({gamification:e,scrollNode:t,scrollStore:o,renderClipBoardNode:i})=>{const{data:r,hasMore:l,loading:a,key:d}=s.useStore(e.leaderboardList.$store),{data:c}=s.useStore(e.deepLink.$store),[u,h]=s.h(i);return!r.length&&!a?n.jsx(Xt,{renderClipBoardNode:i,deepLink:c}):n.jsxs(n.Fragment,{children:[n.jsx(Kt,{items:r,scrollNode:t,scrollStore:o,fetchMore:e.leaderboardList.fetchMore,hasMore:l,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()},d),c&&n.jsx(Jt,{children:n.jsx(St,{onClick:()=>u(c),title:"Invite Friends",description:"Challenge them now!"})}),h]})},sn=s.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),tn=s.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),nn=s.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),on=s.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),rn=()=>s.c1,D=s.styled_default(rn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),an=()=>s.c1,ln=s.styled_default(an())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),dn=s.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),cn=s.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),un=s.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),pn={[s.PickHistoryStatus.LOST]:n.jsx(D,{name:"incorrectVoted"}),[s.PickHistoryStatus.WON]:n.jsx(D,{name:"icon-check"}),[s.PickHistoryStatus.UNSET]:n.jsx(D,{name:"icon-arrow"}),[s.PickHistoryStatus.DNP]:n.jsx(D,{name:"icon-arrow"})},hn=({questionId:e,questionType:t,questionStatus:o,subject:i,openForVoting:r,openQuestion:l,status:a})=>{const d=s.o[t],c=pn[a];return d?n.jsxs(sn,{onClick:()=>l==null?void 0:l(e),children:[n.jsxs(cn,{children:[n.jsxs(tn,{children:[n.jsx(ln,{"data-type-trivia":t===s.QuestionType.TRIVIA,"data-type-poll":t===s.QuestionType.POLL,name:d.iconName}),n.jsxs(dn,{children:[d.label,t===s.QuestionType.TRIVIA&&o===s.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(nn,{children:i||""})]}),n.jsx(on,{children:r?n.jsx(un,{children:"Play"}):c})]}):null},mn=s.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),fn=s.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),yn=({openInsight:e,questionId:t,...o})=>n.jsxs(mn,{children:[n.jsx(le,{questionId:t,...o}),e&&n.jsx(fn,{onClick:()=>e(t),children:"View Insight"})]}),vn=s.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),xn=()=>s.c$1,In=s.styled_default(xn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),jn=s.styled_default("blockquote")({name:"Quote",class:"q1hbaleq",propsAsIs:!1}),Cn=({openTweet:e,...t})=>n.jsxs(vn,{children:[t.title&&n.jsx(jn,{children:t.title}),n.jsx(s.G,{...t}),e&&n.jsx(In,{onClick:()=>e(t.tweetId),children:"View Insight"})]}),gn=s.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),An=({questions:e,openQuestion:t})=>n.jsx(gn,{children:e==null?void 0:e.map(o=>{var i,r,l;if(o.type==="question"&&((i=o.attributes)==null?void 0:i.attributes.case)==="question"){const a=o.attributes.attributes.value;return n.jsx(hn,{openQuestion:t,...a},a.questionId)}if(o.type==="insight"&&((r=o.attributes)==null?void 0:r.attributes.case)==="insight"){const a=o.attributes.attributes.value;return n.jsx(yn,{openInsight:t,...a},a.questionId)}if(o.type==="tweet"&&((l=o.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=o.attributes.attributes.value,d=o.attributes.id;return n.jsx(Cn,{openTweet:t,...a,tweetId:d},d)}return null})}),Tn=({store:e,openQuestion:t})=>{const o=s.useStore(e);return o!=null&&o.data?n.jsx(An,{openQuestion:t,questions:o.data}):n.jsx("div",{children:"wait questions..."})},bn=({userSummary:e})=>{var t;const[o,i]=p.useState(void 0);return p.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&i(l.data)});return()=>{r()}},[e]),o!=null&&o.summary?n.jsx(oe,{...o.summary,successRate:(t=o.percentage)==null?void 0:t.correct}):n.jsx("div",{children:"wait user..."})},$n=({gamification:e,className:t,scrollStore:o,scrollNode:i,appNode:r,style:l,responsiveStore:a,headerNode:d})=>{const{tabsShown:c}=s.useStore(o,{keys:["tabsShown"]}),[u,h]=p.useState(O.HOME),[,f]=p.useTransition(),{sdkInDesktopView:m}=s.useStore(a,{keys:["sdkInDesktopView"]}),y=x=>{f(()=>{var v;h(x),m===!1&&(((v=r.current)==null?void 0:v.getBoundingClientRect().y)||0)<0&&s.C$1(r,{behavior:"instant"})})};p.useEffect(()=>o.listen(x=>{if(x.scrollPosition===0){o.setKey("tabsShown",!0);return}a.get().sdkInDesktopView?o.setKey("tabsShown",x.scrollDirection==="backward"):o.setKey("tabsShown",x.scrollDirection==="forward")}),[o,a]);let C="0px";m?C=c?"0px":"calc(8px - var(--header-height) - var(--header-offset))":C=c?"calc(var(--header-height) + var(--header-offset) - 2px)":"0px";const j=m?r:d;return n.jsxs(s.p,{className:t,style:l,children:[n.jsx(s.C,{style:{top:C},children:n.jsx(jt,{activePage:u,toggleActivePage:y})}),u===O.HOME&&n.jsxs(n.Fragment,{children:[n.jsx(s.n,{style:{paddingTop:"8px"},children:n.jsx(s.m,{children:n.jsx(bn,{userSummary:e.userSummary})})}),n.jsx(s.a,{style:{flex:1},children:n.jsx(Tn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),u===O.LEADERBOARD&&n.jsx(s.l,{children:n.jsx(en,{renderClipBoardNode:j,scrollStore:o,scrollNode:i,gamification:e})})]})},wn=()=>s.l$1,te=s.styled_default(wn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),_n=s.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Sn=({correct:e,incorrect:t})=>{const o=e+t;return o===0?0:Math.round(e/o*100)},Rn=({gamification:e,scrollStore:t,className:o,appNode:i,scrollNode:r,headerNode:l,responsiveStore:a})=>{const d=s.useStore(e.openedQuestion.$store),c=s.useStore(e.openedUser),{sdkInDesktopView:u}=s.useStore(a,{keys:["sdkInDesktopView"]}),h=p.useMemo(()=>{var f;const m=(((f=i.current)==null?void 0:f.getBoundingClientRect().y)||0)<0;if(!i.current||!d&&!c)return null;const y=d?n.jsx(te,{className:o,children:n.jsx(ft,{gamification:e})}):c?n.jsx(te,{className:o,children:n.jsxs(_n,{children:[n.jsx(ne,{label:"Friend's Rank",close:e.closeUser}),n.jsx(s.n,{children:n.jsx(oe,{...c,successRate:Sn(c)})})]})}):null;return s.C$2({Modal:y,container:i,useContainer:!u,fixedView:m})},[i,o,e,d,c,u]);return n.jsxs(n.Fragment,{children:[h,n.jsx($n,{appNode:i,headerNode:l,scrollStore:t,scrollNode:r,className:o,gamification:e,responsiveStore:a})]})};exports.default=Rn;
|