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