@streamlayer/react 0.30.6 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index3.js +1 -1
- package/lib/cjs/index4.js +1 -0
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +18 -17
- package/lib/dist/es/gamification-feature.js +429 -425
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +1929 -1544
- package/lib/es/gamification-feature.js +277 -272
- package/lib/es/index3.js +6 -148
- package/lib/es/index4.js +151 -0
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +1 -1
- package/lib/es/points.js +12 -11
- package/package.json +11 -10
- package/lib/cjs/common.js +0 -1
- package/lib/es/common.js +0 -15
package/lib/cjs/masters2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),T=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index3.js"),fe=require("@streamlayer/sdk-web-notifications"),Ut=require("@lottiefiles/react-lottie-player"),zt=({feature:o,sdk:a,children:c,className:h})=>{const m=X.useStore(o.status),y=X.useStore(a.sdkStore.slStreamId);return y!=null&&y.loading?n.jsx("div",{className:h,children:"event is loading..."}):y!=null&&y.data?m!==de.FeatureStatus.Ready?n.jsx("div",{className:h,children:"wait feature..."}):c:n.jsx("div",{className:h,children:"event is forbidden..."})},Ot=T.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Dt=({sdk:o,feature:a,className:c})=>{const h=T.useMemo(()=>a&&a.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(zt,{className:c,sdk:o,feature:a,children:n.jsx(Ot,{className:c,gamification:a,sdk:o})}):null,[o,a,c]);return n.jsx(T.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:h})},Pt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),qt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Mt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),$e=({disabled:o,active:a,onClick:c,label:h,icon:m})=>n.jsx(Pt,{onClick:c,disabled:o,"data-selected":a,children:n.jsxs(n.Fragment,{children:[m&&n.jsx(qt,{children:m}),n.jsx(Mt,{children:h})]})}),Gt=()=>d.i1,Wt=d.styled_default(Gt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Ht=o=>{var a;return n.jsx($e,{...o,id:"channels",label:"Channels",icon:n.jsx(Wt,{name:"icon-btn-channels","data-selected":(a=o.active)==null?void 0:a.toString()})})},Qt=()=>d.i1,Yt=d.styled_default(Qt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Vt=o=>{var a;return n.jsx($e,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Yt,{name:"icon-btn-feature-groups","data-selected":(a=o.active)==null?void 0:a.toString()})})},Kt=()=>d.i1,Xt=d.styled_default(Kt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Jt=o=>{var a;return n.jsx($e,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Xt,{name:"icon-btn-leaderboard","data-selected":(a=o.active)==null?void 0:a.toString()})})},Zt=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ei=({children:o,className:a})=>n.jsx(Zt,{className:a,children:o}),ti=()=>ei,ii=d.styled_default(ti())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),ri=({activeOverlay:o,setActiveOverlay:a,sdkReady:c,className:h})=>n.jsxs(ii,{className:h,children:[n.jsx(Ht,{active:o===le,onClick:()=>a(le)}),n.jsx(Vt,{active:o===J,disabled:!c,onClick:()=>{a(J)}}),n.jsx(Jt,{active:o===xe,onClick:()=>a(xe)})]}),lt={[U.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.UNSET]:void 0,[U.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[U.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[U.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},ni=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),si=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),oi=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),ai=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),ct=({poster:o,source:a})=>{const c=T.useRef(null),[h,m]=T.useState(!1),[y,f]=T.useState(!0);return n.jsxs(ni,{onClick:()=>{const s=c==null?void 0:c.current;s&&m(g=>g?(s.pause(),!1):(s.play(),f(!1),!0))},children:[n.jsx(si,{ref:c,src:a,onEnded:()=>{var s;(s=c==null?void 0:c.current)==null||s.load(),m(!1),f(!0)},style:{visibility:y?"hidden":"visible"}}),n.jsx(oi,{src:o,style:{visibility:y?"visible":"hidden"}}),n.jsx(ai,{children:!h&&n.jsx(d.i1,{name:"icon-play"})})]})},li=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ci=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),ui=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),di=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),hi=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),pi=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),fi=({video:o,image:a,heading:c,body:h,action:m})=>n.jsxs(li,{children:[(o==null?void 0:o.url)&&n.jsx(ct,{source:o.url,poster:o.thumbnailUrl}),a&&n.jsx(ci,{src:a}),n.jsxs(ui,{children:[n.jsx(di,{children:c}),n.jsx(hi,{children:h}),m&&n.jsx(pi,{onClick:m,children:"View Insight"})]})]}),ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),mi=()=>O,yi=d.styled_default(mi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),xi=()=>O,gi=d.styled_default(xi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),wi=()=>O,_i=d.styled_default(wi())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),Ii=()=>O,Ye=d.styled_default(Ii())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Ai=()=>O,Ve=d.styled_default(Ai())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),bi=()=>O,Ke=d.styled_default(bi())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Ei=()=>O,Xe=d.styled_default(Ei())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Bi=()=>O,Je=d.styled_default(Bi())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),ji=()=>O,Ze=d.styled_default(ji())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),vi=()=>O,et=d.styled_default(vi())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),Ti=()=>O,Ci=d.styled_default(Ti())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Fi=()=>O,Si=d.styled_default(Fi())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),$i=()=>O,ki=d.styled_default($i())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),Li=()=>O,Ni=d.styled_default(Li())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Ri=({step:o,correct:a})=>n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(yi,{}),n.jsx(gi,{}),n.jsx(_i,{})]}),n.jsxs(ie,{"data-active":o===2,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),n.jsxs(ie,{"data-active":o===3,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),a?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]}),n.jsxs(ie,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]})]}):n.jsxs(ie,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ci,{}),n.jsx(Si,{}),n.jsx(ki,{}),n.jsx(Ni,{})]})]}),Ui=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),zi=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),Oi=()=>he,tt=d.styled_default(Oi())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),me=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),Di=()=>d.i1,Ae=d.styled_default(Di())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Pi=()=>d.i1,rt=d.styled_default(Pi())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),qi=({close:o,votedAnswer:a,correct:c,correctAnswerTitle:h})=>{const[m,y]=T.useState(1);return T.useEffect(()=>{const f=setInterval(()=>{y(s=>c&&s>4||!c&&s>3?s:++s)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Ui,{"data-bg-color-white":m>3,children:[n.jsx(Ri,{step:m,correct:c}),n.jsxs(zi,{"data-active-number":m,children:[n.jsxs(re,{children:[n.jsx(ne,{children:"Master"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]}),n.jsxs(re,{"data-color-green":"true",children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",a==null?void 0:a.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]})]}):n.jsxs(re,{children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",h,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]})]})]})},Mi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),Gi=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Wi=()=>d.i1,Hi=d.styled_default(Wi())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Qi=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Yi=()=>d.i1,Vi=d.styled_default(Yi())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Ki=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Xi=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Ji=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Zi=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),er=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),tr=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),ir=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),rr=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),nr=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),sr=({image:o,name:a,userName:c,verified:h})=>n.jsxs(Zi,{children:[n.jsx(er,{children:n.jsx(tr,{src:o})}),n.jsxs(ir,{children:[n.jsxs(rr,{children:[a," ",h&&n.jsx(d.i1,{name:"icon-twitter-verified"})]}),n.jsx(nr,{children:c})]})]}),or=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),ar=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),lr=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),cr=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),ur=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),dr=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),hr=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),pr=({account:o,body:a,image:c,title:h,action:m})=>n.jsxs(or,{children:[n.jsx(dr,{children:n.jsx(hr,{children:h})}),n.jsxs(ur,{children:[n.jsx(sr,{...o}),n.jsx(lr,{children:a}),c&&n.jsx(cr,{src:c})]}),m&&n.jsx(ar,{onClick:m,children:"View Tweet"})]}),nt=({close:o,action:a,data:{questionType:c,question:h,insight:m,tweet:y}})=>{const f=lt[c];return f?h!=null&&h.predictionResult?n.jsx(qi,{close:o,...h}):n.jsxs(Mi,{children:[n.jsx(Gi,{onClick:o,children:n.jsx(Hi,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Qi,{children:[n.jsx(Vi,{name:f.iconName}),n.jsx(Ki,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(fi,{...m,action:a}),c===U.QuestionType.TWEET&&n.jsx(pr,{...y,action:a}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Xi,{children:h==null?void 0:h.title}),n.jsx(Ji,{onClick:a,children:"Answer"})]})]}):null};var ut={},dt={},ge={};ge.byteLength=yr;ge.toByteArray=gr;ge.fromByteArray=Ir;var H=[],P=[],fr=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,mr=be.length;se<mr;++se)H[se]=be[se],P[be.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ht(o){var a=o.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=a);var h=c===a?0:4-c%4;return[c,h]}function yr(o){var a=ht(o),c=a[0],h=a[1];return(c+h)*3/4-h}function xr(o,a,c){return(a+c)*3/4-c}function gr(o){var a,c=ht(o),h=c[0],m=c[1],y=new fr(xr(o,h,m)),f=0,s=m>0?h-4:h,g;for(g=0;g<s;g+=4)a=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],y[f++]=a>>16&255,y[f++]=a>>8&255,y[f++]=a&255;return m===2&&(a=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,y[f++]=a&255),m===1&&(a=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,y[f++]=a>>8&255,y[f++]=a&255),y}function wr(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function _r(o,a,c){for(var h,m=[],y=a;y<c;y+=3)h=(o[y]<<16&16711680)+(o[y+1]<<8&65280)+(o[y+2]&255),m.push(wr(h));return m.join("")}function Ir(o){for(var a,c=o.length,h=c%3,m=[],y=16383,f=0,s=c-h;f<s;f+=y)m.push(_r(o,f,f+y>s?s:f+y));return h===1?(a=o[c-1],m.push(H[a>>2]+H[a<<4&63]+"==")):h===2&&(a=(o[c-2]<<8)+o[c-1],m.push(H[a>>10]+H[a>>4&63]+H[a<<2&63]+"=")),m.join("")}var ke={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ke.read=function(o,a,c,h,m){var y,f,s=m*8-h-1,g=(1<<s)-1,E=g>>1,A=-7,j=c?m-1:0,x=c?-1:1,w=o[a+j];for(j+=x,y=w&(1<<-A)-1,w>>=-A,A+=s;A>0;y=y*256+o[a+j],j+=x,A-=8);for(f=y&(1<<-A)-1,y>>=-A,A+=h;A>0;f=f*256+o[a+j],j+=x,A-=8);if(y===0)y=1-E;else{if(y===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,h),y=y-E}return(w?-1:1)*f*Math.pow(2,y-h)};ke.write=function(o,a,c,h,m,y){var f,s,g,E=y*8-m-1,A=(1<<E)-1,j=A>>1,x=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=h?0:y-1,_=h?1:-1,b=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(s=isNaN(a)?1:0,f=A):(f=Math.floor(Math.log(a)/Math.LN2),a*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+j>=1?a+=x/g:a+=x*Math.pow(2,1-j),a*g>=2&&(f++,g/=2),f+j>=A?(s=0,f=A):f+j>=1?(s=(a*g-1)*Math.pow(2,m),f=f+j):(s=a*Math.pow(2,j-1)*Math.pow(2,m),f=0));m>=8;o[c+w]=s&255,w+=_,s/=256,m-=8);for(f=f<<m|s,E+=m;E>0;o[c+w]=f&255,w+=_,f/=256,E-=8);o[c+w-_]|=b*128};/*!
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),T=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index4.js"),fe=require("@streamlayer/sdk-web-notifications"),Ut=require("@lottiefiles/react-lottie-player"),zt=({feature:o,sdk:a,children:c,className:h})=>{const m=X.useStore(o.status),y=X.useStore(a.sdkStore.slStreamId);return y!=null&&y.loading?n.jsx("div",{className:h,children:"event is loading..."}):y!=null&&y.data?m!==de.FeatureStatus.Ready?n.jsx("div",{className:h,children:"wait feature..."}):c:n.jsx("div",{className:h,children:"event is forbidden..."})},Ot=T.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Dt=({sdk:o,feature:a,className:c})=>{const h=T.useMemo(()=>a&&a.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(zt,{className:c,sdk:o,feature:a,children:n.jsx(Ot,{className:c,gamification:a,sdk:o})}):null,[o,a,c]);return n.jsx(T.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:h})},Pt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),qt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Mt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),$e=({disabled:o,active:a,onClick:c,label:h,icon:m})=>n.jsx(Pt,{onClick:c,disabled:o,"data-selected":a,children:n.jsxs(n.Fragment,{children:[m&&n.jsx(qt,{children:m}),n.jsx(Mt,{children:h})]})}),Gt=()=>d.i1,Wt=d.styled_default(Gt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Ht=o=>{var a;return n.jsx($e,{...o,id:"channels",label:"Channels",icon:n.jsx(Wt,{name:"icon-btn-channels","data-selected":(a=o.active)==null?void 0:a.toString()})})},Qt=()=>d.i1,Yt=d.styled_default(Qt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Vt=o=>{var a;return n.jsx($e,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Yt,{name:"icon-btn-feature-groups","data-selected":(a=o.active)==null?void 0:a.toString()})})},Kt=()=>d.i1,Xt=d.styled_default(Kt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Jt=o=>{var a;return n.jsx($e,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Xt,{name:"icon-btn-leaderboard","data-selected":(a=o.active)==null?void 0:a.toString()})})},Zt=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ei=({children:o,className:a})=>n.jsx(Zt,{className:a,children:o}),ti=()=>ei,ii=d.styled_default(ti())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),ri=({activeOverlay:o,setActiveOverlay:a,sdkReady:c,className:h})=>n.jsxs(ii,{className:h,children:[n.jsx(Ht,{active:o===le,onClick:()=>a(le)}),n.jsx(Vt,{active:o===J,disabled:!c,onClick:()=>{a(J)}}),n.jsx(Jt,{active:o===xe,onClick:()=>a(xe)})]}),lt={[U.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.UNSET]:void 0,[U.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[U.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[U.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},ni=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),si=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),oi=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),ai=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),ct=({poster:o,source:a})=>{const c=T.useRef(null),[h,m]=T.useState(!1),[y,f]=T.useState(!0);return n.jsxs(ni,{onClick:()=>{const s=c==null?void 0:c.current;s&&m(g=>g?(s.pause(),!1):(s.play(),f(!1),!0))},children:[n.jsx(si,{ref:c,src:a,onEnded:()=>{var s;(s=c==null?void 0:c.current)==null||s.load(),m(!1),f(!0)},style:{visibility:y?"hidden":"visible"}}),n.jsx(oi,{src:o,style:{visibility:y?"visible":"hidden"}}),n.jsx(ai,{children:!h&&n.jsx(d.i1,{name:"icon-play"})})]})},li=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ci=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),ui=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),di=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),hi=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),pi=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),fi=({video:o,image:a,heading:c,body:h,action:m})=>n.jsxs(li,{children:[(o==null?void 0:o.url)&&n.jsx(ct,{source:o.url,poster:o.thumbnailUrl}),a&&n.jsx(ci,{src:a}),n.jsxs(ui,{children:[n.jsx(di,{children:c}),n.jsx(hi,{children:h}),m&&n.jsx(pi,{onClick:m,children:"View Insight"})]})]}),ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),mi=()=>O,yi=d.styled_default(mi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),xi=()=>O,gi=d.styled_default(xi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),wi=()=>O,_i=d.styled_default(wi())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),Ii=()=>O,Ye=d.styled_default(Ii())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Ai=()=>O,Ve=d.styled_default(Ai())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),bi=()=>O,Ke=d.styled_default(bi())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Ei=()=>O,Xe=d.styled_default(Ei())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Bi=()=>O,Je=d.styled_default(Bi())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),ji=()=>O,Ze=d.styled_default(ji())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),vi=()=>O,et=d.styled_default(vi())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),Ti=()=>O,Ci=d.styled_default(Ti())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Fi=()=>O,Si=d.styled_default(Fi())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),$i=()=>O,ki=d.styled_default($i())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),Li=()=>O,Ni=d.styled_default(Li())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Ri=({step:o,correct:a})=>n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(yi,{}),n.jsx(gi,{}),n.jsx(_i,{})]}),n.jsxs(ie,{"data-active":o===2,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),n.jsxs(ie,{"data-active":o===3,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),a?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]}),n.jsxs(ie,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]})]}):n.jsxs(ie,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ci,{}),n.jsx(Si,{}),n.jsx(ki,{}),n.jsx(Ni,{})]})]}),Ui=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),zi=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),Oi=()=>he,tt=d.styled_default(Oi())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),me=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),Di=()=>d.i1,Ae=d.styled_default(Di())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Pi=()=>d.i1,rt=d.styled_default(Pi())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),qi=({close:o,votedAnswer:a,correct:c,correctAnswerTitle:h})=>{const[m,y]=T.useState(1);return T.useEffect(()=>{const f=setInterval(()=>{y(s=>c&&s>4||!c&&s>3?s:++s)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Ui,{"data-bg-color-white":m>3,children:[n.jsx(Ri,{step:m,correct:c}),n.jsxs(zi,{"data-active-number":m,children:[n.jsxs(re,{children:[n.jsx(ne,{children:"Master"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]}),n.jsxs(re,{"data-color-green":"true",children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",a==null?void 0:a.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]})]}):n.jsxs(re,{children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",h,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(me,{children:a==null?void 0:a.title})]})]})]})]})},Mi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),Gi=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Wi=()=>d.i1,Hi=d.styled_default(Wi())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Qi=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Yi=()=>d.i1,Vi=d.styled_default(Yi())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Ki=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Xi=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Ji=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Zi=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),er=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),tr=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),ir=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),rr=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),nr=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),sr=({image:o,name:a,userName:c,verified:h})=>n.jsxs(Zi,{children:[n.jsx(er,{children:n.jsx(tr,{src:o})}),n.jsxs(ir,{children:[n.jsxs(rr,{children:[a," ",h&&n.jsx(d.i1,{name:"icon-twitter-verified"})]}),n.jsx(nr,{children:c})]})]}),or=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),ar=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),lr=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),cr=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),ur=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),dr=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),hr=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),pr=({account:o,body:a,image:c,title:h,action:m})=>n.jsxs(or,{children:[n.jsx(dr,{children:n.jsx(hr,{children:h})}),n.jsxs(ur,{children:[n.jsx(sr,{...o}),n.jsx(lr,{children:a}),c&&n.jsx(cr,{src:c})]}),m&&n.jsx(ar,{onClick:m,children:"View Tweet"})]}),nt=({close:o,action:a,data:{questionType:c,question:h,insight:m,tweet:y}})=>{const f=lt[c];return f?h!=null&&h.predictionResult?n.jsx(qi,{close:o,...h}):n.jsxs(Mi,{children:[n.jsx(Gi,{onClick:o,children:n.jsx(Hi,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Qi,{children:[n.jsx(Vi,{name:f.iconName}),n.jsx(Ki,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(fi,{...m,action:a}),c===U.QuestionType.TWEET&&n.jsx(pr,{...y,action:a}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Xi,{children:h==null?void 0:h.title}),n.jsx(Ji,{onClick:a,children:"Answer"})]})]}):null};var ut={},dt={},ge={};ge.byteLength=yr;ge.toByteArray=gr;ge.fromByteArray=Ir;var H=[],P=[],fr=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,mr=be.length;se<mr;++se)H[se]=be[se],P[be.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ht(o){var a=o.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=a);var h=c===a?0:4-c%4;return[c,h]}function yr(o){var a=ht(o),c=a[0],h=a[1];return(c+h)*3/4-h}function xr(o,a,c){return(a+c)*3/4-c}function gr(o){var a,c=ht(o),h=c[0],m=c[1],y=new fr(xr(o,h,m)),f=0,s=m>0?h-4:h,g;for(g=0;g<s;g+=4)a=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],y[f++]=a>>16&255,y[f++]=a>>8&255,y[f++]=a&255;return m===2&&(a=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,y[f++]=a&255),m===1&&(a=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,y[f++]=a>>8&255,y[f++]=a&255),y}function wr(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function _r(o,a,c){for(var h,m=[],y=a;y<c;y+=3)h=(o[y]<<16&16711680)+(o[y+1]<<8&65280)+(o[y+2]&255),m.push(wr(h));return m.join("")}function Ir(o){for(var a,c=o.length,h=c%3,m=[],y=16383,f=0,s=c-h;f<s;f+=y)m.push(_r(o,f,f+y>s?s:f+y));return h===1?(a=o[c-1],m.push(H[a>>2]+H[a<<4&63]+"==")):h===2&&(a=(o[c-2]<<8)+o[c-1],m.push(H[a>>10]+H[a>>4&63]+H[a<<2&63]+"=")),m.join("")}var ke={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ke.read=function(o,a,c,h,m){var y,f,s=m*8-h-1,g=(1<<s)-1,E=g>>1,A=-7,j=c?m-1:0,x=c?-1:1,w=o[a+j];for(j+=x,y=w&(1<<-A)-1,w>>=-A,A+=s;A>0;y=y*256+o[a+j],j+=x,A-=8);for(f=y&(1<<-A)-1,y>>=-A,A+=h;A>0;f=f*256+o[a+j],j+=x,A-=8);if(y===0)y=1-E;else{if(y===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,h),y=y-E}return(w?-1:1)*f*Math.pow(2,y-h)};ke.write=function(o,a,c,h,m,y){var f,s,g,E=y*8-m-1,A=(1<<E)-1,j=A>>1,x=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=h?0:y-1,_=h?1:-1,b=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(s=isNaN(a)?1:0,f=A):(f=Math.floor(Math.log(a)/Math.LN2),a*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+j>=1?a+=x/g:a+=x*Math.pow(2,1-j),a*g>=2&&(f++,g/=2),f+j>=A?(s=0,f=A):f+j>=1?(s=(a*g-1)*Math.pow(2,m),f=f+j):(s=a*Math.pow(2,j-1)*Math.pow(2,m),f=0));m>=8;o[c+w]=s&255,w+=_,s/=256,m-=8);for(f=f<<m|s,E+=m;E>0;o[c+w]=f&255,w+=_,f/=256,E-=8);o[c+w-_]|=b*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
package/lib/cjs/points.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("@streamlayer/sdk-web-types"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("@streamlayer/sdk-web-types"),c=require("./index2.js"),p=require("./index3.js"),t=require("./index4.js"),u=require("react");require("react-countup");const m=require("@nanostores/react"),y=require("./app.js");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const S=t.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),x=t.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),f=()=>t.i1,j=t.styled_default(f())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),P=t.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),q=t.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),v=t.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),h=({points:e})=>s.jsxs(S,{className:c.d,children:[s.jsx(x,{children:s.jsx(j,{name:"icon-trophy"})}),s.jsxs(P,{children:[s.jsx(q,{children:"Total points"}),s.jsx(v,{children:s.jsx(p.m,{value:e})})]})]}),b=({userSummary:e})=>{const[n,r]=u.useState(0);return u.useEffect(()=>{const l=e.subscribe(i=>{var a,o;(o=(a=i.data)==null?void 0:a.summary)!=null&&o.points&&r(i.data.summary.points)});return()=>{l()}},[e]),s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(c.s,{children:s.jsx(h,{points:n})})})},g=({sdk:e})=>{if(m.useStore(e.sdkStore.status)!=="ready")return null;const r=e.getFeature(d.FeatureType.GAMES);return r?s.jsx(b,{userSummary:r.userSummary.getStore()}):null},A=()=>{const e=y.useStreamLayer();return e?s.jsx(g,{sdk:e}):null};exports.StreamLayerSDKPoints=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ne=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ae=()=>n.i1,Se=n.styled_default(Ae())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ze=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.i1,Oe=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Te,{children:[s.jsxs(Ne,{children:[(r==null?void 0:r.iconName)&&s.jsx(Se,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(De,{children:r.label})]}),s.jsx(ze,{onClick:t,children:s.jsx(Oe,{name:"icon-cross"})})]})},we=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),_e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(we,{children:[s.jsx(_e,{children:t}),s.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ee=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(be,{children:[s.jsx(Ee,{children:e}),s.jsx($e,{children:t})]}),Le=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Re=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Qe=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Ue=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),qe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),We=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Fe=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Je=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Ke=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Xe=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),et="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",de=({avatar:e,name:t,points:i,friendsRank:r,rank:a,streak:c,correct:l,incorrect:m,inTop:d,successRate:h})=>s.jsxs(Le,{children:[s.jsx(Re,{children:s.jsxs(Ue,{children:[s.jsxs(Xe,{children:[e&&s.jsx(qe,{alt:"avatar",src:e}),!e&&s.jsx(Ke,{children:n.o$1(t||"")})]}),s.jsxs(Pe,{children:[s.jsx(Ye,{children:t}),s.jsxs(We,{children:[s.jsxs(Ve,{children:[s.jsx(Fe,{alt:"rank-icon",src:et}),s.jsxs(Be,{children:[n.i(i),s.jsx(He,{children:"PTS"})]})]}),s.jsx(Ge,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Qe,{children:[s.jsxs(Ze,{children:[s.jsx(V,{indicator:r||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(Je,{children:[s.jsx(C,{indicator:c||0,title:"Win streak"}),s.jsx(C,{indicator:l||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),tt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),st=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),nt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),it=({title:e,description:t})=>s.jsxs(tt,{children:[s.jsx(n.i1,{name:"icon-check-circle"}),s.jsx(st,{children:e}),s.jsx(nt,{children:t})]}),rt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),at=()=>n.i1,ot=n.styled_default(at())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),lt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ct=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),dt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:a,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!a,d=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(rt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx(L,{children:"Question Expired"})}),s.jsx(ct,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(ot,{name:"icon-prediction"}),s.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.i1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(lt,{"data-feedbackType":d,children:h==null?void 0:h.title}),s.jsx(L,{children:h==null?void 0:h.description})]})})]})]})},ut=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),pt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),ft=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ht=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),It=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),yt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),xt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ue=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),jt=()=>ue,Mt=n.styled_default(jt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),vt=()=>ue,Tt=n.styled_default(vt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Nt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),At=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),St=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Dt=()=>n.i1,zt=n.styled_default(Dt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Mt,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(gt,{children:s.jsx(xt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},kt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:a})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&a?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Ot=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||a===n.QuestionStatus.RESOLVED&&i:!1,wt=e=>{var t;const{id:i,icon:r,text:a,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:h,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:o}=e,u=kt(e),p=Ot({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:o,questionStatus:g}),f=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(ht,{value:i,"data-selected":m,"data-answerState":u,disabled:d||I||M,onClick:l,children:[f&&s.jsx(It,{"data-answerState":u,style:{width:`${c}%`}}),s.jsxs(yt,{children:[r&&h&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(Nt,{children:a}),f&&s.jsxs(At,{children:[p&&s.jsx(zt,{name:"selected"}),s.jsxs(St,{children:[c,"%"]})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,_t=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[l,m]=T.useState(i),d=T.useRef(0),h=T.useRef(i),M=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,j=d.current+y;I.current=f,d.current=j;let x=h.current+(r===0?j:(j/r|0)*r),A=h.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{o(),d.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(a==null?void 0:a(M.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,r]),{elapsedTime:l,reset:u}},Ct=(e,t,i)=>{let r=e/2,a=t/2,c=r-a,l=2*c,m=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,bt=e=>({position:"relative",width:e,height:e}),Et={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},pe=(e,t,i,r,a)=>{if(r===0)return t;let c=(a?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,l)=>`#${a}${a}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},$t=(e,t)=>{var i;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=a==null?void 0:a.findIndex((I,v)=>I>=t&&t>=a[v+1]))!=null?i:-1;if(!a||l===-1)return r[0];if(!c)return r[l];let m=a[l]-t,d=a[l]-a[l+1],h=K(r[l]),M=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>pe(m,I,M[v]-I,d,g)|0).join(",")})`},Lt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:h="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:o}=Ct(a,v,h),{elapsedTime:u}=_t({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?f=>{var y;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(y=M(f))!=null?y:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:h,size:a,stroke:$t(e,p),strokeDashoffset:pe(u,0,o,t,d),strokeWidth:c}},me=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:a}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:h,elapsedTime:M,size:g,strokeWidth:I}=Lt(e);return T.createElement("div",{style:bt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Et},t({remainingTime:h,elapsedTime:M,color:m})))};me.displayName="CountdownCircleTimer";const Rt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Qt=[10,10,0],Ut=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Pt=n.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,a]=T.useState(t>10?qt:X),c=({remainingTime:d})=>s.jsx(Ut,{children:d}),l=T.useCallback(()=>{i==null||i(),a(Pt)},[i,a]),m=T.useCallback(d=>{d===10&&a(X)},[a]);return s.jsx(me,{isPlaying:e,duration:t,colors:Rt,colorsTime:Qt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Wt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ft=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Vt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>n.i1,Ht=n.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Gt=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Zt=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:i,isTimer:r,onTimerExpired:a})=>s.jsxs(Wt,{children:[s.jsxs(Ft,{children:[e&&s.jsx(Vt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Gt,{children:[s.jsx(Zt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),r&&s.jsx(Yt,{isPlaying:i,onTimerExpired:a})]}),Xt=({openedQuestion:e,vote:t,close:i})=>{var r;const a=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,d]=T.useState(!1),[h,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async j=>{if(v){const x=j.currentTarget.value;I(x),M(!0),await t(v,x),M(!1)}},[v,I,t]),o=T.useCallback(()=>{d(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!u,youSelected:g===j.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,m,h,e,u,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(ut,{children:s.jsxs(pt,{children:[y&&s.jsx(dt,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(Kt,{title:m?"Time expired":"To win",points:m?void 0:100,onTimerExpired:o,isTimer:!0}),m?s.jsx(it,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:a}),s.jsx(ft,{children:f.map(j=>s.jsx(wt,{...j},j.id))})]})]})})})},es=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),rs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),fe=({created:e,image:t,title:i,instantView:r})=>{const a=T.useMemo(()=>{if(e){const l=new Date(e);if(n.r$1(l))return{date:n.a(l),time:n.n(l)}}return null},[e]),c=(r==null?void 0:r.image)||t;return s.jsxs(es,{children:[a&&s.jsxs(is,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&s.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),c&&s.jsx(rs,{src:c}),s.jsxs(ts,{children:[s.jsx(ss,{children:(r==null?void 0:r.heading)||i}),s.jsx(ns,{children:r==null?void 0:r.body})]})]})},as=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),os=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(as,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(os,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.i1,{name:"icon-external-link"})]})]}),cs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),ds=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ls,{created:e.attributes.created,...e.attributes.attributes.value}):null},us=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:a}=e;return!r&&a?s.jsx(Xt,{vote:t,close:i,openedQuestion:a}):null},ps=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return s.jsxs(cs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),a!=="question"&&s.jsx(ds,{openedQuestion:i})]})},ms=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),fs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),hs=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Is=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(hs,{onClick:i,"data-selected":t,children:s.jsx(Is,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(fs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},q(e,t)}function gs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function xs(e,t){return!!(e===t||se(e)&&se(t))}function js(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!xs(e[i],t[i]))return!1;return!0}function R(e,t){t===void 0&&(t=js);var i,r=[],a,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&i===this&&t(m,r)||(a=e.apply(this,m),c=!0,i=this,r=m),a}return l}var Ms=typeof performance=="object"&&typeof performance.now=="function",ne=Ms?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function vs(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var Ts=150,Ns=function(t,i){return t};function As(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,a=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){gs(I,g);function I(N){var o;return o=g.call(this,N)||this,o._instanceProps=d(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(u,p,f,y){return o.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),o._callOnScroll=void 0,o._callOnScroll=R(function(u,p,f){return o.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:f})}),o._getItemStyle=void 0,o._getItemStyle=function(u){var p=o.props,f=p.direction,y=p.itemSize,j=p.layout,x=o._getItemStyleCache(h&&y,h&&j,h&&f),A;if(x.hasOwnProperty(u))A=x[u];else{var S=i(o.props,u,o._instanceProps),D=a(o.props,u,o._instanceProps),z=f==="horizontal"||j==="horizontal",w=f==="rtl",_=z?S:0;x[u]=A={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(u,p,f){return{}}),o._onScrollHorizontal=function(u){var p=u.currentTarget,f=p.clientWidth,y=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===y)return null;var A=o.props.direction,S=y;if(A==="rtl")switch(ae()){case"negative":S=-y;break;case"positive-descending":S=j-f-y;break}return S=Math.max(0,Math.min(S,j-f)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(u){var p=u.currentTarget,f=p.clientHeight,y=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,y-f));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(u){var p=o.props.outerRef;o._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=vs(o._resetIsScrolling,Ts)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}I.getDerivedStateFromProps=function(o,u){return Ss(o,u),M(o),null};var v=I.prototype;return v.scrollTo=function(o){o=Math.max(0,o),this.setState(function(u){return u.scrollOffset===o?null:{scrollDirection:u.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(o,u){u===void 0&&(u="auto");var p=this.props,f=p.itemCount,y=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,f-1));var x=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,o,u,j,this._instanceProps,x))},v.componentDidMount=function(){var o=this.props,u=o.direction,p=o.initialScrollOffset,f=o.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var o=this.props,u=o.direction,p=o.layout,f=this.state,y=f.scrollOffset,j=f.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var o=this.props,u=o.children,p=o.className,f=o.direction,y=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?Ns:z,_=o.layout,he=o.outerElementType,Ie=o.outerTagName,ye=o.style,ge=o.useIsScrolling,xe=o.width,P=this.state.isScrolling,$=f==="horizontal"||_==="horizontal",je=$?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Me=Y[0],ve=Y[1],W=[];if(S>0)for(var O=Me;O<=ve;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:ge?P:void 0,style:this._getItemStyle(O)}));var F=r(this.props,this._instanceProps);return T.createElement(he||Ie||"div",{className:p,onScroll:je,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:xe,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ye)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:$?"100%":F,pointerEvents:P?"none":void 0,width:$?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var u=this._getRangeToRender(),p=u[0],f=u[1],y=u[2],j=u[3];this._callOnItemsRendered(p,f,y,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var o=this.props,u=o.itemCount,p=o.overscanCount,f=this.state,y=f.isScrolling,j=f.scrollDirection,x=f.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!y||j==="backward"?Math.max(1,p):1,z=!y||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ss=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Ds=As({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,a,c,l){var m=t.direction,d=t.height,h=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,o=Math.max(0,h*M-N),u=Math.min(o,i*M),p=Math.max(0,i*M-N+M+l);switch(r==="smart"&&(a>=p-N&&a<=u+N?r="auto":r="center"),r){case"start":return u;case"end":return p;case"center":{var f=Math.round(p+(u-p)/2);return f<Math.ceil(N/2)?0:f>o+Math.floor(N/2)?o:f}case"auto":default:return a>=p&&a<=u?a:a<p?p:u}},getStartIndexForOffset:function(t,i){var r=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/a)))},getStopIndexForStartIndex:function(t,i,r){var a=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,h=t.width,M=a==="horizontal"||d==="horizontal",g=i*m,I=M?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function zs(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,a=e.stopIndex;return!(r>i||a<t)}function ks(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,a=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,h=a;h<=c;h++){var M=t(h);M?d!==null&&(l.push(m,d),m=d=null):(d=h,m===null&&(m=h))}if(d!==null){for(var g=Math.min(Math.max(d,m+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var Os=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ws=function(){function e(t,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),_s=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Cs=function(e){_s(t,e);function t(){var i,r,a,c;Os(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(r=(a=oe(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(h){var M=h.visibleStartIndex,g=h.visibleStopIndex;a._lastRenderedStartIndex=M,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(M,g)},a._setRef=function(h){a._listRef=h},r),oe(a,c)}return ws(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,h=d===void 0?10:d,M=c.threshold,g=M===void 0?15:M,I=ks({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var M=r[h],g=r[h+1],I=c(M,g);I!=null&&I.then(function(){if(zs({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(M,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const bs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Es=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),$s=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Ls=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Rs=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Qs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Us=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),qs=()=>n.i1,Ps=n.styled_default(qs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:i,points:r,isCurrentUser:a,openItemDetail:c,style:l})=>s.jsxs(bs,{onClick:c,style:l,children:[s.jsx(Es,{children:e||0}),s.jsxs(Rs,{children:[t?s.jsx($s,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Ls,{children:n.o$1(i||"")}),s.jsxs(Qs,{children:[s.jsx(Us,{children:i||""}),a&&s.jsx(Ps,{name:"icon-star"})]})]}),s.jsx("div",{children:n.i(r)})]}),Ws=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Fs=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:a,height:c})=>s.jsx(Cs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Ws,{children:s.jsx(Ds,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:a,height:c,children:({index:d,style:h})=>s.jsx(Ys,{style:{...h,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Vs=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Bs=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Fs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Vs,{deepLink:e.deepLink})},Hs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Gs=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Zs=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Js=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ks=()=>n.i1,b=n.styled_default(Ks())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Xs=()=>n.i1,en=n.styled_default(Xs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),nn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),rn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},an=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:a,openQuestion:c,status:l})=>{const m=n.o[t],d=rn[l];return m?s.jsxs(Hs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(sn,{children:[s.jsxs(Gs,{children:[s.jsx(en,{name:m.iconName}),s.jsxs(tn,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Zs,{children:r||""})]}),s.jsx(Js,{children:a?s.jsx(nn,{children:"Play"}):d})]}):null},on=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),ln=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:t,...i})=>s.jsxs(on,{children:[s.jsx(fe,{questionId:t,...i}),e&&s.jsx(ln,{onClick:()=>e(t),children:"View Insight"})]}),dn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:e,openQuestion:t})=>s.jsx(dn,{children:e==null?void 0:e.map(i=>{var r,a;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(an,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(cn,{openInsight:t,...c},c.questionId)}return null})}),pn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(un,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},mn=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(de,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},fn=({gamification:e})=>{const[t,i]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a$1,{style:{paddingBottom:"4px"},children:s.jsx(ys,{activePage:t,toggleActivePage:i})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a$1,{style:{paddingTop:"12px"},children:s.jsx(mn,{userSummary:e.userSummary})}),s.jsx(n.n$1,{children:s.jsx(pn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Bs,{gamification:e})})]})},hn=()=>n.d,le=n.styled_default(hn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),In=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),yn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},gn=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(ps,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(In,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a$1,{children:s.jsx(de,{...r,successRate:yn(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(fn,{gamification:e})})]})};exports.default=gn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.i1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.i1,_e=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(r==null?void 0:r.iconName)&&s.jsx(ze,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(ke,{children:r.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(_e,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",Ce=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),$e=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Le=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Le,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:i,friendsRank:r,rank:a,streak:c,correct:l,incorrect:m,inTop:d,successRate:h})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(i),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:r||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(C,{indicator:c||0,title:"Win streak"}),s.jsx(C,{indicator:l||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ot=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ct=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(n.i1,{name:"icon-check-circle"}),s.jsx(ot,{children:e}),s.jsx(lt,{children:t})]}),dt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ut=()=>n.i1,pt=n.styled_default(ut())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),mt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:a,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!a,d=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(dt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx(L,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.i1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(mt,{"data-feedbackType":d,children:h==null?void 0:h.title}),s.jsx(L,{children:h==null?void 0:h.description})]})})]})]})},It=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),yt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),jt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Mt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),vt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Tt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Nt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),At=()=>me,St=n.styled_default(At())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Dt=()=>me,zt=n.styled_default(Dt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),kt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ot=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),wt=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),_t=()=>n.i1,Ct=n.styled_default(_t())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(St,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Tt,{children:s.jsx(Nt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(zt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},bt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:a})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&a?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Et=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||a===n.QuestionStatus.RESOLVED&&i:!1,$t=e=>{var t;const{id:i,icon:r,text:a,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:h,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:o}=e,u=bt(e),p=Et({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:o,questionStatus:g}),f=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(jt,{value:i,"data-selected":m,"data-answerState":u,disabled:d||I||M,onClick:l,children:[f&&s.jsx(Mt,{"data-answerState":u,style:{width:`${c}%`}}),s.jsxs(vt,{children:[r&&h&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(kt,{children:a}),f&&s.jsxs(Ot,{children:[p&&s.jsx(Ct,{name:"selected"}),s.jsx(wt,{children:s.jsx(n.m,{value:c,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,Lt=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[l,m]=T.useState(i),d=T.useRef(0),h=T.useRef(i),M=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,j=d.current+y;I.current=f,d.current=j;let x=h.current+(r===0?j:(j/r|0)*r),A=h.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{o(),d.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(a==null?void 0:a(M.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,r]),{elapsedTime:l,reset:u}},Rt=(e,t,i)=>{let r=e/2,a=t/2,c=r-a,l=2*c,m=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Qt=e=>({position:"relative",width:e,height:e}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,i,r,a)=>{if(r===0)return t;let c=(a?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,l)=>`#${a}${a}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},Pt=(e,t)=>{var i;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=a==null?void 0:a.findIndex((I,v)=>I>=t&&t>=a[v+1]))!=null?i:-1;if(!a||l===-1)return r[0];if(!c)return r[l];let m=a[l]-t,d=a[l]-a[l+1],h=K(r[l]),M=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>fe(m,I,M[v]-I,d,g)|0).join(",")})`},qt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:h="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:o}=Rt(a,v,h),{elapsedTime:u}=Lt({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?f=>{var y;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(y=M(f))!=null?y:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:h,size:a,stroke:Pt(e,p),strokeDashoffset:fe(u,0,o,t,d),strokeWidth:c}},he=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:a}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:h,elapsedTime:M,size:g,strokeWidth:I}=qt(e);return T.createElement("div",{style:Qt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Ut},t({remainingTime:h,elapsedTime:M,color:m})))};he.displayName="CountdownCircleTimer";const Yt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Wt=[10,10,0],Ft=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Bt=n.E.NEUTRALS_GRAY3,Ht=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,a]=T.useState(t>10?Vt:X),c=({remainingTime:d})=>s.jsx(Ft,{children:d}),l=T.useCallback(()=>{i==null||i(),a(Bt)},[i,a]),m=T.useCallback(d=>{d===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Yt,colorsTime:Wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Gt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Kt=()=>n.i1,Xt=n.styled_default(Kt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),es=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),ts=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ss=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ns=({title:e,points:t,isPlayingTimer:i,isTimer:r,onTimerExpired:a})=>s.jsxs(Gt,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Jt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:t}),s.jsx(ss,{children:"PTS"})]})]})]}),r&&s.jsx(Ht,{isPlaying:i,onTimerExpired:a})]}),is=({openedQuestion:e,vote:t,close:i})=>{var r;const a=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,d]=T.useState(!1),[h,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async j=>{if(v){const x=j.currentTarget.value;I(x),M(!0),await t(v,x),M(!1)}},[v,I,t]),o=T.useCallback(()=>{d(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!u,youSelected:g===j.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,m,h,e,u,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(It,{children:s.jsxs(yt,{children:[y&&s.jsx(ht,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(ns,{title:m?"Time expired":"To win",points:m?void 0:100,onTimerExpired:o,isTimer:!0}),m?s.jsx(ct,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:a}),s.jsx(xt,{children:f.map(j=>s.jsx($t,{...j},j.id))})]})]})})})},rs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),as=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),os=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ls=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),cs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ds=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:i,instantView:r})=>{const a=T.useMemo(()=>{if(e){const l=new Date(e);if(Ee(l))return{date:Ce(l),time:be(l)}}return null},[e]),c=(r==null?void 0:r.image)||t;return s.jsxs(rs,{children:[a&&s.jsxs(cs,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&s.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),c&&s.jsx(ds,{src:c}),s.jsxs(as,{children:[s.jsx(os,{children:(r==null?void 0:r.heading)||i}),s.jsx(ls,{children:r==null?void 0:r.body})]})]})},us=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ps=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ms=({instantView:e,...t})=>s.jsxs(us,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ps,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.i1,{name:"icon-external-link"})]})]}),fs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),hs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ms,{created:e.attributes.created,...e.attributes.attributes.value}):null},Is=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:a}=e;return!r&&a?s.jsx(is,{vote:t,close:i,openedQuestion:a}):null},ys=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return s.jsxs(fs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(Is,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),a!=="question"&&s.jsx(hs,{openedQuestion:i})]})},gs=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),js=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Ms=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(js,{onClick:i,"data-selected":t,children:s.jsx(Ms,{children:e})}),vs=({activePage:e="home",toggleActivePage:t})=>s.jsx(gs,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},P(e,t)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ns(e,t){return!!(e===t||se(e)&&se(t))}function As(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!Ns(e[i],t[i]))return!1;return!0}function R(e,t){t===void 0&&(t=As);var i,r=[],a,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&i===this&&t(m,r)||(a=e.apply(this,m),c=!0,i=this,r=m),a}return l}var Ss=typeof performance=="object"&&typeof performance.now=="function",ne=Ss?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ds(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var zs=150,ks=function(t,i){return t};function Os(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,a=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){Ts(I,g);function I(N){var o;return o=g.call(this,N)||this,o._instanceProps=d(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(u,p,f,y){return o.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),o._callOnScroll=void 0,o._callOnScroll=R(function(u,p,f){return o.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:f})}),o._getItemStyle=void 0,o._getItemStyle=function(u){var p=o.props,f=p.direction,y=p.itemSize,j=p.layout,x=o._getItemStyleCache(h&&y,h&&j,h&&f),A;if(x.hasOwnProperty(u))A=x[u];else{var S=i(o.props,u,o._instanceProps),D=a(o.props,u,o._instanceProps),z=f==="horizontal"||j==="horizontal",w=f==="rtl",_=z?S:0;x[u]=A={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(u,p,f){return{}}),o._onScrollHorizontal=function(u){var p=u.currentTarget,f=p.clientWidth,y=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===y)return null;var A=o.props.direction,S=y;if(A==="rtl")switch(ae()){case"negative":S=-y;break;case"positive-descending":S=j-f-y;break}return S=Math.max(0,Math.min(S,j-f)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(u){var p=u.currentTarget,f=p.clientHeight,y=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,y-f));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(u){var p=o.props.outerRef;o._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ds(o._resetIsScrolling,zs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}I.getDerivedStateFromProps=function(o,u){return ws(o,u),M(o),null};var v=I.prototype;return v.scrollTo=function(o){o=Math.max(0,o),this.setState(function(u){return u.scrollOffset===o?null:{scrollDirection:u.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(o,u){u===void 0&&(u="auto");var p=this.props,f=p.itemCount,y=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,f-1));var x=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,o,u,j,this._instanceProps,x))},v.componentDidMount=function(){var o=this.props,u=o.direction,p=o.initialScrollOffset,f=o.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var o=this.props,u=o.direction,p=o.layout,f=this.state,y=f.scrollOffset,j=f.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var o=this.props,u=o.children,p=o.className,f=o.direction,y=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?ks:z,_=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,Me=o.width,q=this.state.isScrolling,$=f==="horizontal"||_==="horizontal",ve=$?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=r(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:ve,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:$?"100%":F,pointerEvents:q?"none":void 0,width:$?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var u=this._getRangeToRender(),p=u[0],f=u[1],y=u[2],j=u[3];this._callOnItemsRendered(p,f,y,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var o=this.props,u=o.itemCount,p=o.overscanCount,f=this.state,y=f.isScrolling,j=f.scrollDirection,x=f.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!y||j==="backward"?Math.max(1,p):1,z=!y||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ws=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},_s=Os({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,a,c,l){var m=t.direction,d=t.height,h=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,o=Math.max(0,h*M-N),u=Math.min(o,i*M),p=Math.max(0,i*M-N+M+l);switch(r==="smart"&&(a>=p-N&&a<=u+N?r="auto":r="center"),r){case"start":return u;case"end":return p;case"center":{var f=Math.round(p+(u-p)/2);return f<Math.ceil(N/2)?0:f>o+Math.floor(N/2)?o:f}case"auto":default:return a>=p&&a<=u?a:a<p?p:u}},getStartIndexForOffset:function(t,i){var r=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/a)))},getStopIndexForStartIndex:function(t,i,r){var a=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,h=t.width,M=a==="horizontal"||d==="horizontal",g=i*m,I=M?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Cs(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,a=e.stopIndex;return!(r>i||a<t)}function bs(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,a=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,h=a;h<=c;h++){var M=t(h);M?d!==null&&(l.push(m,d),m=d=null):(d=h,m===null&&(m=h))}if(d!==null){for(var g=Math.min(Math.max(d,m+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},$s=function(){function e(t,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),Ls=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Rs=function(e){Ls(t,e);function t(){var i,r,a,c;Es(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(r=(a=oe(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(h){var M=h.visibleStartIndex,g=h.visibleStopIndex;a._lastRenderedStartIndex=M,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(M,g)},a._setRef=function(h){a._listRef=h},r),oe(a,c)}return $s(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,h=d===void 0?10:d,M=c.threshold,g=M===void 0?15:M,I=bs({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var M=r[h],g=r[h+1],I=c(M,g);I!=null&&I.then(function(){if(Cs({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(M,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const Qs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Us=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ps=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ys=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ws=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Fs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>n.i1,Bs=n.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Hs=({rank:e,avatar:t,name:i,points:r,isCurrentUser:a,openItemDetail:c,style:l})=>s.jsxs(Qs,{onClick:c,style:l,children:[s.jsx(Us,{children:e||0}),s.jsxs(Ys,{children:[t?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:de(i||"")}),s.jsxs(Ws,{children:[s.jsx(Fs,{children:i||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(r)})]}),Gs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:a,height:c})=>s.jsx(Rs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Gs,{children:s.jsx(_s,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:a,height:c,children:({index:d,style:h})=>s.jsx(Hs,{style:{...h,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Js=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Ks=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Js,{deepLink:e.deepLink})},Xs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),en=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),nn=()=>n.i1,b=n.styled_default(nn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),rn=()=>n.i1,an=n.styled_default(rn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),on=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),cn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),dn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},un=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:a,openQuestion:c,status:l})=>{const m=n.o[t],d=dn[l];return m?s.jsxs(Xs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(ln,{children:[s.jsxs(en,{children:[s.jsx(an,{name:m.iconName}),s.jsxs(on,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(tn,{children:r||""})]}),s.jsx(sn,{children:a?s.jsx(cn,{children:"Play"}):d})]}):null},pn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),mn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),fn=({openInsight:e,questionId:t,...i})=>s.jsxs(pn,{children:[s.jsx(Ie,{questionId:t,...i}),e&&s.jsx(mn,{onClick:()=>e(t),children:"View Insight"})]}),hn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),In=({questions:e,openQuestion:t})=>s.jsx(hn,{children:e==null?void 0:e.map(i=>{var r,a;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(un,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(fn,{openInsight:t,...c},c.questionId)}return null})}),yn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(In,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},gn=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(pe,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,i]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(vs,{activePage:t,toggleActivePage:i})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(gn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(yn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Ks,{gamification:e})})]})},jn=()=>n.d,le=n.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),Mn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),vn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},Tn=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(ys,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(Mn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...r,successRate:vn(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=Tn;
|