@streamlayer/react 0.29.0 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/common-2d2a3ba3.js +15 -0
- package/lib/common-f34b9d88.cjs +1 -0
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/index-59e97bed.cjs +1 -0
- package/lib/dist/{index-b9208075.js → index-b0e4fdb9.js} +439 -463
- package/lib/dist/{masters-a2f6c191.js → masters-7a8328b4.js} +575 -565
- package/lib/dist/{masters-06dc3df7.cjs → masters-ac060b87.cjs} +10 -10
- package/lib/dist/style.css +13 -16
- package/lib/es/masters.js +1 -1
- package/lib/es/points.js +1 -1
- package/lib/index-d229838f.cjs +6 -0
- package/lib/{index-5beb8b30.js → index-ee3edaf5.js} +909 -933
- package/lib/masters-84cfeac0.cjs +1 -0
- package/lib/{masters-0748e717.js → masters-bec9cb07.js} +52 -52
- package/lib/style.css +1 -1
- package/package.json +7 -7
- package/lib/common-0311b835.js +0 -5
- package/lib/common-dc2f2d4f.cjs +0 -1
- package/lib/dist/index-edbd0748.cjs +0 -1
- package/lib/index-a4c9d828.cjs +0 -6
- package/lib/masters-13b0f21d.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./masters-06dc3df7.cjs"),j=require("react");const De=()=>i.e1,we=()=>i.e1,Oe=i.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Ee=i.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),ke=i.styled_default(De())({name:"p",class:"p14kwh4y",propsAsIs:!0}),be=i.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),Le=i.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Ce=i.styled_default(we())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),me=({type:t,close:e,label:s})=>{const r=t?i.o[t]:{label:s,iconName:void 0};return n.jsxs(Oe,{children:[n.jsxs(Ee,{children:[(r==null?void 0:r.iconName)&&n.jsx(ke,{name:r.iconName}),(r==null?void 0:r.label)&&n.jsx(be,{children:r.label})]}),n.jsx(Le,{onClick:e,children:n.jsx(Ce,{name:"icon-cross"})})]})};const Re=i.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),$e=i.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Qe=i.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),Z=({indicator:t,title:e})=>n.jsxs(Re,{children:[n.jsx($e,{children:e}),n.jsx(Qe,{children:t})]});const Ue=i.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),qe=i.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),Ye=i.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),L=({indicator:t,title:e})=>n.jsxs(Ue,{children:[n.jsx(qe,{children:t}),n.jsx(Ye,{children:e})]});const Pe=i.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),Fe=i.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),We=i.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Ve=i.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),He=i.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Be=i.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Ge=i.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Ze=i.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),Je=i.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),Ke=i.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),Xe=i.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),et=i.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),tt=i.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),st=i.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),nt=i.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),it=i.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),rt=i.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),at="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ge=({avatar:t,name:e,points:s,friendsRank:r,rank:a,streak:c,correct:p,incorrect:h,inTop:m,average:x})=>n.jsxs(Pe,{children:[n.jsx(Fe,{children:n.jsxs(Ve,{children:[n.jsxs(rt,{children:[t&&n.jsx(He,{alt:"avatar",src:t}),!t&&n.jsx(it,{children:i.e(e||"")})]}),n.jsxs(Be,{children:[n.jsx(Ge,{children:e}),n.jsxs(Ze,{children:[n.jsxs(Ke,{children:[n.jsx(Je,{alt:"rank-icon",src:at}),n.jsxs(Xe,{children:[i.a(s),n.jsx(et,{children:"PTS"})]})]}),n.jsx(tt,{}),n.jsxs("div",{children:["TOP ",m||0,"%"]})]})]})]})}),n.jsxs(We,{children:[n.jsxs(st,{children:[n.jsx(Z,{indicator:r||0,title:"Friends rank"}),n.jsx(Z,{indicator:a||0,title:"Global rank"})]}),n.jsxs(nt,{children:[n.jsx(L,{indicator:c||0,title:"Win streak"}),n.jsx(L,{indicator:p||0,title:"Correct"}),n.jsx(L,{indicator:h||0,title:"Incorrect"}),n.jsx(L,{indicator:`${x||0}%`,title:"Succ. rate"})]})]})]});const lt=()=>i.e1,ot=i.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),dt=i.styled_default(lt())({name:"n",class:"nfic4xc",propsAsIs:!0}),ct=i.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),ut=i.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),pt=i.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),J=i.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),ft=({feedbackMessages:t,questionVotedCorrectly:e,questionVoted:s,questionType:r,hasCorrectAnswer:a})=>{if(!(s&&(r===i.QuestionType.TRIVIA||r===i.QuestionType.PREDICTION)))return null;const c=r===i.QuestionType.PREDICTION&&!a,p=e?"correct":"incorrect",h=e?t.correctFeedback:t.incorrectFeedback;return n.jsxs(ot,{"data-isPrediction":c,children:[c&&n.jsxs(n.Fragment,{children:[n.jsx(dt,{name:"icon-prediction"}),n.jsx(J,{children:"Stay tuned to see if your prediction was correct."})]}),a&&n.jsxs(n.Fragment,{children:[n.jsx(ct,{"data-feedbackType":p,children:n.jsx(i.e1,{name:p})}),n.jsx("div",{children:n.jsxs(ut,{children:[n.jsx(pt,{"data-feedbackType":p,children:h==null?void 0:h.title}),n.jsx(J,{children:h==null?void 0:h.description})]})})]})]})};const ht=i.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),mt=i.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),gt=i.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),yt=i.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const It=()=>ye,xt=()=>ye,vt=()=>i.e1,_t=i.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),Mt=i.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),jt=i.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),Nt=i.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),zt=i.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),ye=i.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),Tt=i.styled_default(It())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),St=i.styled_default(xt())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),At=i.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),Dt=i.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),wt=i.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),Ot=i.styled_default(vt())({name:"v",class:"v10s9my2",propsAsIs:!0}),K={[i.QuestionImages.CENTERED]:t=>n.jsx(Tt,{alt:"option-icon",src:t}),[i.QuestionImages.TRANSPARENT]:t=>n.jsx(Nt,{children:n.jsx(zt,{style:{backgroundImage:`url(${t})`}})}),[i.QuestionImages.ROUNDED]:t=>n.jsx(St,{alt:"option-icon",src:t}),[i.QuestionImages.NONE]:()=>null,[i.QuestionImages.UNSET]:()=>null},Et=({questionType:t,hasCorrectAnswer:e,correct:s,youVoted:r,questionVoted:a})=>{if(t===i.QuestionType.POLL&&r)return"correct";if(t===i.QuestionType.PREDICTION){if(e&&a)return r?s?"correct":"incorrect":s?"correct":"unset";if(r)return"correct"}return t===i.QuestionType.TRIVIA&&a?r?s?"correct":"incorrect":s?"correct":"unset":"unset"},kt=({questionType:t,questionVoted:e,correct:s,hasCorrectAnswer:r,questionStatus:a})=>t===i.QuestionType.TRIVIA?e&&s:t===i.QuestionType.PREDICTION?e&&s&&r||a===i.QuestionStatus.RESOLVED&&s:!1,bt=t=>{var e;const{id:s,icon:r,text:a,percentageDecimal:c,onVote:p,youSelected:h,questionVoted:m,imageMode:x=i.QuestionImages.ROUNDED,answerTimeExpired:_,questionStatus:v,isLoading:o,questionType:I,correct:y,hasCorrectAnswer:l}=t,f=Et(t),d=kt({questionType:I,questionVoted:m,correct:y,hasCorrectAnswer:l,questionStatus:v}),u=m||v===i.QuestionStatus.RESOLVED&&I===i.QuestionType.PREDICTION;return n.jsxs(_t,{value:s,"data-selected":h,"data-answerState":f,disabled:m||o||_,onClick:p,children:[u&&n.jsx(Mt,{"data-answerState":f,style:{width:`${c}%`}}),n.jsxs(jt,{children:[r&&((e=K[x])==null?void 0:e.call(K,r)),n.jsx(At,{children:a}),u&&n.jsxs(Dt,{children:[d&&n.jsx(Ot,{name:"selected"}),n.jsxs(wt,{children:[c,"%"]})]})]})]})};var X=typeof window>"u"?j.useEffect:j.useLayoutEffect,Lt=({isPlaying:t,duration:e,startAt:s=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[p,h]=j.useState(s),m=j.useRef(0),x=j.useRef(s),_=j.useRef(s*-1e3),v=j.useRef(null),o=j.useRef(null),I=j.useRef(null),y=d=>{let u=d/1e3;if(o.current===null){o.current=u,v.current=requestAnimationFrame(y);return}let g=u-o.current,N=m.current+g;o.current=u,m.current=N;let M=x.current+(r===0?N:(N/r|0)*r),z=x.current+N,T=typeof e=="number"&&z>=e;h(T?e:M),T||(v.current=requestAnimationFrame(y))},l=()=>{v.current&&cancelAnimationFrame(v.current),I.current&&clearTimeout(I.current),o.current=null},f=j.useCallback(d=>{l(),m.current=0;let u=typeof d=="number"?d:s;x.current=u,h(u),t&&(v.current=requestAnimationFrame(y))},[t,s]);return X(()=>{if(c==null||c(p),e&&p>=e){_.current+=e*1e3;let{shouldRepeat:d=!1,delay:u=0,newStartAt:g}=(a==null?void 0:a(_.current/1e3))||{};d&&(I.current=setTimeout(()=>f(g),u*1e3))}},[p,e]),X(()=>(t&&(v.current=requestAnimationFrame(y)),l),[t,e,r]),{elapsedTime:p,reset:f}},Ct=(t,e,s)=>{let r=t/2,a=e/2,c=r-a,p=2*c,h=s==="clockwise"?"1,0":"0,1",m=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${h} 0,${p} a ${c},${c} 0 ${h} 0,-${p}`,pathLength:m}},ee=(t,e)=>t===0||t===e?0:typeof e=="number"?t-e:0,Rt=t=>({position:"relative",width:t,height:t}),$t={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},Ie=(t,e,s,r,a)=>{if(r===0)return e;let c=(a?r-t:t)/r;return e+s*c},te=t=>{var e,s;return(s=(e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,p)=>`#${a}${a}${c}${c}${p}${p}`).substring(1).match(/.{2}/g))==null?void 0:e.map(r=>parseInt(r,16)))!=null?s:[]},Qt=(t,e)=>{var s;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=t;if(typeof r=="string")return r;let p=(s=a==null?void 0:a.findIndex((o,I)=>o>=e&&e>=a[I+1]))!=null?s:-1;if(!a||p===-1)return r[0];if(!c)return r[p];let h=a[p]-e,m=a[p]-a[p+1],x=te(r[p]),_=te(r[p+1]),v=!!t.isGrowing;return`rgb(${x.map((o,I)=>Ie(h,o,_[I]-o,m,v)|0).join(",")})`},Ut=t=>{let{duration:e,initialRemainingTime:s,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:p,isPlaying:h=!1,isGrowing:m=!1,rotation:x="clockwise",onComplete:_,onUpdate:v}=t,o=j.useRef(),I=Math.max(c,p??0),{path:y,pathLength:l}=Ct(a,I,x),{elapsedTime:f}=Lt({isPlaying:h,duration:e,startAt:ee(e,s),updateInterval:r,onUpdate:typeof v=="function"?u=>{let g=Math.ceil(e-u);g!==o.current&&(o.current=g,v(g))}:void 0,onComplete:typeof _=="function"?u=>{var g;let{shouldRepeat:N,delay:M,newInitialRemainingTime:z}=(g=_(u))!=null?g:{};if(N)return{shouldRepeat:N,delay:M,newStartAt:ee(e,z)}}:void 0}),d=e-f;return{elapsedTime:f,path:y,pathLength:l,remainingTime:Math.ceil(d),rotation:x,size:a,stroke:Qt(t,d),strokeDashoffset:Ie(f,0,l,e,m),strokeWidth:c}},xe=t=>{let{children:e,strokeLinecap:s,trailColor:r,trailStrokeWidth:a}=t,{path:c,pathLength:p,stroke:h,strokeDashoffset:m,remainingTime:x,elapsedTime:_,size:v,strokeWidth:o}=Ut(t);return j.createElement("div",{style:Rt(v)},j.createElement("svg",{viewBox:`0 0 ${v} ${v}`,width:v,height:v,xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??o}),j.createElement("path",{d:c,fill:"none",stroke:h,strokeLinecap:s??"round",strokeWidth:o,strokeDasharray:p,strokeDashoffset:m})),typeof e=="function"&&j.createElement("div",{style:$t},e({remainingTime:x,elapsedTime:_,color:h})))};xe.displayName="CountdownCircleTimer";const qt=[i.E.PRIMARY_GREEN1,i.E.SECONDARY_RED1,i.E.SECONDARY_RED1],Yt=[10,10,0],Pt=i.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),Ft=i.E.SECONDARY_GREEN6,se=i.E.SECONDARY_RED3,Wt=i.E.NEUTRALS_GRAY3,Vt=({isPlaying:t=!0,duration:e=30,onTimerExpired:s})=>{const[r,a]=j.useState(e>10?Ft:se),c=({remainingTime:m})=>n.jsx(Pt,{children:m}),p=j.useCallback(()=>{s==null||s(),a(Wt)},[s,a]),h=j.useCallback(m=>{m===10&&a(se)},[a]);return n.jsx(xe,{isPlaying:t,duration:e,colors:qt,colorsTime:Yt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:p,onUpdate:h,children:c})};const Ht=()=>i.e1,Bt=i.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Gt=i.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Zt=i.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Jt=i.styled_default(Ht())({name:"p",class:"p1edlxt3",propsAsIs:!0}),Kt=i.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),Xt=i.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),es=i.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),ts=({title:t,points:e,isPlayingTimer:s,isTimer:r,onTimerExpired:a})=>n.jsxs(Bt,{children:[n.jsxs(Gt,{children:[t&&n.jsx(Zt,{children:t}),e!==void 0&&n.jsxs(n.Fragment,{children:[n.jsx(Jt,{name:"icon-trophy"}),n.jsxs(Kt,{children:[n.jsx(Xt,{children:e}),n.jsx(es,{children:"PTS"})]})]})]}),r&&n.jsx(Vt,{isPlaying:s,onTimerExpired:a})]}),ss=({openedQuestion:t,vote:e})=>{var s;const r=t.subject,a=t.type,c=(s=t.options)==null?void 0:s.options,[p,h]=j.useState(!1),[m,x]=j.useState(!1),[_,v]=j.useState(""),o=t==null?void 0:t.id,I=j.useCallback(async u=>{if(o){const g=u.currentTarget.value;v(g),x(!0),await e(o,g),x(!1)}},[o,v,e]),y=j.useMemo(()=>t==null?void 0:t.answers.find(u=>u.youVoted===!0),[t]),l=j.useMemo(()=>!!(t!=null&&t.answers.find(u=>u.correct===!0)),[t]),f=j.useMemo(()=>t?t.answers.map(u=>({...u,questionVoted:!!y,youSelected:_===u.id,isLoading:m,hasCorrectAnswer:l,questionType:t.type,answerTimeExpired:p,questionStatus:t.status,onVote:I})):[],[l,p,m,t,y,I,_]),d=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return n.jsx(i.r,{"data-question-header":"true",children:n.jsx(ht,{children:n.jsxs(mt,{children:[d&&n.jsx(ft,{feedbackMessages:d,questionVoted:!!y,questionVotedCorrectly:y==null?void 0:y.correct,questionType:a,hasCorrectAnswer:l}),n.jsx(ts,{title:p?"Expired":"To win",points:p?void 0:100,onTimerExpired:()=>h(!0),isTimer:!0}),n.jsx(gt,{children:r}),n.jsx(yt,{children:f.map(u=>n.jsx(bt,{...u},u.id))})]})})})};const ns=i.styled_default("div")({name:"e",class:"e18unvw4",propsAsIs:!1}),is=i.styled_default("div")({name:"r",class:"rs0uvk8",propsAsIs:!1}),rs=i.styled_default("h3")({name:"n",class:"n1hem4g7",propsAsIs:!1}),as=i.styled_default("div")({name:"i",class:"i193lbwv",propsAsIs:!1}),ls=i.styled_default("a")({name:"a",class:"a1dka9qs",propsAsIs:!1}),os=i.styled_default("div")({name:"l",class:"l1un98tk",propsAsIs:!1}),ds=({created:t,title:e,instantView:s})=>{const r=new Date(t),a=r.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),c=r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return n.jsxs(ns,{children:[n.jsxs(os,{children:[a,"・",c]}),(s==null?void 0:s.video)&&n.jsx(i.w,{source:s.video.url,poster:s.video.thumbnailUrl}),n.jsxs(is,{children:[n.jsx(rs,{children:(s==null?void 0:s.heading)||e}),n.jsx(as,{children:s==null?void 0:s.body}),(s==null?void 0:s.webLink)&&n.jsxs(ls,{href:s==null?void 0:s.webLink.url,target:"_blank",children:["Explore more of the Masters History",n.jsx(i.e1,{name:"icon-external-link"})]})]})]})};const cs=i.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),us=({openedQuestion:t})=>{var e;return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?n.jsx(ds,{created:t.attributes.created,...t.attributes.attributes.value}):null},ps=({extendedQuestion:t,vote:e})=>{const{loading:s,data:r}=t;return!s&&r?n.jsx(ss,{vote:e,openedQuestion:r}):null},fs=({gamification:t})=>{var e;const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedQuestion.$extendedStore);if(!s)return null;const a=s.type;return n.jsxs(cs,{children:[n.jsx(me,{close:t.closeQuestion,type:((e=s.attributes)==null?void 0:e.type)||i.QuestionType.UNSET}),a==="question"&&n.jsx(ps,{vote:t.submitAnswer,extendedQuestion:r}),a!=="question"&&n.jsx(us,{openedQuestion:s})]})};const hs=i.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),ms=i.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),gs=i.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),ys=i.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var E=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(E||{});const ne=({title:t,active:e,onClick:s})=>n.jsx(gs,{onClick:s,"data-selected":e,children:n.jsx(ys,{children:t})}),Is=({activePage:t="home",toggleActivePage:e})=>n.jsx(hs,{children:n.jsxs(ms,{"data-position":t==="home"?"left":"right",children:[n.jsx(ne,{title:"Home",active:t==="home",onClick:()=>e("home")}),n.jsx(ne,{title:"Leader Board",active:t==="leaderboard",onClick:()=>e("leaderboard")})]})});let S;typeof window<"u"?S=window:typeof self<"u"?S=self:S=i.dist.global;let Y=null,P=null;const ie=20,R=S.clearTimeout,re=S.setTimeout,$=S.cancelAnimationFrame||S.mozCancelAnimationFrame||S.webkitCancelAnimationFrame,ae=S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame;$==null||ae==null?(Y=R,P=function(e){return re(e,ie)}):(Y=function([e,s]){$(e),R(s)},P=function(e){const s=ae(function(){R(r),e()}),r=re(function(){$(s),e()},ie);return[s,r]});function xs(t){let e,s,r,a,c,p,h;const m=typeof document<"u"&&document.attachEvent;if(!m){p=function(d){const u=d.__resizeTriggers__,g=u.firstElementChild,N=u.lastElementChild,M=g.firstElementChild;N.scrollLeft=N.scrollWidth,N.scrollTop=N.scrollHeight,M.style.width=g.offsetWidth+1+"px",M.style.height=g.offsetHeight+1+"px",g.scrollLeft=g.scrollWidth,g.scrollTop=g.scrollHeight},c=function(d){return d.offsetWidth!==d.__resizeLast__.width||d.offsetHeight!==d.__resizeLast__.height},h=function(d){if(d.target.className&&typeof d.target.className.indexOf=="function"&&d.target.className.indexOf("contract-trigger")<0&&d.target.className.indexOf("expand-trigger")<0)return;const u=this;p(this),this.__resizeRAF__&&Y(this.__resizeRAF__),this.__resizeRAF__=P(function(){c(u)&&(u.__resizeLast__.width=u.offsetWidth,u.__resizeLast__.height=u.offsetHeight,u.__resizeListeners__.forEach(function(M){M.call(u,d)}))})};let o=!1,I="";r="animationstart";const y="Webkit Moz O ms".split(" ");let l="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const d=document.createElement("fakeelement");if(d.style.animationName!==void 0&&(o=!0),o===!1){for(let u=0;u<y.length;u++)if(d.style[y[u]+"AnimationName"]!==void 0){f=y[u],I="-"+f.toLowerCase()+"-",r=l[u],o=!0;break}}}s="resizeanim",e="@"+I+"keyframes "+s+" { from { opacity: 0; } to { opacity: 0; } } ",a=I+"animation: 1ms "+s+"; "}const x=function(o){if(!o.getElementById("detectElementResize")){const I=(e||"")+".resize-triggers { "+(a||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',y=o.head||o.getElementsByTagName("head")[0],l=o.createElement("style");l.id="detectElementResize",l.type="text/css",t!=null&&l.setAttribute("nonce",t),l.styleSheet?l.styleSheet.cssText=I:l.appendChild(o.createTextNode(I)),y.appendChild(l)}};return{addResizeListener:function(o,I){if(m)o.attachEvent("onresize",I);else{if(!o.__resizeTriggers__){const y=o.ownerDocument,l=S.getComputedStyle(o);l&&l.position==="static"&&(o.style.position="relative"),x(y),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=y.createElement("div")).className="resize-triggers";const f=y.createElement("div");f.className="expand-trigger",f.appendChild(y.createElement("div"));const d=y.createElement("div");d.className="contract-trigger",o.__resizeTriggers__.appendChild(f),o.__resizeTriggers__.appendChild(d),o.appendChild(o.__resizeTriggers__),p(o),o.addEventListener("scroll",h,!0),r&&(o.__resizeTriggers__.__animationListener__=function(g){g.animationName===s&&p(o)},o.__resizeTriggers__.addEventListener(r,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(I)}},removeResizeListener:function(o,I){if(m)o.detachEvent("onresize",I);else if(o.__resizeListeners__.splice(o.__resizeListeners__.indexOf(I),1),!o.__resizeListeners__.length){o.removeEventListener("scroll",h,!0),o.__resizeTriggers__.__animationListener__&&(o.__resizeTriggers__.removeEventListener(r,o.__resizeTriggers__.__animationListener__),o.__resizeTriggers__.__animationListener__=null);try{o.__resizeTriggers__=!o.removeChild(o.__resizeTriggers__)}catch{}}}}}class vs extends j.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:s,disableWidth:r,onResize:a}=this.props;if(this._parentNode){var c,p,h,m;const x=window.getComputedStyle(this._parentNode)||{},_=parseFloat((c=x.paddingLeft)!==null&&c!==void 0?c:"0"),v=parseFloat((p=x.paddingRight)!==null&&p!==void 0?p:"0"),o=parseFloat((h=x.paddingTop)!==null&&h!==void 0?h:"0"),I=parseFloat((m=x.paddingBottom)!==null&&m!==void 0?m:"0"),y=this._parentNode.getBoundingClientRect(),l=y.height-o-I,f=y.width-_-v,d=this._parentNode.offsetHeight-o-I,u=this._parentNode.offsetWidth-_-v;(!s&&(this.state.height!==d||this.state.scaledHeight!==l)||!r&&(this.state.width!==u||this.state.scaledWidth!==f))&&(this.setState({height:d,width:u,scaledHeight:l,scaledWidth:f}),typeof a=="function"&&a({height:d,scaledHeight:l,scaledWidth:f,width:u}))}},this._setRef=s=>{this._autoSizer=s}}componentDidMount(){const{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._parentNode!=null&&(typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=xs(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:e,defaultHeight:s,defaultWidth:r,disableHeight:a=!1,disableWidth:c=!1,nonce:p,onResize:h,style:m={},tagName:x="div",..._}=this.props,{height:v,scaledHeight:o,scaledWidth:I,width:y}=this.state,l={overflow:"visible"},f={};let d=!1;return a||(v===0&&(d=!0),l.height=0,f.height=v,f.scaledHeight=o),c||(y===0&&(d=!0),l.width=0,f.width=y,f.scaledWidth=I),j.createElement(x,{ref:this._setRef,style:{...l,...m},..._},!d&&e(f))}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},F.apply(this,arguments)}function le(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},W(t,e)}function _s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,W(t,e)}var oe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ms(t,e){return!!(t===e||oe(t)&&oe(e))}function js(t,e){if(t.length!==e.length)return!1;for(var s=0;s<t.length;s++)if(!Ms(t[s],e[s]))return!1;return!0}function Q(t,e){e===void 0&&(e=js);var s,r=[],a,c=!1;function p(){for(var h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];return c&&s===this&&e(h,r)||(a=t.apply(this,h),c=!0,s=this,r=h),a}return p}var Ns=typeof performance=="object"&&typeof performance.now=="function",de=Ns?function(){return performance.now()}:function(){return Date.now()};function ce(t){cancelAnimationFrame(t.id)}function zs(t,e){var s=de();function r(){de()-s>=e?t.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var U=-1;function ue(t){if(t===void 0&&(t=!1),U===-1||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",document.body.appendChild(e),U=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return U}var w=null;function pe(t){if(t===void 0&&(t=!1),w===null||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",s.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?w="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(e),w}return w}var Ts=150,Ss=function(e,s){return e};function As(t){var e,s=t.getItemOffset,r=t.getEstimatedTotalSize,a=t.getItemSize,c=t.getOffsetForIndexAndAlignment,p=t.getStartIndexForOffset,h=t.getStopIndexForStartIndex,m=t.initInstanceProps,x=t.shouldResetStyleCacheOnItemSizeChange,_=t.validateProps;return e=function(v){_s(o,v);function o(y){var l;return l=v.call(this,y)||this,l._instanceProps=m(l.props,le(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:le(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=Q(function(f,d,u,g){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:d,visibleStartIndex:u,visibleStopIndex:g})}),l._callOnScroll=void 0,l._callOnScroll=Q(function(f,d,u){return l.props.onScroll({scrollDirection:f,scrollOffset:d,scrollUpdateWasRequested:u})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var d=l.props,u=d.direction,g=d.itemSize,N=d.layout,M=l._getItemStyleCache(x&&g,x&&N,x&&u),z;if(M.hasOwnProperty(f))z=M[f];else{var T=s(l.props,f,l._instanceProps),A=a(l.props,f,l._instanceProps),D=u==="horizontal"||N==="horizontal",k=u==="rtl",b=D?T:0;M[f]=z={position:"absolute",left:k?void 0:b,right:k?b:void 0,top:D?0:T,height:D?"100%":A,width:D?A:"100%"}}return z},l._getItemStyleCache=void 0,l._getItemStyleCache=Q(function(f,d,u){return{}}),l._onScrollHorizontal=function(f){var d=f.currentTarget,u=d.clientWidth,g=d.scrollLeft,N=d.scrollWidth;l.setState(function(M){if(M.scrollOffset===g)return null;var z=l.props.direction,T=g;if(z==="rtl")switch(pe()){case"negative":T=-g;break;case"positive-descending":T=N-u-g;break}return T=Math.max(0,Math.min(T,N-u)),{isScrolling:!0,scrollDirection:M.scrollOffset<g?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var d=f.currentTarget,u=d.clientHeight,g=d.scrollHeight,N=d.scrollTop;l.setState(function(M){if(M.scrollOffset===N)return null;var z=Math.max(0,Math.min(N,g-u));return{isScrolling:!0,scrollDirection:M.scrollOffset<z?"forward":"backward",scrollOffset:z,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var d=l.props.outerRef;l._outerRef=f,typeof d=="function"?d(f):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&ce(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=zs(l._resetIsScrolling,Ts)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}o.getDerivedStateFromProps=function(l,f){return Ds(l,f),_(l),null};var I=o.prototype;return I.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},I.scrollToItem=function(l,f){f===void 0&&(f="auto");var d=this.props,u=d.itemCount,g=d.layout,N=this.state.scrollOffset;l=Math.max(0,Math.min(l,u-1));var M=0;if(this._outerRef){var z=this._outerRef;g==="vertical"?M=z.scrollWidth>z.clientWidth?ue():0:M=z.scrollHeight>z.clientHeight?ue():0}this.scrollTo(c(this.props,l,f,N,this._instanceProps,M))},I.componentDidMount=function(){var l=this.props,f=l.direction,d=l.initialScrollOffset,u=l.layout;if(typeof d=="number"&&this._outerRef!=null){var g=this._outerRef;f==="horizontal"||u==="horizontal"?g.scrollLeft=d:g.scrollTop=d}this._callPropsCallbacks()},I.componentDidUpdate=function(){var l=this.props,f=l.direction,d=l.layout,u=this.state,g=u.scrollOffset,N=u.scrollUpdateWasRequested;if(N&&this._outerRef!=null){var M=this._outerRef;if(f==="horizontal"||d==="horizontal")if(f==="rtl")switch(pe()){case"negative":M.scrollLeft=-g;break;case"positive-ascending":M.scrollLeft=g;break;default:var z=M.clientWidth,T=M.scrollWidth;M.scrollLeft=T-z-g;break}else M.scrollLeft=g;else M.scrollTop=g}this._callPropsCallbacks()},I.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ce(this._resetIsScrollingTimeoutId)},I.render=function(){var l=this.props,f=l.children,d=l.className,u=l.direction,g=l.height,N=l.innerRef,M=l.innerElementType,z=l.innerTagName,T=l.itemCount,A=l.itemData,D=l.itemKey,k=D===void 0?Ss:D,b=l.layout,_e=l.outerElementType,Me=l.outerTagName,je=l.style,Ne=l.useIsScrolling,ze=l.width,V=this.state.isScrolling,C=u==="horizontal"||b==="horizontal",Te=C?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),Se=H[0],Ae=H[1],B=[];if(T>0)for(var O=Se;O<=Ae;O++)B.push(j.createElement(f,{data:A,key:k(O,A),index:O,isScrolling:Ne?V:void 0,style:this._getItemStyle(O)}));var G=r(this.props,this._instanceProps);return j.createElement(_e||Me||"div",{className:d,onScroll:Te,ref:this._outerRefSetter,style:F({position:"relative",height:g,width:ze,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:u},je)},j.createElement(M||z||"div",{children:B,ref:N,style:{height:C?"100%":G,pointerEvents:V?"none":void 0,width:C?G:"100%"}}))},I._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),d=f[0],u=f[1],g=f[2],N=f[3];this._callOnItemsRendered(d,u,g,N)}}if(typeof this.props.onScroll=="function"){var M=this.state,z=M.scrollDirection,T=M.scrollOffset,A=M.scrollUpdateWasRequested;this._callOnScroll(z,T,A)}},I._getRangeToRender=function(){var l=this.props,f=l.itemCount,d=l.overscanCount,u=this.state,g=u.isScrolling,N=u.scrollDirection,M=u.scrollOffset;if(f===0)return[0,0,0,0];var z=p(this.props,M,this._instanceProps),T=h(this.props,z,M,this._instanceProps),A=!g||N==="backward"?Math.max(1,d):1,D=!g||N==="forward"?Math.max(1,d):1;return[Math.max(0,z-A),Math.max(0,Math.min(f-1,T+D)),z,T]},o}(j.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Ds=function(e,s){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,s.instance},ws=As({getItemOffset:function(e,s){var r=e.itemSize;return s*r},getItemSize:function(e,s){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var s=e.itemCount,r=e.itemSize;return r*s},getOffsetForIndexAndAlignment:function(e,s,r,a,c,p){var h=e.direction,m=e.height,x=e.itemCount,_=e.itemSize,v=e.layout,o=e.width,I=h==="horizontal"||v==="horizontal",y=I?o:m,l=Math.max(0,x*_-y),f=Math.min(l,s*_),d=Math.max(0,s*_-y+_+p);switch(r==="smart"&&(a>=d-y&&a<=f+y?r="auto":r="center"),r){case"start":return f;case"end":return d;case"center":{var u=Math.round(d+(f-d)/2);return u<Math.ceil(y/2)?0:u>l+Math.floor(y/2)?l:u}case"auto":default:return a>=d&&a<=f?a:a<d?d:f}},getStartIndexForOffset:function(e,s){var r=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(s/a)))},getStopIndexForStartIndex:function(e,s,r){var a=e.direction,c=e.height,p=e.itemCount,h=e.itemSize,m=e.layout,x=e.width,_=a==="horizontal"||m==="horizontal",v=s*h,o=_?x:c,I=Math.ceil((o+r-v)/h);return Math.max(0,Math.min(p-1,s+I-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Os(t){var e=t.lastRenderedStartIndex,s=t.lastRenderedStopIndex,r=t.startIndex,a=t.stopIndex;return!(r>s||a<e)}function Es(t){for(var e=t.isItemLoaded,s=t.itemCount,r=t.minimumBatchSize,a=t.startIndex,c=t.stopIndex,p=[],h=null,m=null,x=a;x<=c;x++){var _=e(x);_?m!==null&&(p.push(h,m),h=m=null):(m=x,h===null&&(h=x))}if(m!==null){for(var v=Math.min(Math.max(m,h+r-1),s-1),o=m+1;o<=v&&!e(o);o++)m=o;p.push(h,m)}if(p.length)for(;p[1]-p[0]+1<r&&p[0]>0;){var I=p[0]-1;if(!e(I))p[0]=I;else break}return p}var ks=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},bs=function(){function t(e,s){for(var r=0;r<s.length;r++){var a=s[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,s,r){return s&&t(e.prototype,s),r&&t(e,r),e}}(),Ls=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},fe=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Cs=function(t){Ls(e,t);function e(){var s,r,a,c;ks(this,e);for(var p=arguments.length,h=Array(p),m=0;m<p;m++)h[m]=arguments[m];return c=(r=(a=fe(this,(s=e.__proto__||Object.getPrototypeOf(e)).call.apply(s,[this].concat(h))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(x){var _=x.visibleStartIndex,v=x.visibleStopIndex;a._lastRenderedStartIndex=_,a._lastRenderedStopIndex=v,a._ensureRowsLoaded(_,v)},a._setRef=function(x){a._listRef=x},r),fe(a,c)}return bs(e,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var c=this.props,p=c.isItemLoaded,h=c.itemCount,m=c.minimumBatchSize,x=m===void 0?10:m,_=c.threshold,v=_===void 0?15:_,o=Es({isItemLoaded:p,itemCount:h,minimumBatchSize:x,startIndex:Math.max(0,r-v),stopIndex:Math.min(h-1,a+v)});(this._memoizedUnloadedRanges.length!==o.length||this._memoizedUnloadedRanges.some(function(I,y){return o[y]!==I}))&&(this._memoizedUnloadedRanges=o,this._loadUnloadedRanges(o))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,p=function(x){var _=r[x],v=r[x+1],o=c(_,v);o!=null&&o.then(function(){if(Os({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:_,stopIndex:v})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(_,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},h=0;h<r.length;h+=2)p(h)}}]),e}(j.PureComponent);const Rs=()=>i.e1,$s=i.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Qs=i.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Us=i.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),qs=i.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Ys=i.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Ps=i.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Fs=i.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Ws=i.styled_default(Rs())({name:"x",class:"x13mk3z6",propsAsIs:!0}),Vs=({rank:t,avatar:e,name:s,points:r,isCurrentUser:a,openItemDetail:c,style:p})=>n.jsxs($s,{onClick:c,style:p,children:[n.jsx(Qs,{children:t||0}),n.jsxs(Ys,{children:[e?n.jsx(Us,{alt:"leaderboard-item-avatar",src:e}):n.jsx(qs,{children:i.e(s||"")}),n.jsxs(Ps,{children:[n.jsx(Fs,{children:s||""}),a&&n.jsx(Ws,{name:"icon-star"})]})]}),n.jsx("div",{children:i.a(r)})]}),Hs=({items:t,openItemDetail:e,fetchMore:s})=>n.jsx(vs,{children:({width:r,height:a})=>n.jsx(Cs,{isItemLoaded:c=>c<t.length,itemCount:t.length+1,loadMoreItems:s,children:({onItemsRendered:c,ref:p})=>n.jsx(ws,{itemSize:56,onItemsRendered:c,ref:p,itemCount:t.length,width:r,height:a,children:({index:h,style:m})=>n.jsx(Vs,{style:{...m,maxHeight:48},...t[h],openItemDetail:()=>e(t[h].userId)},t[h].userId)})})}),Bs=({leaderboardList:t,openUser:e})=>{const{data:s}=i.useStore(t.$store);return n.jsx(Hs,{fetchMore:t.fetchMore,items:s,openItemDetail:e})};const Gs=i.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),Zs=i.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),Js=({disabled:t,variant:e="primary",onClick:s,children:r,...a})=>n.jsx(Gs,{onClick:s,disabled:t,"data-variant":e,...a,children:n.jsx(Zs,{children:r})});const Ks=()=>i.e1,Xs=()=>i.e1,en=i.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),tn=i.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),sn=i.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),nn=i.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),q=i.styled_default(Ks())({name:"c",class:"c6fk2ph",propsAsIs:!0}),rn=i.styled_default(Xs())({name:"d",class:"d1rdm136",propsAsIs:!0}),an=i.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),ln=i.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),on={[i.PickHistoryStatus.LOST]:n.jsx(q,{name:"icon-cross"}),[i.PickHistoryStatus.WON]:n.jsx(q,{name:"icon-check"}),[i.PickHistoryStatus.UNSET]:void 0,[i.PickHistoryStatus.DNP]:n.jsx(q,{name:"icon-arrow"})},dn=({questionId:t,questionType:e,questionStatus:s,subject:r,openForVoting:a,openQuestion:c,status:p})=>{const h=i.o[e],m=on[p];return h?n.jsxs(en,{onClick:()=>c==null?void 0:c(t),children:[n.jsxs(ln,{children:[n.jsxs(tn,{children:[n.jsx(rn,{name:h.iconName}),n.jsxs(an,{children:[h.label,e===i.QuestionType.TRIVIA&&s===i.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(sn,{children:r||""})]}),n.jsx(nn,{children:m||(a?n.jsx(Js,{children:"Play"}):null)})]}):null};const cn=i.styled_default("div")({name:"e",class:"e1jcgove",propsAsIs:!1}),un=i.styled_default("div")({name:"t",class:"t1bwp7hh",propsAsIs:!1}),pn=i.styled_default("div")({name:"i",class:"i1xav4cl",propsAsIs:!1}),fn=i.styled_default("h3")({name:"n",class:"n3qb30y",propsAsIs:!1}),hn=i.styled_default("div")({name:"a",class:"ap5d9g7",propsAsIs:!1}),mn=i.styled_default("button")({name:"l",class:"lvdbmlu",propsAsIs:!1}),gn=({title:t,instantView:e,openInsight:s,questionId:r})=>{const a=new Date,c=a.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),p=a.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return n.jsxs(cn,{children:[n.jsxs(un,{children:[c,"・",p]}),(e==null?void 0:e.video)&&n.jsx(i.w,{source:e.video.url,poster:e.video.thumbnailUrl}),n.jsxs(pn,{children:[n.jsx(fn,{children:(e==null?void 0:e.heading)||t}),n.jsx(hn,{children:e==null?void 0:e.body}),s&&n.jsx(mn,{onClick:()=>s(r),children:"View Insight"})]})]})};const yn=i.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),In=({questions:t,openQuestion:e})=>n.jsx(yn,{children:t==null?void 0:t.map(s=>{var r,a;if(s.type==="question"&&((r=s.attributes)==null?void 0:r.attributes.case)==="question"){const c=s.attributes.attributes.value;return n.jsx(dn,{openQuestion:e,...c},c.questionId)}if(s.type==="insight"&&((a=s.attributes)==null?void 0:a.attributes.case)==="insight"){const c=s.attributes.attributes.value;return n.jsx(gn,{openInsight:e,...c},c.questionId)}return null})}),xn=({store:t,openQuestion:e})=>{const s=i.useStore(t);return s!=null&&s.data?n.jsx(In,{openQuestion:e,questions:s.data}):n.jsx("div",{children:"wait questions..."})},vn=({userSummary:t})=>{var e;const s=i.useStore(t.getStore());return(e=s.data)!=null&&e.summary?n.jsx(ge,{...s.data.summary,...s.data.percentage}):n.jsx("div",{children:"wait user..."})},_n=({gamification:t})=>{const[e,s]=j.useState(E.HOME);return n.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[n.jsxs(i.e$1,{children:[n.jsx(Is,{activePage:e,toggleActivePage:s}),e===E.HOME&&n.jsx(vn,{userSummary:t.userSummary})]}),e===E.HOME&&n.jsx(i.n,{children:n.jsx(xn,{openQuestion:t.openQuestion,store:t.feedList.getStore()})}),e===E.LEADERBOARD&&n.jsx(i.n,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:n.jsx(Bs,{openUser:t.openUser,leaderboardList:t.leaderboardList})})]})};const Mn=()=>i.f,he=i.styled_default(Mn())({name:"m",class:"m1ph66cs",propsAsIs:!0}),jn=i.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),ve=({gamification:t,className:e})=>{const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedUser);return n.jsxs(n.Fragment,{children:[s&&n.jsx(he,{className:e,children:n.jsx(fs,{gamification:t})}),r&&n.jsx(he,{className:e,children:n.jsxs(jn,{children:[n.jsx(me,{label:"Friend's Rank",close:t.closeUser}),n.jsx(i.e$1,{children:n.jsx(ge,{...r})})]})}),n.jsx(i.r,{className:e,"data-nav":"true",children:n.jsx(_n,{gamification:t})})]})};exports.GamificationOverlay=ve;exports.default=ve;
|
package/lib/index-a4c9d828.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),y=require("./index-6b61558d.cjs"),ie=require("@nanostores/react"),V=require("./masters-13b0f21d.cjs"),$=require("react"),C=require("@streamlayer/sdk-web-types"),Ee=require("./common-dc2f2d4f.cjs"),Dt=require("react-countdown-circle-timer"),ue=require("./index-89c19a6e.cjs");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("./cjs/useStreamLayerApp.js");require("@streamlayer/sdk-web");const bt=()=>y.e1,Ot=()=>y.e1,Bt=y.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Ct=y.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),Lt=y.styled_default(bt())({name:"p",class:"p14kwh4y",propsAsIs:!0}),Rt=y.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),kt=y.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Ut=y.styled_default(Ot())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),ht=({type:n,close:i,label:a})=>{const u=n?V.o[n]:{label:a,iconName:void 0};return c.jsxs(Bt,{children:[c.jsxs(Ct,{children:[(u==null?void 0:u.iconName)&&c.jsx(Lt,{name:u.iconName}),(u==null?void 0:u.label)&&c.jsx(Rt,{children:u.label})]}),c.jsx(kt,{onClick:i,children:c.jsx(Ut,{name:"icon-cross"})})]})};const Ft=y.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),$t=y.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Qt=y.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),Je=({indicator:n,title:i})=>c.jsxs(Ft,{children:[c.jsx($t,{children:i}),c.jsx(Qt,{children:n})]});const Pt=y.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),qt=y.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),Yt=y.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),Me=({indicator:n,title:i})=>c.jsxs(Pt,{children:[c.jsx(qt,{children:n}),c.jsx(Yt,{children:i})]});const Wt=y.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),Vt=y.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),Ht=y.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Gt=y.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),Zt=y.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Jt=y.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Kt=y.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Xt=y.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),er=y.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),tr=y.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),rr=y.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),ir=y.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),nr=y.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),sr=y.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),or=y.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),ar=y.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),lr=y.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),cr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pt=({avatar:n,name:i,points:a,friendsRank:u,rank:d,streak:g,correct:m,incorrect:o,inTop:w,average:T})=>c.jsxs(Wt,{children:[c.jsx(Vt,{children:c.jsxs(Gt,{children:[c.jsxs(lr,{children:[n&&c.jsx(Zt,{alt:"avatar",src:n}),!n&&c.jsx(ar,{children:Ee.e(i||"")})]}),c.jsxs(Jt,{children:[c.jsx(Kt,{children:i}),c.jsxs(Xt,{children:[c.jsxs(tr,{children:[c.jsx(er,{alt:"rank-icon",src:cr}),c.jsxs(rr,{children:[Ee.a(a),c.jsx(ir,{children:"PTS"})]})]}),c.jsx(nr,{}),c.jsxs("div",{children:["TOP ",w||0,"%"]})]})]})]})}),c.jsxs(Ht,{children:[c.jsxs(sr,{children:[c.jsx(Je,{indicator:u||0,title:"Friends rank"}),c.jsx(Je,{indicator:d||0,title:"Global rank"})]}),c.jsxs(or,{children:[c.jsx(Me,{indicator:g||0,title:"Win streak"}),c.jsx(Me,{indicator:m||0,title:"Correct"}),c.jsx(Me,{indicator:o||0,title:"Incorrect"}),c.jsx(Me,{indicator:`${T||0}%`,title:"Succ. rate"})]})]})]});const ur=()=>y.e1,dr=y.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),fr=y.styled_default(ur())({name:"n",class:"nfic4xc",propsAsIs:!0}),hr=y.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),pr=y.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),mr=y.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),Ke=y.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),yr=({feedbackMessages:n,questionVotedCorrectly:i,questionVoted:a,questionType:u,hasCorrectAnswer:d})=>{if(!(a&&(u===C.QuestionType.TRIVIA||u===C.QuestionType.PREDICTION)))return null;const g=u===C.QuestionType.PREDICTION&&!d,m=i?"correct":"incorrect",o=i?n.correctFeedback:n.incorrectFeedback;return c.jsxs(dr,{"data-isPrediction":g,children:[g&&c.jsxs(c.Fragment,{children:[c.jsx(fr,{name:"icon-prediction"}),c.jsx(Ke,{children:"Stay tuned to see if your prediction was correct."})]}),d&&c.jsxs(c.Fragment,{children:[c.jsx(hr,{"data-feedbackType":m,children:c.jsx(y.e1,{name:m})}),c.jsx("div",{children:c.jsxs(pr,{children:[c.jsx(mr,{"data-feedbackType":m,children:o==null?void 0:o.title}),c.jsx(Ke,{children:o==null?void 0:o.description})]})})]})]})};const gr=y.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),xr=y.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),Ir=y.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),wr=y.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const _r=()=>mt,Mr=()=>mt,Ar=()=>y.e1,Er=y.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),Tr=y.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),Nr=y.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),jr=y.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),vr=y.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),mt=y.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),Sr=y.styled_default(_r())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),zr=y.styled_default(Mr())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),Dr=y.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),br=y.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),Or=y.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),Br=y.styled_default(Ar())({name:"v",class:"v10s9my2",propsAsIs:!0}),Xe={[C.QuestionImages.CENTERED]:n=>c.jsx(Sr,{alt:"option-icon",src:n}),[C.QuestionImages.TRANSPARENT]:n=>c.jsx(jr,{children:c.jsx(vr,{style:{backgroundImage:`url(${n})`}})}),[C.QuestionImages.ROUNDED]:n=>c.jsx(zr,{alt:"option-icon",src:n}),[C.QuestionImages.NONE]:()=>null,[C.QuestionImages.UNSET]:()=>null},Cr=({questionType:n,hasCorrectAnswer:i,correct:a,youVoted:u,questionVoted:d})=>{if(n===C.QuestionType.POLL&&u)return"correct";if(n===C.QuestionType.PREDICTION){if(i&&d)return u?a?"correct":"incorrect":a?"correct":"unset";if(u)return"correct"}return n===C.QuestionType.TRIVIA&&d?u?a?"correct":"incorrect":a?"correct":"unset":"unset"},Lr=({questionType:n,questionVoted:i,correct:a,hasCorrectAnswer:u,questionStatus:d})=>n===C.QuestionType.TRIVIA?i&&a:n===C.QuestionType.PREDICTION?i&&a&&u||d===C.QuestionStatus.RESOLVED&&a:!1,Rr=n=>{var i;const{id:a,icon:u,text:d,percentageDecimal:g,onVote:m,youSelected:o,questionVoted:w,imageMode:T=C.QuestionImages.ROUNDED,answerTimeExpired:N,questionStatus:j,isLoading:x,questionType:A,correct:E,hasCorrectAnswer:h}=n,_=Cr(n),I=Lr({questionType:A,questionVoted:w,correct:E,hasCorrectAnswer:h,questionStatus:j}),M=w||j===C.QuestionStatus.RESOLVED&&A===C.QuestionType.PREDICTION;return c.jsxs(Er,{value:a,"data-selected":o,"data-answerState":_,disabled:w||x||N,onClick:m,children:[M&&c.jsx(Tr,{"data-answerState":_,style:{width:`${g}%`}}),c.jsxs(Nr,{children:[u&&((i=Xe[T])==null?void 0:i.call(Xe,u)),c.jsx(Dr,{children:d}),M&&c.jsxs(br,{children:[I&&c.jsx(Br,{name:"selected"}),c.jsxs(Or,{children:[g,"%"]})]})]})]})};const kr=[ue.E.PRIMARY_GREEN1,ue.E.SECONDARY_RED1,ue.E.SECONDARY_RED1],Ur=[10,10,0],Fr=y.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),$r=ue.E.SECONDARY_GREEN6,et=ue.E.SECONDARY_RED3,Qr=ue.E.NEUTRALS_GRAY3,Pr=({isPlaying:n=!0,duration:i=30,onTimerExpired:a})=>{const[u,d]=$.useState(i>10?$r:et),g=({remainingTime:w})=>c.jsx(Fr,{children:w}),m=$.useCallback(()=>{a==null||a(),d(Qr)},[a,d]),o=$.useCallback(w=>{w===10&&d(et)},[d]);return c.jsx(Dt.CountdownCircleTimer,{isPlaying:n,duration:i,colors:kr,colorsTime:Ur,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:u,onComplete:m,onUpdate:o,children:g})};const qr=()=>y.e1,Yr=y.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Wr=y.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Vr=y.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Hr=y.styled_default(qr())({name:"p",class:"p1edlxt3",propsAsIs:!0}),Gr=y.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),Zr=y.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),Jr=y.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),Kr=({title:n,points:i,isPlayingTimer:a,isTimer:u,onTimerExpired:d})=>c.jsxs(Yr,{children:[c.jsxs(Wr,{children:[n&&c.jsx(Vr,{children:n}),i!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx(Hr,{name:"icon-trophy"}),c.jsxs(Gr,{children:[c.jsx(Zr,{children:i}),c.jsx(Jr,{children:"PTS"})]})]})]}),u&&c.jsx(Pr,{isPlaying:a,onTimerExpired:d})]}),Xr=({openedQuestion:n,vote:i})=>{var a;const u=n.subject,d=n.type,g=(a=n.options)==null?void 0:a.options,[m,o]=$.useState(!1),[w,T]=$.useState(!1),[N,j]=$.useState(""),x=n==null?void 0:n.id,A=$.useCallback(async M=>{if(x){const v=M.currentTarget.value;j(v),T(!0),await i(x,v),T(!1)}},[x,j,i]),E=$.useMemo(()=>n==null?void 0:n.answers.find(M=>M.youVoted===!0),[n]),h=$.useMemo(()=>!!(n!=null&&n.answers.find(M=>M.correct===!0)),[n]),_=$.useMemo(()=>n?n.answers.map(M=>({...M,questionVoted:!!E,youSelected:N===M.id,isLoading:w,hasCorrectAnswer:h,questionType:n.type,answerTimeExpired:m,questionStatus:n.status,onVote:A})):[],[h,m,w,n,E,A,N]),I=g&&(g.case==="trivia"||g.case==="prediction")?g.value:void 0;return c.jsx(V.r,{"data-question-header":"true",children:c.jsx(gr,{children:c.jsxs(xr,{children:[I&&c.jsx(yr,{feedbackMessages:I,questionVoted:!!E,questionVotedCorrectly:E==null?void 0:E.correct,questionType:d,hasCorrectAnswer:h}),c.jsx(Kr,{title:m?"Expired":"To win",points:m?void 0:100,onTimerExpired:()=>o(!0),isTimer:!0}),c.jsx(Ir,{children:u}),c.jsx(wr,{children:_.map(M=>c.jsx(Rr,{...M},M.id))})]})})})};const ei=y.styled_default("div")({name:"e",class:"e18unvw4",propsAsIs:!1}),ti=y.styled_default("div")({name:"r",class:"rs0uvk8",propsAsIs:!1}),ri=y.styled_default("h3")({name:"n",class:"n1hem4g7",propsAsIs:!1}),ii=y.styled_default("div")({name:"i",class:"i193lbwv",propsAsIs:!1}),ni=y.styled_default("a")({name:"a",class:"a1dka9qs",propsAsIs:!1}),si=y.styled_default("div")({name:"l",class:"l1un98tk",propsAsIs:!1}),oi=({created:n,title:i,instantView:a})=>{const u=new Date(n),d=u.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),g=u.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return c.jsxs(ei,{children:[c.jsxs(si,{children:[d,"・",g]}),(a==null?void 0:a.video)&&c.jsx(V.w,{source:a.video.url,poster:a.video.thumbnailUrl}),c.jsxs(ti,{children:[c.jsx(ri,{children:(a==null?void 0:a.heading)||i}),c.jsx(ii,{children:a==null?void 0:a.body}),(a==null?void 0:a.webLink)&&c.jsxs(ni,{href:a==null?void 0:a.webLink.url,target:"_blank",children:["Explore more of the Masters History",c.jsx(y.e1,{name:"icon-external-link"})]})]})]})};const ai=y.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),li=({openedQuestion:n})=>{var i;return((i=n==null?void 0:n.attributes)==null?void 0:i.attributes.case)==="insight"?c.jsx(oi,{created:n.attributes.created,...n.attributes.attributes.value}):null},ci=({extendedQuestion:n,vote:i})=>{const{loading:a,data:u}=n;return!a&&u?c.jsx(Xr,{vote:i,openedQuestion:u}):null},ui=({gamification:n})=>{var i;const a=ie.useStore(n.openedQuestion.$store),u=ie.useStore(n.openedQuestion.$extendedStore);if(!a)return null;const d=a.type;return c.jsxs(ai,{children:[c.jsx(ht,{close:n.closeQuestion,type:((i=a.attributes)==null?void 0:i.type)||C.QuestionType.UNSET}),d==="question"&&c.jsx(ci,{vote:n.submitAnswer,extendedQuestion:u}),d!=="question"&&c.jsx(li,{openedQuestion:a})]})};const di=y.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),fi=y.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),hi=y.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),pi=y.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var ye=(n=>(n.HOME="home",n.LEADERBOARD="leaderboard",n))(ye||{});const tt=({title:n,active:i,onClick:a})=>c.jsx(hi,{onClick:a,"data-selected":i,children:c.jsx(pi,{children:n})}),mi=({activePage:n="home",toggleActivePage:i})=>c.jsx(di,{children:c.jsxs(fi,{"data-position":n==="home"?"left":"right",children:[c.jsx(tt,{title:"Home",active:n==="home",onClick:()=>i("home")}),c.jsx(tt,{title:"Leader Board",active:n==="leaderboard",onClick:()=>i("leaderboard")})]})});var yt={},gt={},Te={};Te.byteLength=xi;Te.toByteArray=wi;Te.fromByteArray=Ai;var J=[],P=[],yi=typeof Uint8Array<"u"?Uint8Array:Array,Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var le=0,gi=Oe.length;le<gi;++le)J[le]=Oe[le],P[Oe.charCodeAt(le)]=le;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function xt(n){var i=n.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=n.indexOf("=");a===-1&&(a=i);var u=a===i?0:4-a%4;return[a,u]}function xi(n){var i=xt(n),a=i[0],u=i[1];return(a+u)*3/4-u}function Ii(n,i,a){return(i+a)*3/4-a}function wi(n){var i,a=xt(n),u=a[0],d=a[1],g=new yi(Ii(n,u,d)),m=0,o=d>0?u-4:u,w;for(w=0;w<o;w+=4)i=P[n.charCodeAt(w)]<<18|P[n.charCodeAt(w+1)]<<12|P[n.charCodeAt(w+2)]<<6|P[n.charCodeAt(w+3)],g[m++]=i>>16&255,g[m++]=i>>8&255,g[m++]=i&255;return d===2&&(i=P[n.charCodeAt(w)]<<2|P[n.charCodeAt(w+1)]>>4,g[m++]=i&255),d===1&&(i=P[n.charCodeAt(w)]<<10|P[n.charCodeAt(w+1)]<<4|P[n.charCodeAt(w+2)]>>2,g[m++]=i>>8&255,g[m++]=i&255),g}function _i(n){return J[n>>18&63]+J[n>>12&63]+J[n>>6&63]+J[n&63]}function Mi(n,i,a){for(var u,d=[],g=i;g<a;g+=3)u=(n[g]<<16&16711680)+(n[g+1]<<8&65280)+(n[g+2]&255),d.push(_i(u));return d.join("")}function Ai(n){for(var i,a=n.length,u=a%3,d=[],g=16383,m=0,o=a-u;m<o;m+=g)d.push(Mi(n,m,m+g>o?o:m+g));return u===1?(i=n[a-1],d.push(J[i>>2]+J[i<<4&63]+"==")):u===2&&(i=(n[a-2]<<8)+n[a-1],d.push(J[i>>10]+J[i>>4&63]+J[i<<2&63]+"=")),d.join("")}var Ye={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ye.read=function(n,i,a,u,d){var g,m,o=d*8-u-1,w=(1<<o)-1,T=w>>1,N=-7,j=a?d-1:0,x=a?-1:1,A=n[i+j];for(j+=x,g=A&(1<<-N)-1,A>>=-N,N+=o;N>0;g=g*256+n[i+j],j+=x,N-=8);for(m=g&(1<<-N)-1,g>>=-N,N+=u;N>0;m=m*256+n[i+j],j+=x,N-=8);if(g===0)g=1-T;else{if(g===w)return m?NaN:(A?-1:1)*(1/0);m=m+Math.pow(2,u),g=g-T}return(A?-1:1)*m*Math.pow(2,g-u)};Ye.write=function(n,i,a,u,d,g){var m,o,w,T=g*8-d-1,N=(1<<T)-1,j=N>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=u?0:g-1,E=u?1:-1,h=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(o=isNaN(i)?1:0,m=N):(m=Math.floor(Math.log(i)/Math.LN2),i*(w=Math.pow(2,-m))<1&&(m--,w*=2),m+j>=1?i+=x/w:i+=x*Math.pow(2,1-j),i*w>=2&&(m++,w/=2),m+j>=N?(o=0,m=N):m+j>=1?(o=(i*w-1)*Math.pow(2,d),m=m+j):(o=i*Math.pow(2,j-1)*Math.pow(2,d),m=0));d>=8;n[a+A]=o&255,A+=E,o/=256,d-=8);for(m=m<<d|o,T+=d;T>0;n[a+A]=m&255,A+=E,m/=256,T-=8);n[a+A-E]|=h*128};/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/(function(n){const i=Te,a=Ye,u=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=o,n.SlowBuffer=M,n.INSPECT_MAX_BYTES=50;const d=2147483647;n.kMaxLength=d,o.TYPED_ARRAY_SUPPORT=g(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function g(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function m(r){if(r>d)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,o.prototype),e}function o(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(r)}return w(r,e,t)}o.poolSize=8192;function w(r,e,t){if(typeof r=="string")return x(r,e);if(ArrayBuffer.isView(r))return E(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(H(r,ArrayBuffer)||r&&H(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(H(r,SharedArrayBuffer)||r&&H(r.buffer,SharedArrayBuffer)))return h(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const s=r.valueOf&&r.valueOf();if(s!=null&&s!==r)return o.from(s,e,t);const l=_(r);if(l)return l;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return o.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o.from=function(r,e,t){return w(r,e,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function T(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function N(r,e,t){return T(r),r<=0?m(r):e!==void 0?typeof t=="string"?m(r).fill(e,t):m(r).fill(e):m(r)}o.alloc=function(r,e,t){return N(r,e,t)};function j(r){return T(r),m(r<0?0:I(r)|0)}o.allocUnsafe=function(r){return j(r)},o.allocUnsafeSlow=function(r){return j(r)};function x(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=v(r,e)|0;let s=m(t);const l=s.write(r,e);return l!==t&&(s=s.slice(0,l)),s}function A(r){const e=r.length<0?0:I(r.length)|0,t=m(e);for(let s=0;s<e;s+=1)t[s]=r[s]&255;return t}function E(r){if(H(r,Uint8Array)){const e=new Uint8Array(r);return h(e.buffer,e.byteOffset,e.byteLength)}return A(r)}function h(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let s;return e===void 0&&t===void 0?s=new Uint8Array(r):t===void 0?s=new Uint8Array(r,e):s=new Uint8Array(r,e,t),Object.setPrototypeOf(s,o.prototype),s}function _(r){if(o.isBuffer(r)){const e=I(r.length)|0,t=m(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||be(r.length)?m(0):A(r);if(r.type==="Buffer"&&Array.isArray(r.data))return A(r.data)}function I(r){if(r>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return r|0}function M(r){return+r!=r&&(r=0),o.alloc(+r)}o.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==o.prototype},o.compare=function(e,t){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let s=e.length,l=t.length;for(let f=0,p=Math.min(s,l);f<p;++f)if(e[f]!==t[f]){s=e[f],l=t[f];break}return s<l?-1:l<s?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return o.alloc(0);let s;if(t===void 0)for(t=0,s=0;s<e.length;++s)t+=e[s].length;const l=o.allocUnsafe(t);let f=0;for(s=0;s<e.length;++s){let p=e[s];if(H(p,Uint8Array))f+p.length>l.length?(o.isBuffer(p)||(p=o.from(p)),p.copy(l,f)):Uint8Array.prototype.set.call(l,p,f);else if(o.isBuffer(p))p.copy(l,f);else throw new TypeError('"list" argument must be an Array of Buffers');f+=p.length}return l};function v(r,e){if(o.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||H(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&t===0)return 0;let l=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return De(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ze(r).length;default:if(l)return s?-1:De(r).length;e=(""+e).toLowerCase(),l=!0}}o.byteLength=v;function D(r,e,t){let s=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Se(this,e,t);case"utf8":case"utf-8":return ge(this,e,t);case"ascii":return Ie(this,e,t);case"latin1":case"binary":return fe(this,e,t);case"base64":return je(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return we(this,e,t);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),s=!0}}o.prototype._isBuffer=!0;function S(r,e,t){const s=r[e];r[e]=r[t],r[t]=s}o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)S(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?ge(this,0,e):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:o.compare(this,e)===0},o.prototype.inspect=function(){let e="";const t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},u&&(o.prototype[u]=o.prototype.inspect),o.prototype.compare=function(e,t,s,l,f){if(H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),s===void 0&&(s=e?e.length:0),l===void 0&&(l=0),f===void 0&&(f=this.length),t<0||s>e.length||l<0||f>this.length)throw new RangeError("out of range index");if(l>=f&&t>=s)return 0;if(l>=f)return-1;if(t>=s)return 1;if(t>>>=0,s>>>=0,l>>>=0,f>>>=0,this===e)return 0;let p=f-l,z=s-t;const L=Math.min(p,z),B=this.slice(l,f),R=e.slice(t,s);for(let b=0;b<L;++b)if(B[b]!==R[b]){p=B[b],z=R[b];break}return p<z?-1:z<p?1:0};function O(r,e,t,s,l){if(r.length===0)return-1;if(typeof t=="string"?(s=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,be(t)&&(t=l?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(l)return-1;t=r.length-1}else if(t<0)if(l)t=0;else return-1;if(typeof e=="string"&&(e=o.from(e,s)),o.isBuffer(e))return e.length===0?-1:U(r,e,t,s,l);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):U(r,[e],t,s,l);throw new TypeError("val must be string, number or Buffer")}function U(r,e,t,s,l){let f=1,p=r.length,z=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(r.length<2||e.length<2)return-1;f=2,p/=2,z/=2,t/=2}function L(R,b){return f===1?R[b]:R.readUInt16BE(b*f)}let B;if(l){let R=-1;for(B=t;B<p;B++)if(L(r,B)===L(e,R===-1?0:B-R)){if(R===-1&&(R=B),B-R+1===z)return R*f}else R!==-1&&(B-=B-R),R=-1}else for(t+z>p&&(t=p-z),B=t;B>=0;B--){let R=!0;for(let b=0;b<z;b++)if(L(r,B+b)!==L(e,b)){R=!1;break}if(R)return B}return-1}o.prototype.includes=function(e,t,s){return this.indexOf(e,t,s)!==-1},o.prototype.indexOf=function(e,t,s){return O(this,e,t,s,!0)},o.prototype.lastIndexOf=function(e,t,s){return O(this,e,t,s,!1)};function Y(r,e,t,s){t=Number(t)||0;const l=r.length-t;s?(s=Number(s),s>l&&(s=l)):s=l;const f=e.length;s>f/2&&(s=f/2);let p;for(p=0;p<s;++p){const z=parseInt(e.substr(p*2,2),16);if(be(z))return p;r[t+p]=z}return p}function W(r,e,t,s){return _e(De(e,r.length-t),r,t,s)}function ne(r,e,t,s){return _e(jt(e),r,t,s)}function se(r,e,t,s){return _e(Ze(e),r,t,s)}function Ne(r,e,t,s){return _e(vt(e,r.length-t),r,t,s)}o.prototype.write=function(e,t,s,l){if(t===void 0)l="utf8",s=this.length,t=0;else if(s===void 0&&typeof t=="string")l=t,s=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(s)?(s=s>>>0,l===void 0&&(l="utf8")):(l=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const f=this.length-t;if((s===void 0||s>f)&&(s=f),e.length>0&&(s<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");let p=!1;for(;;)switch(l){case"hex":return Y(this,e,t,s);case"utf8":case"utf-8":return W(this,e,t,s);case"ascii":case"latin1":case"binary":return ne(this,e,t,s);case"base64":return se(this,e,t,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ne(this,e,t,s);default:if(p)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(r,e,t){return e===0&&t===r.length?i.fromByteArray(r):i.fromByteArray(r.slice(e,t))}function ge(r,e,t){t=Math.min(r.length,t);const s=[];let l=e;for(;l<t;){const f=r[l];let p=null,z=f>239?4:f>223?3:f>191?2:1;if(l+z<=t){let L,B,R,b;switch(z){case 1:f<128&&(p=f);break;case 2:L=r[l+1],(L&192)===128&&(b=(f&31)<<6|L&63,b>127&&(p=b));break;case 3:L=r[l+1],B=r[l+2],(L&192)===128&&(B&192)===128&&(b=(f&15)<<12|(L&63)<<6|B&63,b>2047&&(b<55296||b>57343)&&(p=b));break;case 4:L=r[l+1],B=r[l+2],R=r[l+3],(L&192)===128&&(B&192)===128&&(R&192)===128&&(b=(f&15)<<18|(L&63)<<12|(B&63)<<6|R&63,b>65535&&b<1114112&&(p=b))}}p===null?(p=65533,z=1):p>65535&&(p-=65536,s.push(p>>>10&1023|55296),p=56320|p&1023),s.push(p),l+=z}return ve(s)}const xe=4096;function ve(r){const e=r.length;if(e<=xe)return String.fromCharCode.apply(String,r);let t="",s=0;for(;s<e;)t+=String.fromCharCode.apply(String,r.slice(s,s+=xe));return t}function Ie(r,e,t){let s="";t=Math.min(r.length,t);for(let l=e;l<t;++l)s+=String.fromCharCode(r[l]&127);return s}function fe(r,e,t){let s="";t=Math.min(r.length,t);for(let l=e;l<t;++l)s+=String.fromCharCode(r[l]);return s}function Se(r,e,t){const s=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>s)&&(t=s);let l="";for(let f=e;f<t;++f)l+=St[r[f]];return l}function we(r,e,t){const s=r.slice(e,t);let l="";for(let f=0;f<s.length-1;f+=2)l+=String.fromCharCode(s[f]+s[f+1]*256);return l}o.prototype.slice=function(e,t){const s=this.length;e=~~e,t=t===void 0?s:~~t,e<0?(e+=s,e<0&&(e=0)):e>s&&(e=s),t<0?(t+=s,t<0&&(t=0)):t>s&&(t=s),t<e&&(t=e);const l=this.subarray(e,t);return Object.setPrototypeOf(l,o.prototype),l};function F(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||F(e,t,this.length);let l=this[e],f=1,p=0;for(;++p<t&&(f*=256);)l+=this[e+p]*f;return l},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,s){e=e>>>0,t=t>>>0,s||F(e,t,this.length);let l=this[e+--t],f=1;for(;t>0&&(f*=256);)l+=this[e+--t]*f;return l},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e=e>>>0,t||F(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||F(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||F(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=te(function(e){e=e>>>0,ae(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&me(e,this.length-8);const l=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,f=this[++e]+this[++e]*2**8+this[++e]*2**16+s*2**24;return BigInt(l)+(BigInt(f)<<BigInt(32))}),o.prototype.readBigUInt64BE=te(function(e){e=e>>>0,ae(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&me(e,this.length-8);const l=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],f=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s;return(BigInt(l)<<BigInt(32))+BigInt(f)}),o.prototype.readIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||F(e,t,this.length);let l=this[e],f=1,p=0;for(;++p<t&&(f*=256);)l+=this[e+p]*f;return f*=128,l>=f&&(l-=Math.pow(2,8*t)),l},o.prototype.readIntBE=function(e,t,s){e=e>>>0,t=t>>>0,s||F(e,t,this.length);let l=t,f=1,p=this[e+--l];for(;l>0&&(f*=256);)p+=this[e+--l]*f;return f*=128,p>=f&&(p-=Math.pow(2,8*t)),p},o.prototype.readInt8=function(e,t){return e=e>>>0,t||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){e=e>>>0,t||F(e,2,this.length);const s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},o.prototype.readInt16BE=function(e,t){e=e>>>0,t||F(e,2,this.length);const s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},o.prototype.readInt32LE=function(e,t){return e=e>>>0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e=e>>>0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=te(function(e){e=e>>>0,ae(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&me(e,this.length-8);const l=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(s<<24);return(BigInt(l)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),o.prototype.readBigInt64BE=te(function(e){e=e>>>0,ae(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&me(e,this.length-8);const l=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(l)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s)}),o.prototype.readFloatLE=function(e,t){return e=e>>>0,t||F(e,4,this.length),a.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e=e>>>0,t||F(e,4,this.length),a.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||F(e,8,this.length),a.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||F(e,8,this.length),a.read(this,e,!1,52,8)};function Q(r,e,t,s,l,f){if(!o.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>l||e<f)throw new RangeError('"value" argument is out of bounds');if(t+s>r.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,s,l){if(e=+e,t=t>>>0,s=s>>>0,!l){const z=Math.pow(2,8*s)-1;Q(this,e,t,s,z,0)}let f=1,p=0;for(this[t]=e&255;++p<s&&(f*=256);)this[t+p]=e/f&255;return t+s},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,s,l){if(e=+e,t=t>>>0,s=s>>>0,!l){const z=Math.pow(2,8*s)-1;Q(this,e,t,s,z,0)}let f=s-1,p=1;for(this[t+f]=e&255;--f>=0&&(p*=256);)this[t+f]=e/p&255;return t+s},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,1,255,0),this[t]=e&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function he(r,e,t,s,l){Ge(e,s,l,r,t,7);let f=Number(e&BigInt(4294967295));r[t++]=f,f=f>>8,r[t++]=f,f=f>>8,r[t++]=f,f=f>>8,r[t++]=f;let p=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=p,p=p>>8,r[t++]=p,p=p>>8,r[t++]=p,p=p>>8,r[t++]=p,t}function ee(r,e,t,s,l){Ge(e,s,l,r,t,7);let f=Number(e&BigInt(4294967295));r[t+7]=f,f=f>>8,r[t+6]=f,f=f>>8,r[t+5]=f,f=f>>8,r[t+4]=f;let p=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=p,p=p>>8,r[t+2]=p,p=p>>8,r[t+1]=p,p=p>>8,r[t]=p,t+8}o.prototype.writeBigUInt64LE=te(function(e,t=0){return he(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=te(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,s,l){if(e=+e,t=t>>>0,!l){const L=Math.pow(2,8*s-1);Q(this,e,t,s,L-1,-L)}let f=0,p=1,z=0;for(this[t]=e&255;++f<s&&(p*=256);)e<0&&z===0&&this[t+f-1]!==0&&(z=1),this[t+f]=(e/p>>0)-z&255;return t+s},o.prototype.writeIntBE=function(e,t,s,l){if(e=+e,t=t>>>0,!l){const L=Math.pow(2,8*s-1);Q(this,e,t,s,L-1,-L)}let f=s-1,p=1,z=0;for(this[t+f]=e&255;--f>=0&&(p*=256);)e<0&&z===0&&this[t+f+1]!==0&&(z=1),this[t+f]=(e/p>>0)-z&255;return t+s},o.prototype.writeInt8=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},o.prototype.writeInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||Q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},o.prototype.writeBigInt64LE=te(function(e,t=0){return he(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=te(function(e,t=0){return ee(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pe(r,e,t,s,l,f){if(t+s>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function We(r,e,t,s,l){return e=+e,t=t>>>0,l||pe(r,e,t,4),a.write(r,e,t,s,23,4),t+4}o.prototype.writeFloatLE=function(e,t,s){return We(this,e,t,!0,s)},o.prototype.writeFloatBE=function(e,t,s){return We(this,e,t,!1,s)};function Ve(r,e,t,s,l){return e=+e,t=t>>>0,l||pe(r,e,t,8),a.write(r,e,t,s,52,8),t+8}o.prototype.writeDoubleLE=function(e,t,s){return Ve(this,e,t,!0,s)},o.prototype.writeDoubleBE=function(e,t,s){return Ve(this,e,t,!1,s)},o.prototype.copy=function(e,t,s,l){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(s||(s=0),!l&&l!==0&&(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&l<s&&(l=s),l===s||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-s&&(l=e.length-t+s);const f=l-s;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,s,l):Uint8Array.prototype.set.call(e,this.subarray(s,l),t),f},o.prototype.fill=function(e,t,s,l){if(typeof e=="string"){if(typeof t=="string"?(l=t,t=0,s=this.length):typeof s=="string"&&(l=s,s=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(e.length===1){const p=e.charCodeAt(0);(l==="utf8"&&p<128||l==="latin1")&&(e=p)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<s)throw new RangeError("Out of range index");if(s<=t)return this;t=t>>>0,s=s===void 0?this.length:s>>>0,e||(e=0);let f;if(typeof e=="number")for(f=t;f<s;++f)this[f]=e;else{const p=o.isBuffer(e)?e:o.from(e,l),z=p.length;if(z===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(f=0;f<s-t;++f)this[f+t]=p[f%z]}return this};const oe={};function ze(r,e,t){oe[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(l){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:l,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}ze("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ze("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),ze("ERR_OUT_OF_RANGE",function(r,e,t){let s=`The value of "${r}" is out of range.`,l=t;return Number.isInteger(t)&&Math.abs(t)>2**32?l=He(String(t)):typeof t=="bigint"&&(l=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(l=He(l)),l+="n"),s+=` It must be ${e}. Received ${l}`,s},RangeError);function He(r){let e="",t=r.length;const s=r[0]==="-"?1:0;for(;t>=s+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function Et(r,e,t){ae(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&me(e,r.length-(t+1))}function Ge(r,e,t,s,l,f){if(r>t||r<e){const p=typeof e=="bigint"?"n":"";let z;throw f>3?e===0||e===BigInt(0)?z=`>= 0${p} and < 2${p} ** ${(f+1)*8}${p}`:z=`>= -(2${p} ** ${(f+1)*8-1}${p}) and < 2 ** ${(f+1)*8-1}${p}`:z=`>= ${e}${p} and <= ${t}${p}`,new oe.ERR_OUT_OF_RANGE("value",z,r)}Et(s,l,f)}function ae(r,e){if(typeof r!="number")throw new oe.ERR_INVALID_ARG_TYPE(e,"number",r)}function me(r,e,t){throw Math.floor(r)!==r?(ae(r,t),new oe.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new oe.ERR_BUFFER_OUT_OF_BOUNDS:new oe.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}const Tt=/[^+/0-9A-Za-z-_]/g;function Nt(r){if(r=r.split("=")[0],r=r.trim().replace(Tt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function De(r,e){e=e||1/0;let t;const s=r.length;let l=null;const f=[];for(let p=0;p<s;++p){if(t=r.charCodeAt(p),t>55295&&t<57344){if(!l){if(t>56319){(e-=3)>-1&&f.push(239,191,189);continue}else if(p+1===s){(e-=3)>-1&&f.push(239,191,189);continue}l=t;continue}if(t<56320){(e-=3)>-1&&f.push(239,191,189),l=t;continue}t=(l-55296<<10|t-56320)+65536}else l&&(e-=3)>-1&&f.push(239,191,189);if(l=null,t<128){if((e-=1)<0)break;f.push(t)}else if(t<2048){if((e-=2)<0)break;f.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;f.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;f.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return f}function jt(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function vt(r,e){let t,s,l;const f=[];for(let p=0;p<r.length&&!((e-=2)<0);++p)t=r.charCodeAt(p),s=t>>8,l=t%256,f.push(l),f.push(s);return f}function Ze(r){return i.toByteArray(Nt(r))}function _e(r,e,t,s){let l;for(l=0;l<s&&!(l+t>=e.length||l>=r.length);++l)e[l+t]=r[l];return l}function H(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function be(r){return r!==r}const St=function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const s=t*16;for(let l=0;l<16;++l)e[s+l]=r[t]+r[l]}return e}();function te(r){return typeof BigInt>"u"?zt:r}function zt(){throw new Error("BigInt not supported")}})(gt);var It={exports:{}},k=It.exports={},G,Z;function Ue(){throw new Error("setTimeout has not been defined")}function Fe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=Ue}catch{G=Ue}try{typeof clearTimeout=="function"?Z=clearTimeout:Z=Fe}catch{Z=Fe}})();function wt(n){if(G===setTimeout)return setTimeout(n,0);if((G===Ue||!G)&&setTimeout)return G=setTimeout,setTimeout(n,0);try{return G(n,0)}catch{try{return G.call(null,n,0)}catch{return G.call(this,n,0)}}}function Ei(n){if(Z===clearTimeout)return clearTimeout(n);if((Z===Fe||!Z)&&clearTimeout)return Z=clearTimeout,clearTimeout(n);try{return Z(n)}catch{try{return Z.call(null,n)}catch{return Z.call(this,n)}}}var K=[],de=!1,re,Ae=-1;function Ti(){!de||!re||(de=!1,re.length?K=re.concat(K):Ae=-1,K.length&&_t())}function _t(){if(!de){var n=wt(Ti);de=!0;for(var i=K.length;i;){for(re=K,K=[];++Ae<i;)re&&re[Ae].run();Ae=-1,i=K.length}re=null,de=!1,Ei(n)}}k.nextTick=function(n){var i=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)i[a-1]=arguments[a];K.push(new Mt(n,i)),K.length===1&&!de&&wt(_t)};function Mt(n,i){this.fun=n,this.array=i}Mt.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function X(){}k.on=X;k.addListener=X;k.once=X;k.off=X;k.removeListener=X;k.removeAllListeners=X;k.emit=X;k.prependListener=X;k.prependOnceListener=X;k.listeners=function(n){return[]};k.binding=function(n){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(n){throw new Error("process.chdir is not supported")};k.umask=function(){return 0};var Ni=It.exports;(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const i=gt,a=Ni,u=m=>m&&m.__esModule?m:{default:m},d=u(a),g=globalThis||void 0||self;Object.defineProperty(n,"Buffer",{enumerable:!0,get:()=>i.Buffer}),Object.defineProperty(n,"process",{enumerable:!0,get:()=>d.default}),n.global=g})(yt);let q;typeof window<"u"?q=window:typeof self<"u"?q=self:q=yt.global;let $e=null,Qe=null;const rt=20,Be=q.clearTimeout,it=q.setTimeout,Ce=q.cancelAnimationFrame||q.mozCancelAnimationFrame||q.webkitCancelAnimationFrame,nt=q.requestAnimationFrame||q.mozRequestAnimationFrame||q.webkitRequestAnimationFrame;Ce==null||nt==null?($e=Be,Qe=function(i){return it(i,rt)}):($e=function([i,a]){Ce(i),Be(a)},Qe=function(i){const a=nt(function(){Be(u),i()}),u=it(function(){Ce(a),i()},rt);return[a,u]});function ji(n){let i,a,u,d,g,m,o;const w=typeof document<"u"&&document.attachEvent;if(!w){m=function(I){const M=I.__resizeTriggers__,v=M.firstElementChild,D=M.lastElementChild,S=v.firstElementChild;D.scrollLeft=D.scrollWidth,D.scrollTop=D.scrollHeight,S.style.width=v.offsetWidth+1+"px",S.style.height=v.offsetHeight+1+"px",v.scrollLeft=v.scrollWidth,v.scrollTop=v.scrollHeight},g=function(I){return I.offsetWidth!==I.__resizeLast__.width||I.offsetHeight!==I.__resizeLast__.height},o=function(I){if(I.target.className&&typeof I.target.className.indexOf=="function"&&I.target.className.indexOf("contract-trigger")<0&&I.target.className.indexOf("expand-trigger")<0)return;const M=this;m(this),this.__resizeRAF__&&$e(this.__resizeRAF__),this.__resizeRAF__=Qe(function(){g(M)&&(M.__resizeLast__.width=M.offsetWidth,M.__resizeLast__.height=M.offsetHeight,M.__resizeListeners__.forEach(function(S){S.call(M,I)}))})};let x=!1,A="";u="animationstart";const E="Webkit Moz O ms".split(" ");let h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),_="";{const I=document.createElement("fakeelement");if(I.style.animationName!==void 0&&(x=!0),x===!1){for(let M=0;M<E.length;M++)if(I.style[E[M]+"AnimationName"]!==void 0){_=E[M],A="-"+_.toLowerCase()+"-",u=h[M],x=!0;break}}}a="resizeanim",i="@"+A+"keyframes "+a+" { from { opacity: 0; } to { opacity: 0; } } ",d=A+"animation: 1ms "+a+"; "}const T=function(x){if(!x.getElementById("detectElementResize")){const A=(i||"")+".resize-triggers { "+(d||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',E=x.head||x.getElementsByTagName("head")[0],h=x.createElement("style");h.id="detectElementResize",h.type="text/css",n!=null&&h.setAttribute("nonce",n),h.styleSheet?h.styleSheet.cssText=A:h.appendChild(x.createTextNode(A)),E.appendChild(h)}};return{addResizeListener:function(x,A){if(w)x.attachEvent("onresize",A);else{if(!x.__resizeTriggers__){const E=x.ownerDocument,h=q.getComputedStyle(x);h&&h.position==="static"&&(x.style.position="relative"),T(E),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=E.createElement("div")).className="resize-triggers";const _=E.createElement("div");_.className="expand-trigger",_.appendChild(E.createElement("div"));const I=E.createElement("div");I.className="contract-trigger",x.__resizeTriggers__.appendChild(_),x.__resizeTriggers__.appendChild(I),x.appendChild(x.__resizeTriggers__),m(x),x.addEventListener("scroll",o,!0),u&&(x.__resizeTriggers__.__animationListener__=function(v){v.animationName===a&&m(x)},x.__resizeTriggers__.addEventListener(u,x.__resizeTriggers__.__animationListener__))}x.__resizeListeners__.push(A)}},removeResizeListener:function(x,A){if(w)x.detachEvent("onresize",A);else if(x.__resizeListeners__.splice(x.__resizeListeners__.indexOf(A),1),!x.__resizeListeners__.length){x.removeEventListener("scroll",o,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(u,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class vi extends $.Component{constructor(...i){super(...i),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:a,disableWidth:u,onResize:d}=this.props;if(this._parentNode){var g,m,o,w;const T=window.getComputedStyle(this._parentNode)||{},N=parseFloat((g=T.paddingLeft)!==null&&g!==void 0?g:"0"),j=parseFloat((m=T.paddingRight)!==null&&m!==void 0?m:"0"),x=parseFloat((o=T.paddingTop)!==null&&o!==void 0?o:"0"),A=parseFloat((w=T.paddingBottom)!==null&&w!==void 0?w:"0"),E=this._parentNode.getBoundingClientRect(),h=E.height-x-A,_=E.width-N-j,I=this._parentNode.offsetHeight-x-A,M=this._parentNode.offsetWidth-N-j;(!a&&(this.state.height!==I||this.state.scaledHeight!==h)||!u&&(this.state.width!==M||this.state.scaledWidth!==_))&&(this.setState({height:I,width:M,scaledHeight:h,scaledWidth:_}),typeof d=="function"&&d({height:I,scaledHeight:h,scaledWidth:_,width:M}))}},this._setRef=a=>{this._autoSizer=a}}componentDidMount(){const{nonce:i}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._parentNode!=null&&(typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=ji(i),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:i,defaultHeight:a,defaultWidth:u,disableHeight:d=!1,disableWidth:g=!1,nonce:m,onResize:o,style:w={},tagName:T="div",...N}=this.props,{height:j,scaledHeight:x,scaledWidth:A,width:E}=this.state,h={overflow:"visible"},_={};let I=!1;return d||(j===0&&(I=!0),h.height=0,_.height=j,_.scaledHeight=x),g||(E===0&&(I=!0),h.width=0,_.width=E,_.scaledWidth=A),$.createElement(T,{ref:this._setRef,style:{...h,...w},...N},!I&&i(_))}}function Pe(){return Pe=Object.assign?Object.assign.bind():function(n){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(n[u]=a[u])}return n},Pe.apply(this,arguments)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function qe(n,i){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,d){return u.__proto__=d,u},qe(n,i)}function Si(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,qe(n,i)}var ot=Number.isNaN||function(i){return typeof i=="number"&&i!==i};function zi(n,i){return!!(n===i||ot(n)&&ot(i))}function Di(n,i){if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!zi(n[a],i[a]))return!1;return!0}function Le(n,i){i===void 0&&(i=Di);var a,u=[],d,g=!1;function m(){for(var o=[],w=0;w<arguments.length;w++)o[w]=arguments[w];return g&&a===this&&i(o,u)||(d=n.apply(this,o),g=!0,a=this,u=o),d}return m}var bi=typeof performance=="object"&&typeof performance.now=="function",at=bi?function(){return performance.now()}:function(){return Date.now()};function lt(n){cancelAnimationFrame(n.id)}function Oi(n,i){var a=at();function u(){at()-a>=i?n.call(null):d.id=requestAnimationFrame(u)}var d={id:requestAnimationFrame(u)};return d}var Re=-1;function ct(n){if(n===void 0&&(n=!1),Re===-1||n){var i=document.createElement("div"),a=i.style;a.width="50px",a.height="50px",a.overflow="scroll",document.body.appendChild(i),Re=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return Re}var ce=null;function ut(n){if(n===void 0&&(n=!1),ce===null||n){var i=document.createElement("div"),a=i.style;a.width="50px",a.height="50px",a.overflow="scroll",a.direction="rtl";var u=document.createElement("div"),d=u.style;return d.width="100px",d.height="100px",i.appendChild(u),document.body.appendChild(i),i.scrollLeft>0?ce="positive-descending":(i.scrollLeft=1,i.scrollLeft===0?ce="negative":ce="positive-ascending"),document.body.removeChild(i),ce}return ce}var Bi=150,Ci=function(i,a){return i};function Li(n){var i,a=n.getItemOffset,u=n.getEstimatedTotalSize,d=n.getItemSize,g=n.getOffsetForIndexAndAlignment,m=n.getStartIndexForOffset,o=n.getStopIndexForStartIndex,w=n.initInstanceProps,T=n.shouldResetStyleCacheOnItemSizeChange,N=n.validateProps;return i=function(j){Si(x,j);function x(E){var h;return h=j.call(this,E)||this,h._instanceProps=w(h.props,st(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:st(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Le(function(_,I,M,v){return h.props.onItemsRendered({overscanStartIndex:_,overscanStopIndex:I,visibleStartIndex:M,visibleStopIndex:v})}),h._callOnScroll=void 0,h._callOnScroll=Le(function(_,I,M){return h.props.onScroll({scrollDirection:_,scrollOffset:I,scrollUpdateWasRequested:M})}),h._getItemStyle=void 0,h._getItemStyle=function(_){var I=h.props,M=I.direction,v=I.itemSize,D=I.layout,S=h._getItemStyleCache(T&&v,T&&D,T&&M),O;if(S.hasOwnProperty(_))O=S[_];else{var U=a(h.props,_,h._instanceProps),Y=d(h.props,_,h._instanceProps),W=M==="horizontal"||D==="horizontal",ne=M==="rtl",se=W?U:0;S[_]=O={position:"absolute",left:ne?void 0:se,right:ne?se:void 0,top:W?0:U,height:W?"100%":Y,width:W?Y:"100%"}}return O},h._getItemStyleCache=void 0,h._getItemStyleCache=Le(function(_,I,M){return{}}),h._onScrollHorizontal=function(_){var I=_.currentTarget,M=I.clientWidth,v=I.scrollLeft,D=I.scrollWidth;h.setState(function(S){if(S.scrollOffset===v)return null;var O=h.props.direction,U=v;if(O==="rtl")switch(ut()){case"negative":U=-v;break;case"positive-descending":U=D-M-v;break}return U=Math.max(0,Math.min(U,D-M)),{isScrolling:!0,scrollDirection:S.scrollOffset<v?"forward":"backward",scrollOffset:U,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(_){var I=_.currentTarget,M=I.clientHeight,v=I.scrollHeight,D=I.scrollTop;h.setState(function(S){if(S.scrollOffset===D)return null;var O=Math.max(0,Math.min(D,v-M));return{isScrolling:!0,scrollDirection:S.scrollOffset<O?"forward":"backward",scrollOffset:O,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(_){var I=h.props.outerRef;h._outerRef=_,typeof I=="function"?I(_):I!=null&&typeof I=="object"&&I.hasOwnProperty("current")&&(I.current=_)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&<(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=Oi(h._resetIsScrolling,Bi)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}x.getDerivedStateFromProps=function(h,_){return Ri(h,_),N(h),null};var A=x.prototype;return A.scrollTo=function(h){h=Math.max(0,h),this.setState(function(_){return _.scrollOffset===h?null:{scrollDirection:_.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},A.scrollToItem=function(h,_){_===void 0&&(_="auto");var I=this.props,M=I.itemCount,v=I.layout,D=this.state.scrollOffset;h=Math.max(0,Math.min(h,M-1));var S=0;if(this._outerRef){var O=this._outerRef;v==="vertical"?S=O.scrollWidth>O.clientWidth?ct():0:S=O.scrollHeight>O.clientHeight?ct():0}this.scrollTo(g(this.props,h,_,D,this._instanceProps,S))},A.componentDidMount=function(){var h=this.props,_=h.direction,I=h.initialScrollOffset,M=h.layout;if(typeof I=="number"&&this._outerRef!=null){var v=this._outerRef;_==="horizontal"||M==="horizontal"?v.scrollLeft=I:v.scrollTop=I}this._callPropsCallbacks()},A.componentDidUpdate=function(){var h=this.props,_=h.direction,I=h.layout,M=this.state,v=M.scrollOffset,D=M.scrollUpdateWasRequested;if(D&&this._outerRef!=null){var S=this._outerRef;if(_==="horizontal"||I==="horizontal")if(_==="rtl")switch(ut()){case"negative":S.scrollLeft=-v;break;case"positive-ascending":S.scrollLeft=v;break;default:var O=S.clientWidth,U=S.scrollWidth;S.scrollLeft=U-O-v;break}else S.scrollLeft=v;else S.scrollTop=v}this._callPropsCallbacks()},A.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&<(this._resetIsScrollingTimeoutId)},A.render=function(){var h=this.props,_=h.children,I=h.className,M=h.direction,v=h.height,D=h.innerRef,S=h.innerElementType,O=h.innerTagName,U=h.itemCount,Y=h.itemData,W=h.itemKey,ne=W===void 0?Ci:W,se=h.layout,Ne=h.outerElementType,je=h.outerTagName,ge=h.style,xe=h.useIsScrolling,ve=h.width,Ie=this.state.isScrolling,fe=M==="horizontal"||se==="horizontal",Se=fe?this._onScrollHorizontal:this._onScrollVertical,we=this._getRangeToRender(),F=we[0],Q=we[1],he=[];if(U>0)for(var ee=F;ee<=Q;ee++)he.push($.createElement(_,{data:Y,key:ne(ee,Y),index:ee,isScrolling:xe?Ie:void 0,style:this._getItemStyle(ee)}));var pe=u(this.props,this._instanceProps);return $.createElement(Ne||je||"div",{className:I,onScroll:Se,ref:this._outerRefSetter,style:Pe({position:"relative",height:v,width:ve,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:M},ge)},$.createElement(S||O||"div",{children:he,ref:D,style:{height:fe?"100%":pe,pointerEvents:Ie?"none":void 0,width:fe?pe:"100%"}}))},A._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var _=this._getRangeToRender(),I=_[0],M=_[1],v=_[2],D=_[3];this._callOnItemsRendered(I,M,v,D)}}if(typeof this.props.onScroll=="function"){var S=this.state,O=S.scrollDirection,U=S.scrollOffset,Y=S.scrollUpdateWasRequested;this._callOnScroll(O,U,Y)}},A._getRangeToRender=function(){var h=this.props,_=h.itemCount,I=h.overscanCount,M=this.state,v=M.isScrolling,D=M.scrollDirection,S=M.scrollOffset;if(_===0)return[0,0,0,0];var O=m(this.props,S,this._instanceProps),U=o(this.props,O,S,this._instanceProps),Y=!v||D==="backward"?Math.max(1,I):1,W=!v||D==="forward"?Math.max(1,I):1;return[Math.max(0,O-Y),Math.max(0,Math.min(_-1,U+W)),O,U]},x}($.PureComponent),i.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},i}var Ri=function(i,a){i.children,i.direction,i.height,i.layout,i.innerTagName,i.outerTagName,i.width,a.instance},ki=Li({getItemOffset:function(i,a){var u=i.itemSize;return a*u},getItemSize:function(i,a){var u=i.itemSize;return u},getEstimatedTotalSize:function(i){var a=i.itemCount,u=i.itemSize;return u*a},getOffsetForIndexAndAlignment:function(i,a,u,d,g,m){var o=i.direction,w=i.height,T=i.itemCount,N=i.itemSize,j=i.layout,x=i.width,A=o==="horizontal"||j==="horizontal",E=A?x:w,h=Math.max(0,T*N-E),_=Math.min(h,a*N),I=Math.max(0,a*N-E+N+m);switch(u==="smart"&&(d>=I-E&&d<=_+E?u="auto":u="center"),u){case"start":return _;case"end":return I;case"center":{var M=Math.round(I+(_-I)/2);return M<Math.ceil(E/2)?0:M>h+Math.floor(E/2)?h:M}case"auto":default:return d>=I&&d<=_?d:d<I?I:_}},getStartIndexForOffset:function(i,a){var u=i.itemCount,d=i.itemSize;return Math.max(0,Math.min(u-1,Math.floor(a/d)))},getStopIndexForStartIndex:function(i,a,u){var d=i.direction,g=i.height,m=i.itemCount,o=i.itemSize,w=i.layout,T=i.width,N=d==="horizontal"||w==="horizontal",j=a*o,x=N?T:g,A=Math.ceil((x+u-j)/o);return Math.max(0,Math.min(m-1,a+A-1))},initInstanceProps:function(i){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(i){i.itemSize}});function Ui(n){var i=n.lastRenderedStartIndex,a=n.lastRenderedStopIndex,u=n.startIndex,d=n.stopIndex;return!(u>a||d<i)}function Fi(n){for(var i=n.isItemLoaded,a=n.itemCount,u=n.minimumBatchSize,d=n.startIndex,g=n.stopIndex,m=[],o=null,w=null,T=d;T<=g;T++){var N=i(T);N?w!==null&&(m.push(o,w),o=w=null):(w=T,o===null&&(o=T))}if(w!==null){for(var j=Math.min(Math.max(w,o+u-1),a-1),x=w+1;x<=j&&!i(x);x++)w=x;m.push(o,w)}if(m.length)for(;m[1]-m[0]+1<u&&m[0]>0;){var A=m[0]-1;if(!i(A))m[0]=A;else break}return m}var $i=function(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")},Qi=function(){function n(i,a){for(var u=0;u<a.length;u++){var d=a[u];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}return function(i,a,u){return a&&n(i.prototype,a),u&&n(i,u),i}}(),Pi=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(n,i):n.__proto__=i)},dt=function(n,i){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:n},qi=function(n){Pi(i,n);function i(){var a,u,d,g;$i(this,i);for(var m=arguments.length,o=Array(m),w=0;w<m;w++)o[w]=arguments[w];return g=(u=(d=dt(this,(a=i.__proto__||Object.getPrototypeOf(i)).call.apply(a,[this].concat(o))),d),d._lastRenderedStartIndex=-1,d._lastRenderedStopIndex=-1,d._memoizedUnloadedRanges=[],d._onItemsRendered=function(T){var N=T.visibleStartIndex,j=T.visibleStopIndex;d._lastRenderedStartIndex=N,d._lastRenderedStopIndex=j,d._ensureRowsLoaded(N,j)},d._setRef=function(T){d._listRef=T},u),dt(d,g)}return Qi(i,[{key:"resetloadMoreItemsCache",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],u&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var u=this.props.children;return u({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(u,d){var g=this.props,m=g.isItemLoaded,o=g.itemCount,w=g.minimumBatchSize,T=w===void 0?10:w,N=g.threshold,j=N===void 0?15:N,x=Fi({isItemLoaded:m,itemCount:o,minimumBatchSize:T,startIndex:Math.max(0,u-j),stopIndex:Math.min(o-1,d+j)});(this._memoizedUnloadedRanges.length!==x.length||this._memoizedUnloadedRanges.some(function(A,E){return x[E]!==A}))&&(this._memoizedUnloadedRanges=x,this._loadUnloadedRanges(x))}},{key:"_loadUnloadedRanges",value:function(u){for(var d=this,g=this.props.loadMoreItems||this.props.loadMoreRows,m=function(T){var N=u[T],j=u[T+1],x=g(N,j);x!=null&&x.then(function(){if(Ui({lastRenderedStartIndex:d._lastRenderedStartIndex,lastRenderedStopIndex:d._lastRenderedStopIndex,startIndex:N,stopIndex:j})){if(d._listRef==null)return;typeof d._listRef.resetAfterIndex=="function"?d._listRef.resetAfterIndex(N,!0):(typeof d._listRef._getItemStyleCache=="function"&&d._listRef._getItemStyleCache(-1),d._listRef.forceUpdate())}})},o=0;o<u.length;o+=2)m(o)}}]),i}($.PureComponent);const Yi=()=>y.e1,Wi=y.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Vi=y.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Hi=y.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),Gi=y.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Zi=y.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Ji=y.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Ki=y.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Xi=y.styled_default(Yi())({name:"x",class:"x13mk3z6",propsAsIs:!0}),en=({rank:n,avatar:i,name:a,points:u,isCurrentUser:d,openItemDetail:g,style:m})=>c.jsxs(Wi,{onClick:g,style:m,children:[c.jsx(Vi,{children:n||0}),c.jsxs(Zi,{children:[i?c.jsx(Hi,{alt:"leaderboard-item-avatar",src:i}):c.jsx(Gi,{children:Ee.e(a||"")}),c.jsxs(Ji,{children:[c.jsx(Ki,{children:a||""}),d&&c.jsx(Xi,{name:"icon-star"})]})]}),c.jsx("div",{children:Ee.a(u)})]}),tn=({items:n,openItemDetail:i,fetchMore:a})=>c.jsx(vi,{children:({width:u,height:d})=>c.jsx(qi,{isItemLoaded:g=>g<n.length,itemCount:n.length+1,loadMoreItems:a,children:({onItemsRendered:g,ref:m})=>c.jsx(ki,{itemSize:56,onItemsRendered:g,ref:m,itemCount:n.length,width:u,height:d,children:({index:o,style:w})=>c.jsx(en,{style:{...w,maxHeight:48},...n[o],openItemDetail:()=>i(n[o].userId)},n[o].userId)})})}),rn=({leaderboardList:n,openUser:i})=>{const{data:a}=ie.useStore(n.$store);return c.jsx(tn,{fetchMore:n.fetchMore,items:a,openItemDetail:i})};const nn=y.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),sn=y.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),on=({disabled:n,variant:i="primary",onClick:a,children:u,...d})=>c.jsx(nn,{onClick:a,disabled:n,"data-variant":i,...d,children:c.jsx(sn,{children:u})});const an=()=>y.e1,ln=()=>y.e1,cn=y.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),un=y.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),dn=y.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),fn=y.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),ke=y.styled_default(an())({name:"c",class:"c6fk2ph",propsAsIs:!0}),hn=y.styled_default(ln())({name:"d",class:"d1rdm136",propsAsIs:!0}),pn=y.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),mn=y.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),yn={[C.PickHistoryStatus.LOST]:c.jsx(ke,{name:"icon-cross"}),[C.PickHistoryStatus.WON]:c.jsx(ke,{name:"icon-check"}),[C.PickHistoryStatus.UNSET]:void 0,[C.PickHistoryStatus.DNP]:c.jsx(ke,{name:"icon-arrow"})},gn=({questionId:n,questionType:i,questionStatus:a,subject:u,openForVoting:d,openQuestion:g,status:m})=>{const o=V.o[i],w=yn[m];return o?c.jsxs(cn,{onClick:()=>g==null?void 0:g(n),children:[c.jsxs(mn,{children:[c.jsxs(un,{children:[c.jsx(hn,{name:o.iconName}),c.jsxs(pn,{children:[o.label,i===C.QuestionType.TRIVIA&&a===C.QuestionStatus.RESOLVED&&" • Expired"]})]}),c.jsx(dn,{children:u||""})]}),c.jsx(fn,{children:w||(d?c.jsx(on,{children:"Play"}):null)})]}):null};const xn=y.styled_default("div")({name:"e",class:"e1jcgove",propsAsIs:!1}),In=y.styled_default("div")({name:"t",class:"t1bwp7hh",propsAsIs:!1}),wn=y.styled_default("div")({name:"i",class:"i1xav4cl",propsAsIs:!1}),_n=y.styled_default("h3")({name:"n",class:"n3qb30y",propsAsIs:!1}),Mn=y.styled_default("div")({name:"a",class:"ap5d9g7",propsAsIs:!1}),An=y.styled_default("button")({name:"l",class:"lvdbmlu",propsAsIs:!1}),En=({title:n,instantView:i,openInsight:a,questionId:u})=>{const d=new Date,g=d.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),m=d.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return c.jsxs(xn,{children:[c.jsxs(In,{children:[g,"・",m]}),(i==null?void 0:i.video)&&c.jsx(V.w,{source:i.video.url,poster:i.video.thumbnailUrl}),c.jsxs(wn,{children:[c.jsx(_n,{children:(i==null?void 0:i.heading)||n}),c.jsx(Mn,{children:i==null?void 0:i.body}),a&&c.jsx(An,{onClick:()=>a(u),children:"View Insight"})]})]})};const Tn=y.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),Nn=({questions:n,openQuestion:i})=>c.jsx(Tn,{children:n==null?void 0:n.map(a=>{var u,d;if(a.type==="question"&&((u=a.attributes)==null?void 0:u.attributes.case)==="question"){const g=a.attributes.attributes.value;return c.jsx(gn,{openQuestion:i,...g},g.questionId)}if(a.type==="insight"&&((d=a.attributes)==null?void 0:d.attributes.case)==="insight"){const g=a.attributes.attributes.value;return c.jsx(En,{openInsight:i,...g},g.questionId)}return null})}),jn=({store:n,openQuestion:i})=>{const a=ie.useStore(n);return a!=null&&a.data?c.jsx(Nn,{openQuestion:i,questions:a.data}):c.jsx("div",{children:"wait questions..."})},vn=({userSummary:n})=>{var i;const a=ie.useStore(n.getStore());return(i=a.data)!=null&&i.summary?c.jsx(pt,{...a.data.summary,...a.data.percentage}):c.jsx("div",{children:"wait user..."})},Sn=({gamification:n})=>{const[i,a]=$.useState(ye.HOME);return c.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[c.jsxs(V.e,{children:[c.jsx(mi,{activePage:i,toggleActivePage:a}),i===ye.HOME&&c.jsx(vn,{userSummary:n.userSummary})]}),i===ye.HOME&&c.jsx(V.n,{children:c.jsx(jn,{openQuestion:n.openQuestion,store:n.feedList.getStore()})}),i===ye.LEADERBOARD&&c.jsx(V.n,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:c.jsx(rn,{openUser:n.openUser,leaderboardList:n.leaderboardList})})]})};const zn=()=>V.f,ft=y.styled_default(zn())({name:"m",class:"m1ph66cs",propsAsIs:!0}),Dn=y.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),At=({gamification:n,className:i})=>{const a=ie.useStore(n.openedQuestion.$store),u=ie.useStore(n.openedUser);return c.jsxs(c.Fragment,{children:[a&&c.jsx(ft,{className:i,children:c.jsx(ui,{gamification:n})}),u&&c.jsx(ft,{className:i,children:c.jsxs(Dn,{children:[c.jsx(ht,{label:"Friend's Rank",close:n.closeUser}),c.jsx(V.e,{children:c.jsx(pt,{...u})})]})}),c.jsx(V.r,{className:i,"data-nav":"true",children:c.jsx(Sn,{gamification:n})})]})};exports.GamificationOverlay=At;exports.default=At;
|
package/lib/masters-13b0f21d.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),v=require("./index-89c19a6e.cjs"),o=require("react"),u=require("@streamlayer/sdk-web-types"),m=require("@nanostores/react"),h=require("@streamlayer/sdk-web-interfaces"),l=require("./index-6b61558d.cjs"),g=require("@streamlayer/sdk-web-notifications"),O=({feature:e,sdk:t,children:a,className:n})=>{const i=m.useStore(e.status),{slStreamId:r}=m.useStore(t.sdkStore);return r!=null&&r.loading?s.jsx("div",{className:n,children:"event is loading..."}):r!=null&&r.data?i!==h.FeatureStatus.Ready?s.jsx("div",{className:n,children:"wait feature..."}):a:s.jsx("div",{className:n,children:"event is forbidden..."})},w=o.lazy(()=>Promise.resolve().then(()=>require("./index-a4c9d828.cjs"))),E=({sdk:e,feature:t,className:a})=>{const n=o.useMemo(()=>t&&t.featureConfig.get().type===u.FeatureType.GAMES?s.jsx(O,{className:a,sdk:e,feature:t,children:s.jsx(w,{className:a,gamification:t,sdk:e})}):null,[e,t,a]);return s.jsx(o.Suspense,{fallback:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:n})};const F=l.styled_default("button")({name:"e",class:"enu64b2",propsAsIs:!1}),L=l.styled_default("span")({name:"t",class:"tw2meku",propsAsIs:!1}),q=l.styled_default("span")({name:"a",class:"aka8vam",propsAsIs:!1}),_=({disabled:e,active:t,onClick:a,label:n,icon:i})=>s.jsx(F,{onClick:a,disabled:e,"data-selected":t,children:s.jsxs(s.Fragment,{children:[i&&s.jsx(L,{children:i}),s.jsx(q,{children:n})]})});const R=()=>l.e1,z=l.styled_default(R())({name:"a",class:"a10lggiw",propsAsIs:!0}),j="channels",Q=e=>{var t;return s.jsx(_,{...e,id:"channels",label:"Channels",icon:s.jsx(z,{name:"icon-btn-channels","data-selected":(t=e.active)==null?void 0:t.toString()})})};const P=()=>l.e1,D=l.styled_default(P())({name:"d",class:"d1x5s8ie",propsAsIs:!0}),f="featuredGroups",M=e=>{var t;return s.jsx(_,{...e,label:"FG+",id:"featuredGroups",icon:s.jsx(D,{name:"icon-btn-feature-groups","data-selected":(t=e.active)==null?void 0:t.toString()})})};const G=()=>l.e1,U=l.styled_default(G())({name:"n",class:"ntav86o",propsAsIs:!0}),b="leaderboard",W=e=>{var t;return s.jsx(_,{...e,label:"Leader Board",id:"leaderboard",icon:s.jsx(U,{name:"icon-btn-leaderboard","data-selected":(t=e.active)==null?void 0:t.toString()})})};const B=l.styled_default("div")({name:"n",class:"n1rlvhvz",propsAsIs:!1}),K=({children:e,className:t})=>s.jsx(B,{className:t,children:e});const V=()=>K,Y=l.styled_default(V())({name:"n",class:"n9bnom",propsAsIs:!0}),H=({activeOverlay:e,setActiveOverlay:t,sdkReady:a,className:n})=>s.jsxs(Y,{className:n,children:[s.jsx(Q,{active:e===j,onClick:()=>t(j)}),s.jsx(M,{active:e===f,disabled:!a,onClick:()=>{t(f)}}),s.jsx(W,{active:e===b,onClick:()=>t(b)})]}),A={[u.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.UNSET]:void 0,[u.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[u.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[u.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}};const J=l.styled_default("div")({name:"i",class:"i1bwjtdb",propsAsIs:!1}),X=l.styled_default("video")({name:"e",class:"enb7moc",propsAsIs:!1}),Z=l.styled_default("img")({name:"r",class:"r1ws5lyh",propsAsIs:!1}),ee=l.styled_default("div")({name:"s",class:"soibf55",propsAsIs:!1}),N=({poster:e,source:t})=>{const a=o.useRef(null),[n,i]=o.useState(!1),[r,c]=o.useState(!0);return s.jsxs(J,{onClick:()=>{const d=a==null?void 0:a.current;d&&i(y=>y?(d.pause(),!1):(d.play(),c(!1),!0))},children:[s.jsx(X,{ref:a,src:t,onEnded:()=>{var d;(d=a==null?void 0:a.current)==null||d.load(),i(!1),c(!0)},style:{visibility:r?"hidden":"visible"}}),s.jsx(Z,{src:e,style:{visibility:r?"visible":"hidden"}}),s.jsx(ee,{children:!n&&s.jsx(l.e1,{name:"icon-play"})})]})};const se=l.styled_default("div")({name:"r",class:"rcr31jh",propsAsIs:!1}),te=l.styled_default("div")({name:"t",class:"thj4z8w",propsAsIs:!1}),ae=l.styled_default("h3")({name:"i",class:"i1oks4sz",propsAsIs:!1}),ne=l.styled_default("div")({name:"n",class:"n18s3mno",propsAsIs:!1}),le=l.styled_default("button")({name:"l",class:"lc8mqwv",propsAsIs:!1}),re=({video:e,heading:t,body:a,action:n})=>s.jsxs(se,{children:[e&&s.jsx(N,{source:e.url,poster:e.thumbnailUrl}),s.jsxs(te,{children:[s.jsx(ae,{children:t}),s.jsx(ne,{children:a}),n&&s.jsx(le,{onClick:n,children:"View Insight"})]})]});const ie=()=>l.e1,de=()=>l.e1,ce=l.styled_default("div")({name:"p",class:"p16oo5uk",propsAsIs:!1}),oe=l.styled_default("div")({name:"a",class:"a18c5k3h",propsAsIs:!1}),ue=l.styled_default(ie())({name:"c",class:"czv5t8k",propsAsIs:!0}),pe=l.styled_default("div")({name:"s",class:"s1wp1emp",propsAsIs:!1}),fe=l.styled_default(de())({name:"l",class:"l1nz0q6x",propsAsIs:!0}),ye=l.styled_default("span")({name:"g",class:"g1jhb9lu",propsAsIs:!1}),me=l.styled_default("div")({name:"d",class:"ds6gfsv",propsAsIs:!1}),xe=l.styled_default("button")({name:"x",class:"xkzz16s",propsAsIs:!1}),k=({close:e,action:t,data:{questionType:a,question:n,insight:i}})=>{const r=A[a];return r?s.jsxs(ce,{children:[s.jsx(oe,{onClick:e,children:s.jsx(ue,{name:"icon-cross"})}),s.jsxs(pe,{children:[s.jsx(fe,{name:r.iconName}),s.jsx(ye,{children:r.label})]}),a===u.QuestionType.FACTOID?s.jsx(re,{...i,action:t}):s.jsx(me,{children:n==null?void 0:n.title}),a!==u.QuestionType.FACTOID&&s.jsx(xe,{onClick:t,children:"Answer"})]}):null};const ve=l.styled_default("div")({name:"s",class:"s1aopxp8",propsAsIs:!1}),he="c1t0h6s",$=({children:e,style:t,className:a,hiding:n})=>s.jsx(ve,{style:t,className:l.cx_default(a,n&&he),children:e});const je=()=>$,I=l.styled_default(je())({name:"d",class:"d1qqtt3e",propsAsIs:!0}),be=({sdk:e})=>{const t=e.getNotificationsStore(),a=m.useStore(t),n=o.useMemo(()=>{if(!(a!=null&&a.size))return null;for(const i of a.values())if(i.type===g.NotificationType.ONBOARDING)return i;return a.values().next().value},[a]);return(n==null?void 0:n.type)===g.NotificationType.QUESTION?s.jsx(I,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(k,{...n})})}):(n==null?void 0:n.type)===g.NotificationType.QUESTION_RESOLVED?s.jsx(I,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(k,{...n})})}):null};const ge=()=>T,Se=l.styled_default("div")({name:"i",class:"idhrx8x",propsAsIs:!1}),S=l.styled_default("div")({name:"r",class:"r1k6v4ep",propsAsIs:!1}),T=l.styled_default("div")({name:"n",class:"n1v8kucd",propsAsIs:!1}),_e=l.styled_default(ge())({name:"e",class:"e16yw7z1",propsAsIs:!0}),ke=e=>{const[t,a]=o.useState(!1),n=m.useStore(e.status),{data:i}=m.useStore(e.getUserStore()),r=n==="ready",[c,d]=o.useState(f),y=o.useCallback((p,x)=>{d(x),x===f?(p&&e.createEventSession(p),e.openFeature(u.FeatureType.GAMES)):e.closeFeature()},[e]);return o.useEffect(()=>{!r&&c===f&&(d(j),e.closeFeature())},[r,c,e]),{sdkEnabled:t,sdkReady:r,activeOverlay:c,activateAndLoadOverlay:y,enableSdk:p=>{e.initializeApp().then(({enabled:x,err:C})=>{if(a(!0),C){y(p,j);return}if(x){y(p,f);return}})},disableSdk:()=>{a(!1),e.disableApp()},isLogged:!!i}},Ie=e=>{const t=m.useStore(e.getActiveFeature()),a=m.useStore(e.streamStore()),[n,i]=o.useState(null);return o.useEffect(()=>{const r=e.getFeatures();if(t)for(const[c,d]of r)c===t?d.status.get()===h.FeatureStatus.Suspended&&(d.enable(),i(d)):d.status.get()===h.FeatureStatus.Ready&&d.disable();else{for(const[,c]of r)c.status.get()===h.FeatureStatus.Ready&&c.disable();i(null)}return()=>{for(const[,c]of r)c.status.get()===h.FeatureStatus.Ready&&c.disable()}},[t,e,a]),[t,n]},Ae=({sdk:e,className:t})=>{const[,a]=Ie(e);return s.jsx(E,{className:t,feature:a,sdk:e})},Ne=({sdk:e,overlays:t,children:a})=>{const{sdkEnabled:n,sdkReady:i,activeOverlay:r,activateAndLoadOverlay:c,enableSdk:d,disableSdk:y,isLogged:p}=ke(e);return s.jsxs(Se,{children:[n&&s.jsx(H,{sdkReady:i,activeOverlay:r,className:v.f,setActiveOverlay:x=>c("",x)}),n&&s.jsx(be,{sdk:e}),s.jsx(S,{"data-nav":n.toString(),style:{display:!n||r===j?"block":"none"},children:a&&a({enableSdk:d,disableSdk:y})}),s.jsx(S,{"data-nav":n.toString(),style:{display:r===b?"block":"none"},children:t&&r===b&&t[r]}),p&&n&&r===f&&s.jsx(Ae,{className:v.f,sdk:e}),!p&&n&&r===f&&s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})},$e=({sdkKey:e,plugins:t,children:a,production:n=!0})=>s.jsx(v.StreamLayerProvider,{sdkKey:e,plugins:t,production:n,autoEnable:!1,children:a}),Te=({children:e,overlays:t})=>{const{sdk:a,status:n}=o.useContext(v.StreamLayerContext);if(n===v.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return a?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(v.p,{style:{height:"100%"},children:s.jsx(Ne,{sdk:a,overlays:t,children:e})})}):e({})};exports.MastersStreamLayerProvider=$e;exports.MastersStreamLayerSDKReact=Te;exports.e=_e;exports.f=$;exports.n=T;exports.o=A;exports.r=S;exports.w=N;
|